主角技能改被动技能代码修改提交

back_recharge
yuanshuai 2022-03-11 17:13:54 +08:00
parent 3e10197728
commit 822aea186f
18 changed files with 1125 additions and 125 deletions

File diff suppressed because one or more lines are too long

View File

@ -19,6 +19,7 @@ local BuffRegister = {
[BuffName.BanBlood] = "BanBlood",
[BuffName.SigilSign] = "SigilSign",
[BuffName.CommonSign] = "CommonSign",
[BuffName.BreakArmor] = "BreakArmor",
}

View File

@ -2374,7 +2374,7 @@ local effectList = {
end
local damage = floor(BattleUtil.ErrorCorrection(f3 * target:GetRoleData(BattlePropList[p1])))
damage=BattleUtil.CalAllReduceShield(caster,target,damage)
BattleUtil.FinalDamage(skill,caster, target,damage)
BattleUtil.FinalDamage(nil,caster, target,damage)
end
end
end)
@ -2552,6 +2552,9 @@ local effectList = {
BattleUtil.FinalDamageCountShield(nil,caster, target,damage)
local hp=floor(damage*f2)
local arr = RoleManager.NoOrder(function (r) return r.camp == caster.camp end,false,true)
if arr==nil or #arr==0 then
return
end
BattleUtil.SortByHpFactor(arr,sort)
BattleUtil.CalTreatNoCrit(caster, arr[1],hp,1,skill)
@ -2814,6 +2817,63 @@ local effectList = {
BattleUtil.FinalTreat(caster,target,treat,1,skill)
end)
end,
--对目标造成神佑状态,造成目标[a]属性[b]%的治疗,持续[c]回合,溢出的治疗量转化为御甲
--a[int],b[float],c[int]
[144] = function(caster, target, args, interval, skill)
local p1 = args[1]
local v1 = args[2]
local round = args[3]
BattleLogic.WaitForTrigger(interval, function ()
local damage=floor(target:GetRoleData(BattlePropList[p1])*v1)
local buff=Buff.Create(caster,BuffName.HOT,round,1,damage)
buff.hotType=2
target:AddBuff(buff)
end)
end,
--为我方添加反伤盾,护盾类型为[a],护盾值为[b]%,持续[c]回合,反弹伤害[d]次
--a[int],b[float],c[int],d[int]
[145] = function(caster, target, args, interval, skill)
local type = args[1]
local v1 = args[2]
local r1 = args[3]
local time = args[4]
BattleLogic.WaitForTrigger(interval, function ()
target:AddBuff(Buff.Create(caster, BuffName.Shield,r1,type,v1,time))
end)
end,
--对目标造成自身[a]*[b]%的伤害,目标每减少[c]个伤害增加[d]%,
--a[int],b[int],c[int],d[float]
[146] = function(caster, target, args, interval, skill)
local pro = args[1]
local v1 = args[2]
local i1 = args[3]
local v2 = args[4]
BattleLogic.WaitForTrigger(interval, function ()
local isBoss=BattleUtil.CheckIsBoss(target)
if isBoss then
return
end
-- 改变值 = 技能最大目标数 - 当前目标数
local maxNum = skill:GetMaxTargetNum()
local curNum = #skill:GetDirectTargets()
local lessNum = max(maxNum - curNum, 0)
local level = math.floor(lessNum/i1)
local extra = BattleUtil.ErrorCorrection(level * v2)
local damage=floor(target:GetRoleData(BattlePropList[pro])*(v1+extra))
BattleUtil.FinalDamageCountShield(nil,caster, target,damage)
end)
end,
--复活目标,并恢复血量[a]%
--a[float]
[147]=function(caster, target, args, interval, skill)
local pro=args[1]
target.isRealDead=true
target:SetRelive(pro, caster)
end,
}

View File

@ -50,7 +50,7 @@ function EffectCaster:DoEffect(caster, target, eff, duration, skill)
e.args[i] = eff.args[i]
end
-- 检测被动技能对技能参数的影响
-- 检测被动技能对技能参数的影响
local function _PassiveCheck(pe)
if pe then
e = pe
@ -77,7 +77,7 @@ end
function EffectCaster:takeEffect(caster, target, effects, effectIndex, duration, skill)
for k=1, #effects do
-- 如果不是第一个效果对列的第一个效果则判断是否命中
-- 如果不是第一个效果对列的第一个效果则判断是否命中
if k ~= 1 and effectIndex == 1 then
if self:CheckTargetIsHit(target) then
self:DoEffect(caster, target, effects[k], duration, skill)
@ -93,25 +93,25 @@ function EffectCaster:ChooseTarget()
--
self.effectTargets = {}
self.targetIsHit = {}
-- 先计算出技能的目标
-- 先计算出技能的目标
for i=1, #self.effectList do
-- 是否重新选择目标
-- 是否重新选择目标
local isReTarget = true
if self.targets and self.targets[i] then
self.effectTargets[i] = self.targets[i]
-- 判断是否有有效目标
-- 判断是否有有效目标
for _, role in ipairs(self.effectTargets[i]) do
if not role:IsRealDead() then
isReTarget = false
end
end
end
-- 重新选择目标
-- 重新选择目标
if isReTarget then
local effectGroup = self.effectList[i]
local chooseId = effectGroup.chooseId
self.effectTargets[i] = BattleUtil.ChooseTarget(self.skill.owner, chooseId)
-- 检测被动对攻击目标的影响
-- 检测被动对攻击目标的影响
if i == 1 then
local function _PassiveTarget(targets)
self.effectTargets[i] = targets
@ -122,19 +122,19 @@ function EffectCaster:ChooseTarget()
end
end
-- 释放技能
-- func 技能释放完成回调
-- 释放技能
-- func 技能释放完成回调
function EffectCaster:Cast()
-- 选择目标
-- 选择目标
self:ChooseTarget()
-- 对目标造成相应的效果
-- 对目标造成相应的效果
for i=1, #self.effectList do
local effectGroup = self.effectList[i]
local chooseId = effectGroup.chooseId
local arr = self.effectTargets[i]
if arr and #arr > 0 then
-- 效果延迟1帧生效
-- 效果延迟1帧生效
BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function()
local effects = effectGroup.effects
local weight = math.floor(chooseId % 10000 / 100)
@ -145,10 +145,10 @@ function EffectCaster:Cast()
table.sort(arr, function(a, b)
return a.position < b.position
end)
-- 全部同时生效
-- 全部同时生效
for j=1, count do
if arr[j] and not arr[j]:IsRealDead() then
-- 检测是否命中
-- 检测是否命中
if i == 1 then
self.targetIsHit[arr[j]] = BattleUtil.CheckIsHit(self.skill.owner, arr[j],self.skill)
end
@ -160,7 +160,7 @@ function EffectCaster:Cast()
end
end
-- 遍历技能命中目标
-- 遍历技能命中目标
function EffectCaster:ForeachTargets(func)
local targets = self:GetDirectTargets()
for _, role in ipairs(targets) do
@ -170,7 +170,7 @@ function EffectCaster:ForeachTargets(func)
end
end
-- 获取直接选择目标Id
-- 获取直接选择目标Id
function EffectCaster:GetDirectChooseId()
local effectGroup = self.effectList[1]
local chooseId = effectGroup.chooseId
@ -178,12 +178,12 @@ function EffectCaster:GetDirectChooseId()
end
-- 获取技能的直接目标,和策划规定第一个效果的目标为直接效果目标,(包含miss的目标)
-- 获取技能的直接目标,和策划规定第一个效果的目标为直接效果目标,(包含miss的目标)
function EffectCaster:GetDirectTargets()
return self.effectTargets[1]
end
-- 获取直接目标不包含miss的目标可能为空
-- 获取直接目标不包含miss的目标可能为空
function EffectCaster:GetDirectTargetsNoMiss()
local list = {}
for _, role in ipairs(self.effectTargets[1]) do
@ -194,7 +194,7 @@ function EffectCaster:GetDirectTargetsNoMiss()
return list
end
-- 获取直接目标和没有被放逐的目标不包含miss的目标可能为空
-- 获取直接目标和没有被放逐的目标不包含miss的目标可能为空
function EffectCaster:GetDirectTargetsNoExile()
local list = {}
for _, role in ipairs(self.effectTargets[1]) do
@ -205,7 +205,7 @@ function EffectCaster:GetDirectTargetsNoExile()
return list
end
-- 获取直接目标和没有被放逐的目标,不包含不灭可能为空
-- 获取直接目标和没有被放逐的目标,不包含不灭可能为空
function EffectCaster:GetDirectTargetsNoNODead()
local list = {}
for _, role in ipairs(self.effectTargets[1]) do
@ -216,7 +216,7 @@ function EffectCaster:GetDirectTargetsNoNODead()
return list
end
-- 获取技能目标最大人数
-- 获取技能目标最大人数
function EffectCaster:GetMaxTargetNum()
local mainEffect = self.effectList[1]
if not mainEffect then
@ -225,7 +225,7 @@ function EffectCaster:GetMaxTargetNum()
return BattleUtil.GetMaxTargetNum(mainEffect.chooseId)
end
-- 判断是否命中
-- 判断是否命中
function EffectCaster:CheckTargetIsHit(role)
return self.targetIsHit[role]
end

View File

