Dirac
22710180
- Reaction score
- 147
JASS:
library GlobalDamage uses/*
*/ Damage /* thehelper.net/forums/showthread.php/168144-Damage-Struct
// Use if you wish to have a function that fires every time damage is dealt
// besides from the specific unit event firing.
***********************************************************************
API:
function RegisterGlobalDamage takes code func returns nothing
// Runs after damage mods and unit damage events. Function should
// return false
**********************************************************************/
//! textmacro GLOBAL_DAMAGE_EX1
globals
private trigger GlobalTrig =CreateTrigger()
private boolexpr GlobalCond =null
endglobals
function RegisterGlobalDamage takes code func returns nothing
if GlobalCond==null then
set GlobalCond=Filter(func)
else
set GlobalCond=Or(Filter(func),GlobalCond)
call TriggerClearConditions(GlobalTrig)
endif
call TriggerAddCondition(GlobalTrig,GlobalCond)
endfunction
//! endtextmacro
//! textmacro GLOBAL_DAMAGE_EX2
call TriggerEvaluate(GlobalTrig)
//! endtextmacro
endlibrary