Skip to content

Add support for ability-based damage bonus mechanic#226

Open
bcollazo wants to merge 3 commits intomainfrom
claude/implement-magearna-skill-2OFZ2
Open

Add support for ability-based damage bonus mechanic#226
bcollazo wants to merge 3 commits intomainfrom
claude/implement-magearna-skill-2OFZ2

Conversation

@bcollazo
Copy link
Copy Markdown
Owner

Summary

Implement support for attack mechanics that deal extra damage when the opponent's Active Pokémon has an Ability.

Key Changes

  • Added new ExtraDamageIfOpponentActiveHasAbility variant to the Mechanic enum with configurable extra_damage parameter
  • Implemented extra_damage_if_opponent_active_has_ability() function that:
    • Checks if the opponent's Active Pokémon has an Ability
    • Returns base damage + extra damage if ability is present, otherwise returns base damage only
  • Added forecast effect handler in forecast_effect_attack_by_mechanic() to process this mechanic during attack resolution
  • Mapped the game text "If your opponent's Active Pokémon has an Ability, this attack does 40 more damage." to the new mechanic in the effect mechanic map

Implementation Details

The implementation follows the existing pattern used for similar conditional damage mechanics (e.g., ExtraDamageIfOpponentHpMoreThanSelf). The ability check uses the card's get_ability() method to determine if an Ability is present on the opponent's Active Pokémon.

https://claude.ai/code/session_01D9WZtbdn3onfUqkzmGS4H1

claude added 3 commits March 27, 2026 12:10
Adds ExtraDamageIfOpponentActiveHasAbility mechanic for the effect
"If your opponent's Active Pokémon has an Ability, this attack does 40 more damage."
Covers A3 123, A3 175, A4b 260, A4b 261.

https://claude.ai/code/session_01D9WZtbdn3onfUqkzmGS4H1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants