-----
--Mass storages lose the mass contained in them when they die
-----
HandleStorage = function(self, to_army)
if EntityCategoryContains(categories.MOBILE, self) then
return -- Exclude ACU / SCU / sparky
end
local bp = self:GetBlueprint()
local brain = GetArmyBrain(self:GetArmy())
for _, t in {'Mass', 'Energy'} do
if bp.Economy['Storage' .. t] then
local type = string.upper(t)
local amount = bp.Economy['Storage' .. t] * brain:GetEconomyStoredRatio(type)
brain:TakeResource(type, amount)
if to_army then
local to = GetArmyBrain(to_army)
to:GiveResource(type, amount)
end
end
end
end,
Statistics: Posted by Ithilis_Quo — 27 Oct 2019, 15:02
Statistics: Posted by Ithilis_Quo — 27 Oct 2019, 12:05