@ -1008,7 +1008,7 @@ local passivityList = {
if skill and (skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra or skill.type==BattleSkillType.DeadSkill ) then
local ar1 = floor(BattleUtil.FP_Mul(defRole:GetRoleData(RoleDataName.MaxHp), f1))
--local ar2 = BattleUtil.FP_Mul(role:GetRoleData(RoleDataName.Attack), 2.5)
BattleUtil.FinalDamage(nil, role, defRole, ar1)
BattleUtil.FinalDamageCountShield(nil, role, defRole, ar1)
--lastTrigger = 0
end
end
@ -1717,6 +1717,9 @@ local passivityList = {
if skill.type == BattleSkillType.Special then
role.Event:RemoveEvent(BattleEventName.RoleHit, OnHit)
local arr = RoleManager.NoOrder(function (r) return r.camp == role.camp and r.deadFilter end)
if arr==nil or #arr==0 then
return
end
BattleUtil.SortByHpFactor(arr, 1)
-- 检测技能伤害<E4BCA4><E5AEB3><EFBFBD>疗加成
local f = BattleUtil.CheckSkillDamageHeal(f1, role, arr[1])
@ -3241,16 +3244,16 @@ local passivityList = {
if not type then
type=0
end
local onBeSkillCastEnd = function(skill)
if type==0 and skill.type~=BattleSkillType.Normal then
local onBeSkillCastEnd = function(atkRole, damage, bCrit, finalDmg, damageType, skill)
if type==0 and (skill.type~=BattleSkillType.Normal and skill.type~=BattleSkillType.ChaosNormal) then
return
end
if type==1 and skill.type~=BattleSkillType.Special and skill.type~=BattleSkillType.Extra and skill.type~=BattleSkillType.DeadSkill then
return
end
BattleUtil.CalRage(role, skill.owner, i1, CountTypeName.Sub)
BattleUtil.CalRage(role, atkRole, i1, CountTypeName.Sub)
end
role.Event:AddEvent(BattleEventName.BeSkillCastEnd, onBeSkillCastEnd,nil,nil,role)
role.Event:AddEvent(BattleEventName.RoleBeHit, onBeSkillCastEnd,nil,nil,role)
end,
@ -3969,6 +3972,9 @@ local passivityList = {
local list = RoleManager.Query(function(v)
return v.camp == role.camp and v.position ~= role.position
end)
if list==nil or #list==0 then
return
end
local ff = 1 -- 分摊比
-- 检测被动对分摊比的影响
local cl = {}
@ -4222,14 +4228,29 @@ local passivityList = {
-- a[float]
[197] = function(role, args,id,judge)
local f1 = args[1]
local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill)
if skill and (skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra) and target:IsDead() and not BattleUtil.CheckIsNoDead(target) then
BattleUtil.RandomAction(f1, function()
BattleUtil.CalRage(role, role, target.Rage, CountTypeName.Add)
end)
-- local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill)
-- if skill and (skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra) and target:IsDead() and not BattleUtil.CheckIsNoDead(target) then
-- BattleUtil.RandomAction(f1, function()
-- LogError("1111111111111")
-- BattleUtil.CalRage(role, role, target.Rage, CountTypeName.Add)
-- end)
-- end
-- end
-- role.Event:AddEvent(BattleEventName.RoleHit, onRoleHit,nil,nil,role)
local onSkillEnd=function(skill)
local list=skill:GetDirectTargetsNoMiss()
if not list then
return
end
for i = 1, #list do
if list[i]:IsDead() and not BattleUtil.CheckIsNoDead(list[i]) then
BattleUtil.RandomAction(f1, function()
BattleUtil.CalRage(role, role, list[i].deadRage, CountTypeName.Add)
end)
end
end
end
role.Event:AddEvent(BattleEventName.RoleHit, onRoleHit,nil,nil,role)
role.Event:AddEvent(BattleEventName.SkillCastEnd,onSkillEnd,nil,nil,role)
end,
-- 受到的[a]效果伤害降低[b]%(与减伤盾原理相同)[c]改变
@ -4572,6 +4593,9 @@ local passivityList = {
if curRound == round then
local list = RoleManager.Query(function(r) return r.camp == role.camp end)
list = BattleUtil.SortByProp(list, RoleDataName.Hp, 1)
if list[1]==nil then
return
end
local base = list[1]:GetRoleData(BattlePropList[pro])
local value = floor(BattleUtil.ErrorCorrection(base* f1))
BattleUtil.ApplyTreat(list[1], list[1], value)
@ -5684,23 +5708,28 @@ local passivityList = {
return
end
if skill and skill.owner==role and (skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra) and target:IsDead() and not BattleUtil.CheckIsNoDead(target) then
local dmg= floor(BattleUtil.ErrorCorrection((damage-finalDmg)*f1))
local list = RoleManager.Query(function(v) return v.camp ~= role.camp end)
list = BattleUtil.SortByHpFactor(list,0)
-- if not list[1]:IsDead() then
if list then
if not point then
point=list[1]
end
BattleUtil.FinalDamage(nil,role,point,dmg)
if curNum>=maxNum then
return
end
if num>0 then
BattleUtil.CalRage(role,point,num,CountTypeName.Sub)
curNum=curNum+num
end
end
BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime,function()
local dmg= floor(BattleUtil.ErrorCorrection((damage-finalDmg)*f1))
local list = RoleManager.Query(function(v) return v.camp ~= role.camp end)
list = BattleUtil.SortByHpFactor(list,0)
-- if not list[1]:IsDead() then
if list then
if not point then
point=list[1]
end
if point==nil then
return
end
BattleUtil.FinalDamage(nil,role,point,dmg)
if curNum>=maxNum then
return
end
if num>0 then
BattleUtil.CalRage(role,point,num,CountTypeName.Sub)
curNum=curNum+num
end
end
end)
end
end
role.Event:AddEvent(BattleEventName.RoleHit, onRoleHit,nil,nil,role)
@ -5834,13 +5863,17 @@ local passivityList = {
end
role.Event:AddEvent(BattleEventName.SkillCastEnd, OnRoleHit,nil,nil,role)
end,
-- 每释放[a]次技能,[b]增加[c]%,可叠加[d]次(d 填0为可叠加无数次)
-- a[int] b[int] c[float] d[int]
-- 每释放[a]次技能,[b]增加[c]%,可叠加[d]次(d 填0为可叠加无数次),[e]属性增加[f]%,[g]属性增加[h]%
-- a[int] b[int] c[float] d[int] e[int] f[float] g[int] h[float] (e,g,g h 不填不添加)
[262] = function(role, args,id,judge)
local num = args[1]
local pro = args[2]
local val = args[3]
local time = args[4]
local p1 = args[5]
local v1 = args[6]
local p2 = args[7]
local v2 = args[8]
local releaseNum=0
local addNum=0
-- 释放技能后
@ -5855,7 +5888,16 @@ local passivityList = {
--role.data:AddValue(BattlePropList[pro],val)
local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], val,CountTypeName.Add)
role:AddBuff(buff)
if p1~=nil and v1~=nil then
local buff1 = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[p1], v1,CountTypeName.Add)
role:AddBuff(buff1)
end
if p2~=nil and v2~=nil then
local buff2 = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[p2], v2,CountTypeName.Add)
role:AddBuff(buff2)
end
addNum=addNum+1
end
end
end
@ -6981,17 +7023,19 @@ local passivityList = {
local onPassiveDamaging = function(func, defRole, damage,skill)
if skill and not skill.isTriggerJudge and judge==1 then
return
end
end
--观音,这个被动只有额外技能才能触发 by王振兴 2021/1/21 17:48
if skill and skill.type == BattleSkillType.Extra then
if skill and skill.isAdd and (skill.type == BattleSkillType.Extra or skill.type == BattleSkillType.Special ) then
--如果是boss 并且额外伤害是根据最大生命则返回
if (f1==12 or f1==13) and BattleUtil.CheckIsBoss(defRole) then
return
end
local val = -floor(BattleUtil.FP_Mul(dt, defRole:GetRoleData(BattlePropList[f1])))
if func then
func(val)
end
local val = floor(BattleUtil.FP_Mul(dt, defRole:GetRoleData(BattlePropList[f1])))
-- LogError("val=="..val)
-- if func then
-- func(val)
-- end
BattleUtil.FinalDamageCountShield(nil,role,defRole,val)
end
end
role.Event:AddEvent(BattleEventName.PassiveDamaging, onPassiveDamaging,nil,nil,role)
@ -7466,7 +7510,7 @@ local passivityList = {
if skill then
table.insert(skill.triggerPassivityId,id)
end
local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.target.camp==role.camp and (buff.type==BuffName.Control or buff.type==BuffName.DOT or buff.type==BuffName.Exile ) end)
local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.target.camp==role.camp and (buff.type==BuffName.Control or buff.type==BuffName.DOT ) end)
local len=BattleUtil.LengthOfTable(list)
if list and len>0 then
local index=Random.RangeInt(1,len)
@ -8968,7 +9012,7 @@ local passivityList = {
return
end
role.Event:RemoveEvent(BattleEventName.RoleTreat,onRoleTreat,nil,nil,role)
local list = skill:GetDirectTargetsNoNoDead()
local list = RoleManager.Query(function(v) return v.camp == role.camp end)
if list and #list>0 then
BattleUtil.SortByHpFactor(list,type)
BattleUtil.FinalTreat(role,list[1],floor(addHp))
@ -9123,6 +9167,9 @@ local passivityList = {
return
end
list = BattleUtil.SortByProp(list, BattlePropList[pro],sort)
if list==nil or #list==0 then
return
end
BattleUtil.CalRage(role,list[1],addNum,ct)
end
role.Event:AddEvent(BattleEventName.SkillCastEnd,onSkillCast,nil,nil,role)
@ -9472,15 +9519,11 @@ local passivityList = {
BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange,onRoundChange,nil,nil,role)
end,
--目标存在御甲,追击的普攻对御甲额外造成[a]倍伤害,不存在御甲,追击的普攻额外造成目标[b][c]%的伤害
--【御甲不足以抵扣a倍伤害 对神将造成血量伤害=([d]属性*[e]-御甲值)/[f]】
--a[int],b[int],c[float],d[int],e[int],f[int]
--a[int],b[int],c[float]
[383]=function(role, args,id,judge)
local d1 = args[1]
local p1 = args[2]
local v1 = args[3]
local p2 = args[4]
local v2 = args[5]
local d2 = args[6]
local passiveDmg=function(func, defRole, damage, skill, dotType, bCrit,damageType, dotType,isDirect)
if not skill then
return
@ -9501,7 +9544,7 @@ local passivityList = {
else
local jia=defRole.bloodShield.bloodValue
if damage*d1>jia then
local aaa=(role:GetRoleData(BattlePropList[p2])*v2-jia)/d2
local aaa=damage-(jia/d1)+jia-damage
func(-floor(aaa))
else
func(-floor(damage*(d1-1)))
@ -10163,6 +10206,638 @@ local passivityList = {
end
role.Event:AddEvent(BattleEventName.BuffCaster, OnBuffStart,nil,nil,role)
end
end,
--被自身添加[a]类型[b]效果的目标,有[c]%概率无法改变[d]怒气
--a[int],b[int],c[float]
[402]=function(role, args,id,judge)
local t1=args[1]
local t2=args[2]
local pro=args[3]
local ct=args[4]
local onRageChange=function(func,caster,target,value,type)
if target.camp==role.camp then
return
end
if ct~=type then
return
end
if BattleLogic.BuffMgr:HasBuff(target, t1, function (buff) return buff.damageType == t2 and buff.caster==role end ) then
BattleUtil.RandomAction(pro,function()
if func then
func(0)
end
end)
end
end
BattleLogic.Event:AddEvent(BattleEventName.ChangeRoleRage,onRageChange,nil,nil,role)
end,
--暴击伤害改变[a] [b]%+[c]%*([d]+目标身上[e]类型[f]状态buff层数)
--a[int],b[float],c[float],d[int],e[int],f[int]
[403]=function(role,args,id,judge)
local ct=args[1]
local v1=args[2]
local v2=args[3]
local v3=args[4]
local t1=args[5]
local t2=args[6]
local addCritDamageFa=function(func,atkRole,defRole)
local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.target==defRole and buff.type==t1 and buff.damageType==t2 end)
local len=BattleUtil.LengthOfTable(list)
if func then
func(v1+v2*(v3+len),ct)
end
end
role.Event:AddEvent(BattleEventName.PassiveAddCritDamageFactor,addCritDamageFa,nil,nil,role)
end,
--直接伤害攻击的目标不足[a]人,爆伤改变[b][c]%,目标达到[d]人额外增加自身[e]点怒气
--a[int],b[int],c[float],d[int],e[int]
[404]=function(role,args,id,judge)
local v1=args[1]
local ct=args[2]
local v2=args[3]
local v3=args[4]
local v4=args[5]
local addCritDamageFa=function(func,atkRole,defRole,skill)
if not skill then
return
end
local list = skill:GetDirectTargetsNoExile()
if #list<v1 then
if func then
func(v2,ct)
end
end
end
role.Event:AddEvent(BattleEventName.PassiveAddCritDamageFactor,addCritDamageFa,nil,nil,role)
local onSkillEnd=function(skill)
if not skill or skill==nil then
return
end
local list = skill:GetDirectTargetsNoExile()
if list~=nil and #list>=v3 then
BattleUtil.CalRage(role,role,v4,CountTypeName.Add)
end
end
role.Event:AddEvent(BattleEventName.SkillCastEnd,onSkillEnd,nil,nil,role)
end,
--敌方处于[a]类型[b]状态的单位死亡,自身立即获得全场[c]状态[d]类型buff层数*[e]的怒气,每回合触发[f]次
--a[int],b[int],c[int],d[int],e[float],f[int]
[405]=function(role,args,id,judge)
local t1=args[1]
local t2=args[2]
local t3=args[3]
local t4=args[4]
local v1=args[5]
local time=args[6]
if args[6]==nil then
time=1
end
local triggerTime=0
local onRoleDead=function(defRole, atkRole)
if defRole and defRole.camp==role.camp then
return
end
if BattleUtil.CheckIsNoDead(defRole) then
return
end
if BattleLogic.BuffMgr:HasBuff(defRole, t1, function (buff) return buff.damageType == t2 end ) then
if triggerTime>=time then
return
end
local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.type==t1 and buff.damageType==t2 end)
local len=BattleUtil.LengthOfTable(list)
local num= floor(v1*len)
BattleUtil.CalRage(role,role,num,CountTypeName.Add)
triggerTime=triggerTime+1
end
end
BattleLogic.Event:AddEvent(BattleEventName.BattleRoleDead,onRoleDead,nil,nil,role)
local onRoundChange=function()
triggerTime=0
end
BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange,onRoundChange,nil,nil,role)
end,
--第[a]回合必定命中
--a[int]
[406]=function(role,args,id,judge)
local v1=args[1]
local lastHit=false
BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, function(curRound)
-- 第i1回合开始
if curRound == v1 then
lastHit=role.mustHit
role.mustHit=true
end
-- 第i1+i2回合结束
if curRound == v1+1 then
role.mustHit=lastHit
end
end,nil,nil,role)
end,
--每次释放技能触发一次[a]类型[b]状态,无视目标[a]%的护甲和[b]%的减伤,期间被控制破解状态解除,破甲叠到[c]层后破甲不可解除
-- a[int],b[int],c[float],d[float],e[int]
[407]=function(role,args,id,judge)
local t1=args[1]
local t2=args[2]
local v1=args[3]
local v2=args[4]
local num=args[5]
--添加破甲
local onSkillCastEnd=function(skill)
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if skill.type~=BattleSkillType.Special and skill.type~=BattleSkillType.Extra and skill.type~=BattleSkillType.DeadSkill then
return
end
local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.target==role and buff.type==t1 and buff.signType==t2 end)
local len=BattleUtil.LengthOfTable(list)
if len>=num then
return
end
local buff=Buff.Create(role,t1,0,t2)
role:AddBuff(buff)
end
role.Event:AddEvent(BattleEventName.SkillCastEnd,onSkillCastEnd,nil,nil,role)
--移除破甲
local buffBeAdd=function(buff)
if buff.type== BuffName.Control then
local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.target==role and buff.type==t1 and buff.signType==t2 end)
local len=BattleUtil.LengthOfTable(list)
if len>=num then
return
end
BattleLogic.BuffMgr:ClearBuff(role, function(buff)
return buff.type==t1 and buff.signType==t2
end)
end
end
role.Event:AddEvent(BattleEventName.BuffBeAdd, buffBeAdd,nil,nil,role)
local ignoreDef=function(func)
if BattleLogic.BuffMgr:HasBuff(role,t1, function (buff) return buff.signType==t2 end ) then
if func then
func(v1,CountTypeName.Add)
end
end
end
role.Event:AddEvent(BattleEventName.PassiveChangeIgnoreDef,ignoreDef,nil,nil,role)
local addDMGFac=function(func)
if BattleLogic.BuffMgr:HasBuff(role,t1, function (buff) return buff.signType==t2 end ) then
if func then
func(v2,CountTypeName.Sub)
end
end
end
role.Event:AddEvent(BattleEventName.PassiveChangeDefDMGReFac,addDMGFac,nil,nil,role)
end,
--被自身添加[a]类型[b]效果的目标,己方[c]系神将对其暴击率改变[d][e]%,命中改变[f][g]%
--a[int],b[int],c[int],d[int],e[float],f[float]
[408]=function(role, args,id,judge)
local t1 = args[1]
local t2 = args[2]
local ele = args[3]
local ct = args[4]
local v1 = args[5]
local ct2 = args[6]
local v2 = args[7]
local changeCrit=function(func,atkRole,defRole,skill)
if atkRole.camp~=role.camp or atkRole.element~=ele then
return
end
if not BattleLogic.BuffMgr:HasBuff(defRole, t1, function (buff) return buff.ctrlType==t2 and buff.caster==role end) then
return
end
if func then
func(v1,ct)
end
end
BattleLogic.Event:AddEvent(BattleEventName.TemporaryChangeCrit,changeCrit,nil,nil,role)
local changeRoleHit=function(func,atkRole,defRole)
if atkRole.camp~=role.camp or atkRole.element~=ele then
return
end
if not BattleLogic.BuffMgr:HasBuff(defRole, t1, function (buff) return buff.ctrlType==t2 and buff.caster==role end) then
return
end
if func then
func(v2,ct2)
end
end
BattleLogic.Event:AddEvent(BattleEventName.PassiveChangeRoleHit,changeRoleHit,nil,nil,role)
end,
--释放技能后有本次被添加[a]类型[b]效果的目标数量*10/100的几率 额外控制[c]属性最[d]且没被控制的目标[e]回合
--a[int],b[int],c[int],d[int 0:高 1低]
[409]=function(role, args,id,judge)
local t1=args[1]
local t2=args[2]
local p1=args[3]
local sort=args[4]
local r1=args[5]
local onCastEnd=function(skill)
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if skill.type~=BattleSkillType.Special and skill.type~=BattleSkillType.Extra and skill.type~=BattleSkillType.DeadSkill then
return
end
local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.caster==role and buff.type==t1 and buff.ctrlType==t2 and buff.startRound == BattleLogic.GetCurRound() end)
local len=BattleUtil.LengthOfTable(list)
if len>0 then
local list=RoleManager.Query(function(target)
if not BattleLogic.BuffMgr:HasBuff(target, t1, function (buff) return buff.ctrlType==t2 end) and target.camp~=role.camp then
return true
end
end)
if #list>0 then
list = BattleUtil.SortByProp(list, BattlePropList[p1],sort)
if list[1]~=nil then
BattleUtil.RandomControl(len*10/100,t2,role,list[1],r1)
end
end
end
end
role.Event:AddEvent(BattleEventName.SkillCastEnd,onCastEnd,nil,nil,role)
end,
--每次释放技能给敌方所有未处于控制[a]类型的敌人添加[b]类型[c]状态效果,每层效果提高控制概率[d]%,(效果最多叠加[e]层)被控制后状态消失,每层消失额外造成目标[f]属性[g]%的伤害
--a[int],b[int],c[int],d[float],e[int],f[int],g[float]
[410]=function(role,args,id,judge)
local t1=args[1]
local t2=args[2]
local t3=args[3]
local p1=args[4]
local num=args[5]
local pro=args[6]
local v1=args[7]
--添加buff
local onCastEnd=function(skill)
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if skill.type~=BattleSkillType.Special and skill.type~=BattleSkillType.Extra and skill.type~=BattleSkillType.DeadSkill then
return
end
local list=RoleManager.Query(function(target)
if not BattleLogic.BuffMgr:HasBuff(target, BuffName.Control, function (buff) return buff.ctrlType==t1 end) and target.camp~=role.camp then
return true
end
end)
if #list>0 then
for i = 1, #list do
local list2=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.type==t2 and buff.signType==t3 and buff.target==list[i] end)
local len=BattleUtil.LengthOfTable(list2)
if len<num then
local buff=Buff.Create(role,t2,0,t3)
list[i]:AddBuff(buff)
end
end
end
end
role.Event:AddEvent(BattleEventName.SkillCastEnd,onCastEnd,nil,nil,role)
--增加命中
local changeRoleHit=function(func,ctrl,atkRole,defRole)
if ctrl~=t1 then
return
end
if atkRole.camp~=role.camp then
return
end
local list2=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.type==t2 and buff.signType==t3 end)
local len=BattleUtil.LengthOfTable(list2)
if len>0 then
if func then
func(p1*len,CountTypeName.Add)
end
end
end
BattleLogic.Event:AddEvent(BattleEventName.PassiveBeRandomControl,changeRoleHit,nil,nil,role)
--移除破甲
local buffBeAdd=function(caster,target,buff)
if caster.camp==role.camp and buff.type== BuffName.Control and buff.ctrlType==t1 then
BattleLogic.BuffMgr:ClearBuff(target, function(buff)
return buff.type==t2 and buff.signType==t3
end)
end
end
BattleLogic.Event:AddEvent(BattleEventName.RecordBuff, buffBeAdd,nil,nil,role)
local onBuffEnd=function(buff)
if buff.caster==role and buff.type==t2 and buff.signType==t3 then
local isBoss=BattleUtil.CheckIsBoss(buff.target)
if isBoss and pro==12 then
return
end
local damage=floor(BattleUtil.FP_Mul(v1, buff.target:GetRoleData(BattlePropList[pro])))
BattleUtil.FinalDamageCountShield(nil,role,buff.target,damage)
end
end
BattleLogic.Event:AddEvent(BattleEventName.BuffEnd,onBuffEnd,nil,nil,role)
end,
--每次释放技能未被添加[a]类型[b]效果的敌方,添加[c]类型[d]效果,每层效果添加概率改变[e][f]%,被控制后清除效果
--a[int],b[int],c[int],d[int],e[int],f[flaot]
[411]=function(role,args,id,judge)
local t1=args[1]
local t2=args[2]
local t3=args[3]
local t4=args[4]
local ct=args[5]
local v1=args[6]
--添加buff
local onCastEnd=function(skill)
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if skill.type~=BattleSkillType.Special and skill.type~=BattleSkillType.Extra and skill.type~=BattleSkillType.DeadSkill then
return
end
local list=RoleManager.Query(function(target)
if not BattleLogic.BuffMgr:HasBuff(target,t1, function (buff) return buff.ctrlType==t2 end) and target.camp~=role.camp then
return true
end
end)
if #list>0 then
for i = 1, #list do
local buff=Buff.Create(role,t3,0,t4)
list[i]:AddBuff(buff)
end
end
end
role.Event:AddEvent(BattleEventName.SkillCastEnd,onCastEnd,nil,nil,role)
--增加命中
local changeRoleHit=function(func,ctrl,atkRole,defRole)
if ctrl~=t2 then
return
end
if atkRole.camp~=role.camp then
return
end
local list2=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.type==t3 and buff.signType==t4 end)
local len=BattleUtil.LengthOfTable(list2)
if len>0 then
if func then
func(v1*len,ct)
end
end
end
BattleLogic.Event:AddEvent(BattleEventName.PassiveBeRandomControl,changeRoleHit,nil,nil,role)
--移除破甲
local buffBeAdd=function(caster,target,buff)
if caster.camp==role.camp and buff.type== t1 and buff.ctrlType==t2 then
BattleLogic.BuffMgr:ClearBuff(target, function(buff)
return buff.type==t3 and buff.signType==t4
end)
end
end
BattleLogic.Event:AddEvent(BattleEventName.RecordBuff, buffBeAdd,nil,nil,role)
end,
--我方神将阵亡后,为随机1个存活神将添加[a]类型[b]效果,持续[c]回合,每场战斗最多触发[d]次,每回合最多触发[e]次
--a[int],b[int],c[int],d[int],e[int]
[412]=function(role,args,id,judge)
local t1=args[1]
local t2=args[2]
local r1=args[3]
local t3=args[4]
local t4=args[5]
local maxTime=0
local rTime=0
if PassiveManager.passiveCountList[role.camp][id] and PassiveManager.passiveCountList[role.camp][id] > 0 then
return
end
PassiveManager.passiveCountList[role.camp][id] = 1
local RoleVanish=function(deader)
--BattleLogic.WaitForTrigger(2,function()
if deader.camp~=role.camp then
return
end
BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function ()
if maxTime>=t3 then
return
end
if rTime>=t4 then
return
end
local arr=RoleManager.Query(function(v) return v.camp==role.camp and not BattleUtil.CheckIsNoDead(v) end)
if arr==nil or #arr==0 then
return
end
local index = Random.RangeInt(1, #arr)
if arr[index] then
-- local caster=RoleManager.GetRole()
-- caster:Init(role.uid,role.roleData,role.position)
-- caster.type=BattleUnitType.Monster
local buff=Buff.Create(deader,t1,r1,t2,0)
arr[index]:AddBuff(buff)
maxTime=maxTime+1
rTime=rTime+1
end
end)
-- end)
end
--即使被放逐也会同样生效
BattleLogic.Event:AddEvent(BattleEventName.RoleRealDead,RoleVanish)
local onBattleRoundChange = function(func, caster)
rTime=0
end
BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, onBattleRoundChange)
end,
-- 每有一个[a]阵营神将改变[b]%[c]属性 改变类型[d](战前全体生效用)
--a[int],b[float],c[属性],d[int]
[413] =function(role,args,id,judge)
end,
--释放技能后随机[a]次目标,每次改变[b]目标[c]点怒气
--a[int],b[int],c[int]
[414]=function(role,args,id,judge)
local t1 = args[1]
local ct = args[2]
local num = args[3]
local OnSkillCastEnd = function(skill)
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if skill.type~=BattleSkillType.Special then
return
end
local arr=RoleManager.Query(function(v) return v.camp~=role.camp end)
if arr==nil or #arr==0 then
return
end
for i = 1, t1 do
local index = Random.RangeInt(1, #arr)
BattleUtil.CalRage(role,arr[index],num,ct)
end
end
role.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd,nil,nil,role)
end,
--[a]%的概率免疫一次伤害,每个英雄每场战斗仅触发[b]次
--a[float],b[int]
[415] = function(role,args,id,judge)
local pro= args[1]
local num=args[2]
local time=0
local checkDamage=function(func,atkRole,defRole)
if time>=num then
return
end
BattleUtil.RandomAction(pro,function()
if func then
func(true)
role.Event:DispatchEvent(BattleEventName.ShowHintText, BattleArtFontType.Immune)
time=time+1
end
end)
end
role.Event:AddEvent(BattleEventName.CheckDamageIsImmune,checkDamage,nil,nil,role)
end,
--攻击时,自身生命百分比[a]于目标,造成的伤害[b]改变[c]%
--a[int 1:高于 2低于 ],b[int],c[float]
[416]=function(role,args,id,judge)
local type=args[1]
local ct=args[2]
local v1=args[3]
local finalDamage=function(func, defRole, damage, skill)
local atk=BattleUtil.GetHPPencent(role)
local def=BattleUtil.GetHPPencent(defRole)
if type==1 and atk<=def then
return
end
if type==2 and atk>=def then
return
end
local add=damage-floor(BattleUtil.CountValue(damage,v1,ct))
if func then
func(add)
end
end
role.Event:AddEvent(BattleEventName.FinalDamage,finalDamage,nil,nil,role)
end,
--生命百分比低于[a]%时触发,[b]改表[c]属性[d]%,[e]改变[f]属性[g]%,持续[h]回合,每场战斗触发[i]次
--a[float],b[int],c[int],d[float],e[int],f[int],g[float],h[int],i[int]
[417]=function(role,args,id,judge)
local pro=args[1]
local ct1=args[2]
local p1 =args[3]
local v1 =args[4]
local ct2=args[5]
local p2 =args[6]
local v2 =args[7]
local round=args[8]
local num=args[9]
local time=0
local onRoleBeDamage=function()
if time>=num then
return
end
local atk=BattleUtil.GetHPPencent(role)
if atk<pro then
local buff1=Buff.Create(role,BuffName.PropertyChange,round,BattlePropList[p1],v1,ct1)
local buff2=Buff.Create(role,BuffName.PropertyChange,round,BattlePropList[p2],v2,ct2)
role:AddBuff(buff1)
role:AddBuff(buff2)
time=time+1
end
end
role.Event:AddEvent(BattleEventName.RoleBeDamaged,onRoleBeDamage,nil,nil,role)
end,
--御甲消失时,神将未死亡,回复[a]属性[b]%的血量
--a[int],b[float]
[418]=function(role,args,id,judge)
local p1=args[1]
local v1=args[2]
local onValueChange=function(buff)
if buff.type==BuffName.Blood and not role:IsDead() then
local tv = floor(BattleUtil.ErrorCorrection(role:GetRoleData(BattlePropList[p1]) * v1))
--BattleUtil.AddBlood(role,tv)
BattleUtil.FinalTreat(role,role,tv)
end
end
role.Event:AddEvent(BattleEventName.BuffEnd,onValueChange,nil,nil,role)
end,
--己方神将死亡时,自身回复[a]属性[b]%的血量,并增加[c]属性[d]%的御甲
--a[int],b[float],c[int],d[float]
[419]=function(role,args,id,judge)
local onRoleDead=function(target)
local p1=args[1]
local v1=args[2]
local p2=args[3]
local v2=args[4]
if target~=role and target.camp==role.camp and not BattleUtil.CheckIsNoDead(target) then
BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime*2, function ()
local tv = floor(BattleUtil.ErrorCorrection(role:GetRoleData(BattlePropList[p1]) * v1))
local tv2 = floor(BattleUtil.ErrorCorrection(role:GetRoleData(BattlePropList[p2]) * v2))
BattleUtil.FinalTreat(role,role,tv)
BattleUtil.AddBlood(role,tv2)
end)
end
end
BattleLogic.Event:AddEvent(BattleEventName.BattleRoleDead,onRoleDead,nil,nil,role)
end,
--攻击时额外[a]改变当前存活神将*[b]%的直接伤害
--a[int],b[float]
[420]=function(role,args,id,judge)
local ct=args[1]
local v1=args[2]
local finalDamage=function(func, defRole, damage, skill)
if not skill then
return
end
local list = RoleManager.QueryIncludeExileNoNoDead(function(v) return v.camp==role.camp end)
local add=damage-floor(BattleUtil.CountValue(damage,v1*#list,ct))
if func then
func(add)
end
end
role.Event:AddEvent(BattleEventName.FinalDamage,finalDamage,nil,nil,role)
end,
--释放技能攻击(非追击)有[a]%的概率偷取目标[b]点怒气。
--a[float],b[int]
[421]=function(role,args,id,judge)
local p1=args[1]
local num=args[2]
-- 释放技能后
local onRoleHit = function(target,damage,bCrit,finalDmg,damageType,skill)
if skill==nil or skill.type~= BattleSkillType.Special then
return
end
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if target.Rage>0 and not target.isImmuneReduceRage and not BattleLogic.BuffMgr:HasBuff(target, BuffName.Shield, function (buff) return buff.shieldType == ShieldTypeName.AllReduce end) then
BattleUtil.RandomAction(p1,function()
BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function ()
BattleUtil.CalRage(role,target,num,CountTypeName.Sub)
BattleUtil.CalRage(role,role,num,CountTypeName.Add)
end)
end)
end
end
role.Event:AddEvent(BattleEventName.RoleHit, onRoleHit,nil,nil,role)
end,
}
return passivityList

