Files
Genarrative/server-rs/crates/module-combat/README.md
高物 3cb3efb4d0 Prune stale docs and update .hermes content
Delete a large set of outdated documentation (many files under docs/ and .hermes/plans/, including audits, design, prd, technical, planning, assets, and todos). Update and consolidate .hermes content: refresh shared-memory pages (decision-log, development-workflow, document-map, pitfalls, project-overview, team-conventions) and several skills/references under .hermes/skills. Also modify AGENTS.md, README.md, UI_CODING_STANDARD.md, docs/README.md and .encoding-check-ignore. Purpose: clean up stale planning/audit material and keep current hermes documentation and related top-level docs in sync.
2026-05-15 06:24:07 +08:00

2.5 KiB
Raw Blame History

module-combat

日期:2026-04-21

1. package 职责

module-combat 是 M4 阶段的战斗规则 crate当前负责

  1. battle_state 首版领域类型与字段校验
  2. resolve_combat_action 的纯规则推进
  3. fight / spar 两种模式下的战斗收束规则
  4. spacetime-module 提供可直接复用的战斗状态与 reducer 输入输出类型

2. 当前实现范围

当前已经真实落地:

  1. src/domain.rs 承接战斗 ID 前缀、版本、伤害、切磋保底生命、旧攻击 function 列表和 BattleMode / BattleStatus / CombatOutcome
  2. BattleStateInput / BattleStateSnapshot / BattleStateQueryInput
  3. ResolveCombatActionInput / ResolveCombatActionResult
  4. BattleStateProcedureResult / ResolveCombatActionProcedureResult
  5. battle_attack_basic / battle_recover_breath / battle_use_skill / battle_escape_breakout
  6. 旧攻击类 function 的兼容解析
  7. chapter_id / experience_reward 最小承载字段,供 spacetime-module 在胜利时联动成长结算

当前刻意未做:

  1. inventory_use
  2. 掉落、好感、任务信号联动
  3. story AI 续写触发
  4. 多目标或完整 build / cooldown 真相建模

3. 配套文档

落地依据见:

  1. ../../../docs/【玩法创作】平台入口与玩法链路-2026-05-15.md
  2. ../../../docs/【后端架构】server-rs与SpacetimeDB数据契约-2026-05-15.md
  3. ../../../docs/【玩法创作】平台入口与玩法链路-2026-05-15.md
  4. ../../../docs/【玩法创作】平台入口与玩法链路-2026-05-15.md
  5. ../../../docs/【后端架构】server-rs与SpacetimeDB数据契约-2026-05-15.md
  6. ../../../docs/【玩法创作】平台入口与玩法链路-2026-05-15.md

4. 边界约束

  1. module-combat 只做纯规则、纯状态推进,不承接 HTTP、LLM、OSS 或文件 IO。
  2. 任何与 inventory / progression / npc / story 的联动,都应先在文档里冻结边界后再继续接入。
  3. 该 crate 的目标不是替代 Axum facade而是成为 spacetime-module 里的战斗真相规则层。