Statistics: Posted by Tanksy — 03 Sep 2016, 16:23
do
local OldBuffAffectUnit = BuffAffectUnit
function BuffAffectUnit(unit, buffName, instigator, afterRemove)
local buffDef = Buffs[buffName]
local buffAffects = buffDef.Affects
if buffDef.OnBuffAffect and not afterRemove then
buffDef:OnBuffAffect(unit, instigator)
end
for atype, vals in buffAffects do
if atype == 'EnergyProductionBuf' then
local val = BuffCalculate(unit, buffName, 'EnergyProductionBuf', unit:GetBlueprint().Economy.ProductionPerSecondEnergy or 0)
unit.EnergyProdMod = val
unit:UpdateProductionValues()
elseif atype == 'MassProductionBuf' then
local val = BuffCalculate(unit, buffName, 'MassProductionBuf', unit:GetBlueprint().Economy.ProductionPerSecondMass or 0)
unit.MassProdMod = val
unit:UpdateProductionValues()
#### ADJACENCY BELOW ####
elseif atype == 'BuildRate2' then
local Buildval = unit:GetBlueprint().Economy.BuildRate
local val = BuffCalculate(unit, buffName, 'BuildRate2', 0)
unit:SetBuildRate( Buildval+val )
#LOG('*BUFF: BuildRate2 = ' .. val)
end
end
OldBuffAffectUnit(unit, buffName, instigator, afterRemove)
end
end
Statistics: Posted by RavenCurow — 03 Sep 2016, 12:31
Statistics: Posted by RavenCurow — 03 Sep 2016, 12:02
Statistics: Posted by Tanksy — 02 Sep 2016, 16:06
Statistics: Posted by Exotic_Retard — 02 Sep 2016, 15:36
Statistics: Posted by Tanksy — 02 Sep 2016, 15:34
Statistics: Posted by Krapougnak — 02 Sep 2016, 14:54
Statistics: Posted by Tanksy — 02 Sep 2016, 09:57
Statistics: Posted by ZLO_RD — 29 Aug 2016, 17:56