Merge branch '0功能/本周版本优化内容_battle' into 0功能/本周版本优化内容

dev_chengFeng
wangzhenxing 2021-02-27 15:26:19 +09:00
commit ab355be37a
6 changed files with 539 additions and 283 deletions

View File

@ -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

View File

@ -472,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)
@ -505,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)
@ -563,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)
--
@ -637,7 +637,7 @@ 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)
atkRole.Event:DispatchEvent(BattleEventName.RoleKill, defRole,skill)
BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoleDead, defRole, atkRole,skill)
end
@ -754,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
-- 公式伤害 = 基础伤害 * 基础伤害系数 * 增伤系数 * 爆伤系数
@ -762,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)

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)
@ -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
@ -362,11 +375,11 @@ function RoleLogic:AddSkill(type, isRage, isAdd, targets)
local effectData = type == BattleSkillType.Normal and self.skill or self.superSkill
--角色被混乱后
local isTriggerJudge=true
if self.ctrl_chaos and isRage then
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
isTriggerJudge=false
end
SkillManager.AddSkill(self, effectData, type, targets, isAdd, isRage,isTriggerJudge)
--
@ -384,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,

View File

@ -23,7 +23,7 @@ function Skill:Init(role, effectData, type, targets, isAdd, isRage,isTriggerJudg
self.isKill = false --是否技能击杀目标
self.isAdd = isAdd
self.isRage = isRage
if isTriggerJudge then
if isTriggerJudge~=nil then
self.isTriggerJudge=isTriggerJudge
else
self.isTriggerJudge = true

View File

@ -57,12 +57,20 @@ function this.AddSkill(caster, effectData, type, targets, isAdd, isRage,isTrigge
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)