aboutsummaryrefslogtreecommitdiff
path: root/go/game/tile.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-02-04 14:37:15 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2025-01-27 16:43:47 +0100
commitea54efacae089aa3644cfe00c8e180d5cc2c8d9e (patch)
tree8b83151059e1d7661a366d350ef18eb913f4ce3d /go/game/tile.go
parent9fc26075aa486e6887dbb28640224bffd1d57330 (diff)
downloadmuhqs-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.go20
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 {