Skip to content
Snippets Groups Projects
Commit fa7b2e7f authored by DarkGod's avatar DarkGod
Browse files

Fixed Assemble to try and not use archers/mages if it can avoid it

parent 41087455
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -459,12 +459,17 @@ newTalent{
if stats.bone_giant then stats.bone_giant:die(self) end
local list = {}
local skel_value = {warrior=1, archer=2, mage=3}
for _, m in ipairs(stats.list) do if m.skeleton_minion and not m.lord_of_skulls then list[#list+1] = m end end
if #list < 3 then return end
table.sort(list, function(a, b)
local va, vb = skel_value[a.skeleton_minion], skel_value[b.skeleton_minion]
if va ~= vb then return va > vb end
local pa, pb = a.life / a.max_life, b.life / b.max_life
if pa == pb then return a.creation_turn < b.creation_turn end
return pa < pb
if pa == pb then return a.creation_turn > b.creation_turn end
return pa > pb
end)
for i, s in ipairs(list) do game.log("===== %d : %s", i, s.skeleton_minion) end
local lev = t.getLevel(self, t)
local pos
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment