diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-02-04 14:37:15 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-01-27 16:43:47 +0100 |
| commit | ea54efacae089aa3644cfe00c8e180d5cc2c8d9e (patch) | |
| tree | 8b83151059e1d7661a366d350ef18eb913f4ce3d /go/game/tile.go | |
| parent | 9fc26075aa486e6887dbb28640224bffd1d57330 (diff) | |
| download | muhqs-game-ea54efacae089aa3644cfe00c8e180d5cc2c8d9e.tar.gz muhqs-game-ea54efacae089aa3644cfe00c8e180d5cc2c8d9e.zip | |
support crewing
* Introduce new callback for leaving a pile without beeing dropped
* Fix equipment contrsuctor
* Implement attack inheritance
Diffstat (limited to 'go/game/tile.go')
| -rw-r--r-- | go/game/tile.go | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/go/game/tile.go b/go/game/tile.go index ba600c66..3f9f9f5f 100644 --- a/go/game/tile.go +++ b/go/game/tile.go @@ -105,13 +105,27 @@ func (t *Tile) IsFree() bool { } func (t *Tile) IsAvailableForCard(card *Card) bool { - if t.Water && !card.hasPlacementConstrain("swimming") { + if t.IsFree() { + if t.Water && !card.hasPlacementConstrain("swimming") { + return false + } + if !t.Water && card.hasPlacementConstrain("swimming") { + return false + } + + return true + } + + x, err := t.Permanent.Card().getXEffect("crew") + if err != nil { return false } - if !t.Water && card.hasPlacementConstrain("swimming") { + + if len(t.Permanent.Pile()) == x { return false } - return t.IsFree() + + return true } func (t *Tile) OnDiagonal(other *Tile) bool { |
