|
发表于 2007-12-2 14:10:53
|
显示全部楼层
哦,普通的我搞定了已经
就差技能和普通的整合了
[codes=jass]
function ClearScore takes nothing returns nothing
local timer tm=GetExpiredTimer()
call DestroyTimer(tm)
set tm=null
endfunction
function Show_Con takes nothing returns boolean
local trigger trg=GetTriggeringTrigger()
local unit hero=I2U(GetStoredInteger(udg_GC,I2S(H2I(trg)),"Hero"))
local texttag tag=I2TAG(GetStoredInteger(udg_GC,I2S(H2I(hero)),"TextTag"))
local timer tm=I2TM(GetStoredInteger(udg_GC,I2S(H2I(hero)),"Timer"))
local unit target=I2U(GetStoredInteger(udg_GC,I2S(H2I(hero)),"Target"))
local real n= GetStoredReal(udg_GC,I2S(H2I(hero)),"ComboNum")
if hero==GetAttacker() then
if (n==0 or target!=GetAttackedUnitBJ()) then
set n=1
call StoreReal(udg_GC,I2S(H2I(hero)),"Damage",0)
set tm=CreateTimer()
call TimerStart(tm,999,false,function ClearScore)
call DisplayTextToPlayer(GetOwningPlayer(hero),0,0,GetUnitName(hero)+"找到新单位")
else
set n=n+1
if n>3 then
call DestroyTextTag(tag)
set tag=CreateTextTagUnitBJ( ( I2S(R2I(n)) + "击!" ), hero, 0,(10+n/10), 100, 0.00, 0.00, 0 )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 24, 90 )
call SetTextTagPermanent( GetLastCreatedTextTag(), false )
call SetTextTagLifespan( GetLastCreatedTextTag(), 3.00 )
call SetTextTagFadepoint( GetLastCreatedTextTag(), 2.60 )
endif
endif
else
set trg=null
set hero=null
set target=null
set tm=null
set tag=null
return false
endif
call StoreInteger(udg_GC,I2S(H2I(trg)),"Hero",H2I(hero))
call StoreReal(udg_GC,I2S(H2I(hero)),"ComboNum",n)
call StoreInteger(udg_GC,I2S(H2I(hero)),"TextTag",H2I(tag))
call StoreInteger(udg_GC,I2S(H2I(hero)),"Target",H2I(GetAttackedUnitBJ()))
call StoreInteger(udg_GC,I2S(H2I(hero)),"Timer",H2I(tm))
set trg=null
set hero=null
set target=null
set tm=null
set tag=null
return false
endfunction
function Show takes unit hero returns nothing
local trigger trg=CreateTrigger()
call DisplayTextToPlayer(GetOwningPlayer(hero),0,0,GetUnitName(hero)+"显示启动")
//call StoreInteger(udg_GC,I2S(H2I(hero)),"Trigger",H2I(trg))
call StoreReal(udg_GC,I2S(H2I(hero)),"ComboNum",0)
call StoreInteger(udg_GC,I2S(H2I(trg)),"Hero",H2I(hero))
call TriggerRegisterAnyUnitEventBJ(trg,EVENT_PLAYER_UNIT_ATTACKED)
call StoreInteger(udg_GC,I2S(H2I(trg)),"TriggerCondition",H2I(TriggerAddCondition(trg,Condition(function Show_Con))))
set trg=null
endfunction
[/codes] |
|