dd
This commit is contained in:
@@ -10,16 +10,16 @@ export const HeroSet = {
|
||||
max_skill: "精准打击", skill_uuid: 9001, max_skill_uuid: 2003, word: "守护", info: "自身护盾", atktype: 1,
|
||||
},
|
||||
9011: {
|
||||
uuid: 9004, path: "m1", type: 3, level: 1,cost:2, name: "冰法", atk: 15, hp: 20, atk_dis: 300, atk_cd: 2.5, power: 0, power_max: 10, speed: 30,
|
||||
uuid: 9004, path: "m1", type: 3, level: 1,cost:2, name: "冰法", atk: 15, hp: 20, atk_dis: 260, atk_cd: 2.5, power: 0, power_max: 10, speed: 30,
|
||||
max_skill: "寒冰箭", skill_uuid: 9002, max_skill_uuid: 1002, word: "守护", info: "自身护盾", atktype: 1,
|
||||
},
|
||||
9021: {
|
||||
uuid: 9006, path: "m3", type: 3, level: 1,cost:2, name: "火法", atk: 10, hp: 20, atk_dis: 300, atk_cd: 2, power: 0, power_max: 10, speed: 30,
|
||||
uuid: 9006, path: "m3", type: 3, level: 1,cost:2, name: "火法", atk: 10, hp: 20, atk_dis: 260, atk_cd: 2, power: 0, power_max: 10, speed: 30,
|
||||
max_skill: "火球术", skill_uuid: 9002, max_skill_uuid: 1001, word: "守护", info: "自身护盾", atktype: 2
|
||||
},
|
||||
|
||||
9031: {
|
||||
uuid: 9005, path: "m2", type: 3, level: 1,cost:2, name: "牧师", atk: 3, hp: 20, atk_dis: 300, atk_cd: 2, power: 0, power_max: 10, speed: 30,
|
||||
uuid: 9005, path: "m2", type: 3, level: 1,cost:2, name: "牧师", atk: 3, hp: 20, atk_dis: 260, atk_cd: 2, power: 0, power_max: 10, speed: 30,
|
||||
max_skill: "治愈术", skill_uuid: 9002, max_skill_uuid: 2001, word: "守护", info: "自身护盾", atktype: 2
|
||||
},
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { _decorator ,Vec3,v3} from "cc";
|
||||
import { _decorator ,Vec3,v3, Prefab, instantiate,Node} from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer";
|
||||
@@ -40,6 +40,11 @@ export class MapMonsterComp extends CCComp {
|
||||
hero_start_ys:any[] = [35,-35];
|
||||
mon_index:number = 0
|
||||
hero_index:number = 0
|
||||
|
||||
|
||||
@property(Node)
|
||||
start_p: Node = null;
|
||||
|
||||
onLoad(){
|
||||
// 监听全局事件
|
||||
oops.message.on("other_add_monster", this.on_other_add_monster, this);
|
||||
@@ -49,6 +54,9 @@ export class MapMonsterComp extends CCComp {
|
||||
// this.scene = this.getComponent(MapViewScene);
|
||||
// this.scene.node.active = true
|
||||
// this.scene = this.getComponent(MapViewScene);
|
||||
var scene = smc.map.MapView.scene;
|
||||
this.start_p.parent=scene.mapLayer!.node!
|
||||
this.set_start_point()
|
||||
let num =RandomManager.instance.getRandomByObjectList(MissionNum,1)
|
||||
this.cur_mission = num[0]
|
||||
this.mission_list = MonsetList[this.cur_mission]
|
||||
@@ -58,6 +66,7 @@ export class MapMonsterComp extends CCComp {
|
||||
this.load_role()
|
||||
|
||||
}
|
||||
|
||||
protected update(dt: number): void {
|
||||
if(smc.vm_data.game_over){
|
||||
return
|
||||
@@ -79,6 +88,9 @@ export class MapMonsterComp extends CCComp {
|
||||
// }
|
||||
// this.shuaxin(dt)
|
||||
}
|
||||
set_start_point(){
|
||||
this.start_p.setPosition(-240,BoxSet.GAME_LINE+this.start_ys[this.hero_index]+30,0)
|
||||
}
|
||||
check_mon_count(){
|
||||
let count = 0;
|
||||
let list = ecs.query(ecs.allOf(MonModelComp));
|
||||
@@ -149,7 +161,7 @@ export class MapMonsterComp extends CCComp {
|
||||
private addHero(uuid:number=1001) {
|
||||
let hero = ecs.getEntity<Hero>(Hero);
|
||||
var scene = smc.map.MapView.scene;
|
||||
let pos:Vec3 = v3(-280,BoxSet.GAME_LINE+this.start_ys[this.hero_index]);
|
||||
let pos:Vec3 = v3(-240,BoxSet.GAME_LINE+this.start_ys[this.hero_index]);
|
||||
let monster_layer = scene.entityLayer!.node!
|
||||
let scale = 1
|
||||
hero.load(pos,scale,uuid,monster_layer);
|
||||
@@ -157,6 +169,7 @@ export class MapMonsterComp extends CCComp {
|
||||
if(this.hero_index > 2){
|
||||
this.hero_index = 0
|
||||
}
|
||||
this.set_start_point()
|
||||
}
|
||||
monster_refresh(){
|
||||
if (this.setp_num <= 0){
|
||||
|
||||
Reference in New Issue
Block a user