This commit is contained in:
2024-12-11 16:55:06 +08:00
parent eab71044d0
commit de39c74d4a
17 changed files with 3434 additions and 4543 deletions

View File

@@ -21,24 +21,24 @@ export class HeroSelectComp extends CCComp {
start() {
this.mhc_home=this.node.parent.parent.parent.parent.getComponent(MissionHomeComp);
if(smc.vmdata.fight_heros.indexOf(this.h_uuid)>=0){
if(smc.fight_heros.indexOf(this.h_uuid)>=0){
this.show_bg(true)
}else{
this.show_bg(false)
}
}
select(){
if(smc.vmdata.fight_heros.indexOf(this.h_uuid)>=0){
smc.vmdata.fight_heros.splice(smc.vmdata.fight_heros.indexOf(this.h_uuid),1)
if(smc.fight_heros.indexOf(this.h_uuid)>=0){
smc.fight_heros.splice(smc.fight_heros.indexOf(this.h_uuid),1)
this.show_bg(false)
this.mhc_home.cancel_hero(this.h_uuid)
return
}
if(smc.vmdata.fight_heros.length>= 5){
if(smc.fight_heros.length>= 5){
oops.gui.toast("英雄数量不能超过5个")
return
}
smc.vmdata.fight_heros.push(this.h_uuid)
smc.fight_heros.push(this.h_uuid)
this.mhc_home.select_hero(this.h_uuid)
this.show_bg(true)
}

View File

@@ -195,7 +195,7 @@ export class HeroViewComp extends CCComp {
onPostSolve (selfCollider: Collider2D, otherCollider: Collider2D) {
}
update(dt: number){
if(!smc.vmdata.mission.play||smc.vmdata.mission.pause) return
if(!smc.mission.play||smc.mission.pause) return
if(this.is_dead) {
if(!this.in_grave()) this.to_grave()
return
@@ -277,7 +277,7 @@ export class HeroViewComp extends CCComp {
}
//移动
move(dt: number){
if(this.stop_cd > 0||smc.vmdata.mission.is_victory||smc.vmdata.mission.is_defeat){
if(this.stop_cd > 0||smc.mission.is_victory||smc.mission.is_defeat){
this.status_change("idle")
return
}