Merge branch 'master_xma_local' into master_develop

gaoxin 2020-11-16 10:13:01 +08:00
commit 6639b42bed
8 changed files with 50 additions and 14 deletions

View File

@ -829,6 +829,14 @@ function this.GetBattleSorting()
end
end
-- 判断是否是战斗测试
function this.IsBattleTestPanel()
if UIManager.IsOpen(UIName.BattleTestPanel) then
return true
end
end
-- 获取战斗背景
function this.GetBattleBg(fightType)
local index = 1

View File

@ -5286,7 +5286,7 @@ local passivityList = {
--受到敌方技能攻击
if atkRole.camp~=role.camp and skill and skill.type~=BattleSkillType.Monster and skill.type~=BattleSkillType.Normal then
BattleUtil.RandomAction(pro, function ()
local list = RoleManager.GetNeighbor(atk+Role, 1)
local list = RoleManager.GetNeighbor(atkRole, 1)
-- table.insert(list,defRole)
for i=1, #list do
--如果目标身上没有灼烧效果
@ -5367,8 +5367,17 @@ local passivityList = {
end
local list = RoleManager.Query(function(v) return v.camp ~= role.camp end)
list=BattleUtil.SortByProp(list, RoleDataName.Hp, 1)
if list and list[1] then
BattleUtil.RandomControl(pro2*num, con, role,list[1],time)
--获取主目标
local targets=skill:GetDirectTargets()
local aaa=nil
for key, value in pairs(list) do
if value and not BattleUtil.ChecklistIsContainValue(targets,value) then
aaa=value
break
end
end
if aaa then
BattleUtil.RandomControl(pro2*num, con, role,aaa,time)
end
end
end

View File

@ -65,8 +65,8 @@ function Immune:OnEnd()
immune = immune2
elseif self.immuneType == 3 then --免疫无敌盾
immune = immune3
elseif self.immuneType == 3 then--自定义免疫
mmune=immune4
elseif self.immuneType == 4 then--自定义免疫
immune=immune4
immune4=nil
end
for i = 1, self.target.buffFilter.size do

View File

@ -38,7 +38,7 @@ function Shield:OnTrigger()
end
-- 计算护盾
function Shield:CountShield(damage, atkRole)
function Shield:CountShield(damage, atkRole,skill)
self.atk = atkRole
local finalDamage = 0
if self.shieldType == ShieldTypeName.NormalReduce then
@ -54,10 +54,14 @@ function Shield:CountShield(damage, atkRole)
end
elseif self.shieldType == ShieldTypeName.RateReduce then
local reduceDamage = math.floor(BattleUtil.ErrorCorrection(damage * self.shieldValue))
finalDamage = damage - reduceDamage
self.damageSum = self.damageSum + reduceDamage
--减伤盾只减伤直接伤害,和史弘毅对接的 2020/11/14 by王振兴
if skill then
local reduceDamage = math.floor(BattleUtil.ErrorCorrection(damage * self.shieldValue))
finalDamage = damage - reduceDamage
self.damageSum = self.damageSum + reduceDamage
else
finalDamage=damage
end
elseif self.shieldType == ShieldTypeName.AllReduce then
finalDamage = 0
--TODO 计算吸血

View File

@ -282,10 +282,10 @@ function BattleUtil.CalHit(atkRole, defRole)
end
-- 计算护盾
function BattleUtil.CalShield(atkRole, defRole, damage)
function BattleUtil.CalShield(atkRole, defRole, damage,skill)
for i=1, defRole.shield.size do
local buff = defRole.shield.buffer[i]
damage = buff:CountShield(damage, atkRole)
damage = buff:CountShield(damage, atkRole,skill)
end
return damage
end
@ -370,7 +370,8 @@ function BattleUtil.ApplyDamage(skill, atkRole, defRole, damage, bCrit, damageTy
BattleLogic.Event:DispatchEvent(BattleEventName.PassiveDamaging, damagingFunc, atkRole, defRole, damage, skill, dotType, bCrit)
-- 计算护盾减伤
damage = BattleUtil.CalShield(atkRole, defRole, damage)
damage = BattleUtil.CalShield(atkRole, defRole, damage,skill)
-- 造成的最终伤害
local damagingFunc = function(dmgDeduction)
@ -416,6 +417,8 @@ function BattleUtil.GetExtraSkillbyId(id)
return ExtraReleaseSkill.skill3
elseif id==4 then
return ExtraReleaseSkill.skill4
elseif id==5 then
return ExtraReleaseSkill.skill5
end
end

View File

@ -273,7 +273,7 @@ function this:OnOpen()
end)
this.SkillOption:GetComponent("Canvas").sortingOrder = BattleManager.GetBattleSorting() + 200
this.SkillOption:GetComponent("Canvas").sortingOrder = BattleManager.GetBattleSorting() + 20
end
-- 设置数据

View File

@ -374,6 +374,9 @@ function EnemyView:OnDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType,
d = dmg
count = 1
end
if BattleManager.IsBattleTestPanel() then
LogYellow(string.format("目标阵营:%s, 位置:%s, 总伤害:%s, 伤害段数:%s每段伤害%s", self.camp, self.role.position, dmg, count, d))
end
if count ~= 1 then
-- 后续伤害延迟打出
self:LoopFunc(space, count - 1, function()
@ -386,6 +389,9 @@ function EnemyView:OnDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType,
self:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, skill)
end
else
if BattleManager.IsBattleTestPanel() then
LogYellow(string.format("目标阵营:%s, 位置:%s, 总伤害:%s", self.camp, self.role.position, dmg))
end
self:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, skill)
end
end

View File

@ -418,6 +418,9 @@ function PlayerView:OnDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType
d = dmg
count = 1
end
if BattleManager.IsBattleTestPanel() then
LogYellow(string.format("目标阵营:%s, 位置:%s, 总伤害:%s, 伤害段数:%s每段伤害%s", self.camp, self.role.position, dmg, count, d))
end
if count ~= 1 then
-- 后续伤害延迟打出
self:LoopFunc(space, count - 1, function()
@ -430,6 +433,9 @@ function PlayerView:OnDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType
self:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, skill)
end
else
if BattleManager.IsBattleTestPanel() then
LogYellow(string.format("目标阵营:%s, 位置:%s, 总伤害:%s", self.camp, self.role.position, dmg))
end
self:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, skill)
end
end