aboutsummaryrefslogtreecommitdiff
path: root/go/game/cardImplementations_test.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-08-06 09:34:33 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2025-08-20 15:57:34 +0200
commit6eb0cde9c815527db2059a006ec9bbd664b6f65d (patch)
tree18ef881ee8ef07713421c53d319780494f2e4124 /go/game/cardImplementations_test.go
parentdeee4b76b6ab1a94e5578818aba4b94e22e6ac89 (diff)
downloadmuhqs-game-6eb0cde9c815527db2059a006ec9bbd664b6f65d.tar.gz
muhqs-game-6eb0cde9c815527db2059a006ec9bbd664b6f65d.zip
consider houses when determining damage for a tile
Diffstat (limited to 'go/game/cardImplementations_test.go')
-rw-r--r--go/game/cardImplementations_test.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/go/game/cardImplementations_test.go b/go/game/cardImplementations_test.go
index fc051f4e..b962677c 100644
--- a/go/game/cardImplementations_test.go
+++ b/go/game/cardImplementations_test.go
@@ -68,9 +68,10 @@ func TestPikemanRange(t *testing.T) {
mapDef := `map: |1-
SSS
SSS
- SSS
+ SHS
symbols:
S: street
+ H: house
`
s := NewLocalState()
@@ -82,7 +83,8 @@ symbols:
p := s.addNewUnit(NewCard("base/pikeman"), Position{0, 0}, player)
c := s.addNewUnit(NewCard("base/cavalry"), Position{0, 2}, opo)
- ca := s.addNewUnit(NewCard("base/cavalry_archer"), Position{1, 2}, opo)
+ prot := s.addNewUnit(NewCard("base/cavalry_archer"), Position{1, 2}, opo)
+ ca := s.addNewUnit(NewCard("base/cavalry_archer"), Position{2, 1}, opo)
k := s.addNewUnit(NewCard("base/knight"), Position{2, 0}, opo)
attackable := utils.TypedSliceToInterfaceSlice(p.AttackableEnemyPermanents())
@@ -95,6 +97,9 @@ symbols:
if utils.InterfaceSliceContains(attackable, k) {
t.Fatal("knight is attackable")
}
+ if utils.InterfaceSliceContains(attackable, prot) {
+ t.Fatal("cavalry is protected")
+ }
a := NewAttackAction(p)
err := a.Target().AddSelection(c)