diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-07-24 20:06:34 -0400 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-07-28 18:03:10 +0200 |
| commit | 6c78e02e1968c57a7f4c7592860cda4c812a9219 (patch) | |
| tree | 2c32cf2938f7c6795a8f7b0e76e6389a99dec5ff | |
| parent | d4e04a8736adb91c84323608b67bfa67c28f09cb (diff) | |
| download | muhqs-game-6c78e02e1968c57a7f4c7592860cda4c812a9219.tar.gz muhqs-game-6c78e02e1968c57a7f4c7592860cda4c812a9219.zip | |
include only buyable cards during a challenge
| -rw-r--r-- | go/game/challenge.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/go/game/challenge.go b/go/game/challenge.go index 9ce4515e..ff43d061 100644 --- a/go/game/challenge.go +++ b/go/game/challenge.go @@ -91,7 +91,8 @@ func prepBaseChallenge(s *LocalState) *LocalState { p := s.PlayerById(1) nCards := rand.Intn(6) nCards = nCards + 3 - NewRandomDeck(nCards, []SetIdentifier{Sets.Base, Sets.Magic, Sets.Equipments}).MoveInto(p.Store) + d := NewRandomDeck(nCards, []SetIdentifier{Sets.Base, Sets.Magic, Sets.Equipments}) + p.Store.AddCards(d.FilterCards(func(c *Card) bool { return c.IsBuyable() })) ai := s.PlayerById(2) ai.Deck = NewRandomDeck(nCards, []SetIdentifier{Sets.Base}) |
