Merge branch 'master_develop' of http://60.1.1.230/gaoxin/JL_Client into master_develop

zhangqiang 2020-11-02 06:30:53 +08:00
commit 349831895e
3 changed files with 32 additions and 3 deletions

View File

@ -417,8 +417,8 @@ function this.GetBattleServerData(msg, isFightPlayer)
fightData.enemyData[i].outData = data2.specialPassive
-- 灵兽数据
fightData.enemyData[i].monsterList ={}
for i = 1, #data2.pokemonUnitList do
fightData.enemyData[i].monsterList[i] = this.PokemonUnitAdapter(data2.pokemonUnitList[i])
for k = 1, #data2.pokemonUnitList do
fightData.enemyData[i].monsterList[k] = this.PokemonUnitAdapter(data2.pokemonUnitList[k])
end
end
local data = {

View File

@ -130,6 +130,10 @@ function BuffManager.GenerateBuffId()
return curBuffId
end
function BuffManager:AddBuff(target, buff)
-- 灵兽无效
if target.type == BattleUnitType.Monster then
return
end
buff.target = target
self.buffQueue:Enqueue(buff)
-- buff.frameDuration = floor(buff.duration * BattleLogic.GameFrameRate)
@ -252,7 +256,7 @@ function BuffManager:Update()
oldBuff.target.Event:DispatchEvent(BattleEventName.BuffEnd, oldBuff)
putBuff(oldBuff)
-- 覆盖老buff
buffList.buffer[i] = buff
buffList.buffer[i] = buff
buff:OnStart()
buff.target.Event:DispatchEvent(BattleEventName.BuffStart, buff)
buff.target.Event:DispatchEvent(BattleEventName.BuffCover, buff)

View File

@ -298,6 +298,10 @@ end
-- 秒杀
function BattleUtil.Seckill(skill, atkRole, defRole)
-- 灵兽无效
if defRole.type == BattleUnitType.Monster then
return
end
local damage = defRole:GetRoleData(RoleDataName.Hp)
local finalDmg = defRole.data:SubValue(RoleDataName.Hp, damage)
if finalDmg >= 0 then
@ -324,6 +328,11 @@ end
-- 计算真实伤害
function BattleUtil.ApplyDamage(skill, atkRole, defRole, damage, bCrit, damageType, dotType,isDirect)
-- 灵兽无效
if defRole.type == BattleUnitType.Monster then
return
end
bCrit = bCrit or false
damageType = damageType or 0
@ -396,6 +405,10 @@ function BattleUtil.GetExtraSkillbyId(id)
end
function BattleUtil.FinalDamage(skill, atkRole, defRole, damage, bCrit, damageType, dotType,isDirect)
-- 灵兽无效
if defRole.type == BattleUnitType.Monster then
return
end
if damage < 0 then damage = 0 end
local finalDmg = defRole.data:SubValue(RoleDataName.Hp, damage)
if finalDmg >= 0 then
@ -442,6 +455,10 @@ end
--执行完整的命中,伤害,暴击计算,返回命中,暴击
--skill造成伤害的技能 atkRole攻击者 defRole受击者 damageType伤害类型 baseFactor伤害系数 ignoreDef无视防御参数 dotType是持续伤害类型
function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, ignoreDef, dotType)
-- 灵兽无效
if defRole.type == BattleUnitType.Monster then
return
end
-- 判断是否命中
if skill and not skill:CheckTargetIsHit(defRole) then
BattleLogic.Event:DispatchEvent(BattleEventName.HitMiss, atkRole, defRole, skill)
@ -530,6 +547,10 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i
end
function BattleUtil.CalTreat(castRole, targetRole, value, baseFactor)
-- 灵兽无效
if defRole.type == BattleUnitType.Monster then
return
end
if targetRole.ctrl_noheal or targetRole:IsDead() then --禁疗和死亡无法加血
return
end
@ -553,6 +574,10 @@ function BattleUtil.CalTreat(castRole, targetRole, value, baseFactor)
end
function BattleUtil.ApplyTreat(castRole, targetRole, value, baseFactor,critDamageFactor,addDamageFactor)
-- 灵兽无效
if defRole.type == BattleUnitType.Monster then
return
end
if targetRole.ctrl_noheal or targetRole:IsDead() then --禁疗和死亡无法加血
return
end