Jesus4Lyf
Good Idea™
- Reaction score
- 397
You can write a wrapper function.is there a way to block percent of damage taken? if not, why don't you replace this:
JASS:public function BlockAll takes nothing returns nothing set ToBlock[TypeStackLevel]=ToBlock[TypeStackLevel]+GetEventDamage() endfunction
with this:
JASS:public function BlockPercent takes real percent returns nothing set ToBlock[TypeStackLevel]=ToBlock[TypeStackLevel] + GetEventDamage()*percent endfunction
percent being any number between 0 and 1
I've changed it like that for my map (hope you don't mind) and it works
JASS:
function Damage_BlockPercent takes real percent returns nothing
call Damage_Block(GetEventDamage()*percent)
endfunction
Best approach, doesn't touch the library. I believe it will inline, too.