View File

@ -488,6 +488,7 @@ function BattleLogic.Update()
end
if CurRound > MaxRound then
if BattleLogic.Type == BATTLE_SERVER_TYPE.TOPFight -- 巅峰赛
or BattleLogic.Type == BATTLE_SERVER_TYPE.ArenaFight
or BattleLogic.Type == BATTLE_SERVER_TYPE.Firend
or BattleLogic.Type == BATTLE_SERVER_TYPE.CrossYuxuLunDaoFight
or BattleLogic.Type == BATTLE_SERVER_TYPE.LINGMAIMIJING
@ -569,6 +570,7 @@ function BattleLogic.BattleEnd(result)
local v1 = HardStageCondition.CheckCondition(harConfig.ConditionType,harConfig.ConditionValue)
table.insert(levelStarRecord,hardStageConfig.ConditionValue[i])
table.insert(levelStarRecord,v1)
print("k=="..hardStageConfig.ConditionValue[i].." v=="..v1)
end
end
end

View File

@ -0,0 +1,33 @@
BreakArmor = Buff:New()
--初始化Buff通过传入一些自定义参数控制成长相关的数值
function BreakArmor:SetData(...)
self.signType=...
-- 刷新排序等级
self.sort = 4
end
--初始化后调用一次
function BreakArmor:OnStart()
end
--间隔N帧触发返回true时表示继续触发返回false立刻触发OnEnd
function BreakArmor:OnTrigger()
return true
end
--效果结束时调用一次
function BreakArmor:OnEnd()
end
--只有当cover字段为true时触发返回true则被新效果覆盖
function BreakArmor:OnCover(newBuff)
return true
end
return BreakArmor

