aboutsummaryrefslogtreecommitdiff
path: root/go/game/state.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-02-08 12:44:07 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2025-01-27 16:43:48 +0100
commit5dae3b7e97669bc6ad5dfc61bbb1903aeb03aaf3 (patch)
tree62ce4be85d1014d797cfadbebe38e6a11872dbf3 /go/game/state.go
parentbb7810a4bb0ee1a3c21de67e857ca41596646da3 (diff)
downloadmuhqs-game-5dae3b7e97669bc6ad5dfc61bbb1903aeb03aaf3.tar.gz
muhqs-game-5dae3b7e97669bc6ad5dfc61bbb1903aeb03aaf3.zip
intermediate commit
* detect tokens and do not add them to pile of cards * only add spells not already in exile to their owners discard pile * add the played card to onPlay callback
Diffstat (limited to 'go/game/state.go')
-rw-r--r--go/game/state.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/go/game/state.go b/go/game/state.go
index 5a4714f7..7a54ddc0 100644
--- a/go/game/state.go
+++ b/go/game/state.go
@@ -392,14 +392,15 @@ func (s *State) resolvePlay(p *Player, c *Card, targets *Targets) {
s.addNewEquipment(c, tile.Position, p)
}
case CardTypes.Spell:
- c.Impl.onPlay(s, p, targets)
+ c.Impl.onPlay(s, c, p, targets)
default:
log.Printf("Resolving unhandled card type: %s\n", c.Type.String())
}
- if c.IsPermanent() {
- } else {
- p.DiscardPile.AddCard(c)
+ if c.Type == CardTypes.Spell {
+ if !s.Exile.Contains(c) {
+ p.DiscardPile.AddCard(c)
+ }
}
}