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

dev_chengFeng
ZhangBiao 2020-11-13 18:01:05 +08:00
commit 6c8a011528
6 changed files with 10834 additions and 142524 deletions

File diff suppressed because it is too large Load Diff

View File

@ -664,7 +664,7 @@ local passivityList = {
local OnPassiveDamaging = function(damagingFunc)
damagingFunc(-f1)
end
role.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
role.Event:AddEvent(BattleEventName.PassiveDamiaging, OnPassiveDamaging)
end,
--进入战斗[a]秒后,造成的伤害提升[b],持续[c]秒
@ -1706,7 +1706,7 @@ local passivityList = {
local arr = RoleManager.Query(function (r) return r.camp == role.camp end)
BattleUtil.SortByHpFactor(arr, 1)
-- 检测技能伤害疗加成
-- 检测技能伤害<EFBFBD><EFBFBD><EFBFBD>疗加成
local f = BattleUtil.CheckSkillDamageHeal(f1, role, arr[1])
-- 治疗血量最低队友实际伤害的f1%
BattleUtil.ApplyTreat(role, arr[1], floor(BattleUtil.ErrorCorrection(allDamage*f)))
@ -1772,6 +1772,7 @@ local passivityList = {
for i = 1, i1 do
role:AddSkill(BattleSkillType.Normal, false, true, nil)
end
LogError("aaaaaaaaaaaaaaaaaa")
end
end
role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillEnd)
@ -1910,7 +1911,8 @@ local passivityList = {
[109] = function(role, args)
local i1 = args[1]
local onBeSkillCastEnd = function(skill)
if skill.type == BattleSkillType.Normal then
--同阵营普工加血不触发被动
if skill.type == BattleSkillType.Normal and skill.owner and skill.owner.camp~=role.camp then
role:AddRage(i1, CountTypeName.Add)
end
end
@ -2495,7 +2497,8 @@ local passivityList = {
-- 普攻后
local onSkillEnd = function(skill)
if skill.type == BattleSkillType.Normal then
--己方普攻不会触发被动
if skill.type == BattleSkillType.Normal and skill.owner and skill.owner.camp~=role.camp then
local caster = skill.owner
local attack = role:GetRoleData(RoleDataName.Attack)
local damage = floor(BattleUtil.ErrorCorrection(attack * 0.2))
@ -2747,6 +2750,7 @@ local passivityList = {
-- 技能后后
local onRoleBeHit = function(caster)
local attack = role:GetRoleData(RoleDataName.Attack)
local damage = floor(BattleUtil.ErrorCorrection(attack * 0.2))
BattleUtil.RandomDot(f1, dot, role, caster, i1, 1, damage)
@ -3025,7 +3029,7 @@ local passivityList = {
-- 技能后后
local onBeSkillCastEnd = function(skill)
if skill.type == BattleSkillType.Normal then
if skill.type == BattleSkillType.Normal and skill.owner and skill.owner.camp~=role.camp then
local attack = role:GetRoleData(RoleDataName.Attack)
local damage = floor(BattleUtil.ErrorCorrection(attack * f2))
BattleUtil.RandomDot(f1, dot, role, skill.owner, i1, 1, damage)
@ -3791,20 +3795,28 @@ local passivityList = {
local immune = function(buff)
return buff.type == BuffName.Control and (BattleUtil.ChecklistIsContainValue(ctrls,buff.ctrlType))
end
local curBuff=nil
BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, function(curRound)
-- 第i1回合开始
if curRound == 1 then
role.buffFilter:Add(immune)
-- role.buffFilter:Add(immune)
curBuff=Buff.Create(role, BuffName.Immune, 1,4,immune)
role:AddBuff(curBuff)
end
-- 第i1+i2回合结束
if curRound == 2 then
for i = 1, role.buffFilter.size do
if role.buffFilter.buffer[i] == immune then
role.buffFilter:Remove(i)
break
end
-- for i = 1, role.buffFilter.size do
-- if role.buffFilter.buffer[i] == immune then
-- role.buffFilter:Remove(i)
-- break
-- end
-- end
if curBuff then
BattleLogic.BuffMgr:ClearBuff(role, function (buff)
return buff==curBuff
end)
end
end
end)
end,
@ -4997,14 +5009,14 @@ local passivityList = {
role.Event:AddEvent(BattleEventName.RoleHit, onHit)
end,
-- 击杀目标后对敌方血量百分比最低两角色造成[a]%[b]伤害 重写170 一次技能只触发一次被动
-- 击杀目标后对敌方血量百分比最低两<EFBFBD><EFBFBD><EFBFBD>角色造成[a]%[b]伤害 重写170 一次技能只触发一次被动
-- a[float]b[伤害类型]
[253] = function(role, args)
local f1 = args[1]
local dt = args[2]
-- 直接伤害后
local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill)
--如果是技能并且这个被动已经被触发 return
--如果是技能并且这个被动已经被触发<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> return
if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,253) then
return
end
@ -5093,5 +5105,316 @@ local passivityList = {
end
role.Event:AddEvent(BattleEventName.RoleHit, onRoleHit)
end,
--技能击杀目标溢出伤害的[a]%将对生命百分比最高的攻击目标造成伤害
-- a[float]
[257]=function(role,args)
local f1 = args[1]
local dt = args[2]
local point=nil
-- 直接伤害后
local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill)
if skill and skill.owner==role and (skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra) and target:IsDead() and not BattleUtil.CheckIsNoDead(target) then
local dmg= floor(BattleUtil.ErrorCorrection((damage-finalDmg)*f1))
local list = RoleManager.Query(function(v) return v.camp ~= role.camp end)
list = BattleUtil.SortByHpFactor(list,0)
-- if not list[1]:IsDead() then
if list then
if not point then
point=list[1]
end
BattleUtil.ApplyDamage(nil,role,point,dmg)
end
-- end
end
end
role.Event:AddEvent(BattleEventName.RoleHit, onRoleHit)
end,
--技能追加的普攻额外造成目标[a][b]%的伤害。
--a[int 属性id] b[float]
[258]=function(role,args)
local f1 = args[1]
local dt = args[2]
-- 直接伤害后
local onPassiveDamaging = function(func, defRole, damage,skill)
--如果是boss 并且额外伤害是根据最大生命则返回
local isBoss=BattleUtil.CheckIsBoss(defRole)
if isBoss and f1==12 then
return
end
if skill and skill.type == BattleSkillType.Normal and skill.isAdd and skill.owner==role then
local val = -floor(BattleUtil.FP_Mul(dt, defRole:GetRoleData(BattlePropList[f1])))
if func then
func(val)
end
end
end
role.Event:AddEvent(BattleEventName.PassiveDamaging, onPassiveDamaging)
end,
-- 释放技能[a][b]%概率命中(必定命中舔100%或200%)
-- a[int], b[float]
[259] = function(role, args)
local pro = args[1]
local f1 = args[2]
local function onSkillCast(skill)
if skill.type ~= BattleSkillType.Normal then
role.data:AddValue(BattlePropList[pro], f1)
end
end
role.Event:AddEvent(BattleEventName.SkillCast, onSkillCast)
local function onSkillCastEnd(skill)
if skill.type ~= BattleSkillType.Normal then
role.data:SubValue(BattlePropList[pro], f1)
end
end
role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillCastEnd)
end,
--释放技能时,如果目标怒气不足[a]点,技能伤害额外[b] [c]%
-- a[int,怒气值]b[改变类型]c[float]
[260]=function(role,args)
local anger = args[1]
local type = args[2]
local v1 = args[3]
local onPassiveDamaging = function(func, defRole, damage,skill)
--怒气小于规定值
if defRole.Rage>=anger then
return
end
if skill and skill.type~=BattleSkillType.Monster and skill.type~=BattleSkillType.Normal and skill.owner==role then
local dmgDeduction = damage - floor(BattleUtil.ErrorCorrection(BattleUtil.CountValue(damage,v1,type)))
if func then func(dmgDeduction) end
end
end
role.Event:AddEvent(BattleEventName.PassiveDamaging, onPassiveDamaging)
end,
--本次技能中如果有[a]目标,额外回复[b]点怒气
-- a[持续伤害状态]b[int]
[261]=function(role,args)
local dot=args[1]
local i1 = args[2]--defRole, damage, bCrit, finalDmg, damageType, skill
local OnRoleHit = function(skill)
-- if skill and skill.owner==role and (skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra) and role.camp~=defRole.camp and defRole and BattleLogic.BuffMgr:HasBuff(defRole, BuffName.DOT, function(buff) return buff.damageType == dot end) then
-- role:AddRage(i1, CountTypeName.Add)
--end
if skill and skill.owner==role and (skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra) and skill then
local list=skill:GetDirectTargetsNoMiss()
if not list then
return
end
local num=0
for key, value in pairs(list) do
local isHave=BattleLogic.BuffMgr:HasBuff(value, BuffName.DOT, function(buff) return buff.damageType == dot and buff.caster==role and buff.startRound == BattleLogic.GetCurRound() end)
if isHave then
num=num+1
end
end
if num>0 then
role:AddRage(i1, CountTypeName.Add)
end
end
end
role.Event:AddEvent(BattleEventName.SkillCastEnd, OnRoleHit)
end,
-- 每释放[a]次技能,[b]增加[c]%,可叠加[d]次
-- a[int] b[int] c[float] d[int]
[262] = function(role, args)
local num = args[1]
local pro = args[2]
local val = args[3]
local time = args[4]
local releaseNum=0
local addNum=0
-- 释放技能后
local onSkillEnd = function(skill)
if skill and skill.owner==role and (skill.type == BattleSkillType.Special or skill.type == BattleSkillType.Extra ) then
releaseNum=releaseNum+1
--如果能被限制次数整除 and 小于最大叠加次数
if releaseNum>0 and releaseNum%num==0 and addNum<time then
role.data:AddValue(BattlePropList[pro],val)
addNum=addNum+1
end
end
end
role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillEnd)
end,
--第[a]回合技能命中前有[b]%概率清除对方目标的免疫控制效果(所有控制效果)的护盾(表现上为护盾,清除护盾为直接清除效果)
--a[int] b[float]
[263]=function(role,args)
local round=args[1]
local pro=args[2]
local onRoleDamageBefore=function(defRole, factorFunc, damageType, skill)
--判断是否是规定回合
if BattleLogic.GetCurRound() ~= round then
return
end
if defRole and defRole.camp~=role.camp and skill.owner==role and (skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra) then
BattleUtil.RandomAction(pro, function()
BattleLogic.BuffMgr:ClearBuff(defRole, function(buff)
return buff.type == BuffName.Immune and (buff.immuneType == 4 or buff.immuneType == 2)
end)
end)
end
end
role.Event:AddEvent(BattleEventName.RoleDamageBefore,onRoleDamageBefore)
end,
--释放技能时,如果目标怒气大于[a]点,额外降低目标[b]点怒气
--a[int] b[int]
[264]= function(role,args)
local v1 = args[1]
local v2 = args[2]
local onFinalBeDamage = function(damagingFunc, defRole, damage, skill)
if defRole.Rage<=v1 then
return
end
if skill and skill.owner==role and defRole.camp~=role.camp and skill.type~=BattleSkillType.Monster and skill.type~=BattleSkillType.Normal then
defRole:AddRage(v2,CountTypeName.Sub)
end
end
role.Event:AddEvent(BattleEventName.FinalDamage,onFinalBeDamage)
end,
--受技能攻击时有[a]%概率给攻击者及周围没有[b]状态的敌方武将附加[c]状态,造成自身[d] [e]% 的伤害持续[f]回合
-- a[float] b[持续伤害类型] c[持续伤害类型] d[int] e[float] f[int]
[265] = function(role,args)
local pro=args[1]
local state1=args[2]
local state2=args[3]
local pro1=args[4]
local v1 = args[5]
local time= args[6]
local onFinalBeDamage = function(damagingFunc, atkRole, damage, skill)
--受到敌方技能攻击
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)
-- table.insert(list,defRole)
for i=1, #list do
--如果目标身上没有灼烧效果
if not BattleLogic.BuffMgr:HasBuff(list[i], BuffName.DOT, function (buff) return buff.type== BuffName.DOT and buff.damageType==state1 end) then
local damage = BattleUtil.ErrorCorrection(v1 * role:GetRoleData(BattlePropList[pro1]))
BattleUtil.RandomDot(1, state2, role, list[i], time, 1, floor(damage))
end
end
end)
end
end
role.Event:AddEvent(BattleEventName.FinalBeDamage,onFinalBeDamage)
end,
--攻击时伤害增加(我方每个存活的其他[a]元素武将伤害增加[b]%
--a[int] b[float]
[266] = function(role,args)
local ele=args[1]
local v1=args[2]
local passiveBeBeDamage=function(damagingFunc, defRole, damage, skill)
local list = RoleManager.Query(function(v) return role.camp == v.camp end)
local num=0
for _, r in pairs(list) do
if r~=role and r.element==ele and not r:IsDead() then
num=num+1
end
end
if damagingFunc then
local dd = BattleUtil.CountValue(damage,v1*num,2)-damage
LogError(-floor(BattleUtil.ErrorCorrection(dd)))
damagingFunc(-floor(BattleUtil.ErrorCorrection(dd)))
end
end
role.Event:AddEvent(BattleEventName.PassiveDamaging,passiveBeBeDamage)
end,
--技能击中受到[a,控制效果]的目标,会额外降低[b]点怒气
-- a[int 控制效果]b[int]
[267]=function(role,args)
local dot=args[1]
local i1 = args[2]
--defRole, damage, bCrit, finalDmg, damageType, skill
local OnRoleHit = function(skill)
if skill and (skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra) and skill.owner==role then
local list=skill:GetDirectTargetsNoMiss()
if not list then
return
end
local num=0
for key, value in pairs(list) do
local isHave=BattleLogic.BuffMgr:HasBuff(value, BuffName.Control, function(buff) return buff.ctrlType == dot and buff.caster==role and buff.startRound == BattleLogic.GetCurRound() end)
if isHave then
value:AddRage(i1, CountTypeName.Sub)
end
end
end
end
role.Event:AddEvent(BattleEventName.SkillCastEnd, OnRoleHit)
end,
--概率额外 [a]敌方血量最少的目标(己方每个上阵的其他妖阵营神将可提供姑获鸟眩晕总概率的[b])。持续[c]回合
-- a[控制状态] b[float] c[int]
[268] = function(role,args)
local con=args[1]
local pro2=args[2]
local time=args[3]
local onSkillCast=function(skill)
if skill and skill.owner==role and (skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra) then
local heros=RoleManager.GetRoleByCamp(role.camp)
local num=0
for _, r in pairs(heros) do
if r~=role and r.element==role.element then
num=num+1
end
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)
end
end
end
role.Event:AddEvent(BattleEventName.SkillCast,onSkillCast)
end,
--受到[a]目标攻击时,自身免疫[b]和[c]效果
--a[int 持续伤害类型] b,c[int 持续伤害类型]
[269] = function(role,args)
local sta1=args[1]
local sta2=args[2]
local sta3=args[3]
local skiller=nil
local immune = function(buff)
LogError(buff.damageType)
return buff.type == BuffName.DOT and (buff.damageType==sta2 or buff.damageType==sta3)
end
local curBuff=nil
local onRoleDamageBefore=function(atkRole, factorFunc, damageType, skill)
if atkRole.camp~= role.camp and BattleLogic.BuffMgr:HasBuff(skill.owner, BuffName.DOT, function (buff) return buff.damageType == sta1 end) then
--curBuff=Buff.Create(role, BuffName.Immune, 1,4,immune)
-- role:AddBuff(curBuff)
role.buffFilter:Add(immune)
skiller=atkRole
end
end
role.Event:AddEvent(BattleEventName.RoleBeDamagedBefore,onRoleDamageBefore)
-- 释放技能后
local onSkillEnd = function(skill)
if skill and skill.owner==skiller then
--if curBuff then
LogError("清除buff")
-- BattleLogic.BuffMgr:ClearBuff(role, function (buff)
-- return buff==curBuff
-- end)
for i = 1, role.buffFilter.size do
if role.buffFilter.buffer[i] == immune then
role.buffFilter:Remove(i)
break
end
end
-- end
end
end
BattleLogic.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillEnd)
end,
}
return passivityList

