技能期间只触发一次被动触发条件修改
parent
3b10d60477
commit
b5b8f79dca
|
@ -4785,13 +4785,14 @@ local passivityList = {
|
|||
local i1 = args[1]
|
||||
local OnRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill)
|
||||
--如果是技能并且这个被动已经被触发过 return
|
||||
if skill and skill.isTriggePassivity then
|
||||
if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,245) then
|
||||
return
|
||||
end
|
||||
if skill and not skill.isAdd and defRole:IsDead() and not BattleUtil.CheckIsNoDead(defRole) then
|
||||
role:AddRage(i1, CountTypeName.Add)
|
||||
if skill then
|
||||
skill.isTriggePassivity=true
|
||||
-- skill.isTriggePassivity=true
|
||||
table.insert(skill.triggerPassivityId,245)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -4807,7 +4808,7 @@ local passivityList = {
|
|||
-- 释放技能后
|
||||
local onRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill)
|
||||
--如果是技能并且这个被动已经被触发过 return
|
||||
if skill and skill.isTriggePassivity then
|
||||
if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,246) then
|
||||
return
|
||||
end
|
||||
if defRole:IsDead() and not BattleUtil.CheckIsNoDead(defRole) then
|
||||
|
@ -4815,7 +4816,8 @@ local passivityList = {
|
|||
-- buff.cover = true
|
||||
role:AddBuff(buff)
|
||||
if skill then
|
||||
skill.isTriggePassivity=true
|
||||
--skill.isTriggePassivity=true
|
||||
table.insert(skill.triggerPassivityId,246)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -4828,7 +4830,7 @@ local passivityList = {
|
|||
-- 释放技能后
|
||||
local onRoleHit = function(target,damage, bCrit, finalDmg, damageType, skill)
|
||||
--如果是技能并且这个被动已经被触发过 return
|
||||
if skill and skill.isTriggePassivity then
|
||||
if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,247) then
|
||||
return
|
||||
end
|
||||
if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then
|
||||
|
@ -4836,7 +4838,8 @@ local passivityList = {
|
|||
role:AddSkill(BattleSkillType.Normal, false, true, nil)
|
||||
end
|
||||
if skill then
|
||||
skill.isTriggePassivity=true
|
||||
-- skill.isTriggePassivity=true
|
||||
table.insert(skill.triggerPassivityId,247)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -4850,14 +4853,15 @@ local passivityList = {
|
|||
-- 释放技能后
|
||||
local onRoleHit = function(target,damage, bCrit, finalDmg, damageType, skill)
|
||||
--如果是技能并且这个被动已经被触发过 return
|
||||
if skill and skill.isTriggePassivity then
|
||||
if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,248) then
|
||||
return
|
||||
end
|
||||
if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then
|
||||
local treat = floor(BattleUtil.FP_Mul(role:GetRoleData(RoleDataName.MaxHp), f1))
|
||||
BattleUtil.CalTreat(role, role, treat)
|
||||
if skill then
|
||||
skill.isTriggePassivity=true
|
||||
-- skill.isTriggePassivity=true
|
||||
table.insert(skill.triggerPassivityId,248)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -4871,14 +4875,15 @@ local passivityList = {
|
|||
-- 释放技能后
|
||||
local onRoleHit = function(target,damage, bCrit, finalDmg, damageType, skill)
|
||||
--如果是技能并且这个被动已经被触发过 return
|
||||
if skill and skill.isTriggePassivity then
|
||||
if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,249) then
|
||||
return
|
||||
end
|
||||
if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then
|
||||
local buff = Buff.Create(role, BuffName.PropertyChange, 1, RoleDataName.Crit, f1, CountTypeName.Add)
|
||||
role:AddBuff(buff)
|
||||
if skill then
|
||||
skill.isTriggePassivity=true
|
||||
--skill.isTriggePassivity=true
|
||||
table.insert(skill.triggerPassivityId,249)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -4897,13 +4902,14 @@ local passivityList = {
|
|||
-- 击杀数量累加
|
||||
local OnRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill)
|
||||
--如果是技能并且这个被动已经被触发过 return
|
||||
if skill and skill.isTriggePassivity then
|
||||
if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,250) then
|
||||
return
|
||||
end
|
||||
if skill and defRole:IsDead() and not BattleUtil.CheckIsNoDead(defRole) then
|
||||
killNum = killNum + 1
|
||||
if skill then
|
||||
skill.isTriggePassivity=true
|
||||
--skill.isTriggePassivity=true
|
||||
table.insert(skill.triggerPassivityId,250)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -4938,7 +4944,7 @@ local passivityList = {
|
|||
local f1 = args[2]
|
||||
local function onHit(target, damage, bCrit, finalDmg, damageType, skill)
|
||||
--如果是技能并且这个被动已经被触发过 return
|
||||
if skill and skill.isTriggePassivity then
|
||||
if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,251) then
|
||||
return
|
||||
end
|
||||
if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then
|
||||
|
@ -4946,7 +4952,8 @@ local passivityList = {
|
|||
local value = floor(BattleUtil.ErrorCorrection(maxHp* f1))
|
||||
BattleUtil.ApplyTreat(role, role, value)
|
||||
if skill then
|
||||
skill.isTriggePassivity=true
|
||||
--skill.isTriggePassivity=true
|
||||
table.insert(skill.triggerPassivityId,251)
|
||||
end
|
||||
end
|
||||
role.Event:RemoveEvent(BattleEventName.RoleHit, onHit)
|
||||
|
@ -4965,13 +4972,14 @@ local passivityList = {
|
|||
local i1 = args[1]
|
||||
local onHit = function(target, damage, bCrit, finalDmg,damageType,skill)
|
||||
--如果是技能并且这个被动已经被触发过 return
|
||||
if skill and skill.isTriggePassivity then
|
||||
if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,252) then
|
||||
return
|
||||
end
|
||||
if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then
|
||||
role:AddRage(i1, CountTypeName.Add)
|
||||
if skill then
|
||||
skill.isTriggePassivity=true
|
||||
--skill.isTriggePassivity=true
|
||||
table.insert(skill.triggerPassivityId,252)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -4986,7 +4994,7 @@ local passivityList = {
|
|||
-- 直接伤害后
|
||||
local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill)
|
||||
--如果是技能并且这个被动已经被触发过 return
|
||||
if skill and skill.isTriggePassivity then
|
||||
if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,253) then
|
||||
return
|
||||
end
|
||||
if skill and not skill.isAdd and target:IsDead() and not BattleUtil.CheckIsNoDead(target) then
|
||||
|
@ -5000,7 +5008,8 @@ local passivityList = {
|
|||
end
|
||||
end
|
||||
if skill then
|
||||
skill.isTriggePassivity=true
|
||||
--skill.isTriggePassivity=true
|
||||
table.insert(skill.triggerPassivityId,253)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -5013,14 +5022,15 @@ local passivityList = {
|
|||
local f1 = args[1]
|
||||
local onRoleHit = function(target,damage, bCrit, finalDmg, damageType, skill)
|
||||
--如果是技能并且这个被动已经被触发过 return
|
||||
if skill and skill.isTriggePassivity then
|
||||
if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,254) then
|
||||
return
|
||||
end
|
||||
if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then
|
||||
local target = RoleManager.GetAliveAggro(role)
|
||||
BattleUtil.CalDamage(nil, role, target, 1, f1)
|
||||
if skill then
|
||||
skill.isTriggePassivity=true
|
||||
--skill.isTriggePassivity=true
|
||||
table.insert(skill.triggerPassivityId,254)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -5033,14 +5043,15 @@ local passivityList = {
|
|||
local f1 = args[1]
|
||||
local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill)
|
||||
--如果是技能并且这个被动已经被触发过 return
|
||||
if skill and skill.isTriggePassivity then
|
||||
if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,255) then
|
||||
return
|
||||
end
|
||||
if skill and skill.type == BattleSkillType.Special and target:IsDead() and not BattleUtil.CheckIsNoDead(target) then
|
||||
BattleUtil.RandomAction(f1, function()
|
||||
role:AddRage(target.Rage, CountTypeName.Add)
|
||||
if skill then
|
||||
skill.isTriggePassivity=true
|
||||
--skill.isTriggePassivity=true
|
||||
table.insert(skill.triggerPassivityId,255)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
@ -5055,7 +5066,7 @@ local passivityList = {
|
|||
local f2=args[2]
|
||||
local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill)
|
||||
--如果是技能并且这个被动已经被触发过 return
|
||||
if skill and skill.isTriggePassivity then
|
||||
if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,256) then
|
||||
return
|
||||
end
|
||||
if target:IsDead() and not BattleUtil.CheckIsNoDead(target) and not role:IsDead() then
|
||||
|
@ -5064,7 +5075,8 @@ local passivityList = {
|
|||
--加一个延时操作,防止有的英雄有死亡后再释放一次技能的被动 by:王振兴
|
||||
role:InsertExtraSkill(f1,f2)
|
||||
if skill then
|
||||
skill.isTriggePassivity=true
|
||||
--skill.isTriggePassivity=true
|
||||
table.insert(skill.triggerPassivityId,256)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -35,7 +35,8 @@ function Skill:Init(role, effectData, type, targets, isAdd, isRage) --type 0 异
|
|||
self.hitTime = effectData[2] -- 效果命中需要的时间
|
||||
self.continueTime = effectData[3] -- 命中后伤害持续时间
|
||||
self.attackCount = effectData[4] -- 伤害持续时间内伤害次数
|
||||
self.isTriggePassivity = false -- 是否一个技能只触发一次被动 true:每次释放技能只会触发一次
|
||||
self.isTriggePassivity = false -- 是否一个技能只触发一次被动 true:每次释放技能只会触发一次
|
||||
self.triggerPassivityId={}
|
||||
self.targets = targets or {}
|
||||
self.isAdd = isAdd
|
||||
self.isRage = isRage
|
||||
|
@ -121,6 +122,7 @@ function Skill:Cast(func)
|
|||
self.effectTargets = {}
|
||||
self.targetIsHit = {}
|
||||
self.isTriggePassivity=false
|
||||
self.triggerPassivityId={}
|
||||
-- 先计算出技能的目标
|
||||
for i=1, self.effectList.size do
|
||||
-- 是否重新选择目标
|
||||
|
@ -261,6 +263,7 @@ function Skill:EndSkill()
|
|||
BattleLogic.WaitForTrigger(0.3, function()
|
||||
-- 结束回调
|
||||
self.isTriggePassivity=false
|
||||
self.triggerPassivityId={}
|
||||
if self.castDoneFunc then self.castDoneFunc() end
|
||||
|
||||
end)
|
||||
|
|
Loading…
Reference in New Issue