Closed Praytic closed 8 months ago
Below are some notes on this issue.
Original JASS code has this function.
function ETv takes integer D0 returns integer
local integer e7=RC[cL[D0]]
if e7==1 then
set e7=0
elseif e7==7 then
set e7=5
endif
return e7
endfunction
This is the creep.getSize()
function used in tower scripts. It returns creep size, except if creep is CHALLENGE_MASS OR CHALLENGE_BOSS, it returns MASS or BOSS.
Note that in original youtd engine, functions like doCustomAttackDamage() also convert challenge sizes to "simple" sizes.
function doCustomAttackDamage takes integer caster,integer target,real damage,real crit_ratio,integer attack_type returns nothing
local boolean E9v=Ic
set damage=damage*crit_ratio*tL[TL[target]+3]*Euv(caster,RC[cL[target]])*lL[LL[caster]+OC[cL[target]]]*kL[KL[target]+OC[cL[caster]]]
set Ic=(((crit_ratio)*1.)>1.)
call doCustomAttackDamage_internal(bL[caster],bL[target],damage,kB[attack_type])
set Ic=E9v
endfunction
function Euv takes integer D0,integer e7 returns real
if e7==1 then
set e7=0
elseif e7==7 then
set e7=5
endif
return mL[ML[D0]+e7]
endfunction
So if tower deals +100% to mass creeps, it will also deal +100% to mass challenge creeps.
There also some weirdness in tower scripts which assume that creep.getSize() returns challenge sizes. Need to fix those case by case.
Example of tower which doesn't follow this rule: Broken Circle of Wind