战斗同步

back_recharge
duhui 2021-03-02 17:14:52 +08:00
parent 78709a72e8
commit 129b9ed2ac
12 changed files with 1043 additions and 369 deletions

View File

@ -2337,7 +2337,7 @@ local effectList = {
BattleLogic.WaitForTrigger(interval, function ()
if (pro==12 or pro==13) and BattleUtil.CheckIsBoss(target) then
return
end
end
local damage = floor(BattleUtil.ErrorCorrection(f1 * target:GetRoleData(BattlePropList[pro])))
BattleUtil.FinalDamage(skill, caster, target, damage, nil, 0, nil, true)
end)
@ -2353,7 +2353,41 @@ local effectList = {
target:AddBuff(Buff.Create(caster, BuffName.PropertyChange, i1, BattlePropList[pro], f1, ct))
end)
end,
--造成[a]%的[b]伤害,目标数量大于等于[c],伤害[d]改变[e]%;目标数量小于[f],对其额外造成[g]属性[h]%的伤害(e,h填0 为魂印修改数值3)
--a[float],b[伤害类型],c[int],d[int],e[float] f[int] g[int] h[float]
[126] = function(caster, target, args, interval, skill)
local f1 = args[1]
local dt = args[2]
local num = args[3]
local ct = args[4]
local f2 = args[5]
local num2 =args[6]
local p1 = args[7]
local f3 = args[8]
-- 改变值 = 技能最大目标数 - 当前目标数
local maxNum = skill:GetMaxTargetNum()
local curNum = #skill:GetDirectTargets()
if curNum>=num and f2>0 then
f1=BattleUtil.CountValue(f1,f2,ct)
end
BattleLogic.WaitForTrigger(interval, function ()
BattleUtil.CalDamage(skill, caster, target, dt, f1)
--伤害命中才会给目标上buff
if skill and skill:CheckTargetIsHit(target) then
if curNum<num2 then
if f3 and f3==0 then
return
end
if (p1==12 or p1==13) and BattleUtil.CheckIsBoss(target) then
return
end
local damage = floor(BattleUtil.ErrorCorrection(f3 * target:GetRoleData(BattlePropList[p1])))
damage=BattleUtil.CalAllReduceShield(caster,target,damage)
BattleUtil.FinalDamage(skill,caster, target,damage)
end
end
end)
end,
}
return effectList

View File

@ -42,7 +42,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
@ -60,7 +60,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)
@ -76,48 +76,48 @@ 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
end
self.skill.owner.Event:DispatchEvent(BattleEventName.SkillTargetCheck, _PassiveTarget)
self.skill.owner.Event:DispatchEvent(BattleEventName.SkillTargetCheck, _PassiveTarget,self.skill)
end
end
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)
@ -125,10 +125,10 @@ function EffectCaster:Cast()
if count == 0 then
count = #arr
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
@ -140,7 +140,7 @@ function EffectCaster:Cast()
end
end
-- 遍历技能命中目标
-- 遍历技能命中目标
function EffectCaster:ForeachTargets(func)
local targets = self:GetDirectTargets()
for _, role in ipairs(targets) do
@ -150,7 +150,7 @@ function EffectCaster:ForeachTargets(func)
end
end
-- 获取直接选择目标Id
-- 获取直接选择目标Id
function EffectCaster:GetDirectChooseId()
local effectGroup = self.effectList[1]
local chooseId = effectGroup.chooseId
@ -158,12 +158,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
@ -174,7 +174,7 @@ function EffectCaster:GetDirectTargetsNoMiss()
return list
end
-- 获取技能目标最大人数
-- 获取技能目标最大人数
function EffectCaster:GetMaxTargetNum()
local mainEffect = self.effectList[1]
if not mainEffect then
@ -183,7 +183,7 @@ function EffectCaster:GetMaxTargetNum()
return BattleUtil.GetMaxTargetNum(mainEffect.chooseId)
end
-- 判断是否命中
-- 判断是否命中
function EffectCaster:CheckTargetIsHit(role)
return self.targetIsHit[role]
end

File diff suppressed because it is too large Load Diff

View File

