/*
a - Give/Set/Remove
b - Passive/Item
c - Resist/Attack
d - Resistance/Attack
e - ""/", real howMuch"
f - container to hold the value(including [].real[])
g - 0/howMuch/read container + howMuch
*/
//! textmacro PRIVATE_EXPAND_SIMPLE_ATT_RES takes a, b, c, d, e, f, g
function $a$$b$$c$ takes integer id, $d$ which $e$ returns nothing
set $f$ = $g$
endfunction
//! endtextmacro
//resistances
//! runtextmacro PRIVATE_EXPAND_SIMPLE_ATT_RES("Give", "Passive", "Resist", "Resistance", ", real howMuch", "spellPassiveResist[which].real[id]", "howMuch")
//! runtextmacro PRIVATE_EXPAND_SIMPLE_ATT_RES("Add", "Passive", "Resist", "Resistance", ", real howMuch", "spellPassiveResist[which].real[id]", "spellPassiveResist[which].real[id] + howMuch")
//! runtextmacro PRIVATE_EXPAND_SIMPLE_ATT_RES("Remove", "Passive", "Resist", "Resistance", "", "spellPassiveResist[which].real[id]", "0")
//! runtextmacro PRIVATE_EXPAND_SIMPLE_ATT_RES("Give", "Item", "Resist", "Resistance", ", real howMuch", "itemPassiveResist[which].real[id]", "howMuch")
//! runtextmacro PRIVATE_EXPAND_SIMPLE_ATT_RES("Add", "Item", "Resist", "Resistance", ", real howMuch", "itemPassiveResist[which].real[id]", "itemPassiveResist[which].real[id] + howMuch")
//! runtextmacro PRIVATE_EXPAND_SIMPLE_ATT_RES("Remove", "Item", "Resist", "Resistance", "", "itemPassiveResist[which].real[id]", "0")
//attacks
//! runtextmacro PRIVATE_EXPAND_SIMPLE_ATT_RES("Give", "Passive", "Attack", "Attack", ", real howMuch", "spellPassiveAttack[which].real[id]", "howMuch")
//! runtextmacro PRIVATE_EXPAND_SIMPLE_ATT_RES("Add", "Passive", "Attack", "Attack", ", real howMuch", "spellPassiveAttack[which].real[id]", "spellPassiveAttack[which].real[id] + howMuch")
//! runtextmacro PRIVATE_EXPAND_SIMPLE_ATT_RES("Remove", "Passive", "Attack", "Attack", "", "spellPassiveAttack[which].real[id]", "0")
//! runtextmacro PRIVATE_EXPAND_SIMPLE_ATT_RES("Give", "Item", "Attack", "Attack", ", real howMuch", "itemPassiveAttack[which].real[id]", "howMuch")
//! runtextmacro PRIVATE_EXPAND_SIMPLE_ATT_RES("Add", "Item", "Attack", "Attack", ", real howMuch", "itemPassiveAttack[which].real[id]", "itemPassiveAttack[which].real[id] + howMuch")
//! runtextmacro PRIVATE_EXPAND_SIMPLE_ATT_RES("Remove", "Item", "Attack", "Attack", "", "itemPassiveAttack[which].real[id]", "0")
private struct dataholder extends array
implement Alloc
integer id
real howMuch
integer which
static method create takes nothing returns thistype
return allocate()
endmethod
method destroy takes nothing returns nothing
call deallocate()
endmethod
endstruct
/*
a - Give/Add/Remove
b - Resist/Attack
c - Resistance/Attack
d - ""/", real howMuch, real time"
e - container to store the data in(including [].real[])
f - random identifier
g - container to set after timeout
h - true/false(if we are using Remove or not)
*/
//! textmacro PRIVATE_EXPAND_ABIT_ATT_RES takes a, b, c, d, e, f, g, h
static if not $h$ then
private function timeOut$f$ takes nothing returns nothing
local timer t = GetExpiredTimer()
local dataholder data = GetTimerData(t)
call ReleaseTimer(t)
set $g$ = data.howMuch
set t = null
endfunction
endif
function $a$Spell$b$ takes integer id, $c$ which $d$ returns nothing
static if not $h$ then
local dataholder data = dataholder.create()
set data.howMuch = $e$
set data.id = id
set data.which = which
set $e$ = $e$ + howMuch
call TimerStart(NewTimerEx(data), time, false, function timeOut$f$)
else
set $e$ = 0
endif
endfunction
//! endtextmacro
//! runtextmacro PRIVATE_EXPAND_ABIT_ATT_RES("Give", "Resist", "Resistance", ", real howMuch, real time", "spellOnCastResist[which].real[id]", "gr", "spellOnCastResist[data.which].real[data.id]", "false")
//! runtextmacro PRIVATE_EXPAND_ABIT_ATT_RES("Add", "Resist", "Resistance", ", real howMuch, real time", "spellOnCastResist[which].real[id]", "ar", "spellOnCastResist[data.which].real[data.id]", "false")
//! runtextmacro PRIVATE_EXPAND_ABIT_ATT_RES("Remove", "Resist", "Resistance", "", "spellOnCastResist[which].real[id]", "", "", "true")
private struct dataholderUnit extends array
implement Alloc
unit unit_t
integer which
real howMuch
static method create takes nothing returns thistype
return allocate()
endmethod
method destroy takes nothing returns nothing
call deallocate()
endmethod
endstruct
//! textmacro PRIVATE_EXPAND_HARDCORE_ATT_RES
static if not $$ then
private function onTime$$ takes nothing returns nothing
local timer t = GetExpiredTimer()
local dataholderUnit d = GetTimerData(t)
set $$ = d.howMuch
call ReleaseTimer(t)
set t = null
endfunction
endif
function $$Unit$$ takes
//! endtextmacro