diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-08-02 14:47:01 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-08-20 15:57:33 +0200 |
| commit | c696829f9e37e9f3752fdb89ebaadd4b3b237bea (patch) | |
| tree | a205a17da9618e04f61e44d49cb028ede23dd732 /go/game/cardImplementations.go | |
| parent | ca083639a4b52215b39bb863031f71c0a8209ee9 (diff) | |
| download | muhqs-game-c696829f9e37e9f3752fdb89ebaadd4b3b237bea.tar.gz muhqs-game-c696829f9e37e9f3752fdb89ebaadd4b3b237bea.zip | |
add support for flexible attacks
Diffstat (limited to 'go/game/cardImplementations.go')
| -rw-r--r-- | go/game/cardImplementations.go | 11 |
1 files changed, 9 insertions, 2 deletions
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{}, |
