diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-07-24 20:06:34 -0400 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-08-20 15:57:31 +0200 |
| commit | fcbe5fb2314baf858362f26664e1438d0f4ef89a (patch) | |
| tree | 19f848cf91363ed6149add4e8beda3671db41bf3 | |
| parent | d375063d6fc51eda5139ad1e1b418fec25663a1c (diff) | |
| download | muhqs-game-fcbe5fb2314baf858362f26664e1438d0f4ef89a.tar.gz muhqs-game-fcbe5fb2314baf858362f26664e1438d0f4ef89a.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}) |
