|
[jass]
function Yeyu takes nothing returns gamecache
if udg_GameCache == null then
call FlushGameCache( udg_GameCache )
set udg_GameCache = InitGameCache( "Yeyu.w3v")
endif
return udg_GameCache
endfunction
function H2I takes handle h returns integer
return h
return 0
endfunction
function I2T takes integer i returns trigger
return i
return null
endfunction
function I2TC takes integer i returns triggercondition
return i
return null
endfunction
function SetHandleInt takes handle subject, string name, integer value returns nothing
if value==0 then
call FlushStoredInteger(Yeyu(),I2S(H2I(subject)),name)
else
call StoreInteger(Yeyu(), I2S(H2I(subject)), name, value)
endif
endfunction
function GetHandleInt takes handle subject, string name returns integer
return GetStoredInteger(Yeyu(), I2S(H2I(subject)), name)
endfunction
function FlushHandleInt takes handle subject, string name returns nothing
call FlushStoredInteger(Yeyu(),I2S(H2I(subject)),name)
endfunction
function FlushHandleLocals takes handle subject returns nothing
call FlushStoredMission(Yeyu(), I2S(H2I(subject)) )
endfunction
function GoFun takes string s returns nothing
call ExecuteFunc(s)
endfunction
function DamageFunIf takes nothing returns nothing
local integer i = 1
loop
exitwhen i > GetHandleInt(gg_trg_Init2,"Trigger")
call GoFun("Trig_" + "SSBC" + I2S(i) + "_Actions")
set i = i + 1
endloop
endfunction
function DamageFun takes unit u,boolean boo returns nothing
local integer t
local integer tc
if boo then
set t = H2I(CreateTrigger())
set tc = H2I(TriggerAddCondition( I2T(t), Condition( function DamageFunIf ) ))
call TriggerRegisterUnitEvent( I2T(t), u, EVENT_UNIT_DAMAGED )
call SetHandleInt(u,"Trigger",t)
call SetHandleInt(u,"TriggerC",tc)
else
set t = GetHandleInt(u,"Trigger")
set tc = GetHandleInt(u,"TriggerC")
call TriggerRemoveCondition(I2T(t),I2TC(tc))
call FlushHandleInt(u,"Trigger")
call FlushHandleInt(u,"TriggerC")
call DestroyTrigger(I2T(t))
endif
endfunction
function SSBCCC takes nothing returns nothing
if GetPlayerController(GetOwningPlayer(GetTriggerUnit())) != MAP_CONTROL_USER then
call DamageFun(GetTriggerUnit(),false)
endif
endfunction
function SSBCCCC takes nothing returns nothing
call DamageFun(GetTriggerUnit(),true)
endfunction
function SSBCCCCC takes nothing returns nothing
call DamageFun(GetEnumUnit(),true)
endfunction
function SSBCC takes integer i returns nothing
local integer t
local integer tc
call SetHandleInt(gg_trg_Init2,"Trigger",i)
set t = H2I(CreateTrigger())
set tc = H2I(TriggerAddCondition( I2T(t), Condition( function SSBCCC ) ))
call TriggerRegisterAnyUnitEventBJ( I2T(t), EVENT_PLAYER_UNIT_DEATH )
set t = H2I(CreateTrigger())
set tc = H2I(TriggerAddCondition( I2T(t), Condition( function SSBCCCC ) ))
call TriggerRegisterEnterRectSimple( I2T(t), GetPlayableMapRect() )
call ForGroupBJ( GetUnitsInRectAll(GetPlayableMapRect()), function SSBCCCCC )
call DestroyGroup( bj_lastCreatedGroup )
endfunction
function InitTrig_Init takes nothing returns nothing
endfunction
-------------------------------------------
移植过来的伤害事件代码
偶尔会失效的样子
不知道是不是这玩意儿害我系统不稳定 |
|