View File

@ -27,6 +27,9 @@ end
-- 记录承受伤害
function NoDead:OnRoleBeHit(atkRole, damage, bCrit, finalDmg, damageType, skill,isDirect)
if skill and (skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra or skill.type==BattleSkillType.DeadSkill ) and atkRole.camp~=self.target.camp then
if self.changePro==nil then
self.changePro=0.1
end
self.recordDamage=self.recordDamage+math.floor(damage*self.changePro)
end
end
@ -65,6 +68,9 @@ function NoDead:OnEnd()
self.target.Event:RemoveEvent(BattleEventName.RoleBeHit,self.OnRoleBeHit,self)
end
--self.target.Event
if self.pro==nil then
self.pro=0
end
local isRand=BattleUtil.RandomAction(self.pro,function()
RoleManager.RemoveDeadRole(self.target)
self.target.isDead=false

View File

@ -1,12 +1,16 @@
Shield = Buff:New()
-- 无敌吸血盾的免疫状态
local immune0 = function(buff)
return buff.type == BuffName.Control or buff.isDeBuff or buff.type == BuffName.DOT
end
--local immune0 = nil
--local onRoleBeHit=nil
-- function Shield:immune0(buff)
-- return buff.type == BuffName.Control or buff.isDeBuff or buff.type == BuffName.DOT or (buff.caster~=nil and buff.caster.camp~=self.target.camp and buff.type~= BuffName.Exile)
-- end
--初始化Buff通过传入一些自定义参数控制成长相关的数值
function Shield:SetData(...)
self.shieldType, -- 护盾类型(1 固定减伤盾 2 百分比减伤盾 3 无敌盾)
self.shieldType, -- 护盾类型(1 固定减伤盾 2 百分比减伤盾 3 无敌盾 5.反伤盾 )
self.shieldValue, -- 护盾值(固定减伤盾:减伤值 百分比减伤盾:减伤百分比 无敌盾:吸血率)
self.dmgReboundFactor = ... --伤害反弹系数
self.damageSum = 0 --记录承受的伤害
@ -16,18 +20,43 @@ function Shield:SetData(...)
self.cover = self.shieldType ~= ShieldTypeName.NormalReduce -- 除固定减伤盾外都不能叠加
-- 刷新排序等级
self.sort = 4
self.triggerNum=0
self.onRoleBeHit=function(atkRole, damage, bCrit, finalDmg, damageType, skill)
--damagetype为3 是 舍身济世分摊伤害
if damageType==3 then
return
end
if skill then --技能造成的直接伤害
local rDamage = math.floor(damage*self.shieldValue)
if rDamage ~= 0 then
self.triggerNum=self.triggerNum+1
BattleUtil.ApplyDamage(nil,self.target,atkRole, rDamage)
if self.triggerNum>=self.dmgReboundFactor then
self.disperse=true
end
end
end
end
self.immune0=function(buff)
return buff.type == BuffName.Control or buff.isDeBuff or buff.type == BuffName.DOT or (buff.caster.camp~=self.target.camp and buff.type~= BuffName.Exile)
end
end
--初始化后调用一次
function Shield:OnStart()
self.target.shield:Add(self)
if self.shieldType == ShieldTypeName.AllReduce then
self.target.buffFilter:Add(immune0)
self.target.buffFilter:Add(self.immune0)
-- 清除所有负面buff
BattleLogic.BuffMgr:ClearBuff(self.target, function (buff)
return buff.type == BuffName.Control or buff.type == BuffName.DOT
return buff.type == BuffName.Control or buff.type == BuffName.DOT or buff.caster.camp~=self.target.camp
end)
elseif self.shieldType == ShieldTypeName.ThornsReduce then
self.target.Event:AddEvent(BattleEventName.RoleBeHit,self.onRoleBeHit,nil,nil,self.target)
end
end
@ -80,6 +109,8 @@ function Shield:CountShield(damage, atkRole,skill)
local treatValue = math.floor(BattleUtil.ErrorCorrection(damage * self.shieldValue))
BattleUtil.ApplyTreat(self.target, self.target, treatValue)
end
elseif self.shieldType == ShieldTypeName.ThornsReduce then
finalDamage=damage
end
--
@ -124,6 +155,8 @@ function Shield:PreCountShield(damage)
elseif self.shieldType == ShieldTypeName.AllReduce then
finalDamage = 0
elseif self.shieldType == ShieldTypeName.ThornsReduce then
finalDamage=damage
end
return finalDamage
end
@ -166,16 +199,27 @@ function Shield:OnEnd()
end
elseif self.shieldType == ShieldTypeName.AllReduce then
-- 移除免疫效果
for i = 1, self.target.buffFilter.size do
if self.target.buffFilter.buffer[i] == self.immune0 then
self.target.buffFilter:Remove(i)
break
end
end
for i = 1, self.target.shield.size do
if self.target.shield.buffer[i] == self then
self.target.shield:Remove(i)
break
end
end
-- 移除免疫效果
for i = 1, self.target.buffFilter.size do
if self.target.buffFilter.buffer[i] == immune0 then
self.target.buffFilter:Remove(i)
elseif self.shieldType == ShieldTypeName.ThornsReduce then
self.target.Event:RemoveEvent(BattleEventName.RoleBeHit,self.onRoleBeHit,nil,nil,self.target)
for i = 1, self.target.shield.size do
if self.target.shield.buffer[i] == self then
self.target.shield:Remove(i)
break
end
end

View File

@ -190,6 +190,13 @@ BattleEventName = {
PassiveAddCritDamageFactor = indexAdd(), --被动增加爆伤系数
PassiveChangeIgnoreImmuneValue = indexAdd(),--被动修改无视
ImmuneDebuffSuccess = indexAdd(),--免疫debuff成功
ChangeRoleRage = indexAdd(),--改变角色怒气
PassiveChangeIgnoreDef = indexAdd(),--被动改变无视防御比例
PassiveChangeDefDMGReFac = indexAdd(),--被动改变防御方减伤比例
PassiveChangeRoleHit = indexAdd(),--被动改变角色命中
RoleIsVanish = indexAdd(), -- 角色已经从显示层消失
CheckDamageIsImmune = indexAdd(),--检测伤害是否免疫
}
BattleMaxFrame = 1000000
@ -272,6 +279,7 @@ BuffName = {
BanBlood = 14,
SigilSign = 15,
CommonSign = 16,
BreakArmor = 17,
}
DotType = {
@ -289,6 +297,7 @@ ControlType = {
Blind = 5,
Palsy = 7,
Chaos = 8,
}
BattleSkillType = {
@ -326,6 +335,7 @@ ShieldTypeName = {
NormalReduce = 1, -- 固定值减伤
RateReduce = 2, -- 百分比减伤
AllReduce = 3, -- 无敌护盾
ThornsReduce = 5, --反伤盾
}
--额外释放技能

View File

@ -8,7 +8,7 @@ local min = math.min
--local BattleEventName = BattleEventName
BattleUtil.Passivity = require("Modules/Battle/Logic/Base/Passivity")
local function table_removebyvalue(array, value, removeall)
function table_removebyvalue(array, value, removeall)
local c, i, max = 0, 1, #array
while i <= max do
if array[i] == value then
@ -387,7 +387,7 @@ function BattleUtil.ChooseTarget(role, chooseId)
if sort~=0 then
BattleUtil.SortByProp(arr, RoleDataName.Hp, sort)
end
elseif chooseWeight == 2 then -- 血量百分比
elseif chooseWeight == 2 then -- 血量百分比(不含不灭)
BattleUtil.SortByHpFactor(arr, sort)
--选血量百分比最低的 不选择有不灭的,如果伤害要选有不灭的 需处理
BattleUtil.RemoveNoDeadRole(arr)
@ -441,8 +441,18 @@ function BattleUtil.ChooseTarget(role, chooseId)
if list and #list>0 then
arr=RoleManager.GetNeighbor(list[1], chooseType)
end
elseif chooseWeight ==15 then --敌方
-- body
elseif chooseWeight ==15 then --我方阵亡
local aaa=RoleManager.GetDeadRole(role.camp)
if aaa~=nil then
--LogError(aaa.position)
end
aaa.isRealDead=false
arr={}
table.insert(arr,aaa)
-- return aaa
elseif chooseWeight ==16 then --(血量百分比 含不灭)
BattleUtil.SortByHpFactor(arr, sort)
end
local finalArr = {}
if num == 0 then
@ -617,6 +627,9 @@ end
-- 计算真实伤害
function BattleUtil.ApplyDamage(skill, atkRole, defRole, damage, bCrit, damageType, dotType,isDirect)
if defRole==nil then
return
end
-- 灵兽无效
if defRole.type == BattleUnitType.Monster or defRole.type == BattleUnitType.Player then
return
@ -703,11 +716,18 @@ function BattleUtil.CalRage(caster, target, value, countType,isBorrow)
if (countType==3 or countType==4) and target.RoundMaxSubRage~=0 and value+target.AllSubRage>target.RoundMaxSubRage then
value=target.RoundMaxSubRage-target.AllSubRage
end
local changeRage=function(num)
value=num
end
BattleLogic.Event:DispatchEvent(BattleEventName.ChangeRoleRage,changeRage,caster,target,value,countType)
-- 操作怒气
local deltaRage = target:AddRage(value, countType)
if (countType==3 or countType==4) and target.RoundMaxSubRage~=0 then
target.AllSubRage=target.AllSubRage-deltaRage
end
if value==0 then
return
end
caster.Event:DispatchEvent(BattleEventName.RecordRageChange, caster, target, deltaRage,countType,value,lastRage,isBorrow)
BattleLogic.Event:DispatchEvent(BattleEventName.RecordRageChange, caster, target, deltaRage,countType,value,lastRage,isBorrow)
-- 用于记录统计
@ -776,6 +796,11 @@ function BattleUtil.FinalDamage(skill, atkRole, defRole, damage, bCrit, damageTy
damage=realDamage
end
defRole.Event:DispatchEvent(BattleEventName.CheckLiZhanZhiQu, damagingFunc, atkRole, realDamage, skill, dotType, bCrit, damageType,isDirect)
local isImmune=BattleUtil.CheckDamageIsImmune(atkRole,defRole)
if isImmune then
realDamage=0
damage=0
end
--御甲过滤后的伤害只会处理扣血 by: wangzhenxing shihongyi 2021/09/27
local finalDmg = defRole.data:SubValue(RoleDataName.Hp,realDamage)
if finalDmg >= 0 then
@ -787,7 +812,7 @@ function BattleUtil.FinalDamage(skill, atkRole, defRole, damage, bCrit, damageTy
end
atkRole.Event:DispatchEvent(BattleEventName.RoleDamage, defRole, damage, bCrit, finalDmg, damageType, dotType, skill)
defRole.Event:DispatchEvent(BattleEventName.RoleBeDamaged, atkRole, damage, bCrit, finalDmg, damageType, dotType, skill)
defRole.Event:DispatchEvent(BattleEventName.RoleBeDamaged, atkRole, damage, bCrit, finalDmg, damageType, dotType, skill,isImmune)
BattleLogic.Event:DispatchEvent(BattleEventName.RoleDamage, atkRole, defRole, damage, bCrit, finalDmg, damageType, dotType, skill)
BattleLogic.Event:DispatchEvent(BattleEventName.RoleBeDamaged, defRole, atkRole, damage, bCrit, finalDmg, damageType, dotType, skill)
if bCrit then
@ -856,6 +881,11 @@ function BattleUtil.FinalDamageCountShield(skill, atkRole, defRole, damage, bCri
defRole.Event:DispatchEvent(BattleEventName.CheckLiZhanZhiQu, damagingFunc, atkRole, realDamage, skill, dotType, bCrit, damageType,isDirect)
--LogError("最后扣除伤害=="..realDamage)
--御甲过滤后的伤害只会处理扣血 by: wangzhenxing shihongyi 2021/09/27
local isImmune=BattleUtil.CheckDamageIsImmune(atkRole,defRole)
if isImmune then
realDamage=0
damage=0
end
local finalDmg = defRole.data:SubValue(RoleDataName.Hp,realDamage)
if finalDmg >= 0 then
if defRole:GetRoleData(RoleDataName.Hp) <= 0 and not defRole:IsDead() then
@ -866,7 +896,7 @@ function BattleUtil.FinalDamageCountShield(skill, atkRole, defRole, damage, bCri
end
atkRole.Event:DispatchEvent(BattleEventName.RoleDamage, defRole, damage, bCrit, finalDmg, damageType, dotType, skill)
defRole.Event:DispatchEvent(BattleEventName.RoleBeDamaged, atkRole, damage, bCrit, finalDmg, damageType, dotType, skill)
defRole.Event:DispatchEvent(BattleEventName.RoleBeDamaged, atkRole, damage, bCrit, finalDmg, damageType, dotType, skill,isImmune)
BattleLogic.Event:DispatchEvent(BattleEventName.RoleDamage, atkRole, defRole, damage, bCrit, finalDmg, damageType, dotType, skill)
BattleLogic.Event:DispatchEvent(BattleEventName.RoleBeDamaged, defRole, atkRole, damage, bCrit, finalDmg, damageType, dotType, skill)
if bCrit then
@ -906,8 +936,16 @@ function BattleUtil.FinalDamageCountShield(skill, atkRole, defRole, damage, bCri
return finalDmg
end
--检测伤害是否免疫
function BattleUtil.CheckDamageIsImmune(atkRole,defRole)
local isImmune=false
local GetIsImmune=function(isTrue)
isImmune=isTrue
end
defRole.Event:DispatchEvent(BattleEventName.CheckDamageIsImmune,GetIsImmune,atkRole,defRole)
return isImmune
end
--执行完整的命中,伤害,暴击计算,返回命中,暴击
@ -972,16 +1010,30 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i
else
defence = defRole:GetRoleData(RoleDataName.MagicDefence)
end
if ignoreDef==nil then
ignoreDef=0
end
-- 攻击力
local attack = atkRole:GetRoleData(RoleDataName.Attack)+atkRole.addAttack
local ignoreFunc=function(v1,ct)
ignoreDef=BattleUtil.CountValue(ignoreDef,v1,ct)
end
atkRole.Event:DispatchEvent(BattleEventName.PassiveChangeIgnoreDef,ignoreFunc)
-- 无视防御系数
ignoreDef = 1 - (ignoreDef or 0)
-- 基础伤害 = 攻击力 - 防御力
baseDamage = max(attack - BattleUtil.FP_Mul(2,defence, ignoreDef), 0)
local defDMGRef=defRole:GetRoleData(RoleDataName.DamageReduceFactor)
local changeDefDMGFac=function(v1,ct)
if ct== CountTypeName.Sub and defDMGRef==0 then
return
end
defDMGRef=BattleUtil.CountValue(defDMGRef,v1,ct)
end
atkRole.Event:DispatchEvent(BattleEventName.PassiveChangeDefDMGReFac,changeDefDMGFac)
-- 基础伤害增加系数
local addDamageFactor = 1 + atkRole:GetRoleData(RoleDataName.DamageBocusFactor) - defRole:GetRoleData(RoleDataName.DamageReduceFactor)
local addDamageFactor = 1 + atkRole:GetRoleData(RoleDataName.DamageBocusFactor) - defDMGRef
-- 计算暴伤害系数
local critDamageFactor = 1
@ -995,9 +1047,9 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i
table.insert(cl, {v, ct})
end
end
atkRole.Event:DispatchEvent(BattleEventName.CritDamageReduceFactor, onCritDamageReduceFactor, atkRole, defRole)
defRole.Event:DispatchEvent(BattleEventName.CritDamageReduceFactor, onCritDamageReduceFactor, atkRole, defRole)
BattleLogic.Event:DispatchEvent(BattleEventName.CritDamageReduceFactor, onCritDamageReduceFactor, atkRole, defRole)
atkRole.Event:DispatchEvent(BattleEventName.CritDamageReduceFactor, onCritDamageReduceFactor, atkRole, defRole,skill)
defRole.Event:DispatchEvent(BattleEventName.CritDamageReduceFactor, onCritDamageReduceFactor, atkRole, defRole,skill)
BattleLogic.Event:DispatchEvent(BattleEventName.CritDamageReduceFactor, onCritDamageReduceFactor, atkRole, defRole,skill)
critDamageReduceFactor = max(BattleUtil.CountChangeList(critDamageReduceFactor, cl), 0)
local critDamageAddFactor=0
@ -1008,7 +1060,7 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i
table.insert(cl2, {v, ct})
end
end
atkRole.Event:DispatchEvent(BattleEventName.PassiveAddCritDamageFactor, onCritDamageAddFactor, atkRole, defRole)
atkRole.Event:DispatchEvent(BattleEventName.PassiveAddCritDamageFactor, onCritDamageAddFactor, atkRole, defRole,skill)
critDamageAddFactor = max(BattleUtil.CountChangeList(critDamageAddFactor, cl2), 0)
-- 计算额外暴击伤害
critDamageFactor = 1.3 + atkRole:GetRoleData(RoleDataName.CritDamageBonus) - defRole:GetRoleData(RoleDataName.CritDamageReduce)+critDamageAddFactor - critDamageReduceFactor
@ -1042,6 +1094,9 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i
end
function BattleUtil.CalTreat(castRole, targetRole, value, baseFactor,skill)
if targetRole==nil then
return
end
-- 灵兽无效
if targetRole.type == BattleUnitType.Monster or targetRole.type == BattleUnitType.Player then
return
@ -1075,7 +1130,13 @@ end
--没有暴击得治疗
function BattleUtil.CalTreatNoCrit(castRole, targetRole, value, baseFactor,skill)
if targetRole==nil then
return
end
-- 灵兽无效
if targetRole==nil then
return
end
if targetRole.type == BattleUnitType.Monster or targetRole.type == BattleUnitType.Player then
return
end
@ -1101,6 +1162,9 @@ end
function BattleUtil.FinalTreat(castRole, targetRole, value, baseFactor,skill)
if targetRole==nil then
return
end
-- 灵兽无效
if targetRole.type == BattleUnitType.Monster or targetRole.type == BattleUnitType.Player then
return
@ -1146,10 +1210,16 @@ end
function BattleUtil.ApplyTreat(castRole, targetRole, value, baseFactor,critDamageFactor,addDamageFactor,skill)
if targetRole==nil then
return
end
-- 灵兽无效
if targetRole.type == BattleUnitType.Monster then
return
end
if addDamageFactor==nil then
addDamageFactor=1
end
BattleLogic.Event:DispatchEvent(BattleEventName.DisposeRoleCtrl_noheal, castRole,targetRole)
if targetRole.ctrl_noheal or targetRole:IsDead() then --禁疗和死亡无法加血
--禁疗并且没有死亡的单位显示血量+0 不走后面代码,防止触发后面的被动 by:王振兴 2021/1/27
@ -1159,6 +1229,7 @@ function BattleUtil.ApplyTreat(castRole, targetRole, value, baseFactor,critDamag
return
end
baseFactor = baseFactor or 1
critDamageFactor = critDamageFactor or 1
local maxHp = targetRole:GetRoleData(RoleDataName.MaxHp)
local hp = targetRole:GetRoleData(RoleDataName.Hp)
@ -1170,9 +1241,11 @@ function BattleUtil.ApplyTreat(castRole, targetRole, value, baseFactor,critDamag
targetRole.Event:DispatchEvent(BattleEventName.PassiveBeTreatedFactor, treatFactorFunc, castRole)
local factor = castRole.isTeam and 1 or castRole:GetRoleData(RoleDataName.TreatFacter) --释放者为team则不计算治疗加成属性
if factor==0 then
factor=1
end
local factor2 = targetRole:GetRoleData(RoleDataName.CureFacter)
local baseTreat = BattleUtil.FP_Mul(value, baseFactor, factor, factor2,critDamageFactor,addDamageFactor)
--加入被动效果
local cl = {}
local function treatingFunc(v, ct)
@ -1185,7 +1258,6 @@ function BattleUtil.ApplyTreat(castRole, targetRole, value, baseFactor,critDamag
targetRole.Event:DispatchEvent(BattleEventName.PassiveBeTreated, treatingFunc, castRole)
baseTreat = BattleUtil.CountChangeList(baseTreat, cl)
-- 取整
local baseTreat = floor(baseTreat + 0.5)
@ -1221,7 +1293,12 @@ function BattleUtil.CheckIsHit(atkRole, defRole,skill)
mustHit=false
end
local hitRandom = Random.Range01()
local hitCondition = clamp(atkRole:GetRoleData(RoleDataName.Hit) - defRole:GetRoleData(RoleDataName.Dodge), 0, 1)
local addHit=0
local addHitFunc=function(v1,ct)
addHit=BattleUtil.CountValue(addHit,v1,ct)
end
BattleLogic.Event:DispatchEvent(BattleEventName.PassiveChangeRoleHit,addHitFunc,atkRole,defRole)
local hitCondition = clamp(atkRole:GetRoleData(RoleDataName.Hit)+addHit - defRole:GetRoleData(RoleDataName.Dodge), 0, 1)
isHit = hitRandom <= hitCondition
return mustHit or isHit
end
@ -1230,9 +1307,13 @@ end
function BattleUtil.AddBlood(target,value)
if not target.isBanBlood then
if target.bloodShield then
target.bloodShield:AddValue(value)
BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime*2,function()
target.bloodShield:AddValue(value)
end)
else
target:AddBuff(Buff.Create(target, BuffName.Blood,0,value))
local buff=Buff.Create(target, BuffName.Blood,0,value)
target:AddBuff(buff)
target.bloodShield=buff
end
else
target.Event:DispatchEvent(BattleEventName.ShowHintText, BattleArtFontType.Blood)
@ -1271,6 +1352,7 @@ function BattleUtil.RandomControl(rand, ctrl, caster, target, round,skill)
end
caster.Event:DispatchEvent(BattleEventName.PassiveRandomControl, _CallBack, ctrl, target)
target.Event:DispatchEvent(BattleEventName.PassiveBeRandomControl, _CallBack, ctrl, target)
BattleLogic.Event:DispatchEvent(BattleEventName.PassiveBeRandomControl, _CallBack, ctrl,caster,target)
rand = BattleUtil.CountChangeList(rand, cl)
local buff = Buff.Create(caster, BuffName.Control, round, ctrl)
local isAdd=BattleUtil.RandomAction(rand, function()

View File

@ -23,6 +23,11 @@ function MonsterManager.AddMonster(data)
BattleLogic.Event:DispatchEvent(BattleEventName.AddMonster, monster)
end
-- 获取角色数据
function this.GetMonster(camp, pos)
local index = camp * 6 + pos
return this.monsterList[index]
end
function MonsterManager.Update()

View File

@ -184,6 +184,16 @@ local _TriggerConfig = {
end,
},
[BattleEventName.RoleIsVanish]={
[15]=function(skill, ...)
local args={...}
local role=RoleManager.GetDeadRole(skill.owner.camp)
if role and role:IsRealDead() and not BattleUtil.CheckIsNoDead(role) then
return true
end
return false
end,
},
}
function MTrigger.Init()
@ -230,7 +240,11 @@ function this.InitListener()
table.sort(firstList, function(a, b)
-- 同阵营按位置排序
if a.owner.camp == b.owner.camp then
return a.owner.position < b.owner.position
if a.owner.position == b.owner.position then
return a.id < b.id
else
return a.owner.position < b.owner.position
end
else
-- 不同阵营的根据先手阵营排序
return a.owner.camp == BattleLogic.FirstCamp
@ -240,7 +254,11 @@ function this.InitListener()
table.sort(sortList, function(a, b)
-- 同阵营按位置排序
if a.owner.camp == b.owner.camp then
return a.owner.position < b.owner.position
if a.owner.position == b.owner.position then
return a.id < b.id
else
return a.owner.position < b.owner.position
end
else
-- 不同阵营的根据先手阵营排序
return a.owner.camp == BattleLogic.FirstCamp

View File

@ -29,6 +29,7 @@ function RoleLogic:Init(uid, data, position)
self.isDead = self:GetRoleData(RoleDataName.Hp) <= 0
self.isRealDead = self.isDead
self.killDamage = 0 --致死伤害
self.deadRage = 0
self.teamDamage = data.teamDamage --最高战斗力
self.superSkillDamage = 0 --技能伤害
self.killRole=nil --击杀英雄
@ -651,6 +652,7 @@ end
function RoleLogic:SetDead(damage)
self.isDead = true
self.killDamage=damage
self.deadRage=self.Rage
RoleManager.AddDeadRole(self)
end
-- 判断是否死亡

View File

@ -7,6 +7,10 @@ local _DeadRoleList = {}
local _ReliveRoleList = {}
-- 所有角色
local PosList = {}
local RealDeadList={}
-- 删除节点
local removeObjList = BattleList.New()
-- 角色对象池
@ -47,6 +51,10 @@ function this.AddRole(roleData, position)
BattleLogic.Event:DispatchEvent(BattleEventName.AddRole, role)
end
end
function this.GetRole()
local role = rolePool:Get()
return role
end
--
@ -83,6 +91,16 @@ end
function this.AddDeadRole(role)
_DeadRoleList[role.position + role.camp * 6] = role
end
function this.GetDeadRole(type)
if RealDeadList and #RealDeadList>0 then
for i = 1, #RealDeadList do
if RealDeadList[i].camp==type then
return RealDeadList[i]
end
end
end
end
function this.RemoveDeadRole(role)
if _DeadRoleList[role.position + role.camp * 6] then
@ -101,8 +119,13 @@ function this.CheckDead()
end
end
for _, pos in ipairs(removePos) do
table.insert(RealDeadList,_DeadRoleList[pos])
BattleLogic.WaitForTrigger(1,function()
BattleLogic.Event:DispatchEvent(BattleEventName.RoleIsVanish,RealDeadList,_DeadRoleList[pos])
end)
_DeadRoleList[pos] = nil
end
return isDeadFrame
end
@ -116,11 +139,13 @@ function this.CheckRelive()
local removePos = {}
for pos, role in pairs(_ReliveRoleList) do
if role:Relive() then
table_removebyvalue(RealDeadList,role)
isReliveFrame = true
table.insert(removePos, pos)
end
end
for _, pos in ipairs(removePos) do
_ReliveRoleList[pos] = nil
end
return isReliveFrame
@ -182,6 +207,26 @@ function RoleManager.QueryIncludeExile(func, inCludeDeadRole)
end)
return list
end
-- 查找角包括放逐目标,不包括触发不灭的
function RoleManager.QueryIncludeExileNoNoDead(func, inCludeDeadRole)
local list = {}
local index = 1
if func then
for pos, v in pairs(PosList) do
if func(v) and (inCludeDeadRole or not v:IsRealDead()) and v.deadFilter then
list[index] = v
index = index + 1
end
end
end
table.sort(list, function(a, b)
return a.position < b.position
end)
return list
end
-- 查找角色(不包含死亡和拥有不灭的) 2020/11/28 王振兴
function RoleManager.QueryNoDead(func)
local list = {}
@ -215,6 +260,9 @@ function RoleManager.NoOrder(func)
return list
end
--对位规则: 1敌方相同对位 2若死亡或不存在选取相邻阵位最近且阵位索引最小的
function this.GetAggro(role)
-- 计算开始位置
@ -411,6 +459,7 @@ function this.Clear()
_DeadRoleList = {}
_ReliveRoleList = {}
RealDeadList = {}
end
-- 多波

View File

@ -89,9 +89,9 @@ function Skill:Cast(func)
local duration = self.hitTime + self.continueTime
-- 结算时间向后延长0.2秒,避免在效果结算完成前就结束了技能释放
local time=0.8
if self.id==1282 then
time=2.5
end
-- if self.id==1282 then
-- time=1
-- end
BattleLogic.WaitForTrigger(duration + time, function()
self.owner.Event:DispatchEvent(BattleEventName.SkillCastEnd, self)
BattleLogic.Event:DispatchEvent(BattleEventName.SkillCastEnd, self)

View File

@ -2444,16 +2444,6 @@ public class HeroLogic {
Map<Integer, Integer> practiceSkillMap,
long maxForce,int sex,int userLv,List<Integer> tfInfoList) {
StringBuilder skillStr = new StringBuilder();
// 修行技能
if (practiceSkillMap != null){
for (Map.Entry<Integer, Integer> entry : practiceSkillMap.entrySet()) {
SPlayerSkill playerSkill = SPlayerSkill.GetSPlayerSkill(entry.getKey(), entry.getValue());
if (playerSkill != null){
skillStr.append(playerSkill.getId()).append("#");
}
}
}
// 身外化身技能
if (tfInfoList != null){
Map<Integer, SChangingCard> cardMap = STableManager.getConfig(SChangingCard.class);
@ -2465,6 +2455,24 @@ public class HeroLogic {
}
}
// 修行技能
if (practiceSkillMap != null){
for (Map.Entry<Integer, Integer> entry : practiceSkillMap.entrySet()) {
SPlayerSkill playerSkill = SPlayerSkill.GetSPlayerSkill(entry.getKey(), entry.getValue());
if (playerSkill != null){
///第一个技能是主动技
if (playerSkill.getSort()==1){
skillStr.append(playerSkill.getId());
skillStr.append("|");
}else{
///第一个技能是被动技能
skillStr.append(playerSkill.getSkillIDList()[0]);
skillStr.append("#");
}
}
}
}
// 去除最后一位得#号
String skill = skillStr.toString();
if (!StringUtil.isEmpty(skill)){

View File

@ -281,7 +281,12 @@ public class FightDataUtil {
monster.set("camp",camp);
monster.set("position",unitInfo.getPosition());
monster.set("property",getProperty(unitInfo.getProperty()));
String[] skillIdArr = skillId.split("#");
String[] allSkillIdArr = skillId.split("\\|");
String[]skillIdArr=allSkillIdArr[0].split("#");
if (allSkillIdArr.length>1){
String[]passivitySkillIdArr=allSkillIdArr[1].split("#");
monster.set("passivity", getPassivity(passivitySkillIdArr));
}
LuaValue skillList= new LuaTable();
for (int k = 0; k < skillIdArr.length; k++) {
SPlayerSkill playerSkillConfig=STableManager.getConfig(SPlayerSkill.class).get(Integer.valueOf(skillIdArr[k]));