From f9ab2cfdb25eb3fcd85868a2e375326a9c8b6022 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 15 Feb 2023 13:13:06 +0100 Subject: intermediate commit * fix a lot of target and action bugs * check target selection before adding it to the prompt * use the store view for stores on the map * fix card highlighting in CardGrid * Only prompt for Upkeep-/DiscardActions if appropriate * Add helper for areaEffects granting new FullActions * Add Target() helper selecting the first target to the Action interface * Fix BuyAction and DiscardAction targets * Remember the stores a player has seen --- go/game/ai.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'go/game/ai.go') diff --git a/go/game/ai.go b/go/game/ai.go index bda7356a..9b48c2f5 100644 --- a/go/game/ai.go +++ b/go/game/ai.go @@ -90,7 +90,7 @@ func selectRandomTargets(rand *rand.Rand, targets *Targets) error { if len(options) > 1 { idx = rand.Intn(len(options) - 1) } - t.AddSelection(options[idx]) + _ = t.AddSelection(options[idx]) } } return nil @@ -211,7 +211,7 @@ func moveTowardsNearestEnemyUnit(ai *UnitAI) Action { } a := NewMoveAction(ai.u) - a.Targets().ts[0].AddSelection(ai.s.Map.TileAt(target)) + _ = a.Target().AddSelection(ai.s.Map.TileAt(target)) return a } -- cgit v1.2.3