|
|
楼主 |
发表于 2015-5-13 00:22:39
|
显示全部楼层
实际效果比前几个都长
function SMAW_Effect takes location target,unit caster, integer id, integer rpg_l, integer rockettype returns nothing
//参数为目标地点,施法单位,id,rpgl,rockettype
local real x = GetLocationX(target)
local real y = GetLocationY(target)//目标位置
local real z
local real x1
local real y1
local real theta = 0.0
local integer n = 8
local real thetastep = 360.0/n//360/8,不知作何
local real damage
local real angle
local integer A = 1
local group g
local rect r = Rect(x-300,y-300,x+300,y+300)//不知是什么
local unit u = CreateUnit(ConvertedPlayer(id),'e003',x,y,0.0)
local real blastradius = udg_rpg_radius[rpg_l]//目测这个是溅射伤害——实际上是伤害范围
local real blastdamage = udg_rpg_damage[rpg_l]//这么多变量,见鬼
if rockettype==3 then //HEAA//穿甲就是高伤害低溅射
set blastradius = blastradius*0.5
set blastdamage = blastdamage*1.25//
endif
set z = udg_rpg_radius[rpg_l]/2.0
set g = AMGetUnitsInRange(blastradius, target, null)
call UnitDamagePoint(caster,0,blastradius,x,y,blastdamage,true,false,udg_SMAWWarhead[id],DAMAGE_TYPE_DEMOLITION,WEAPON_TYPE_WHOKNOWS)//范围伤害单位
call ForGroup(g, function killexplosive)
call DestroyGroup(g)
set udg_soundpath = "war3mapImported\\Explosion2.mp3"//播放音效
call ExecuteFunc("PlaySoundPath")
set udg_myinteger = rpg_l
call EnumDestructablesInRect(r,null,function killtree)//炸树
call EnumItemsInRect(r,null,function killitem)//炸物品
call RemoveRect(r)
call KillUnit(u)
set r = null
if rockettype==3 then //HEAA
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Human\\FragmentationShards\\FragBoomSpawn.mdl",x,y))//特效
else
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl",x,y))//特效
endif
call EarShockArea(x,y,blastradius+150.0)//耳鸣
set g = AMGetUnitsInRange(blastradius+50,target,null)
loop
set u = FirstOfGroup(g)
exitwhen u==null
if GetWidgetLife(u)>0.405 and GetUnitAbilityLevel(u,'Avul')<1 and ShockwaveSafe(u) then
set angle = Atan2(y-GetUnitY(u),x-GetUnitX(u))
if GetUnitPointValue(u)==50 then
call PushUnit(u,angle,20,7.5,0.04)
else
call PushUnit(u,angle,30,10.0,0.04)//吹怪
endif
endif
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup(g)
set g = null
loop
exitwhen A > n
set x1 = x+z*Cos(theta)
set y1 = y+z*Sin(theta)
if RectContainsCoords(bj_mapInitialPlayableArea,x1,y1) then
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl",x1,y1))//特效灰尘
endif
set theta = theta + thetastep
set A = A + 1
endloop
endfunction |
|