diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-07-21 08:34:52 -0400 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-07-22 12:54:28 -0400 |
| commit | 2efe13ae51f9184de6ebd34f82e788f5b49fcdf6 (patch) | |
| tree | ef89a0136adfaf7483d5a5a4d36b899909225d7f /go/game/areaEffect_test.go | |
| parent | feeb0d6c75ed5747c8642c9ec0fc2ad8b89fab5f (diff) | |
| download | muhqs-game-2efe13ae51f9184de6ebd34f82e788f5b49fcdf6.tar.gz muhqs-game-2efe13ae51f9184de6ebd34f82e788f5b49fcdf6.zip | |
add more deck and farm area effect tests
Diffstat (limited to 'go/game/areaEffect_test.go')
| -rw-r--r-- | go/game/areaEffect_test.go | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/go/game/areaEffect_test.go b/go/game/areaEffect_test.go index 0da2c8ac..30bcb760 100644 --- a/go/game/areaEffect_test.go +++ b/go/game/areaEffect_test.go @@ -16,8 +16,7 @@ symbols: m, _ := readMap(r) s.SetMap(m) - s.AddNewPlayer("player", NewDeck()) - p := s.Players()[0] + p := s.AddNewPlayer("player", NewDeck()) t0_0 := s.Map().TileAt(Position{0, 0}) entered0_0, left0_0 := false, false @@ -68,3 +67,31 @@ symbols: sword := newEquipmentFromPath("base/sword", t0_1, p) s.addPermanent(sword) } + +func TestFarmEffect(t *testing.T) { + mapDef := `map: |1- + FH +symbols: + F: farm + H: house +` + s := NewLocalState() + r := strings.NewReader(mapDef) + m, _ := readMap(r) + s.SetMap(m) + + p := s.AddNewPlayer("player", NewDeck()) + f := s.addNewUnit(NewCard("misc/farmer"), Position{0, 0}, p) + if len(f.FullActions) != 1 { + t.Fatal("farmer has no farm fullaction") + } + + a := NewMoveAction(f) + a.Target().AddSelection(m.TileAt(Position{1, 0})) + + a.resolve(s) + + if len(f.FullActions) != 0 { + t.Fatal("farmer still has farm fullaction") + } +} |
