Statistics: Posted by odin002 — 26 Oct 2014, 00:25
# Look for newly defeated brains and tell them they're dead
local stillAlive = {}
for index,brain in ArmyBrains do
if not brain:IsDefeated() and not ArmyIsCivilian(brain:GetArmyIndex()) then
if brain:GetCurrentUnits(categoryCheck) == 0 then
brain:OnDefeat()
CallEndGame(false, true)
else
table.insert(stillAlive, brain)
end
end
end
# Look for newly defeated brains and tell them they're dead
local stillAlive = {}
for index,brain in ArmyBrains do
if not brain:IsDefeated() and not ArmyIsCivilian(brain:GetArmyIndex()) then
if categoryCheck == categories.COMMAND then
if brain:GetCurrentUnits(categoryCheck) == 1 then
brain:OnDefeat()
CallEndGame(false, true)
end
elseif brain:GetCurrentUnits(categoryCheck) == 0 then
brain:OnDefeat()
CallEndGame(false, true)
else
table.insert(stillAlive, brain)
end
end
end
Statistics: Posted by IceDreamer — 26 Oct 2014, 00:19
local categoryCheck = nil
if scenarioInfo.Options.Victory == 'demoralization' then
# You're dead if you have no commanders
categoryCheck = categories.COMMAND
elseif scenarioInfo.Options.Victory == 'domination' then
# You're dead if all structures and engineers are destroyed
categoryCheck = categories.STRUCTURE + categories.ENGINEER - categories.WALL
elseif scenarioInfo.Options.Victory == 'eradication' then
# You're dead if you have no units
categoryCheck = categories.ALLUNITS - categories.WALL
else
# no victory condition
return
end
local categoryCheck = nil
if scenarioInfo.Options.Victory == 'demoralization' then
# You're dead if you have no commanders
if categories.COMMAND == 1 then
categoryCheck = 0
else
categoryCheck = categories.COMMAND
end
elseif scenarioInfo.Options.Victory == 'domination' then
# You're dead if all structures and engineers are destroyed
categoryCheck = categories.STRUCTURE + categories.ENGINEER - categories.WALL
elseif scenarioInfo.Options.Victory == 'eradication' then
# You're dead if you have no units
categoryCheck = categories.ALLUNITS - categories.WALL
else
# no victory condition
return
end
if scenarioInfo.Options.Victory == 'demoralization' then
# You're dead if you have no commanders
categoryCheck = categories.COMMAND +1
elseif scenarioInfo.Options.Victory == 'domination' then
Statistics: Posted by odin002 — 26 Oct 2014, 00:06