找回密码
 点一下
查看: 1717|回复: 3

风暴之锤用属性影响伤害的原理是什么

[复制链接]
发表于 2008-7-30 11:47:15 | 显示全部楼层 |阅读模式
注意,是锤子砸到单位的时候造成伤害,只要告诉我原理就好了,谢谢帮忙回答
发表于 2008-7-30 12:18:57 | 显示全部楼层
风暴之锤击中单位会造成一个buff,通过判断单位受伤害时拥有这个buff来判断单位被风暴之锤击中
为了避免被击中后buff持续存在而导致其他伤害也触发,还需要删除buff,并用普通的buff替代,就是对其释放辅助的风暴之锤技能

有很多类似的演示,如属性影响的bash等等,可以搜索、翻阅
回复

使用道具 举报

发表于 2008-7-31 11:54:47 | 显示全部楼层
自己做一个 模拟的技能就可以了
回复

使用道具 举报

发表于 2008-7-31 11:57:49 | 显示全部楼层
[jass]//======================风暴之锤效果=======================
//参数1.目标单位2.施法单位3.移动速度4.伤害5.投射物单位类型6.给予伤害单位
function thunderbolt_2 takes nothing returns nothing
local timer Timer=GetExpiredTimer()
local integer ID = GetTimerIndex(Timer)
local unit U = SYS_TimerData_U00[ID]
local unit JU = SYS_TimerData_U02[ID]  
local unit U2 = SYS_TimerData_U01[ID]
local unit LM = SYS_TimerData_U02[ID]
local real S = SYS_TimerData_R00[ID]
local real D = SYS_TimerData_R01[ID]
local real AM = bj_RADTODEG * Atan2(GetUnitY(U) - GetUnitY(LM),GetUnitX(U) - GetUnitX(LM))
local real x = SYS_TimerData_R02[ID]
local real y = SYS_TimerData_R03[ID]
set x = GetUnitX(LM) + S *Cos(AM * bj_DEGTORAD)
set y = GetUnitY(LM) + S *Sin(AM * bj_DEGTORAD)
set SYS_TimerData_R02[ID] = x
set SYS_TimerData_R03[ID] = y
call SetUnitX( LM, x )
call SetUnitY( LM, y )
call SetUnitFacing(LM,AM )
if (SquareRoot((x-GetUnitX(U))*(x-GetUnitX(U))+(y-GetUnitY(U))*(y-GetUnitY(U)))>0)then
call TimerStart(Timer,0.01,false,function thunderbolt_2)
else
call KillUnit( LM )
call UnitDamageTarget(JU,U,D,true,false,ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call ReleaseTimer(Timer)
endif
set U =null
set U2 =null
set Timer =null
set LM =null
set JU = null
endfunction

function thunderbolt takes unit U,unit U2,real S,real D,integer L,unit JU returns nothing
local timer Timer= GetTimer()
local integer ID = GetTimerIndex(Timer)
local real AM = bj_RADTODEG * Atan2(GetUnitY(U) - GetUnitY(U2),GetUnitX(U) - GetUnitX(U2))                                          
local unit LM = CreateUnit(GetOwningPlayer(U2), L, GetUnitX(U2), GetUnitY(U2), AM)
local real x = GetUnitX(U2)
local real y = GetUnitY(U2)
set SYS_TimerData_U00[ID] = U
set SYS_TimerData_U01[ID] = U2
set SYS_TimerData_U02[ID] = JU
set SYS_TimerData_U02[ID] = LM
set SYS_TimerData_R00[ID] = S
set SYS_TimerData_R01[ID] = D
set SYS_TimerData_R02[ID] = x
set SYS_TimerData_R03[ID] = y
call TimerStart(Timer,0.01,false,function thunderbolt_2)
set Timer = null
set LM = null
set JU = null
endfunction[/jass]
以前做的 就是模拟风暴之锤
不过可惜的是...
这里用了数组系统..
所以 看不懂就无视
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-7-21 00:27 , Processed in 0.062585 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表