Statistics: Posted by rockoe10 — 04 Apr 2014, 23:14
-- Return the total time in seconds, cost in energy, and cost in mass to reclaim the given target from 100%.
-- The energy and mass costs will normally be negative, to indicate that you gain mass/energy back.
GetReclaimCosts = function(self, target_entity)
local bp = self:GetBlueprint()
local target_bp = target_entity:GetBlueprint()
if IsUnit(target_entity) then
#LOG('Reclaim Target Is Unit')
local mtime = target_bp.Economy.BuildCostEnergy / self:GetBuildRate()
local etime = target_bp.Economy.BuildCostMass / self:GetBuildRate()
local time = mtime
if mtime < etime then
time = etime
end
time = time * (self.ReclaimTimeMultiplier or 1)
time = math.max( (time/10), 0.0001) -- this should never be 0 or we'll divide by 0!
return time, target_bp.Economy.BuildCostEnergy, target_bp.Economy.BuildCostMass
elseif IsProp(target_entity) then
local time, energy, mass = target_entity:GetReclaimCosts(self)
#LOG('*DEBUG: Reclaiming a prop. Time = ', repr(time), ' Mass = ', repr(mass), ' Energy = ', repr(energy))
return time, energy, mass
end
end,
-- Return the total time in seconds, cost in energy, and cost in mass to capture the given target.
-- Calculation given by Jake - 6/26/06
GetCaptureCosts = function(self, target_entity)
local target_bp = target_entity:GetBlueprint().Economy
local bp = self:GetBlueprint().Economy
local time = ((target_bp.BuildTime or 10) / self:GetBuildRate()) / 2
local energy = target_bp.BuildCostEnergy or 100
time = time * (self.CaptureTimeMultiplier or 1)
return time, energy, 0
end,
Statistics: Posted by Crotalus — 04 Apr 2014, 03:35
Statistics: Posted by rockoe10 — 03 Apr 2014, 23:38
ZLO_RD wrote:speed wich unit can be reclaimed by build capacity depends on amount of build power and build time of target
it is pretty easy imho, for example: reclaimming t1 radar takes alot of time, while ACU can reclaim hydrocarbon faster then shoot it down
so you just take unit build time and divide by your build power and you get time that you need to reclaim target (then may divide HP on time and get DPS of reclaim
Statistics: Posted by ZLO_RD — 20 Mar 2014, 22:00
Statistics: Posted by rockoe10 — 20 Mar 2014, 18:34
Statistics: Posted by E8400-CV — 19 Mar 2014, 19:22
Statistics: Posted by CrayzyNath — 18 Mar 2014, 22:10
Statistics: Posted by Vee — 18 Mar 2014, 21:39
Statistics: Posted by ZLO_RD — 18 Mar 2014, 20:41