@ -248,7 +248,6 @@ function BattleLogic.TurnRound(debugTurn)
end)
end)
else
-- 检测一次灵兽技能
SkillManager.CheckMonsterSkill(function()
--轮数变化后延时0.2秒用于初始化监听回合数被动的初始化
@ -300,7 +299,6 @@ function BattleLogic.CheckBattleLogic()
BattleLogic.TurnRoundNextFrame()
return
end
--
BattleLogManager.Log(
"Position Change",
@ -328,7 +326,7 @@ function BattleLogic.CheckBattleLogic()
if not SkillRole:IsAvailable() -- 角色不能释放技能
or (SkillRole:IsDead() -- 将死状态
and not BattleLogic.BuffMgr:HasBuff(SkillRole,BuffName.NoDead) --将死但没有不死buff
and not SkillManager.HaveMySkill(SkillRole)) -- 也没有要释放的技能
and not SkillManager.HaveMySkill(SkillRole)) -- 也没有要释放的技能
then
SkillManager.CheckTurnRound()
return
@ -415,9 +413,11 @@ function BattleLogic.Update()
return
end
-- 检测技能释放
-- 检测轮转
BattleLogic.CheckTurnRound()
-- 没有技能释放时再检测轮转
if SkillManager.IsSkillEmpty() then
-- 检测轮转
BattleLogic.CheckTurnRound()
end
-- 技能
SkillManager.Update()
--如果有英雄有可以复活的技能,先执行技能逻辑,最后判断死亡人数 by:王振兴

View File

@ -89,6 +89,28 @@ function Shield:CountShield(damage, atkRole,skill)
return finalDamage
end
--计算无敌盾
function Shield:CountAllReduce(damage,atkRole,skill)
local finalDamage = damage
local isImmuneAllReduceShield=false
if self.shieldType == ShieldTypeName.AllReduce then
--攻击者免疫无敌盾
isImmuneAllReduceShield=atkRole.isImmuneAllReduceShield
--特殊处理 白骨精附加的普攻不会必定暴击
if atkRole.roleId==10091 and skill and skill.type==BattleSkillType.Normal and skill.isAdd then
isImmuneAllReduceShield=false
end
if isImmuneAllReduceShield and skill then
finalDamage=damage
else
finalDamage = 0
end
end
return finalDamage
end
-- 提前计算护盾吸收伤害
function Shield:PreCountShield(damage)
local finalDamage = 0

View File

@ -163,7 +163,7 @@ BattleEventName = {
RecordTransRage = indexAdd(), -- 转移怒气
RecordBuff = indexAdd(), -- buff
RecordSecKill = indexAdd(), -- 斩杀
DisposeRoleCtrl_noheal = indexAdd(),--处理角色禁疗
}
BattleMaxFrame = 1000000
@ -275,6 +275,7 @@ skill2={1132051,0.8,0,1,{200212,{1,0.89,2}}},
skill3={1151111,0.05,0,1,{220000,{1,0.86,2}}},
skill4={10000351,0.3,0.5,4,{400000,{1,1.75,1}}},
skill5={12011001,0.3,0.5,4,{400000,{1,2.2,1}}},
skill6={100923,0.15,1.5,1,{260004,{126,0.48,2,4,1,0,4,12,0}}},
}

View File

