From 0b9ba3dd30791c098ee929bc54dba6a56072294b Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期二, 13 一月 2026 14:47:29 +0800
Subject: [PATCH] 411 定军阁-客户端
---
Main/System/WarlordPavilion/WarlordPavilionSelectBonusCell.cs | 19
Main/Config/Configs/FBDJGQuickConfig.cs | 41
Main/Config/PartialConfigs/FBDJGLevelConfig.cs.meta | 11
Main/System/WarlordPavilion/WarlordPavilionRankWin.cs | 100 +
Main/System/Redpoint/MainRedDot.cs | 1
Main/Core/NetworkPackage/ServerPack/HB2_ActionMap/HB202_tagSCDingjungeInfo.cs | 45
Main/Core/NetworkPackage/ClientPack/CB1_ActionMap.meta | 8
Main/System/WarlordPavilion/WarlordPavilionGiftDiyButtonCell.cs.meta | 11
Main/System/ViewNPC/ViewNPCManager.cs.meta | 11
Main/System/Settlement/BattleSettlementManager.cs | 16
Main/System/WarlordPavilion/WarlordPavilionAwardCell.cs | 23
Main/System/WarlordPavilion/WarlordPavilionReplaceGiftGird.cs | 44
Main/Config/Configs/FBDJGEffectConfig.cs | 50
Main/System/WarlordPavilion/WarlordPavilionWin.cs | 279 ++++
Main/System/Settlement/WarlordPavilionVictoryWin.cs | 86 +
Main/System/WarlordPavilion/WarlordPavilionReplaceGiftGird.cs.meta | 11
Main/Utility/EnumHelper.cs | 1
Main/System/WarlordPavilion/WarlordPavilionSelectBonusCell.cs.meta | 11
Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB108_tagCMFBQuickPass.cs | 20
Main/System/WarlordPavilion/WarlordPavilionDropdownItem.cs.meta | 11
Main/System/WarlordPavilion/WarlordPavilionPlayerTop3Cell.cs.meta | 11
Main/Config/Configs/FBDJGLevelConfig.cs.meta | 11
Main/System/WarlordPavilion/WarlordPavilionAwardWin.cs | 48
Main/System/WarlordPavilion/WarlordPavilionPlayerTop3Cell.cs | 44
Main/System/Battle/WarlordPavilionBattleWin.cs | 293 ++++
Main/System/Settlement/WarlordPavilionFailWin.cs | 54
Main/System/WarlordPavilion/WarlordPavilionBonusPresetWin.cs.meta | 11
Main/System/WarlordPavilion/WarlordPavilionAwardWin.cs.meta | 11
Main/System/WarlordPavilion/WarlordPavilionBonusPreseCell.cs.meta | 11
Main/System/WarlordPavilion/WarlordPavilionSelectGiftGird.cs | 22
Main/System/WarlordPavilion/WarlordPavilionAwardCell.cs.meta | 11
Main/System/WarlordPavilion/WarlordPavilionPlayerRankCell.cs | 73 +
Main/Core/NetworkPackage/ClientPack/CB4_FightDefine/CB416_tagCSViewNPCAttr.cs | 22
Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB102_tagCSDingjungeEffSelect.cs | 22
Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB108_tagCMFBQuickPass.cs.meta | 11
Main/System/WarlordPavilion/WarlordPavilionPlayerRankCell.cs.meta | 11
Main/Config/Configs/FBDJGLevelConfig.cs | 68
Main/System/Battle/BattleConst.cs | 5
Main/System/WarlordPavilion/WarlordPavilionSelectBonusWin.cs.meta | 11
Main/Config/ConfigManager.cs | 9
Main/Core/NetworkPackage/ServerPack/HB4_FightDefine/HB432_tagSCViewNPCAttrRet.cs.meta | 11
Main/System/WarlordPavilion/WarlordPavilionReplaceBonusWin.cs | 53
Main/System/WarlordPavilion/WarlordPavilionGiftCell.cs | 258 +++
Main/Config/Configs/FBDJGQuickConfig.cs.meta | 11
Main/System/WarlordPavilion.meta | 8
Main/System/WarlordPavilion/WarlordPavilionBonusPresetWin.cs | 78 +
Main/Core/NetworkPackage/DTCFile/ServerPack/HB4_FightDefine/DTCB432_tagSCViewNPCAttrRet.cs.meta | 11
Main/System/Battle/BattleField/WarlordPavilionBattleField.cs | 135 +
Main/System/Battle/WarlordPavilionBattleWin.cs.meta | 11
Main/System/WarlordPavilion/WarlordPavilionManager.cs.meta | 11
Main/System/Battle/BattleFieldFactory.cs | 3
Main/System/WarlordPavilion/WarlordPavilionReplaceBonusWin.cs.meta | 11
Main/Config/Configs/FBDJGEffectConfig.cs.meta | 11
Main/Core/NetworkPackage/DTCFile/ServerPack/HB2_ActionMap/DTCB202_tagSCDingjungeInfo.cs.meta | 11
Main/Main.cs | 2
Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB101_tagCSDingjungeEffSet.cs.meta | 11
Main/Core/NetworkPackage/ServerPack/HB4_FightDefine/HB432_tagSCViewNPCAttrRet.cs | 49
Main/System/Settlement/WarlordPavilionVictoryWin.cs.meta | 11
Main/System/ChallengeTab/WarlordPavilionTabHandler.cs.meta | 11
Main/System/WarlordPavilion/WarlordPavilionGiftCell.cs.meta | 11
Main/System/ViewNPC/ViewNPCManager.cs | 146 ++
Main/System/WarlordPavilion/WarlordPavilionGiftGird.cs | 40
Main/System/Settlement/WarlordPavilionFailWin.cs.meta | 11
Main/Core/NetworkPackage/ServerPack/HB2_ActionMap/HB202_tagSCDingjungeInfo.cs.meta | 11
Main/System/WarlordPavilion/WarlordPavilionBonusPreseCell.cs | 90 +
Main/Core/NetworkPackage/DTCFile/ServerPack/HB4_FightDefine/DTCB432_tagSCViewNPCAttrRet.cs | 12
Main/Config/PartialConfigs/FBDJGLevelConfig.cs | 119 +
Main/Core/NetworkPackage/ClientPack/CB4_FightDefine/CB416_tagCSViewNPCAttr.cs.meta | 11
Main/System/WarlordPavilion/WarlordPavilionGiftDiyButtonCell.cs | 268 +++
Main/System/WarlordPavilion/WarlordPavilionWin.cs.meta | 11
Main/System/Battle/BattleField/WarlordPavilionBattleField.cs.meta | 11
Main/System/WarlordPavilion/WarlordPavilionDropdownItem.cs | 50
Main/System/ViewNPC.meta | 8
Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB101_tagCSDingjungeEffSet.cs | 22
Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs | 2
Main/System/WarlordPavilion/WarlordPavilionSelectGiftGird.cs.meta | 11
Main/System/WarlordPavilion/WarlordPavilionSelectBonusWin.cs | 167 ++
Main/System/WarlordPavilion/WarlordPavilionRankWin.cs.meta | 11
Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB102_tagCSDingjungeEffSelect.cs.meta | 11
Main/System/ChallengeTab/WarlordPavilionTabHandler.cs | 63
Main/Core/NetworkPackage/DTCFile/ServerPack/HB2_ActionMap/DTCB202_tagSCDingjungeInfo.cs | 12
Main/System/WarlordPavilion/WarlordPavilionManager.cs | 731 ++++++++++
Main/System/WarlordPavilion/WarlordPavilionGiftGird.cs.meta | 11
83 files changed, 4,104 insertions(+), 1 deletions(-)
diff --git a/Main/Config/ConfigManager.cs b/Main/Config/ConfigManager.cs
index bb11e62..65fef12 100644
--- a/Main/Config/ConfigManager.cs
+++ b/Main/Config/ConfigManager.cs
@@ -52,6 +52,9 @@
typeof(DungeonOpenTimeConfig),
typeof(FaceConfig),
typeof(FamilyDonateConfig),
+ typeof(FBDJGEffectConfig),
+ typeof(FBDJGLevelConfig),
+ typeof(FBDJGQuickConfig),
typeof(FightPowerRatioConfig),
typeof(FirstChargeConfig),
typeof(GoldRushCampConfig),
@@ -276,6 +279,12 @@
ClearConfigDictionary<FaceConfig>();
// 娓呯┖ FamilyDonateConfig 瀛楀吀
ClearConfigDictionary<FamilyDonateConfig>();
+ // 娓呯┖ FBDJGEffectConfig 瀛楀吀
+ ClearConfigDictionary<FBDJGEffectConfig>();
+ // 娓呯┖ FBDJGLevelConfig 瀛楀吀
+ ClearConfigDictionary<FBDJGLevelConfig>();
+ // 娓呯┖ FBDJGQuickConfig 瀛楀吀
+ ClearConfigDictionary<FBDJGQuickConfig>();
// 娓呯┖ FightPowerRatioConfig 瀛楀吀
ClearConfigDictionary<FightPowerRatioConfig>();
// 娓呯┖ FirstChargeConfig 瀛楀吀
diff --git a/Main/Config/Configs/FBDJGEffectConfig.cs b/Main/Config/Configs/FBDJGEffectConfig.cs
new file mode 100644
index 0000000..b06b61c
--- /dev/null
+++ b/Main/Config/Configs/FBDJGEffectConfig.cs
@@ -0,0 +1,50 @@
+锘�//--------------------------------------------------------
+// [Author]: YYL
+// [ Date ]: Thursday, January 8, 2026
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System;
+using UnityEngine;
+using LitJson;
+
+public partial class FBDJGEffectConfig : ConfigBase<int, FBDJGEffectConfig>
+{
+ static FBDJGEffectConfig()
+ {
+ // 璁块棶杩囬潤鎬佹瀯閫犲嚱鏁�
+ visit = true;
+ }
+
+ public int EffID;
+ public string Name;
+ public int EffQuality;
+ public int AttrID;
+ public int AttrValue;
+
+ public override int LoadKey(string _key)
+ {
+ int key = GetKey(_key);
+ return key;
+ }
+
+ public override void LoadConfig(string input)
+ {
+ try {
+ string[] tables = input.Split('\t');
+ int.TryParse(tables[0],out EffID);
+
+ Name = tables[1];
+
+ int.TryParse(tables[2],out EffQuality);
+
+ int.TryParse(tables[3],out AttrID);
+
+ int.TryParse(tables[4],out AttrValue);
+ }
+ catch (Exception exception)
+ {
+ Debug.LogError(exception);
+ }
+ }
+}
diff --git a/Main/Config/Configs/FBDJGEffectConfig.cs.meta b/Main/Config/Configs/FBDJGEffectConfig.cs.meta
new file mode 100644
index 0000000..67100d5
--- /dev/null
+++ b/Main/Config/Configs/FBDJGEffectConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1d9ab1627e4cbd940b92b06a7fbdbb9f
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Config/Configs/FBDJGLevelConfig.cs b/Main/Config/Configs/FBDJGLevelConfig.cs
new file mode 100644
index 0000000..c47f867
--- /dev/null
+++ b/Main/Config/Configs/FBDJGLevelConfig.cs
@@ -0,0 +1,68 @@
+锘�//--------------------------------------------------------
+// [Author]: YYL
+// [ Date ]: Thursday, January 8, 2026
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System;
+using UnityEngine;
+using LitJson;
+
+public partial class FBDJGLevelConfig : ConfigBase<int, FBDJGLevelConfig>
+{
+ static FBDJGLevelConfig()
+ {
+ // 璁块棶杩囬潤鎬佹瀯閫犲嚱鏁�
+ visit = true;
+ }
+
+ public int LevelID;
+ public int LayerNum;
+ public int LevelNum;
+ public int[][] PassAwardList;
+ public int[][] AwardList;
+ public int[] LineupIDList;
+ public long FightPower;
+
+ public override int LoadKey(string _key)
+ {
+ int key = GetKey(_key);
+ return key;
+ }
+
+ public override void LoadConfig(string input)
+ {
+ try {
+ string[] tables = input.Split('\t');
+ int.TryParse(tables[0],out LevelID);
+
+ int.TryParse(tables[1],out LayerNum);
+
+ int.TryParse(tables[2],out LevelNum);
+
+ PassAwardList = JsonMapper.ToObject<int[][]>(tables[3].Replace("(", "[").Replace(")", "]"));
+
+ AwardList = JsonMapper.ToObject<int[][]>(tables[4].Replace("(", "[").Replace(")", "]"));
+
+ if (tables[5].Contains("["))
+ {
+ LineupIDList = JsonMapper.ToObject<int[]>(tables[5]);
+ }
+ else
+ {
+ string[] LineupIDListStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ LineupIDList = new int[LineupIDListStringArray.Length];
+ for (int i=0;i<LineupIDListStringArray.Length;i++)
+ {
+ int.TryParse(LineupIDListStringArray[i],out LineupIDList[i]);
+ }
+ }
+
+ long.TryParse(tables[6],out FightPower);
+ }
+ catch (Exception exception)
+ {
+ Debug.LogError(exception);
+ }
+ }
+}
diff --git a/Main/Config/Configs/FBDJGLevelConfig.cs.meta b/Main/Config/Configs/FBDJGLevelConfig.cs.meta
new file mode 100644
index 0000000..1a5efaa
--- /dev/null
+++ b/Main/Config/Configs/FBDJGLevelConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: fcb6fd70d963c02458708cfb1a6bec17
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Config/Configs/FBDJGQuickConfig.cs b/Main/Config/Configs/FBDJGQuickConfig.cs
new file mode 100644
index 0000000..a966c0f
--- /dev/null
+++ b/Main/Config/Configs/FBDJGQuickConfig.cs
@@ -0,0 +1,41 @@
+锘�//--------------------------------------------------------
+// [Author]: YYL
+// [ Date ]: 2026骞�1鏈�7鏃�
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System;
+using UnityEngine;
+using LitJson;
+
+public partial class FBDJGQuickConfig : ConfigBase<int, FBDJGQuickConfig>
+{
+ static FBDJGQuickConfig()
+ {
+ // 璁块棶杩囬潤鎬佹瀯閫犲嚱鏁�
+ visit = true;
+ }
+
+ public int NeedLayer;
+ public int[][] QuickAwardList;
+
+ public override int LoadKey(string _key)
+ {
+ int key = GetKey(_key);
+ return key;
+ }
+
+ public override void LoadConfig(string input)
+ {
+ try {
+ string[] tables = input.Split('\t');
+ int.TryParse(tables[0],out NeedLayer);
+
+ QuickAwardList = JsonMapper.ToObject<int[][]>(tables[1].Replace("(", "[").Replace(")", "]"));
+ }
+ catch (Exception exception)
+ {
+ Debug.LogError(exception);
+ }
+ }
+}
diff --git a/Main/Config/Configs/FBDJGQuickConfig.cs.meta b/Main/Config/Configs/FBDJGQuickConfig.cs.meta
new file mode 100644
index 0000000..2ea089b
--- /dev/null
+++ b/Main/Config/Configs/FBDJGQuickConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1b059c4a6d6df3640b8f1c56d87ec625
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Config/PartialConfigs/FBDJGLevelConfig.cs b/Main/Config/PartialConfigs/FBDJGLevelConfig.cs
new file mode 100644
index 0000000..89bc33f
--- /dev/null
+++ b/Main/Config/PartialConfigs/FBDJGLevelConfig.cs
@@ -0,0 +1,119 @@
+using System.Collections.Generic;
+using System.Linq;
+public partial class FBDJGLevelConfig : ConfigBase<int, FBDJGLevelConfig>
+{
+ //<灞傛暟,<鍏冲崱缂栧彿,鍏冲崱ID>>
+ static Dictionary<int, Dictionary<int, int>> idDict = new Dictionary<int, Dictionary<int, int>>();
+
+ protected override void OnConfigParseCompleted()
+ {
+ if (!idDict.ContainsKey(LayerNum))
+ {
+ idDict[LayerNum] = new Dictionary<int, int>();
+ }
+ idDict[LayerNum][LevelNum] = LevelID;
+ }
+
+ public static bool TryGetLayerNumDict(int layerNum, out Dictionary<int, int> dict)
+ {
+ dict = null;
+ return idDict != null && idDict.TryGetValue(layerNum, out dict);
+ }
+
+ public static bool TryGetLevelID(int layerNum, int levelNum, out int levelID)
+ {
+ levelID = 0;
+ return idDict != null && idDict.TryGetValue(layerNum, out var dict) && dict.TryGetValue(levelNum, out levelID);
+ }
+
+ public static bool TryGetFBDJGLevelConfig(int layerNum, int levelNum, out FBDJGLevelConfig config)
+ {
+ config = null;
+ if (TryGetLevelID(layerNum, levelNum, out var levelID) && HasKey(levelID))
+ {
+ config = Get(levelID);
+ return true;
+ }
+ return false;
+ }
+
+ public static bool TryGetFBDJGLevelConfig(int levelID, out FBDJGLevelConfig config)
+ {
+ config = null;
+ if (HasKey(levelID))
+ {
+ config = Get(levelID);
+ return true;
+ }
+ return false;
+ }
+
+ public static bool TryGetMinFBDJGLevelConfig(out FBDJGLevelConfig minConfig)
+ {
+ minConfig = null;
+ if (idDict.IsNullOrEmpty())
+ return false;
+ int layerNum = idDict.Keys.Min();
+ if (!TryGetLayerNumDict(layerNum, out var dict) || dict.IsNullOrEmpty())
+ return false;
+ int levelNum = dict.Keys.Min();
+ if (!TryGetFBDJGLevelConfig(layerNum, levelNum, out minConfig) || minConfig == null)
+ return false;
+ return true;
+ }
+ public static bool TryGetMaxFBDJGLevelConfig(out FBDJGLevelConfig maxConfig)
+ {
+ maxConfig = null;
+ if (idDict.IsNullOrEmpty())
+ return false;
+ int layerNum = idDict.Keys.Max();
+ if (!TryGetLayerNumDict(layerNum, out var dict) || dict.IsNullOrEmpty())
+ return false;
+ int levelNum = dict.Keys.Max();
+ if (!TryGetFBDJGLevelConfig(layerNum, levelNum, out maxConfig) || maxConfig == null)
+ return false;
+ return true;
+ }
+
+ // 鑾峰彇鎸囧畾灞傜殑鏈�澶у叧鍗$紪鍙�
+ public static bool TryGetMaxLevelNumInLayer(int layerNum, out int maxLevelNum)
+ {
+ maxLevelNum = 0;
+ if (!TryGetLayerNumDict(layerNum, out var dict) || dict.IsNullOrEmpty())
+ return false;
+ maxLevelNum = dict.Keys.Max();
+ return true;
+ }
+
+ // 鑾峰彇涓嬩竴鍏�
+ public static bool TryGetNextLevel(int layerNum, int levelNum, out int nextLayerNum, out int nextLevelNum)
+ {
+ nextLayerNum = 0;
+ nextLevelNum = 0;
+ if (!TryGetMaxLevelNumInLayer(layerNum, out int maxLevelNum))
+ return false;
+
+ // 灞傛暟鐩稿悓锛屼笅涓�鍏�
+ if (maxLevelNum > 0 && levelNum < maxLevelNum)
+ {
+ nextLayerNum = layerNum;
+ nextLevelNum = levelNum + 1;
+ return true;
+ }
+
+ // 涓嬩竴灞傜殑绗�1鍏�
+ nextLayerNum = layerNum + 1;
+
+ // 濡傛灉娌℃湁涓嬩竴灞�
+ if (!idDict.ContainsKey(nextLayerNum))
+ {
+ nextLayerNum = 0;
+ nextLevelNum = 0;
+ return false;
+ }
+
+ nextLevelNum = idDict[nextLayerNum].Keys.Min();
+ return true;
+ }
+
+}
\ No newline at end of file
diff --git a/Main/Config/PartialConfigs/FBDJGLevelConfig.cs.meta b/Main/Config/PartialConfigs/FBDJGLevelConfig.cs.meta
new file mode 100644
index 0000000..c8a9948
--- /dev/null
+++ b/Main/Config/PartialConfigs/FBDJGLevelConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6758d29be01589f498a9074901ac5eaf
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/ClientPack/CB1_ActionMap.meta b/Main/Core/NetworkPackage/ClientPack/CB1_ActionMap.meta
new file mode 100644
index 0000000..0410dab
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CB1_ActionMap.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: e31491498dc67314482b5c0dd793d662
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB101_tagCSDingjungeEffSet.cs b/Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB101_tagCSDingjungeEffSet.cs
new file mode 100644
index 0000000..42c2c0e
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB101_tagCSDingjungeEffSet.cs
@@ -0,0 +1,22 @@
+using UnityEngine;
+using System.Collections;
+
+// B1 01 瀹氬啗闃佹晥鏋滈璁� #tagCSDingjungeEffSet
+
+public class CB101_tagCSDingjungeEffSet : GameNetPackBasic {
+ public byte SelectAuto; //鏄惁鍚敤鑷姩閫夋嫨
+ public byte SelectSetCnt;
+ public ushort[] SelectSetAttrIDList; //棰勮浼樺厛閫夋嫨灞炴�D鍒楄〃 [浼樺厛绾�1灞炴�D, ...]
+
+ public CB101_tagCSDingjungeEffSet () {
+ combineCmd = (ushort)0x03FE;
+ _cmd = (ushort)0xB101;
+ }
+
+ public override void WriteToBytes () {
+ WriteBytes (SelectAuto, NetDataType.BYTE);
+ WriteBytes (SelectSetCnt, NetDataType.BYTE);
+ WriteBytes (SelectSetAttrIDList, NetDataType.WORD, SelectSetCnt);
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB101_tagCSDingjungeEffSet.cs.meta b/Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB101_tagCSDingjungeEffSet.cs.meta
new file mode 100644
index 0000000..528358a
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB101_tagCSDingjungeEffSet.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 16ea44f330cde9d4ba513f69ee39bf7b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB102_tagCSDingjungeEffSelect.cs b/Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB102_tagCSDingjungeEffSelect.cs
new file mode 100644
index 0000000..8973c9b
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB102_tagCSDingjungeEffSelect.cs
@@ -0,0 +1,22 @@
+using UnityEngine;
+using System.Collections;
+
+// B1 02 瀹氬啗闃佹晥鏋滈�夋嫨 #tagCSDingjungeEffSelect
+
+public class CB102_tagCSDingjungeEffSelect : GameNetPackBasic {
+ public byte SelectType; //0-鎵嬪姩閫夋嫨锛�1-鏀惧純鏈閫夋嫨锛�2-涓�閿�夋嫨锛堜粎寮�鍚簡鑷姩閫夋嫨鏃舵湁鏁堬級
+ public byte SelectIndex; //鎵嬪姩閫夋嫨绱㈠紩 0~n
+ public byte ReplaceHole; //鎵嬪姩閫夋嫨鏇挎崲妲戒綅 1~n锛屾Ы浣�=妲界储寮�+1锛屽崌绾ф椂鍙洿鎺ュ彂0
+
+ public CB102_tagCSDingjungeEffSelect () {
+ combineCmd = (ushort)0x03FE;
+ _cmd = (ushort)0xB102;
+ }
+
+ public override void WriteToBytes () {
+ WriteBytes (SelectType, NetDataType.BYTE);
+ WriteBytes (SelectIndex, NetDataType.BYTE);
+ WriteBytes (ReplaceHole, NetDataType.BYTE);
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB102_tagCSDingjungeEffSelect.cs.meta b/Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB102_tagCSDingjungeEffSelect.cs.meta
new file mode 100644
index 0000000..7facb54
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB102_tagCSDingjungeEffSelect.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 022b09229e8064d43a397e44a8502088
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB108_tagCMFBQuickPass.cs b/Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB108_tagCMFBQuickPass.cs
new file mode 100644
index 0000000..5c6941f
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB108_tagCMFBQuickPass.cs
@@ -0,0 +1,20 @@
+using UnityEngine;
+using System.Collections;
+
+// B1 08 蹇�熶竴閿繃鍏冲壇鏈� #tagCMFBQuickPass
+
+public class CB108_tagCMFBQuickPass : GameNetPackBasic {
+ public uint MapID;
+ public ushort LineID;
+
+ public CB108_tagCMFBQuickPass () {
+ combineCmd = (ushort)0x03FE;
+ _cmd = (ushort)0xB108;
+ }
+
+ public override void WriteToBytes () {
+ WriteBytes (MapID, NetDataType.DWORD);
+ WriteBytes (LineID, NetDataType.WORD);
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB108_tagCMFBQuickPass.cs.meta b/Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB108_tagCMFBQuickPass.cs.meta
new file mode 100644
index 0000000..e7eb69e
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CB1_ActionMap/CB108_tagCMFBQuickPass.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c50a7b683e2b15b47b1e399aed9525ef
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/ClientPack/CB4_FightDefine/CB416_tagCSViewNPCAttr.cs b/Main/Core/NetworkPackage/ClientPack/CB4_FightDefine/CB416_tagCSViewNPCAttr.cs
new file mode 100644
index 0000000..c303581
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CB4_FightDefine/CB416_tagCSViewNPCAttr.cs
@@ -0,0 +1,22 @@
+using UnityEngine;
+using System.Collections;
+
+// B4 16 鏌ョ湅NPC灞炴�� #tagCSViewNPCAttr
+
+public class CB416_tagCSViewNPCAttr : GameNetPackBasic {
+ public uint MapID; // 鑷畾涔夊湴鍥綢D锛屽彲鐢ㄤ簬缁戝畾鎴樻枟鍦板浘鍦烘櫙鍔熻兘锛堝涓荤嚎boss銆佺埇濉斻�佺珵鎶�鍦虹瓑锛�
+ public uint FuncLineID; // MapID瀵瑰簲鐨勬墿灞曞�硷紝濡傚叿浣撴煇涓叧鍗$瓑
+ public uint ViewNPCID; // 鎸囧畾鏌ョ湅鏌愪釜NPCID锛屽彂0鍒欐煡鐪嬭鍏冲崱闃靛鎵�鏈塏PC
+
+ public CB416_tagCSViewNPCAttr () {
+ combineCmd = (ushort)0x03FE;
+ _cmd = (ushort)0xB416;
+ }
+
+ public override void WriteToBytes () {
+ WriteBytes (MapID, NetDataType.DWORD);
+ WriteBytes (FuncLineID, NetDataType.DWORD);
+ WriteBytes (ViewNPCID, NetDataType.DWORD);
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ClientPack/CB4_FightDefine/CB416_tagCSViewNPCAttr.cs.meta b/Main/Core/NetworkPackage/ClientPack/CB4_FightDefine/CB416_tagCSViewNPCAttr.cs.meta
new file mode 100644
index 0000000..8bef52c
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CB4_FightDefine/CB416_tagCSViewNPCAttr.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a6ce8891edcc48b49918eb96e53a9a11
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HB2_ActionMap/DTCB202_tagSCDingjungeInfo.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB2_ActionMap/DTCB202_tagSCDingjungeInfo.cs
new file mode 100644
index 0000000..ee412a7
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB2_ActionMap/DTCB202_tagSCDingjungeInfo.cs
@@ -0,0 +1,12 @@
+using UnityEngine;
+using System.Collections;
+
+// B2 02 瀹氬啗闃佷俊鎭� #tagSCDingjungeInfo
+
+public class DTCB202_tagSCDingjungeInfo : DtcBasic {
+ public override void Done(GameNetPackBasic vNetPack) {
+ base.Done(vNetPack);
+ HB202_tagSCDingjungeInfo vNetData = vNetPack as HB202_tagSCDingjungeInfo;
+ WarlordPavilionManager.Instance.UpdateDingjungeInfo(vNetData);
+ }
+}
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HB2_ActionMap/DTCB202_tagSCDingjungeInfo.cs.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB2_ActionMap/DTCB202_tagSCDingjungeInfo.cs.meta
new file mode 100644
index 0000000..5bef0e6
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB2_ActionMap/DTCB202_tagSCDingjungeInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 225b85aa172fad04089d1a456d91f7dc
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HB4_FightDefine/DTCB432_tagSCViewNPCAttrRet.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB4_FightDefine/DTCB432_tagSCViewNPCAttrRet.cs
new file mode 100644
index 0000000..f975514
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB4_FightDefine/DTCB432_tagSCViewNPCAttrRet.cs
@@ -0,0 +1,12 @@
+using UnityEngine;
+using System.Collections;
+
+// B4 32 鏌ョ湅NPC灞炴�х粨鏋� #tagSCViewNPCAttrRet
+
+public class DTCB432_tagSCViewNPCAttrRet : DtcBasic {
+ public override void Done(GameNetPackBasic vNetPack) {
+ base.Done(vNetPack);
+ HB432_tagSCViewNPCAttrRet vNetData = vNetPack as HB432_tagSCViewNPCAttrRet;
+ ViewNPCManager.Instance.UpdateViewNPCAttrRet(vNetData);
+ }
+}
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HB4_FightDefine/DTCB432_tagSCViewNPCAttrRet.cs.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB4_FightDefine/DTCB432_tagSCViewNPCAttrRet.cs.meta
new file mode 100644
index 0000000..ed66805
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB4_FightDefine/DTCB432_tagSCViewNPCAttrRet.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: cde823bde6926d742b373957c8225a1c
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs b/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
index 45f3975..7a2ec21 100644
--- a/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
+++ b/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
@@ -139,6 +139,8 @@
Register(typeof(HB130_tagSCBeautyInfo), typeof(DTCB130_tagSCBeautyInfo));
Register(typeof(HB040_tagSCTravelInfo), typeof(DTCB040_tagSCTravelInfo));
Register(typeof(HA3C7_tagMCGubaoInfo), typeof(DTCA3C7_tagMCGubaoInfo));
+ Register(typeof(HB202_tagSCDingjungeInfo), typeof(DTCB202_tagSCDingjungeInfo));
+ Register(typeof(HB432_tagSCViewNPCAttrRet), typeof(DTCB432_tagSCViewNPCAttrRet));
}
//涓诲伐绋嬫敞鍐屽皝鍖�
diff --git a/Main/Core/NetworkPackage/ServerPack/HB2_ActionMap/HB202_tagSCDingjungeInfo.cs b/Main/Core/NetworkPackage/ServerPack/HB2_ActionMap/HB202_tagSCDingjungeInfo.cs
new file mode 100644
index 0000000..0cdb0a2
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HB2_ActionMap/HB202_tagSCDingjungeInfo.cs
@@ -0,0 +1,45 @@
+using UnityEngine;
+using System.Collections;
+
+// B2 02 瀹氬啗闃佷俊鎭� #tagSCDingjungeInfo
+
+public class HB202_tagSCDingjungeInfo : GameNetPackBasic {
+ public uint TodayPass; //浠婃棩杩囧叧杩涘害 灞�*100+鍏冲崱缂栧彿锛屽巻鍙叉渶楂樿繃鍏宠褰曞彇A320涓殑PassLineID
+ public byte EffCnt;
+ public tagSCDingjungeEff[] EffList; //宸茬敓鏁堢殑鏁堟灉鍒楄〃
+ public byte SelectEffCnt;
+ public uint[] SelectEffList; //寰呮墜鍔ㄩ�夋嫨鐨勬晥鏋淚D鍒楄〃
+ public ushort UnSelectCnt; //杩樻湁鍑犱釜鏈�夋嫨鐨勬晥鏋�
+ public byte SelectAuto; //鏄惁鍚敤鑷姩閫夋嫨
+ public byte SelectSetCnt;
+ public ushort[] SelectSetAttrIDList; //棰勮浼樺厛閫夋嫨灞炴�D鍒楄〃 [浼樺厛绾�1灞炴�D, ...]
+
+ public HB202_tagSCDingjungeInfo () {
+ _cmd = (ushort)0xB202;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out TodayPass, vBytes, NetDataType.DWORD);
+ TransBytes (out EffCnt, vBytes, NetDataType.BYTE);
+ EffList = new tagSCDingjungeEff[EffCnt];
+ for (int i = 0; i < EffCnt; i ++) {
+ EffList[i] = new tagSCDingjungeEff();
+ TransBytes (out EffList[i].EffIndex, vBytes, NetDataType.BYTE);
+ TransBytes (out EffList[i].EffID, vBytes, NetDataType.WORD);
+ TransBytes (out EffList[i].EffLV, vBytes, NetDataType.BYTE);
+ }
+ TransBytes (out SelectEffCnt, vBytes, NetDataType.BYTE);
+ TransBytes (out SelectEffList, vBytes, NetDataType.DWORD, SelectEffCnt);
+ TransBytes (out UnSelectCnt, vBytes, NetDataType.WORD);
+ TransBytes (out SelectAuto, vBytes, NetDataType.BYTE);
+ TransBytes (out SelectSetCnt, vBytes, NetDataType.BYTE);
+ TransBytes (out SelectSetAttrIDList, vBytes, NetDataType.WORD, SelectSetCnt);
+ }
+
+ public class tagSCDingjungeEff {
+ public byte EffIndex; //妲界储寮曪紝0~n
+ public ushort EffID;
+ public byte EffLV;
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/HB2_ActionMap/HB202_tagSCDingjungeInfo.cs.meta b/Main/Core/NetworkPackage/ServerPack/HB2_ActionMap/HB202_tagSCDingjungeInfo.cs.meta
new file mode 100644
index 0000000..c73fb9f
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HB2_ActionMap/HB202_tagSCDingjungeInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: aa87a53953bfef748b62a18e1537e3dd
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/ServerPack/HB4_FightDefine/HB432_tagSCViewNPCAttrRet.cs b/Main/Core/NetworkPackage/ServerPack/HB4_FightDefine/HB432_tagSCViewNPCAttrRet.cs
new file mode 100644
index 0000000..50655cb
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HB4_FightDefine/HB432_tagSCViewNPCAttrRet.cs
@@ -0,0 +1,49 @@
+using UnityEngine;
+using System.Collections;
+
+// B4 32 鏌ョ湅NPC灞炴�х粨鏋� #tagSCViewNPCAttrRet
+
+public class HB432_tagSCViewNPCAttrRet : GameNetPackBasic {
+ public uint MapID; // 鑷畾涔夊湴鍥綢D锛屽彲鐢ㄤ簬缁戝畾鎴樻枟鍦板浘鍦烘櫙鍔熻兘锛堝涓荤嚎鍏冲崱銆佷富绾縝oss銆佺埇濉斻�佺珵鎶�鍦虹瓑锛�
+ public uint FuncLineID; // MapID瀵瑰簲鐨勬墿灞曞�硷紝濡傚叿浣撴煇涓叧鍗$瓑
+ public uint ViewNPCID; // 鎸囧畾鏌ョ湅鏌愪釜NPCID锛屽彂0鍒欐煡鐪嬭鍏冲崱闃靛鎵�鏈塏PC
+ public byte NPCCnt;
+ public tagSCViewNPCAttr[] NPCAttrList;
+
+ public HB432_tagSCViewNPCAttrRet () {
+ _cmd = (ushort)0xB432;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out MapID, vBytes, NetDataType.DWORD);
+ TransBytes (out FuncLineID, vBytes, NetDataType.DWORD);
+ TransBytes (out ViewNPCID, vBytes, NetDataType.DWORD);
+ TransBytes (out NPCCnt, vBytes, NetDataType.BYTE);
+ NPCAttrList = new tagSCViewNPCAttr[NPCCnt];
+ for (int i = 0; i < NPCCnt; i ++) {
+ NPCAttrList[i] = new tagSCViewNPCAttr();
+ TransBytes (out NPCAttrList[i].PosNum, vBytes, NetDataType.BYTE);
+ TransBytes (out NPCAttrList[i].NPCID, vBytes, NetDataType.DWORD);
+ TransBytes (out NPCAttrList[i].HeroID, vBytes, NetDataType.DWORD);
+ TransBytes (out NPCAttrList[i].LV, vBytes, NetDataType.WORD);
+ TransBytes (out NPCAttrList[i].Star, vBytes, NetDataType.BYTE);
+ TransBytes (out NPCAttrList[i].BreakLV, vBytes, NetDataType.BYTE);
+ TransBytes (out NPCAttrList[i].AwakeLV, vBytes, NetDataType.BYTE);
+ TransBytes (out NPCAttrList[i].AttrLen, vBytes, NetDataType.WORD);
+ TransBytes (out NPCAttrList[i].AttrMsg, vBytes, NetDataType.Chars, NPCAttrList[i].AttrLen);
+ }
+ }
+
+ public class tagSCViewNPCAttr {
+ public byte PosNum; // 鍦ㄦ湰闃靛涓殑绔欎綅锛屼粠1寮�濮�
+ public uint NPCID; // 鎴樻枟NPCID锛屼笉鍚岀殑瀹炰緥ID瀵瑰簲鐨凬PCID鍙兘涓�鏍�
+ public uint HeroID; // 姝﹀皢ID锛岀帺瀹舵垨NPC鍧囧彲鑳芥湁锛屽鏋滄湁鍊煎垯澶栬鐩稿叧浠ヨ姝﹀皢涓哄噯锛屽惁鍒欎互NPCID涓哄噯
+ public ushort LV; // 绛夌骇锛岀帺瀹剁殑姝﹀皢绛夌骇鎴朜PC鎴愰暱绛夌骇锛岀瓑绾ф樉绀轰互璇ュ�间负鍑�
+ public byte Star; // 鏄熺骇
+ public byte BreakLV; // 绐佺牬
+ public byte AwakeLV; // 瑙夐啋
+ public ushort AttrLen;
+ public string AttrMsg; // 灞炴�т俊鎭� {"灞炴�D":value, ...}
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/HB4_FightDefine/HB432_tagSCViewNPCAttrRet.cs.meta b/Main/Core/NetworkPackage/ServerPack/HB4_FightDefine/HB432_tagSCViewNPCAttrRet.cs.meta
new file mode 100644
index 0000000..3dee87f
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HB4_FightDefine/HB432_tagSCViewNPCAttrRet.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 128031526f9b0f14180aa02d3e0318b6
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Main.cs b/Main/Main.cs
index b7bf254..0f72ce9 100644
--- a/Main/Main.cs
+++ b/Main/Main.cs
@@ -98,6 +98,8 @@
managers.Add(BeautyMMManager.Instance);
managers.Add(DailySpecialsManager.Instance);
managers.Add(GubaoManager.Instance);
+ managers.Add(WarlordPavilionManager.Instance);
+ managers.Add(ViewNPCManager.Instance);
foreach (var manager in managers)
{
manager.Init();
diff --git a/Main/System/Battle/BattleConst.cs b/Main/System/Battle/BattleConst.cs
index 6bba7e4..4ca5b66 100644
--- a/Main/System/Battle/BattleConst.cs
+++ b/Main/System/Battle/BattleConst.cs
@@ -12,6 +12,7 @@
typeof(ArenaBattleWin),
typeof(BoneFieldBattleWin),
typeof(TianziBillboradBattleWin),
+ typeof(WarlordPavilionBattleWin),
};
// 鎴樺満鍚嶇О
@@ -20,6 +21,7 @@
public const string ArenaBattleField = "ArenaBattleField";
public const string BoneBattleField = "BoneBattleField";
public const string TianziBillboradBattleField = "TianziBillboradBattleField";
+ public const string WarlordPavilionBattleField = "WarlordPavilionBattleField";
public static Dictionary<string, string> battleNameToWinName = new Dictionary<string, string>()
{
@@ -28,6 +30,7 @@
{ ArenaBattleField, "ArenaBattleWin" },
{ BoneBattleField, "BoneFieldBattleWin" },
{ TianziBillboradBattleField, "TianziBillboradBattleWin" },
+ { WarlordPavilionBattleField, "WarlordPavilionBattleField" },
};
public static Dictionary<string, int> FieldNameToIndex = new Dictionary<string, int>()
@@ -36,6 +39,7 @@
{ ArenaBattleField, 2 },
{ BoneBattleField, 3},
{ TianziBillboradBattleField, 4 },
+ { WarlordPavilionBattleField, 5 },
};
//鍜� CreateBattleField 閲岀殑瀵瑰簲
@@ -46,6 +50,7 @@
{3, ArenaBattleField},
{30010, BoneBattleField},
{30020, TianziBillboradBattleField},
+ {30030, WarlordPavilionBattleField},
};
diff --git a/Main/System/Battle/BattleField/WarlordPavilionBattleField.cs b/Main/System/Battle/BattleField/WarlordPavilionBattleField.cs
new file mode 100644
index 0000000..46371d5
--- /dev/null
+++ b/Main/System/Battle/BattleField/WarlordPavilionBattleField.cs
@@ -0,0 +1,135 @@
+using LitJson;
+using System.Collections.Generic;
+using System.Linq;
+
+public class WarlordPavilionBattleField : BattleField
+{
+ protected JsonData extendData;
+ protected MainLevelConfig levelConfig;
+ public WarlordPavilionBattleField(string _guid) : base(_guid)
+ {
+
+ }
+
+ public override void Init(int MapID, int FuncLineID, JsonData _extendData,
+ List<TeamBase> _redTeamList, List<TeamBase> _blueTeamList, byte turnMax)
+ {
+ base.Init(MapID, FuncLineID, extendData, _redTeamList, _blueTeamList, turnMax);
+
+ int level = FuncLineID;// 鍏冲崱
+ extendData = _extendData;
+ levelConfig = MainLevelConfig.Get(level);
+
+ SetBattleMode(BattleMode.Record);
+ }
+
+ public override void AutoSetBattleMode()
+ {
+ SetBattleMode(BattleMode.Record);
+ }
+
+ public override void TurnFightState(int TurnNum, int State,
+ uint FuncLineID, JsonData extendData)
+ {
+ base.TurnFightState(TurnNum, State, FuncLineID, extendData);
+
+ switch (State)
+ {
+ // 璧峰鐘舵�佹爣璁�
+ case 0:
+ break;
+ case 1://鍑嗗瀹屾瘯
+ break;
+ case 2://鎴樻枟涓�
+ break;
+ case 3://鎴樻枟缁撴潫
+ break;
+ case 4://缁撶畻濂栧姳
+ break;
+ case 5://缁撴潫鐘舵�佹爣璁�
+ break;
+ default:
+ BattleDebug.LogError("recieve a unknown State");
+ break;
+ }
+ }
+
+ protected override void OnSettlement(JsonData turnFightStateData)
+ {
+ base.OnSettlement(turnFightStateData);
+ }
+
+ public override void WhaleFall()
+ {
+ AutoFightModel.Instance.isPause = false;
+ Destroy();
+
+ if (UIManager.Instance.IsOpened<WarlordPavilionBattleWin>())
+ {
+ UIManager.Instance.CloseWindow<WarlordPavilionBattleWin>();
+ UIManager.Instance.OpenWindow<WarlordPavilionWin>();
+ }
+ }
+
+ public override void Run()
+ {
+ if (operationAgent == null)
+ {
+ //闃茶寖寮傚父
+ return;
+ }
+ base.Run();
+ }
+
+ public override void DistributeNextPackage()
+ {
+ if (IsBattleFinish)
+ return;
+
+ // 涓嶈璋冪敤base鐨勫嚱鏁�
+ BattleManager.Instance.DistributeNextReportPackage(guid);
+ }
+
+ public override void ShowWindow(HB424_tagSCTurnFightInit vNetData)
+ {
+ WarlordPavilionBattleWin fsBattleWin = UIManager.Instance.GetUI<WarlordPavilionBattleWin>();// as FullScreenBattleWin;
+ if (null == fsBattleWin)
+ {
+ fsBattleWin = UIManager.Instance.OpenWindow<WarlordPavilionBattleWin>();
+ }
+ fsBattleWin.SetBattleField(this);
+
+ if (UIManager.Instance.IsOpened<WarlordPavilionWin>())
+ {
+ UIManager.Instance.CloseWindow<WarlordPavilionWin>();
+ }
+ }
+
+ public NPCLineupConfig GetBossLineupConfig()
+ {
+ WarlordPavilionManager.Instance.AnalysisFinishProgress(FuncLineID, out int layerNum, out int levelNum);
+ if (!FBDJGLevelConfig.TryGetFBDJGLevelConfig(layerNum, levelNum, out FBDJGLevelConfig config))
+ return null;
+ int[] lineupIDList = config.LineupIDList;
+ if (lineupIDList.IsNullOrEmpty())
+ return null;
+ int lineupID = lineupIDList[0];
+ if (!NPCLineupConfig.HasKey(lineupID))
+ return null;
+ NPCLineupConfig nPCLineupConfig = NPCLineupConfig.Get(lineupID);
+ return nPCLineupConfig;
+ }
+
+ public override BattleObject FindBoss()
+ {
+
+ var config = GetBossLineupConfig();
+ if (config != null)
+ {
+ int bossId = config.BossID;
+ BattleObject bo = battleObjMgr.allBattleObjDict.Values.FirstOrDefault(bo => bo.teamHero.NPCID == bossId);
+ return bo;
+ }
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/Main/System/Battle/BattleField/WarlordPavilionBattleField.cs.meta b/Main/System/Battle/BattleField/WarlordPavilionBattleField.cs.meta
new file mode 100644
index 0000000..5d4b11c
--- /dev/null
+++ b/Main/System/Battle/BattleField/WarlordPavilionBattleField.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1435e3580e72a024c9b99a89b94809eb
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/Battle/BattleFieldFactory.cs b/Main/System/Battle/BattleFieldFactory.cs
index b12531c..d752c89 100644
--- a/Main/System/Battle/BattleFieldFactory.cs
+++ b/Main/System/Battle/BattleFieldFactory.cs
@@ -29,6 +29,9 @@
case 30020:
battleField = new TianziBillboradBattleField(guid);
break;
+ case 30030:
+ battleField = new WarlordPavilionBattleField(guid);
+ break;
default:
break;
}
diff --git a/Main/System/Battle/WarlordPavilionBattleWin.cs b/Main/System/Battle/WarlordPavilionBattleWin.cs
new file mode 100644
index 0000000..691adde
--- /dev/null
+++ b/Main/System/Battle/WarlordPavilionBattleWin.cs
@@ -0,0 +1,293 @@
+锘縰sing System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class WarlordPavilionBattleWin : BaseBattleWin
+{
+ [SerializeField] Transform transButtons;
+ [SerializeField] public BossLifeBar bossLifeBar;
+ [SerializeField] public SkillWordCell[] skillWordCells;
+ [SerializeField] public BossHeadCell bossHeadCell;
+ [SerializeField] public Text txtBossName;
+ private BattleObject bossBattleObject = null;
+ [SerializeField] public List<BattleBuffCell> buffCells;
+ [SerializeField] HeroCountryComponent myCountry;
+ [SerializeField] HeroCountryComponent enemyCountry;
+
+ protected override void OnPreOpen()
+ {
+ base.OnPreOpen();
+ MainWin.TabChangeEvent += OnTabChangeEvent;
+ UIManager.Instance.OnOpenWindow += OnOpenWindow;
+ bool isOpenBattleChangeTab = IsOpenBattleChangeTab();
+ transButtons.localPosition = new Vector3(0, isOpenBattleChangeTab ? 130 : 0, 0);
+ if (isOpenBattleChangeTab)
+ {
+ UIManager.Instance.GetUI<MainWin>()?.CloseSubUI();
+ }
+ else
+ {
+ UIManager.Instance.CloseWindow<MainWin>();
+ }
+ isClickSkip = false;
+ }
+
+ protected override void OnPreClose()
+ {
+ base.OnPreClose();
+
+ MainWin.TabChangeEvent -= OnTabChangeEvent;
+ UIManager.Instance.OnOpenWindow -= OnOpenWindow;
+ bool isOpenBattleChangeTab = IsOpenBattleChangeTab();
+ if (isOpenBattleChangeTab)
+ {
+ UIManager.Instance.GetUI<MainWin>()?.RestoreSubUI();
+ }
+ else
+ {
+ UIManager.Instance.OpenWindow<MainWin>();
+ }
+
+ if (bossBattleObject != null)
+ {
+ if (bossBattleObject.buffMgr != null)
+ {
+ bossBattleObject.buffMgr.onBuffChanged -= OnBuffChanged;
+ }
+ bossBattleObject = null;
+ }
+
+ if (isClickSkip)
+ {
+ isClickSkip = false;
+ TryPass();
+ }
+ }
+
+ void OnOpenWindow(UIBase win)
+ {
+ if (win is WarlordPavilionVictoryWin || win is WarlordPavilionFailWin)
+ {
+ isClickSkip = false;
+ }
+ }
+
+ bool isClickSkip = false;
+ protected override void OnClickPass()
+ {
+ if (!IsPass())
+ return;
+ isClickSkip = true;
+ clickTime = Time.time; // 璁板綍鐐瑰嚮鏃堕棿
+ battleField.ForceFinish();
+
+ }
+
+ float stayTime = 2f;
+ float clickTime = 0f;
+ void LateUpdate()
+ {
+ if (isClickSkip && Time.time - clickTime >= stayTime)
+ {
+ isClickSkip = false;
+ TryPass();
+ }
+ }
+
+ private void TryPass()
+ {
+ if (UIManager.Instance.IsOpened<WarlordPavilionVictoryWin>() ||
+ UIManager.Instance.IsOpened<WarlordPavilionFailWin>())
+ return;
+ CloseWindow();
+ Debug.LogError($"OnBattleEnd 寮傚父鍏抽棴");
+ BattleSettlementManager.Instance.WinShowOver(BattleConst.WarlordPavilionBattleField);
+
+ }
+ private void OnTabChangeEvent()
+ {
+ UIManager.Instance.CloseWindow<WarlordPavilionBattleWin>();
+ }
+
+ protected override void OnCreateBattleField(string guid, BattleField field)
+ {
+ if (field is WarlordPavilionBattleField)
+ {
+ SetBattleField(field);
+ }
+ }
+
+ protected override void RefreshSpecific()
+ {
+ WarlordPavilionBattleField warlordField = battleField as WarlordPavilionBattleField;
+ if (warlordField == null) return;
+
+ NPCLineupConfig lineupConfig = warlordField.GetBossLineupConfig();
+
+ if (bossBattleObject != null)
+ {
+ if (bossBattleObject.buffMgr != null)
+ {
+ bossBattleObject.buffMgr.onBuffChanged -= OnBuffChanged;
+ }
+ bossBattleObject = null;
+ }
+
+ bossBattleObject = warlordField.FindBoss();
+
+ DisplaySkillWordsList(lineupConfig);
+
+ if (null != bossBattleObject)
+ {
+ TeamHero teamHero = bossBattleObject.teamHero;
+ bossHeadCell.SetTeamHero(teamHero);
+ txtBossName.text = teamHero.name;
+ NPCConfig npcConfig = NPCConfig.Get(teamHero.NPCID);
+ bossLifeBar.SetBaseInfo(Mathf.Max(1, npcConfig.LifeBarCount), (ulong)teamHero.curHp, (ulong)teamHero.maxHp);
+ bossBattleObject.buffMgr.onBuffChanged -= OnBuffChanged;
+ bossBattleObject.buffMgr.onBuffChanged += OnBuffChanged;
+ }
+ else
+ {
+ bossHeadCell.SetTeamHero(null);
+ txtBossName.text = string.Empty;
+ bossLifeBar.SetBaseInfo(2, 2, 2);
+ Debug.LogError("鎵句笉鍒癰oss");
+ }
+
+ OnRoundChange(battleField.round, battleField.turnMax); // 纭繚鍥炲悎鏄剧ず琚皟鐢�
+ OnBuffChanged();
+
+ // 鑾峰彇鎴戞柟锛堢孩鏂癸級闃熶紞鏁版嵁
+ List<BattleObject> myTeam = battleField.battleObjMgr.GetBattleObjList(BattleCamp.Red);
+ // 鑾峰彇鏁屾柟锛堣摑鏂癸級闃熶紞鏁版嵁
+ List<BattleObject> enemyTeam = battleField.battleObjMgr.GetBattleObjList(BattleCamp.Blue);
+
+ myCountry.RefreshOnTeamCountry(GetTeamHeroList(myTeam), true);
+ enemyCountry.RefreshOnTeamCountry(GetTeamHeroList(enemyTeam), true);
+ }
+
+ private void OnBuffChanged()
+ {
+ var buffList = new List<HB428_tagSCBuffRefresh>();
+ if (null != bossBattleObject)
+ {
+ buffList = bossBattleObject.buffMgr.GetBuffIconList();
+ }
+ RefreshBuff(buffList);
+ }
+
+ private void RefreshHP()
+ {
+ if (null != bossBattleObject)
+ {
+ TeamHero teamHero = bossBattleObject.teamHero;
+ bossLifeBar.Show((ulong)teamHero.curHp, (ulong)teamHero.maxHp);
+ }
+ }
+
+ protected override void OnDamageTaken(BattleDmgInfo info)
+ {
+ // Debug.LogError("OnDamageTaken 琚皟鐢� 璋冪敤鑰呮槸 " + info.battleHurtParam.caster.casterObj?.teamHero.name + " 瀵硅薄 " + info.battleHurtParam.hurter.hurtObj?.teamHero.name);
+ base.OnDamageTaken(info);
+
+ if (battleField == null || info.battleFieldGuid != battleField.guid)
+ return;
+
+ if (null == bossBattleObject)
+ return;
+
+ // 鈽呪槄鈽� 瀹屽叏浣跨敤 StoryBossBattleWin 鐨勯�昏緫 鈽呪槄鈽�
+ if (info.battleHurtParam.hurter.hurtObj != null && bossBattleObject.teamHero.ObjID == info.battleHurtParam.hurter.hurtObj.teamHero.ObjID)
+ {
+ bossLifeBar.Show((ulong)info.battleHurtParam.hurter.toHp, (ulong)bossBattleObject.teamHero.maxHp);
+ }
+ else if (info.battleHurtParam.caster.casterObj != null && bossBattleObject.teamHero.ObjID == info.battleHurtParam.caster.casterObj.teamHero.ObjID)
+ {
+ bossLifeBar.Show((ulong)info.battleHurtParam.caster.toHp, (ulong)bossBattleObject.teamHero.maxHp);
+ }
+ }
+
+ protected override void OnClose()
+ {
+ base.OnClose();
+ }
+
+ public void DisplaySkillWordsList(NPCLineupConfig lineUPConfig)
+ {
+ if (skillWordCells.IsNullOrEmpty())
+ return;
+
+ if (null == lineUPConfig)
+ return;
+
+ for (int i = 0; i < skillWordCells.Length; i++)
+ {
+ if (i < lineUPConfig.SkillIDExList.Length)
+ {
+ skillWordCells[i].SetActive(true);
+ int skillID = lineUPConfig.SkillIDExList[i];
+ skillWordCells[i].Init(skillID, () =>
+ {
+ SmallTipWin.showText = Language.Get("SmallTipFomat", SkillConfig.Get(skillID)?.SkillName, SkillConfig.Get(skillID)?.Description);
+ SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition);
+ SmallTipWin.isDownShow = true;
+ UIManager.Instance.OpenWindow<SmallTipWin>();
+ });
+ }
+ else
+ {
+ skillWordCells[i].SetActive(false);
+ }
+ }
+ }
+
+ public void RefreshBuff(List<HB428_tagSCBuffRefresh> datas)
+ {
+ if (buffCells == null)
+ {
+ for (int i = 0; i < buffCells.Count; i++)
+ {
+ buffCells[i].SetActive(false);
+ }
+ }
+ else
+ {
+ for (int i = 0; i < buffCells.Count; i++)
+ {
+ if (i < datas.Count)
+ {
+ buffCells[i].SetActive(true);
+ HB428_tagSCBuffRefresh buffData = datas[i];
+ SkillConfig skillConfig = SkillConfig.Get((int)buffData.SkillID);
+ buffCells[i].Init(buffData, () =>
+ {
+ // 鐐瑰嚮buff鍥炬爣 鏄剧ずbuff鎻忚堪/褰撳墠韬笂鎵�鏈塨uff
+ });
+ }
+ else
+ {
+ buffCells[i].SetActive(false);
+ }
+ }
+ }
+ }
+
+ bool IsOpenBattleChangeTab()
+ {
+ return FuncOpen.Instance.IsFuncOpen(ArenaManager.Instance.BattleChangeTabFuncId);
+ }
+
+ List<TeamHero> GetTeamHeroList(List<BattleObject> teams)
+ {
+ List<TeamHero> teamHeroes = new List<TeamHero>();
+ if (teams.IsNullOrEmpty())
+ return teamHeroes;
+ foreach (var item in teams)
+ {
+ teamHeroes.Add(item.teamHero);
+ }
+ return teamHeroes;
+
+ }
+}
\ No newline at end of file
diff --git a/Main/System/Battle/WarlordPavilionBattleWin.cs.meta b/Main/System/Battle/WarlordPavilionBattleWin.cs.meta
new file mode 100644
index 0000000..5b94162
--- /dev/null
+++ b/Main/System/Battle/WarlordPavilionBattleWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: fc7f3f13231e1b449a1f66527363b427
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/ChallengeTab/WarlordPavilionTabHandler.cs b/Main/System/ChallengeTab/WarlordPavilionTabHandler.cs
new file mode 100644
index 0000000..175e498
--- /dev/null
+++ b/Main/System/ChallengeTab/WarlordPavilionTabHandler.cs
@@ -0,0 +1,63 @@
+using System;
+using System.Collections.Generic;
+
+public class WarlordPavilionTabHandler : BaseChallengeTabHandler
+{
+ protected override int GetIndex() => 4;
+ protected override int GetOpenState() => 0; // 0=FuncID
+ protected override int GetFuncId() => (int)FuncOpenEnum.WarlordPavilion;
+ protected override int GetRedpointId() => MainRedDot.WarlordPavilionRepoint;
+
+ protected override string GetCountInfo()
+ {
+ WarlordPavilionManager.Instance.TryGetShowLayerNumAndLevelNum(out int layerNum, out int levelNum);
+ return UIHelper.AppendColor(TextColType.Green, Language.Get("WarlordPavilion29", Language.Get("Arena15", layerNum, levelNum)));
+ }
+
+ protected override Action GetOnClickAction()
+ {
+ return HandleBoneFieldNavigation;
+ }
+
+ private void HandleBoneFieldNavigation()
+ {
+ if (!FuncOpen.Instance.IsFuncOpen(GetFuncId(), true))
+ return;
+ UIManager.Instance.CloseWindow<ChallengeTabWin>();
+
+ BattleField battleField = BattleManager.Instance.GetBattleFieldByMapID(WarlordPavilionManager.Instance.DataMapID);
+ if (battleField != null)
+ {
+ WarlordPavilionBattleWin battleWin;
+ if (!UIManager.Instance.IsOpened<WarlordPavilionBattleWin>())
+ {
+ battleWin = UIManager.Instance.OpenWindow<WarlordPavilionBattleWin>();
+ }
+ else
+ {
+ battleWin = UIManager.Instance.GetUI<WarlordPavilionBattleWin>();
+ }
+ battleWin.SetBattleField(battleField as WarlordPavilionBattleField);
+ }
+ else
+ {
+ UIManager.Instance.OpenWindow<WarlordPavilionWin>();
+ }
+ }
+
+ protected override void SubscribeToSpecificEvents()
+ {
+ WarlordPavilionManager.Instance.OnUpdateDingjungeInfoEvent += OnUpdateDingjungeInfoEvent;
+ }
+
+ protected override void UnsubscribeFromSpecificEvents()
+ {
+ WarlordPavilionManager.Instance.OnUpdateDingjungeInfoEvent -= OnUpdateDingjungeInfoEvent;
+ }
+
+ private void OnUpdateDingjungeInfoEvent(List<int> indexs)
+ {
+ Refresh();
+ }
+
+}
\ No newline at end of file
diff --git a/Main/System/ChallengeTab/WarlordPavilionTabHandler.cs.meta b/Main/System/ChallengeTab/WarlordPavilionTabHandler.cs.meta
new file mode 100644
index 0000000..d4f3bb3
--- /dev/null
+++ b/Main/System/ChallengeTab/WarlordPavilionTabHandler.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 9c12a549ffaac2d46b8221a69c966eba
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/Redpoint/MainRedDot.cs b/Main/System/Redpoint/MainRedDot.cs
index da94e4e..3dde9e3 100644
--- a/Main/System/Redpoint/MainRedDot.cs
+++ b/Main/System/Redpoint/MainRedDot.cs
@@ -142,6 +142,7 @@
public const int FunctionPreviewRepoint = 474; //鍔熻兘棰勫憡
public const int HeroFatesRepoint = 475;//瀹跨紭
public const int DailyTehui = 476;//姣忔棩鐗规儬
+ public const int WarlordPavilionRepoint = 477;//瀹氬啗闃�
public void Register()
{
diff --git a/Main/System/Settlement/BattleSettlementManager.cs b/Main/System/Settlement/BattleSettlementManager.cs
index 4664dfa..dcadce9 100644
--- a/Main/System/Settlement/BattleSettlementManager.cs
+++ b/Main/System/Settlement/BattleSettlementManager.cs
@@ -50,6 +50,9 @@
case BattleConst.TianziBillboradBattleField:
PopupWindowsProcessor.Instance.Add("TianziBillboradVictoryWin", false, BattleConst.TianziBillboradBattleField);
break;
+ case BattleConst.WarlordPavilionBattleField:
+ PopupWindowsProcessor.Instance.Add(isWin ? "WarlordPavilionVictoryWin" : "WarlordPavilionFailWin", false, BattleConst.WarlordPavilionBattleField);
+ break;
default:
PopupWindowsProcessor.Instance.Add(isWin ? "BattleVictoryWin" : "BattleFailWin", false, BattleConst.StoryBossBattleField);
break;
@@ -84,6 +87,16 @@
case BattleConst.TianziBillboradBattleField:
TianziBillboradManager.Instance.isSweepVictory = false;
UIManager.Instance.OpenWindow<TianziBillboradVictoryWin>();
+ break;
+ case BattleConst.WarlordPavilionBattleField:
+ if (isWin)
+ {
+ UIManager.Instance.OpenWindow<WarlordPavilionVictoryWin>();
+ }
+ else
+ {
+ UIManager.Instance.OpenWindow<WarlordPavilionFailWin>();
+ }
break;
default:
if (isWin)
@@ -246,7 +259,7 @@
UIManager.Instance.CloseWindow<MapLoadingWin>();
if (mapID == 2)
{
- AutoFightModel.Instance.isPause = false;
+ AutoFightModel.Instance.isPause = false;
}
}
}
@@ -319,6 +332,7 @@
case BattleConst.StoryBossBattleField:
case BattleConst.BoneBattleField:
case BattleConst.TianziBillboradBattleField:
+ case BattleConst.WarlordPavilionBattleField:
BattleObject bossBattleObject = battleField.FindBoss();
if (bossBattleObject == null || bossBattleObject.teamHero == null)
return detailName;
diff --git a/Main/System/Settlement/WarlordPavilionFailWin.cs b/Main/System/Settlement/WarlordPavilionFailWin.cs
new file mode 100644
index 0000000..38554be
--- /dev/null
+++ b/Main/System/Settlement/WarlordPavilionFailWin.cs
@@ -0,0 +1,54 @@
+using UnityEngine;
+using UnityEngine.UI;
+
+//鎴樺満缁撶畻鐣岄潰锛屽瓨鍦ㄥ涓殑鎯呭喌
+public class WarlordPavilionFailWin : UIBase
+{
+ [SerializeField] TextEx txtFuncName;
+ [SerializeField] Button tipHeroCultivateBtn;
+ [SerializeField] Button tipEquipBtn;
+ [SerializeField] Button tipHeroPosBtn;
+ [SerializeField] ButtonEx detailBtn;
+ string battleName = BattleConst.WarlordPavilionBattleField;
+ protected override void InitComponent()
+ {
+ tipHeroCultivateBtn.AddListener(() =>
+ {
+ CloseWindow();
+ });
+
+ tipEquipBtn.AddListener(() =>
+ {
+ CloseWindow();
+ });
+
+ tipHeroPosBtn.AddListener(() =>
+ {
+ CloseWindow();
+ UIManager.Instance.OpenWindow<HeroPosWin>();
+ });
+
+ detailBtn.SetListener(() =>
+ {
+ BattleSettlementManager.Instance.OpenBattleDetailWin(battleName);
+ });
+ }
+
+ protected override void OnPreOpen()
+ {
+ int funcId = (int)FuncOpenEnum.WarlordPavilion;
+ txtFuncName.text = FuncOpenLVConfig.HasKey(funcId) ? FuncOpenLVConfig.Get(funcId).Name : string.Empty;
+ if (!FirstChargeManager.Instance.GetLocalFail())
+ {
+ FirstChargeManager.Instance.SetLocalFail();
+ }
+ FirstChargeManager.Instance.TryPopWin();
+ }
+
+
+ protected override void OnPreClose()
+ {
+ BattleSettlementManager.Instance.WinShowOver(battleName);
+ }
+
+}
\ No newline at end of file
diff --git a/Main/System/Settlement/WarlordPavilionFailWin.cs.meta b/Main/System/Settlement/WarlordPavilionFailWin.cs.meta
new file mode 100644
index 0000000..64a9775
--- /dev/null
+++ b/Main/System/Settlement/WarlordPavilionFailWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 7680971ec5970cd45a4c6dbd6ba705bb
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/Settlement/WarlordPavilionVictoryWin.cs b/Main/System/Settlement/WarlordPavilionVictoryWin.cs
new file mode 100644
index 0000000..dcacf58
--- /dev/null
+++ b/Main/System/Settlement/WarlordPavilionVictoryWin.cs
@@ -0,0 +1,86 @@
+using System.Collections.Generic;
+using Cysharp.Threading.Tasks;
+using UnityEngine;
+
+public class WarlordPavilionVictoryWin : UIBase
+{
+ [SerializeField] ButtonEx detailBtn;
+ [SerializeField] TextEx txtFuncName;
+ [SerializeField] ScrollerController scroller;
+
+ string battleName = BattleConst.WarlordPavilionBattleField;
+
+ protected override void InitComponent()
+ {
+ detailBtn.SetListener(() =>
+ {
+ BattleSettlementManager.Instance.OpenBattleDetailWin(battleName);
+ });
+ }
+
+ protected override void OnPreOpen()
+ {
+ scroller.OnRefreshCell += OnRefreshCell;
+ CreateScroller();
+ int funcId = (int)FuncOpenEnum.WarlordPavilion;
+ txtFuncName.text = FuncOpenLVConfig.HasKey(funcId) ? FuncOpenLVConfig.Get(funcId).Name : string.Empty;
+ }
+
+
+ protected override void OnPreClose()
+ {
+ scroller.OnRefreshCell -= OnRefreshCell;
+ BattleSettlementManager.Instance.WinShowOver(battleName);
+ }
+
+ List<Item> showItems = new List<Item>();
+ void CreateScroller()
+ {
+ var jsonData = BattleSettlementManager.Instance.GetBattleSettlement(battleName);
+ if (jsonData == null)
+ {
+ DelayCloseWindow().Forget();
+ return;
+ }
+ showItems.Clear();
+ scroller.Refresh();
+
+ if (!jsonData.ContainsKey("itemInfo"))
+ {
+ return;
+ }
+
+ var resultStr = jsonData["itemInfo"];
+ for (int i = 0; i < resultStr.Count; i++)
+ {
+ showItems.Add(new Item((int)resultStr[i]["ItemID"], (long)resultStr[i]["Count"]));
+ }
+
+ showItems.Sort(SortItem);
+ for (int i = 0; i < showItems.Count; i++)
+ {
+ scroller.AddCell(ScrollerDataType.Header, i);
+ }
+ scroller.Restart();
+ }
+
+
+
+ int SortItem(Item itemA, Item itemB)
+ {
+ var itemConfigA = ItemConfig.Get(itemA.id);
+ var itemConfigB = ItemConfig.Get(itemB.id);
+ return itemConfigB.ItemColor - itemConfigA.ItemColor;
+ }
+
+
+
+
+ void OnRefreshCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell as SettlementAwardCell;
+ var item = showItems[cell.index];
+ _cell?.Display(item.id, item.countEx);
+ }
+
+}
\ No newline at end of file
diff --git a/Main/System/Settlement/WarlordPavilionVictoryWin.cs.meta b/Main/System/Settlement/WarlordPavilionVictoryWin.cs.meta
new file mode 100644
index 0000000..95e9f86
--- /dev/null
+++ b/Main/System/Settlement/WarlordPavilionVictoryWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b3c1aab8b21497246a29d15362bba684
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/ViewNPC.meta b/Main/System/ViewNPC.meta
new file mode 100644
index 0000000..7455d05
--- /dev/null
+++ b/Main/System/ViewNPC.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 575457eac14e9134f91cefacf5d696aa
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/ViewNPC/ViewNPCManager.cs b/Main/System/ViewNPC/ViewNPCManager.cs
new file mode 100644
index 0000000..8412697
--- /dev/null
+++ b/Main/System/ViewNPC/ViewNPCManager.cs
@@ -0,0 +1,146 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+using LitJson;
+
+public class ViewNPCManager : GameSystemManager<ViewNPCManager>
+{
+ public Dictionary<uint, Dictionary<uint, Dictionary<uint, ViewNPCAttr>>> dict = new Dictionary<uint, Dictionary<uint, Dictionary<uint, ViewNPCAttr>>>();
+ public override void Init()
+ {
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin;
+ }
+
+ public override void Release()
+ {
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitializeEventOnRelogin;
+ }
+
+ private void OnBeforePlayerDataInitializeEventOnRelogin()
+ {
+ dict.Clear();
+ }
+ // --- 瑙f瀽灞炴�у瓧鍏� ---
+ private Dictionary<int, long> ParseAttrDict(string jsonStr)
+ {
+ Dictionary<int, long> result = new Dictionary<int, long>();
+ if (string.IsNullOrEmpty(jsonStr)) return result;
+
+ try
+ {
+ JsonData jd = JsonMapper.ToObject(jsonStr);
+ foreach (string attrKey in jd.Keys)
+ {
+ if (int.TryParse(attrKey, out int attrId))
+ {
+ JsonData v = jd[attrKey];
+ long val = 0;
+ // 鍋ュ.鎬ф暟鍊艰浆鎹�
+ if (v.IsLong) val = (long)v;
+ else if (v.IsInt) val = (long)(int)v;
+ else if (v.IsDouble) val = (long)(double)v;
+ else if (v.IsString) long.TryParse(v.ToString(), out val);
+
+ result[attrId] = val;
+ }
+ }
+ }
+ catch (System.Exception e)
+ {
+ Debug.LogWarning($"瑙f瀽NPC灞炴�SON澶辫触: {e.Message}");
+ }
+ return result;
+ }
+
+ public event Action<uint, uint> OnUpdateViewNPCAttrRet;
+ public void UpdateViewNPCAttrRet(HB432_tagSCViewNPCAttrRet vNetData)
+ {
+ if (!dict.ContainsKey(vNetData.MapID))
+ {
+ dict[vNetData.MapID] = new Dictionary<uint, Dictionary<uint, ViewNPCAttr>>();
+ }
+
+ var mapDict = dict[vNetData.MapID];
+
+ if (!mapDict.ContainsKey(vNetData.FuncLineID))
+ {
+ mapDict[vNetData.FuncLineID] = new Dictionary<uint, ViewNPCAttr>();
+ }
+
+ var funcLineDict = mapDict[vNetData.FuncLineID];
+
+ if (vNetData.NPCAttrList != null)
+ {
+ // 浣跨敤涓存椂瀛楀吀鎸塏PCID鍒嗙粍
+ Dictionary<uint, List<HB432_tagSCViewNPCAttrRet.tagSCViewNPCAttr>> tempGroup =
+ new Dictionary<uint, List<HB432_tagSCViewNPCAttrRet.tagSCViewNPCAttr>>();
+
+ foreach (var npcAttr in vNetData.NPCAttrList)
+ {
+ uint npcID = npcAttr.NPCID;
+ if (!tempGroup.ContainsKey(npcID))
+ {
+ tempGroup[npcID] = new List<HB432_tagSCViewNPCAttrRet.tagSCViewNPCAttr>();
+ }
+ tempGroup[npcID].Add(npcAttr);
+ }
+
+ // 瀛樺叆绗�3灞傚瓧鍏�
+ foreach (var kvp in tempGroup)
+ {
+ var firstAttr = kvp.Value[0];
+ funcLineDict[kvp.Key] = new ViewNPCAttr
+ {
+ PosNum = firstAttr.PosNum,
+ NPCID = firstAttr.NPCID,
+ HeroID = firstAttr.HeroID,
+ LV = firstAttr.LV,
+ Star = firstAttr.Star,
+ BreakLV = firstAttr.BreakLV,
+ AwakeLV = firstAttr.AwakeLV,
+ AttrDict = ParseAttrDict(firstAttr.AttrMsg)
+ };
+ }
+ }
+ OnUpdateViewNPCAttrRet?.Invoke(vNetData.MapID, vNetData.FuncLineID);
+ }
+
+
+ public bool TryGetNPCAttr(uint mapID, uint funcLineID, uint npcID, out ViewNPCAttr npcAttr)
+ {
+ npcAttr = null;
+
+ if (!dict.TryGetValue(mapID, out var mapDict))
+ {
+ return false;
+ }
+
+ if (!mapDict.TryGetValue(funcLineID, out var funcLineDict))
+ {
+ return false;
+ }
+
+ return funcLineDict.TryGetValue(npcID, out npcAttr);
+ }
+
+ public void SendViewNPCAttr(uint mapID, uint funcLineID, uint viewNPCID)
+ {
+ CB416_tagCSViewNPCAttr pack = new CB416_tagCSViewNPCAttr();
+ pack.MapID = mapID;
+ pack.FuncLineID = funcLineID;
+ pack.ViewNPCID = viewNPCID;
+ GameNetSystem.Instance.SendInfo(pack);
+ }
+}
+
+public class ViewNPCAttr
+{
+ public byte PosNum; // 鍦ㄦ湰闃靛涓殑绔欎綅锛屼粠1寮�濮�
+ public uint NPCID; // 鎴樻枟NPCID锛屼笉鍚岀殑瀹炰緥ID瀵瑰簲鐨凬PCID鍙兘涓�鏍�
+ public uint HeroID; // 姝﹀皢ID锛岀帺瀹舵垨NPC鍧囧彲鑳芥湁锛屽鏋滄湁鍊煎垯澶栬鐩稿叧浠ヨ姝﹀皢涓哄噯锛屽惁鍒欎互NPCID涓哄噯
+ public ushort LV; // 绛夌骇锛岀帺瀹剁殑姝﹀皢绛夌骇鎴朜PC鎴愰暱绛夌骇锛岀瓑绾ф樉绀轰互璇ュ�间负鍑�
+ public byte Star; // 鏄熺骇
+ public byte BreakLV; // 绐佺牬
+ public byte AwakeLV; // 瑙夐啋
+ public Dictionary<int, long> AttrDict = new Dictionary<int, long>(); // 灞炴��;
+}
\ No newline at end of file
diff --git a/Main/System/ViewNPC/ViewNPCManager.cs.meta b/Main/System/ViewNPC/ViewNPCManager.cs.meta
new file mode 100644
index 0000000..ea352a2
--- /dev/null
+++ b/Main/System/ViewNPC/ViewNPCManager.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 26665bb56e360ba48883659f9df93abd
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/WarlordPavilion.meta b/Main/System/WarlordPavilion.meta
new file mode 100644
index 0000000..fd082be
--- /dev/null
+++ b/Main/System/WarlordPavilion.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: df6e40f1c2f93aa4784924dc1ea30145
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/WarlordPavilion/WarlordPavilionAwardCell.cs b/Main/System/WarlordPavilion/WarlordPavilionAwardCell.cs
new file mode 100644
index 0000000..6d1772c
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionAwardCell.cs
@@ -0,0 +1,23 @@
+using UnityEngine;
+public class WarlordPavilionAwardCell : MonoBehaviour
+{
+ [SerializeField] TextEx txtTitle;
+ [SerializeField] TextEx txtState;
+ [SerializeField] ItemCell[] itemCells;
+ [SerializeField] Color32 pass = new Color32(36, 139, 18, 255);
+ [SerializeField] Color32 noPass = new Color32(157, 112, 84, 255);
+ WarlordPavilionManager manager { get { return WarlordPavilionManager.Instance; } }
+
+ public void Display(int needLayer, int historyMaxLayer)
+ {
+ if (!FBDJGQuickConfig.HasKey(needLayer))
+ return;
+ FBDJGQuickConfig fBDJGQuickConfig = FBDJGQuickConfig.Get(needLayer);
+ txtTitle.text = Language.Get("WarlordPavilion15", needLayer);
+ bool isPass = needLayer <= historyMaxLayer;
+ txtState.text = Language.Get(isPass ? "WarlordPavilion13" : "WarlordPavilion14");
+ txtState.color = isPass ? pass : noPass;
+ manager.DisplayItemCell(itemCells, fBDJGQuickConfig.QuickAwardList);
+ }
+
+}
\ No newline at end of file
diff --git a/Main/System/WarlordPavilion/WarlordPavilionAwardCell.cs.meta b/Main/System/WarlordPavilion/WarlordPavilionAwardCell.cs.meta
new file mode 100644
index 0000000..a4576c7
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionAwardCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6d64090da81e2634ea818bac6c36d145
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/WarlordPavilion/WarlordPavilionAwardWin.cs b/Main/System/WarlordPavilion/WarlordPavilionAwardWin.cs
new file mode 100644
index 0000000..57a250a
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionAwardWin.cs
@@ -0,0 +1,48 @@
+using System.Collections.Generic;
+using UnityEngine;
+public class WarlordPavilionAwardWin : UIBase
+{
+ [SerializeField] ScrollerController scrAward;
+ WarlordPavilionManager manager { get { return WarlordPavilionManager.Instance; } }
+
+ protected override void OnPreOpen()
+ {
+ scrAward.OnRefreshCell += OnRefreshCell;
+ CreateScroller();
+ }
+
+ protected override void OnPreClose()
+ {
+ scrAward.OnRefreshCell -= OnRefreshCell;
+ }
+
+ int historyMaxLayerNum;
+ private void OnRefreshCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell.GetComponent<WarlordPavilionAwardCell>();
+ _cell?.Display(cell.index, historyMaxLayerNum);
+ }
+
+ private void CreateScroller()
+ {
+ manager.GetHistoryMaxPassLayerNum(out historyMaxLayerNum);
+
+ int jumpIndex = 0;
+ scrAward.Refresh();
+ List<int> list = manager.GetAwardList();
+ if (!list.IsNullOrEmpty())
+ {
+ for (int i = 0; i < list.Count; i++)
+ {
+ int needLayer = list[i];
+ if (needLayer <= historyMaxLayerNum)
+ {
+ jumpIndex = i;
+ }
+ scrAward.AddCell(ScrollerDataType.Header, needLayer);
+ }
+ }
+ scrAward.Restart();
+ scrAward.JumpIndex(jumpIndex);
+ }
+}
\ No newline at end of file
diff --git a/Main/System/WarlordPavilion/WarlordPavilionAwardWin.cs.meta b/Main/System/WarlordPavilion/WarlordPavilionAwardWin.cs.meta
new file mode 100644
index 0000000..0419683
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionAwardWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: adedcbbf6fe04e8488e61002e7ca67d3
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/WarlordPavilion/WarlordPavilionBonusPreseCell.cs b/Main/System/WarlordPavilion/WarlordPavilionBonusPreseCell.cs
new file mode 100644
index 0000000..76408f2
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionBonusPreseCell.cs
@@ -0,0 +1,90 @@
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+public class WarlordPavilionBonusPreseCell : MonoBehaviour
+{
+ [SerializeField] TextEx txtNum;
+ [SerializeField] Dropdown dropdown;
+ WarlordPavilionManager manager { get { return WarlordPavilionManager.Instance; } }
+ int index;
+ List<int> attrIds;
+
+ public void Display(int index)
+ {
+ this.index = index;
+ txtNum.text = Language.Get("WarlordPavilion19", index + 1);
+
+ InitializeDropdown();
+ }
+
+ void InitializeDropdown()
+ {
+ dropdown.onValueChanged.RemoveAllListeners();
+ attrIds = manager.GetAttrIds();
+ if (attrIds.IsNullOrEmpty())
+ return;
+ List<string> options = manager.GetOptions();
+ if (options.IsNullOrEmpty())
+ return;
+ dropdown.ClearOptions();
+ dropdown.AddOptions(options);
+ RefreshCheckmarks();
+
+ int defaultValue = 0; // 榛樿閫変腑"鏃�"
+
+ ushort[] chooseAttrIDList = manager.GetChooseAttrIDList();
+ if (chooseAttrIDList.IsNullOrEmpty() || index < 0 || index >= chooseAttrIDList.Length)
+ return;
+
+ int savedAttrId = chooseAttrIDList[index];
+ if (savedAttrId > 0) // 鎺掗櫎"鏃�"閫夐」
+ {
+ int savedIndex = attrIds.IndexOf(savedAttrId);
+ if (savedIndex >= 0)
+ {
+ defaultValue = savedIndex + 1; // +1 鏄洜涓虹涓�涓�夐」鏄�"鏃�"
+ }
+ }
+
+ dropdown.value = defaultValue;
+ dropdown.onValueChanged.AddListener(OnDropdownValueChanged);
+ }
+
+ // 鍒锋柊鎵�鏈夐�夐」鐨勫嬀閫夌姸鎬�
+ // 鍒锋柊鎵�鏈夐�夐」鐨勫嬀閫夌姸鎬�
+ void RefreshCheckmarks()
+ {
+ ushort[] chooseAttrIDList = manager.GetChooseAttrIDList();
+ if (chooseAttrIDList.IsNullOrEmpty())
+ return;
+ var dict = manager.GetIndexToAttrIds();
+
+ for (int i = 0; i < dropdown.options.Count; i++)
+ {
+ // 濡傛灉瀛楀吀涓瓨鍦ㄨ绱㈠紩锛岃幏鍙栧搴旂殑attrId
+ if (dict.TryGetValue(i, out int attrId))
+ {
+ // 妫�鏌ttrId鏄惁鍦╟hooseAttrIDList涓瓨鍦紙琚叾浠朿ell閫変腑锛�
+ bool isChecked = Array.Exists(chooseAttrIDList, id => id == attrId);
+
+ }
+ }
+ }
+
+ public void OnDropdownValueChanged(int selectedIndex)
+ {
+ if (attrIds.IsNullOrEmpty() || selectedIndex < 0 || selectedIndex >= attrIds.Count)
+ return;
+
+ if (selectedIndex <= 0)
+ {
+ // 閫変腑"鏃�"閫夐」
+ manager.SetChooseAttrIDList(index, 0);
+ return;
+ }
+
+ int selectedAttrId = attrIds[selectedIndex - 1];
+ manager.SetChooseAttrIDList(index, selectedAttrId);
+ }
+}
\ No newline at end of file
diff --git a/Main/System/WarlordPavilion/WarlordPavilionBonusPreseCell.cs.meta b/Main/System/WarlordPavilion/WarlordPavilionBonusPreseCell.cs.meta
new file mode 100644
index 0000000..5e6b689
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionBonusPreseCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b1360540210575a449ccbdd082ee4264
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/WarlordPavilion/WarlordPavilionBonusPresetWin.cs b/Main/System/WarlordPavilion/WarlordPavilionBonusPresetWin.cs
new file mode 100644
index 0000000..f81dcbf
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionBonusPresetWin.cs
@@ -0,0 +1,78 @@
+using System.Collections.Generic;
+using UnityEngine;
+public class WarlordPavilionBonusPresetWin : UIBase
+{
+ [SerializeField] ScrollerController scroller;
+ [SerializeField] ButtonEx btnOpen; //寮�鍚璁�
+ [SerializeField] ButtonEx btnClose; //鍏抽棴棰勮
+ WarlordPavilionManager manager { get { return WarlordPavilionManager.Instance; } }
+ protected override void InitComponent()
+ {
+ btnOpen.SetListener(() =>
+ {
+ ushort[] choose = manager.GetChooseAttrIDList();
+ manager.SendDingjungeEffSet(true, choose);
+ });
+ btnClose.SetListener(() =>
+ {
+ ushort[] choose = manager.GetChooseAttrIDList();
+ manager.SendDingjungeEffSet(false, choose);
+ });
+ }
+
+ protected override void OnPreOpen()
+ {
+ scroller.OnRefreshCell += OnRefreshCell;
+ manager.OnChooseAttrIDListChangeEvent += OnChooseAttrIDListChangeEvent;
+ manager.OnUpdateDingjungeInfoEvent += OnUpdateDingjungeInfoEvent;
+ Display();
+ CreateScroller();
+ bool isTodayShowSelectBonusRed = manager.IsTodayShowSelectBonusRed();
+ if (isTodayShowSelectBonusRed)
+ {
+ manager.SetLoacl();
+ manager.UpdateRedpoint();
+ }
+ }
+
+ protected override void OnPreClose()
+ {
+ scroller.OnRefreshCell -= OnRefreshCell;
+ manager.OnChooseAttrIDListChangeEvent -= OnChooseAttrIDListChangeEvent;
+ manager.OnUpdateDingjungeInfoEvent -= OnUpdateDingjungeInfoEvent;
+ }
+
+ private void OnUpdateDingjungeInfoEvent(List<int> indexs)
+ {
+ Display();
+ scroller.m_Scorller.RefreshActiveCellViews();
+ }
+
+ private void OnChooseAttrIDListChangeEvent()
+ {
+ scroller.m_Scorller.RefreshActiveCellViews();
+ }
+
+ private void OnRefreshCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell.GetComponent<WarlordPavilionBonusPreseCell>();
+ _cell?.Display(cell.index);
+ }
+
+ private void CreateScroller()
+ {
+ manager.SetChooseAttrIDList();
+ scroller.Refresh();
+ for (int i = 0; i < manager.bonusPresetMaxCnt; i++)
+ {
+ scroller.AddCell(ScrollerDataType.Header, i);
+ }
+ scroller.Restart();
+ }
+
+ private void Display()
+ {
+ btnOpen.SetActive(!manager.IsAutoPresetOn());
+ btnClose.SetActive(manager.IsAutoPresetOn());
+ }
+}
\ No newline at end of file
diff --git a/Main/System/WarlordPavilion/WarlordPavilionBonusPresetWin.cs.meta b/Main/System/WarlordPavilion/WarlordPavilionBonusPresetWin.cs.meta
new file mode 100644
index 0000000..b440863
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionBonusPresetWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4fff8e65184e70d46875dc2c53eca00f
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/WarlordPavilion/WarlordPavilionDropdownItem.cs b/Main/System/WarlordPavilion/WarlordPavilionDropdownItem.cs
new file mode 100644
index 0000000..bfcd90a
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionDropdownItem.cs
@@ -0,0 +1,50 @@
+
+using UnityEngine;
+using UnityEngine.UI;
+public class WarlordPavilionDropdownItem : MonoBehaviour
+{
+ [SerializeField] Text txtTitle;
+ [SerializeField] Image imgCheck;
+ [SerializeField] Color32 selectCol;
+ [SerializeField] Color32 unSelectCol;
+ WarlordPavilionManager manager { get { return WarlordPavilionManager.Instance; } }
+ void Start()
+ {
+ int myIndex = Mathf.Max(transform.GetSiblingIndex()-1,0);
+
+ var dict = manager.GetIndexToAttrIds();
+ if (dict == null)
+ return;
+
+ if (myIndex == 0)
+ {
+ ShowDefault();
+ return;
+ }
+
+
+ if (!dict.ContainsKey(myIndex))
+ {
+ ShowDefault();
+ return;
+ }
+
+
+ int attrID = dict[myIndex];
+ int index = manager.IndexOf(attrID);
+ if (index < 0)
+ {
+ ShowDefault();
+ return;
+ }
+
+ txtTitle.color = selectCol;
+ imgCheck.SetActive(true);
+ }
+
+ public void ShowDefault()
+ {
+ txtTitle.color = unSelectCol;
+ imgCheck.SetActive(false);
+ }
+}
\ No newline at end of file
diff --git a/Main/System/WarlordPavilion/WarlordPavilionDropdownItem.cs.meta b/Main/System/WarlordPavilion/WarlordPavilionDropdownItem.cs.meta
new file mode 100644
index 0000000..72150d6
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionDropdownItem.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 418a93fb8f74ef94890e0fc7bc00f856
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/WarlordPavilion/WarlordPavilionGiftCell.cs b/Main/System/WarlordPavilion/WarlordPavilionGiftCell.cs
new file mode 100644
index 0000000..10e3eca
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionGiftCell.cs
@@ -0,0 +1,258 @@
+锘縰sing UnityEngine;
+using UnityEngine.UI;
+public class WarlordPavilionGiftCell : MonoBehaviour
+{
+
+ Image m_QualityBG;
+ Image qualityBG
+ {
+ get
+ {
+ if (m_QualityBG == null)
+ {
+ m_QualityBG = this.transform.GetComponent<Image>("Container_GiftCell/qualityIcon");
+ }
+ return m_QualityBG;
+ }
+ }
+
+ Button m_GiftBtn;
+ Button giftBtn
+ {
+ get
+ {
+ if (m_GiftBtn == null)
+ {
+ m_GiftBtn = this.transform.GetComponent<Button>("Container_GiftCell");
+ }
+ return m_GiftBtn;
+ }
+ }
+
+
+ Text m_GiftName;
+ Text giftName
+ {
+ get
+ {
+ if (m_GiftName == null)
+ {
+ m_GiftName = this.transform.GetComponent<Text>("Container_GiftCell/name");
+ }
+ return m_GiftName;
+ }
+ }
+
+ OutlineEx m_TextOutline;
+ OutlineEx textOutline
+ {
+ get
+ {
+ if (m_TextOutline == null)
+ {
+ m_TextOutline = this.transform.GetComponent<OutlineEx>("Container_GiftCell/name");
+ }
+ return m_TextOutline;
+ }
+ }
+
+ Transform m_LvRect;
+ Transform lvRect
+ {
+ get
+ {
+ if (m_LvRect == null)
+ {
+ m_LvRect = this.transform.Find("Container_GiftCell/lvrect");
+ }
+ return m_LvRect;
+ }
+ }
+
+ Text m_LvText;
+ Text lvText
+ {
+ get
+ {
+ if (m_LvText == null)
+ {
+ m_LvText = this.transform.GetComponent<Text>("Container_GiftCell/lvrect/lv");
+ }
+ return m_LvText;
+ }
+ }
+
+ Image m_StateImg;
+ Image stateImg
+ {
+ get
+ {
+ if (m_StateImg == null)
+ {
+ m_StateImg = this.transform.GetComponent<Image>("Container_GiftCell/state");
+ }
+ return m_StateImg;
+ }
+ }
+
+ Image m_AwakeLockImg; //閲嶇敓闄嶄綆瑙夐啋绛夌骇閿佸畾鐨勫浘鐗�
+ Image awakeLockImg
+ {
+ get
+ {
+ if (m_AwakeLockImg == null)
+ {
+ m_AwakeLockImg = this.transform.GetComponent<Image>("Container_GiftCell/lock");
+ }
+ return m_AwakeLockImg;
+ }
+ }
+
+
+ void Awake()
+ {
+ LoadPrefab();
+ }
+
+ //showState 0锛氫笉鏄剧ず 1锛氭柊澧� 2锛氭彁鍗�
+ public void Init(int giftID, int lv, int showState = 0, bool isShowTip = true)
+ {
+ LoadPrefab(); //瀛樺湪琚嵏杞界殑鍙兘锛岄噸鏂板姞杞�
+ if (FBDJGEffectConfig.HasKey(giftID))
+ {
+ var config = FBDJGEffectConfig.Get(giftID);
+ qualityBG.SetSprite("GiftQualityBG" + config.EffQuality);
+ giftName.text = config.Name;
+ giftName.color = GetColor(config.EffQuality);
+ textOutline.OutlineColor = GetOutlineColor(config.EffQuality);
+ lvText.text = lv.ToString();
+ lvRect.SetActive(lv > 0);
+ stateImg.SetActive(showState > 0);
+ stateImg.SetSprite("GiftState" + showState);
+ stateImg.SetNativeSize();
+
+ }
+ else
+ {
+ qualityBG.SetSprite("GiftQualityBG" + giftID);
+ giftName.text = string.Empty;
+ lvRect.SetActive(false);
+ stateImg.SetActive(false);
+ awakeLockImg.SetActive(false);
+ }
+ giftBtn.AddListener(() =>
+ {
+ if (isShowTip)
+ {
+ ShowSmallTip(giftID, lv);
+ }
+ });
+ }
+
+ void ShowSmallTip(int giftID, int giftLV)
+ {
+ SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition);
+ if (giftID > 0)
+ {
+ var giftConfig = FBDJGEffectConfig.Get(giftID);
+ SmallTipWin.showText = Language.Get("SmallTipFomat", giftConfig.Name + " " + Language.Get("L1113", giftLV),
+ Language.Get("HeroGift5", PlayerPropertyConfig.Get(giftConfig.AttrID).Name, PlayerPropertyConfig.GetValueDescription(giftConfig.AttrID, giftConfig.AttrValue * giftLV)));
+ UIManager.Instance.OpenWindow<SmallTipWin>();
+ }
+
+ }
+
+
+ Color32 GetColor(int quality)
+ {
+ if (quality == 1)
+ {
+ //D196FF
+ return new Color32(209, 150, 255, 255);
+ }
+ else if (quality == 2)
+ {
+ //ffda8c
+ return new Color32(255, 218, 140, 255);
+ }
+ else if (quality == 3)
+ {
+ //ffbd88
+ return new Color32(255, 189, 136, 255);
+ }
+ else if (quality == 4)
+ {
+ //ff8888
+ return new Color32(255, 136, 136, 255);
+ }
+ return new Color32(255, 255, 255, 255);
+ }
+
+ Color32 GetOutlineColor(int quality)
+ {
+ if (quality == 1)
+ {
+ //692088
+ return new Color32(105, 32, 136, 128);
+ }
+ else if (quality == 2)
+ {
+ //886220
+ return new Color32(136, 98, 32, 128);
+ }
+ else if (quality == 3)
+ {
+ //884a20
+ return new Color32(136, 74, 32, 128);
+ }
+ else if (quality == 4)
+ {
+ //882020
+ return new Color32(136, 32, 32, 128);
+ }
+ return new Color32(0, 0, 0, 128);
+ }
+
+ GameObject cellContainer;
+ protected void LoadPrefab()
+ {
+ if (cellContainer != null)
+ return;
+
+ var tmp = transform.Find("Container_GiftCell");
+ if (tmp != null)
+ {
+ cellContainer = tmp.gameObject;
+ return;
+ }
+ if (cellContainer == null)
+ {
+ cellContainer = UIUtility.CreateWidget("GiftBaseCell", "Container_GiftCell");
+
+ if (cellContainer != null)
+ {
+ cellContainer.transform.SetParentEx(this.transform, Vector3.zero, Quaternion.identity, Vector3.one);
+ cellContainer.transform.SetAsFirstSibling();
+ }
+ }
+
+ //缂╂斁鍒板拰鐖秗ect涓�鏍峰ぇ
+ var scale = 1f;
+ var rect = cellContainer.GetComponent<RectTransform>();
+ var parentRect = transform.GetComponent<RectTransform>();
+ float width = parentRect.sizeDelta.x;
+ if (width <= 0f)
+ {
+ //澶栭儴鎺у埗浜嗗昂瀵歌幏鍙栦负0
+ GridLayoutGroup grid = GetComponentInParent<GridLayoutGroup>();
+ if (grid != null)
+ {
+ width = grid.cellSize.x;
+ }
+
+ }
+ scale = width / rect.sizeDelta.x;
+ cellContainer.transform.localScale = cellContainer.transform.localScale * scale;
+ }
+}
+
diff --git a/Main/System/WarlordPavilion/WarlordPavilionGiftCell.cs.meta b/Main/System/WarlordPavilion/WarlordPavilionGiftCell.cs.meta
new file mode 100644
index 0000000..9d9a4cb
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionGiftCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e3e3ef1c58f0527418883447a7ca3746
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/WarlordPavilion/WarlordPavilionGiftDiyButtonCell.cs b/Main/System/WarlordPavilion/WarlordPavilionGiftDiyButtonCell.cs
new file mode 100644
index 0000000..612d0c7
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionGiftDiyButtonCell.cs
@@ -0,0 +1,268 @@
+锘縰sing UnityEngine;
+using UnityEngine.Events;
+using UnityEngine.UI;
+public class WarlordPavilionGiftDiyButtonCell : MonoBehaviour
+{
+
+ Image m_QualityBG;
+ Image qualityBG
+ {
+ get
+ {
+ if (m_QualityBG == null)
+ {
+ m_QualityBG = this.transform.GetComponent<Image>("Container_GiftCell/qualityIcon");
+ }
+ return m_QualityBG;
+ }
+ }
+
+ Button m_GiftBtn;
+ Button giftBtn
+ {
+ get
+ {
+ if (m_GiftBtn == null)
+ {
+ m_GiftBtn = this.transform.GetComponent<Button>("Container_GiftCell");
+ }
+ return m_GiftBtn;
+ }
+ }
+
+
+ Text m_GiftName;
+ Text giftName
+ {
+ get
+ {
+ if (m_GiftName == null)
+ {
+ m_GiftName = this.transform.GetComponent<Text>("Container_GiftCell/name");
+ }
+ return m_GiftName;
+ }
+ }
+
+ OutlineEx m_TextOutline;
+ OutlineEx textOutline
+ {
+ get
+ {
+ if (m_TextOutline == null)
+ {
+ m_TextOutline = this.transform.GetComponent<OutlineEx>("Container_GiftCell/name");
+ }
+ return m_TextOutline;
+ }
+ }
+
+ Transform m_LvRect;
+ Transform lvRect
+ {
+ get
+ {
+ if (m_LvRect == null)
+ {
+ m_LvRect = this.transform.Find("Container_GiftCell/lvrect");
+ }
+ return m_LvRect;
+ }
+ }
+
+ Text m_LvText;
+ Text lvText
+ {
+ get
+ {
+ if (m_LvText == null)
+ {
+ m_LvText = this.transform.GetComponent<Text>("Container_GiftCell/lvrect/lv");
+ }
+ return m_LvText;
+ }
+ }
+
+ Image m_StateImg;
+ Image stateImg
+ {
+ get
+ {
+ if (m_StateImg == null)
+ {
+ m_StateImg = this.transform.GetComponent<Image>("Container_GiftCell/state");
+ }
+ return m_StateImg;
+ }
+ }
+
+ Image m_AwakeLockImg; //閲嶇敓闄嶄綆瑙夐啋绛夌骇閿佸畾鐨勫浘鐗�
+ Image awakeLockImg
+ {
+ get
+ {
+ if (m_AwakeLockImg == null)
+ {
+ m_AwakeLockImg = this.transform.GetComponent<Image>("Container_GiftCell/lock");
+ }
+ return m_AwakeLockImg;
+ }
+ }
+
+
+ void Awake()
+ {
+ LoadPrefab();
+ }
+ private bool hasCustomListener = false;
+
+ // 璁剧疆鑷畾涔夌洃鍚櫒
+ public void SetListener(UnityAction action)
+ {
+ hasCustomListener = true; // 鏍囪宸茶缃嚜瀹氫箟鐩戝惉
+ giftBtn.SetListener(action);
+ }
+
+ //showState 0锛氫笉鏄剧ず 1锛氭柊澧� 2锛氭彁鍗�
+ public void Init(int giftID, int lv, int showState = 0)
+ {
+ LoadPrefab(); //瀛樺湪琚嵏杞界殑鍙兘锛岄噸鏂板姞杞�
+ if (FBDJGEffectConfig.HasKey(giftID))
+ {
+ var config = FBDJGEffectConfig.Get(giftID);
+ qualityBG.SetSprite("GiftQualityBG" + config.EffQuality);
+ giftName.text = config.Name;
+ giftName.color = GetColor(config.EffQuality);
+ textOutline.OutlineColor = GetOutlineColor(config.EffQuality);
+ lvText.text = lv.ToString();
+ lvRect.SetActive(lv > 0);
+ stateImg.SetActive(showState > 0);
+ stateImg.SetSprite("GiftState" + showState);
+ stateImg.SetNativeSize();
+
+ }
+ else
+ {
+ qualityBG.SetSprite("GiftQualityBG" + giftID);
+ giftName.text = string.Empty;
+ lvRect.SetActive(false);
+ stateImg.SetActive(false);
+ awakeLockImg.SetActive(false);
+ }
+ // 濡傛灉宸茬粡璁剧疆浜嗚嚜瀹氫箟鐩戝惉鍣紝涓嶈鐩�
+ if (!hasCustomListener)
+ {
+ giftBtn.SetListener(() =>
+ {
+ ShowSmallTip(giftID, lv);
+ });
+ }
+ }
+
+ public void ShowSmallTip(int giftID, int giftLV)
+ {
+ SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition);
+ if (giftID > 0)
+ {
+ var giftConfig = FBDJGEffectConfig.Get(giftID);
+ SmallTipWin.showText = Language.Get("SmallTipFomat", giftConfig.Name + " " + Language.Get("L1113", giftLV),
+ Language.Get("HeroGift5", PlayerPropertyConfig.Get(giftConfig.AttrID).Name, PlayerPropertyConfig.GetValueDescription(giftConfig.AttrID, giftConfig.AttrValue * giftLV)));
+ UIManager.Instance.OpenWindow<SmallTipWin>();
+ }
+
+ }
+
+
+ Color32 GetColor(int quality)
+ {
+ if (quality == 1)
+ {
+ //D196FF
+ return new Color32(209, 150, 255, 255);
+ }
+ else if (quality == 2)
+ {
+ //ffda8c
+ return new Color32(255, 218, 140, 255);
+ }
+ else if (quality == 3)
+ {
+ //ffbd88
+ return new Color32(255, 189, 136, 255);
+ }
+ else if (quality == 4)
+ {
+ //ff8888
+ return new Color32(255, 136, 136, 255);
+ }
+ return new Color32(255, 255, 255, 255);
+ }
+
+ Color32 GetOutlineColor(int quality)
+ {
+ if (quality == 1)
+ {
+ //692088
+ return new Color32(105, 32, 136, 128);
+ }
+ else if (quality == 2)
+ {
+ //886220
+ return new Color32(136, 98, 32, 128);
+ }
+ else if (quality == 3)
+ {
+ //884a20
+ return new Color32(136, 74, 32, 128);
+ }
+ else if (quality == 4)
+ {
+ //882020
+ return new Color32(136, 32, 32, 128);
+ }
+ return new Color32(0, 0, 0, 128);
+ }
+
+ GameObject cellContainer;
+ protected void LoadPrefab()
+ {
+ if (cellContainer != null)
+ return;
+
+ var tmp = transform.Find("Container_GiftCell");
+ if (tmp != null)
+ {
+ cellContainer = tmp.gameObject;
+ return;
+ }
+ if (cellContainer == null)
+ {
+ cellContainer = UIUtility.CreateWidget("GiftBaseCell", "Container_GiftCell");
+
+ if (cellContainer != null)
+ {
+ cellContainer.transform.SetParentEx(this.transform, Vector3.zero, Quaternion.identity, Vector3.one);
+ cellContainer.transform.SetAsFirstSibling();
+ }
+ }
+
+ //缂╂斁鍒板拰鐖秗ect涓�鏍峰ぇ
+ var scale = 1f;
+ var rect = cellContainer.GetComponent<RectTransform>();
+ var parentRect = transform.GetComponent<RectTransform>();
+ float width = parentRect.sizeDelta.x;
+ if (width <= 0f)
+ {
+ //澶栭儴鎺у埗浜嗗昂瀵歌幏鍙栦负0
+ GridLayoutGroup grid = GetComponentInParent<GridLayoutGroup>();
+ if (grid != null)
+ {
+ width = grid.cellSize.x;
+ }
+
+ }
+ scale = width / rect.sizeDelta.x;
+ cellContainer.transform.localScale = cellContainer.transform.localScale * scale;
+ }
+}
+
diff --git a/Main/System/WarlordPavilion/WarlordPavilionGiftDiyButtonCell.cs.meta b/Main/System/WarlordPavilion/WarlordPavilionGiftDiyButtonCell.cs.meta
new file mode 100644
index 0000000..ea93204
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionGiftDiyButtonCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 7450261499a35894f83167fd90f9e418
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/WarlordPavilion/WarlordPavilionGiftGird.cs b/Main/System/WarlordPavilion/WarlordPavilionGiftGird.cs
new file mode 100644
index 0000000..84fe416
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionGiftGird.cs
@@ -0,0 +1,40 @@
+
+using UnityEngine;
+public class WarlordPavilionGiftGird : MonoBehaviour
+{
+ [SerializeField] ImageEx imgBG;
+ [SerializeField] Transform transUnlock;
+ [SerializeField] TextEx txtUnlock;
+ [SerializeField] ImageEx imgAdd;
+ [SerializeField] WarlordPavilionGiftCell cell;
+ [SerializeField] UIEffectPlayer effectPlayer;
+ WarlordPavilionManager manager { get { return WarlordPavilionManager.Instance; } }
+
+ public void Display(int index, bool isPlay = false)
+ {
+ effectPlayer.Stop();
+ // 0-鏈В閿� 1-宸茶В閿佹棤鏁堟灉 2-宸茶В閿佹湁鏁堟灉
+ int state = manager.GetGiftGirdState(index);
+ imgBG.SetActive(state != 2);
+ transUnlock.SetActive(state == 0);
+ imgAdd.SetActive(state == 1);
+ cell.SetActive(state == 2);
+
+ if (state == 0)
+ {
+ bool hasNeedLayerNumAndLevelNum = manager.TryGetNeedLayerNumAndLevelNum(index, out int needLayerNum, out int needLevelNum);
+ txtUnlock.text = hasNeedLayerNumAndLevelNum ? Language.Get("Arena15", needLayerNum, needLevelNum) : string.Empty;
+ }
+ if (state == 2)
+ {
+ if (!manager.TryGetEff(index, out HB202_tagSCDingjungeInfo.tagSCDingjungeEff eff))
+ return;
+ cell.Init(eff.EffID, eff.EffLV);
+ }
+ if (isPlay)
+ {
+ effectPlayer.Play();
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/Main/System/WarlordPavilion/WarlordPavilionGiftGird.cs.meta b/Main/System/WarlordPavilion/WarlordPavilionGiftGird.cs.meta
new file mode 100644
index 0000000..0a95167
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionGiftGird.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: bd30321d34ea2d740926495996da4bad
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/WarlordPavilion/WarlordPavilionManager.cs b/Main/System/WarlordPavilion/WarlordPavilionManager.cs
new file mode 100644
index 0000000..cb183bb
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionManager.cs
@@ -0,0 +1,731 @@
+using System;
+using System.Collections.Generic;
+using LitJson;
+using UnityEngine;
+
+public class WarlordPavilionManager : GameSystemManager<WarlordPavilionManager>
+{
+ public readonly int RankType = 5;
+ public readonly int DataMapID = 30030;
+
+ public uint TodayPass; //浠婃棩杩囧叧杩涘害 灞�*100+鍏冲崱缂栧彿锛屽巻鍙叉渶楂樿繃鍏宠褰曞彇A320涓殑PassLineID
+ public Dictionary<int, HB202_tagSCDingjungeInfo.tagSCDingjungeEff> lastEffDict = new Dictionary<int, HB202_tagSCDingjungeInfo.tagSCDingjungeEff>();
+ public HB202_tagSCDingjungeInfo.tagSCDingjungeEff[] EffList; //宸茬敓鏁堢殑鏁堟灉鍒楄〃
+ public uint[] SelectEffList; //寰呮墜鍔ㄩ�夋嫨鐨勬晥鏋淚D鍒楄〃
+ public ushort UnSelectCnt; //杩樻湁鍑犱釜鏈�夋嫨鐨勬晥鏋�
+ public byte SelectAuto; //鏄惁鍚敤鑷姩閫夋嫨
+ public ushort[] SelectSetAttrIDList; //棰勮浼樺厛閫夋嫨灞炴�D鍒楄〃 [浼樺厛绾�1灞炴�D, ...]
+
+ public int[] unlockGiftGirdLevelIDs; //鏁堟灉妲借В閿佹墍闇�杩囧叧鍏冲崱ID鍒楄〃 [绗�1妲芥墍闇�鍏冲崱ID, ...]锛屽垪琛ㄧ殑闀垮害涔熸槸鏁堟灉妲界殑鎬绘暟
+ public int giftGirdMaxCnt; //鏁堟灉妲界殑鎬绘暟
+ public int bonusPresetMaxCnt; //棰勮鍔犳垚鏁堟灉鍙璁炬暟
+ public int[] funcOpenArr;
+ public int openLayerNum;
+ public int openLevelNum;
+ public int openLV;
+ public int backLayerCnt; // 姣忔棩鍥為��灞傛暟锛屾瘡鏃ヤ粠鍥為��鍚庣殑灞傜1鍏冲紑濮嬫寫鎴橈紝鑻ュ洖閫�鍚庣殑灞傛暟澶т簬1锛屽垯寮哄埗闇�鍏堣繘琛屽揩閫熸寫鎴樻墠鑳界户缁寫鎴�
+ public int[] sortIndexList;
+ private int m_SelectEffID;
+ public int selectEffID
+ {
+ get
+ {
+ return m_SelectEffID;
+ }
+ set
+ {
+ if (m_SelectEffID == value)
+ return;
+ m_SelectEffID = value;
+ }
+ }
+
+ private int m_SelectIndex;
+ public int selectIndex
+ {
+ get
+ {
+ return m_SelectIndex;
+ }
+ set
+ {
+ if (m_SelectIndex == value)
+ return;
+ m_SelectIndex = value;
+ UpdateSelectGiftGirdIndexEvent?.Invoke();
+ }
+ }
+
+ private int m_SelectReplaceIndex;
+ public int selectReplaceIndex
+ {
+ get
+ {
+ return m_SelectReplaceIndex;
+ }
+ set
+ {
+ if (m_SelectReplaceIndex == value)
+ return;
+ m_SelectReplaceIndex = value;
+ UpdateSelectReplaceGiftGirdIndexEvent?.Invoke();
+ }
+ }
+ public event Action UpdateSelectReplaceGiftGirdIndexEvent;
+ public event Action UpdateSelectGiftGirdIndexEvent;
+ public event Action<List<int>> OnUpdateDingjungeInfoEvent;
+
+ public override void Init()
+ {
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin;
+ FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
+ PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh;
+
+ var config = FuncConfigConfig.Get("DingjungeEff");
+ unlockGiftGirdLevelIDs = JsonMapper.ToObject<int[]>(config.Numerical1);
+ giftGirdMaxCnt = unlockGiftGirdLevelIDs == null ? 0 : unlockGiftGirdLevelIDs.Length;
+ bonusPresetMaxCnt = int.Parse(config.Numerical4);
+ config = FuncConfigConfig.Get("Dingjunge");
+ backLayerCnt = int.Parse(config.Numerical1);
+ sortIndexList = JsonMapper.ToObject<int[]>(config.Numerical2);
+ funcOpenArr = JsonMapper.ToObject<int[]>(config.Numerical3);
+ bool funcOpenArrNotExist = funcOpenArr == null || funcOpenArr.Length < 3;
+ openLayerNum = funcOpenArrNotExist ? 0 : funcOpenArr[0];
+ openLevelNum = funcOpenArrNotExist ? 0 : funcOpenArr[1];
+ openLV = funcOpenArrNotExist ? 0 : funcOpenArr[2];
+ }
+
+ public override void Release()
+ {
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitializeEventOnRelogin;
+ FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
+ PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh;
+ }
+
+ private void OnBeforePlayerDataInitializeEventOnRelogin()
+ {
+ isGiveupToggleOn = false;
+
+ TodayPass = 0;
+ lastEffDict = new Dictionary<int, HB202_tagSCDingjungeInfo.tagSCDingjungeEff>();
+ EffList = null;
+ SelectEffList = null;
+ UnSelectCnt = 0;
+ SelectAuto = 0;
+ SelectSetAttrIDList = null;
+ }
+
+ private void PlayerDataRefresh(PlayerDataType type)
+ {
+ if (PlayerDataType.LV == type)
+ {
+ UpdateRedpoint();
+ }
+ }
+
+ private void OnFuncStateChangeEvent(int obj)
+ {
+ if (obj == (int)FuncOpenEnum.WarlordPavilion)
+ {
+ UpdateRedpoint();
+ }
+ }
+
+
+
+ public bool IsFuncOpen(bool isTip = false)
+ {
+ GetCurrentFinishProgress(out int layerNum, out int levelNum);
+ int lv = PlayerDatas.Instance.baseData.LV;
+ bool isOpen = false;
+ if (lv >= openLV)
+ {
+ if (layerNum < openLayerNum)
+ {
+ isOpen = false;
+ }
+ else if (layerNum == openLayerNum)
+ {
+ isOpen = levelNum >= openLevelNum;
+ }
+ else
+ {
+ isOpen = true;
+ }
+ }
+ else
+ {
+ isOpen = false;
+ }
+
+ if (!isOpen && isTip)
+ {
+ SysNotifyMgr.Instance.ShowTip("WarlordPavilion01", openLayerNum, openLevelNum, openLV);
+ }
+ return isOpen;
+ }
+
+ public Redpoint parentRedpoint = new Redpoint(MainRedDot.WarlordPavilionRepoint);
+ public void UpdateRedpoint()
+ {
+ parentRedpoint.state = RedPointState.None;
+
+ if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.WarlordPavilion))
+ return;
+
+ //褰撴棩鍙互蹇�熸寫鎴�
+ bool canFastChallenge = CanFastChallenge();
+ if (canFastChallenge)
+ {
+ parentRedpoint.state = RedPointState.Simple;
+ return;
+ }
+ //姣忔棩0鐐规樉绀哄姞鎴愰璁剧孩鐐�
+ bool isTodayShowSelectBonusRed = IsTodayShowSelectBonusRed();
+ if (isTodayShowSelectBonusRed)
+ {
+ parentRedpoint.state = RedPointState.Simple;
+ return;
+ }
+ }
+
+ string key
+ {
+ get
+ {
+ return StringUtility.Concat(
+ "WarlordPavilion_SelectBonus_",
+ PlayerDatas.Instance.PlayerId.ToString()
+ );
+ }
+ }
+
+ public int GetLoacl()
+ {
+ int hasLocal = LocalSave.GetInt(key);
+ return hasLocal;
+ }
+
+ public void SetLoacl()
+ {
+ LocalSave.SetInt(key, TimeUtility.AllSeconds);
+ }
+
+ public bool IsTodayShowSelectBonusRed()
+ {
+ bool isOpen = IsFuncOpen();
+ if (!isOpen)
+ return false;
+
+ int localTime = GetLoacl();
+ if (localTime <= 0)
+ return true;
+ DateTime lastFailTime = TimeUtility.GetTime((uint)localTime);
+ DateTime now = TimeUtility.ServerNow;
+ if (lastFailTime.Year != now.Year || lastFailTime.Month != now.Month || lastFailTime.Day != now.Day)
+ return true;
+ return false;
+ }
+
+ ushort[] chooseAttrIDList = null;
+ public ushort[] GetChooseAttrIDList()
+ {
+ if (chooseAttrIDList == null)
+ {
+ chooseAttrIDList = new ushort[giftGirdMaxCnt];
+ }
+ return chooseAttrIDList;
+ }
+
+ public event Action OnChooseAttrIDListChangeEvent;
+ public void SetChooseAttrIDList(int index, int attrID)
+ {
+ if (chooseAttrIDList == null)
+ chooseAttrIDList = new ushort[giftGirdMaxCnt];
+ if (index < 0 || index >= giftGirdMaxCnt)
+ return;
+ List<int> attrIds = GetAttrIds();
+ if (attrIds.IsNullOrEmpty())
+ return;
+ if (attrID < 0 && !attrIds.Contains(attrID))
+ return;
+
+ if (attrID <= 0)
+ {
+ chooseAttrIDList[index] = 0;
+ }
+ else
+ {
+ if (!chooseAttrIDList.Contains((ushort)attrID))
+ {
+ chooseAttrIDList[index] = (ushort)attrID;
+ return;
+ }
+ int oldIndex = IndexOf(attrID);
+ if (oldIndex < 0)
+ return;
+ ushort temp = chooseAttrIDList[index];
+ chooseAttrIDList[oldIndex] = temp;
+ chooseAttrIDList[index] = (ushort)attrID;
+ }
+ OnChooseAttrIDListChangeEvent?.Invoke();
+ }
+
+ public int IndexOf(int attrID)
+ {
+ if (chooseAttrIDList == null)
+ return -1;
+ for (int i = 0; i < chooseAttrIDList.Length; i++)
+ {
+ int tempAttrID = chooseAttrIDList[i];
+ if (tempAttrID == attrID)
+ return i;
+ }
+ return -1;
+ }
+
+ public void SetChooseAttrIDList()
+ {
+ chooseAttrIDList = null;
+
+ if (SelectSetAttrIDList != null)
+ {
+ chooseAttrIDList = new ushort[SelectSetAttrIDList.Length];
+ Array.Copy(SelectSetAttrIDList, chooseAttrIDList, SelectSetAttrIDList.Length);
+ }
+ }
+
+ List<string> options = null;
+ public List<string> GetOptions()
+ {
+ List<int> attrIdList = GetAttrIds();
+ if (options == null)
+ {
+ options = new List<string>();
+ options.Add(Language.Get("L1125")); // 娣诲姞"鏃�"閫夐」
+
+ if (attrIdList.IsNullOrEmpty())
+ return options;
+ foreach (int attrId in attrIdList)
+ {
+ if (!PlayerPropertyConfig.HasKey(attrId))
+ continue;
+ PlayerPropertyConfig playerPropertyConfig = PlayerPropertyConfig.Get(attrId);
+ options.Add(playerPropertyConfig.ShowName);
+ }
+ }
+ return options;
+ }
+
+ Dictionary<int, int> indexToAttrIds = null;
+ public Dictionary<int, int> GetIndexToAttrIds()
+ {
+ List<int> attrIdList = GetAttrIds();
+ if (indexToAttrIds == null)
+ {
+ indexToAttrIds = new Dictionary<int, int>();
+ indexToAttrIds[0] = 0;
+ if (attrIdList.IsNullOrEmpty())
+ return indexToAttrIds;
+ for (int i = 0; i < attrIdList.Count; i++)
+ {
+ indexToAttrIds[i + 1] = attrIdList[i];
+ }
+ }
+ return indexToAttrIds;
+ }
+
+
+ private List<int> attrIds = null;
+ public List<int> GetAttrIds()
+ {
+ if (attrIds.IsNullOrEmpty())
+ {
+ attrIds = new List<int>();
+ foreach (var config in FBDJGEffectConfig.GetValues())
+ {
+ int attrId = config.AttrID;
+ if (!attrIds.Contains(attrId))
+ {
+ attrIds.Add(attrId);
+ }
+ }
+ attrIds.Sort((a, b) =>
+ {
+ if (sortIndexList.IsNullOrEmpty())
+ {
+ return a.CompareTo(b); // fallback鍒版暟瀛楁帓搴�
+ }
+ int indexA = Array.IndexOf(sortIndexList, a);
+ int indexB = Array.IndexOf(sortIndexList, b);
+ if (indexA < 0) indexA = int.MaxValue;
+ if (indexB < 0) indexB = int.MaxValue;
+ return indexA.CompareTo(indexB);
+ });
+
+ }
+ return attrIds;
+ }
+
+ /// <summary>
+ /// 灏濊瘯鑾峰彇鎸囧畾鏁堟灉ID鎵�鍦ㄧ殑鏁堟灉妲界储寮�
+ /// </summary>
+ /// <param name="effID">瑕佹煡鎵剧殑鏁堟灉ID</param>
+ /// <param name="gridIndex">杈撳嚭锛氭晥鏋淚D鎵�鍦ㄧ殑鏁堟灉妲界储寮�</param>
+ /// <returns>鏁堟灉妲戒腑鏄惁瀛樺湪鎸囧畾鐨勬晥鏋淚D</returns>
+ public bool TryGetEffGridIndex(int effID, out int gridIndex)
+ {
+ gridIndex = -1;
+
+ if (EffList.IsNullOrEmpty())
+ return false;
+
+ foreach (var eff in EffList)
+ {
+ if (eff.EffID == effID)
+ {
+ gridIndex = eff.EffIndex;
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+
+ /// <summary>
+ /// 灏濊瘯鑾峰彇宸茶В閿佷笖娌℃湁鏁堟灉鐨勬牸瀛愮储寮�
+ /// </summary>
+ /// <param name="emptyIndex">杈撳嚭锛氱储寮曟渶灏忕殑宸茶В閿佷笖娌℃湁鏁堟灉鐨勬牸瀛愮储寮�</param>
+ /// <returns>鏄惁瀛樺湪宸茶В閿佷笖娌℃湁鏁堟灉鐨勬牸瀛�</returns>
+ public bool TryGetEmptyUnlockedGiftGrid(out int emptyIndex)
+ {
+ emptyIndex = 0;
+
+ if (giftGirdMaxCnt <= 0)
+ return false;
+
+ for (int i = 0; i < giftGirdMaxCnt; i++)
+ {
+ // 妫�鏌ユ槸鍚﹀凡瑙i攣涓旀病鏈夋晥鏋�
+ int state = GetGiftGirdState(i); // 0-鏈В閿� 1-宸茶В閿佹棤鏁堟灉 2-宸茶В閿佹湁鏁堟灉
+ if (state == 1)
+ {
+ emptyIndex = i;
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ // 鏄惁杈惧埌婊″眰
+ public bool IsPass()
+ {
+ // 闃叉姢 鎷夸笉鍒版弧灞傛暟鎹涓烘弧灞�
+ if (!FBDJGLevelConfig.TryGetMaxFBDJGLevelConfig(out FBDJGLevelConfig maxConfig))
+ return true;
+ GetCurrentFinishProgress(out int curLayer, out int curLevel);
+ return maxConfig.LayerNum <= curLayer && maxConfig.LevelNum <= curLevel;
+ }
+
+ //鏄惁鏈夋湭閫夋嫨鐨勬晥鏋�
+ public bool HasBonusToSelect()
+ {
+ return !SelectEffList.IsNullOrEmpty();
+ }
+
+ // 鏄惁寮�鍚簡鑷姩棰勮
+ public bool IsAutoPresetOn()
+ {
+ return SelectAuto == 1;
+ }
+
+ // 鏄惁鍙互蹇�熸寫鎴�
+ public bool CanFastChallenge()
+ {
+ GetHistoryMaxFinishProgress(out int maxLayer, out int maxLevel);
+ bool hasNext = FBDJGLevelConfig.TryGetNextLevel(maxLayer, maxLevel, out int nextLayerNum, out int nextLevelNum);
+ int curMaxLayer = hasNext ? nextLayerNum : maxLayer;
+ //鑻ョ帺瀹跺巻鍙叉渶楂樺眰鏁�-2锛�1锛屽垯娆℃棩鍙娇鐢ㄥ揩閫熸寫鎴樺姛鑳�
+ bool isTodayNoFight = IsTodayNoFight();
+ if (isTodayNoFight && curMaxLayer - backLayerCnt > 1)
+ {
+ return true;
+ }
+ return false;
+ }
+
+
+ public bool TryGetEff(int index, out HB202_tagSCDingjungeInfo.tagSCDingjungeEff eff)
+ {
+ eff = null;
+ if (EffList.IsNullOrEmpty())
+ return false;
+
+ foreach (var tempEff in EffList)
+ {
+ if (tempEff.EffIndex == index)
+ {
+ eff = tempEff;
+ return true;
+ }
+ }
+ return false;
+ }
+ public bool TryGetEffByEffID(int effID, out HB202_tagSCDingjungeInfo.tagSCDingjungeEff eff)
+ {
+ eff = null;
+ if (EffList.IsNullOrEmpty())
+ return false;
+
+ foreach (var tempEff in EffList)
+ {
+ if (tempEff.EffID == effID)
+ {
+ eff = tempEff;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ // 0-鏈В閿� 1-宸茶В閿佹棤鏁堟灉 2-宸茶В閿佹湁鏁堟灉
+ public int GetGiftGirdState(int index)
+ {
+ return !IsGiftGridUnlock(index) ? 0 : !hasEffGiftGrid(index) ? 1 : 2;
+ }
+
+ public bool hasEffGiftGrid(int index)
+ {
+ if (EffList.IsNullOrEmpty() || index < 0 || index >= EffList.Length)
+ return false;
+ return true;
+ }
+
+ public bool IsGiftGridUnlock(int index)
+ {
+ if (!TryGetNeedLayerNumAndLevelNum(index, out int needLayerNum, out int needLevelNum))
+ return true;
+ GetCurrentFinishProgress(out int layerNum, out int levelNum);
+ if (needLayerNum > layerNum)
+ return false;
+ if (needLayerNum < layerNum)
+ return true;
+ return needLevelNum <= levelNum;
+ }
+
+
+ public bool TryGetNeedLayerNumAndLevelNum(int index, out int needLayerNum, out int needLevelNum)
+ {
+ needLayerNum = 0;
+ needLevelNum = 0;
+ if (unlockGiftGirdLevelIDs.IsNullOrEmpty() || index < 0 || index >= unlockGiftGirdLevelIDs.Length)
+ return false;
+ int levelID = unlockGiftGirdLevelIDs[index];
+ if (!FBDJGLevelConfig.TryGetFBDJGLevelConfig(levelID, out FBDJGLevelConfig config))
+ return false;
+ needLayerNum = config.LayerNum;
+ needLevelNum = config.LevelNum;
+ return true;
+ }
+
+ public string GetCountdownToNextDay()
+ {
+ int remainSeconds = TimeUtility.GetTodayRemainSeconds();
+ return TimeUtility.SecondsToShortDHMS(remainSeconds);
+ }
+
+ public bool isGiveupToggleOn = false;
+ private List<int> awards = new List<int>();
+
+ public List<int> GetAwardList()
+ {
+ if (awards.IsNullOrEmpty())
+ {
+ awards = FBDJGQuickConfig.GetKeys();
+ awards.Sort();
+ }
+ return awards;
+ }
+ public void DisplayItemCell(ItemCell[] cells, int[][] items)
+ {
+ if (cells.IsNullOrEmpty() || items.IsNullOrEmpty())
+ return;
+
+ for (int i = 0; i < cells.Length; i++)
+ {
+ if (i < items.Length)
+ {
+ cells[i].SetActive(true);
+ int itemID = items[i][0];
+ int count = items[i][1];
+ cells[i].Init(new ItemCellModel(itemID, false, count));
+ cells[i].button.SetListener(() => ItemTipUtility.Show(itemID));
+ }
+ else
+ {
+ cells[i].SetActive(false);
+ }
+ }
+ }
+ public bool TryGetShowLayerNumAndLevelNum(out int showLayerNum, out int showLevelNum)
+ {
+ showLayerNum = 0;
+ showLevelNum = 0;
+ if (!FBDJGLevelConfig.TryGetMinFBDJGLevelConfig(out FBDJGLevelConfig minConfig))
+ return false;
+ // 娌℃垬鏂楄繃 鏄剧ず绗竴灞�
+ bool isNoFinishProgress = IsTodayNoFight();
+ if (isNoFinishProgress)
+ {
+ showLayerNum = minConfig.LayerNum;
+ showLevelNum = minConfig.LevelNum;
+ }
+ else
+ {
+ //涓嶆槸鏈�鍚庝竴灞傦紝灏辨樉绀轰笅涓�灞�
+ GetCurrentFinishProgress(out int layerNum, out int levelNum);
+ bool isShowNoMaxLevel = FBDJGLevelConfig.TryGetNextLevel(layerNum, levelNum, out int nextLayerNum, out int nextLevelNum);
+ showLayerNum = isShowNoMaxLevel ? nextLayerNum : layerNum;
+ showLevelNum = isShowNoMaxLevel ? nextLevelNum : levelNum;
+ }
+ return true;
+ }
+
+ public bool TryGetNPCConfig(int layerNum, int levelNum, out NPCLineupConfig npcLineupConfig, out NPCConfig npcConfig)
+ {
+ npcConfig = null;
+ npcLineupConfig = null;
+ if (!FBDJGLevelConfig.TryGetFBDJGLevelConfig(layerNum, levelNum, out var config))
+ return false;
+ int[] lineupIDList = config.LineupIDList;
+ if (lineupIDList.IsNullOrEmpty())
+ return false;
+ int lineupID = lineupIDList[0];
+ if (!NPCLineupConfig.HasKey(lineupID))
+ return false;
+ npcLineupConfig = NPCLineupConfig.Get(lineupID);
+ int bossId = npcLineupConfig.BossID;
+ if (!NPCConfig.HasKey(bossId))
+ return false;
+ npcConfig = NPCConfig.Get(bossId);
+ return true;
+ }
+
+ public bool IsTodayNoFight()
+ {
+ return TodayPass <= 0;
+ }
+
+ public void AnalysisFinishProgress(int value, out int layerNum, out int levelNum)
+ {
+ layerNum = value / 100;
+ levelNum = value % 100;
+ }
+
+ public int GetLineID(int layerNum, int levelNum)
+ {
+ return layerNum * 100 + levelNum;
+ }
+
+ // 鑾峰彇褰撳墠瀹屾垚鐨勫眰鏁板拰鍏冲崱缂栧彿
+ public void GetCurrentFinishProgress(out int layerNum, out int levelNum)
+ {
+ AnalysisFinishProgress((int)TodayPass, out layerNum, out levelNum);
+ }
+
+ // 鑾峰彇鍘嗗彶瀹屾垚鐨勬渶楂樺眰鏁板拰鍏冲崱缂栧彿
+ public void GetHistoryMaxFinishProgress(out int layerNum, out int levelNum)
+ {
+ layerNum = 0;
+ levelNum = 0;
+ if (!FBDJGLevelConfig.TryGetMinFBDJGLevelConfig(out FBDJGLevelConfig minConfig))
+ return;
+ layerNum = minConfig.LayerNum;
+ levelNum = minConfig.LevelNum;
+ if (!DungeonManager.Instance.TryGetFBInfoByMapID(DataMapID, out var fbInfo) || fbInfo == null)
+ return;
+ AnalysisFinishProgress((int)fbInfo.PassLineID, out layerNum, out levelNum);
+ }
+
+ public void GetHistoryMaxPassLayerNum(out int layerNum)
+ {
+ layerNum = 0;
+ GetHistoryMaxFinishProgress(out int finishLayerNum, out int finishLevelNum);
+ if (!FBDJGLevelConfig.TryGetMinFBDJGLevelConfig(out FBDJGLevelConfig minConfig))
+ return;
+ if (!FBDJGLevelConfig.TryGetMaxLevelNumInLayer(finishLayerNum, out int maxLevelNum))
+ return;
+ layerNum = finishLevelNum >= maxLevelNum ? finishLayerNum : Mathf.Max(finishLayerNum - 1, minConfig.LayerNum);
+ }
+
+
+ public void UpdateDingjungeInfo(HB202_tagSCDingjungeInfo vNetData)
+ {
+ TodayPass = vNetData.TodayPass;
+ SelectEffList = vNetData.SelectEffList;
+ UnSelectCnt = vNetData.UnSelectCnt;
+ SelectAuto = vNetData.SelectAuto;
+ SelectSetAttrIDList = vNetData.SelectSetAttrIDList;
+ List<int> effectIndexList = GetEffectIndexList(vNetData.EffList);
+
+ EffList = vNetData.EffList;
+ UpdateRedpoint();
+ OnUpdateDingjungeInfoEvent?.Invoke(effectIndexList);
+
+ }
+
+ public List<int> GetEffectIndexList(HB202_tagSCDingjungeInfo.tagSCDingjungeEff[] EffList)
+ {
+ if (EffList.IsNullOrEmpty())
+ return null;
+ List<int> result = new List<int>();
+ foreach (var eff in EffList)
+ {
+ if (!lastEffDict.ContainsKey(eff.EffIndex))
+ {
+ if (eff.EffID == 0)
+ continue;
+ result.Add(eff.EffIndex);
+ }
+ else
+ {
+ if (lastEffDict[eff.EffIndex].EffID != eff.EffID || lastEffDict[eff.EffIndex].EffLV != eff.EffLV)
+ {
+ result.Add(eff.EffIndex);
+ }
+ }
+ lastEffDict[eff.EffIndex] = eff;
+ }
+ return result;
+ }
+
+
+ public void SendDingjungeEffSelect(int selectType, int selectIndex, int replaceHole)
+ {
+ CB102_tagCSDingjungeEffSelect pack = new CB102_tagCSDingjungeEffSelect();
+ pack.SelectType = (byte)selectType; //0-鎵嬪姩閫夋嫨锛�1-鏀惧純鏈閫夋嫨锛�2-涓�閿�夋嫨锛堜粎寮�鍚簡鑷姩閫夋嫨鏃舵湁鏁堬級
+ pack.SelectIndex = (byte)selectIndex; //鎵嬪姩閫夋嫨绱㈠紩 0~n
+ pack.ReplaceHole = (byte)replaceHole; //鎵嬪姩閫夋嫨鏇挎崲妲戒綅 1~n锛屾Ы浣�=妲界储寮�+1锛屽崌绾ф椂鍙洿鎺ュ彂0
+ GameNetSystem.Instance.SendInfo(pack);
+ }
+
+ public void SendDingjungeEffSet(bool isSelectAuto, ushort[] selectSetAttrIDList)
+ {
+ CB101_tagCSDingjungeEffSet pack = new CB101_tagCSDingjungeEffSet();
+ pack.SelectAuto = isSelectAuto ? (byte)1 : (byte)0;
+ pack.SelectSetAttrIDList = selectSetAttrIDList.IsNullOrEmpty() ? new ushort[bonusPresetMaxCnt] : selectSetAttrIDList;
+ pack.SelectSetCnt = (byte)pack.SelectSetAttrIDList.Length;
+ GameNetSystem.Instance.SendInfo(pack);
+ }
+
+
+ public void SendFBQuickPass(int dataMapID, int lineID)
+ {
+ CB108_tagCMFBQuickPass pack = new CB108_tagCMFBQuickPass();
+ pack.MapID = (uint)dataMapID;
+ pack.LineID = (ushort)lineID;
+ GameNetSystem.Instance.SendInfo(pack);
+ }
+}
\ No newline at end of file
diff --git a/Main/System/WarlordPavilion/WarlordPavilionManager.cs.meta b/Main/System/WarlordPavilion/WarlordPavilionManager.cs.meta
new file mode 100644
index 0000000..6363b25
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionManager.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ec3bcd654e946944784378b1e6ae50bd
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/WarlordPavilion/WarlordPavilionPlayerRankCell.cs b/Main/System/WarlordPavilion/WarlordPavilionPlayerRankCell.cs
new file mode 100644
index 0000000..6627ab4
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionPlayerRankCell.cs
@@ -0,0 +1,73 @@
+锘縰sing UnityEngine;
+using UnityEngine.UI;
+
+public class WarlordPavilionPlayerRankCell : MonoBehaviour
+{
+ [SerializeField] AvatarCell avatarCell;
+ [SerializeField] Text rankText;
+ [SerializeField] Text rankValueText; //鎺掑悕姣旇緝鍐呭
+ [SerializeField] Text nameText;
+ [SerializeField] OfficialTitleCell officialTitleCell;
+ [SerializeField] Button queryPlayerBtn; //鍚庣画娣诲姞鐐瑰嚮鏌ョ湅鐜╁璇︽儏
+ WarlordPavilionManager manager { get { return WarlordPavilionManager.Instance; } }
+
+ // rank 涓�0 浠h〃鐜╁鑷繁
+ public void Display(int rankType, int rank, string valueFormat)
+ {
+ RankData rankData = null;
+ int viewPlayerId = (int)PlayerDatas.Instance.baseData.PlayerID;
+ if (rank != 0)
+ {
+ rankData = RankModel.Instance.GetRankDataByRank(rankType, rank);
+ }
+ else
+ {
+ rankData = RankModel.Instance.GetMyRank(rankType);
+ if (rankData == null)
+ {
+ //鍙栫帺瀹惰嚜宸辩殑鏁版嵁
+ avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)PlayerDatas.Instance.baseData.PlayerID,
+ PlayerDatas.Instance.baseData.face,
+ PlayerDatas.Instance.baseData.facePic));
+ rankText.text = Language.Get("L1045");
+ rankValueText.text = "";//Language.Get("L1125");
+ nameText.text = PlayerDatas.Instance.baseData.PlayerName;
+ officialTitleCell.InitUI(PlayerDatas.Instance.baseData.realmLevel, PlayerDatas.Instance.baseData.TitleID);
+ return;
+ }
+ rank = rankData.rank;
+ }
+ if (rankData == null)
+ {
+ officialTitleCell.SetActive(false);
+ avatarCell.SetActive(false);
+ nameText.text = Language.Get("L1124");
+ rankValueText.text = "";//Language.Get("L1125");
+ }
+ else
+ {
+ officialTitleCell.SetActive(true);
+ officialTitleCell.InitUI((int)rankData.value1, (int)rankData.value2);
+ avatarCell.SetActive(true);
+ avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)rankData.id, (int)rankData.value3, (int)rankData.value4));
+ viewPlayerId = (int)rankData.id;
+ nameText.text = rankData.name1;
+ manager.AnalysisFinishProgress((int)rankData.cmpValue, out int layerNum, out int levelNum);
+ rankValueText.text = Language.Get("WarlordPavilion23", layerNum, levelNum);
+ }
+
+ rankText.text = rank.ToString();
+ if (queryPlayerBtn != null)
+ {
+ queryPlayerBtn.AddListener(() =>
+ {
+ AvatarHelper.TryViewOtherPlayerInfo(viewPlayerId);
+ });
+ }
+ }
+}
+
+
+
+
+
diff --git a/Main/System/WarlordPavilion/WarlordPavilionPlayerRankCell.cs.meta b/Main/System/WarlordPavilion/WarlordPavilionPlayerRankCell.cs.meta
new file mode 100644
index 0000000..8d04b2e
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionPlayerRankCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a709f52774c19354f84d8bdec0782fa0
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/WarlordPavilion/WarlordPavilionPlayerTop3Cell.cs b/Main/System/WarlordPavilion/WarlordPavilionPlayerTop3Cell.cs
new file mode 100644
index 0000000..a11646b
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionPlayerTop3Cell.cs
@@ -0,0 +1,44 @@
+锘�//--------------------------------------------------------
+// [Author]: 鐜╀釜娓告垙
+// [ Date ]: Wednesday, September 26, 2018
+//--------------------------------------------------------
+using UnityEngine;
+using UnityEngine.UI;
+
+public class WarlordPavilionPlayerTop3Cell : MonoBehaviour
+{
+ //[SerializeField] Model 鏄剧ずNPC 姝﹀皢妯″瀷
+ [SerializeField] Text rankValueText; //鎺掑悕姣旇緝鍐呭
+ [SerializeField] Text nameText;
+ [SerializeField] OfficialTitleCell officialTitleCell;
+ [SerializeField] Button queryPlayerBtn; //鍚庣画娣诲姞鐐瑰嚮鏌ョ湅鐜╁璇︽儏
+ [SerializeField] HorseController model;
+ WarlordPavilionManager manager { get { return WarlordPavilionManager.Instance; } }
+ public void Display(int rankType, int rank, string valueFormat = "{0}")
+ {
+ var rankData = RankModel.Instance.GetRankDataByRank(rankType, rank);
+ if (rankData == null)
+ {
+ rankValueText.text = "";//Language.Get("L1125");
+ nameText.text = Language.Get("L1124");
+ officialTitleCell.SetActive(false);
+ model.SetActive(false);
+ return;
+ }
+ officialTitleCell.SetActive(true);
+ manager.AnalysisFinishProgress((int)rankData.cmpValue, out int layerNum, out int levelNum);
+ rankValueText.text = Language.Get("WarlordPavilion23", layerNum, levelNum);
+ nameText.text = rankData.name1;
+ officialTitleCell.InitUI((int)rankData.value1, (int)rankData.value2);
+ model.SetActive(true);
+ model.Create(HorseManager.Instance.GetOtherPlayerHorseSkinID((int)rankData.value6), (int)rankData.value5, rank == 1 ? 1f : 0.8f);
+ queryPlayerBtn.SetListener(() =>
+ {
+ AvatarHelper.TryViewOtherPlayerInfo((int)rankData.id);
+ });
+ }
+}
+
+
+
+
diff --git a/Main/System/WarlordPavilion/WarlordPavilionPlayerTop3Cell.cs.meta b/Main/System/WarlordPavilion/WarlordPavilionPlayerTop3Cell.cs.meta
new file mode 100644
index 0000000..fd65d65
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionPlayerTop3Cell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 17533cedcfb10a44a8b1256ca7f8c6a2
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/WarlordPavilion/WarlordPavilionRankWin.cs b/Main/System/WarlordPavilion/WarlordPavilionRankWin.cs
new file mode 100644
index 0000000..8e3f1a4
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionRankWin.cs
@@ -0,0 +1,100 @@
+using System.Collections.Generic;
+using UnityEngine;
+public class WarlordPavilionRankWin : UIBase
+{
+ [SerializeField] List<WarlordPavilionPlayerTop3Cell> playerTop3Cells;
+ [SerializeField] TextEx rankText;
+ [SerializeField] TextEx rankValueText; //鎺掑悕姣旇緝鍐呭
+ [HideInInspector] public string valueFormat = "{0}";
+ [HideInInspector] public int groupValue1 = 0; //涓�鑸敤浜庤法鏈�
+ [HideInInspector] public int groupValue2 = 0; //涓�鑸敤浜庤法鏈�
+ [SerializeField] ScrollerController scroller;
+ WarlordPavilionManager manager { get { return WarlordPavilionManager.Instance; } }
+
+ protected override void OnPreOpen()
+ {
+ RankModel.Instance.ResetQueryParam();
+ RankModel.Instance.QueryRankByPage(manager.RankType, watchID: (int)PlayerDatas.Instance.baseData.PlayerID);
+ RankModel.Instance.onRankRefresh += OnRankRefresh;
+ scroller.OnRefreshCell += OnRefreshCell;
+ ShowTop3();
+ CreateScroller();
+ DisplayMyRank();
+ }
+
+ protected override void OnPreClose()
+ {
+ RankModel.Instance.onRankRefresh -= OnRankRefresh;
+ scroller.OnRefreshCell -= OnRefreshCell;
+ }
+ void OnRankRefresh(int type)
+ {
+ RefreshAll();
+ }
+ void RefreshAll()
+ {
+ ShowTop3();
+ scroller.m_Scorller.RefreshActiveCellViews();
+ DisplayMyRank();
+ }
+
+ void OnRefreshCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell.GetComponent<WarlordPavilionPlayerRankCell>();
+ _cell.Display(manager.RankType, cell.index + 1, valueFormat);
+ RankModel.Instance.ListenRankPage(manager.RankType, cell.index, groupValue1, groupValue2);
+ }
+
+ void CreateScroller()
+ {
+ scroller.Refresh();
+ var cnt = RankModel.Instance.GetRankShowMaxCnt(manager.RankType);
+ for (int i = 3; i < cnt; i++)
+ {
+ scroller.AddCell(ScrollerDataType.Header, i);
+ }
+ scroller.Restart();
+ }
+
+ void ShowTop3()
+ {
+ for (int i = 0; i < playerTop3Cells.Count; i++)
+ {
+ playerTop3Cells[i].Display(manager.RankType, i + 1);
+ }
+ }
+
+ private void DisplayMyRank()
+ {
+ int rankType = manager.RankType;
+ int rank = 0;
+ RankData rankData = null;
+ if (rank != 0)
+ {
+ rankData = RankModel.Instance.GetRankDataByRank(rankType, rank);
+ }
+ else
+ {
+ rankData = RankModel.Instance.GetMyRank(rankType);
+ if (rankData == null)
+ {
+ //鍙栫帺瀹惰嚜宸辩殑鏁版嵁
+ rankText.text = Language.Get("L1045");
+ rankValueText.text = "";//Language.Get("L1125");
+ return;
+ }
+ rank = rankData.rank;
+ }
+ if (rankData == null)
+ {
+ rankValueText.text = "";//Language.Get("L1125");
+ }
+ else
+ {
+ manager.AnalysisFinishProgress((int)rankData.cmpValue, out int layerNum, out int levelNum);
+ rankValueText.text = Language.Get("WarlordPavilion23", layerNum, levelNum);
+ }
+ rankText.text = Language.Get("WarlordPavilion12", rank);
+
+ }
+}
\ No newline at end of file
diff --git a/Main/System/WarlordPavilion/WarlordPavilionRankWin.cs.meta b/Main/System/WarlordPavilion/WarlordPavilionRankWin.cs.meta
new file mode 100644
index 0000000..c5ff7ff
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionRankWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 58b1a69c39aec164ab846ac94cc6a701
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/WarlordPavilion/WarlordPavilionReplaceBonusWin.cs b/Main/System/WarlordPavilion/WarlordPavilionReplaceBonusWin.cs
new file mode 100644
index 0000000..c1a69c1
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionReplaceBonusWin.cs
@@ -0,0 +1,53 @@
+using UnityEngine;
+
+public class WarlordPavilionReplaceBonusWin : UIBase
+{
+ [SerializeField] WarlordPavilionReplaceGiftGird[] giftCells;
+ [SerializeField] ButtonEx btnOk;
+ [SerializeField] ButtonEx btnClose;
+ WarlordPavilionManager manager { get { return WarlordPavilionManager.Instance; } }
+
+ protected override void InitComponent()
+ {
+ btnOk.SetListener(() =>
+ {
+ if (manager.selectReplaceIndex < 0)
+ {
+ SysNotifyMgr.Instance.ShowTip("WarlordPavilion02");
+ return;
+ }
+ manager.SendDingjungeEffSelect(0, manager.selectIndex, manager.selectReplaceIndex + 1);
+ CloseWindow();
+ });
+ btnClose.SetListener(() =>
+ {
+ CloseWindow();
+ });
+ }
+
+ protected override void OnPreOpen()
+ {
+ manager.UpdateSelectReplaceGiftGirdIndexEvent += UpdateSelectReplaceGiftGirdIndexEvent;
+ manager.selectReplaceIndex = -1;//榛樿涓嶉�変腑
+ Display();
+ }
+
+ protected override void OnPreClose()
+ {
+ manager.UpdateSelectReplaceGiftGirdIndexEvent -= UpdateSelectReplaceGiftGirdIndexEvent;
+ }
+
+ private void UpdateSelectReplaceGiftGirdIndexEvent()
+ {
+ Display();
+ }
+
+ private void Display()
+ {
+ for (int i = 0; i < giftCells.Length; i++)
+ {
+ bool isChoose = manager.selectReplaceIndex == i;
+ giftCells[i].Display(i, isChoose);
+ }
+ }
+}
diff --git a/Main/System/WarlordPavilion/WarlordPavilionReplaceBonusWin.cs.meta b/Main/System/WarlordPavilion/WarlordPavilionReplaceBonusWin.cs.meta
new file mode 100644
index 0000000..8a54efd
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionReplaceBonusWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: f95498841dec2e04b849e65e1b1bf4a5
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/WarlordPavilion/WarlordPavilionReplaceGiftGird.cs b/Main/System/WarlordPavilion/WarlordPavilionReplaceGiftGird.cs
new file mode 100644
index 0000000..9ef105b
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionReplaceGiftGird.cs
@@ -0,0 +1,44 @@
+using UnityEngine;
+public class WarlordPavilionReplaceGiftGird : MonoBehaviour
+{
+
+ [SerializeField] ImageEx imgBG;
+ [SerializeField] Transform transUnlock;
+ [SerializeField] TextEx txtUnlock;
+ [SerializeField] ImageEx imgAdd;
+ [SerializeField] UIEffectPlayer effectPlayer;
+ [SerializeField] ImageEx imgChoose;
+ [SerializeField] WarlordPavilionGiftDiyButtonCell cell;
+ WarlordPavilionManager manager { get { return WarlordPavilionManager.Instance; } }
+
+ public void Display(int index, bool isChoose = false)
+ {
+ imgChoose.SetActive(isChoose);
+ // 0-鏈В閿� 1-宸茶В閿佹棤鏁堟灉 2-宸茶В閿佹湁鏁堟灉
+ int state = manager.GetGiftGirdState(index);
+ imgBG.SetActive(state != 2);
+ transUnlock.SetActive(state == 0);
+ imgAdd.SetActive(state == 1);
+ cell.SetActive(state == 2);
+
+ if (state == 0)
+ {
+ bool hasNeedLayerNumAndLevelNum = manager.TryGetNeedLayerNumAndLevelNum(index, out int needLayerNum, out int needLevelNum);
+ txtUnlock.text = hasNeedLayerNumAndLevelNum ? Language.Get("Arena15", needLayerNum, needLevelNum) : string.Empty;
+ }
+ if (state == 2)
+ {
+ if (!manager.TryGetEff(index, out HB202_tagSCDingjungeInfo.tagSCDingjungeEff eff))
+ return;
+ cell.Init(eff.EffID, eff.EffLV);
+ cell.SetListener(() =>
+ {
+ if (manager.selectReplaceIndex == index)
+ {
+ cell.ShowSmallTip(eff.EffID, eff.EffLV);
+ }
+ manager.selectReplaceIndex = index;
+ });
+ }
+ }
+}
\ No newline at end of file
diff --git a/Main/System/WarlordPavilion/WarlordPavilionReplaceGiftGird.cs.meta b/Main/System/WarlordPavilion/WarlordPavilionReplaceGiftGird.cs.meta
new file mode 100644
index 0000000..8fccce1
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionReplaceGiftGird.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 0fcd5717f6117be4fae12d9dd1ba1b07
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/WarlordPavilion/WarlordPavilionSelectBonusCell.cs b/Main/System/WarlordPavilion/WarlordPavilionSelectBonusCell.cs
new file mode 100644
index 0000000..78a9473
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionSelectBonusCell.cs
@@ -0,0 +1,19 @@
+using UnityEngine;
+
+public class WarlordPavilionSelectBonusCell : MonoBehaviour
+{
+
+ [SerializeField] WarlordPavilionSelectGiftGird chooseCell;
+
+ WarlordPavilionManager manager { get { return WarlordPavilionManager.Instance; } }
+ public void Display(int index)
+ {
+ if (manager.SelectEffList.IsNullOrEmpty() || index < 0 || index >= manager.SelectEffList.Length)
+ return;
+ int effID = (int)manager.SelectEffList[index];
+ bool isChoose = effID == manager.selectEffID;
+ bool isUp = manager.TryGetEffByEffID(effID, out HB202_tagSCDingjungeInfo.tagSCDingjungeEff eff);
+ chooseCell.Display(index, effID, isChoose, isUp);
+ }
+
+}
diff --git a/Main/System/WarlordPavilion/WarlordPavilionSelectBonusCell.cs.meta b/Main/System/WarlordPavilion/WarlordPavilionSelectBonusCell.cs.meta
new file mode 100644
index 0000000..75d9c51
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionSelectBonusCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 438258b01785bdf468dfac5038b76244
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/WarlordPavilion/WarlordPavilionSelectBonusWin.cs b/Main/System/WarlordPavilion/WarlordPavilionSelectBonusWin.cs
new file mode 100644
index 0000000..aafe846
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionSelectBonusWin.cs
@@ -0,0 +1,167 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class WarlordPavilionSelectBonusWin : UIBase
+{
+ [SerializeField] WarlordPavilionGiftGird[] giftCells;
+ [SerializeField] TextEx txtAttr;
+ [SerializeField] TextEx txtAttrValue;
+ [SerializeField] TextEx txtCnt;
+ [SerializeField] ScrollerController scroller;
+ [SerializeField] ButtonEx btnOk;
+ [SerializeField] ButtonEx btnGiveup;
+ WarlordPavilionManager manager { get { return WarlordPavilionManager.Instance; } }
+
+ protected override void InitComponent()
+ {
+ btnOk.SetListener(() =>
+ {
+ // 鏁堟灉妲介噷鏈夋寚瀹氭晥鏋�
+ if (manager.TryGetEffGridIndex(manager.selectEffID, out int gridIndex))
+ {
+ manager.SendDingjungeEffSelect(0, manager.selectIndex, 0);
+ TryClose();
+ return;
+ }
+
+ // 鏁堟灉妲介噷鏈夊凡瑙i攣涓旀病鏈夋晥鏋滅殑鏍煎瓙
+ if (manager.TryGetEmptyUnlockedGiftGrid(out int emptyIndex))
+ {
+ manager.SendDingjungeEffSelect(0, manager.selectIndex, emptyIndex + 1);
+ TryClose();
+ return;
+ }
+ UIManager.Instance.OpenWindow<WarlordPavilionReplaceBonusWin>();
+ });
+ btnGiveup.SetListener(() =>
+ {
+ if (!manager.isGiveupToggleOn)
+ {
+ ConfirmCancel.ToggleConfirmCancel(
+ Language.Get("L1003"),
+ Language.Get("WarlordPavilion27"),
+ Language.Get("TianziBillborad08"),
+ Language.Get("PopConfirmWin_OK"),
+ null,
+ (bool isOK, bool isToggle) =>
+ {
+ if (isOK)
+ {
+ manager.isGiveupToggleOn = isToggle;
+ GiveUp();
+ }
+ },
+ false
+ );
+ return;
+ }
+ GiveUp();
+ });
+ }
+
+ void GiveUp()
+ {
+ manager.SendDingjungeEffSelect(1, 0, 0);
+ TryClose();
+ }
+
+ void TryClose()
+ {
+ // 娌℃湁鏈�夋嫨鐨勬晥鏋�
+ if (manager.UnSelectCnt <= 0 && manager.SelectEffList.IsNullOrEmpty())
+ {
+ CloseWindow();
+ }
+ }
+
+ protected override void OnPreOpen()
+ {
+ manager.UpdateSelectGiftGirdIndexEvent += UpdateSelectGiftGirdIndexEvent;
+ manager.OnUpdateDingjungeInfoEvent += OnUpdateDingjungeInfo;
+ scroller.OnRefreshCell += OnRefreshCell;
+ AutoChoose();
+ Display();
+ }
+
+ protected override void OnPreClose()
+ {
+ manager.UpdateSelectGiftGirdIndexEvent -= UpdateSelectGiftGirdIndexEvent;
+ manager.OnUpdateDingjungeInfoEvent -= OnUpdateDingjungeInfo;
+ scroller.OnRefreshCell -= OnRefreshCell;
+ }
+
+ private void UpdateSelectGiftGirdIndexEvent()
+ {
+ Display();
+ scroller.m_Scorller.RefreshActiveCellViews();
+ }
+ private void OnRefreshCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell.GetComponent<WarlordPavilionSelectBonusCell>();
+ _cell?.Display(cell.index);
+ }
+ private void OnUpdateDingjungeInfo(List<int> indexs)
+ {
+ TryClose();
+ AutoChoose();
+ Display();
+ PlayerEffects(indexs);
+ scroller.m_Scorller.RefreshActiveCellViews();
+ }
+ void PlayerEffects(List<int> indexs)
+ {
+ if (indexs.IsNullOrEmpty())
+ return;
+ for (int i = 0; i < giftCells.Length; i++)
+ {
+ giftCells[i].Display(i, indexs.Contains(i));
+ }
+ }
+ // 榛樿閫変腑绗竴涓姞鎴愭晥鏋�
+ private void AutoChoose()
+ {
+ if (manager.SelectEffList.IsNullOrEmpty())
+ return;
+ manager.selectIndex = 0;
+ manager.selectEffID = (int)manager.SelectEffList[0];
+ }
+
+ private void Display()
+ {
+ for (int i = 0; i < giftCells.Length; i++)
+ {
+ giftCells[i].Display(i);
+ }
+
+ int selectEffID = manager.selectEffID;
+
+ CreateScroller();
+
+ if (FBDJGEffectConfig.HasKey(selectEffID))
+ {
+ FBDJGEffectConfig config = FBDJGEffectConfig.Get(selectEffID);
+ txtAttr.text = config.Name;
+ txtAttrValue.text = Language.Get(
+ "HeroGift5",
+ PlayerPropertyConfig.Get(config.AttrID).Name,
+ PlayerPropertyConfig.GetValueDescription(config.AttrID, config.AttrValue)
+ );
+ }
+ txtCnt.text = Language.Get("WarlordPavilion26", manager.UnSelectCnt);
+ }
+
+ private void CreateScroller()
+ {
+
+ scroller.Refresh();
+ List<int> list = manager.GetAwardList();
+ if (!manager.SelectEffList.IsNullOrEmpty())
+ {
+ for (int i = 0; i < manager.SelectEffList.Length; i++)
+ {
+ scroller.AddCell(ScrollerDataType.Header, i);
+ }
+ }
+ scroller.Restart();
+ }
+}
diff --git a/Main/System/WarlordPavilion/WarlordPavilionSelectBonusWin.cs.meta b/Main/System/WarlordPavilion/WarlordPavilionSelectBonusWin.cs.meta
new file mode 100644
index 0000000..2ab7ef4
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionSelectBonusWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 144d23ba33b0f494bb5b5ad3ac72532f
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/WarlordPavilion/WarlordPavilionSelectGiftGird.cs b/Main/System/WarlordPavilion/WarlordPavilionSelectGiftGird.cs
new file mode 100644
index 0000000..ac026b8
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionSelectGiftGird.cs
@@ -0,0 +1,22 @@
+using UnityEngine;
+public class WarlordPavilionSelectGiftGird : MonoBehaviour
+{
+ [SerializeField] ImageEx imgChoose;
+ [SerializeField] ImageEx imgUp;
+ [SerializeField] WarlordPavilionGiftDiyButtonCell cell;
+ WarlordPavilionManager manager { get { return WarlordPavilionManager.Instance; } }
+
+ public void Display(int index, int effID, bool isChoose = false, bool isUp = false)
+ {
+ imgChoose.SetActive(isChoose);
+ imgUp.SetActive(isUp);
+ cell.Init(effID, 1);//鏄剧ず1绾х殑
+ cell.SetListener(() =>
+ {
+ manager.selectEffID = effID;
+ manager.selectIndex = index;
+ });
+ }
+
+
+}
\ No newline at end of file
diff --git a/Main/System/WarlordPavilion/WarlordPavilionSelectGiftGird.cs.meta b/Main/System/WarlordPavilion/WarlordPavilionSelectGiftGird.cs.meta
new file mode 100644
index 0000000..c54c5cd
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionSelectGiftGird.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e3028fce7f0c67947a39942b48467336
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/WarlordPavilion/WarlordPavilionWin.cs b/Main/System/WarlordPavilion/WarlordPavilionWin.cs
new file mode 100644
index 0000000..6ca3e32
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionWin.cs
@@ -0,0 +1,279 @@
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+public class WarlordPavilionWin : UIBase
+{
+ [SerializeField] float modelSize;
+ [SerializeField] TextEx txtCurrentLevel; //褰撳墠鍏冲崱
+ [SerializeField] TextEx txtBossName;
+ [SerializeField] UIHeroController uiHeroController;
+ [SerializeField] List<SkillWordCell> skillWords;
+ [SerializeField] ItemCell[] firstAwards;
+ [SerializeField] ImageEx[] firstAwardMasks;
+ [SerializeField] ItemCell[] challengeAwards;
+ [SerializeField] WarlordPavilionGiftGird[] giftCells;
+ [SerializeField] TextEx txtTime;
+ [SerializeField] TextEx txtMax;
+ [SerializeField] ButtonEx btnRank;
+ [SerializeField] ButtonEx btnAward;
+ [SerializeField] ButtonEx btnBossInfo;
+ [SerializeField] ButtonEx btnFormation; //甯冮樀
+ [SerializeField] ButtonEx btnBonusPreset; //鍔犳垚棰勮
+ [SerializeField] TextEx txtBonusPreset; //鍔犳垚棰勮
+ [SerializeField] ButtonEx btnChallenge; //鎸戞垬
+ [SerializeField] ButtonEx btnSelectOneClick; //涓�閿�夋嫨
+ [SerializeField] ButtonEx btnQuickChallenge; //蹇�熸寫鎴�
+ [SerializeField] ButtonEx btnSelectBonus; //閫夋嫨鍔犳垚
+ [SerializeField] Image imgSelectBonusRed; //鍔犳垚棰勮绾㈢偣
+ [SerializeField] UIEffectPlayer uIEffectPlayer; //閫夋嫨鍔犳垚寮�鍚壒鏁�
+ WarlordPavilionManager manager { get { return WarlordPavilionManager.Instance; } }
+ protected override void InitComponent()
+ {
+ btnBossInfo.SetListener(() =>
+ {
+ if (npcConfig == null)
+ return;
+ uint mapID = (uint)manager.DataMapID;
+ uint funcLineID = (uint)manager.GetLineID(showLayerNum, showLevelNum);
+ uint npcID = (uint)npcConfig.NPCID;
+ if (ViewNPCManager.Instance.TryGetNPCAttr(mapID, funcLineID, npcID, out var npcAttr) && npcAttr != null && npcAttr.AttrDict != null)
+ {
+ AttributeManager.Instance.OpenTotalAttributeWin(npcAttr.AttrDict);
+ return;
+ }
+ ViewNPCManager.Instance.SendViewNPCAttr(mapID, funcLineID, npcID);
+ });
+ btnRank.SetListener(() =>
+ {
+ UIManager.Instance.OpenWindow<WarlordPavilionRankWin>();
+ });
+ btnAward.SetListener(() =>
+ {
+ UIManager.Instance.OpenWindow<WarlordPavilionAwardWin>();
+ });
+ btnFormation.SetListener(() =>
+ {
+ HeroUIManager.Instance.selectTeamType = TeamType.Story;
+ UIManager.Instance.OpenWindow<HeroPosWin>();
+ });
+ btnSelectOneClick.SetListener(() =>
+ {
+ manager.SendDingjungeEffSelect(2, 0, 0);
+ });
+ btnQuickChallenge.SetListener(() =>
+ {
+ manager.SendFBQuickPass(manager.DataMapID, 0);
+ });
+ btnChallenge.SetListener(() =>
+ {
+ BattleManager.Instance.SendTurnFight((uint)manager.DataMapID, 0);
+ });
+ btnSelectBonus.SetListener(() =>
+ {
+ UIManager.Instance.OpenWindow<WarlordPavilionSelectBonusWin>();
+ });
+ btnBonusPreset.SetListener(() =>
+ {
+ if (!manager.IsFuncOpen(true))
+ return;
+ UIManager.Instance.OpenWindow<WarlordPavilionBonusPresetWin>();
+ });
+ }
+
+ protected override void OnPreOpen()
+ {
+ GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
+ ViewNPCManager.Instance.OnUpdateViewNPCAttrRet += OnUpdateViewNPCAttrRet;
+ manager.OnUpdateDingjungeInfoEvent += OnUpdateDingjungeInfo;
+ Display();
+ }
+
+ protected override void OnPreClose()
+ {
+ GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent;
+ ViewNPCManager.Instance.OnUpdateViewNPCAttrRet -= OnUpdateViewNPCAttrRet;
+ manager.OnUpdateDingjungeInfoEvent -= OnUpdateDingjungeInfo;
+ }
+
+ private void OnUpdateDingjungeInfo(List<int> indexs)
+ {
+ Display();
+ PlayerEffects(indexs);
+ }
+
+ void PlayerEffects(List<int> indexs)
+ {
+ if (indexs.IsNullOrEmpty())
+ return;
+ for (int i = 0; i < giftCells.Length; i++)
+ {
+ giftCells[i].Display(i, indexs.Contains(i));
+ }
+ }
+
+ private void OnUpdateViewNPCAttrRet(uint mapID, uint funcLineID)
+ {
+ if (mapID != manager.DataMapID)
+ return;
+ if (npcConfig == null)
+ return;
+ uint npcID = (uint)npcConfig.NPCID;
+ if (ViewNPCManager.Instance.TryGetNPCAttr(mapID, funcLineID, npcID, out var npcAttr) && npcAttr != null && npcAttr.AttrDict != null)
+ {
+ AttributeManager.Instance.OpenTotalAttributeWin(npcAttr.AttrDict);
+ return;
+ }
+ }
+
+ void OnSecondEvent()
+ {
+ txtTime.text = Language.Get("WarlordPavilion10", manager.GetCountdownToNextDay());
+ bool isShowRed = manager.IsTodayShowSelectBonusRed();
+ imgSelectBonusRed.SetActive(isShowRed);
+ }
+
+ int showLayerNum;
+ int showLevelNum;
+ FBDJGLevelConfig config;
+ NPCLineupConfig npcLineupConfig;
+ NPCConfig npcConfig;
+ private void Display()
+ {
+ uIEffectPlayer.Stop();
+ OnSecondEvent();
+ int dataMapID = manager.DataMapID;
+ if (!DungeonManager.Instance.TryGetFBInfoByMapID(dataMapID, out var fbInfo))
+ return;
+ if (!manager.TryGetShowLayerNumAndLevelNum(out showLayerNum, out showLevelNum))
+ return;
+ if (!FBDJGLevelConfig.TryGetFBDJGLevelConfig(showLayerNum, showLevelNum, out config))
+ return;
+ if (!manager.TryGetNPCConfig(showLayerNum, showLevelNum, out npcLineupConfig, out npcConfig))
+ return;
+
+ txtCurrentLevel.text = Language.Get("WarlordPavilion22", showLayerNum, showLevelNum);
+ txtBossName.text = npcConfig.NPCName;
+ uiHeroController.Create(npcConfig.SkinID, modelSize);
+ DisplaySkillWordsList(npcLineupConfig);
+ DisplayItemCell(firstAwards, config.PassAwardList);
+ manager.DisplayItemCell(challengeAwards, config.AwardList);
+ DisplayButtons();
+
+ for (int i = 0; i < giftCells.Length; i++)
+ {
+ giftCells[i].Display(i);
+ }
+ txtBonusPreset.text = Language.Get(manager.SelectAuto == 1 ? "WarlordPavilion30" : "WarlordPavilion08");
+ if (manager.SelectAuto == 1)
+ {
+ uIEffectPlayer.Play();
+ }
+ }
+ private void DisplayButtons()
+ {
+ bool isPass = manager.IsPass();
+ bool hasBonusToSelect = manager.HasBonusToSelect();
+ bool isAutoPresetOn = manager.IsAutoPresetOn();
+ bool canFastChallenge = manager.CanFastChallenge();
+
+ txtMax.SetActive(false);
+ btnSelectOneClick.SetActive(false);
+ btnSelectBonus.SetActive(false);
+ btnQuickChallenge.SetActive(false);
+ btnChallenge.SetActive(false);
+
+ txtMax.SetActive(isPass);
+
+ if (isPass)
+ return;
+ if (hasBonusToSelect)
+ {
+ btnSelectOneClick.SetActive(isAutoPresetOn);
+ btnSelectBonus.SetActive(!isAutoPresetOn);
+ return;
+ }
+ btnQuickChallenge.SetActive(canFastChallenge);
+ btnChallenge.SetActive(!canFastChallenge);
+
+ }
+ public bool IsNowPass()
+ {
+ manager.GetHistoryMaxFinishProgress(out int layerNum, out int levelNum);
+ if (layerNum <= 0 || levelNum <= 0)
+ {
+ return false;
+ }
+
+ if (showLayerNum < layerNum)
+ {
+ return true;
+ }
+
+ if (showLayerNum == layerNum)
+ {
+ if (showLevelNum <= levelNum)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void DisplayItemCell(ItemCell[] cells, int[][] items)
+ {
+ bool isPass = IsNowPass();
+
+ if (cells.IsNullOrEmpty() || items.IsNullOrEmpty())
+ return;
+
+ for (int i = 0; i < cells.Length; i++)
+ {
+ if (i < items.Length)
+ {
+ if (i < firstAwardMasks.Length)
+ {
+ firstAwardMasks[i].SetActive(isPass);
+ }
+ else
+ {
+ firstAwardMasks[i].SetActive(false);
+ }
+
+ cells[i].SetActive(true);
+ int itemID = items[i][0];
+ int count = items[i][1];
+ cells[i].Init(new ItemCellModel(itemID, false, count));
+ cells[i].button.SetListener(() => ItemTipUtility.Show(itemID));
+ }
+ else
+ {
+ cells[i].SetActive(false);
+ }
+ }
+ }
+
+ public void DisplaySkillWordsList(NPCLineupConfig lineUPConfig)
+ {
+ if (skillWords.IsNullOrEmpty())
+ return;
+ for (int i = 0; i < skillWords.Count; i++)
+ {
+ if (i < lineUPConfig.SkillIDExList.Length)
+ {
+ skillWords[i].SetActive(true);
+ int skillID = lineUPConfig.SkillIDExList[i];
+ skillWords[i].Init(skillID, () =>
+ {
+ SmallTipWin.showText = Language.Get("SmallTipFomat", SkillConfig.Get(skillID)?.SkillName, SkillConfig.Get(skillID)?.Description);
+ SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition);
+ SmallTipWin.isDownShow = true;
+ UIManager.Instance.OpenWindow<SmallTipWin>();
+ });
+ }
+ else
+ {
+ skillWords[i].SetActive(false);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Main/System/WarlordPavilion/WarlordPavilionWin.cs.meta b/Main/System/WarlordPavilion/WarlordPavilionWin.cs.meta
new file mode 100644
index 0000000..7ed772e
--- /dev/null
+++ b/Main/System/WarlordPavilion/WarlordPavilionWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 22e78d9e59c01994f9cd2e8e2e5f83a2
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Utility/EnumHelper.cs b/Main/Utility/EnumHelper.cs
index 7be73bb..a5d5be9 100644
--- a/Main/Utility/EnumHelper.cs
+++ b/Main/Utility/EnumHelper.cs
@@ -850,6 +850,7 @@
LineupRecommend = 50, //闃靛鎺ㄨ崘
DailySpecials = 51, //姣忔棩鐗规儬
Mail = 52, //閭
+ WarlordPavilion = 55, //瀹氬啗闃�
}
--
Gitblit v1.8.0