luafight
parent
f15ecf3ba6
commit
e8d68d8972
|
@ -887,5 +887,62 @@ local passivityList = {
|
||||||
end
|
end
|
||||||
role.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd)
|
role.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
--战斗中,每[a]秒增加[b]%的异妖能量
|
||||||
|
--a[int],b[float]
|
||||||
|
[50] = function(role, args)
|
||||||
|
local f1 = args[1]
|
||||||
|
local f2 = args[2]
|
||||||
|
|
||||||
|
local auraBuff = Buff.Create(role, BuffName.Aura, 0, function (r)
|
||||||
|
BattleLogic.AddMP(role.camp, f2 * 100)
|
||||||
|
end)
|
||||||
|
auraBuff.interval = f1
|
||||||
|
BattleLogic.BuffMgr:AddBuff(role, auraBuff)
|
||||||
|
end,
|
||||||
|
|
||||||
|
--战斗中,初始拥有[a]%的异妖能量
|
||||||
|
--a[float]
|
||||||
|
[51] = function(role, args)
|
||||||
|
local f1 = args[1]
|
||||||
|
BattleLogic.AddMP(role.camp, f1 * 100)
|
||||||
|
end,
|
||||||
|
|
||||||
|
--战斗中,队伍每损失[a]%的生命值,增加[b]%的异妖能量
|
||||||
|
--a[float],b[float]
|
||||||
|
[52] = function(role, args)
|
||||||
|
local f1 = args[1]
|
||||||
|
local f2 = args[2]
|
||||||
|
|
||||||
|
local maxHp = 0
|
||||||
|
local curHp = 0
|
||||||
|
if f1 == 0 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local curHpGears = 0
|
||||||
|
local arr = BattleUtil.ChooseTarget(role, 10000)
|
||||||
|
for i=1, #arr do
|
||||||
|
curHp = curHp + arr[i]:GetRoleData(RoleDataName.Hp)
|
||||||
|
maxHp = maxHp + arr[i]:GetRoleData(RoleDataName.MaxHp)
|
||||||
|
end
|
||||||
|
|
||||||
|
local auraBuff = Buff.Create(role, BuffName.Aura, 0, function (r)
|
||||||
|
local hp = 0
|
||||||
|
for i=1, #arr do
|
||||||
|
hp = hp + arr[i]:GetRoleData(RoleDataName.Hp)
|
||||||
|
end
|
||||||
|
|
||||||
|
if hp < curHp then
|
||||||
|
local gears = floor((maxHp - hp) / (f1 * maxHp))
|
||||||
|
if gears > curHpGears then
|
||||||
|
BattleLogic.AddMP(role.camp, f2 * (gears - curHpGears) * 100)
|
||||||
|
curHpGears = gears
|
||||||
|
end
|
||||||
|
curHp = hp
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
auraBuff.interval = 0
|
||||||
|
BattleLogic.BuffMgr:AddBuff(role, auraBuff)
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
return passivityList
|
return passivityList
|
|
@ -146,7 +146,11 @@ function Skill:Cast()
|
||||||
if self.owner.superSkill == self then
|
if self.owner.superSkill == self then
|
||||||
self.sp = 0
|
self.sp = 0
|
||||||
self.spPass = floor(self.cd * BattleLogic.GameFrameRate)
|
self.spPass = floor(self.cd * BattleLogic.GameFrameRate)
|
||||||
BattleLogic.AddMP(self.owner.camp, 10)
|
if BattleLogic.Type == 4 then --秘境boss的能量特殊处理
|
||||||
|
BattleLogic.AddMP(self.owner.camp, 20)
|
||||||
|
else
|
||||||
|
BattleLogic.AddMP(self.owner.camp, 10)
|
||||||
|
end
|
||||||
if self.owner.skill then
|
if self.owner.skill then
|
||||||
local skill = self.owner.skill
|
local skill = self.owner.skill
|
||||||
skill.sp = 0
|
skill.sp = 0
|
||||||
|
@ -155,7 +159,11 @@ function Skill:Cast()
|
||||||
else
|
else
|
||||||
self.sp = 0
|
self.sp = 0
|
||||||
self.spPass = floor(time * BattleLogic.GameFrameRate)
|
self.spPass = floor(time * BattleLogic.GameFrameRate)
|
||||||
BattleLogic.AddMP(self.owner.camp, 5)
|
if BattleLogic.Type == 4 then --秘境boss的能量特殊处理
|
||||||
|
BattleLogic.AddMP(self.owner.camp, 20)
|
||||||
|
else
|
||||||
|
BattleLogic.AddMP(self.owner.camp, 5)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
self.owner.Event:DispatchEvent(BattleEventName.SkillCast, self)
|
self.owner.Event:DispatchEvent(BattleEventName.SkillCast, self)
|
||||||
else
|
else
|
||||||
|
|
|
@ -6,6 +6,7 @@ local min = math.min
|
||||||
--local Random = Random
|
--local Random = Random
|
||||||
--local RoleDataName = RoleDataName
|
--local RoleDataName = RoleDataName
|
||||||
--local BattleEventName = BattleEventName
|
--local BattleEventName = BattleEventName
|
||||||
|
BattleUtil.Passivity = require("Modules/Battle/Logic/Base/Passivity")
|
||||||
|
|
||||||
local function clamp(v, minValue, maxValue)
|
local function clamp(v, minValue, maxValue)
|
||||||
if v < minValue then
|
if v < minValue then
|
||||||
|
|
|
@ -7,7 +7,6 @@ local Random = Random
|
||||||
local floor = math.floor
|
local floor = math.floor
|
||||||
local max = math.max
|
local max = math.max
|
||||||
local min = math.min
|
local min = math.min
|
||||||
local Passivity = require("Modules/Battle/Logic/Base/Passivity")
|
|
||||||
|
|
||||||
local aiList = {
|
local aiList = {
|
||||||
[0] = function(skill, superSkill) --默认75%释放点击技、25%释放上滑技
|
[0] = function(skill, superSkill) --默认75%释放点击技、25%释放上滑技
|
||||||
|
@ -85,7 +84,7 @@ function RoleLogic:Init(uid, data)
|
||||||
for j = 2, #v do
|
for j = 2, #v do
|
||||||
args[j-1] = v[j]
|
args[j-1] = v[j]
|
||||||
end
|
end
|
||||||
Passivity[id](self, args)
|
BattleUtil.Passivity[id](self, args)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue