技能都改为 cd 减少 玩家学习成本
This commit is contained in:
@@ -11,6 +11,7 @@ import { GameEvent } from "../common/config/GameEvent";
|
||||
import { oops } from "db://oops-framework/core/Oops";
|
||||
// 导入肉鸽配置
|
||||
import { getRogueWaveConfig, RogueConfig, RogueWaveType, AffixCountConfig, MonsterAffixConfig } from "./RogueConfig";
|
||||
import { MonModelComp } from "../hero/MonModelComp";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -36,6 +37,7 @@ export class MissionMonCompComp extends CCComp {
|
||||
|
||||
onLoad(){
|
||||
this.on(GameEvent.FightStart,this.to_fight,this)
|
||||
this.on(GameEvent.MonDead,this.check_mon,this)
|
||||
}
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
@@ -43,13 +45,29 @@ export class MissionMonCompComp extends CCComp {
|
||||
// this.on(ModuleEvent.Cmd, this.onHandler, this);
|
||||
// this.test_call()
|
||||
}
|
||||
|
||||
check_mon(){
|
||||
let mon=ecs.query(ecs.allOf(MonModelComp))
|
||||
console.log("[MissionMonComp]:check_mon",mon)
|
||||
if(mon.length==1) {
|
||||
|
||||
// do 倒计时
|
||||
|
||||
this.do_mon_wave()
|
||||
}
|
||||
}
|
||||
//奖励发放
|
||||
do_reward(){
|
||||
let wave=smc.vmdata.mission_data.current_wave
|
||||
// 奖励发放
|
||||
}
|
||||
protected update(dt: number): void {
|
||||
if(!smc.mission.play||smc.mission.pause) return
|
||||
|
||||
if(this.is_fight) {
|
||||
if(this.timer.update(dt)){
|
||||
this.do_mon_wave()
|
||||
}
|
||||
// if(this.timer.update(dt)){
|
||||
// this.do_mon_wave()
|
||||
// }
|
||||
}
|
||||
// 处理刷怪队列
|
||||
if (this.monsterQueue.length > 0 && !this.isSpawning) {
|
||||
@@ -60,6 +78,7 @@ export class MissionMonCompComp extends CCComp {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
to_fight(){
|
||||
console.log("[MissionMonComp]:to_fight")
|
||||
this.is_fight=true
|
||||
|
||||
Reference in New Issue
Block a user