refactor: 统一将游戏内的「波次」术语替换为「回合」

本次提交将全项目中所有与「波次」相关的术语、注释、配置描述、UI文本全部替换为「回合」,包括:
1.  技能卡牌、怪物刷新、经济系统的相关注释与变量名
2.  配置表中的波次相关常量与描述文本
3.  UI预制体中的波次显示文本
4.  所有相关的文档注释与接口说明

统一术语后,游戏的关卡流程描述将更符合常规肉鸽游戏的表达习惯,避免与「波次」字面含义混淆,提升代码可读性与团队协作一致性。
This commit is contained in:
panFD
2026-08-09 14:51:48 +08:00
parent 2907c214f1
commit c59ba45b5b
14 changed files with 622 additions and 618 deletions

View File

@@ -9,18 +9,18 @@
* 4. 触发结束后自动销毁。
*
* 触发类型CardTriggerType
* - Instant (1)init 时立即触发一次(按 t_times 控制次数,跨波次 NewWave 时再次触发)
* - Interval (2):监听 FightStart → update 帧驱动按 t_inv 间隔重复触发(按 t_times 控制每次数)
* - Instant (1)init 时立即触发一次(按 t_times 控制次数,跨回合 NewWave 时再次触发)
* - Interval (2):监听 FightStart → update 帧驱动按 t_inv 间隔重复触发(按 t_times 控制每回合次数)
* - Field (3):被动生效,不主动施法(实际由 FieldSkillSet 处理)
* - FightStart (4):监听 FightStart 事件,按 trigger_limit 全局累计上限
* - FightEnd (5):监听 FightEnd 事件(每结束派发),按 trigger_limit 全局累计上限
* - FightEnd (5):监听 FightEnd 事件(每回合结束派发),按 trigger_limit 全局累计上限
* - HeroDead (6):监听 HeroDead 事件(仅英雄阵营派发,怪物死亡不触发)
* - HeroCall (7):监听 MasterCalled主角/技能召唤)+ ReviveSuccess复活
*
* 关键设计:
* - 事件型4-7统一走 onEventTrigger 入口,仅作触发信号,不读取 payload
* - 触发上限Instant/Interval 按 t_times内),事件型按 trigger_limit全局
* - 跨波次keep_waves 控制存活;事件型 trigger_count 不随波次重置
* - 触发上限Instant/Interval 按 t_times回合内),事件型按 trigger_limit全局
* - 跨回合keep_waves 控制存活;事件型 trigger_count 不随回合重置
* - 销毁时通过 GameEvent.RemoveSkillBox 通知 MissSkillsComp 回收槽位
*
* 依赖:
@@ -89,7 +89,7 @@ export class SkillBoxComp extends CCComp {
private trigger_times: number = 1;
/** 触发间隔(秒,仅持续技能有效) */
private trigger_interval: number = 0;
/** 维持的波次数(-1表示直到战斗结束0表示不跨波次>0表示维持的具体波次数) */
/** 维持的回合数(-1表示直到战斗结束0表示不跨回合>0表示维持的具体回合数) */
private keep_waves: number = 0;
/** 技能覆写参数自定义伤害、Buff等 */
private overrides?: SkillOverrides;
@@ -123,7 +123,7 @@ export class SkillBoxComp extends CCComp {
/**
* 注册全局事件:
* - MissionEnd所有类型都需要监听任务结束时强制销毁
* - NewWave处理 keep_waves 跨波次逻辑(所有类型统一)
* - NewWave处理 keep_waves 跨回合逻辑(所有类型统一)
* - 其它触发事件由 registerTrigger 按 trigger_type 动态注册
*/
onLoad() {
@@ -304,7 +304,7 @@ export class SkillBoxComp extends CCComp {
case CardTriggerType.Interval:
// 定时循环:监听 FightStart 进入战斗后启动计时
oops.message.on(GameEvent.FightStart, this.onFightStart, this);
// 若购买时战斗已在进行FightStart 已派发过),立即进入战斗态,避免空等下一
// 若购买时战斗已在进行FightStart 已派发过),立即进入战斗态,避免空等下一回合
if (smc.mission.in_fight) {
this.in_combat = true;
this.timer = 0;
@@ -361,14 +361,14 @@ export class SkillBoxComp extends CCComp {
this.current_trigger_times++;
this.updateUI();
// 单次触发 + 不跨波次维持 → 延迟销毁(保留短暂视觉反馈)
// 单次触发 + 不跨回合维持 → 延迟销毁(保留短暂视觉反馈)
if (this.keep_waves === 0 && this.current_trigger_times >= this.trigger_times) {
this.scheduleOnce(() => this.destroySelf(), 1.0);
}
return;
}
// 事件型:上限由 trigger_limit 控制(全局累计,跨波次不重置)
// 事件型:上限由 trigger_limit 控制(全局累计,跨回合不重置)
if (this.trigger_count >= this.trigger_limit) {
this.destroySelf();
return;
@@ -504,30 +504,30 @@ export class SkillBoxComp extends CCComp {
this.timer = 0; // 重置计时器
}
/** 节点级新一事件处理 */
/** 节点级新一回合事件处理 */
private onNewWave() {
this.handleNewWave();
}
/** 全局级新一事件处理 */
/** 全局级新一回合事件处理 */
private onNewWaveGlobal() {
this.handleNewWave();
}
/**
* 新一:退出战斗状态。
* 处理维持波次逻辑:递减剩余波次,或者重置触发次数。
* 新一回合:退出战斗状态。
* 处理维持回合逻辑:递减剩余回合,或者重置触发次数。
*
* 各类型在新一的行为:
* - Instant/Interval/FightStart/FightEnd按 keep_waves 决定维持/销毁,并在新一开始时重置本地计数
* 各类型在新一回合的行为:
* - Instant/Interval/FightStart/FightEnd按 keep_waves 决定维持/销毁,并在新一回合开始时重置本地计数
* - Field被动生效跟随 keep_waves 决定存活
* - HeroDead/HeroCall波次触发的事件型trigger_count全局不重置仅 keep_waves 控制存活
* - HeroDead/HeroCall回合触发的事件型trigger_count全局不重置仅 keep_waves 控制存活
*/
private handleNewWave() {
if (!this.initialized) return;
this.in_combat = false;
// 事件型触发HeroDead / HeroCalltrigger_count 全局累计,不随波次重置
// 事件型触发HeroDead / HeroCalltrigger_count 全局累计,不随回合重置
const isGlobalEventType =
this.trigger_type === CardTriggerType.HeroDead ||
this.trigger_type === CardTriggerType.HeroCall;
@@ -540,21 +540,21 @@ export class SkillBoxComp extends CCComp {
return;
}
}
// 跨波次维持:重置本地计数与计时器(事件型 trigger_count 不重置)
// 跨回合维持:重置本地计数与计时器(事件型 trigger_count 不重置)
if (!isGlobalEventType) {
this.current_trigger_times = 0;
this.trigger_count = 0;
}
this.timer = 0;
// 即时/事件型触发一次保持旧行为Instant 在新一开始立即触发一次)
// 即时/事件型触发一次保持旧行为Instant 在新一回合开始立即触发一次)
if (this.trigger_type === CardTriggerType.Instant) {
this.triggerSkill();
this.current_trigger_times++;
}
this.updateUI();
} else {
// 不跨波次维持:达到上限即销毁
// 不跨回合维持:达到上限即销毁
// - Interval / Instant按 t_times 判定
// - 事件型:按 trigger_limit 判定
const reachedLimit = isGlobalEventType
@@ -604,7 +604,7 @@ export class SkillBoxComp extends CCComp {
this.current_trigger_times++;
this.updateUI();
// 次数用完且不跨波次维持 → 延迟销毁
// 次数用完且不跨回合维持 → 延迟销毁
if (this.keep_waves === 0 && this.current_trigger_times >= this.trigger_times) {
this.scheduleOnce(() => this.destroySelf(), 0.5);
}