From d64715ce017349c9156d23e10f41255465b85322 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Wed, 8 Dec 2021 15:56:08 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E3=80=90=E7=89=9B=E6=B0=94=E5=86=B2?= =?UTF-8?q?=E5=A4=A9=E3=80=91=E9=A1=B5=E7=AD=BE=E6=A0=B9=E6=8D=AE=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=88=A4=E6=96=AD=E6=98=BE=E9=9A=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NiuQiChongTian/NiuQiChongTianManager.lua | 100 +++++++++--------- .../NiuQiChongTian/NiuQiChongTianPanel.lua | 19 +++- 2 files changed, 68 insertions(+), 51 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianManager.lua b/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianManager.lua index 9f81783f5f..a8209166fe 100644 --- a/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianManager.lua @@ -8,7 +8,7 @@ local itemId = 0 function this.Initialize() this.InitAllRewardData() Game.GlobalEvent:AddEvent(GameEvent.Mission.NiuQiChongTianTask,this.UpdateStatus) - this.IsNewActivity = false + -- this.IsNewActivity = false end --服务器发来的活动进度条数据 @@ -92,52 +92,52 @@ end --需要显示的任务数据 function this.GetNeedRewardData(sort) local needData = {} - if not this.IsNewActivity then--老的牛气冲天 - for i = 1, 2 do - local tempdata = {} - for k, v in pairs(this.rewardData) do - if v.Sort == sort and v.Type == i and (v.state == 1 or v.state == 0) then - if #tempdata < 1 then - table.insert(tempdata,v) - else - table.insert(tempdata,v) - break - end - end - end - if #tempdata < 2 then - for k = #this.rewardData, 1 , -1 do - local v = this.rewardData[k] - local data = nil - if #tempdata == 0 then - if v.Sort == sort and v.Type == i then - data = v - end - else - for j = 1, #tempdata do - if tempdata[j].id ~= v.id and v.Sort == sort and v.Type == i then - data = v - break - end - end - end - if data then - table.insert(tempdata,data) - if #tempdata >= 2 then - break - end - end - end - end + -- if not this.IsNewActivity then--老的牛气冲天 + -- for i = 1, 2 do + -- local tempdata = {} + -- for k, v in pairs(this.rewardData) do + -- if v.Sort == sort and v.Type == i and (v.state == 1 or v.state == 0) then + -- if #tempdata < 1 then + -- table.insert(tempdata,v) + -- else + -- table.insert(tempdata,v) + -- break + -- end + -- end + -- end + -- if #tempdata < 2 then + -- for k = #this.rewardData, 1 , -1 do + -- local v = this.rewardData[k] + -- local data = nil + -- if #tempdata == 0 then + -- if v.Sort == sort and v.Type == i then + -- data = v + -- end + -- else + -- for j = 1, #tempdata do + -- if tempdata[j].id ~= v.id and v.Sort == sort and v.Type == i then + -- data = v + -- break + -- end + -- end + -- end + -- if data then + -- table.insert(tempdata,data) + -- if #tempdata >= 2 then + -- break + -- end + -- end + -- end + -- end - for j = 1,#tempdata do - table.insert(needData,tempdata[j]) - end - end - table.sort(needData,function (a,b) - return a.id < b.id - end) - else--新的牛气冲天 + -- for j = 1,#tempdata do + -- table.insert(needData,tempdata[j]) + -- end + -- end + -- table.sort(needData,function (a,b) + -- return a.id < b.id + -- end) + -- else--新的牛气冲天 for k, v in pairs(this.rewardData) do if v.Sort == sort then table.insert(needData,v) @@ -155,7 +155,7 @@ function this.GetNeedRewardData(sort) return STATE[a.state] > STATE[b.state] end end) - end + -- end return needData end @@ -209,9 +209,9 @@ end function this.CheckIsNewActivity() local id = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.NiuQi) local data = ConfigManager.GetConfigData(ConfigName.GlobalActivity,id) - if data.ShowArt == 2 then - this.IsNewActivity = true - end + -- if data.ShowArt == 2 then + -- this.IsNewActivity = true + -- end end return this \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianPanel.lua b/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianPanel.lua index c5043eb809..7dd6bb1ebc 100644 --- a/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/NiuQiChongTian/NiuQiChongTianPanel.lua @@ -104,6 +104,11 @@ function NiuQiChongTianPanel:OnShow(_sortingOrder) end local NiuQiChongTianPanelTabAdapter = function(tab, index, status) + if status == "lock" then + tab:SetActive(false) + return + end + tab:SetActive(true) local tabLab = Util.GetGameObject(tab, "Text") local redPoint = Util.GetGameObject(tab, "Redpot") if _TabData[index].rpType > 0 then @@ -114,7 +119,7 @@ function NiuQiChongTianPanel:OnShow(_sortingOrder) self.redPointList[_TabData[index].rpType] = redPoint end Util.GetGameObject(tab,"Image"):GetComponent("Image").sprite = self.spLoader:LoadSprite(_TabData[index][status]) - tabLab:GetComponent("Text").text = NiuQiChongTianManager.IsNewActivity and _TabData[index].nameNew or _TabData[index].name + tabLab:GetComponent("Text").text = _TabData[index].nameNew tabLab:GetComponent("Text").color = _TabFontColor[status] end @@ -127,8 +132,20 @@ function NiuQiChongTianPanel:OnShow(_sortingOrder) self:SetReward(bool) end + -- 没有数据则不显示页签 + local IsTabLock = function(index) + -- if index == 1 then + -- return true + -- end + local rewardData = NiuQiChongTianManager.GetNeedRewardData(index) + if not rewardData or #rewardData <= 0 then + return true + end + end + self.TabCtrl = TabBox.New() self.TabCtrl:SetTabAdapter(NiuQiChongTianPanelTabAdapter) + self.TabCtrl:SetTabIsLockCheck(IsTabLock) self.TabCtrl:SetChangeTabCallBack(NiuQiChongTianPanelSwitchView) self.curPage = DynamicActivityManager.NiuQiIndex or 1 self.TabCtrl:Init(self.tabBox, _TabData, self.curPage) From f846d6f17e58c42766147b59f199945cf5689e56 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Wed, 8 Dec 2021 16:39:37 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E3=80=90=E6=88=98=E6=96=97=E3=80=91?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E4=B8=89=E5=80=8D=E9=80=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Prefabs/UI/Battle/BattlePanel.prefab | 176 +++++++++++++----- .../~Lua/Modules/Battle/BattleManager.lua | 5 +- .../~Lua/Modules/Battle/View/BattlePanel.lua | 21 ++- 3 files changed, 145 insertions(+), 57 deletions(-) diff --git a/Assets/ManagedResources/Prefabs/UI/Battle/BattlePanel.prefab b/Assets/ManagedResources/Prefabs/UI/Battle/BattlePanel.prefab index 38ae732ce2..cb46acdb34 100644 --- a/Assets/ManagedResources/Prefabs/UI/Battle/BattlePanel.prefab +++ b/Assets/ManagedResources/Prefabs/UI/Battle/BattlePanel.prefab @@ -4881,7 +4881,7 @@ ParticleSystem: --- !u!199 &4899634819696531688 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -9637,7 +9637,7 @@ ParticleSystem: --- !u!199 &4644274050042266027 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -14503,7 +14503,7 @@ ParticleSystem: --- !u!199 &-6568434204472551825 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -20015,7 +20015,7 @@ ParticleSystem: --- !u!199 &4504004418399676027 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -20602,7 +20602,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &-7597116722685450429 RectTransform: m_ObjectHideFlags: 0 @@ -25456,7 +25456,7 @@ ParticleSystem: --- !u!199 &-6320650307698832674 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -26058,7 +26058,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -8.319983, y: -27.379997} + m_AnchoredPosition: {x: -11.3, y: -27.379997} m_SizeDelta: {x: 16, y: 16} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &3916812082061854205 @@ -26554,6 +26554,85 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 +--- !u!1 &397301096 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 397301097} + - component: {fileID: 397301099} + - component: {fileID: 397301098} + m_Layer: 5 + m_Name: num + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &397301097 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 397301096} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 9048216259318326988} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 7.3, y: -26.8} + m_SizeDelta: {x: 30, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &397301099 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 397301096} + m_CullTransparentMesh: 0 +--- !u!114 &397301098 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 397301096} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 0.96470594, b: 0.8235295, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: 4b73e9e4512d17e4daeea351e090d33c, type: 3} + m_FontSize: 30 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 0 + m_MaxSize: 200 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: 1 --- !u!1 &437121363 GameObject: m_ObjectHideFlags: 0 @@ -32529,7 +32608,7 @@ ParticleSystem: --- !u!199 &1498398485 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -33985,12 +34064,13 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 6820716135288942901} + - {fileID: 397301097} m_Father: {fileID: 692595718783767060} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 4.3, y: 6.5} + m_AnchoredPosition: {x: 4.3, y: 8} m_SizeDelta: {x: 44, y: 31} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &7941431343224618870 @@ -39025,7 +39105,7 @@ ParticleSystem: --- !u!199 &5218046717783627369 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -43797,7 +43877,7 @@ ParticleSystem: --- !u!199 &4973672912865784035 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -49571,7 +49651,7 @@ ParticleSystem: --- !u!199 &8115754504008755670 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -54197,7 +54277,7 @@ ParticleSystem: --- !u!199 &9076588630997100118 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -59747,7 +59827,7 @@ ParticleSystem: --- !u!199 &4884976521430742359 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -64765,7 +64845,7 @@ ParticleSystem: --- !u!199 &8971589303256642876 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -69545,7 +69625,7 @@ ParticleSystem: --- !u!199 &908326538797127167 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -74222,7 +74302,7 @@ ParticleSystem: --- !u!199 &3424815464729120938 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -79445,7 +79525,7 @@ ParticleSystem: --- !u!199 &5261670500339204049 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -87398,7 +87478,7 @@ ParticleSystem: --- !u!199 &2874419575716874138 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -93463,7 +93543,7 @@ ParticleSystem: --- !u!199 &-4646563412136487132 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -98391,7 +98471,7 @@ ParticleSystem: --- !u!199 &-1472657892369082979 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -103700,7 +103780,7 @@ ParticleSystem: --- !u!199 &1190906450238264296 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -108705,7 +108785,7 @@ ParticleSystem: --- !u!199 &303874950425780290 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -113515,7 +113595,7 @@ ParticleSystem: --- !u!199 &6491226494071429411 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -118253,7 +118333,7 @@ ParticleSystem: --- !u!199 &7665643744862724267 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -122978,7 +123058,7 @@ ParticleSystem: --- !u!199 &3356793107164812852 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -127824,7 +127904,7 @@ ParticleSystem: --- !u!199 &2105574043811551045 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -133263,7 +133343,7 @@ ParticleSystem: --- !u!199 &3873208337485661605 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -137889,7 +137969,7 @@ ParticleSystem: --- !u!199 &7638952314412277887 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -142740,7 +142820,7 @@ ParticleSystem: --- !u!199 &7217318690555267618 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -147466,7 +147546,7 @@ ParticleSystem: --- !u!199 &5163551958220482345 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -152164,7 +152244,7 @@ ParticleSystem: --- !u!199 &1275831586270848987 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -157073,7 +157153,7 @@ ParticleSystem: --- !u!199 &6459582860832847666 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -162935,7 +163015,7 @@ ParticleSystem: --- !u!199 &6379215747265299312 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -168303,7 +168383,7 @@ ParticleSystem: --- !u!199 &-6104293520298689822 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -173585,7 +173665,7 @@ ParticleSystem: --- !u!199 &4760249444529865488 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -178380,7 +178460,7 @@ ParticleSystem: --- !u!199 &5880366811561489219 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -185405,7 +185485,7 @@ ParticleSystem: --- !u!199 &8058989397371758890 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -191176,7 +191256,7 @@ ParticleSystem: --- !u!199 &3915694397730101422 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -196118,7 +196198,7 @@ ParticleSystem: --- !u!199 &2480133432062228239 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -201064,7 +201144,7 @@ ParticleSystem: --- !u!199 &912766437007132055 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -205904,7 +205984,7 @@ ParticleSystem: --- !u!199 &5882683786084557201 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -210575,7 +210655,7 @@ ParticleSystem: --- !u!199 &333661895225793953 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -215598,7 +215678,7 @@ ParticleSystem: --- !u!199 &4000754657521103867 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -220529,7 +220609,7 @@ ParticleSystem: --- !u!199 &6245463154932388831 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -225872,7 +225952,7 @@ ParticleSystem: --- !u!199 &3385089575464667298 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -231523,7 +231603,7 @@ ParticleSystem: --- !u!199 &334997627562404853 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} @@ -236504,7 +236584,7 @@ ParticleSystem: --- !u!199 &7957960085504555880 ParticleSystemRenderer: serializedVersion: 6 - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 2 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua index 1fe979008e..aa5a32d8b3 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua @@ -882,6 +882,7 @@ end BATTLE_TIME_SCALE_ZERO = 0 BATTLE_TIME_SCALE_ONE= 1.1 BATTLE_TIME_SCALE_TWO = 2 +BATTLE_TIME_SCALE_THREE = 3 this.TimeScale = 0 function this.InitTimeScale() this.TimeScale = 0 @@ -897,8 +898,8 @@ function this.SetTimeScale(TimeScale) TimeScale = BATTLE_TIME_SCALE_ONE end -- - if TimeScale > BATTLE_TIME_SCALE_TWO then - TimeScale = BATTLE_TIME_SCALE_TWO + if TimeScale > BATTLE_TIME_SCALE_THREE then + TimeScale = BATTLE_TIME_SCALE_THREE end if this.TimeScale ~= TimeScale then diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua index a684ddff67..b886c623c4 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua @@ -104,6 +104,7 @@ function this:InitComponent() this.orderText = Util.GetGameObject(this.Option, "order/text"):GetComponent("Text") this.BtnTimeScale = Util.GetGameObject(this.DownRoot, "option/BtnTimeScale") + this.TimeScaleTxt = Util.GetGameObject(this.DownRoot, "option/BtnTimeScale/icon/num"):GetComponent("Text") this.BtnJumpFight = Util.GetGameObject(this.DownRoot, "option/Button") this.jumpLock = Util.GetGameObject(this.DownRoot, "option/Button/lock_round") this.jumpLock:GetComponent("Image").fillAmount = 1 @@ -162,6 +163,10 @@ function this:BindEvent() if scale == BATTLE_TIME_SCALE_ONE then BattleManager.SetTimeScale(BATTLE_TIME_SCALE_TWO) elseif scale == BATTLE_TIME_SCALE_TWO then + BattleManager.SetTimeScale(BATTLE_TIME_SCALE_THREE) + elseif scale == BATTLE_TIME_SCALE_THREE then + BattleManager.SetTimeScale(BATTLE_TIME_SCALE_ONE) + else BattleManager.SetTimeScale(BATTLE_TIME_SCALE_ONE) end end) @@ -409,13 +414,15 @@ end function this.SwitchTimeScale() - local _scale = BattleManager.GetTimeScale() - local child = this.BtnTimeScale.transform.childCount - 3 -- 3倍速时-2 - local s = "x".. math.floor(_scale) - for i=1, child do - local g = this.BtnTimeScale.transform:GetChild(i-1).gameObject - g:SetActive(g.name == s) - end + local _scale = math.floor(BattleManager.GetTimeScale()) + this.TimeScaleTxt.text = _scale + + -- local child = this.BtnTimeScale.transform.childCount - 2 -- 3倍速时-2 + -- local s = "x".. math.floor(_scale) + -- for i=1, child do + -- local g = this.BtnTimeScale.transform:GetChild(i-1).gameObject + -- g:SetActive(g.name == s) + -- end end function this.BattleEnd(result) From 34b02496f23622ffd78e068326114f200497537b Mon Sep 17 00:00:00 2001 From: gaoxin Date: Thu, 9 Dec 2021 09:46:02 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E3=80=90=E6=88=98=E6=96=97=E3=80=91?= =?UTF-8?q?=E4=BA=8C=E5=80=8D=E9=80=9F=EF=BC=8C=E4=B8=89=E5=80=8D=E9=80=9F?= =?UTF-8?q?=E8=A7=A3=E9=94=81=E6=9D=A1=E4=BB=B6=E4=BF=AE=E6=94=B9=EF=BC=8C?= =?UTF-8?q?=E8=B7=B3=E8=BF=87=E6=9D=A1=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Common/GlobalDefine.lua | 1 + .../~Lua/Modules/Battle/BattleManager.lua | 7 +- .../~Lua/Modules/Battle/View/BattlePanel.lua | 93 +++++++++++-------- 3 files changed, 59 insertions(+), 42 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua index f720dabf41..93ed1a6b30 100644 --- a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua +++ b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua @@ -1499,6 +1499,7 @@ PRIVILEGE_TYPE = { EXPLORE_REWARD = 4, -- 挂机探索特权 ADVENTURE_BOSS = 9, -- 外敌挑战次数 DoubleTimesFight = 501, --2倍速战斗 + ThreeTimesFight = 503, --3倍速战斗 CarbonSweeps = 502, --副本扫荡 SkipFight = 512, --跳过战斗 -- UnlockPickUp=504,--一键领取 diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua index aa5a32d8b3..8eb0cf5afd 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua @@ -844,11 +844,14 @@ end function this.IsUnlockBattleSpeed() return PrivilegeManager.GetPrivilegeOpenStatus(PRIVILEGE_TYPE.DoubleTimesFight) end - +-- 是否解锁3倍速 +function this.IsUnlockBattleSpeedThree() + return PrivilegeManager.GetPrivilegeOpenStatus(PRIVILEGE_TYPE.ThreeTimesFight) +end -- 是否解锁跳过功能 function this.IsUnlockBattlePass() -- return false - return PrivilegeManager.GetPrivilegeOpenStatus(PRIVILEGE_TYPE.SkipFight) + return PrivilegeManager.GetPrivilegeOpenStatus(PRIVILEGE_TYPE.SkipFight), "通关简单3-20或充值任意金额后解锁" end -- 战斗暂停控制 diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua index b886c623c4..2962089003 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua @@ -29,9 +29,10 @@ local SKIP_STATE = { } local UpdateBtnGMFunc = { [-1] = function() - -- if not BattleManager.IsUnlockBattlePass() then - -- return SKIP_STATE.LOCK, "25级或充值任意金额后解锁" - -- end + local isUnlock, tip = BattleManager.IsUnlockBattlePass() + if not isUnlock then + return SKIP_STATE.LOCK, tip + end return SKIP_STATE.UNLOCK end, [BATTLE_TYPE.BACK]= function() @@ -43,36 +44,36 @@ local UpdateBtnGMFunc = { [BATTLE_TYPE.Test] = function() return SKIP_STATE.UNLOCK end, - [BATTLE_TYPE.MONSTER_CAMP] = function() - return SKIP_STATE.UNLOCK - end, + -- [BATTLE_TYPE.MONSTER_CAMP] = function() + -- return SKIP_STATE.UNLOCK + -- end, -- [BATTLE_TYPE.DAILY_CHALLENGE] = function() -- return SKIP_STATE.NOUSE, "日常副本战斗无法跳过!" -- end, - [BATTLE_TYPE.STORY_FIGHT] = function() - -- if not BattleManager.IsUnlockBattlePass() then - -- return SKIP_STATE.LOCK, "25级或充值任意金额后解锁" - -- end - -- if FightPointPassManager.GetCurOpenFightIdIsBoss() then - -- return SKIP_STATE.NOUSE, "首领关卡无法跳过!" - -- end - if this.curRound <= _NO_JUMP_ROUND then - return SKIP_STATE.NOUSE, "第二回合结束后可以跳过" - end - return SKIP_STATE.UNLOCK - end, - [BATTLE_TYPE.DAILY_CHALLENGE] = function() - -- if not BattleManager.IsUnlockBattlePass() then - -- return SKIP_STATE.LOCK, "25级或充值任意金额后解锁" - -- end - -- if FightPointPassManager.GetCurOpenFightIdIsBoss() then - -- return SKIP_STATE.NOUSE, "首领关卡无法跳过!" - -- end - if this.curRound <= _NO_JUMP_ROUND then - return SKIP_STATE.NOUSE, "第二回合结束后可以跳过" - end - return SKIP_STATE.UNLOCK - end, + -- [BATTLE_TYPE.STORY_FIGHT] = function() + -- if not BattleManager.IsUnlockBattlePass() then + -- return SKIP_STATE.LOCK, "25级或充值任意金额后解锁" + -- end + -- -- if FightPointPassManager.GetCurOpenFightIdIsBoss() then + -- -- return SKIP_STATE.NOUSE, "首领关卡无法跳过!" + -- -- end + -- -- if this.curRound <= _NO_JUMP_ROUND then + -- -- return SKIP_STATE.NOUSE, "第二回合结束后可以跳过" + -- -- end + -- return SKIP_STATE.UNLOCK + -- end, + -- [BATTLE_TYPE.DAILY_CHALLENGE] = function() + -- -- if not BattleManager.IsUnlockBattlePass() then + -- -- return SKIP_STATE.LOCK, "25级或充值任意金额后解锁" + -- -- end + -- -- if FightPointPassManager.GetCurOpenFightIdIsBoss() then + -- -- return SKIP_STATE.NOUSE, "首领关卡无法跳过!" + -- -- end + -- if this.curRound <= _NO_JUMP_ROUND then + -- return SKIP_STATE.NOUSE, "第二回合结束后可以跳过" + -- end + -- return SKIP_STATE.UNLOCK + -- end, } function this:GetSkipState() @@ -106,8 +107,8 @@ function this:InitComponent() this.BtnTimeScale = Util.GetGameObject(this.DownRoot, "option/BtnTimeScale") this.TimeScaleTxt = Util.GetGameObject(this.DownRoot, "option/BtnTimeScale/icon/num"):GetComponent("Text") this.BtnJumpFight = Util.GetGameObject(this.DownRoot, "option/Button") - this.jumpLock = Util.GetGameObject(this.DownRoot, "option/Button/lock_round") - this.jumpLock:GetComponent("Image").fillAmount = 1 + this.jumpLock = Util.GetGameObject(this.DownRoot, "option/Button/lock") + -- this.jumpLock:GetComponent("Image").fillAmount = 1 this.submit = Util.GetGameObject(this.DownRoot, "bg") @@ -151,22 +152,34 @@ function this:BindEvent() Util.AddClick(this.BtnTimeScale, function () + -- 没开始不能调整 if not BattleManager.IsCanOperate() then return end + -- 2倍速没开始表示没解锁倍速 if not BattleManager.IsUnlockBattleSpeed() then PopupTipPanel.ShowTip(PrivilegeManager.GetPrivilegeOpenTip(PRIVILEGE_TYPE.DoubleTimesFight)) return end + -- 判断当前倍速 local scale = BattleManager.GetTimeScale() scale = math.floor(scale*10 + 0.5)/10 + if scale == BATTLE_TIME_SCALE_ONE then + -- 一倍速回到二倍速 BattleManager.SetTimeScale(BATTLE_TIME_SCALE_TWO) - elseif scale == BATTLE_TIME_SCALE_TWO then - BattleManager.SetTimeScale(BATTLE_TIME_SCALE_THREE) + elseif scale == BATTLE_TIME_SCALE_TWO then + -- 2倍速时判断是否解锁了3倍速,没解锁就回到1倍速 + if BattleManager.IsUnlockBattleSpeedThree() then + BattleManager.SetTimeScale(BATTLE_TIME_SCALE_THREE) + else + BattleManager.SetTimeScale(BATTLE_TIME_SCALE_ONE) + end elseif scale == BATTLE_TIME_SCALE_THREE then + -- 三倍速回到一倍速 BattleManager.SetTimeScale(BATTLE_TIME_SCALE_ONE) else + -- 其他异常数据回到一倍速 BattleManager.SetTimeScale(BATTLE_TIME_SCALE_ONE) end end) @@ -405,11 +418,11 @@ function this.SetJumpBtnState() local isLock = state ~= SKIP_STATE.UNLOCK -- 战斗跳过按钮显示 this.jumpLock:SetActive(isLock) - if isLock then - - local filter = 1 - (this.curRound - 1)/_NO_JUMP_ROUND - this.jumpLock:GetComponent("Image").fillAmount = filter > 0 and filter or 0 - end + -- 进度展示 + -- if isLock then + -- local filter = 1 - (this.curRound - 1)/_NO_JUMP_ROUND + -- this.jumpLock:GetComponent("Image").fillAmount = filter > 0 and filter or 0 + -- end end @@ -760,7 +773,7 @@ function this.OnRoundChanged(round) this.roundText.text = string.format(Language[10211], curRound, maxRound) -- 设置跳过按钮的状态 - this.SetJumpBtnState() + -- this.SetJumpBtnState() end -- 角色轮转回调 function this.RoleTurnChange(role) From 10b275ea339bae4307973212c84b900ee0b482b5 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Thu, 9 Dec 2021 11:17:47 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E3=80=90=E5=BC=95=E5=AF=BC=E3=80=91?= =?UTF-8?q?=E5=BC=95=E5=AF=BC=E7=B1=BB=E5=9E=8B19=EF=BC=9A=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=88=B03=E5=80=8D=E9=80=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Guide/GuidePanel.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Assets/ManagedResources/~Lua/Modules/Guide/GuidePanel.lua b/Assets/ManagedResources/~Lua/Modules/Guide/GuidePanel.lua index b4feb3997f..a9f1305a79 100644 --- a/Assets/ManagedResources/~Lua/Modules/Guide/GuidePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Guide/GuidePanel.lua @@ -504,6 +504,19 @@ function this.ExecuteBehavior(beType, beArgs) StoryManager.EventTrigger(tonumber(beArgs), function() this.NextGuide() end) + + elseif beType == 19 then -- 三倍速引导,点击直接切换到3倍速 + local btn = Util.GetGameObject(UIManager.uiRoot, beArgs):GetComponent("Button") + this.button:GetComponent("Button").onClick:RemoveAllListeners() + Util.AddClick(this.button, function() + -- 设置战斗3倍速 + BattleManager.SetTimeScale(BATTLE_TIME_SCALE_THREE) + -- + this.NextGuide() + this.button:GetComponent("Button").onClick:RemoveAllListeners() + Util.AddClick(this.button, this.NextGuide) + end) + this.SetBtnGOPosition(btn.gameObject:GetComponent("RectTransform").position) end end From 889a49576c870b3121960b20c5e305a244bff4bd Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Thu, 9 Dec 2021 14:25:02 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E3=80=90=E6=88=98=E6=96=97=E3=80=91=3D?= =?UTF-8?q?=3D=3D=3D=3D=3D=3D=E7=AC=AC=E4=BA=94=E6=9C=9F=E7=A5=9E=E9=AD=82?= =?UTF-8?q?=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/Buff.lua | 1 + .../Modules/Battle/Logic/Base/Passivity.lua | 399 +++++++++++++++++- .../Modules/Battle/Logic/Buff/BreakArmor.lua | 33 ++ .../Battle/Logic/Buff/BreakArmor.lua.meta | 7 + .../Battle/Logic/Misc/BattleDefine.lua | 6 + .../Modules/Battle/Logic/Misc/BattleUtil.lua | 36 +- .../Modules/Battle/View/Unit/BuffCtrl.lua | 26 +- .../Modules/Battle/View/Unit/BuffView.lua | 1 + 8 files changed, 496 insertions(+), 13 deletions(-) create mode 100644 Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/BreakArmor.lua create mode 100644 Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/BreakArmor.lua.meta diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua index 9163929c02..c6afb2ecd1 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua @@ -19,6 +19,7 @@ local BuffRegister = { [BuffName.BanBlood] = "BanBlood", [BuffName.SigilSign] = "SigilSign", [BuffName.CommonSign] = "CommonSign", + [BuffName.BreakArmor] = "BreakArmor", } diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index 2687eb5343..10bb34986f 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -5839,13 +5839,17 @@ local passivityList = { end role.Event:AddEvent(BattleEventName.SkillCastEnd, OnRoleHit,nil,nil,role) end, - -- 每释放[a]次技能,[b]增加[c]%,可叠加[d]次(d 填0为可叠加无数次) - -- a[int] b[int] c[float] d[int] + -- 每释放[a]次技能,[b]增加[c]%,可叠加[d]次(d 填0为可叠加无数次),[e]属性增加[f]%,[g]属性增加[h]% + -- a[int] b[int] c[float] d[int] e[int] f[float] g[int] h[float] (e,g,g h 不填不添加) [262] = function(role, args,id,judge) local num = args[1] local pro = args[2] local val = args[3] local time = args[4] + local p1 = args[5] + local v1 = args[6] + local p2 = args[7] + local v2 = args[8] local releaseNum=0 local addNum=0 -- 释放技能后 @@ -5860,7 +5864,16 @@ local passivityList = { --role.data:AddValue(BattlePropList[pro],val) local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], val,CountTypeName.Add) role:AddBuff(buff) + if p1~=nil and v1~=nil then + local buff1 = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[p1], v1,CountTypeName.Add) + role:AddBuff(buff1) + end + if p2~=nil and v2~=nil then + local buff2 = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[p2], v2,CountTypeName.Add) + role:AddBuff(buff2) + end addNum=addNum+1 + end end end @@ -10169,6 +10182,388 @@ local passivityList = { role.Event:AddEvent(BattleEventName.BuffCaster, OnBuffStart,nil,nil,role) end, + --被自身添加[a]类型[b]效果的目标,有[c]%概率无法改变[d]怒气 + --a[int],b[int],c[float] + [402]=function(role, args,id,judge) + local t1=args[1] + local t2=args[2] + local pro=args[3] + local ct=args[4] + local onRageChange=function(func,caster,target,value,type) + if target.camp==role.camp then + return + end + if ct~=type then + return + end + if BattleLogic.BuffMgr:HasBuff(target, t1, function (buff) return buff.damageType == t2 and buff.caster==role end ) then + BattleUtil.RandomAction(pro,function() + if func then + func(0) + end + end) + end + end + BattleLogic.Event:AddEvent(BattleEventName.ChangeRoleRage,onRageChange,nil,nil,role) + + end, + --暴击伤害改变[a] [b]%+[c]%*([d]+目标身上[e]类型[f]状态buff层数) + --a[int],b[float],c[float],d[int],e[int],f[int] + [403]=function(role,args,id,judge) + local ct=args[1] + local v1=args[2] + local v2=args[3] + local v3=args[4] + local t1=args[5] + local t2=args[6] + + local addCritDamageFa=function(func,atkRole,defRole) + local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.target==defRole and buff.type==t1 and buff.damageType==t2 end) + local len=BattleUtil.LengthOfTable(list) + if func then + func(v1+v2*(v3+len),ct) + end + end + role.Event:AddEvent(BattleEventName.PassiveAddCritDamageFactor,addCritDamageFa,nil,nil,role) + end, + --直接伤害攻击的目标不足[a]人,爆伤改变[b][c]%,目标达到[d]人额外增加自身[e]点怒气 + --a[int],b[int],c[float],d[int],e[int] + [404]=function(role,args,id,judge) + local v1=args[1] + local ct=args[2] + local v2=args[3] + local v3=args[4] + local v4=args[5] + + local addCritDamageFa=function(func,atkRole,defRole,skill) + if not skill then + return + end + local list = skill:GetDirectTargetsNoExile() + if #list=v3 then + BattleUtil.CalRage(role,role,v4,CountTypeName.Add) + end + end + role.Event:AddEvent(BattleEventName.SkillCastEnd,onSkillEnd,nil,nil,role) + end, + --敌方处于[a]类型[b]状态的单位死亡,自身立即获得全场[c]状态[d]类型buff层数*[e]的怒气 + --a[int],b[int],c[int],d[int],e[float] + [405]=function(role,args,id,judge) + local t1=args[1] + local t2=args[2] + local t3=args[3] + local t4=args[4] + local v1=args[5] + local onRoleDead=function(defRole, atkRole) + + if defRole and defRole.camp==role.camp then + return + end + if BattleLogic.BuffMgr:HasBuff(defRole, t1, function (buff) return buff.damageType == t2 end ) then + local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.type==t1 and buff.damageType==t2 end) + local len=BattleUtil.LengthOfTable(list) + local num= floor(v1*len) + BattleUtil.CalRage(role,role,num,CountTypeName.Add) + end + end + BattleLogic.Event:AddEvent(BattleEventName.BattleRoleDead,onRoleDead,nil,nil,role) + end, + --第[a]回合必定命中 + --a[int] + [406]=function(role,args,id,judge) + local v1=args[1] + local lastHit=false + BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, function(curRound) + -- 第i1回合开始 + if curRound == v1 then + lastHit=role.mustHit + role.mustHit=true + end + -- 第i1+i2回合结束 + if curRound == v1+1 then + role.mustHit=lastHit + end + end,nil,nil,role) + end, + --每次释放技能触发一次[a]类型[b]状态,无视目标[a]%的护甲和[b]%的减伤,期间被控制破解状态解除,破甲叠到[c]层后破甲不可解除 + -- a[int],b[int],c[float],d[float],e[int] + [407]=function(role,args,id,judge) + local t1=args[1] + local t2=args[2] + local v1=args[3] + local v2=args[4] + local num=args[5] + --添加破甲 + local onSkillCastEnd=function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end + if skill.type~=BattleSkillType.Special and skill.type~=BattleSkillType.Extra and skill.type~=BattleSkillType.DeadSkill then + return + end + local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.target==role and buff.type==t1 and buff.signType==t2 end) + local len=BattleUtil.LengthOfTable(list) + if len>=num then + return + end + local buff=Buff.Create(role,t1,0,t2) + role:AddBuff(buff) + end + role.Event:AddEvent(BattleEventName.SkillCastEnd,onSkillCastEnd,nil,nil,role) + + --移除破甲 + local buffBeAdd=function(buff) + if buff.type== BuffName.Control then + local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.target==role and buff.type==t1 and buff.signType==t2 end) + local len=BattleUtil.LengthOfTable(list) + if len>=num then + return + end + BattleLogic.BuffMgr:ClearBuff(role, function(buff) + return buff.type==t1 and buff.signType==t2 + end) + end + end + role.Event:AddEvent(BattleEventName.BuffBeAdd, buffBeAdd,nil,nil,role) + + local ignoreDef=function(func) + if BattleLogic.BuffMgr:HasBuff(role,t1, function (buff) return buff.signType==t2 end ) then + if func then + func(v1,CountTypeName.Add) + end + end + end + role.Event:AddEvent(BattleEventName.PassiveChangeIgnoreDef,ignoreDef,nil,nil,role) + + local addDMGFac=function(func) + if BattleLogic.BuffMgr:HasBuff(role,t1, function (buff) return buff.signType==t2 end ) then + if func then + func(v2,CountTypeName.Add) + end + end + end + role.Event:AddEvent(BattleEventName.PassiveChangeAddDMGFac,addDMGFac,nil,nil,role) + end, + --被自身添加[a]类型[b]效果的目标,己方[c]系神将对其暴击率改变[d][e]%,命中改变[f][g]% + --a[int],b[int],c[int],d[int],e[float],f[float] + [408]=function(role, args,id,judge) + local t1 = args[1] + local t2 = args[2] + local ele = args[3] + local ct = args[4] + local v1 = args[5] + local ct2 = args[6] + local v2 = args[7] + local changeCrit=function(func,atkRole,defRole,skill) + if atkRole.camp~=role.camp or atkRole.element~=ele then + return + end + if not BattleLogic.BuffMgr:HasBuff(defRole, t1, function (buff) return buff.ctrlType==t2 and buff.caster==role end) then + return + end + if func then + func(v1,ct) + end + end + BattleLogic.Event:AddEvent(BattleEventName.TemporaryChangeCrit,changeCrit,nil,nil,role) + + local changeRoleHit=function(func,atkRole,defRole) + if atkRole.camp~=role.camp or atkRole.element~=ele then + return + end + if not BattleLogic.BuffMgr:HasBuff(defRole, t1, function (buff) return buff.ctrlType==t2 and buff.caster==role end) then + return + end + if func then + func(v2,ct2) + end + end + BattleLogic.Event:AddEvent(BattleEventName.PassiveChangeRoleHit,changeRoleHit,nil,nil,role) + end, + --释放技能后有本次被添加[a]类型[b]效果的目标数量*10/100的几率 额外控制[c]属性最[d]且没被控制的目标[e]回合 + --a[int],b[int],c[int],d[int 0:高 1:低] + [409]=function(role, args,id,judge) + local t1=args[1] + local t2=args[2] + local p1=args[3] + local sort=args[4] + local r1=args[5] + local onCastEnd=function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end + if skill.type~=BattleSkillType.Special and skill.type~=BattleSkillType.Extra and skill.type~=BattleSkillType.DeadSkill then + return + end + local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.caster==role and buff.type==t1 and buff.ctrlType==t2 and buff.startRound == BattleLogic.GetCurRound() end) + local len=BattleUtil.LengthOfTable(list) + + if len>0 then + local list=RoleManager.Query(function(target) + if not BattleLogic.BuffMgr:HasBuff(target, t1, function (buff) return buff.ctrlType==t2 end) then + return true + end + end) + if #list>0 then + list = BattleUtil.SortByProp(list, BattlePropList[p1],sort) + if list[1]~=nil then + BattleUtil.RandomControl(len*10/100,t2,role,list[1],r1) + end + end + end + end + role.Event:AddEvent(BattleEventName.SkillCastEnd,onCastEnd,nil,nil,role) + end, + --每次释放技能给敌方所有未处于控制[a]类型的敌人添加[b]类型[c]状态效果,每层效果提高控制概率[d]%,(效果最多叠加[e]层)被控制后状态消失,每层消失额外造成目标[f]属性[g]%的伤害 + --a[int],b[int],c[int],d[float],e[int],f[int],g[float] + [410]=function(role,args,id,judge) + local t1=args[1] + local t2=args[2] + local t3=args[3] + local p1=args[4] + local num=args[5] + local pro=args[6] + local v1=args[7] + --添加buff + local onCastEnd=function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end + if skill.type~=BattleSkillType.Special and skill.type~=BattleSkillType.Extra and skill.type~=BattleSkillType.DeadSkill then + return + end + local list=RoleManager.Query(function(target) + if not BattleLogic.BuffMgr:HasBuff(target, BuffName.Control, function (buff) return buff.ctrlType==t1 end) and target.camp~=role.camp then + return true + end + end) + if #list>0 then + for i = 1, #list do + local list2=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.type==t2 and buff.signType==t3 end) + local len=BattleUtil.LengthOfTable(list2) + if len0 then + if func then + func(p1*len,CountTypeName.Add) + end + end + end + BattleLogic.Event:AddEvent(BattleEventName.PassiveBeRandomControl,changeRoleHit,nil,nil,role) + + --移除破甲 + local buffBeAdd=function(caster,target,buff) + if caster.camp==role.camp and buff.type== BuffName.Control and buff.ctrlType==t1 then + BattleLogic.BuffMgr:ClearBuff(target, function(buff) + return buff.type==t2 and buff.signType==t3 + end) + end + end + BattleLogic.Event:AddEvent(BattleEventName.RecordBuff, buffBeAdd,nil,nil,role) + + local onBuffEnd=function(buff) + if buff.caster==role and buff.type==t2 and buff.signType==t3 then + local isBoss=BattleUtil.CheckIsBoss(buff.target) + if isBoss and pro==12 then + return + end + local damage=floor(BattleUtil.FP_Mul(v1, buff.target:GetRoleData(BattlePropList[pro]))) + BattleUtil.FinalDamageCountShield(nil,role,buff.target,damage) + end + end + BattleLogic.Event:AddEvent(BattleEventName.BuffEnd,onBuffEnd,nil,nil,role) + end, + --每次释放技能未被添加[a]类型[b]效果的敌方,添加[c]类型[d]效果,每层效果添加概率改变[e][f]%,被控制后清除效果 + --a[int],b[int],c[int],d[int],e[int],f[flaot] + [411]=function(role,args,id,judge) + local t1=args[1] + local t2=args[2] + local t3=args[3] + local t4=args[4] + local ct=args[5] + local v1=args[6] + --添加buff + local onCastEnd=function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end + if skill.type~=BattleSkillType.Special and skill.type~=BattleSkillType.Extra and skill.type~=BattleSkillType.DeadSkill then + return + end + local list=RoleManager.Query(function(target) + if not BattleLogic.BuffMgr:HasBuff(target,t1, function (buff) return buff.ctrlType==t2 end) and target.camp~=role.camp then + return true + end + end) + if #list>0 then + for i = 1, #list do + local buff=Buff.Create(role,t3,0,t4) + list[i]:AddBuff(buff) + end + end + end + role.Event:AddEvent(BattleEventName.SkillCastEnd,onCastEnd,nil,nil,role) + + --增加命中 + local changeRoleHit=function(func,ctrl,atkRole,defRole) + if ctrl~=t2 then + return + end + if atkRole.camp~=role.camp then + return + end + local list2=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.type==t3 and buff.signType==t4 end) + local len=BattleUtil.LengthOfTable(list2) + if len>0 then + if func then + func(v1*len,ct) + end + end + end + BattleLogic.Event:AddEvent(BattleEventName.PassiveBeRandomControl,changeRoleHit,nil,nil,role) + + --移除破甲 + local buffBeAdd=function(caster,target,buff) + if caster.camp==role.camp and buff.type== t1 and buff.ctrlType==t2 then + BattleLogic.BuffMgr:ClearBuff(target, function(buff) + return buff.type==t3 and buff.signType==t4 + end) + end + end + BattleLogic.Event:AddEvent(BattleEventName.RecordBuff, buffBeAdd,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 new file mode 100644 index 0000000000..719b504691 --- /dev/null +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/BreakArmor.lua @@ -0,0 +1,33 @@ +BreakArmor = Buff:New() + +--初始化Buff,通过传入一些自定义参数控制成长相关的数值 +function BreakArmor:SetData(...) + self.signType=... + -- 刷新排序等级 + self.sort = 4 +end + + +--初始化后调用一次 +function BreakArmor:OnStart() + + +end + +--间隔N帧触发,返回true时表示继续触发,返回false立刻触发OnEnd +function BreakArmor:OnTrigger() + return true +end + +--效果结束时调用一次 +function BreakArmor:OnEnd() + + +end + +--只有当cover字段为true时触发,返回true则被新效果覆盖 +function BreakArmor:OnCover(newBuff) + return true +end + +return BreakArmor \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/BreakArmor.lua.meta b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/BreakArmor.lua.meta new file mode 100644 index 0000000000..c2c83a9069 --- /dev/null +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/BreakArmor.lua.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9198aba4ca48104459b33d94513390b6 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleDefine.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleDefine.lua index 6ac45927f3..a3b4dbe402 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleDefine.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleDefine.lua @@ -190,6 +190,11 @@ BattleEventName = { PassiveAddCritDamageFactor = indexAdd(), --被动增加爆伤系数 PassiveChangeIgnoreImmuneValue = indexAdd(),--被动修改无视 ImmuneDebuffSuccess = indexAdd(),--免疫debuff成功 + ChangeRoleRage = indexAdd(),--改变角色怒气 + PassiveChangeIgnoreDef = indexAdd(),--被动改变无视防御比例 + PassiveChangeAddDMGFac = indexAdd(),--被动改变增伤比例 + PassiveChangeRoleHit = indexAdd(),--被动改变角色命中 + } BattleMaxFrame = 1000000 @@ -272,6 +277,7 @@ BuffName = { BanBlood = 14, SigilSign = 15, CommonSign = 16, + BreakArmor = 17, } DotType = { diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua index 970680500d..eb7b699d46 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -703,11 +703,18 @@ function BattleUtil.CalRage(caster, target, value, countType,isBorrow) if (countType==3 or countType==4) and target.RoundMaxSubRage~=0 and value+target.AllSubRage>target.RoundMaxSubRage then value=target.RoundMaxSubRage-target.AllSubRage end + local changeRage=function(num) + value=num + end + BattleLogic.Event:DispatchEvent(BattleEventName.ChangeRoleRage,changeRage,caster,target,value,countType) -- 操作怒气 local deltaRage = target:AddRage(value, countType) if (countType==3 or countType==4) and target.RoundMaxSubRage~=0 then target.AllSubRage=target.AllSubRage-deltaRage end + if value==0 then + return + end caster.Event:DispatchEvent(BattleEventName.RecordRageChange, caster, target, deltaRage,countType,value,lastRage,isBorrow) BattleLogic.Event:DispatchEvent(BattleEventName.RecordRageChange, caster, target, deltaRage,countType,value,lastRage,isBorrow) -- 用于记录统计 @@ -972,17 +979,26 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i else defence = defRole:GetRoleData(RoleDataName.MagicDefence) end + if ignoreDef==nil then + ignoreDef=0 + end -- 攻击力 local attack = atkRole:GetRoleData(RoleDataName.Attack)+atkRole.addAttack + local ignoreFunc=function(v1,ct) + ignoreDef=BattleUtil.CountValue(ignoreDef,v1,ct) + end + atkRole.Event:DispatchEvent(BattleEventName.PassiveChangeIgnoreDef,ignoreFunc) -- 无视防御系数 ignoreDef = 1 - (ignoreDef or 0) -- 基础伤害 = 攻击力 - 防御力 baseDamage = max(attack - BattleUtil.FP_Mul(2,defence, ignoreDef), 0) - -- 基础伤害增加系数 local addDamageFactor = 1 + atkRole:GetRoleData(RoleDataName.DamageBocusFactor) - defRole:GetRoleData(RoleDataName.DamageReduceFactor) - + local addDMGFac=function(v1,ct) + addDamageFactor=BattleUtil.CountValue(addDamageFactor,v1,ct) + end + atkRole.Event:DispatchEvent(BattleEventName.PassiveChangeAddDMGFac,addDMGFac) -- 计算暴伤害系数 local critDamageFactor = 1 local critDamageReduceFactor = 0 -- 暴击伤害减免 @@ -995,9 +1011,9 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i table.insert(cl, {v, ct}) end end - atkRole.Event:DispatchEvent(BattleEventName.CritDamageReduceFactor, onCritDamageReduceFactor, atkRole, defRole) - defRole.Event:DispatchEvent(BattleEventName.CritDamageReduceFactor, onCritDamageReduceFactor, atkRole, defRole) - BattleLogic.Event:DispatchEvent(BattleEventName.CritDamageReduceFactor, onCritDamageReduceFactor, atkRole, defRole) + atkRole.Event:DispatchEvent(BattleEventName.CritDamageReduceFactor, onCritDamageReduceFactor, atkRole, defRole,skill) + defRole.Event:DispatchEvent(BattleEventName.CritDamageReduceFactor, onCritDamageReduceFactor, atkRole, defRole,skill) + BattleLogic.Event:DispatchEvent(BattleEventName.CritDamageReduceFactor, onCritDamageReduceFactor, atkRole, defRole,skill) critDamageReduceFactor = max(BattleUtil.CountChangeList(critDamageReduceFactor, cl), 0) local critDamageAddFactor=0 @@ -1008,7 +1024,7 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i table.insert(cl2, {v, ct}) end end - atkRole.Event:DispatchEvent(BattleEventName.PassiveAddCritDamageFactor, onCritDamageAddFactor, atkRole, defRole) + atkRole.Event:DispatchEvent(BattleEventName.PassiveAddCritDamageFactor, onCritDamageAddFactor, atkRole, defRole,skill) critDamageAddFactor = max(BattleUtil.CountChangeList(critDamageAddFactor, cl2), 0) -- 计算额外暴击伤害 critDamageFactor = 1.3 + atkRole:GetRoleData(RoleDataName.CritDamageBonus) - defRole:GetRoleData(RoleDataName.CritDamageReduce)+critDamageAddFactor - critDamageReduceFactor @@ -1221,7 +1237,12 @@ function BattleUtil.CheckIsHit(atkRole, defRole,skill) mustHit=false end local hitRandom = Random.Range01() - local hitCondition = clamp(atkRole:GetRoleData(RoleDataName.Hit) - defRole:GetRoleData(RoleDataName.Dodge), 0, 1) + local addHit=0 + local addHitFunc=function(v1,ct) + addHit=BattleUtil.CountValue(addHit,v1,ct) + end + BattleLogic.Event:DispatchEvent(BattleEventName.PassiveChangeRoleHit,addHitFunc,atkRole,defRole) + local hitCondition = clamp(atkRole:GetRoleData(RoleDataName.Hit)+addHit - defRole:GetRoleData(RoleDataName.Dodge), 0, 1) isHit = hitRandom <= hitCondition return mustHit or isHit end @@ -1271,6 +1292,7 @@ function BattleUtil.RandomControl(rand, ctrl, caster, target, round,skill) end caster.Event:DispatchEvent(BattleEventName.PassiveRandomControl, _CallBack, ctrl, target) target.Event:DispatchEvent(BattleEventName.PassiveBeRandomControl, _CallBack, ctrl, target) + BattleLogic.Event:DispatchEvent(BattleEventName.PassiveBeRandomControl, _CallBack, ctrl,caster,target) rand = BattleUtil.CountChangeList(rand, cl) local buff = Buff.Create(caster, BuffName.Control, round, ctrl) local isAdd=BattleUtil.RandomAction(rand, function() diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffCtrl.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffCtrl.lua index 989c48c17d..b48d557971 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffCtrl.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffCtrl.lua @@ -14,6 +14,7 @@ local BuffTypeToConfigType = { [BuffName.BanBlood] = 11, [BuffName.SigilSign] = 12, [BuffName.CommonSign] = 13, + [BuffName.BreakArmor] = 14, } local function _GetPropChangeBuffCType(pName) for cType, pn in ipairs(BattlePropList) do @@ -57,8 +58,11 @@ local function _GetBuffEffectConfig(buff) elseif bType==BuffName.SigilSign then cType = 1 elseif bType==BuffName.CommonSign then - cType = 1 - + cType = 1 + elseif bType==BuffName.BreakArmor then + cType=buff.signType + else + cType = 1 end local type = BuffTypeToConfigType[bType] @@ -242,6 +246,11 @@ function BuffCtrl:AddBuffIcon(buff, icon) self.BuffIconList[key]:SetCount(self.BuffIconList[key].count+1) return end + elseif buffType ==BuffName.BreakArmor then + if self.BuffIconList[key].buffSignType==currBuff.signType then + self.BuffIconList[key]:SetCount(self.BuffIconList[key].count+1) + return + end end end end @@ -333,8 +342,17 @@ function BuffCtrl:RemoveBuffIcon(buff) return end elseif buffType == BuffName.Curse then - if self.BuffIconList[key].curseType==buff.curseType then - + if self.BuffIconList[key].curseType==buff.curseType then + if floor==1 then + self.BuffIconList[key]:Dispose() + self.BuffIconList[key] = nil + else + self.BuffIconList[key]:SetCount(floor-1) + end + return + end + elseif buffType == BuffName.BreakArmor then + if self.BuffIconList[key].buffSignType==buff.signType then if floor==1 then self.BuffIconList[key]:Dispose() self.BuffIconList[key] = nil diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffView.lua index 37ccf9f3b2..d69767edd2 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffView.lua @@ -16,6 +16,7 @@ function BuffView.New(go, buff, icon) instance.healValue = buff.healValue instance.immuneType = buff.immuneType instance.curseType = buff.curseType + instance.buffSignType = buff.signType instance.levelText = Util.GetGameObject(go, "level"):GetComponent("Text") instance.layerText = Util.GetGameObject(go, "layer"):GetComponent("Text") instance.roundText = Util.GetGameObject(go, "round"):GetComponent("Text") From 6f3774c030c0f8e3d075508b4a7041dce15e020a Mon Sep 17 00:00:00 2001 From: gaoxin Date: Thu, 9 Dec 2021 18:04:29 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E3=80=90=E4=BA=91=E6=A2=A6=E7=A5=88?= =?UTF-8?q?=E7=A6=8F=E3=80=91=E4=B8=8D=E5=86=8D=E8=AF=B7=E6=B1=82=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/ActivityGift/ActivityGiftManager.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua b/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua index 6ebbc4905f..6c4f6a2cf4 100644 --- a/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/ActivityGift/ActivityGiftManager.lua @@ -234,10 +234,10 @@ end function this.CheckActiveIsOpen(data) local globalActivityData = GlobalActivity[data.activityId] if globalActivityData then - if globalActivityData.Type == ActivityTypeDef.Pray then - --云梦活动开启 请求数据 - NetManager.InitPrayDataRequest() - end + -- if globalActivityData.Type == ActivityTypeDef.Pray then + -- --云梦活动开启 请求数据 + -- NetManager.InitPrayDataRequest() + -- end end end From ffe01ddf1619a30414b28ce5e1f98270204da1be Mon Sep 17 00:00:00 2001 From: gaoxin Date: Thu, 9 Dec 2021 18:05:47 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E3=80=90=E5=BC=95=E5=AF=BC=E6=88=98?= =?UTF-8?q?=E6=96=97=E3=80=91=E6=B7=BB=E5=8A=A0=E6=A0=B9=E6=8D=AE=E4=B8=BB?= =?UTF-8?q?=E8=A7=92=E9=87=8A=E6=94=BE=E6=8A=80=E8=83=BD=E6=AC=A1=E6=95=B0?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=AF=B9=E8=AF=9D=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Battle/View/BattleView.lua | 9 ++++ .../Modules/Battle/View/GuideBattleLogic.lua | 41 +++++++++++++++++++ .../Modules/Battle/View/GuideBattlePanel.lua | 6 +++ 3 files changed, 56 insertions(+) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua index 0bf3d03cfb..0b011f8152 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua @@ -420,6 +420,7 @@ function this.InitBattleEvent() BattleLogic.Event:AddEvent(BattleEventName.BattleRoundEnd, this.BattleRoundEnd) BattleLogic.Event:AddEvent(BattleEventName.RoleTurnStart, this.RoleTurnChange) BattleLogic.Event:AddEvent(BattleEventName.BattleStart, this.OnBattleStart) + BattleLogic.Event:AddEvent(BattleEventName.SkillCastEnd, this.OnSkillCastEnd) end -- 清除战斗数据 @@ -435,6 +436,7 @@ function this.ClearBattleEvent() BattleLogic.Event:RemoveEvent(BattleEventName.BattleRoundEnd, this.BattleRoundEnd) BattleLogic.Event:RemoveEvent(BattleEventName.RoleTurnStart, this.RoleTurnChange) BattleLogic.Event:RemoveEvent(BattleEventName.BattleStart, this.OnBattleStart) + BattleLogic.Event:RemoveEvent(BattleEventName.SkillCastEnd, this.OnSkillCastEnd) end --敌军出现的表现 @@ -505,6 +507,13 @@ function this.OnBattleStart() this.root.OnBattleStart() end end +-- 技能释放完成 +function this.OnSkillCastEnd(skill) + -- 回调UI层 + if this.root.OnSkillCastEnd then + this.root.OnSkillCastEnd(skill) + end +end -- 角色轮转回调(不出手的位置不会回调) function this.RoleTurnChange(role) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattleLogic.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattleLogic.lua index 215cae4a9d..b6a6b0695e 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattleLogic.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattleLogic.lua @@ -6,6 +6,7 @@ function GuideBattleLogic:Init(guideType) end self.guideType = guideType self.configList = ConfigManager.TryGetAllConfigsDataByKey(ConfigName.GuideBattleConfig, "GuideGroup", self.guideType) + self.PlayerSkillCount = {} -- 主角释放技能次数计数器 end @@ -140,4 +141,44 @@ function GuideBattleLogic:OnBattleEnd(func) end end +-- +function GuideBattleLogic:OnSkillCastEnd(skill) + -- 这里只判断主角技能 + if skill.owner.position ~= 100 then + return + end + if not self.PlayerSkillCount[skill.owner.camp] then + self.PlayerSkillCount[skill.owner.camp] = 0 + end + -- 释放技能次数+1 + self.PlayerSkillCount[skill.owner.camp] = self.PlayerSkillCount[skill.owner.camp] + 1 + + -- 没有就不引导了 + if not self.configList or #self.configList <= 0 then + return + end + local _config = nil + for _, con in ipairs(self.configList) do + -- 主角释放技能次数判断 + if con.Round == -4 and con.Camp == skill.owner.camp and con.Turn == self.PlayerSkillCount[skill.owner.camp] then + _config = con + break + end + end + if not _config then + return + end + -- 对话形式的引导 + if _config.TriggerType == 1 then + BattleManager.SetGuidePause(true) + local storyId = _config.TriggerId + StoryManager.EventTrigger(storyId, function() + BattleManager.SetGuidePause(false) + if func then + func() + end + end) + end +end + return GuideBattleLogic \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattlePanel.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattlePanel.lua index b6c5736a5b..91bb6d728e 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattlePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/GuideBattlePanel.lua @@ -170,6 +170,12 @@ function this.OnBattleStart(order) GuideBattleLogic:OnBattleStart() end +-- 技能释放完成 +function this.OnSkillCastEnd(skill) + -- + GuideBattleLogic:OnSkillCastEnd(skill) +end + function this.OnOrderChanged(order) --显示波次 From 836d21630915b99495b283e1f4bee5f49f94b698 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Fri, 10 Dec 2021 09:57:08 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E3=80=90=E6=88=98=E6=96=97=E3=80=91?= =?UTF-8?q?=E4=B8=BB=E8=A7=92=E5=87=BA=E7=8E=B0=E5=9C=A8=E6=88=98=E6=96=97?= =?UTF-8?q?=E4=B8=AD=E6=97=B6=E7=BC=BA=E5=B0=91=E5=8A=A8=E7=94=BB=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Battle/View/Unit/PlayerView.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua index 15217264d8..9187ca9d6d 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/PlayerView.lua @@ -387,6 +387,9 @@ end -- 播放动画 function PlayerView:PlaySpineAnim(gog, time, name, isLoop) + if startWith(gog.gameObject.name, "live2d_npc") then + return + end if isLoop then self.currAniName=name gog.AnimationState:SetAnimation(time, name, isLoop) From 33d25289b38314c96c3e34dd54d5c7bc186698f1 Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Fri, 10 Dec 2021 11:52:10 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E3=80=90=E6=88=98=E6=96=97=E3=80=91=3D?= =?UTF-8?q?=3D=3D=3D=3D=3D=3D=E5=8F=98=E8=BA=AB=E5=8D=A1=E6=8A=80=E8=83=BD?= =?UTF-8?q?=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 | 53 +++++++++++++++++++ .../Modules/Battle/Logic/Base/Passivity.lua | 27 +++++++--- .../~Lua/Modules/Battle/Logic/Buff/Shield.lua | 26 +++++++++ .../Battle/Logic/Misc/BattleDefine.lua | 1 + .../Modules/Battle/Logic/Misc/BattleUtil.lua | 17 +++++- .../Modules/Battle/Logic/Role/RoleManager.lua | 17 ++++++ 6 files changed, 132 insertions(+), 9 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Effect.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Effect.lua index 4124f28ebf..70c966b18b 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Effect.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Effect.lua @@ -2814,6 +2814,59 @@ local effectList = { BattleUtil.FinalTreat(caster,target,treat,1,skill) end) end, + --对目标造成神佑状态,造成目标[a]属性[b]%的治疗,持续[c]回合,溢出的治疗量转化为御甲 + --a[int],b[float],c[int] + [144] = function(caster, target, args, interval, skill) + local p1 = args[1] + local v1 = args[2] + local round = args[3] + + BattleLogic.WaitForTrigger(interval, function () + local damage=floor(target:GetRoleData(p1)*v1) + local buff=Buff.Create(caster,BuffName.HOT,round,1,damage) + buff.hotType=2 + target:AddBuff(buff) + end) + end, + --为我方添加反伤盾,护盾类型为[a],护盾值为[b]%,持续[c]回合 + --a[int],b[float],c[int] + [145] = function(caster, target, args, interval, skill) + local type = args[1] + local v1 = args[2] + local r1 = args[3] + BattleLogic.WaitForTrigger(interval, function () + + target:AddBuff(Buff.Create(caster, BuffName.Shield,r1,type,v1)) + end) + end, + --对目标造成自身[a]*[b]%的伤害,目标每减少[c]个伤害增加[d]%, + --a[int],b[int],c[int],d[float] + [146] = function(caster, target, args, interval, skill) + local pro = args[1] + local v1 = args[2] + local i1 = args[3] + local v2 = args[4] + BattleLogic.WaitForTrigger(interval, function () + + local isBoss=BattleUtil.CheckIsBoss(target) + if isBoss then + return + 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 * v2) + local damage=floor(target:GetRoleData(pro)*(v1+extra)) + BattleUtil.FinalDamageCountShield(nil,caster, target,damage) + end) + end, + [147]=function(caster, target, args, interval, skill) + target.isRealDead=true + target:SetRelive(1, caster) + end, + } diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index 10bb34986f..b54b6a3577 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -3241,16 +3241,16 @@ local passivityList = { if not type then type=0 end - local onBeSkillCastEnd = function(skill) - if type==0 and skill.type~=BattleSkillType.Normal then + local onBeSkillCastEnd = function(atkRole, damage, bCrit, finalDmg, damageType, skill) + if type==0 and (skill.type~=BattleSkillType.Normal and skill.type~=BattleSkillType.ChaosNormal) then return end if type==1 and skill.type~=BattleSkillType.Special and skill.type~=BattleSkillType.Extra and skill.type~=BattleSkillType.DeadSkill then return end - BattleUtil.CalRage(role, skill.owner, i1, CountTypeName.Sub) + BattleUtil.CalRage(role, atkRole, i1, CountTypeName.Sub) end - role.Event:AddEvent(BattleEventName.BeSkillCastEnd, onBeSkillCastEnd,nil,nil,role) + role.Event:AddEvent(BattleEventName.RoleBeHit, onBeSkillCastEnd,nil,nil,role) end, @@ -10259,27 +10259,40 @@ local passivityList = { end role.Event:AddEvent(BattleEventName.SkillCastEnd,onSkillEnd,nil,nil,role) end, - --敌方处于[a]类型[b]状态的单位死亡,自身立即获得全场[c]状态[d]类型buff层数*[e]的怒气 - --a[int],b[int],c[int],d[int],e[float] + --敌方处于[a]类型[b]状态的单位死亡,自身立即获得全场[c]状态[d]类型buff层数*[e]的怒气,每回合触发[f]次 + --a[int],b[int],c[int],d[int],e[float],f[int] [405]=function(role,args,id,judge) local t1=args[1] local t2=args[2] local t3=args[3] local t4=args[4] local v1=args[5] + local time=args[6] + if args[6]==nil then + time=1 + end + local triggerTime=0 local onRoleDead=function(defRole, atkRole) if defRole and defRole.camp==role.camp then return end if BattleLogic.BuffMgr:HasBuff(defRole, t1, function (buff) return buff.damageType == t2 end ) then + if triggerTime>=time then + return + end local list=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.type==t1 and buff.damageType==t2 end) local len=BattleUtil.LengthOfTable(list) local num= floor(v1*len) BattleUtil.CalRage(role,role,num,CountTypeName.Add) + triggerTime=triggerTime+1 end end BattleLogic.Event:AddEvent(BattleEventName.BattleRoleDead,onRoleDead,nil,nil,role) + local onRoundChange=function() + triggerTime=0 + end + BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange,onRoundChange,nil,nil,role) end, --第[a]回合必定命中 --a[int] @@ -10452,7 +10465,7 @@ local passivityList = { end) if #list>0 then for i = 1, #list do - local list2=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.type==t2 and buff.signType==t3 end) + local list2=BattleLogic.BuffMgr:GetAllBuffByFunc(function(buff) return buff.type==t2 and buff.signType==t3 and buff.target==list[i] end) local len=BattleUtil.LengthOfTable(list2) if len0 then arr=RoleManager.GetNeighbor(list[1], chooseType) end - elseif chooseWeight ==15 then --敌方 - -- body + elseif chooseWeight ==15 then --我方阵亡 + + local aaa=RoleManager.GetDeadRole(role.camp) + if aaa~=nil then + --LogError(aaa.position) + end + aaa.isRealDead=false + table.insert(arr,aaa) + -- return aaa end local finalArr = {} if num == 0 then @@ -617,6 +624,9 @@ end -- 计算真实伤害 function BattleUtil.ApplyDamage(skill, atkRole, defRole, damage, bCrit, damageType, dotType,isDirect) + if defRole==nil then + return + end -- 灵兽无效 if defRole.type == BattleUnitType.Monster or defRole.type == BattleUnitType.Player then return @@ -1092,6 +1102,9 @@ end --没有暴击得治疗 function BattleUtil.CalTreatNoCrit(castRole, targetRole, value, baseFactor,skill) -- 灵兽无效 + if targetRole==nil then + return + end if targetRole.type == BattleUnitType.Monster or targetRole.type == BattleUnitType.Player then return end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleManager.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleManager.lua index 0e6442b73a..8ae289047b 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleManager.lua @@ -7,6 +7,10 @@ local _DeadRoleList = {} local _ReliveRoleList = {} -- 所有角色 local PosList = {} + + +local RealDeadList={} + -- 删除节点 local removeObjList = BattleList.New() -- 角色对象池 @@ -83,6 +87,16 @@ end function this.AddDeadRole(role) _DeadRoleList[role.position + role.camp * 6] = role end +function this.GetDeadRole(type) + if RealDeadList and #RealDeadList>0 then + for i = 1, #RealDeadList do + if RealDeadList[i].camp==type then + return RealDeadList[i] + end + end + end +end + function this.RemoveDeadRole(role) if _DeadRoleList[role.position + role.camp * 6] then @@ -101,8 +115,10 @@ function this.CheckDead() end end for _, pos in ipairs(removePos) do + table.insert(RealDeadList,_DeadRoleList[pos]) _DeadRoleList[pos] = nil end + return isDeadFrame end @@ -411,6 +427,7 @@ function this.Clear() _DeadRoleList = {} _ReliveRoleList = {} + RealDeadList = {} end -- 多波 From 9ec7d07fbb8231c2f71232d5a2fa4bcb8f589848 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Fri, 10 Dec 2021 11:58:42 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E3=80=90=E8=BA=AB=E5=A4=96=E5=8C=96?= =?UTF-8?q?=E8=BA=AB=E5=89=A7=E6=83=85=E3=80=91=E5=AD=99=E6=82=9F=E7=A9=BA?= =?UTF-8?q?=E5=8F=AF=E9=85=8D=E7=BD=AE=E4=B8=BA=E4=B8=BB=E8=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Battle/BattleManager.lua | 10 ++- .../Modules/Battle/View/Unit/MonsterView.lua | 67 ++++++++++--------- 2 files changed, 42 insertions(+), 35 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua index 8eb0cf5afd..57eb4928f4 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua @@ -175,6 +175,7 @@ end --获取怪物数据(战斗用) function this.GetMonsterData(monsterId) + LogRed("GetMonsterData :"..monsterId) local monsterConfig = MonsterConfig[monsterId] return { roleId = monsterConfig.MonsterId, @@ -676,11 +677,16 @@ function this.GetMonsterDataFromGroup(gId, camp) list[i] = this.PokemonUnitAdapter(mUnit, camp) end end - -- 主角 + -- 技能 local RoleSkills = MonsterGroup[gId].Role if RoleSkills and #RoleSkills > 0 then + -- 主角ID + local CharacterId = MonsterGroup[gId].CharacterId + if not CharacterId or CharacterId == 0 then + CharacterId = 20100 + end local mUnit = { - unitId = 20100, + unitId = CharacterId, position = 100, star = 1, playerSex = NameManager.roleSex, diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/MonsterView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/MonsterView.lua index 7065cc0c0f..65d700bb97 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/MonsterView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/MonsterView.lua @@ -29,26 +29,37 @@ function MonsterView:onCreate(go, role, position, root) self.icon = Util.GetGameObject(go, "icon"):GetComponent("Image") self.turnEffect=role.camp == 0 and self.RootPanel.lingshouDownEffect or self.RootPanel.lingshouUpEffect -- 获取数据 - local live=0 + self.livePath = nil if position==100 then - if role.sex==ROLE_SEX.BOY then - self.livePath="live2d_npc_boy" - else - self.livePath="live2d_npc_girl" - end - --self.livePath="live2d_npc_girl" - role.roleData.id=20100 - else - self.livePath = GetResourcePath(SpiritAnimal[role.roleData.id].Live) - self.icon.sprite = self.spLoader:LoadSprite(GetResourcePath(SpiritAnimal[role.roleData.id].Icon)) + if not role.roleData.id or role.roleData.id == 0 then + role.roleData.id = 20100 + end + if role.roleData.id == 20100 then + if role.sex == ROLE_SEX.BOY then + self.livePath = "live2d_npc_boy" + else + self.livePath = "live2d_npc_girl" + end + -- 确定是主角 + self.isMainPlayer = true + end end - self.play_liveScale = SpiritAnimal[role.roleData.id].play_liveScale - self.enemy_liveScale = SpiritAnimal[role.roleData.id].enemy_liveScale - self.offset = SpiritAnimal[role.roleData.id].offset - self.outOffset = SpiritAnimal[role.roleData.id].enemy_offset - self.spAtkTime = SpiritAnimal[role.roleData.id].CastingSkills/1000 - self.atkSoundTime = SpiritAnimal[role.roleData.id].CastingAudio/1000 - self.attackSound = SpiritAnimal[role.roleData.id].sond + -- 配置表数据 + self.config = SpiritAnimal[role.roleData.id] + + -- 如果不是男女主角 + if not self.livePath then + self.livePath = GetResourcePath(self.config.Live) + self.icon.sprite = self.spLoader:LoadSprite(GetResourcePath(self.config.Icon)) + end + + self.play_liveScale = self.config.play_liveScale + self.enemy_liveScale = self.config.enemy_liveScale + self.offset = self.config.offset + self.outOffset = self.config.enemy_offset + self.spAtkTime = self.config.CastingSkills/1000 + self.atkSoundTime = self.config.CastingAudio/1000 + self.attackSound = self.config.sond -- 人物立绘 @@ -139,12 +150,7 @@ function MonsterView:PlaySpineAnim(gog, time, name, isLoop) local _complete = nil _complete = function(state) gog.AnimationState.Complete = gog.AnimationState.Complete - _complete - if self.role.roleData.id==20100 then - gog.AnimationState:SetAnimation(0, "idle", true) - else - gog.AnimationState:SetAnimation(0, "attack", true) - end - + gog.AnimationState:SetAnimation(0, "idle", true) end gog.AnimationState:ClearTracks() -- 清除上一个动画的影响(修复概率攻击动画播放错误的问题) gog.AnimationState:SetAnimation(time, name, isLoop) @@ -182,7 +188,7 @@ function MonsterView:OnSkillCastStart(skill) self.RoleLiveGO3.transform:SetParent(self.skillCastRoot.gameObject.transform) self.RoleLiveGO3.transform:SetSiblingIndex(0) --self.RoleLiveGO3.transform.position=Vector3.zero - local offset = self.camp == 0 and SpiritAnimal[20100].offset or SpiritAnimal[20100].enemy_offset + local offset = self.camp == 0 and self.config.offset or self.config.enemy_offset local add=roleConfig.enemy_offset if self.camp==1 then self.RoleLiveGO3.transform.rotation=Vector3.New(0,180,0) @@ -219,10 +225,6 @@ function MonsterView:OnSkillCastingStart(skill) -- 提前进入下一阶段 self.turnEffect:SetActive(false) self.RoleLiveGO2:SetActive(true) - local animName="attack" - if self.role.roleData.id==20100 then - animName="idle" - end self.RoleLiveGO2:GetComponent("RectTransform").rotation = Quaternion.Euler(Vector3.New(0, 0, 0)) if self.RoleLiveGO3 then if (self.camp==0 and heroConfig and heroConfig.Toward==1) or (self.camp==1 and heroConfig and heroConfig.Toward==2) then @@ -245,16 +247,15 @@ function MonsterView:OnSkillCastingStart(skill) self.RoleLiveGO3.transform:DORotate(Vector3.New(0,0, 0),0.5) end self.castingNameNode:GetComponent("Image").sprite = self.spLoader:LoadSprite(self.combat.skillname) - animName="attack" - self:PlaySpineAnim(self.RoleLiveGOGraphic3, 0,animName , false) - coroutine.wait(1.5) + self:PlaySpineAnim(self.RoleLiveGOGraphic3, 0, "attack" , false) + -- coroutine.wait(1.5) --self.turnEffect:SetActive(false) end) coroutine.wait(0.1) self.turnEffect:SetActive(true) end) else - self:PlaySpineAnim(self.RoleLiveGOGraphic2, 0,animName , false) + self:PlaySpineAnim(self.RoleLiveGOGraphic2, 0, "attack" , false) end