diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-08-22 11:56:46 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-08-22 11:56:46 +0200 |
| commit | 0667db9e5a765cbd1eec90b63fb8cd0a6e0a2dc7 (patch) | |
| tree | 155a8e692b6eed924e4b735bd8e1444cd08ba83d /go/game/cardImplementations.go | |
| parent | 157a8601c10b06ab14a216372b0c06fc47f4de31 (diff) | |
| download | muhqs-game-0667db9e5a765cbd1eec90b63fb8cd0a6e0a2dc7.tar.gz muhqs-game-0667db9e5a765cbd1eec90b63fb8cd0a6e0a2dc7.zip | |
implement banner
Diffstat (limited to 'go/game/cardImplementations.go')
| -rw-r--r-- | go/game/cardImplementations.go | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/go/game/cardImplementations.go b/go/game/cardImplementations.go index 9fa56e12..16205ca5 100644 --- a/go/game/cardImplementations.go +++ b/go/game/cardImplementations.go @@ -186,16 +186,30 @@ func (*pikemanImpl) onETB(s *LocalState, p Permanent) { p.(*Unit).Attack.flexAttack = pikeAttack() } -type spearImpl struct{ cardImplementationBase } +// ====== Equipments Set ====== -func (*spearImpl) onPile(p Permanent) { - // FIXME: support multiple flexAttacks - p.(*Unit).Attack.flexAttack = pikeAttack() +var bannerAoE areaEffect = newCombinedAreaEffect([]areaEffect{ + newAdjustmentAreaEffect(adjustAttack, 1), + newAdjustmentAreaEffect(adjustMovement, 1), +}) + +type bannerImpl struct { + cardImplementationBase + aoe areaEffect } -func (*spearImpl) onUnpile(p Permanent) { - // FIXME: restore flexAttack - p.(*Unit).Attack.flexAttack = nil +func (i *bannerImpl) onEntering(t *Tile) { + s := t.Permanent.Controller().gameState + for _, tile := range TilesInRange(s.Map(), t.Permanent, 1) { + tile.addEffect(i.aoe) + } +} + +func (i *bannerImpl) onLeaving(t *Tile) { + s := t.Permanent.Controller().gameState + for _, tile := range TilesInRange(s.Map(), t.Permanent, 1) { + tile.removeEffect(i.aoe) + } } type maceImpl struct { @@ -233,6 +247,18 @@ func (*poisonDaggerImpl) onPile(p Permanent) { func (*poisonDaggerImpl) onUnpile(p Permanent) { } +type spearImpl struct{ cardImplementationBase } + +func (*spearImpl) onPile(p Permanent) { + // FIXME: support multiple flexAttacks + p.(*Unit).Attack.flexAttack = pikeAttack() +} + +func (*spearImpl) onUnpile(p Permanent) { + // FIXME: restore flexAttack + p.(*Unit).Attack.flexAttack = nil +} + // ====== Magic Set ====== type attackImpl struct{ cardImplementationBase } @@ -740,6 +766,7 @@ func init() { "base/tax_collector": &taxCollectorImpl{}, "base/wormtongue": &wormtongueImpl{}, + "equipments/banner": &bannerImpl{}, "equipments/mace": &maceImpl{triggers: make(map[Permanent]Trigger)}, "equipments/poison_dagger": &poisonDaggerImpl{}, "equipments/spear": &spearImpl{}, |
