fix(engine): trigger land mana amplification once - #7288
Conversation
|
Warning Review limit reached
Next review available in: 41 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (11)
📝 WalkthroughWalkthroughThe engine now parses and resolves land mana amplification triggers. It adds aggregate ChangesLand mana amplification
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Parse changes introduced by this PRBaseline pending for |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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.
Inline comments:
In `@crates/engine/src/game/ability_rw.rs`:
- Line 2684: Classify FilterProp::SameNameAsExiledBySource as member-bound by
moving it into the => true arm alongside TargetFilter::ExiledBySource and
FilterProp::InTrackedSet. Add a regression test covering two sources linked to
different exiled names, verifying sibling-order analysis does not treat their
source-bound results as uniform.
In `@crates/engine/src/game/filter.rs`:
- Around line 5183-5189: Update both matcher arms for
FilterProp::SameNameAsExiledBySource so each checks only the exile linked to its
paired exile ability, rather than every ExileLink for source.id. Preserve the
existing name comparison while adding ability or pile identity to the link
context, or limit the property to the supported one-pile class. Add a two-pile
regression test and verified CR 607.2a annotations to both arms.
In `@crates/engine/src/game/mana_abilities.rs`:
- Around line 735-744: Update the aggregate ManaAbilityProduced emission around
produced_for_tap_event to preserve each mana recipient’s identity instead of
assigning the activating player to all produced mana. Emit recipient-scoped
aggregate events or equivalent recipient-scoped entries, and ensure
match_mana_ability_produced validates triggers against the receiving player
while retaining one aggregate resolution per recipient.
In `@crates/engine/tests/integration/issue_6979_land_mana_amplification.rs`:
- Around line 19-68: Rewrite the regression tests around
caged_sun_triggers_once_from_a_non_tap_land_mana_ability and the corresponding
Lens test to activate real mana abilities through the scenario pipeline instead
of injecting GameEvent::ManaAbilityProduced directly. Give the tested land an
actual non-tap mana ability, use distinct controllers for Lens and land, and add
controls for a nonchosen color, nonmatching land name, and opponent-controlled
matching land. Assert that only the matching land controller receives exactly
one additional mana, covering both aggregate production and
one-event-per-mana-unit behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 6f4622fb-f9e1-4047-9241-f230973d4247
📒 Files selected for processing (26)
crates/engine/src/ai_support/filter.rscrates/engine/src/ai_support/mod.rscrates/engine/src/ai_support/shortcut_efficacy.rscrates/engine/src/analysis/ability_graph.rscrates/engine/src/game/ability_rw.rscrates/engine/src/game/ability_scan.rscrates/engine/src/game/casting_costs.rscrates/engine/src/game/coverage.rscrates/engine/src/game/effects/mana.rscrates/engine/src/game/exile_links.rscrates/engine/src/game/filter.rscrates/engine/src/game/layers.rscrates/engine/src/game/log.rscrates/engine/src/game/mana_abilities.rscrates/engine/src/game/mana_sources.rscrates/engine/src/game/public_state.rscrates/engine/src/game/trigger_index.rscrates/engine/src/game/trigger_matchers.rscrates/engine/src/game/triggers.rscrates/engine/src/parser/oracle_trigger.rscrates/engine/src/parser/oracle_trigger_tests.rscrates/engine/src/types/ability.rscrates/engine/src/types/events.rscrates/engine/src/types/triggers.rscrates/engine/tests/integration/issue_6979_land_mana_amplification.rscrates/engine/tests/integration/main.rs
|
Pushed the test repair rebased on the branch update as 47f66b8c4d. |
|
Correction: the pushed rebased head is |
Closes #6979\n\nPreserves the produced-mana event as a single trigger source and matches source-linked land names for Caged Sun and Extraplanar Lens.
Summary by CodeRabbit