[Phase 2.5] Layered EffectiveStat & ContinuousModifier Dependency Engine #23

Open
opened 2026-11-17 08:14:10 +00:00 by john4064 · 0 comments
Owner

Goal

Implement the non-destructive layered stat & modifier pipeline in chaotic_core so creature base templates are never mutated during combat.

Metadata

  • Phase / Step: Phase 2.5
  • Depends On: #4
  • Unlocks: #9, #24
  • Target Crates / Paths: crates/chaotic_core/src/modifiers.rs
  • Line Budget Plan: Production .rs <= 400 lines, test .rs <= 600 lines, mod.rs < 80 lines (AGENTS.md Section 2.3)

Acceptance Criteria

  • Compute EffectiveStat = (TemplateBase + ScannedInstanceOffset + BattlegearMod + LocationMod + TurnBuffs).max(0) deterministically across Energy, Disciplines, Elements, and Keywords.
  • Handle dynamic aura/continuous layers (Location -> Support/Tribe auras -> Battlegear -> turn buffs/debuffs -> stat swaps) without order-dependent bugs.
  • Prevent permanent mutation of CreatureTemplate or ScannedCreatureInstance fields during match state evaluation.
  • Unit tests cover overlapping positive/negative buffs, stat floor clamping at 0, and end-of-turn cleanup.
## Goal Implement the non-destructive layered stat & modifier pipeline in `chaotic_core` so creature base templates are never mutated during combat. ## Metadata - **Phase / Step:** Phase 2.5 - **Depends On:** #4 - **Unlocks:** #9, #24 - **Target Crates / Paths:** `crates/chaotic_core/src/modifiers.rs` - **Line Budget Plan:** Production `.rs` <= 400 lines, test `.rs` <= 600 lines, `mod.rs` < 80 lines (`AGENTS.md` Section 2.3) ## Acceptance Criteria - [ ] Compute `EffectiveStat = (TemplateBase + ScannedInstanceOffset + BattlegearMod + LocationMod + TurnBuffs).max(0)` deterministically across Energy, Disciplines, Elements, and Keywords. - [ ] Handle dynamic aura/continuous layers (`Location` -> `Support`/Tribe auras -> `Battlegear` -> turn buffs/debuffs -> stat swaps) without order-dependent bugs. - [ ] Prevent permanent mutation of `CreatureTemplate` or `ScannedCreatureInstance` fields during match state evaluation. - [ ] Unit tests cover overlapping positive/negative buffs, stat floor clamping at 0, and end-of-turn cleanup.
Sign in to join this conversation.
No description provided.