afisakov
You can change this now in User CP.
- Reaction score
- 37
I was making an ability that doubles every level and I though the easiest way was to use exponents.
I ended up with a damage function that I posted below.
This trigger activates on attack and has 15 possible levels. My question is is it ok to keep it as an exponent function to calculate each time or do I have to create an array to hold the values for each lvl and reference those to save on computer resources.
Does anyone know how the processor load of a calculation like 2048*1.05^15+100*2^15 compares to creating and destroying a special effect?
Thank you for the assistance
P.S. how do I fix the spelling in my title? (not sure how to edit it)
I ended up with a damage function that I posted below.
This trigger activates on attack and has 15 possible levels. My question is is it ok to keep it as an exponent function to calculate each time or do I have to create an array to hold the values for each lvl and reference those to save on computer resources.
Does anyone know how the processor load of a calculation like 2048*1.05^15+100*2^15 compares to creating and destroying a special effect?
Code:
function gtson takes nothing returns boolean
return UnitHasBuffBJ(GetAttacker(),'B013')
endfunction
function getsu_slash takes nothing returns nothing
local integer gbl
call TriggerSleepAction(0.1)
if gtson() then
set fint1=rcount(GetAttacker())
set gbl=GetUnitAbilityLevel(GetAttacker(),'A0VI')
if(GetRandomInt(1,10)<=3+fint1)then
set tp1=GetUnitLoc(GetAttackedUnitBJ())
set dx=(I2R(GetHeroStr(GetAttacker()*gbl))*Pow(1.05,gbl)+125*Pow(2.,gbl))*ab1(GetAttacker())/2.
call hitaoe(GetAttacker())
call UnitDamageTargetBJ(GetAttacker(),GetAttackedUnitBJ(),dx,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC)
call DestroyEffect(AddSpecialEffectLocBJ(tp1,"Abilities\\Spells\\Orc\\FeralSpirit\\feralspirittarget.mdl"))
call DestroyEffect(AddSpecialEffectLocBJ(tp1,"Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl"))
call RemoveLocation (tp1)
endif
...other stuff here
endfunction
Thank you for the assistance
P.S. how do I fix the spelling in my title? (not sure how to edit it)