aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--go/game/challenge.go16
1 files 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)
}