JASS冲刺,单位突进编写方法:[6]JASS语言
操作方法
- 01
- 02
如何让某个单位向某角度冲刺突进呢? 先找找地图编辑器中是否存在这种技能, 1: 闪烁? Oh no 不行,没有冲刺移动效果, 2:...似乎没有类似与 冲刺的东西了把... call bb(gg_unit_Hpal_0000,1000,GetUnitFacing(gg_unit_Hpal_0000)) bb{单位,冲刺长度,冲刺角度}
- 03
library AJ
- 04
globals
- 05
constant hashtable Handle=InitHashtable()
- 06
endglobals
- 07
globals
- 08
private timer DeliverDataTimer
- 09
private unit DeliverDataUnit
- 10
endglobals
- 11
function aa takes nothing returns nothing
- 12
local timer tm = GetExpiredTimer()
- 13
local integer i = GetHandleId(tm)
- 14
local unit Unit = LoadUnitHandle(Handle,i,StringHash("unit"))
- 15
local real Size = LoadReal(Handle,i,StringHash("size"))
- 16
local real jd = LoadReal(Handle,i,StringHash("jd"))
- 17
local location codi
- 18
set codi = PolarProjectionBJ(GetUnitLoc(Unit), 10.00, jd)
- 19
call SetUnitPositionLocFacingBJ( Unit, codi, GetUnitFacing(Unit) )
- 20
//call CreateTextTagLocBJ( "O", GetUnitLoc(Unit), 0, 10, 100, 100, 100, 0 )
- 21
call AddSpecialEffectLocBJ( GetUnitLoc(Unit), "abilities\\weapons\\catapult\\catapultmissile.mdl" )
- 22
call SaveReal(Handle,i,StringHash("size"),Size-10)
- 23
if (Size <= 0 ) then
- 24
call DestroyTimer(tm)
- 25
else
- 26
endif
- 27
endfunction
- 28
function bb takes unit Unit,real Size,real jd returns nothing
- 29
local timer tm = CreateTimer()
- 30
local integer i = GetHandleId(tm)
- 31
call SaveUnitHandle(Handle,i,StringHash("unit"),Unit)
- 32
call SaveReal(Handle,i,StringHash("size"),Size)
- 33
call SaveReal(Handle,i,StringHash("jd"),jd)
- 34
call TimerStart(tm,0.01,true,function aa)
- 35
endfunction
- 36
endlibrary