Improved duration stacking (code included)
Posted: Fri May 24, 2013 3:23 am
In short:
replace all instances of:
in timed effects with
What this does is weight the duration such that the dps of any given effect will never decrease from the sum of the two parts (alternatively you can do it as the max of their dps's instead of the sum, but this has the weird situation where without capping it would just stack duration instead of damage, and is therefore wrong)
replace all instances of:
Code: Select all
local dur = math.ceil((old_eff.dur + new_eff.dur) / 2)
Code: Select all
local dur = math.floor((old_dam + new_dam) / (old_eff.power + new_effect.power))