diff --git a/assets/script/game/Role/RoleViewComp.ts b/assets/script/game/Role/RoleViewComp.ts index d3e19b63..ed82e57f 100644 --- a/assets/script/game/Role/RoleViewComp.ts +++ b/assets/script/game/Role/RoleViewComp.ts @@ -93,7 +93,7 @@ export class RoleViewComp extends CCComp { is_atking:boolean = false; onLoad() { - this.BoxRang = this.node.getChildByName("range_box"); + // this.BoxRang = this.node.getChildByName("range_box"); this.as = this.node.getComponent(RoleSpine); } @@ -110,8 +110,8 @@ export class RoleViewComp extends CCComp { - this.BoxRang.getComponent(RoleRangComp).box_group = this.box_group; - this.BoxRang.getComponent(RoleRangComp).atk_range = this.atk_range + // this.BoxRang.getComponent(RoleRangComp).box_group = this.box_group; + // this.BoxRang.getComponent(RoleRangComp).atk_range = this.atk_range // this.BoxRang.getComponent(RoleRangComp).offset_x = this.scale*smc.skills[this.skill_uuid].dis/3; // console.log("monseter ",this.BoxRang); diff --git a/assets/script/game/hero/Hero.ts b/assets/script/game/hero/Hero.ts index ed87c9e9..e584e8d9 100644 --- a/assets/script/game/hero/Hero.ts +++ b/assets/script/game/hero/Hero.ts @@ -48,8 +48,8 @@ export class Hero extends ecs.Entity { // var as = node.getComponent(HeroSpine); // let ratio=this.set_ratio(uuid); // node.setScale(node.scale.x*scale*ratio, node.scale.y*ratio, 0); - pos.x=smc.Role.RoleView.node.position.x+pos.x; - pos.y=smc.Role.RoleView.node.position.y+pos.y; + // pos.x=smc.Role.RoleView.node.position.x+pos.x; + // pos.y=smc.Role.RoleView.node.position.y+pos.y; node.setPosition(pos) this.hero_init(uuid,node,index) oops.message.dispatchEvent("hero_load",this) diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index bb097ecc..87199cd6 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -185,12 +185,12 @@ export class HeroViewComp extends CCComp { if(this.stop_cd > 0){ return } - if (this.scale === 1 && this.node.position.x >= BoxSet.MONSTER_START-150) { + if (this.node.position.x >= 250-this.atk_dis) { return; } - if(this.enemy){ - return - } + // if(this.enemy){ + // return + // } this.node.setPosition(this.node.position.x+dt*this.speed*this.scale, this.node.position.y+dt*this.dir_y, this.node.position.z); } hp_show(){ @@ -407,7 +407,7 @@ export class HeroViewComp extends CCComp { if(this.hp <= 0){ this.dead(); this.is_dead = true; - smc.role_heros[this.role_heros_index].eid == 0 + // smc.role_heros[this.role_heros_index].eid == 0 setTimeout(() => { this.ent.destroy(); }, 15); diff --git a/assets/script/game/map/MapMonsterComp.ts b/assets/script/game/map/MapMonsterComp.ts index 96282483..e71a102c 100644 --- a/assets/script/game/map/MapMonsterComp.ts +++ b/assets/script/game/map/MapMonsterComp.ts @@ -97,26 +97,12 @@ export class MapMonsterComp extends CCComp { private addHero(uuid:number=1001) { let hero = ecs.getEntity(Hero); var scene = smc.map.MapView.scene; - let oy=RandomManager.instance.getRandomInt(-70,70,1) - let pos = v3(0,0); - let less=0 - let index =0 - for(let i=0; i <= 11;i++){ - if(smc.role_heros[i].eid==0){ - pos=v3(smc.role_heros[i].x,smc.role_heros[i].y) - less += 1 - index = i - smc.role_heros[i].eid=hero.eid - break - } - } - if(less <= 0){ - oops.gui.toast("人数已满"); - return false - } + let oy=RandomManager.instance.getRandomByObjectList(this.start_ys,1) + let pos:Vec3 = v3(-280,BoxSet.GAME_LINE+oy[0]); + let monster_layer = scene.entityLayer!.node! let scale = 1 - hero.load(pos,scale,uuid,monster_layer,index); + hero.load(pos,scale,uuid,monster_layer); } monster_refresh(){ if (this.setp_num <= 0){ diff --git a/assets/script/game/map/MapSkillComp.ts b/assets/script/game/map/MapSkillComp.ts index c3064068..42a5ca28 100644 --- a/assets/script/game/map/MapSkillComp.ts +++ b/assets/script/game/map/MapSkillComp.ts @@ -30,14 +30,14 @@ export class MapSkillComp extends CCComp { } doMonsterLoad(){ - const light = instantiate(this.light); - light.setPosition(BoxSet.MONSTER_START,BoxSet.GAME_LINE); - this.node.addChild(light); + // const light = instantiate(this.light); + // light.setPosition(BoxSet.MONSTER_START,BoxSet.GAME_LINE); + // this.node.addChild(light); } doHeroLoad(){ - const light = instantiate(this.light); - light.setPosition(BoxSet.HERO_START,BoxSet.GAME_LINE,0); - this.node.addChild(light); + // const light = instantiate(this.light); + // light.setPosition(BoxSet.HERO_START,BoxSet.GAME_LINE,0); + // this.node.addChild(light); } useItem(event: string, args: any){ console.log("useItem");