[战斗]========被动154修改 新增300被动 Hot 添加修改治疗量的接口,复活接口添加界面显示

dev_chengFeng
wangzhenxing 2021-01-18 14:31:54 +09:00
parent 1d65116a84
commit b9479d8326
3 changed files with 58 additions and 9 deletions

View File

@ -2955,15 +2955,17 @@ local passivityList = {
if deadRole==role then
return
end
if deadRole.camp == role.camp then
if ele and v1 and deadRole.element==ele then
f1=v1
BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function () --延时一帧做处理我方场上所有单位都结算死亡以后再处理299被动回血
if deadRole.camp == role.camp and not role:IsDead() then
if ele and v1 and deadRole.element==ele then
f1=v1
end
counter = counter + 1
if counter == i1 then
deadRole:SetRelive(f1)
end
end
counter = counter + 1
if counter == i1 then
deadRole:SetRelive(f1)
end
end
end)
end
BattleLogic.Event:AddEvent(BattleEventName.RoleRealDead, onRoleRealDead)
end,
@ -6176,7 +6178,6 @@ local passivityList = {
end
if skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra then
local list = skill:GetDirectTargetsNoMiss()
LogError(LengthOfTable(list))
if list then
local isHave=false
for key, value in pairs(list) do
@ -6246,6 +6247,37 @@ local passivityList = {
role.Event:AddEvent(BattleEventName.RoleDead, OnDead)
end,
--修改持续效果的治疗值为[a] [b]属性的[c]%
--a[int] b[float]
[300]=function(role,args,id,judge)
local pro=args[1]
local v1=args[2]
local onSkillCastEnd = function(skill)
if not skill or skill.type~= BattleSkillType.Special then
return
end
if skill and judge==1 and not skill.isTriggerJudge then
return
end
BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function () --延迟一帧移除事件,才能抓到添加效果字典里面的效果
local tv = floor(BattleUtil.ErrorCorrection(role:GetRoleData(BattlePropList[pro]) * v1))
if tv and tv<=0 then
return
end
local list=skill:GetDirectTargetsNoMiss()
for _, role1 in ipairs(list) do
BattleLogic.BuffMgr:QueryBuff(role1, function(buff)
if buff.type == BuffName.HOT and buff.caster == role and buff.roundDuration>1 and buff.startRound==BattleLogic.GetCurRound() then
buff:ChangeHealValue(tv)
end
end)
end
end)
end
role.Event:AddEvent(BattleEventName.SkillCastEnd,onSkillCastEnd)
end,
}
return passivityList

View File

@ -10,12 +10,20 @@ function HOT:SetData(...)
self.sort = 1 -- 最先计算回血
end
--初始化后调用一次
function HOT:OnStart()
self.target.Event:DispatchEvent(BattleEventName.RoleBeHealed, self.caster)
end
--修改持续加血效果的加血值
function HOT:ChangeHealValue(newValue)
if newValue then
self.healValue=newValue
end
end
--间隔N帧触发返回true时表示继续触发返回false立刻触发OnEnd
function HOT:OnTrigger()

View File

@ -557,6 +557,15 @@ function RoleLogic:SetRelive(hpf, caster)
self.reliveHPF = hpf or 1
self.reliveCaster = caster
RoleManager.AddReliveRole(self)
local maxHp = self.data:GetData(RoleDataName.MaxHp)
local reHp = floor(self.reliveHPF * maxHp)
self.data:SetValue(RoleDataName.Hp, reHp)
-- 发送复活事件
--self.Event:DispatchEvent(BattleEventName.RoleRelive, self)
--BattleLogic.Event:DispatchEvent(BattleEventName.RoleRelive, self)
-- 复活的血量算做加血
BattleLogic.Event:DispatchEvent(BattleEventName.RecordTreat, self.reliveCaster or self, self, reHp)
return true
end
return false
end