danaotiangong zhandou
parent
91e53bdf42
commit
d31e186de2
|
@ -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
|
|
@ -99,7 +99,7 @@ function EffectCaster:ChooseTarget()
|
|||
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
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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:王振兴
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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}}},
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue