From c696829f9e37e9f3752fdb89ebaadd4b3b237bea Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 2 Aug 2025 14:47:01 +0200 Subject: add support for flexible attacks --- go/game/cardImplementations.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'go/game/cardImplementations.go') diff --git a/go/game/cardImplementations.go b/go/game/cardImplementations.go index 18235faa..007c2335 100644 --- a/go/game/cardImplementations.go +++ b/go/game/cardImplementations.go @@ -12,7 +12,7 @@ func adjustMelee(p Permanent, damage int) { return } - if INVALID_ATTACK(u.Attack) { + if !u.Attack.Valid() { u.Attack.attacks = append(u.Attack.attacks, 1) } else { if u.Attack.attacks[0]+damage == 0 { @@ -29,7 +29,7 @@ func adjustAttack(p Permanent, damage int) { return } - if INVALID_ATTACK(u.Attack) { + if !u.Attack.Valid() { u.Attack.attacks = append(u.Attack.attacks, damage) } else { // TODO: remove 0 attacks @@ -201,6 +201,12 @@ func (*wormtongueImpl) fullActions(u *Unit) []*FullAction { return []*FullAction{a} } +type pikemanImpl struct{ cardImplementationBase } + +func (*pikemanImpl) onETB(s *LocalState, p Permanent) { + p.(*Unit).Attack.flexAttack = pikeAttack() +} + // ====== Magic Set ====== type attackImpl struct{ cardImplementationBase } @@ -706,6 +712,7 @@ func init() { "base/tax_collector": &taxCollectorImpl{}, "base/tower_shield": &towerShieldImpl{}, "base/wormtongue": &wormtongueImpl{}, + "base/pikeman": &pikemanImpl{}, "magic/attack!": &attackImpl{}, "magic/appear!": &appearImpl{}, -- cgit v1.2.3