From 5dae3b7e97669bc6ad5dfc61bbb1903aeb03aaf3 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 8 Feb 2023 12:44:07 +0100 Subject: 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 --- go/game/state.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'go/game/state.go') 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) + } } } -- cgit v1.2.3