From 1393e8ff52d4d07cd8504c11450861888ca33ad2 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 30 Jul 2025 19:44:56 +0200 Subject: reduce amount of enemy units and potentially spawn a support equipment --- go/game/challenge.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/go/game/challenge.go b/go/game/challenge.go index ff43d061..b27ef162 100644 --- a/go/game/challenge.go +++ b/go/game/challenge.go @@ -41,8 +41,21 @@ func prepCavArcherChallenge(s *LocalState) *LocalState { s.addNewUnit(u, tile.Position, p) // Prepare the opponent's units - nUnits := rand.Intn(2) + 4 + nUnits := rand.Intn(2) + 2 + + // add support equipment + if nUnits > 3 { + candidates := NewDeckFromCardPaths(Sets.Base.CardPaths()).FilterCards(func(c *Card) bool { + return c.Type == CardTypes.Equipment + }) + e := NewCard(candidates[rand.Intn(len(candidates))].Path()) + tiles := s._map.AvailableTilesFor(e) + tile := tiles[rand.Intn(len(tiles))] + s.addNewEquipment(e, tile.Position, p) + } + units := make([]*Card, 0, nUnits) + ai := s.PlayerById(2) // Only use Melee Units candidates := NewDeckFromCardPaths(Sets.Base.CardPaths()).FilterCards(func(c *Card) bool { if c.Type != CardTypes.Unit { @@ -69,7 +82,6 @@ func prepCavArcherChallenge(s *LocalState) *LocalState { for _, u := range units { tiles := s._map.AvailableTilesFor(u) tile := tiles[rand.Intn(len(tiles))] - ai := s.PlayerById(2) s.addNewUnit(u, tile.Position, ai) } -- cgit v1.2.3