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