View File

@ -86,6 +86,7 @@ function this.PrintBattleTable(tb)
return indent_str
end
--
this.logList = {}
function this.Init(fightdata, userdata)
this.timestamp = Random.GetSeed()
this.fightdata = fightdata

View File

@ -65,13 +65,14 @@ function BattleLogic.Init(data, _userData, maxRound)
BattleLogic.BuffMgr:Init()
BattleLogic.IsEnd = false
BattleLogic.Result = -1
-- 日志管理放到前面初始化
BattleLogManager.Init(fightData, userData)
MonsterManager.Init()
RoleManager.Init()
SkillManager.Init()
OutDataManager.Init(fightData)
PassiveManager.Init()
BattleLogManager.Init(fightData, userData)
-- 监听英雄受到治疗
BattleLogic.Event:AddEvent(BattleEventName.RoleBeTreated,function (castRole, realTreat, treat)

View File

@ -305,6 +305,8 @@ function this.RefreshFightData(type)
data.professionId = roleData.Profession
data.quality = roleData.Quality
data.star = 10
data.skinId=role.skinId
LogError("skinId==="..role.skinId)
data.type = 1
local paskill = string.split(role.passivity, "#")
data.passivity = BattleManager.GetPassivityData(paskill) or {}
@ -312,7 +314,7 @@ function this.RefreshFightData(type)
for pi = 1, 25 do
data.property[pi] = role.props[pi] or 0
end
data.skill = BattleManager.GetSkillData(role.skill) or {}
data.skill = BattleManager.GetSkillData(role.skill,role.skinId) or {}
data.superSkill = BattleManager.GetSkillData(role.superSkill) or {}
-- 添加角色数据
this.AddRoleData(data)

View File

@ -10,6 +10,8 @@ function RoleSetView:Init(root)
self.roleId = Util.GetGameObject(root, "roleId/input"):GetComponent("InputField")
self.passivity = Util.GetGameObject(root, "passivity/input"):GetComponent("InputField")
self.skill = Util.GetGameObject(root, "skill/input"):GetComponent("InputField")
self.skin = Util.GetGameObject(root, "skin/input"):GetComponent("InputField")
self.skin.text="0"
self.superSkill = Util.GetGameObject(root, "superSkill/input"):GetComponent("InputField")
self.props = Util.GetGameObject(root, "props")
@ -53,13 +55,14 @@ function RoleSetView:LoadFromConfig()
local passivity = config.PassiveSkillList and table.concat(config.PassiveSkillList, "#") or ""
local skill = config.SkillList[1] or ""
local superSkill = config.SkillList[2] or ""
local skinId=tonumber(self.skin.text)
self.localData = {
monsterId,
config.MonsterId, -- roleId
passivity,
skill,
superSkill,
skinId,
config.Level,
config.Hp,
config.Hp,
@ -83,6 +86,7 @@ function RoleSetView:LoadFromConfig()
self.passivity.text = self:GetLocalData(3)
self.skill.text = self:GetLocalData(4)
self.superSkill.text = self:GetLocalData(5)
self.skin.text="0"
for propIndex, prop in ipairs(self.propList) do
prop.text = self:GetLocalData(propIndex + 5)
end
@ -103,7 +107,6 @@ function RoleSetView:saveToLocal()
str = str .. "|"..(self.data.passivity or "")
str = str .. "|"..(self.data.skill or "")
str = str .. "|"..(self.data.superSkill or "")
for propIndex, prop in ipairs(self.data.props) do
str = str .. "|"..(prop or "")
end
@ -118,7 +121,7 @@ function RoleSetView:GetLocalData(index)
"", -- 被动
1011, -- 普技
1012, -- 特殊
0, --皮肤
100, -- 等级
100000, -- hp
100000, -- maxhp
@ -157,6 +160,7 @@ function RoleSetView:Show(camp, pos, data, func)
self.passivity.text = data.passivity or self:GetLocalData(3)
self.skill.text = data.skill or self:GetLocalData(4)
self.superSkill.text = data.superSkill or self:GetLocalData(5)
self.skin.text=data.skinId or 0
for propIndex, prop in ipairs(self.propList) do
prop.text = data.props[propIndex] or self:GetLocalData(propIndex + 5)
end
@ -169,6 +173,7 @@ function RoleSetView:ApplyData()
self.data.passivity = self.passivity.text
self.data.skill = tonumber(self.skill.text)
self.data.superSkill = tonumber(self.superSkill.text)
self.data.skinId=tonumber(self.skin.text)
for propIndex, prop in ipairs(self.propList) do
local value = prop.text == "" and 0 or tonumber(prop.text)
self.data.props[propIndex] = tonumber(value)