- Added BattleState class to manage battle flow, including turn management and event handling. - Introduced BuffInstance class to represent buffs applied to combatants. - Created CardInstance class to handle card definitions and cost calculations. - Developed CombatantState class to manage combatant attributes and actions. - Implemented EffectRegistry to apply effects based on event specifications. - Added various handlers (BlockHandler, DamageHandler, DrawHandler, etc.) to process specific events. - Created IntentPlanner and IntentState classes to manage enemy actions and intents. - Established a queue system for handling battle events with BattleEventQueue and BattleEventTask. - Introduced triggers for applying effects based on game events (e.g., OnCardDrawnGainBlockTrigger). - Added necessary UID files for new scripts to ensure proper resource management.
55 lines
2.9 KiB
Markdown
55 lines
2.9 KiB
Markdown
# 剩余重构与实现 TODO
|
||
|
||
下面是当前项目中尚未完成或需要重点检查的核心内容。
|
||
|
||
## 1. 核心规则入口与策略切换
|
||
- [ ] 恢复并确认 `BattleRuleProvider` 的单点规则入口实现
|
||
- [ ] 完成 `DrawPolicy` 抽牌策略接口及 `StandardDrawPolicy` 实现
|
||
- [ ] 完成 `AutoPlayPolicy` 出牌策略接口及至少一个策略实现
|
||
- [ ] 在 `BattleController` 中注入 `rule_provider`,并赋值给 `battle_state.draw_policy`
|
||
- [ ] 保留出牌/抽牌策略为单点切换点,可通过配置位置切换规则逻辑
|
||
|
||
## 2. 阶段机制与阶段钩子
|
||
- [ ] 确保 `BattlePhase` 全局阶段模型完备,涵盖回合开始/回合结束/抽牌阶段等关键阶段
|
||
- [ ] 完成 `phase_entered` / `phase_exited` 钩子事件
|
||
- [ ] 实现阶段钩子分发器,可监听阶段变化并生成/分发事件
|
||
- [ ] 让卡牌/Buff 逻辑可以直接声明“进入某阶段触发”的规则
|
||
|
||
## 3. 触发器与 Buff 系统
|
||
- [ ] 确保 `BuffInstance` 容器可正常存储 `subscriber`
|
||
- [ ] 确保 `TriggerDispatchHandler` 按 `speed_weight` + `acquire_index` 正常排序触发
|
||
- [ ] 补齐 `TriggerSubscriber`、`OnCardDrawnGainBlockTrigger`、`OnPhaseEnteredGainBlockTrigger` 等触发器模板
|
||
- [ ] 验证抽牌/受伤/阶段触发链路在事件队列尾部追加,并且行为可复现
|
||
|
||
## 4. 事件队列与处理器
|
||
- [ ] 检查 `BattleEventQueue` 是否稳定执行,避免类型解析或执行顺序异常
|
||
- [ ] 确认核心事件处理器已在 `BattleState` 中注册:
|
||
- `DAMAGE_REQUESTED`
|
||
- `BLOCK_REQUESTED`
|
||
- `WEAK_APPLIED`
|
||
- `CARD_DRAW_REQUESTED`
|
||
- `CARD_DISCARD_REQUESTED`
|
||
- 相关阶段钩子事件
|
||
- [ ] 确认 `EffectRegistry` 仅做兼容层,不再承担核心 handler 注册责任
|
||
|
||
## 5. 格挡与生命管理
|
||
- [ ] 修复格挡消耗机制,保证 `take_damage` 中格挡按伤害量正确吸收并减少
|
||
- [ ] 保留“回合结束清空格挡”或实现可配置的格挡生命周期策略
|
||
- [ ] 增加“格挡被清空/吸收了多少伤害”的反馈日志或状态提示
|
||
|
||
## 6. UI 反馈与指示
|
||
- [ ] 确认战斗界面顶部 HUD 阶段指示已正确显示当前阶段
|
||
- [ ] 确认玩家/敌方 Buff 指示可见且不会严重挤占界面空间
|
||
- [ ] 增加“格挡消耗/清空”状态文案提示
|
||
- [ ] 如有条件,可进一步升级为小图标/胶囊式 Buff 展示
|
||
|
||
## 7. 文档与交接
|
||
- [ ] 把当前剩余工作整理成文档 TODO,并写入 `Docs/Architecture` 或 `Game/Tests`
|
||
- [ ] 更新交接文档中的“未完成项”和“下一阶段任务”
|
||
- [ ] 标记已完成 vs 未完成的实现节点,便于后续接手和验收
|
||
|
||
## 8. 测试与验证
|
||
- [ ] 建立最小测试基线:事件队列、触发器、阶段钩子、策略切换、格挡消耗
|
||
- [ ] 验证当前 Demo Buff 不再干扰“受伤消耗格挡”的真实行为
|
||
- [ ] 检查第二回合抽牌仍能触发格挡逻辑并保持稳定
|