mantimon-tcg/backend/app/core/models
Cal Corum dba2813f80 Add effects system with configurable weakness/resistance
Effects System (Week 3):
- EffectContext: helper methods for player/card access, params, coin flips
- EffectResult: success, message, effect_type, details for logging
- @effect_handler decorator with sync/async support and introspection
- resolve_effect() for executing effects by ID

Built-in Handlers (13 total):
- deal_damage: raw damage primitive (poison, burn, recoil)
- attack_damage: combat damage with modifiers, weakness, resistance
- heal, draw_cards, discard_from_hand, shuffle_deck
- apply_status, remove_status
- coin_flip_damage, bench_damage
- discard_energy, modify_hp, modify_retreat_cost

Configurable Weakness/Resistance:
- ModifierMode enum: MULTIPLICATIVE (x2) or ADDITIVE (+20)
- CombatConfig in RulesConfig for game-wide defaults
- WeaknessResistance supports per-card mode/value overrides
- Legacy 'modifier' field maintained for backwards compatibility

Test Coverage: 98% (418 tests)
- 84 tests for effects system (base, registry, handlers)
- Comprehensive edge case coverage for all handlers
- CardDefinition helper methods tested for non-Pokemon cards
- Zone edge cases (draw_bottom empty, peek_bottom overflow)
2026-01-25 00:25:38 -06:00
..
__init__.py Add GameState, PlayerState, Zone models and test fixtures 2026-01-24 22:55:31 -06:00
actions.py Add card/action models with stage/variant separation 2026-01-24 22:35:31 -06:00
card.py Add effects system with configurable weakness/resistance 2026-01-25 00:25:38 -06:00
enums.py Add effects system with configurable weakness/resistance 2026-01-25 00:25:38 -06:00
game_state.py Refactor turn action tracking from booleans to counters for RulesConfig support 2026-01-24 23:16:37 -06:00