|
发表于 2007-10-12 11:59:27
|
显示全部楼层
因为他所有的射击物件都是用计时器去移动的。原理和澄海的老牛冲撞相同。我打开了地图的J,比如里面的这个函数:
function CreateParticle takes player p,integer utype,real x,real y,real facing returns unit
local unit u=CreateUnit(p,utype,x,y,facing)
set x=x+CosBJ(facing)*VectorGetX(SpawnPlaceOffset())+SinBJ(facing)*VectorGetY(SpawnPlaceOffset())
set y=y+SinBJ(facing)*VectorGetX(SpawnPlaceOffset())+CosBJ(facing)*VectorGetY(SpawnPlaceOffset())
call SetUnitX(u,x)
call SetUnitY(u,y)
if not clsParticleCreate(u) then
call BJDebugMsg("|cffff0000Error:|r could not initialize particle class in function |cffffcc00CreateParticle|r, see the documentation for help.")
call RemoveUnit(u)
return null
endif
call MakeUnitFlyable(u)
call GroupAddUnit(udg_particleGroup,u)
return u
endfunction
还有这个函数,用于删除激光:
function LaserKillUnit takes nothing returns nothing
local unit u=I2U(GetStoredInteger(GC(),H2S(GetExpiredTimer()),"laser"))
local integer i=H2I(u)
local group g=I2G(GetStoredInteger(GC(),I2S(i),"hitunitsgroup"))
call FlushStoredInteger(GC(),I2S(i),"hitunitsgroup")
call FlushStoredInteger(GC(),I2S(i),"bounce")
call FlushStoredInteger(GC(),H2S(GetExpiredTimer()),"laser")
call FlushStoredInteger(GC(),I2S(i),"deathtimer")
call KillUnit(u)
call RemoveParticle(u,true)
call DestroyGroup(g)
call PauseTimer(GetExpiredTimer())
call DestroyTimer(GetExpiredTimer())
set u=null
endfunction |
|