From e1c73c954f202558b13915e73a0b785cead1cd09 Mon Sep 17 00:00:00 2001 From: jiaoyangna <3046463818@qq.com> Date: Fri, 11 Mar 2022 15:55:05 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/ManagedResources/~Lua/Message/Family_pb.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Message/Family_pb.lua b/Assets/ManagedResources/~Lua/Message/Family_pb.lua index 46a7893152..56359f176f 100644 --- a/Assets/ManagedResources/~Lua/Message/Family_pb.lua +++ b/Assets/ManagedResources/~Lua/Message/Family_pb.lua @@ -2759,8 +2759,8 @@ GETCARCHALLENEGLISTRESPONSE_MYSCORE_FIELD.index = 2 GETCARCHALLENEGLISTRESPONSE_MYSCORE_FIELD.label = 1 GETCARCHALLENEGLISTRESPONSE_MYSCORE_FIELD.has_default_value = false GETCARCHALLENEGLISTRESPONSE_MYSCORE_FIELD.default_value = 0 -GETCARCHALLENEGLISTRESPONSE_MYSCORE_FIELD.type = 5 -GETCARCHALLENEGLISTRESPONSE_MYSCORE_FIELD.cpp_type = 1 +GETCARCHALLENEGLISTRESPONSE_MYSCORE_FIELD.type = 3 +GETCARCHALLENEGLISTRESPONSE_MYSCORE_FIELD.cpp_type = 2 GETCARCHALLENEGLISTRESPONSE.name = "GetCarChallenegListResponse" GETCARCHALLENEGLISTRESPONSE.full_name = ".rpc.protocols.GetCarChallenegListResponse" From 8e0505351209f22e9b971c32b6c638760821d5c2 Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Fri, 11 Mar 2022 16:30:38 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E3=80=90=E6=88=98=E6=96=97=E3=80=91=3D=3D?= =?UTF-8?q?=3D=3D=3D=3D=3D=3D=3D=E8=A2=AB=E5=8A=A8429=20=20430=20=20431?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Battle/BattleManager.lua | 37 ++++++--- .../Modules/Battle/Logic/Base/Passivity.lua | 77 +++++++++++++++++++ .../Modules/Battle/Logic/Buff/BreakArmor.lua | 4 +- .../Modules/Battle/Logic/Misc/BattleUtil.lua | 8 +- .../Modules/Battle/Logic/Monster/Monster.lua | 26 +++++++ .../~Lua/Modules/Practice/PracticeManager.lua | 3 + .../~Lua/Modules/Practice/PracticePanel.lua | 1 + .../Practice/PracticeSkillInfoPanel.lua | 17 +++- 8 files changed, 158 insertions(+), 15 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua index cbb6021100..111518afe9 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua @@ -277,20 +277,35 @@ function this.PokemonUnitAdapter(pokemonUnit,camp,_teamDamage) property = {}, } -- 技能 - local skills = string.split(pokemonUnit.unitSkillIds, "#") - if pokemonUnit.position==100 then -- 特殊处理位置 100 是玩家技能数据 - for i = 1, #skills do - if skills[i] and skills[i]~="" then - local newSkill=this.PlayerSkillAdapter(tonumber(skills[i])) - role.skill[i] = newSkill + LogError(pokemonUnit.unitSkillIds) + local skills = string.split(pokemonUnit.unitSkillIds, "|") + if skills then + if skills[1] then + local actives=string.split(skills[1], "#") + if pokemonUnit.position==100 then -- 特殊处理位置 100 是玩家技能数据 + for i = 1, #actives do + if actives[i] and actives[i]~="" then + local newSkill=this.PlayerSkillAdapter(tonumber(actives[i])) + role.skill[i] = newSkill + end + end + else + for i = 1, #actives do + role.skill[i]= this.MonsterSkillAdapter(tonumber(actives[i])) + end end - end - else - for i = 1, #skills do - role.skill[i]= this.MonsterSkillAdapter(tonumber(skills[i])) - end + end + if skills[2] then + local passs=string.split(skills[2], "#") + local passivityList = {} + for j = 1, #passs do + table.insert(passivityList, tonumber(passs[j])) + end + role.passivity = this.GetPassivityData(passivityList) + end end + -- 属性 local propertys = string.split(pokemonUnit.property, "#") for j = 1, #propertys do diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index 79f5716e38..5acbacfe44 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -11039,6 +11039,83 @@ local passivityList = { time=time+1 end) end, + --每次释放技能,有[a]%的概率,使目标被控制概率改变[b][c]%,持续[d]回合 + --a[float],b[int],c[float],d[int] + [429]=function(role, args,id,judge) + local p1=args[1] + local ct=args[2] + local p2=args[3] + local r1=args[4] + local OnSkillCast=function(skill) + if not skill then + return + end + if skill and not skill.isTriggerJudge and judge==1 then + return + end + local list = skill:GetDirectTargets() + if list then + for i = 1, #list do + BattleUtil.RandomAction(p1,function() + + list[i]:AddBuff(Buff.Create(role, BuffName.BreakArmor,r1,4,ct,p2)) + end) + end + end + + end + role.Event:AddEvent(BattleEventName.SkillCastEnd,OnSkillCast,nil,nil,role) + end, + --释放技能时,有[a]%概率为目标增加[b]属性 改变[c][d]%的效果,持续[e]回合 + --a[float],b[int 属性],c[int],d[float],e[int] + [430]=function(role, args,id,judge) + local p1 = args[1] + local pro = args[2] + local ct = args[3] + local v1 = args[4] + local r1 = args[5] + local OnSkillCast = function(skill) + if not skill then + return + end + if skill and not skill.isTriggerJudge and judge==1 then + return + end + local arr=skill:GetDirectTargets() + for i = 1, #arr do + BattleUtil.RandomAction(p1,function() + arr[i]:AddBuff(Buff.Create(role, BuffName.PropertyChange,r1, BattlePropList[pro], v1, ct)) + end) + end + end + role.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCast,nil,nil,role) + end, + --释放技能时,我方随机[a]个人,增加[b]%[c]属性的御甲 + --a[int],b[float],c[int 属性] + [431]=function(role, args,id,judge) + local v1 = args[1] + local v2 = args[2] + local pro = args[3] + local OnSkillCast = function(skill) + if not skill then + return + end + if skill and not skill.isTriggerJudge and judge==1 then + return + end + local list = RoleManager.Query(function(v) return role.camp == v.camp end) + if list then + BattleUtil.RandomList(list) + v1=min(v1,#list) + for i = 1, v1 do + local val = floor(BattleUtil.FP_Mul(v2, list[i]:GetRoleData(BattlePropList[pro]))) + --如果身上有御甲就添加御甲的值 + BattleUtil.AddBlood(list[i],val) + end + end + end + role.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCast,nil,nil,role) + end, } return passivityList \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/BreakArmor.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/BreakArmor.lua index 719b504691..a2899b3e8a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/BreakArmor.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/BreakArmor.lua @@ -2,7 +2,9 @@ BreakArmor = Buff:New() --初始化Buff,通过传入一些自定义参数控制成长相关的数值 function BreakArmor:SetData(...) - self.signType=... + self.signType, + self.signValue1, + self.signValue2=... -- 刷新排序等级 self.sort = 4 end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua index daea8ddf9f..1fee2f2fd5 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -1074,7 +1074,7 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i -- 计算克制伤害系数 local MieKangFactor = 1 - if atkRole.type == BattleUnitType.Role and defRole.type == BattleUnitType.Role then + if BattleLogic.GetIsPvP() and atkRole.type == BattleUnitType.Role and defRole.type == BattleUnitType.Role then MieKangFactor=MieKangFactor + atkRole:GetRoleData(BattleMieProp[defRole.element]) - defRole:GetRoleData(BattleKangProp[atkRole.element]) end @@ -1359,6 +1359,12 @@ function BattleUtil.RandomControl(rand, ctrl, caster, target, round,skill) target.Event:DispatchEvent(BattleEventName.PassiveBeRandomControl, _CallBack, ctrl, target) BattleLogic.Event:DispatchEvent(BattleEventName.PassiveBeRandomControl, _CallBack, ctrl,caster,target) rand = BattleUtil.CountChangeList(rand, cl) + local list=BattleLogic.BuffMgr:GetBuff(target,function(buff) + return buff.type==BuffName.BreakArmor and buff.signType==4 + end) + for key, value in pairs(list) do + rand=BattleUtil.CountValue(rand,value.signValue2,value.signValue1) + end local buff = Buff.Create(caster, BuffName.Control, round, ctrl) local isAdd=BattleUtil.RandomAction(rand, function() target:AddBuff(buff) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Monster/Monster.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Monster/Monster.lua index e87c747e15..6bc13d1d72 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Monster/Monster.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Monster/Monster.lua @@ -39,6 +39,32 @@ function Monster:Init(data) --LogError("monster skill id=="..data.skill[i]) self.skillGroupList[i] = MSkillManager.CreateMSkillGroup(self, i, data.skill[i]) end + if data.passivity and #data.passivity > 0 then + table.sort(data.passivity,function(a,b) + return a[1] < b[1] + end) + for i = 1, #data.passivity do + local v = data.passivity[i] + local passivityId = tonumber(v[1]) + local judge=v[2] + local id = tonumber(v[3]) + local args = {} + for j = 4, #v do + args[j-3] = v[j] + end + if BattleUtil.Passivity[id] then + BattleUtil.Passivity[id](self, args,passivityId,judge) + BattleLogManager.Log( + "Add Passive", + "id", tostring(id), + "camp", tostring(self.camp), + "pos", tostring(self.position), + "passivityId", tostring(passivityId), + "judge", tostring(judge) + ) + end + end + end end diff --git a/Assets/ManagedResources/~Lua/Modules/Practice/PracticeManager.lua b/Assets/ManagedResources/~Lua/Modules/Practice/PracticeManager.lua index fd82f746f1..d1ae207c12 100644 --- a/Assets/ManagedResources/~Lua/Modules/Practice/PracticeManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Practice/PracticeManager.lua @@ -63,6 +63,9 @@ function this.CheckPlayerSkillRed(redType) end local id=redType-5000 local lv=this.playerSkillList[id] + if id~=100 and lv>=this.playerSkillList[100] then + return false + end local openId=PlayerPrefs.GetInt(PlayerManager.uid.."playerSkillRed") if openId==id then return true diff --git a/Assets/ManagedResources/~Lua/Modules/Practice/PracticePanel.lua b/Assets/ManagedResources/~Lua/Modules/Practice/PracticePanel.lua index 3778877c3e..885346b0aa 100644 --- a/Assets/ManagedResources/~Lua/Modules/Practice/PracticePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Practice/PracticePanel.lua @@ -273,6 +273,7 @@ function Practice:SetSkillInfo() Util.GetGameObject(item, "Text"):SetActive(false) end Util.AddClick(item,function() + LogError("i=="..i.." list[i]=="..list[i]) UIManager.OpenPanel(UIName.PracticeSkillInfoPanel,i,list[i]) end) index=index+1 diff --git a/Assets/ManagedResources/~Lua/Modules/Practice/PracticeSkillInfoPanel.lua b/Assets/ManagedResources/~Lua/Modules/Practice/PracticeSkillInfoPanel.lua index f98ad5e3c7..c9536639bd 100644 --- a/Assets/ManagedResources/~Lua/Modules/Practice/PracticeSkillInfoPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Practice/PracticeSkillInfoPanel.lua @@ -41,6 +41,9 @@ function PracticeSkillInfoPanel:BindEvent() PracticeManager.SetPlayerSkill(skillId,skillLv) end end) + elseif btnState==5 then + PopupTipPanel.ShowTip("不能超过主动技能等级") + return end end) @@ -70,6 +73,7 @@ function PracticeSkillInfoPanel:RefreshShow(id,lv) else currLv=lv end + local list=PracticeManager.GetSkillInfo() LogError("level====="..lv) skillLv=lv skillId=id @@ -125,8 +129,17 @@ function PracticeSkillInfoPanel:RefreshShow(id,lv) self.costImg.sprite=icon if BagManager.GetItemCountById(currData.LvupCost[1][1])>=currData.LvupCost[1][2] then self.costNum.color=UIColor.WRITE - btnState=3 --可以点击 - self.redPoint:SetActive(true) + if skillId~=100 and list[skillId] and currLv>=list[100] then + btnState=5 + self.hintInfo.gameObject:SetActive(true) + self.costImg.gameObject:SetActive(false) + self.hintInfo.text="不能超过主动技能等级" + Util.SetGray(self.btn_up,true) + else + btnState=3 --可以点击 + Util.SetGray(self.btn_up,false) + end + else self.costNum.color=UIColor.RED btnState=4 --货币不足