Add support for Ogerpon-family cards from Fantastical Parade#231
Merged
Add support for Ogerpon-family cards from Fantastical Parade#231
Conversation
- Teal Mask Ogerpon ex: Soothing Wind passive ability + Energized Leaves attack - Hearthflame Mask Ogerpon: Hearthflame Dance (coin flip charge bench) - Wellspring Mask Ogerpon: Wellspring Dance (coin flip also bench damage) - Cornerstone Mask Ogerpon: Cornerstone Dance (extra damage at combined energy threshold) New mechanics: ExtraDamageIfCombinedActiveEnergyAtLeast, CoinFlipChargeBench, CoinFlipAlsoChoiceBenchDamage, SoothingWind ability (passive status immunity) Robustness fixes for deferred-action edge cases: - on_end_turn: early return when active is None - modify_damage: graceful None for attacker/receiver slots - apply_defender_damage_prevention_if_needed: graceful None for defender - heal_active_your_pokemon: guard against None active Added 11 integration tests in tests/ogerpon_test.rs https://claude.ai/code/session_019RHHC3bwN4LP6v2FrqQq3U
Resolved conflicts in: - src/actions/abilities/mechanic.rs: added new variants from main alongside SoothingWind - src/actions/apply_abilities_action.rs: combined SoothingWind + new passive panic arms - src/actions/effect_ability_mechanic_map.rs: kept both SoothingWind + DoubleGrassEnergy entries - src/hooks/core.rs: kept graceful None guard + adopted AbilityMechanic check for Intimidating Fang - src/move_generation/move_generation_abilities.rs: added SoothingWind + new passive false arms https://claude.ai/code/session_019RHHC3bwN4LP6v2FrqQq3U
…d bench damage atomicity - Soothing Wind now cures all energy-bearing Pokémon immediately when Ogerpon enters play (apply_place_card), rather than at end of turn. Removed the end-of-turn apply_soothing_wind() call — the ability prevents status, not cures it. - Added apply_soothing_wind_for_player() helper (single-player, pub(crate)). - Added ExtraDamageIfDefenderPoisoned mechanic for Venoshock attacks (+40/50/60/70 extra damage if opponent's active is Poisoned). Mapped 4 text variants. - Fixed coin_flip_also_choice_bench_damage to bundle active+bench damage atomically in a single ApplyDamage, preventing stale slot references after KO/promotion. - Reverted heal_active_your_pokemon to hard get_active_mut (soft-None guard was masking the now-fixed deferred bench damage ordering bug). - Graceful None guards in apply_defender_damage_prevention_if_needed and modify_damage for attacker/receiver slots. - 3 new ogerpon tests: cure-on-play, Venoshock extra damage, Soothing Wind prevents Venoshock bonus. https://claude.ai/code/session_019RHHC3bwN4LP6v2FrqQq3U
- Remove unused `mut` on game variables in 3 state-only tests - Switch Venoshock test targets from Bulbasaur (Grass, weak to Fire) to Charmander (Fire, weak to Water) so Salandit's Fire attacks don't trigger weakness, keeping expected HP values correct (50 and 10 instead of KO/wrong totals) https://claude.ai/code/session_019RHHC3bwN4LP6v2FrqQq3U
The guard was masking a now-fixed root cause: deferred bench damage could be processed after a KO/promotion, leaving the active slot empty. Since coin_flip_also_choice_bench_damage now bundles both damages atomically, the stale-state scenario can't occur. Use get_active() directly so a future None panics loudly instead of silently skipping damage prevention. https://claude.ai/code/session_019RHHC3bwN4LP6v2FrqQq3U
EndTurn only appears when move_generation_stack is empty, which means promotions are always resolved first (trigger_promotion_or_declare_winner uses .insert(0, ...) so promotions settle before the stack drains). By the time on_end_turn fires, the active is always present. The modify_damage and get_intimidating_fang_reduction guards were also masking the now-fixed deferred bench damage root cause; atomic ApplyDamage ensures attacker and receiver slots are always populated during damage resolution. Restore .expect() so future None values surface as real bugs. https://claude.ai/code/session_019RHHC3bwN4LP6v2FrqQq3U
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements support for four Ogerpon-family Pokémon cards from the Fantastical Parade (B2) set, including their unique attack mechanics and passive abilities.
Key Changes
New Attack Mechanics
New Ability Mechanic
State::apply_soothing_wind()for end-of-turn maintenanceState::apply_status_condition()to block status applicationImplementation Details
ApplyDamageaction to prevent stale slot issues when KOs occuron_end_turn()hook to handle scenarios where active Pokémon is absentget_intimidating_fang_reduction()to gracefully handle missing active PokémonTest Coverage
Added comprehensive test suite (
tests/ogerpon_test.rs) covering:Card Mappings
Updated
effect_mechanic_map.rsandeffect_ability_mechanic_map.rsto map card text to the new mechanics for all four Ogerpon variants.https://claude.ai/code/session_019RHHC3bwN4LP6v2FrqQq3U