|
[codes=jass]
local timer t = GetExpiredTimer()
local unit u = I2U(GetStoredInteger(GameCache(),I2S(H2I(t)),"TriggerUnit"))
local unit ua = CreateUnit(GetOwningPlayer(u),'n00G',GetUnitX(u),GetUnitY(u),0.00)
local integer steps = GetStoredInteger(GameCache(),I2S(H2I(t)),"steps")
local real ux = GetUnitX(u)
local real uy = GetUnitY(u)
local real angle = GetStoredReal(GameCache(),I2S(H2I(t)),"angle")
local real x
local real y
set steps = steps + 1
if (not(IsUnitPaused(u) == false)) then
set steps = 29
endif
if (not(GetUnitState(u,UNIT_STATE_LIFE) >= 0)) then
set steps = 29
endif
call StoreInteger(GameCache(),I2S(H2I(t)),"steps",steps)
if steps < 29 then
set x = ux+50*Cos(3.14159/180*angle)
set y = uy+50*Sin(3.14159/180*angle)
if x > udg_Map_X_Max then
set x = udg_Map_X_Max
endif
call SetUnitX(u,x)
call SetUnitY(u,y)
else
call UnitRemoveType(u,UNIT_TYPE_GIANT)
call PauseTimer(t)
call DestroyTimer(t)
call FlushStoredMission(GameCache(),I2S(H2I(t)))
call IssueImmediateOrderById(u,852127)
endif
endif[/codes]
我想单位被暂停和被杀死(血等于0时)就设置set steps = 50(即停止触发).该怎么写?
if (not(GetUnitState(u,UNIT_STATE_LIFE) >= 0)) then把这句改为<=0,就是set steps = 50,如果把这句改为
>=0,貌似不等于set steps = 50.我该怎么写. |
|