From 05fb2f5e7f4d9f0ba89ab37fd2870fa2b7358367 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Fri, 6 Nov 2020 20:45:21 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=88=98=E6=96=97=E3=80=91=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=88=98=E6=96=97=E4=B8=AD=E5=8F=97=E5=87=BB=E7=89=B9?= =?UTF-8?q?=E6=95=88=E5=8F=8A=E9=9F=B3=E6=95=88=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=81=87=E6=88=98?= =?UTF-8?q?=E6=96=97=E6=98=9F=E7=BA=A7=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Battle/BattleManager.lua | 40 ++++++++++--------- .../Modules/Battle/Test/View/SkillSetView.lua | 10 +++-- .../Modules/Battle/View/Unit/EnemyView.lua | 3 +- .../Modules/Battle/View/Unit/PlayerView.lua | 5 ++- .../Modules/Battle/View/Unit/RoleView.lua | 3 +- .../Modules/Battle/View/Unit/SkillCaster.lua | 16 +------- 6 files changed, 36 insertions(+), 41 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua index e0ea10c86e..145f66cec1 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua @@ -100,33 +100,16 @@ function this.GetSkillData(skillId,skinId) local target = SkillLogicConfig[skillId].Target local effectList = SkillLogicConfig[skillId].Effect local effectArgsList = SkillLogicConfig[skillId].EffectValue - local skin=skinId - if not skinId then - skin=0 - end - local effectIds=SkillLogicConfig[skillId].SkillDisplay - local eid=0 - if effectIds then - for i = 1, #effectIds do - if effectIds[i][1]==skin then - eid=effectIds[i][2] - end - end - end - if eid==0 then - eid=effectIds[1][2] - end + local eid = BattleManager.GetCombatIdBySkin(skillId, skinId or 0) local EffectCombat = CombatControl[eid] - --local EffectCombat = CombatControl[SkillLogicConfig[skillId].SkillDisplay] - local index = 1 - skill[1] = skillId skill[2] = EffectCombat.KeyFrame/1000 skill[3] = EffectCombat.SkillDuration/1000 skill[4] = EffectCombat.SkillNumber + local index = 1 for i = 1, #effectList do local effectGroup = { target[i][1] } -- 效果目标 for j = 1, #effectList[i] do @@ -198,6 +181,7 @@ function this.GetMonsterData(monsterId) type = 1, quality = 0, skinId=monsterConfig.SkinId, + star=monsterConfig.Star, skill = this.GetSkillData(monsterConfig.SkillList[1],monsterConfig.SkinId), superSkill = this.GetSkillData(monsterConfig.SkillList[2],monsterConfig.SkinId), element = monsterConfig.PropertyName, @@ -857,4 +841,22 @@ function this.RecycleAllDelayRes() end --++++++++++++++ +-- 获取技能表现id +function this.GetCombatIdBySkin(skillId, skinId) + local effectIds = SkillLogicConfig[skillId].SkillDisplay + local eid=0 + local skin = skinId or 0 + if effectIds then + for i = 1, #effectIds do + if effectIds[i][1] == skin then + eid=effectIds[i][2] + end + end + end + if eid==0 then + eid=effectIds[1][2] + end + return eid +end + return this \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Test/View/SkillSetView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Test/View/SkillSetView.lua index 7db10d8a81..49cda44109 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Test/View/SkillSetView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Test/View/SkillSetView.lua @@ -46,11 +46,13 @@ function SkillSetView:Show(camp, pos, BattleView) self.rt.text = self.roleView.spAtkTime*1000 self.rt2.text = self.roleView.atkSoundTime*1000 - local nCombat = BattleManager.GetSkillCombat(SkillLogicConfig[nSkillId].SkillDisplay) + local nCId = BattleManager.GetCombatIdBySkin(nSkillId, 0) + local nCombat = BattleManager.GetSkillCombat(nCId) self.nt1.text = nCombat.BulletTime self.nt2.text = nCombat.KeyFrame - local sCombat = BattleManager.GetSkillCombat(SkillLogicConfig[sSkillId].SkillDisplay) + local sCId = BattleManager.GetCombatIdBySkin(sSkillId, 0) + local sCombat = BattleManager.GetSkillCombat(sCId) self.st1.text = sCombat.BulletTime self.st2.text = sCombat.KeyFrame @@ -65,7 +67,7 @@ function SkillSetView:ApplyData() self.roleView.spAtkTime = (tonumber(self.rt.text)or 0)/1000 self.roleView.atkSoundTime = (tonumber(self.rt2.text)or 0)/1000 - local ncId = SkillLogicConfig[nSkillId].SkillDisplay + local ncId = BattleManager.GetCombatIdBySkin(nSkillId, 0) local nCombat = BattleManager.GetSkillCombat(ncId) local nBulletTime = tonumber(self.nt1.text) or 0 local nKeyFrame = tonumber(self.nt2.text) or 0 @@ -76,7 +78,7 @@ function SkillSetView:ApplyData() self.role.skill[2] = nKeyFrame/1000 end - local scId = SkillLogicConfig[sSkillId].SkillDisplay + local scId = BattleManager.GetCombatIdBySkin(sSkillId, 0) local sCombat = BattleManager.GetSkillCombat(scId) local sBulletTime = tonumber(self.st1.text) or 0 local sKeyFrame = tonumber(self.st2.text) or 0 diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua index b3a589dcac..f1ec3a49fc 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/EnemyView.lua @@ -424,7 +424,8 @@ function EnemyView:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotTyp self:PlaySpineAnim(self.RoleLiveGOGraphic, 0, "hit", false) -- bo if skill then - local combat = BattleManager.GetSkillCombat(SkillLogicConfig[skill.id].SkillDisplay) + local combatId = BattleManager.GetCombatIdBySkin(skill.id, atkRole.roleData.skinId) + local combat = BattleManager.GetSkillCombat(combatId) self.SkillCaster:CheckSkillHitEffect("hit", combat, skill) end end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua index cc87d96c37..68c86f8c3d 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua @@ -1,4 +1,4 @@ - + local RoleConfig = ConfigManager.GetConfig(ConfigName.RoleConfig) local HeroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig) local SkillLogicConfig = ConfigManager.GetConfig(ConfigName.SkillLogicConfig) @@ -483,7 +483,8 @@ function PlayerView:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotTy -- 播放受击特效 if skill then - local combat = BattleManager.GetSkillCombat(SkillLogicConfig[skill.id].SkillDisplay) + local combatId = BattleManager.GetCombatIdBySkin(skill.id, atkRole.roleData.skinId) + local combat = BattleManager.GetSkillCombat(combatId) self.SkillCaster:CheckSkillHitEffect("hit", combat, skill) end end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/RoleView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/RoleView.lua index 6d58cd398e..580911f33c 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/RoleView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/RoleView.lua @@ -556,7 +556,8 @@ function RoleView:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType -- 播放受击特效 if skill then - local combat = BattleManager.GetSkillCombat(SkillLogicConfig[skill.id].SkillDisplay) + local combatId = BattleManager.GetCombatIdBySkin(skill.id, atkRole.roleData.skinId) + local combat = BattleManager.GetSkillCombat(combatId) self.SkillCaster:CheckSkillHitEffect("hit", combat, skill) end end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua index b2e21ec3ad..25494120a4 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/SkillCaster.lua @@ -1,4 +1,4 @@ - + local Bezier = require("Base.Bezier") local SkillLogicConfig = ConfigManager.GetConfig(ConfigName.SkillLogicConfig) local BuffEffectConfig = ConfigManager.GetConfig(ConfigName.BuffEffectConfig) @@ -26,20 +26,8 @@ end function SkillCaster:OnSkillCast(skill) if not skill then return end - local effectIds=SkillLogicConfig[skill.id].SkillDisplay - local eid=0 - local skin=self.owner.skinId or 0 - if effectIds then - for i = 1, #effectIds do - if effectIds[i][1]==skin then - eid=effectIds[i][2] - end - end - end - if eid==0 then - eid=effectIds[1][2] - end + local eid = BattleManager.GetCombatIdBySkin(skill.id, self.owner.skinId) local combat = BattleManager.GetSkillCombat(eid) if not combat then return end -- 追击显示追击文字