ship/cr733 p2 mana appliers - #6336
Conversation
📝 WalkthroughWalkthroughThe PR adds semantic resolved mana insert/spend commands to the journal, validates their provenance, applies exact mana units atomically, updates payment paths to use the new flow, and adds replay and invariant tests using a Dimir Signet scenario. ChangesResolved mana command replay
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant CastingPath
participant GameState
participant ResolvedRulesJournal
participant ManaPool
CastingPath->>GameState: select exact mana units
GameState->>ResolvedRulesJournal: record_mana_spend
GameState->>ManaPool: apply_resolved_mana_spend
ManaPool-->>GameState: remove exact pip units
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/engine/src/game/mana_abilities.rs (1)
3258-3275: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy liftHonor life-payment alternatives for mana-ability costs. Both
select_mana_paymentcalls hard-codeLifePaymentColors::EMPTY, so mana-ability sub-costs can never use K'rrik-style 2-life substitution. Thread the active life-payment grant through here, and apply the returnedVec<LifePayment>instead of discarding it.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/engine/src/game/mana_abilities.rs` around lines 3258 - 3275, The two select_mana_payment call sites in mana_abilities.rs, at lines 3258-3275 and 3363-3382, must thread the active LifePaymentColors grant instead of passing LifePaymentColors::EMPTY, then apply the returned Vec<LifePayment> rather than discarding it. Preserve the existing restriction-aware payment context and ensure both mana-ability sub-cost paths honor K’rrik-style life substitution.Sources: Coding guidelines, Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@crates/engine/src/game/mana_abilities.rs`:
- Around line 3258-3275: The two select_mana_payment call sites in
mana_abilities.rs, at lines 3258-3275 and 3363-3382, must thread the active
LifePaymentColors grant instead of passing LifePaymentColors::EMPTY, then apply
the returned Vec<LifePayment> rather than discarding it. Preserve the existing
restriction-aware payment context and ensure both mana-ability sub-cost paths
honor K’rrik-style life substitution.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: d6d985cb-db14-431c-adfc-ccb380578159
📒 Files selected for processing (10)
.agents/cr733/RUN5-REPORT.mdcrates/engine/src/game/casting.rscrates/engine/src/game/casting_costs.rscrates/engine/src/game/mana_abilities.rscrates/engine/src/game/mana_payment.rscrates/engine/src/types/game_state.rscrates/engine/src/types/mod.rscrates/engine/src/types/resolved_commands.rscrates/engine/tests/integration/cr733_resolved_commands_p2.rscrates/engine/tests/integration/main.rs
Parse changes introduced by this PR✓ No card-parse changes detected. |
* cr733(p2): apply resolved mana commands * cr733(p2): record mana command run report * cr733(p2): debug-format ManaPipId in ExactManaRemovalError messages --------- Co-authored-by: matthewevans <matthewevans@users.noreply.github.com>
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Documentation