This commit is contained in:
2025-02-03 22:36:14 +08:00
parent 8cdd6aaa21
commit 2521af3a55
2 changed files with 35 additions and 33 deletions

View File

@@ -1,9 +0,0 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "98ac6b4e-90c9-4719-bae3-a65982701915",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -21,7 +21,6 @@ import { UIID } from "../common/config/GameUIConfig";
import { CardControllerComp } from "./CardController"; import { CardControllerComp } from "./CardController";
import { MissionHomeComp } from "./MissionHomeComp"; import { MissionHomeComp } from "./MissionHomeComp";
import { GameEvent } from "../common/config/GameEvent"; import { GameEvent } from "../common/config/GameEvent";
import { BattleManager } from "../battle/BattleManager";
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
/** 视图层对象 */ /** 视图层对象 */
@@ -69,32 +68,44 @@ export class MissionComp extends CCComp {
// } // }
// this.shuaxin(dt) // this.shuaxin(dt)
} }
mission_start(missionId: number) { mission_start(){
// 初始化关卡数据 /* todo 关卡设定完善*/
this.colose_victory(); console.log("mission_start Missions mons:",Missions[smc.mission.lv])
this.mission_init(); this.colose_victory()
this.mission_init()
// 启动战斗(外部控制入口) // this.mskill_init()
BattleManager.startBattle(smc.mission.lv); this.mon_refresh()
this.heros_call()
// 生成怪物和英雄
this.mon_refresh();
this.heros_call();
} }
mission_end() { mission_end(){
// 结束战斗(外部控制出口) oops.message.dispatchEvent(GameEvent.MissionEnd)
BattleManager.endBattle(); smc.mission.play=false
smc.mission.pause=false
// 更新游戏状态 let heros:any= this.get_heros();;
oops.message.dispatchEvent(GameEvent.MissionEnd); let monsters:any= this.get_mons();
smc.mission.play = false; let hcards:any= ecs.query(ecs.allOf(HCardComp));
let rewards:any= ecs.query(ecs.allOf(ItemComp));
// 显示结算界面 // let hcns=this.node.getChildByName("hcards")
this.open_victory(); // for(let i=0;i<hcns.children.length;i++){
// hcns.children[i].destroy()
// }
for(let i=0;i<heros.length;i++){
heros[i].HeroView.reset()
heros[i].HeroView.ent.destroy()
}
for(let i=0;i<hcards.length;i++){
hcards[i].HCardComp.reset()
hcards[i].HCardComp.ent.destroy()
}
for(let i=0;i<monsters.length;i++){
monsters[i].HeroView.reset()
monsters[i].HeroView.ent.destroy()
}
// this.to_mission_home()
this.open_victory()
} }
open_victory(){ open_victory(){
this.node.getChildByName("victory").active=true this.node.getChildByName("victory").active=true
this.node.getChildByName("victory").getComponent(VictoryComp).open() this.node.getChildByName("victory").getComponent(VictoryComp).open()