Skip to content

Implement Shield Bash armor reduction mechanic #1024

@eshaffer321

Description

@eshaffer321

Summary

The ShieldBashArmorReduction modifier exists in mk-types/src/modifier.rs:329 and is applied by the card definition in mk-data/src/cards.rs:2128, but no code in mk-engine consumes this modifier. The entire Shield Bash armor reduction mechanic is unimplemented.

Expected Behavior (TS Reference)

From core/src/engine/combat/shieldBashHelpers.tsapplyShieldBashArmorReduction():

  1. At the end of the Block phase, calculate undoubled effective block vs undoubled required block for each blocked enemy
  2. Excess undoubled block reduces the enemy's armor by the excess amount (minimum armor = 1)
  3. Apply an EnemyStat(Armor, -excess, min=1) modifier to the blocked enemy

Special Rules

  • Swift enemies: Cannot be blocked normally, so Shield Bash doesn't apply
  • Ice Resistance: Enemy is immune to armor reduction from Shield Bash (ice blocks don't count)
  • Summoned monsters: Excluded from Shield Bash
  • Arcane Immunity (FAQ S5): Block part works normally, but armor reduction does NOT apply to AI enemies

Implementation Notes

  • The modifier ShieldBashArmorReduction already exists in types — needs consumption logic in combat resolution
  • The AI guard is trivial to add once the mechanic works (same pattern as other !has_ai guards in units.rs)
  • Hook point is likely at the Block → AssignDamage phase transition in combat_actions.rs

Acceptance Criteria

  • Excess undoubled block reduces enemy armor (minimum 1)
  • Swift enemies excluded
  • Ice Resistance immunity respected
  • Summoned monsters excluded
  • Arcane Immune enemies excluded (FAQ S5)
  • Tests covering all edge cases

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:combatCombat systemcomplexity:mediumModerate effort, multiple files or considerationsfeatureNew functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions