diff --git a/changelog b/changelog index b2682e54c3cc..cc9139ac0cb4 100644 --- a/changelog +++ b/changelog @@ -3,6 +3,9 @@ Version 1.12.0+dev: * Big Animals Micro AI: bug fix for units not attacking when [avoid_unit] is not set * Lurkers MAI: bug fix for attack error when lurker runs into ambush + * Campaigns + * Son of the Black Eye: + * S6 Black Flag: reduce randomness of unit types unloading from galleons * Editor: * Fixed falcon race missing an icon due to having incorrectly-named image files. diff --git a/data/campaigns/Son_Of_The_Black_Eye/ai/ca_transport_S6.lua b/data/campaigns/Son_Of_The_Black_Eye/ai/ca_transport_S6.lua index da86082dc21b..c6192e710ef4 100644 --- a/data/campaigns/Son_Of_The_Black_Eye/ai/ca_transport_S6.lua +++ b/data/campaigns/Son_Of_The_Black_Eye/ai/ca_transport_S6.lua @@ -110,16 +110,27 @@ function ca_transport:execution(ai) -- Also unload units table.sort(best_adj_tiles, function(a, b) return a[3] > b[3] end) - for i = 1, math.min(#best_adj_tiles, 3) do - local command = "local H = wesnoth.require 'lua/helper.lua' " - .. "wesnoth.put_unit(".. best_adj_tiles[i][1] .. "," .. best_adj_tiles[i][2] + local command = "local unit = wesnoth.get_unit(x1, y1) " + .. "unit.variables.landed = 'yes' " + .. "unit.variables.destination_x = 1 " + .. "unit.variables.destination_y = 30" + ai.synced_command(command, best_unit.x, best_unit.y) + + -- Unload 1 level 2 unit + local l2_type = H.rand('Swordsman,Javelineer,Pikeman') + local command = "wesnoth.put_unit(".. best_adj_tiles[1][1] .. "," .. best_adj_tiles[1][2] + .. ", { side = " .. wesnoth.current.side + .. ", type = '" .. l2_type + .. "', moves = 2 })" + ai.synced_command(command, best_unit.x, best_unit.y) + + -- Unload up to 2 level 1 units + for i = 2, math.min(#best_adj_tiles, 3) do + local l1_type = H.rand('Fencer,Mage,Cavalryman,Bowman,Spearman') + local command = "wesnoth.put_unit(".. best_adj_tiles[i][1] .. "," .. best_adj_tiles[i][2] .. ", { side = " .. wesnoth.current.side - .. ", type = H.rand('Fencer,Swordsman,Mage,Cavalryman,Javelineer,Bowman,Pikeman,Bowman,Fencer')" - .. ", moves = 2 }) " - .. "local unit = wesnoth.get_unit(x1, y1) " - .. "unit.variables.landed = 'yes' " - .. "unit.variables.destination_x = 1 " - .. "unit.variables.destination_y = 30" + .. ", type = '" .. l1_type + .. "', moves = 2 })" ai.synced_command(command, best_unit.x, best_unit.y) end