添加了结束战斗按钮

This commit is contained in:
2024-11-13 23:36:34 +08:00
parent 9d0ee7e7b5
commit 2a07f4718a
7 changed files with 966 additions and 383 deletions

View File

@@ -16,6 +16,7 @@ import { MonModelComp } from "../mon/MonModelComp";
import { Boss} from "../Boss/Boss";
import { UIID } from "../common/config/GameUIConfig";
import { Talents } from "../common/config/TalentSet";
import { HeroViewComp } from "../hero/HeroViewComp";
const { ccclass, property } = _decorator;
/** 视图层对象 */
@@ -59,6 +60,7 @@ export class MapMonsterComp extends CCComp {
oops.message.on("other_add_monster", this.on_other_add_monster, this);
oops.message.on("do_add_hero", this.on_do_add_hero, this);
oops.message.on("mission_start", this.mission_start, this);
oops.message.on("mission_end", this.mission_end, this);
oops.message.on("normal_call", this.on_normal_call, this);
oops.message.on("better_call", this.on_better_call, this);
oops.message.on("mon_dead", this.on_mon_dead, this);
@@ -123,6 +125,13 @@ export class MapMonsterComp extends CCComp {
this.hero_index=0
smc.vm_data.mission.coin = 0
}
mission_end(){
smc.vm_data.mission.play=false
let heros:any= ecs.query(ecs.allOf(HeroViewComp));
for(let i=0;i<heros.length;i++){
heros[i].HeroView.ent.destroy()
}
}
on_mon_dead(){
let coin =(GameSet.MON_COIN_ADD*smc.vm_data.mission.coin_reward_add*(1+Talents[1006].bonus*smc.vm_data.talent[1006].lv)).toFixed(0)
smc.vm_data.mission.coin += parseFloat(coin)