技能都改为 cd 减少 玩家学习成本

This commit is contained in:
2025-07-25 17:20:23 +08:00
parent 509121a2ab
commit 855fed2a47
8 changed files with 73 additions and 55 deletions

View File

@@ -33,8 +33,8 @@ export class MissionComp extends CCComp {
this.on(GameEvent.MissionEnd,this.mission_end,this)
// this.on(GameEvent.CardsClose,this.after_used_skill_card,this)
this.on(GameEvent.WaveUpdate,this.on_mon_wave_update,this)
this.on(GameEvent.CanUpdateLv,this.show_uplv_button,this)
this.on(GameEvent.UseEnhancement,this.hide_uplv_button,this)
// this.on(GameEvent.CanUpdateLv,this.show_uplv_button,this)
// this.on(GameEvent.UseEnhancement,this.hide_uplv_button,this)
}
@@ -73,18 +73,18 @@ export class MissionComp extends CCComp {
to_ready(){
oops.message.dispatchEvent(GameEvent.HeroSelect,{is_master:true})
}
show_uplv_button(){
this.update_count++
this.node.getChildByName("uplv").active=true
}
hide_uplv_button(){
this.update_count--
if(this.update_count > 0) return
this.node.getChildByName("uplv").active=false
}
to_uplv(){
oops.message.dispatchEvent(GameEvent.EnhancementSelect)
}
// show_uplv_button(){
// this.update_count++
// this.node.getChildByName("uplv").active=true
// }
// hide_uplv_button(){
// this.update_count--
// if(this.update_count > 0) return
// this.node.getChildByName("uplv").active=false
// }
// to_uplv(){
// oops.message.dispatchEvent(GameEvent.EnhancementSelect)
// }
to_call_friend(){
oops.message.dispatchEvent(GameEvent.HeroSelect,{is_master:false})
}

View File

@@ -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