@ -69,6 +69,98 @@ function BattleUtil.ChooseCol(arr, col)
end)
return tempArr
end
-- 选择两列
function BattleUtil.ChooseTowCol(arr)
local teamArr={}
--第一列
local oneArr = {}
for _, role in ipairs(arr) do
if role.position % 3 == 1 then
table.insert(oneArr, role)
end
end
local one=#oneArr
--第二列
local twoArr = {}
for _, role in ipairs(arr) do
if role.position % 3 == 2 then
table.insert(twoArr, role)
end
end
local two=#twoArr
--第三列
local threeArr = {}
for _, role in ipairs(arr) do
if role.position % 3 == 0 then
table.insert(threeArr, role)
end
end
local three=#threeArr
--如果每列人数相同,就选前两列
if one==two and two==three then
for key, value in pairs(oneArr) do
table.insert(teamArr,value)
end
for key, value in pairs(twoArr) do
table.insert(teamArr,value)
end
else
--如果第一列数量>第二列数量就把第一列选入
if one>two then
if one>0 then
for key, value in pairs(oneArr) do
table.insert(teamArr,value)
end
end
--如果第二列数量>=第三列数量就把第二列选入
if two>=three then
if two>0 then
for key, value in pairs(twoArr) do
table.insert(teamArr,value)
end
end
else
--如果第三列数量>第二列数量就把第三列选入
if three>0 then
for key, value in pairs(threeArr) do
table.insert(teamArr,value)
end
end
end
else
--如果第二列数量>第一列数量就把第二列选入
if two>0 then
for key, value in pairs(twoArr) do
table.insert(teamArr,value)
end
end
--如果第一列数量>第三列数量就把第一列选入
if one>=three then
if one>0 then
for key, value in pairs(oneArr) do
table.insert(teamArr,value)
end
end
else
--如果第三列数量>第一列数量就把第三列选入
if three>0 then
for key, value in pairs(threeArr) do
table.insert(teamArr,value)
end
end
end
end
end
table.sort(teamArr, function(a, b)
return a.position < b.position
end)
return teamArr
end
-- 根据属性排序
function BattleUtil.SortByProp(arr, prop, sort)
BattleUtil.Sort(arr, function(a, b)
@ -247,6 +339,9 @@ function BattleUtil.ChooseTarget(role, chooseId)
end
end
arr = tempArr
elseif chooseLimit == 6 then --两纵排单位
local tempArr=BattleUtil.ChooseTowCol(arr)
arr=tempArr
end
-- 选择条件
@ -334,6 +429,16 @@ function BattleUtil.CalShield(atkRole, defRole, damage,skill)
end
return damage
end
-- 计算护盾
function BattleUtil.CalAllReduceShield(atkRole, defRole, damage,skill)
for i=1, defRole.shield.size do
local buff = defRole.shield.buffer[i]
damage = buff:CountAllReduce(damage, atkRole,skill)
end
return damage
end
-- 提前计算护盾后伤害
function BattleUtil.PreCountShield(defRole, damage)
for i=1, defRole.shield.size do
@ -367,8 +472,8 @@ function BattleUtil.Seckill(skill, atkRole, defRole)
if finalDmg >= 0 then
if defRole:GetRoleData(RoleDataName.Hp) <= 0 and not defRole:IsDead() then
defRole:SetDead()
defRole.Event:DispatchEvent(BattleEventName.RoleDead, atkRole)
atkRole.Event:DispatchEvent(BattleEventName.RoleKill, defRole)
defRole.Event:DispatchEvent(BattleEventName.RoleDead, atkRole,skill)
atkRole.Event:DispatchEvent(BattleEventName.RoleKill, defRole,skill)
BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoleDead, defRole, atkRole)
atkRole.Event:DispatchEvent(BattleEventName.Seckill, defRole)
@ -400,7 +505,7 @@ function BattleUtil.SeckillHP(skill, atkRole, defRole, pro)
if defRole:GetRoleData(RoleDataName.Hp) <= 0 and not defRole:IsDead() then
defRole:SetDead()
defRole.Event:DispatchEvent(BattleEventName.RoleDead, atkRole)
atkRole.Event:DispatchEvent(BattleEventName.RoleKill, defRole)
atkRole.Event:DispatchEvent(BattleEventName.RoleKill, defRole,skill)
BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoleDead, defRole, atkRole)
atkRole.Event:DispatchEvent(BattleEventName.Seckill, defRole)
@ -458,7 +563,7 @@ function BattleUtil.ApplyDamage(skill, atkRole, defRole, damage, bCrit, damageTy
end
atkRole.Event:DispatchEvent(BattleEventName.FinalDamage, damagingFunc, defRole, damage, skill, dotType, bCrit, damageType)
defRole.Event:DispatchEvent(BattleEventName.FinalBeDamage, damagingFunc, atkRole, damage, skill, dotType, bCrit, damageType)
defRole.Event:DispatchEvent(BattleEventName.FinalBeDamageEnd, damagingFunc, atkRole, damage, skill, dotType, bCrit, damageType)
defRole.Event:DispatchEvent(BattleEventName.FinalBeDamageEnd, damagingFunc, atkRole, damage, skill, dotType, bCrit, damageType,isDirect)
BattleLogic.Event:DispatchEvent(BattleEventName.FinalDamage, damagingFunc, atkRole, defRole, damage, skill, dotType, bCrit, damageType)
--
@ -516,6 +621,8 @@ function BattleUtil.GetExtraSkillbyId(id)
return ExtraReleaseSkill.skill4
elseif id==5 then
return ExtraReleaseSkill.skill5
elseif id==6 then
return ExtraReleaseSkill.skill6
end
end
@ -530,8 +637,8 @@ function BattleUtil.FinalDamage(skill, atkRole, defRole, damage, bCrit, damageTy
if defRole:GetRoleData(RoleDataName.Hp) <= 0 and not defRole:IsDead() then
defRole:SetDead()
defRole.Event:DispatchEvent(BattleEventName.RoleDead, atkRole)
atkRole.Event:DispatchEvent(BattleEventName.RoleKill, defRole)
BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoleDead, defRole, atkRole)
atkRole.Event:DispatchEvent(BattleEventName.RoleKill, defRole,skill)
BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoleDead, defRole, atkRole,skill)
end
atkRole.Event:DispatchEvent(BattleEventName.RoleDamage, defRole, damage, bCrit, finalDmg, damageType, dotType, skill)
@ -647,7 +754,7 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i
--加入被动效果 触发暴击被动
local critFunc = function(critEx) critDamageFactor = critEx end
atkRole.Event:DispatchEvent(BattleEventName.PassiveCriting, critFunc)
atkRole.Event:DispatchEvent(BattleEventName.PassiveCriting, critFunc,skill)
end
-- 公式伤害 = 基础伤害 * 基础伤害系数 * 增伤系数 * 爆伤系数
@ -655,7 +762,7 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i
-- 公式计算完成
local damageFunc = function(damage) fixDamage = damage end
atkRole.Event:DispatchEvent(BattleEventName.RoleDamageAfter, defRole, damageFunc, fixDamage)
atkRole.Event:DispatchEvent(BattleEventName.RoleDamageAfter, defRole, damageFunc, fixDamage,skill)
defRole.Event:DispatchEvent(BattleEventName.RoleBeDamagedAfter, atkRole, damageFunc, fixDamage)
fixDamage = max(floor(attack * 0.1), fixDamage)
@ -672,7 +779,12 @@ function BattleUtil.CalTreat(castRole, targetRole, value, baseFactor)
if targetRole.type == BattleUnitType.Monster then
return
end
BattleLogic.Event:DispatchEvent(BattleEventName.DisposeRoleCtrl_noheal, castRole,targetRole)
if targetRole.ctrl_noheal or targetRole:IsDead() then --禁疗和死亡无法加血
--禁疗并且没有死亡的单位显示血量+0 不走后面代码,防止触发后面的被动 by:王振兴 2021/1/27
if targetRole.ctrl_noheal and not targetRole:IsDead() then
targetRole.Event:DispatchEvent(BattleEventName.RoleBeTreated, castRole, 0, 0)
end
return
end
-- 是否暴击: 暴击率 = 自身暴击率 - 对方抗暴率
@ -699,7 +811,12 @@ function BattleUtil.ApplyTreat(castRole, targetRole, value, baseFactor,critDamag
if targetRole.type == BattleUnitType.Monster then
return
end
BattleLogic.Event:DispatchEvent(BattleEventName.DisposeRoleCtrl_noheal, castRole,targetRole)
if targetRole.ctrl_noheal or targetRole:IsDead() then --禁疗和死亡无法加血
--禁疗并且没有死亡的单位显示血量+0 不走后面代码,防止触发后面的被动 by:王振兴 2021/1/27
if targetRole.ctrl_noheal and not targetRole:IsDead() then
targetRole.Event:DispatchEvent(BattleEventName.RoleBeTreated, castRole, 0, 0)
end
return
end
baseFactor = baseFactor or 1

View File

@ -126,6 +126,19 @@ function RoleLogic:CanCastSkill()
return self.sp >= self.spPass and not self.IsDebug
end
--检测是否有某被动
function RoleLogic:CheckHavePassive(id)
if self.passiveList then
for index, value in ipairs(self.passiveList) do
if value and value[1] and value[1]==id then
return true
end
end
return false
end
return false
end
-- 废弃的方法
function RoleLogic:GetSkillCD()
return max(self.spPass - self.sp, 0)
@ -248,7 +261,7 @@ function RoleLogic:AddBuff(buff)
-- 如果概率为0 或者没有miss
if missF == 0 or not BattleUtil.RandomAction(missF, function() BattleLogic.BuffMgr:PutBuff(buff) end) then
for i=1, self.buffFilter.size do
if self.buffFilter.buffer[i](buff) then
if self.buffFilter.buffer[i](buff,self) then
BattleLogic.BuffMgr:PutBuff(buff)
return
end
@ -331,7 +344,7 @@ function RoleLogic:SkillCast(skill, func)
noRageRate = noRageRate + rate
costRage = costRage + cost
end
self.Event:DispatchEvent(BattleEventName.RoleRageCost, costRage, noRageRate, _RageCostPassivity)
self.Event:DispatchEvent(BattleEventName.RoleRageCost, costRage, noRageRate, _RageCostPassivity,skill)
-- 计算消耗怒气的概率,并消耗怒气
local costRate = 1 - noRageRate
costRate = costRate > 1 and 1 or costRate
@ -361,12 +374,14 @@ function RoleLogic:AddSkill(type, isRage, isAdd, targets)
if not self.IsCanAddSkill and isAdd then return end
local effectData = type == BattleSkillType.Normal and self.skill or self.superSkill
--角色被混乱后
if self.ctrl_chaos and isRage then
local isTriggerJudge=true
if self.ctrl_chaos then
type=BattleSkillType.ChaosNormal
--混乱普攻使用普攻特效
effectData={self.skill[1],self.skill[2],self.skill[3],self.skill[4],{100001,{1,1,1}}}
isTriggerJudge=false
end
SkillManager.AddSkill(self, effectData, type, targets, isAdd, isRage)
SkillManager.AddSkill(self, effectData, type, targets, isAdd, isRage,isTriggerJudge)
--
BattleLogManager.Log(
"Add Skill",
@ -382,14 +397,16 @@ end
--加入额外技能,用于额外释放技能 by:王振兴
function RoleLogic:InsertExtraSkill(id,type)
local effectData=BattleUtil.GetExtraSkillbyId(id)
if effectData then
local skillType=BattleSkillType.Extra
--如果type为1则按绝技处理,不为1的话按额外技能处理额外技能因为被动判断会判断是否是绝技类型所以不会触发
if type==1 then
skillType=BattleSkillType.Special
end
--和老史,佳琦确认果 附加技能算绝技 被沉默无法释放 可以套娃 递归触发 by:王振兴
SkillManager.InsertSkill(self, effectData, skillType, nil, true, false)
SkillManager.InsertSkill(self, effectData, skillType, nil, true, false,true)
BattleLogManager.Log(
"Insert Extra Skill",
"camp", self.camp,
@ -557,6 +574,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

View File

@ -9,7 +9,7 @@ function Skill:New()
return o
end
function Skill:Init(role, effectData, type, targets, isAdd, isRage) --type 0 异妖 1 点技 2 滑技
function Skill:Init(role, effectData, type, targets, isAdd, isRage,isTriggerJudge) --type 0 异妖 1 点技 2 滑技
self.type = type
--skill = {技能ID, 命中时间, 持续时间, 伤害次数, {目标id1, 效果1, 效果2, ...},{目标id2, 效果3, 效果4, ...}, ...}
--效果 = {效果类型id, 效果参数1, 效果参数2, ...}
@ -23,7 +23,11 @@ function Skill:Init(role, effectData, type, targets, isAdd, isRage) --type 0 异
self.isKill = false --是否技能击杀目标
self.isAdd = isAdd
self.isRage = isRage
self.isTriggerJudge = true
if isTriggerJudge~=nil then
self.isTriggerJudge=isTriggerJudge
else
self.isTriggerJudge = true
end
-- 初始化
local effects = {}
for i=5, #effectData do

View File

@ -42,13 +42,13 @@ end
-- 向技能列表中追加技能
function this.AddSkill(caster, effectData, type, targets, isAdd, isRage)
function this.AddSkill(caster, effectData, type, targets, isAdd, isRage,isTriggerJudge)
-- 如果超出最大限制则不再追加技能
if not this.CheckMaxCount() then
return
end
local skill = skillPool:Get()
skill:Init(caster, effectData, type, targets, isAdd, isRage)
skill:Init(caster, effectData, type, targets, isAdd, isRage,isTriggerJudge)
if type == BattleSkillType.DeadSkill then -- 死亡技能加入单独的对列
table.insert(this.DeadSkillList, skill)
else
@ -57,16 +57,24 @@ function this.AddSkill(caster, effectData, type, targets, isAdd, isRage)
return skill
end
-- 插入技能到技能列表首位
function this.InsertSkill(caster, effectData, type, targets, isAdd, isRage)
function this.InsertSkill(caster, effectData, type, targets, isAdd, isRage,isTriggerJudge)
-- 如果超出最大限制则不再追加技能
if not this.CheckMaxCount() then
return
end
local skill = skillPool:Get()
--角色被混乱后
isTriggerJudge=true
if caster.ctrl_chaos and type~=BattleSkillType.DeadSkill then
type=BattleSkillType.ChaosNormal
--混乱普攻使用普攻特效
effectData={caster.skill[1],caster.skill[2],caster.skill[3],caster.skill[4],{100001,{1,1,1}}}
isTriggerJudge=false
end
skill:Init(caster, effectData, type, targets, isAdd, isRage)
if type == BattleSkillType.DeadSkill then -- 死亡技能加入单独的对列
table.insert(this.DeadSkillList, 1, skill)
else
else
table.insert(this.SkillList, 1, skill)
end
return skill
@ -86,6 +94,24 @@ function this.HaveMySkill(role)
return false
end
-- 判断是否有即将释放的技能
function this.IsSkillEmpty()
if this.IsSkilling then
-- LogError("正在释放技能")
return false
end
if this.MonsterSkillList and #this.MonsterSkillList > 0 then
return false
end
if this.DeadSkillList and #this.DeadSkillList > 0 then
return false
end
if this.SkillList and #this.SkillList > 0 then
return false
end
return true
end
-- 设置用于轮转的方法
function this.SetTurnRoundFunc(func)
@ -93,37 +119,30 @@ function this.SetTurnRoundFunc(func)
end
function this.CheckTurnRound()
-- 如果正在释放技能
if this.IsSkilling then
-- if this.IsSkilling then
-- LogError("正在释放技能")
-- return
-- end
-- 如果技能列表部位为空
if not this.IsSkillEmpty() then
return
end
if this.MonsterSkillList and #this.MonsterSkillList > 0 then
return
end
-- 检测一次灵兽技能
-- this.CheckMonsterSkill(this.MonsterCheckFunc)
--
if this.DeadSkillList and #this.DeadSkillList > 0 then
return
end
if this.SkillList and #this.SkillList > 0 then
return
end
-- 没有技能释放的时候才轮转
if this.TurnRoundFunc then
BattleLogic.WaitForTrigger(0.3, function()
-- 清除数量限制
this.CurSkillCount = 0
--
this.TurnRoundFunc()
this.TurnRoundFunc = nil
if this.TurnRoundFunc then
this.CurSkillCount = 0
this.TurnRoundFunc()
this.TurnRoundFunc = nil
end
end)
end
end
-- 检测是否需要等待灵兽技能
function this.CheckMonsterSkill(func)
this.MonsterCheckFunc = func
this.MonsterCheckFunc = func
-- 判断是否可以向下执行
if not this.IsSkilling and (not this.MonsterSkillList or #this.MonsterSkillList == 0) then
--
@ -174,6 +193,7 @@ function this.Update()
this.CheckMonsterSkill(this.CheckTurnRound)
end
end
return
end
@ -195,6 +215,7 @@ function this.Update()
this.IsSkilling = false
this.CheckTurnRound()
end
return
end

View File

@ -1,3 +1,45 @@
v1.0.21
1、混乱后的普攻不触发任何特性
2 舍身济世分担的伤害改为可以触发被动
v1.0.20
1、修复孙悟空和观音菩萨同时死亡导致报错的问题
v1.0.19
1、298被动修改 解除中毒效果前先解除禁疗
v1.0.18
1、禁疗显示血量 +0
2、126效果修改 生命百分比伤害会被无敌盾挡住
v1.0.17
1、新增新将观音的技能及被动
2、新增选择两列的目标选择逻辑
3、有技能在释放时不会检测轮转逻辑
v1.0.16
1、修改获取最大血量的方式修复灵兽伤害未计算到最大血量中的问题
2、被动120删除无用的事件
3、log打印添加结果数据
v1.0.15
1、添加第四期英雄觉醒
2、添加结算界面显示log
v1.0.14_2
1、战斗类型常量化
2、森罗幻境战斗超出最大回合数结果返回2并返回双方剩余血量
v1.0.14
1、 244被动修改
2、 检测是否为boss方法修改
v1.0.13
1、 新增灵兽 金乌技能逻辑修改
2、 新增 124 125 效果
3、 rolelogic 新增job字段
v1.0.12
1、【魂印】舍身济世魂印修改为不触发任何特性
2、【技能】阎罗王的连接符伤害结算改为最终伤害。

View File

@ -16,6 +16,7 @@ public class SRobotProperty implements BaseConfig {
private int skillPool;
private int[][] animal;
@Override
public void init() throws Exception {
@ -39,5 +40,7 @@ public class SRobotProperty implements BaseConfig {
return skillPool;
}
public int[][] getAnimal() {
return animal;
}
}