diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-02-15 15:49:50 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-08-20 15:50:10 +0200 |
| commit | b810c024c301fdbe3d0833422bd18449d66d276a (patch) | |
| tree | 9fe207e1dc0c74c8670a9a86d9bda0eb88ed6b07 /go/game/state.go | |
| parent | 259b2f2b2af8f23bc2fe193838e7f7ecfc61c23a (diff) | |
| download | muhqs-game-b810c024c301fdbe3d0833422bd18449d66d276a.tar.gz muhqs-game-b810c024c301fdbe3d0833422bd18449d66d276a.zip | |
implement the basics of the rest of the base cards
* Add more TODOs
* Implement permanents granting more spawn tiles
Diffstat (limited to 'go/game/state.go')
| -rw-r--r-- | go/game/state.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/go/game/state.go b/go/game/state.go index 5c2fd053..a5a9de82 100644 --- a/go/game/state.go +++ b/go/game/state.go @@ -409,6 +409,16 @@ func (s *State) resolvePlay(p *Player, c *Card, targets *Targets) { } } +func (s *State) additionalSpawnsFor(p *Player, cType CardType) (spawns []*Tile) { + for _, perm := range s.Permanents { + if perm.Controller() != p { + continue + } + spawns = append(spawns, perm.Card().Impl.additionalSpawnsFor(perm, cType)...) + } + return +} + func (s *State) SpawnTiles(p *Player) []*Tile { spawns := s.Map.FilterTiles(func(t *Tile) bool { if t.Type != TileTypes.Spawn { @@ -459,6 +469,8 @@ func (s *State) AvailableSpawnTiles(p *Player, c *Card) []*Tile { } else { candidates = s.SpawnTiles(p) } + + candidates = append(candidates, s.additionalSpawnsFor(p, c.Type)...) } tiles := []*Tile{} |
