From ae8021cd6a368bbd7799ef0bff66c24fc6145963 Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Thu, 25 Nov 2021 15:04:55 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E6=88=98=E6=96=97=E8=A1=A8=E7=8E=B0]=3D?= =?UTF-8?q?=3D=3D=3D=3D=3D=3D=3D=E6=95=8C=E6=88=91=E6=96=B9=E7=AB=8B?= =?UTF-8?q?=E7=BB=98=E9=95=9C=E5=83=8F=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Battle/View/Unit/EnemyView.lua | 12 +++++++++++- .../Modules/Battle/View/Unit/PlayerView.lua | 18 ++++++++++++------ .../Modules/Battle/View/Unit/SkillCaster.lua | 6 +++++- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua index 3242b71337..f2fc31e77a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua @@ -99,7 +99,17 @@ function EnemyView:onCreate(go, role, position, root, isBoss,enemyId) self.RoleLiveGO2:GetComponent("RectTransform").anchoredPosition = Vector2.New(self.outOffset[1], self.outOffset[2] + 400) self.RoleLiveGO2.transform.localScale = Vector3.one * self.enemy_liveScale --* 2 self.RoleLiveGO2:SetActive(false) - + local toward=HeroConfig[role.roleData.roleId].Toward + if toward==2 then + local mirrOffset=RoleConfig[roleId].mirrorimage_offset + if mirrOffset and mirrOffset[1]~=0 and mirrOffset[2]~=0 then + self.RoleLiveGO:GetComponent("RectTransform").anchoredPosition = Vector2.New(mirrOffset[1],mirrOffset[2]) + self.RoleLiveGO2:GetComponent("RectTransform").anchoredPosition = Vector2.New(mirrOffset[1],mirrOffset[2]) + end + + self.RoleLiveGO:GetComponent("RectTransform").rotation = Quaternion.Euler(Vector3.New(0,180, 0)) + self.RoleLiveGO2:GetComponent("RectTransform").rotation = Quaternion.Euler(Vector3.New(0,180, 0)) + end -- 阴影 self.shadow = Util.GetGameObject(self.RootPanel.EnemyPanel, "live_"..position.."/shadow") self.shadow:SetActive(true) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua index 92b663699c..907a946ab4 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua @@ -105,8 +105,7 @@ function PlayerView:onCreate(go, role, position, root) self.RoleLiveGO:GetComponent("RectTransform").anchoredPosition = Vector2.New(self.outOffset[1], self.outOffset[2])-- * 0.5 self.RoleLiveGO.transform.localScale = Vector3.one * self.enemy_liveScale self.RoleLiveGO:SetActive(true) - - + -- 卡牌立绘显示 --self.liveRender = Util.GetGameObject(go, "Mask/icon"):GetComponent("RawImage") --self.liveRender.texture, self.aaa , _, self.RoleLiveParnet = CardRendererManager.GetSpineTexture(role.position, self.livePath, Vector3.one * self.play_liveScale, Vector3.New(self.offset[1], self.offset[2], 0), false) --self.spLoader:LoadSprite(heroData.painting) @@ -117,9 +116,6 @@ function PlayerView:onCreate(go, role, position, root) -- self.liveRender.transform.anchoredPosition = Vector3.zero--Vector2.New(self.offset[1], self.offset[2]) -- self.liveRender.gameObject:SetActive(true) -- self.liveRender.material:SetInt("_IsMask", 1) - - - -- casting技能立绘 self.RoleLiveGO2 = poolManager:LoadLive(self.livePath, go.transform.parent, Vector3.one, Vector3.zero) self.RoleLiveGO2.transform:SetParent(self.RootPanel.mySkillCastRoot.transform) @@ -130,7 +126,17 @@ function PlayerView:onCreate(go, role, position, root) self.RoleLiveGOTran2 = self.RoleLiveGO2:GetComponent("RectTransform") self.RoleLiveGOGraphic2.AnimationState:SetAnimation(0, "idle", true) self.RoleLiveGOTran2.sizeDelta = Vector2.New(1000, 1000) - + local toward=HeroConfig[role.roleData.roleId].Toward + if toward==1 then + local mirrOffset=RoleConfig[roleId].mirrorimage_offset + if mirrOffset and mirrOffset[1]~=0 and mirrOffset[2]~=0 then + self.RoleLiveGO:GetComponent("RectTransform").anchoredPosition = Vector2.New(mirrOffset[1],mirrOffset[2]) + self.RoleLiveGO2:GetComponent("RectTransform").anchoredPosition = Vector2.New(mirrOffset[1],mirrOffset[2]) + end + self.RoleLiveGO:GetComponent("RectTransform").rotation = Quaternion.Euler(Vector3.New(0,180, 0)) + self.RoleLiveGO2:GetComponent("RectTransform").rotation = Quaternion.Euler(Vector3.New(0,180, 0)) + end + -- self.RoleIconGO = Util.GetGameObject(go, "func") self.RoleIconGO:SetActive(true) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua index 349548914e..12cbbdf033 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua @@ -40,7 +40,7 @@ function SkillCaster:OnSkillCast(skill) BattleManager.PauseBattle() -- 调用上层接口 if self.owner.OnSkillCastStart then - self.owner:OnSkillCastStart() + self.owner:OnSkillCastStart(skill) end self.owner.RootPanel.SetRoleHighLight(self.owner, skill:GetDirectTargets(), function() @@ -118,6 +118,10 @@ function SkillCaster:PlaySkillCastingEffect(combat, skill, func) if self.owner.role.type == BattleUnitType.Monster then self:CheckSkillForoleEffect(combat, skill) end + + if self.owner.OnSkillCastStart then + self.owner:OnSkillCastStart(skill) + end -- 调用上层接口 if self.owner.OnSkillCastingStart then self.owner:OnSkillCastingStart() From aff13f89046915f53ad28c24f6fad8af145c8e3b Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Thu, 25 Nov 2021 15:07:40 +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=E6=8A=80=E8=83=BD132-140=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Battle/Logic/Base/Effect.lua | 211 ++++++++++++++++++ 1 file changed, 211 insertions(+) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Effect.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Effect.lua index e59d75d048..1378fdd0e4 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Effect.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Effect.lua @@ -2517,6 +2517,217 @@ local effectList = { target:AddBuff(buff) end) end, + --造成主角[a]*[b]攻击伤害 + --a[int 1:等级 2.战斗力],b[int] + [132] = function(caster, target, args, interval, skill) + local type = args[1] + local pro = args[2] + + BattleLogic.WaitForTrigger(interval, function () + local value=0 + if type==1 then + value=caster.star + elseif type==2 then + value=caster.teamDamage + end + local damage=floor(value*pro) + BattleUtil.FinalDamageCountShield(nil,caster, target,damage) + end) + end, + --对目标造成玩家[a]*[b]的伤害,伤害的[c]%转化为生命,治疗生命百分比最[d]的英雄 + --a[int 1:等级 2.战斗力],b[int],c[float],d[int 1:低 0:高] + [133] = function(caster, target, args, interval, skill) + local type=args[1] + local f1 = args[2] + local f2 = args[3] + local sort = args[4] + BattleLogic.WaitForTrigger(interval, function () + local value=0 + if type==1 then + value=caster.star + elseif type==2 then + value=caster.teamDamage + end + local damage=floor(value*f1) + BattleUtil.FinalDamageCountShield(nil,caster, target,damage) + local hp=floor(damage*f2) + local arr = RoleManager.NoOrder(function (r) return r.camp == caster.camp end,false,true) + BattleUtil.SortByHpFactor(arr,sort) + BattleUtil.CalTreat(caster, arr[1],hp,1,skill) + + end) + end, + --对目标造成主角[a]*[b]的伤害,并有[c]%概率给目标上[d]类型[e]效果buff持续[f]回合,buff具体参数1 [g] + --a[int 1:等级 2.战斗力],b[int],c[float],d[int],e[int],f[int],g[int] + [134] = function(caster, target, args, interval, skill) + local type=args[1] + local v1 = args[2] + local p1 = args[3] + local t1 = args[4] + local t2 = args[5] + local r1 = args[6] + local v2 = args[7] + BattleLogic.WaitForTrigger(interval, function () + local value=0 + if type==1 then + value=caster.star + elseif type==2 then + value=caster.teamDamage + end + local damage=floor(value*v1) + BattleUtil.FinalDamageCountShield(nil,caster, target,damage) + if t1==BuffName.Control then + BattleUtil.RandomControl(p1,t2,caster,target,r1,skill) + elseif t1==BuffName.DOT then + BattleUtil.RandomDot(p1,t2,caster,target,r1,1,value*v2,skill) + end + end) + end, + --对目标造成主角[a]*[b]的伤害,如果目标处于[c]类型[d]效果,则[e]%概率给目标添加[f]类型[g]效果,持续[h]回合 + --a[int 1:等级 2.战斗力],b[int],c[int],d[int],e[float],f[int],g[int],h[int] + [135] = function(caster, target, args, interval, skill) + local type=args[1] + local v1 = args[2] + local t1 = args[3] + local t2 = args[4] + local pro = args[5] + local t3 = args[6] + local t4 = args[7] + local r1 =args[8] + BattleLogic.WaitForTrigger(interval, function () + local value=0 + if type==1 then + value=caster.star + elseif type==2 then + value=caster.teamDamage + end + local damage=floor(value*v1) + BattleUtil.FinalDamageCountShield(nil,caster, target,damage) + if BattleLogic.BuffMgr:HasBuff(target, t1, function (buff) + if t1==BuffName.DOT then + return buff.damageType==t2 + end + end) then + if t3==BuffName.Control then + BattleUtil.RandomControl(pro,t4,caster,target,r1,skill) + end + end + end) + end, + --对目标造成主角[a]*[b]攻击伤害,目标每减少[c]个伤害增加[d]% + --a[int 1:等级 2.战斗力],b[int],c[int],d[float] + [136] = function(caster, target, args, interval, skill) + local type = args[1] + local pro = args[2] + local i1 = args[3] + local v1 = args[4] + BattleLogic.WaitForTrigger(interval, function () + local value=0 + if type==1 then + value=caster.star + elseif type==2 then + value=caster.teamDamage + end + -- 改变值 = 技能最大目标数 - 当前目标数 + local maxNum = skill:GetMaxTargetNum() + local curNum = #skill:GetDirectTargets() + local lessNum = max(maxNum - curNum, 0) + local level = math.floor(lessNum/i1) + local extra = BattleUtil.ErrorCorrection(level * i1) + local damage=floor(value*pro*(1+extra)) + BattleUtil.FinalDamageCountShield(nil,caster, target,damage) + end) + end, + --对目标造成主角[a]*[b]攻击伤害,如果击杀目标,随机减少敌方[c]个神将[d]点怒气 + --a[int 1:等级 2.战斗力],b[int],c[int],d[float] + [137] = function(caster, target, args, interval, skill) + local type = args[1] + local pro = args[2] + local i1 = args[3] + local v1 = args[4] + BattleLogic.WaitForTrigger(interval, function () + local value=0 + if type==1 then + value=caster.star + elseif type==2 then + value=caster.teamDamage + end + local damage=floor(value*pro) + BattleUtil.FinalDamageCountShield(nil,caster, target,damage) + if target.isDead then + local arr = RoleManager.Query(function (r) return r.camp == target.camp end) + for i = 1, i1 do + local count = Random.RangeInt(1,#arr) + BattleUtil.CalRage(caster,arr[count],v1,CountTypeName.Sub) + end + end + end) + end, + --技能目标如果大于[a],改变[b]目标[c]点怒气 + --a[int],b[int],c[int] + [138] = function(caster, target, args, interval, skill) + local num = args[1] + local ct = args[2] + local v1 = args[3] + BattleLogic.WaitForTrigger(interval, function () + local curNum = #skill:GetDirectTargets() + if curNum>num then + BattleUtil.CalRage(caster,target,v1,ct) + end + end) + end, + --对目标造成主角[a]*[b]的伤害,如果目标处于[c]类型[d]效果,则伤害改变[e][f]% + --a[int 1:等级 2.战斗力],b[int],c[int],d[int],e[int],f[float] + [139] = function(caster, target, args, interval, skill) + local type=args[1] + local v1 = args[2] + local t1 = args[3] + local t2 = args[4] + local ct = args[5] + local v2 = args[6] + BattleLogic.WaitForTrigger(interval, function () + local value=0 + if type==1 then + value=caster.star + elseif type==2 then + value=caster.teamDamage + end + local add=0 + if BattleLogic.BuffMgr:HasBuff(target, t1, function (buff) + if t1==BuffName.DOT then + return buff.damageType==t2 + end + end) then + add=v2 + end + local damage=floor(value*v1) + damage=floor(BattleUtil.CountValue(damage,add,ct)) + BattleUtil.FinalDamageCountShield(nil,caster, target,damage) + end) + end, + --造成主角[a]*[b]攻击伤害,概率[c]改变[d]目标[e]点怒气 + --a[int 1:等级 2.战斗力],b[int],c[float],d[int],e[int] + [140] = function(caster, target, args, interval, skill) + local type = args[1] + local pro = args[2] + local p1 = args[3] + local ct = args[4] + local v1 = args[5] + BattleLogic.WaitForTrigger(interval, function () + local value=0 + if type==1 then + value=caster.star + elseif type==2 then + value=caster.teamDamage + end + local damage=floor(value*pro) + BattleUtil.FinalDamageCountShield(nil,caster, target,damage) + BattleUtil.RandomAction(p1, function () + BattleUtil.CalRage(caster,target,v1,ct) + end) + end) + end, + } return effectList \ No newline at end of file