Icyculyr
I'm a Mac
- Reaction score
- 68
Ok cool.
and the footman has locust
"Cool Indeed."
function CreateMine_MineId takes nothing returns integer
return 039;hkni039;
endfunction
function CreateMine_DetonationRange takes nothing returns real
return 300.
endfunction
function CreateMine_AlwaysTrue takes nothing returns boolean
return true
endfunction
function CreateMine_Detonate takes nothing returns nothing
local unit footy=GetTriggerUnit()
if(GetUnitTypeId(footy)==039;hfoo039;)then
call SetUnitExploded(footy,true)
call KillUnit(footy)
endif
set footy=null
endfunction
function CreateMine takes nothing returns nothing
local unit mine=GetEnteringUnit()
local trigger t
if(GetUnitTypeId(mine)==CreateMine_MineId())then
set t=CreateTrigger()
call TriggerRegisterUnitInRange(t,mine,CreateMine_DetonationRange(),Condition(function CreateMine_AlwaysTrue))
call TriggerAddAction(t,function CreateMine_Detonate)
endif
set mine=null
endfunction
//========================================================================================================
function InitTrig_CreateMine takes nothing returns nothing
local trigger t=CreateTrigger()
local region rectRegion=CreateRegion()
call RegionAddRect(rectRegion,GetPlayableMapRect())
call TriggerRegisterEnterRegion(t,rectRegion,Condition(function CreateMine_AlwaysTrue))
call TriggerAddAction(t,function CreateMine)
set rectRegion=null
set t=null
endfunction