aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2024-03-26 16:22:52 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2025-01-27 16:43:56 +0100
commitf5e740230cc2ac034b98496f1c0715b3ed6cef27 (patch)
treebbf19ce03e96a2234169847c321253232d779c34
parent6460572cc3403f4540d6cf7c862b154d81f02cae (diff)
downloadmuhqs-game-f5e740230cc2ac034b98496f1c0715b3ed6cef27.tar.gz
muhqs-game-f5e740230cc2ac034b98496f1c0715b3ed6cef27.zip
fix some kraken card implementations
* Devour the Poor!: Check if a card is buyable * Frost Pylon: Only spawn on free tiles
-rw-r--r--go/game/cardImplementations.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/go/game/cardImplementations.go b/go/game/cardImplementations.go
index f304ee1c..34567962 100644
--- a/go/game/cardImplementations.go
+++ b/go/game/cardImplementations.go
@@ -424,7 +424,7 @@ type devourThePoorImpl struct{ cardImplementationBase }
func (*devourThePoorImpl) onPlay(s *State, _ *Card, kraken *Player, _ *Targets) {
for _, u := range s.EnemyUnits(kraken) {
- if u.Card().BuyCosts.Costs(s) < 7 {
+ if !u.Card().IsBuyable() || u.Card().BuyCosts.Costs(s) < 7 {
s.destroyPermanent(u)
}
}
@@ -499,7 +499,12 @@ type frostPylonImpl struct {
func (*frostPylonImpl) spawnTiles(s *State, kraken *Player) (spawns []*Tile) {
for _, u := range s.EnemyUnits(kraken) {
- spawns = append(spawns, TilesInRange(s.Map, u, 1)...)
+ candiates := TilesInRange(s.Map, u, 1)
+ for _, candidate := range candiates {
+ if candidate.IsFree() {
+ spawns = append(spawns, candidate)
+ }
+ }
}
return
}