|
只是这个移动函数为什么没有用,很让我困惑
调用没反应啊,郁闷ing,哪位达人告诉下
[codes=jass]
//转型函数
function H2I takes handle h returns integer
return h
return 0
endfunction
function I2H takes integer h returns handle
return h
return null
endfunction
function H2S takes handle h returns string
return I2S(H2I(h))
return null
endfunction
//释放缓存
function FlushTable takes handle lable returns nothing
call FlushStoredMission(udg_GC,H2S(lable))
//返回两个单位的角度(非弧度)
function GetUnitAngle takes unit a,unit b returns real
local real dx = GetUnitX(a) - GetUnitX(b)
local real dy = GetUnitY(a) - GetUnitY(b)
local real anger
if (GetUnitX(a) > GetUnitX(b)) then
set anger = (Atan(dy/dx)*bj_RADTODEG) + 180
else
set anger = Atan(dy/dx)*bj_RADTODEG
endif
return anger
endfunction
//技能模板
//hg_skillmode1(GetTriggerUnit(),GetSpellTargetUnit(),速度,行动效果,行动中的伤害系数)
function hg_skillmode1_action takes nothing returns nothing
local timer tm = GetExpiredTimer()
local unit u1 = I2U(GetStoredInteger(udg_GC,H2S(tm),"u1"))
local unit u2 = I2U(GetStoredInteger(udg_GC,H2S(tm),"u2"))
local real dis = GetStoredReal(udg_GC,H2S(tm),"dis")
local real xy = GetStoredReal(udg_GC,H2S(tm),"xy")
local string ef = GetStoredString(udg_GC,H2S(tm),"ef")
local integer abi = GetStoredInteger(udg_GC,H2S(tm),"ability")
local real an = GetUnitAngle(u1,u2)
local effect eff
if (GetUnitX(u1)+dis*Cos(an))<GetRectMaxX(bj_mapInitialPlayableArea) then
if (GetUnitX(u1)+dis*Cos(an))>GetRectMinX(bj_mapInitialPlayableArea) then
call SetUnitX(u1,GetUnitX(u1)+dis*Cos(an))
endif
endif
if (GetUnitY(u1)+dis*Sin(an))<GetRectMaxY(bj_mapInitialPlayableArea) and (GetUnitY(u1)+dis*Sin(an))>GetRectMinY(bj_mapInitialPlayableArea) then
call SetUnitY(u1,GetUnitY(u1)+dis*Sin(an))
endif
if ef != null then
set eff=AddSpecialEffect(ef,GetUnitX(u1),GetUnitY(u1))
call DestroyEffect(eff)
set eff = null
endif
//这是伤害部分,掠过先 call FullDamageRange(u1,GetUnitX(u1),GetUnitY(u1),200,abi,xy,2)
if ( 40000.00 >= ( Pow( (GetUnitX(u1) - GetUnitX(u2)), 2.00) + Pow(( GetUnitY(u1) - GetUnitY(u2) ), 2.00) ) ) then
call FlushTable(tm)
call PauseTimer(tm)
call DestroyTimer(tm)
endif
set tm = null
set u1 = null
set u2 = null
set eff = null
endfunction
function hg_skillmode1 takes unit u1,unit u2,real speed,string ef,real xs returns nothing
local timer tm = CreateTimer()
local real tim = 0.02
local real dis = speed*tim
local real xy = xs*speed/1000
local real time = GetUnitDistance(u1,u2)/speed
call StoreInteger(udg_GC,H2S(tm),"u1",H2I(u1))
call StoreInteger(udg_GC,H2S(tm),"u2",H2I(u2))
call StoreReal(udg_GC,H2S(tm),"dis",dis)
call StoreReal(udg_GC,H2S(tm),"xy",xy)
call StoreString(udg_GC,H2S(tm),"ef",ef)
call StoreInteger(udg_GC,H2S(tm),"ability",GetSpellAbilityId())
call TimerStart(tm,0.02,true,function hg_skillmode1_action)
// call FlushTable(tm)
// call PauseTimer(tm)
// call DestroyTimer(tm)
set tm=null
endfunction
[/codes] |
|