From 71365e5c15d81759c04d7aab953fa757fb183f9b Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期三, 12 十一月 2025 18:54:59 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts

---
 Main/System/Equip/EquipModel.cs                                                              |    8 
 Main/Core/NetworkPackage/DTCFile/ServerPack/HA9_Function/DTCA921_tagSCRenameResult.cs.meta   |   11 
 Main/System/DayMission/DayMissionManager.cs                                                  |    4 
 Main/System/Main/FightPowerFormula.cs.meta                                                   |   11 
 Main/Core/NetworkPackage/DTCFile/ServerPack/HA1_Sys/DTCA123_tagUpdatePlayerNameCount.cs      |   12 
 Main/Core/NetworkPackage/ServerPack/HA9_Function/HA921_tagSCRenameResult.cs.meta             |   11 
 Main/System/Main/MoneyMoveByPath.cs                                                          |   12 
 Main/Config/ConfigManager.cs                                                                 |    3 
 Main/Utility/GlobalTimeEvent.cs                                                              |    8 
 Main/Config/PartialConfigs/RandomNameConfig.cs.meta                                          |   11 
 Main/System/PlayerProfile/RenameWin.cs                                                       |   93 ++++
 Main/Core/NetworkPackage/DTCFile/ServerPack/HA9_Function/DTCA921_tagSCRenameResult.cs        |   12 
 Main/System/SystemSetting/SystemSetting.cs                                                   |    4 
 Main/Core/NetworkPackage/ServerPack/HA9_Function/HA921_tagSCRenameResult.cs                  |   17 
 Main/System/Battle/BaseBattleWin.cs                                                          |    6 
 Main/System/PlayerProfile.meta                                                               |    8 
 Main/Config/Configs/RandomNameConfig.cs                                                      |   47 ++
 Main/System/PlayerProfile/ExchangeCodeWin.cs                                                 |   89 ++++
 Main/System/PlayerProfile/ExchangeCodeWin.cs.meta                                            |   11 
 Main/System/PlayerProfile/SystemSetWin.cs                                                    |   40 +
 Main/Main.cs                                                                                 |    1 
 Main/System/PhantasmPavilion/AvatarCell.cs                                                   |    1 
 Main/System/PlayerProfile/SystemSetWin.cs.meta                                               |   11 
 Main/Config/PartialConfigs/RandomNameConfig.cs                                               |   46 ++
 Main/System/PlayerProfile/RenameWin.cs.meta                                                  |   11 
 Main/Core/NetworkPackage/DTCFile/ServerPack/HA1_Sys/DTCA123_tagUpdatePlayerNameCount.cs.meta |   11 
 Main/System/PlayerProfile/PlayerProfileWin.cs                                                |   86 ++++
 Main/Utility/JaceCalculator.cs                                                               |   57 ++
 Main/Config/Configs/RandomNameConfig.cs.meta                                                 |   11 
 Main/Core/NetworkPackage/DTCFile/ServerPack/HB4_FightDefine/DTCB430_tagSCTurnFightReport.cs  |   31 +
 Main/System/PlayerProfile/PlayerProfileWin.cs.meta                                           |   11 
 Main/System/PlayerProfile/RenameManager.cs                                                   |  145 ++++++
 Main/System/Battle/BattleManager.cs                                                          |    9 
 Main/System/PlayerProfile/RenameManager.cs.meta                                              |   11 
 Main/System/Main/FightPowerManager.cs                                                        |  138 +++++-
 Main/Utility/UIHelper.cs                                                                     |    4 
 Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs                                         |    3 
 Main/System/HeroUI/HeroSkillWin.cs                                                           |   18 
 Main/System/Main/MainWin.cs                                                                  |   19 
 Main/System/Main/FightPowerFormula.cs                                                        |  158 +++++++
 Main/Core/NetworkPackage/ServerPack/HA1_Sys/HA123_tagUpdatePlayerNameCount.cs                |   17 
 Main/Core/NetworkPackage/ServerPack/HA1_Sys/HA123_tagUpdatePlayerNameCount.cs.meta           |   11 
 Main/Component/UI/Common/LayoutElementSizeClamp.cs                                           |    6 
 43 files changed, 1,167 insertions(+), 67 deletions(-)

diff --git a/Main/Component/UI/Common/LayoutElementSizeClamp.cs b/Main/Component/UI/Common/LayoutElementSizeClamp.cs
index b0b17c3..fc3752b 100644
--- a/Main/Component/UI/Common/LayoutElementSizeClamp.cs
+++ b/Main/Component/UI/Common/LayoutElementSizeClamp.cs
@@ -3,6 +3,11 @@
 using UnityEngine.UI;
 
 //鎺у埗鐩爣鐨勬渶澶ф渶灏忓昂瀵�
+//浣跨敤鍙傝��
+// Preferred Width 鍜� Height 鍙互涓嶅嬀閫�
+// 锛侊紒锛佸繀椤诲嬀閫� Clamp Enable
+// Clamp涓� Min閰嶆渶灏� 鍜� Max閰嶆渶澶�
+// Target 閰嶇洰鏍囷紝姣斿鑴氭湰鍙互鎸傝浇鏂囧瓧缁勪欢涓婏紝鐩爣涔熸寚鍚戞枃瀛楃粍浠�
 [ExecuteAlways]
 public class LayoutElementSizeClamp : LayoutElement
 {
@@ -25,6 +30,7 @@
 
     }
 
+
     async UniTask UpdateRect()
     {
         await UniTask.DelayFrame(1);
diff --git a/Main/Config/ConfigManager.cs b/Main/Config/ConfigManager.cs
index 315200f..5a0a614 100644
--- a/Main/Config/ConfigManager.cs
+++ b/Main/Config/ConfigManager.cs
@@ -69,6 +69,7 @@
             typeof(PlayerAttrConfig),
             typeof(PlayerFaceConfig),
             typeof(PriorBundleConfig),
+            typeof(RandomNameConfig),
             typeof(SignInConfig),
             typeof(StoreConfig),
             typeof(SuccessConfig),
@@ -291,6 +292,8 @@
         ClearConfigDictionary<PlayerFaceConfig>();
         // 娓呯┖ PriorBundleConfig 瀛楀吀
         ClearConfigDictionary<PriorBundleConfig>();
+        // 娓呯┖ RandomNameConfig 瀛楀吀
+        ClearConfigDictionary<RandomNameConfig>();
         // 娓呯┖ SignInConfig 瀛楀吀
         ClearConfigDictionary<SignInConfig>();
         // 娓呯┖ StoreConfig 瀛楀吀
diff --git a/Main/Config/Configs/RandomNameConfig.cs b/Main/Config/Configs/RandomNameConfig.cs
new file mode 100644
index 0000000..ae5c159
--- /dev/null
+++ b/Main/Config/Configs/RandomNameConfig.cs
@@ -0,0 +1,47 @@
+锘�//--------------------------------------------------------
+//    [Author]:           YYL
+//    [  Date ]:           2025骞�11鏈�11鏃�
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System;
+using UnityEngine;
+using LitJson;
+
+public partial class RandomNameConfig : ConfigBase<int, RandomNameConfig>
+{
+    static RandomNameConfig()
+    {
+        // 璁块棶杩囬潤鎬佹瀯閫犲嚱鏁�
+        visit = true; 
+    }
+
+    public int ID;
+	public string Job;
+	public string RandomName1;
+	public string RandomName2;
+
+    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 ID); 
+
+			Job = tables[1];
+
+			RandomName1 = tables[2];
+
+			RandomName2 = tables[3];
+        }
+        catch (Exception exception)
+        {
+            Debug.LogError(exception);
+        }
+    }
+}
diff --git a/Main/Config/Configs/RandomNameConfig.cs.meta b/Main/Config/Configs/RandomNameConfig.cs.meta
new file mode 100644
index 0000000..67c8188
--- /dev/null
+++ b/Main/Config/Configs/RandomNameConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: be5973bc28eb7ad47bf0054cb653c1da
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/Config/PartialConfigs/RandomNameConfig.cs b/Main/Config/PartialConfigs/RandomNameConfig.cs
new file mode 100644
index 0000000..2d172d4
--- /dev/null
+++ b/Main/Config/PartialConfigs/RandomNameConfig.cs
@@ -0,0 +1,46 @@
+using System.Collections.Generic;
+public partial class RandomNameConfig : ConfigBase<int, RandomNameConfig>
+{
+    // <鑱屼笟,闅忔満濮�>
+    static Dictionary<int, List<string>> randomName1Dict = new Dictionary<int, List<string>>();
+    // <鑱屼笟,闅忔満鍚�>
+    static Dictionary<int, List<string>> randomName2Dict = new Dictionary<int, List<string>>();
+    protected override void OnConfigParseCompleted()
+    {
+        int[] arr = ConfigParse.GetMultipleStr<int>(Job);
+        if (arr.IsNullOrEmpty())
+            return;
+        foreach (var item in arr)
+        {
+            if (!randomName1Dict.ContainsKey(item))
+            {
+                randomName1Dict[item] = new List<string>();
+            }
+            if (!randomName1Dict[item].Contains(RandomName1))
+            {
+                randomName1Dict[item].Add(RandomName1);
+            }
+
+            if (!randomName2Dict.ContainsKey(item))
+            {
+                randomName2Dict[item] = new List<string>();
+            }
+            if (!randomName2Dict[item].Contains(RandomName2))
+            {
+                randomName2Dict[item].Add(RandomName2);
+            }
+        }
+    }
+
+    public static bool TryGetRandomName1ByJob(int job, out List<string> list)
+    {
+        list = null;
+        return !randomName1Dict.IsNullOrEmpty() && randomName1Dict.TryGetValue(job, out list);
+    }
+
+    public static bool TryGetRandomName2ByJob(int job, out List<string> list)
+    {
+        list = null;
+        return !randomName2Dict.IsNullOrEmpty() && randomName2Dict.TryGetValue(job, out list);
+    }
+}
diff --git a/Main/Config/PartialConfigs/RandomNameConfig.cs.meta b/Main/Config/PartialConfigs/RandomNameConfig.cs.meta
new file mode 100644
index 0000000..d752269
--- /dev/null
+++ b/Main/Config/PartialConfigs/RandomNameConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6a7049648c8e9ff428d119302bbd4800
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HA1_Sys/DTCA123_tagUpdatePlayerNameCount.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA1_Sys/DTCA123_tagUpdatePlayerNameCount.cs
new file mode 100644
index 0000000..9b7b743
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA1_Sys/DTCA123_tagUpdatePlayerNameCount.cs
@@ -0,0 +1,12 @@
+using UnityEngine;
+using System.Collections;
+
+//A1 23 瑙掕壊鏀瑰悕娆℃暟 #tagUpdatePlayerNameCount
+
+public class DTCA123_tagUpdatePlayerNameCount : DtcBasic {
+    public override void Done(GameNetPackBasic vNetPack) {
+        base.Done(vNetPack);
+        HA123_tagUpdatePlayerNameCount vNetData = vNetPack as HA123_tagUpdatePlayerNameCount;
+        RenameManager.Instance.UpdatePlayerNameCount(vNetData);
+    }
+}
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HA1_Sys/DTCA123_tagUpdatePlayerNameCount.cs.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA1_Sys/DTCA123_tagUpdatePlayerNameCount.cs.meta
new file mode 100644
index 0000000..f899f61
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA1_Sys/DTCA123_tagUpdatePlayerNameCount.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: fe116c76d9a7fb64cae48b1ccf2620bc
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HA9_Function/DTCA921_tagSCRenameResult.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA9_Function/DTCA921_tagSCRenameResult.cs
new file mode 100644
index 0000000..dce8f91
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA9_Function/DTCA921_tagSCRenameResult.cs
@@ -0,0 +1,12 @@
+using UnityEngine;
+using System.Collections;
+
+// A9 21 瑙掕壊鏀瑰悕缁撴灉 #tagSCRenameResult
+
+public class DTCA921_tagSCRenameResult : DtcBasic {
+    public override void Done(GameNetPackBasic vNetPack) {
+        base.Done(vNetPack);
+        HA921_tagSCRenameResult vNetData = vNetPack as HA921_tagSCRenameResult;
+        RenameManager.Instance.UpdateRenameResult(vNetData);
+    }
+}
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HA9_Function/DTCA921_tagSCRenameResult.cs.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA9_Function/DTCA921_tagSCRenameResult.cs.meta
new file mode 100644
index 0000000..ea3defa
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA9_Function/DTCA921_tagSCRenameResult.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 13b012d2181362849a84ed5b9201d225
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HB4_FightDefine/DTCB430_tagSCTurnFightReport.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB4_FightDefine/DTCB430_tagSCTurnFightReport.cs
index 74b63df..58bf81f 100644
--- a/Main/Core/NetworkPackage/DTCFile/ServerPack/HB4_FightDefine/DTCB430_tagSCTurnFightReport.cs
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB4_FightDefine/DTCB430_tagSCTurnFightReport.cs
@@ -10,7 +10,8 @@
 {
 
     static byte[] vCmdBytes = new byte[2];
-
+    bool canAddPack = false;
+        
     public override void Done(GameNetPackBasic vNetPack)
     {
         base.Done(vNetPack);
@@ -18,8 +19,10 @@
 
         // 鎴樻姤缁撴灉
         string guid = UIHelper.ServerStringTrim(vNetData.GUID);
+        canAddPack = false;
 
         //绾﹀畾 B430 鍐呭锛堝皬鍖�1闀垮害WORD + 鍖�1 + 灏忓寘2闀垮害WORD + 鍖�2锛�
+        //绾﹀畾绗竴涓寘鏄疊424锛屽厛鍙戣繃鏉ョ殑杩囨护鎶ラ敊閫氱煡
         try
         {
             int vReadIndex = 0;
@@ -60,8 +63,11 @@
                     GameNetPackBasic npk = PackageRegedit.TransPack(ServerType.B430, cmd, vPackBytes);
                     if (npk != null)
                     {
-                        vPackList.Add(npk);
-                        BattleManager.Instance.PushPackUID(guid, npk.packUID);
+                        if (!FilterBeforeB424(npk))
+                        {
+                            vPackList.Add(npk);
+                            BattleManager.Instance.PushPackUID(guid, npk.packUID);
+                        }
                         isRegist = true;
                     }
                 }
@@ -83,7 +89,7 @@
             {
                 BattleManager.Instance.PushPackage(guid, vPackList[i]);
             }
-
+            canAddPack = false;
             BattleManager.Instance.DistributeNextReportPackage(guid);
         }
         catch (Exception e)
@@ -92,6 +98,23 @@
         }
     }
 
+    //绾﹀畾绗竴涓寘鏄疊424锛屽厛鍙戣繃鏉ョ殑杩囨护鎶ラ敊閫氱煡
+    bool FilterBeforeB424(GameNetPackBasic npk)
+    {
+        if (npk is HB424_tagSCTurnFightInit)
+        {
+            canAddPack = true;
+            return false;
+        }
+
+        if (!canAddPack)
+        {
+            Debug.LogErrorFormat("鏈嶅姟绔渶澶勭悊 DTCB430_tagSCTurnFightReport 杩囨护鎺塀424涔嬪墠鐨勫寘:" + npk.ToString());
+            return true;
+        }
+        return false;
+    }
+
 
     protected List<GameNetPackBasic> AnalysisPackQueueAndDistribute(string guid, List<GameNetPackBasic> vPackList)
     {
diff --git a/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs b/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
index 44d9b4e..fa90f22 100644
--- a/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
+++ b/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
@@ -76,7 +76,6 @@
         Register(typeof(HB120_tagMCZhanlingInfo), typeof(DTCB120_tagMCZhanlingInfo));
         Register(typeof(HA311_tagMCSyncRealmInfo), typeof(DTCA311_tagMCSyncRealmInfo));
         Register(typeof(HB110_tagMCTaskInfo), typeof(DTCB110_tagMCTaskInfo));
-        Register(typeof(HA921_tagUpdatePlayerNameResult), typeof(DTCA921_tagUpdatePlayerNameResult));
         Register(typeof(H3202_tagServerResponse), typeof(DTC3202_tagServerResponse));
         Register(typeof(HA130_tagMCViewBillboardRet), typeof(DTCA130_tagMCViewBillboardRet));
         Register(typeof(HB419_tagSCObjHPRefresh), typeof(DTCB419_tagSCObjHPRefresh));
@@ -124,6 +123,8 @@
         Register(typeof(HA342_tagSCSuccessAwardRecordList), typeof(DTCA342_tagSCSuccessAwardRecordList));
         Register(typeof(HB128_tagSCLLMJInfo), typeof(DTCB128_tagSCLLMJInfo));
         Register(typeof(HA30D_tagSCDaySignInfo), typeof(DTCA30D_tagSCDaySignInfo));
+        Register(typeof(HA123_tagUpdatePlayerNameCount), typeof(DTCA123_tagUpdatePlayerNameCount));
+        Register(typeof(HA921_tagSCRenameResult), typeof(DTCA921_tagSCRenameResult));
     }
 
     //涓诲伐绋嬫敞鍐屽皝鍖�
diff --git a/Main/Core/NetworkPackage/ServerPack/HA1_Sys/HA123_tagUpdatePlayerNameCount.cs b/Main/Core/NetworkPackage/ServerPack/HA1_Sys/HA123_tagUpdatePlayerNameCount.cs
new file mode 100644
index 0000000..ce3935a
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HA1_Sys/HA123_tagUpdatePlayerNameCount.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+using System.Collections;
+
+//A1 23 瑙掕壊鏀瑰悕娆℃暟 #tagUpdatePlayerNameCount
+
+public class HA123_tagUpdatePlayerNameCount : GameNetPackBasic {
+    public uint Count;    //鏀瑰悕娆℃暟
+
+    public HA123_tagUpdatePlayerNameCount () {
+        _cmd = (ushort)0xA123;
+    }
+
+    public override void ReadFromBytes (byte[] vBytes) {
+        TransBytes (out Count, vBytes, NetDataType.DWORD);
+    }
+
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/HA1_Sys/HA123_tagUpdatePlayerNameCount.cs.meta b/Main/Core/NetworkPackage/ServerPack/HA1_Sys/HA123_tagUpdatePlayerNameCount.cs.meta
new file mode 100644
index 0000000..dbcb098
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HA1_Sys/HA123_tagUpdatePlayerNameCount.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 22a9f002b7d6ce248b9ea930161aea99
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/Core/NetworkPackage/ServerPack/HA9_Function/HA921_tagSCRenameResult.cs b/Main/Core/NetworkPackage/ServerPack/HA9_Function/HA921_tagSCRenameResult.cs
new file mode 100644
index 0000000..9a2240f
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HA9_Function/HA921_tagSCRenameResult.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+using System.Collections;
+
+// A9 21 瑙掕壊鏀瑰悕缁撴灉 #tagSCRenameResult
+
+public class HA921_tagSCRenameResult : GameNetPackBasic {
+    public string PlayerName;    // 鏂板悕瀛�
+
+    public HA921_tagSCRenameResult () {
+        _cmd = (ushort)0xA921;
+    }
+
+    public override void ReadFromBytes (byte[] vBytes) {
+        TransBytes (out PlayerName, vBytes, NetDataType.Chars, 33);
+    }
+
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/HA9_Function/HA921_tagSCRenameResult.cs.meta b/Main/Core/NetworkPackage/ServerPack/HA9_Function/HA921_tagSCRenameResult.cs.meta
new file mode 100644
index 0000000..3a8b473
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HA9_Function/HA921_tagSCRenameResult.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 36721f75d20b1bc4dbed1a1b80411885
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/Main.cs b/Main/Main.cs
index c472246..f336ab3 100644
--- a/Main/Main.cs
+++ b/Main/Main.cs
@@ -86,6 +86,7 @@
         managers.Add(TianziBillboradManager.Instance);
         managers.Add(ExpSecretCollectionManager.Instance);
         managers.Add(SignManager.Instance);
+        managers.Add(RenameManager.Instance);
         foreach (var manager in managers)
         {
             manager.Init();
diff --git a/Main/System/Battle/BaseBattleWin.cs b/Main/System/Battle/BaseBattleWin.cs
index 1a2b085..fa8c2ad 100644
--- a/Main/System/Battle/BaseBattleWin.cs
+++ b/Main/System/Battle/BaseBattleWin.cs
@@ -42,7 +42,13 @@
 
         // 鍦ㄦ墦寮�鏃堕渶瑕佹殏鍋滀富绾挎垬鏂�
         if (BattleManager.Instance.storyBattleField != null)
+        {
             BattleManager.Instance.storyBattleField.IsPause = true;
+            if (UIManager.Instance.IsOpened<EquipExchangeWin>())
+            {
+                UIManager.Instance.CloseWindow<EquipExchangeWin>();
+            }
+        }
     }
 
     protected override void OnPreClose()
diff --git a/Main/System/Battle/BattleManager.cs b/Main/System/Battle/BattleManager.cs
index 827433e..64c81a5 100644
--- a/Main/System/Battle/BattleManager.cs
+++ b/Main/System/Battle/BattleManager.cs
@@ -2,6 +2,7 @@
 using UnityEngine;
 using LitJson;
 using System;
+using System.Linq;
 
 public class BattleManager : GameSystemManager<BattleManager>
 {
@@ -662,13 +663,13 @@
 
     public void DestroyAllBattleField()
     {
-        foreach (var kvp in battleFields)
+        var battleFieldsList = battleFields.Values.ToList();
+        foreach (var battleField in battleFieldsList)
         {
-            BattleField battleField = kvp.Value;
             if (battleField == null)
                 continue;
-                
-            DestroyBattleField(battleField);
+            battleField.Destroy();
         }
     }
+
 }
\ No newline at end of file
diff --git a/Main/System/DayMission/DayMissionManager.cs b/Main/System/DayMission/DayMissionManager.cs
index daccfee..208d51b 100644
--- a/Main/System/DayMission/DayMissionManager.cs
+++ b/Main/System/DayMission/DayMissionManager.cs
@@ -20,7 +20,7 @@
     public override void Init()
     {
         DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
-        GlobalTimeEvent.Instance.MS100Event += OnMSEvent;
+        GlobalTimeEvent.Instance.MSEvent += OnMSEvent;
 
         ParseConfig();
     }
@@ -28,7 +28,7 @@
     public override void Release()
     {
         DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize;
-        GlobalTimeEvent.Instance.MS100Event -= OnMSEvent;
+        GlobalTimeEvent.Instance.MSEvent -= OnMSEvent;
     }
 
     void OnBeforePlayerDataInitialize()
diff --git a/Main/System/Equip/EquipModel.cs b/Main/System/Equip/EquipModel.cs
index 4b8f35d..fbb4b5f 100644
--- a/Main/System/Equip/EquipModel.cs
+++ b/Main/System/Equip/EquipModel.cs
@@ -327,9 +327,6 @@
         if (waitEquipOPPack)
             return false;
 
-        // 鍚庣画琛ュ厖寮曞鎴栬�呭叾浠栨儏鍐典笅锛屼笉鍏佽鍒囨崲瑁呭鐣岄潰
-        // if (NewBieCenter.Instance.inGuiding)
-        //     return;
 
         if (UIManager.Instance.IsOpened<EquipExchangeWin>())
         {
@@ -356,6 +353,11 @@
         if (NewBieCenter.Instance.inGuiding)
             return null;
 
+        string activeBattleName = BattleManager.Instance.GetActiveBattleName();
+        if (activeBattleName != "" && activeBattleName != "StoryBattleField")
+            return null;
+
+
         return PackManager.Instance.GetItemByIndex(PackType.DropItem, waitEquipOP.Dequeue());
     }
 
diff --git a/Main/System/HeroUI/HeroSkillWin.cs b/Main/System/HeroUI/HeroSkillWin.cs
index fc83d71..cc83ae1 100644
--- a/Main/System/HeroUI/HeroSkillWin.cs
+++ b/Main/System/HeroUI/HeroSkillWin.cs
@@ -1,3 +1,4 @@
+using Cysharp.Threading.Tasks;
 using UnityEngine;
 using UnityEngine.UI;
 
@@ -7,11 +8,12 @@
 /// </summary>
 public class HeroSkillWin : UIBase
 {
+    [SerializeField] RectTransform bg;
     [SerializeField] SkillBaseCell normalSkillCell;
     [SerializeField] Text nameText;
     [SerializeField] Text skillTypeText;
     [SerializeField] RichText descText;
-    
+
     [SerializeField] SkillBaseCell angerSkillCell;
     [SerializeField] Text name2Text;
     [SerializeField] Text skillType2Text;
@@ -24,10 +26,13 @@
     {
         heroID = functionOrder;
         Refresh();
+
+        
     }
 
-    protected override void OnPreClose()
+    protected override void NextFrameAfterOpen()
     {
+        ForceRefreshLayout().Forget();
     }
 
 
@@ -49,4 +54,13 @@
         desc2Text.text = skillConfig2.Description;
     }
 
+    async UniTask ForceRefreshLayout()
+    {
+        await UniTask.DelayFrame(2);
+        LayoutRebuilder.ForceRebuildLayoutImmediate(bg);
+        // 鍒锋柊鎵�鏈塋ayout缁勪欢
+        await UniTask.Delay(100);
+        // 鍒锋柊鎵�鏈塋ayout缁勪欢
+        LayoutRebuilder.ForceRebuildLayoutImmediate(bg);
+    }
 }
\ No newline at end of file
diff --git a/Main/System/Main/FightPowerFormula.cs b/Main/System/Main/FightPowerFormula.cs
new file mode 100644
index 0000000..9aca394
--- /dev/null
+++ b/Main/System/Main/FightPowerFormula.cs
@@ -0,0 +1,158 @@
+
+using System.Collections.Generic;
+
+public class FightPowerFormula
+{
+    // 鍩虹灞炴�у叕寮�
+    // 鎴樻枟灞炴�у叕寮�
+    // (lvValue+equipValue+bookValue+realmValue+gubaoValue+hjgValue+horseValue)+(heroSelfValue+lineupHaloValue+starTalentValue+breakLVValue+awakeTalentValue)+fetterValue
+    // 鎴樻枟鍔涘叕寮�
+    // long(Atk*AtkRatio+MaxHP*MaxHPRatio+Def*DefRatio+(StunRate*StunRateRatio+SuperHitRate*SuperHitRateRatio+ComboRate*ComboRateRatio+MissRate*MissRateRatio+ParryRate*ParryRateRatio+SuckHPPer*SuckHPPerRatio+StunRateDef*StunRateDefRatio+SuperHitRateDef*SuperHitRateDefRatio+ComboRateDef*ComboRateDefRatio+MissRateDef*MissRateDefRatio+ParryRateDef*ParryRateDefRatio+SuckHPPerDef*SuckHPPerDefRatio+FinalDamPer*FinalDamPerRatio+FinalDamPerDef*FinalDamPerDefRatio+PhyDamPer*PhyDamPerRatio+PhyDamPerDef*PhyDamPerDefRatio+MagDamPer*MagDamPerRatio+MagDamPerDef*MagDamPerDefRatio+NormalSkillPer*NormalSkillPerRatio+NormalSkillPerDef*NormalSkillPerDefRatio+AngerSkillPer*AngerSkillPerRatio+AngerSkillPerDef*AngerSkillPerDefRatio+SuperDamPer*SuperDamPerRatio+SuperDamPerDef*SuperDamPerDefRatio+CurePer*CurePerRatio+CurePerDef*CurePerDefRatio+ShieldPer*ShieldPerRatio+ShieldPerDef*ShieldPerDefRatio+DOTPer*DOTPerRatio+DOTPerDef*DOTPerDefRatio+WeiFinalDamPer*WeiFinalDamPerRatio+WeiFinalDamPerDef*WeiFinalDamPerDefRatio+ShuFinalDamPer*ShuFinalDamPerRatio+ShuFinalDamPerDef*ShuFinalDamPerDefRatio+WuFinalDamPer*WuFinalDamPerRatio+WuFinalDamPerDef*WuFinalDamPerDefRatio+QunFinalDamPer*QunFinalDamPerRatio+QunFinalDamPerDef*QunFinalDamPerDefRatio)/100.0-55000)
+
+    public static double GetBaseAttr(Dictionary<string, double> variables)
+    {
+
+        double lvValue = variables["lvValue"];
+        double equipValue = variables["equipValue"];
+        double bookValue = variables["bookValue"];
+        double realmValue = variables["realmValue"];
+        double gubaoValue = variables["gubaoValue"];
+        double hjgValue = variables["hjgValue"];
+        double horseValue = variables["horseValue"];
+        double lineupHaloPer = variables["lineupHaloPer"];
+        double bookPer = variables["bookPer"];
+        double realmPer = variables["realmPer"];
+        double gubaoPer = variables["gubaoPer"];
+        double hjgPer = variables["hjgPer"];
+        double horsePer = variables["horsePer"];
+        double lineupInitAddPer = variables["lineupInitAddPer"];
+        double lineupLVAddPer = variables["lineupLVAddPer"];
+        double lineupBreakLVAddPer = variables["lineupBreakLVAddPer"];
+        double lineupStarAddPer = variables["lineupStarAddPer"];
+        double inheritPer = variables["inheritPer"];
+        double fetterPer = variables["fetterPer"];
+        double starTalentPer = variables["starTalentPer"];
+        double breakLVPer = variables["breakLVPer"];
+        double awakeTalentPer = variables["awakeTalentPer"];
+        double heroSelfValue = variables["heroSelfValue"];
+
+        return (lvValue + equipValue + bookValue + realmValue + gubaoValue + hjgValue + horseValue) * (1 + lineupHaloPer + bookPer + realmPer + gubaoPer + hjgPer + horsePer + lineupInitAddPer + lineupLVAddPer + lineupBreakLVAddPer + lineupStarAddPer) * (inheritPer + fetterPer + starTalentPer + breakLVPer + awakeTalentPer) + heroSelfValue;
+    }
+
+    public static double GetFightAttr(Dictionary<string, double> variables)
+    {
+        double lvValue = variables["lvValue"];
+        double equipValue = variables["equipValue"];
+        double bookValue = variables["bookValue"];
+        double realmValue = variables["realmValue"];
+        double gubaoValue = variables["gubaoValue"];
+        double hjgValue = variables["hjgValue"];
+        double horseValue = variables["horseValue"];
+        double heroSelfValue = variables["heroSelfValue"];
+        double lineupHaloValue = variables["lineupHaloValue"];
+        double starTalentValue = variables["starTalentValue"];
+        double breakLVValue = variables["breakLVValue"];
+        double awakeTalentValue = variables["awakeTalentValue"];
+        double fetterValue = variables["fetterValue"];
+
+        return lvValue + equipValue + bookValue + realmValue + gubaoValue + hjgValue + horseValue + (heroSelfValue + lineupHaloValue + starTalentValue + breakLVValue + awakeTalentValue) + fetterValue;
+    }
+
+    public static double GetFightPower(Dictionary<string, double> variables)
+    {
+        double Atk = variables["Atk"];
+        double AtkRatio = variables["AtkRatio"];
+        double MaxHP = variables["MaxHP"];
+        double MaxHPRatio = variables["MaxHPRatio"];
+        double Def = variables["Def"];
+        double DefRatio = variables["DefRatio"];
+        double StunRate = variables["StunRate"];
+        double StunRateRatio = variables["StunRateRatio"];
+        double SuperHitRate = variables["SuperHitRate"];
+        double SuperHitRateRatio = variables["SuperHitRateRatio"];
+        double ComboRate = variables["ComboRate"];
+        double ComboRateRatio = variables["ComboRateRatio"];
+        double MissRate = variables["MissRate"];
+        double MissRateRatio = variables["MissRateRatio"];
+        double ParryRate = variables["ParryRate"];
+        double ParryRateRatio = variables["ParryRateRatio"];
+        double SuckHPPer = variables["SuckHPPer"];
+        double SuckHPPerRatio = variables["SuckHPPerRatio"];
+        double StunRateDef = variables["StunRateDef"];
+        double StunRateDefRatio = variables["StunRateDefRatio"];
+        double SuperHitRateDef = variables["SuperHitRateDef"];
+        double SuperHitRateDefRatio = variables["SuperHitRateDefRatio"];
+        double ComboRateDef = variables["ComboRateDef"];
+        double ComboRateDefRatio = variables["ComboRateDefRatio"];
+        double MissRateDef = variables["MissRateDef"];
+        double MissRateDefRatio = variables["MissRateDefRatio"];
+        double ParryRateDef = variables["ParryRateDef"];
+        double ParryRateDefRatio = variables["ParryRateDefRatio"];
+        double SuckHPPerDef = variables["SuckHPPerDef"];
+        double SuckHPPerDefRatio = variables["SuckHPPerDefRatio"];
+        double FinalDamPer = variables["FinalDamPer"];
+        double FinalDamPerRatio = variables["FinalDamPerRatio"];
+        double FinalDamPerDef = variables["FinalDamPerDef"];
+        double FinalDamPerDefRatio = variables["FinalDamPerDefRatio"];
+        double PhyDamPer = variables["PhyDamPer"];
+        double PhyDamPerRatio = variables["PhyDamPerRatio"];
+        double PhyDamPerDef = variables["PhyDamPerDef"];
+        double PhyDamPerDefRatio = variables["PhyDamPerDefRatio"];
+        double MagDamPer = variables["MagDamPer"];
+        double MagDamPerRatio = variables["MagDamPerRatio"];
+        double MagDamPerDef = variables["MagDamPerDef"];
+        double MagDamPerDefRatio = variables["MagDamPerDefRatio"];
+        double NormalSkillPer = variables["NormalSkillPer"];
+        double NormalSkillPerRatio = variables["NormalSkillPerRatio"];
+        double NormalSkillPerDef = variables["NormalSkillPerDef"];
+        double NormalSkillPerDefRatio = variables["NormalSkillPerDefRatio"];
+        double AngerSkillPer = variables["AngerSkillPer"];
+        double AngerSkillPerRatio = variables["AngerSkillPerRatio"];
+        double AngerSkillPerDef = variables["AngerSkillPerDef"];
+        double AngerSkillPerDefRatio = variables["AngerSkillPerDefRatio"];
+        double SuperDamPer = variables["SuperDamPer"];
+        double SuperDamPerRatio = variables["SuperDamPerRatio"];
+        double SuperDamPerDef = variables["SuperDamPerDef"];
+        double SuperDamPerDefRatio = variables["SuperDamPerDefRatio"];
+        double CurePer = variables["CurePer"];
+        double CurePerRatio = variables["CurePerRatio"];
+        double CurePerDef = variables["CurePerDef"];
+        double CurePerDefRatio = variables["CurePerDefRatio"];
+        double ShieldPer = variables["ShieldPer"];
+        double ShieldPerRatio = variables["ShieldPerRatio"];
+        double ShieldPerDef = variables["ShieldPerDef"];
+        double ShieldPerDefRatio = variables["ShieldPerDefRatio"];
+        double DOTPer = variables["DOTPer"];
+        double DOTPerRatio = variables["DOTPerRatio"];
+        double DOTPerDef = variables["DOTPerDef"];
+        double DOTPerDefRatio = variables["DOTPerDefRatio"];
+        double WeiFinalDamPer = variables["WeiFinalDamPer"];
+        double WeiFinalDamPerRatio = variables["WeiFinalDamPerRatio"];
+        double WeiFinalDamPerDef = variables["WeiFinalDamPerDef"];
+        double WeiFinalDamPerDefRatio = variables["WeiFinalDamPerDefRatio"];
+        double ShuFinalDamPer = variables["ShuFinalDamPer"];
+        double ShuFinalDamPerRatio = variables["ShuFinalDamPerRatio"];
+        double ShuFinalDamPerDef = variables["ShuFinalDamPerDef"];
+        double ShuFinalDamPerDefRatio = variables["ShuFinalDamPerDefRatio"];
+        double WuFinalDamPer = variables["WuFinalDamPer"];
+        double WuFinalDamPerRatio = variables["WuFinalDamPerRatio"];
+        double WuFinalDamPerDef = variables["WuFinalDamPerDef"];
+        double WuFinalDamPerDefRatio = variables["WuFinalDamPerDefRatio"];
+        double QunFinalDamPer = variables["QunFinalDamPer"];
+        double QunFinalDamPerRatio = variables["QunFinalDamPerRatio"];
+        double QunFinalDamPerDef = variables["QunFinalDamPerDef"];
+        double QunFinalDamPerDefRatio = variables["QunFinalDamPerDefRatio"];
+
+
+
+        return Atk * AtkRatio + MaxHP * MaxHPRatio + Def * DefRatio + (StunRate * StunRateRatio + SuperHitRate * SuperHitRateRatio + ComboRate * ComboRateRatio + MissRate * MissRateRatio + ParryRate * ParryRateRatio + SuckHPPer * SuckHPPerRatio + StunRateDef * StunRateDefRatio + SuperHitRateDef * SuperHitRateDefRatio + ComboRateDef * ComboRateDefRatio + MissRateDef * MissRateDefRatio + ParryRateDef * ParryRateDefRatio + SuckHPPerDef * SuckHPPerDefRatio + FinalDamPer * FinalDamPerRatio + FinalDamPerDef * FinalDamPerDefRatio + PhyDamPer * PhyDamPerRatio + PhyDamPerDef * PhyDamPerDefRatio + MagDamPer * MagDamPerRatio + MagDamPerDef * MagDamPerDefRatio + NormalSkillPer * NormalSkillPerRatio + NormalSkillPerDef * NormalSkillPerDefRatio + AngerSkillPer * AngerSkillPerRatio + AngerSkillPerDef * AngerSkillPerDefRatio + SuperDamPer * SuperDamPerRatio + SuperDamPerDef * SuperDamPerDefRatio + CurePer * CurePerRatio + CurePerDef * CurePerDefRatio + ShieldPer * ShieldPerRatio + ShieldPerDef * ShieldPerDefRatio + DOTPer * DOTPerRatio + DOTPerDef * DOTPerDefRatio + WeiFinalDamPer * WeiFinalDamPerRatio + WeiFinalDamPerDef * WeiFinalDamPerDefRatio + ShuFinalDamPer * ShuFinalDamPerRatio + ShuFinalDamPerDef * ShuFinalDamPerDefRatio + WuFinalDamPer * WuFinalDamPerRatio + WuFinalDamPerDef * WuFinalDamPerDefRatio + QunFinalDamPer * QunFinalDamPerRatio + QunFinalDamPerDef * QunFinalDamPerDefRatio) / 100.0 - 55000;
+
+    }
+
+    public static double GetSkillsFightPower(Dictionary<string, double> variables)
+    {
+        double SkillPower = variables["SkillPower"];
+        double OfficialLV = variables["OfficialLV"];
+        return SkillPower * OfficialLV;
+    }
+}
\ No newline at end of file
diff --git a/Main/System/Main/FightPowerFormula.cs.meta b/Main/System/Main/FightPowerFormula.cs.meta
new file mode 100644
index 0000000..40b9582
--- /dev/null
+++ b/Main/System/Main/FightPowerFormula.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 7ccd965ff7cf97e40bc0c620b706bcff
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/Main/FightPowerManager.cs b/Main/System/Main/FightPowerManager.cs
index 05a4476..a73bea9 100644
--- a/Main/System/Main/FightPowerManager.cs
+++ b/Main/System/Main/FightPowerManager.cs
@@ -4,7 +4,7 @@
 using System.Linq;
 using UnityEngine;
 using LitJson;
-using Spine;
+
 
 //锛佸崟鑻遍泟鏌ョ湅鎴樺姏 鍙畻鑷繁鐨勪笂闃靛睘鎬�  涓嶇畻缇佺粖 鎬讳笂闃靛睘鎬�  鍏夌幆
 // 鎴樺姏鐨勮绠楁柟寮�
@@ -20,7 +20,7 @@
     Dictionary<string, double> propertyVariables = new Dictionary<string, double>();
     Dictionary<string, double> fightPowerVariables = new Dictionary<string, double>();  //鎬绘垬鍔涗腑鐨勫崟姝﹀皢鎴樺姏
 
-
+    int useFormulaType = 0;  //鍏紡璋冪敤鏂瑰紡0 浠g爜 1鍏紡
     public FightPowerManager()
     {
         // 鏁板��1锛氬熀纭�涓夌淮灞炴�ц绠楀叕寮�
@@ -53,7 +53,7 @@
 
         dropIndexCalc = dropindex;
 #if UNITY_EDITOR
-        Debug.Log("鎴樺姏锛氬垵濮嬪寲鍙傛暟 dropIndex锛�" + dropIndexCalc + " 闃靛瀷锛�" + teamTypeCalc + " ispreview:" + ispreview);
+        // Debug.Log("鎴樺姏锛氬垵濮嬪寲鍙傛暟 dropIndex锛�" + dropIndexCalc + " 闃靛瀷锛�" + teamTypeCalc + " ispreview:" + ispreview);
 #endif
     }
     #endregion
@@ -74,14 +74,14 @@
     //绛夌骇灞炴��
     void RefreshLVAttrs()
     {
-        lvAttrs.Clear();
+        // lvAttrs.Clear();
         var playerLVConfig = PlayerLVConfig.Get(PlayerDatas.Instance.baseData.LV);
         foreach (var attrType in PlayerPropertyConfig.baseAttrs)
         {
             lvAttrs[attrType] = GetPlayerLVValue(playerLVConfig, attrType);
         }
 #if UNITY_EDITOR
-        Debug.Log("鎴樺姏锛氱瓑绾у睘鎬� " + JsonMapper.ToJson(lvAttrs));
+        // Debug.Log("鎴樺姏锛氱瓑绾у睘鎬� " + JsonMapper.ToJson(lvAttrs));
 #endif
 
     }
@@ -107,7 +107,7 @@
     //瀹樿亴灞炴��
     void RefreshOfficialAttrs()
     {
-        officialAttrs.Clear();
+        // officialAttrs.Clear();
         var config = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel);
         for (int i = 0; i < config.AddAttrType.Length; i++)
         {
@@ -115,7 +115,7 @@
             officialAttrs[id] = config.AddAttrNum[i];
         }
 #if UNITY_EDITOR
-        Debug.Log("鎴樺姏锛氬畼鑱屽睘鎬� " + JsonMapper.ToJson(officialAttrs));
+        // Debug.Log("鎴樺姏锛氬畼鑱屽睘鎬� " + JsonMapper.ToJson(officialAttrs));
 #endif
 
     }
@@ -175,7 +175,7 @@
         }
 
 #if UNITY_EDITOR
-        Debug.Log("鎴樺姏锛氳澶囧睘鎬� " + JsonMapper.ToJson(equipAttrs));
+        // Debug.Log("鎴樺姏锛氳澶囧睘鎬� " + JsonMapper.ToJson(equipAttrs));
 #endif
     }
 
@@ -187,12 +187,12 @@
         lineUpPerDict = HeroUIManager.Instance.GetLineupPer(teamTypeCalc, isPreviewTeamPower);
 
 #if UNITY_EDITOR
-        Debug.Log("鎴樺姏锛氫笂闃靛睘鎬� " + JsonMapper.ToJson(lineUpPerDict));
+        // Debug.Log("鎴樺姏锛氫笂闃靛睘鎬� " + JsonMapper.ToJson(lineUpPerDict));
 #endif
         // 闃靛锛氬浗瀹讹紙鍏夌幆锛夊睘鎬�
         countryAttrs = HeroUIManager.Instance.GetCountryAttrs(teamTypeCalc, isPreviewTeamPower);
 #if UNITY_EDITOR
-        Debug.Log("鎴樺姏锛氬浗瀹讹紙鍏夌幆锛夊睘鎬� " + JsonMapper.ToJson(countryAttrs));
+        // Debug.Log("鎴樺姏锛氬浗瀹讹紙鍏夌幆锛夊睘鎬� " + JsonMapper.ToJson(countryAttrs));
 #endif
     }
 
@@ -223,7 +223,7 @@
     // 鍗曞熀纭�灞炴�ц绠�
     public double GetPropertyVaule(int attrType, HeroInfo hero, string formula)
     {
-        propertyVariables.Clear();
+        // propertyVariables.Clear();
         propertyVariables["lvValue"] = lvAttrs.ContainsKey(attrType) ? lvAttrs[attrType] : 0;
         propertyVariables["equipValue"] = equipAttrs.ContainsKey(attrType) ? equipAttrs[attrType] : 0;
         propertyVariables["bookValue"] = 0;
@@ -263,12 +263,66 @@
 
 #if UNITY_EDITOR
         //鎺掗櫎鍊间负0鐨勫睘鎬ц緭鍑�
-        var tmpPropertyVariables = propertyVariables.Where(x => x.Value > 0).ToDictionary(x => x.Key, x => x.Value);
-        if (!tmpPropertyVariables.IsNullOrEmpty())
-            propertyStrForDebug += $"灞炴�D {attrType} - {JsonMapper.ToJson(tmpPropertyVariables)}";
+        // var tmpPropertyVariables = propertyVariables.Where(x => x.Value > 0).ToDictionary(x => x.Key, x => x.Value);
+        // if (!tmpPropertyVariables.IsNullOrEmpty())
+        //     propertyStrForDebug += $"灞炴�D {attrType} - {JsonMapper.ToJson(tmpPropertyVariables)}";
 #endif
         return JaceCalculator.Calculate(formula, propertyVariables);
     }
+
+    public double GetPropertyVaule(int attrType, HeroInfo hero, int type)
+    {
+        // propertyVariables.Clear();
+        propertyVariables["lvValue"] = lvAttrs.ContainsKey(attrType) ? lvAttrs[attrType] : 0;
+        propertyVariables["equipValue"] = equipAttrs.ContainsKey(attrType) ? equipAttrs[attrType] : 0;
+        propertyVariables["bookValue"] = 0;
+        propertyVariables["bookPer"] = GetBookPer(attrType) / 10000.0f;
+        propertyVariables["realmValue"] = officialAttrs.ContainsKey(attrType) ? officialAttrs[attrType] : 0;
+        propertyVariables["realmPer"] = GetOfficialPer(attrType) / 10000.0f;
+        propertyVariables["gubaoValue"] = 0;
+        propertyVariables["gubaoPer"] = 0;
+        propertyVariables["hjgValue"] = 0;
+        propertyVariables["hjgPer"] = 0;
+        propertyVariables["horseValue"] = 0;
+        propertyVariables["horsePer"] = 0;
+
+        //锛侊紒锛佸崟姝﹀皢鎴樺姏棰勮鐨勮瘽闇�瑕佹帓闄ら槦浼嶅奖鍝嶆垬鍔涳紝鍙畻姝﹀皢鑷韩鐨勪笂闃靛睘鎬�
+        propertyVariables["lineupInitAddPer"] = GetLineUpPer(attrType, "lineupInitAddPer") / 10000.0f;
+        propertyVariables["lineupLVAddPer"] = GetLineUpPer(attrType, "lineupLVAddPer") / 10000.0f;
+        propertyVariables["lineupBreakLVAddPer"] = GetLineUpPer(attrType, "lineupBreakLVAddPer") / 10000.0f;
+        propertyVariables["lineupStarAddPer"] = GetLineUpPer(attrType, "lineupStarAddPer") / 10000.0f;
+
+        //闃靛鍏夌幆 涓夊洿鐧惧垎姣斿姞鎴�
+        propertyVariables["lineupHaloValue"] = countryAttrs.ContainsKey(attrType) ? countryAttrs[attrType] : 0;
+        propertyVariables["lineupHaloPer"] = GetCountryPer(attrType) / 10000.0f;
+
+
+        //姝﹀皢灞炴��
+        propertyVariables["inheritPer"] = hero.GetInheritAttrPer(attrType) / 10000.0f;
+        propertyVariables["heroSelfValue"] = hero.GetSelfAddValue(attrType);
+        propertyVariables["heroSelfPer"] = hero.GetSelfAddPer(attrType) / 10000.0f;
+        propertyVariables["starTalentValue"] = hero.GetTalentAttrValue(attrType);
+        propertyVariables["starTalentPer"] = hero.GetTalentAttrPer(attrType) / 10000.0f;
+        propertyVariables["breakLVValue"] = hero.GetBreakAttrValue(attrType);
+        propertyVariables["breakLVPer"] = hero.GetBreakAttrPer(attrType) / 10000.0f;
+        propertyVariables["awakeTalentValue"] = hero.GetAwakeAttrValue(attrType);
+        propertyVariables["awakeTalentPer"] = hero.GetAwakeAttrPer(attrType) / 10000.0f;
+        propertyVariables["fetterValue"] = hero.GetFetterAttrValue(attrType);
+        propertyVariables["fetterPer"] = hero.GetFetterAttrPer(attrType) / 10000.0f;
+
+#if UNITY_EDITOR
+        //鎺掗櫎鍊间负0鐨勫睘鎬ц緭鍑�
+        // var tmpPropertyVariables = propertyVariables.Where(x => x.Value > 0).ToDictionary(x => x.Key, x => x.Value);
+        // if (!tmpPropertyVariables.IsNullOrEmpty())
+        //     propertyStrForDebug += $"灞炴�D {attrType} - {JsonMapper.ToJson(tmpPropertyVariables)}";
+#endif
+        if (type == 0)
+            return FightPowerFormula.GetBaseAttr(propertyVariables);
+        else
+            return FightPowerFormula.GetFightAttr(propertyVariables);
+    }
+
+
 
 
     int GetLineUpPer(int attrType, string key)
@@ -325,7 +379,7 @@
     public long CalculatePower()
     {
 #if UNITY_EDITOR
-        Debug.Log("鎴樺姏锛氬紑濮嬭绠�");
+        // Debug.Log("鎴樺姏锛氬紑濮嬭绠�");
 #endif
         // --- 鍏堣绠楁墍鏈夊姛鑳界殑姹囨�诲睘鎬� ---
         RefreshLVAttrs();
@@ -359,7 +413,7 @@
         }
 
 #if UNITY_EDITOR
-        Debug.Log("鎴樺姏锛氳绠楀畬姣� " + fightPower);
+        // Debug.Log("鎴樺姏锛氳绠楀畬姣� " + fightPower);
 #endif
         return fightPower;
     }
@@ -386,16 +440,22 @@
             }
             if (config.showType == 1)
             {
-                fightPowerVariables[config.Parameter] = Math.Round(GetPropertyVaule(config.ID, hero, propertyFormula), 3);
+                if (useFormulaType == 0)
+                    fightPowerVariables[config.Parameter] = Math.Round(GetPropertyVaule(config.ID, hero, 0), 3);
+                else
+                    fightPowerVariables[config.Parameter] = Math.Round(GetPropertyVaule(config.ID, hero, propertyFormula), 3);
             }
             else
             {
-                fightPowerVariables[config.Parameter] = Math.Round(GetPropertyVaule(config.ID, hero, fightPropertyFormula), 3);
+                if (useFormulaType == 0)
+                    fightPowerVariables[config.Parameter] = Math.Round(GetPropertyVaule(config.ID, hero, 1), 3);
+                else
+                    fightPowerVariables[config.Parameter] = Math.Round(GetPropertyVaule(config.ID, hero, fightPropertyFormula), 3);
             }
         }
 
 #if UNITY_EDITOR
-        Debug.Log($"鎴樺姏锛氭灏咺D {hero.heroId} 灞炴�т俊鎭� {propertyStrForDebug}");
+        // Debug.Log($"鎴樺姏锛氭灏咺D {hero.heroId} 灞炴�т俊鎭� {propertyStrForDebug}");
 #endif
 
         //灞炴�х郴鏁版牴鎹畼鑱岀瓑绾х殑鍔犳垚
@@ -443,13 +503,21 @@
         fightPowerVariables["CurePerRatio"] = fightPowerRatioConfig.CurePerRatio;
         fightPowerVariables["CurePerDefRatio"] = fightPowerRatioConfig.CurePerDefRatio;
 
+        long fightPower;
+        if (useFormulaType == 0)
+        {
+            fightPower = (long)FightPowerFormula.GetFightPower(fightPowerVariables);
+        }
+        else
+        {
 
-        long fightPower = (long)JaceCalculator.Calculate(fightPowerFormula, fightPowerVariables);
+            fightPower = (long)JaceCalculator.Calculate(fightPowerFormula, fightPowerVariables);
+        }        
 #if UNITY_EDITOR
-        //鎺掗櫎鍊间负0鐨勫睘鎬ц緭鍑�
-        var tmpFightPowerVariables = fightPowerVariables.Where(x => x.Value > 0).ToDictionary(x => x.Key, x => x.Value);
-        if (!tmpFightPowerVariables.IsNullOrEmpty())
-            Debug.Log($"鎴樺姏锛氭灏咺D {hero.heroId} 灞炴�ф垬鍔� {fightPower} 灞炴�ф垬鍔涘弬鏁� {JsonMapper.ToJson(tmpFightPowerVariables)}");
+            //鎺掗櫎鍊间负0鐨勫睘鎬ц緭鍑�
+            // var tmpFightPowerVariables = fightPowerVariables.Where(x => x.Value > 0).ToDictionary(x => x.Key, x => x.Value);
+            // if (!tmpFightPowerVariables.IsNullOrEmpty())
+            //     Debug.Log($"鎴樺姏锛氭灏咺D {hero.heroId} 灞炴�ф垬鍔� {fightPower} 灞炴�ф垬鍔涘弬鏁� {JsonMapper.ToJson(tmpFightPowerVariables)}");
 #endif
 
         //鍔犱笂鎶�鑳芥垬鍔�
@@ -458,15 +526,23 @@
         fightPowerVariables["OfficialLV"] = PlayerDatas.Instance.baseData.realmLevel;
         fightPowerVariables["SkillPower"] = hero.GetSkillsFightPower();
 
-        long skillPower = (long)JaceCalculator.Calculate(skillFightPowerFormula, fightPowerVariables);
+        long skillPower;
+        if (useFormulaType == 0)
+        {
+            skillPower = (long)FightPowerFormula.GetSkillsFightPower(fightPowerVariables);
+        }
+        else
+        {
+            skillPower = (long)JaceCalculator.Calculate(skillFightPowerFormula, fightPowerVariables);
+        }        
 
 #if UNITY_EDITOR
-        Debug.Log($"鎴樺姏锛氭灏咺D {hero.heroId} 鎶�鑳芥垬鍔� {skillPower} 鎶�鑳藉弬鏁� {JsonMapper.ToJson(fightPowerVariables)}");
+            // Debug.Log($"鎴樺姏锛氭灏咺D {hero.heroId} 鎶�鑳芥垬鍔� {skillPower} 鎶�鑳藉弬鏁� {JsonMapper.ToJson(fightPowerVariables)}");
 
-        Debug.Log($"鎴樺姏锛氭灏咺D {hero.heroId} 鎬绘垬鍔� {fightPower + skillPower}");
+            // Debug.Log($"鎴樺姏锛氭灏咺D {hero.heroId} 鎬绘垬鍔� {fightPower + skillPower}");
 #endif
 
-        return fightPower + skillPower;
+            return fightPower + skillPower;
     }
 
 
@@ -550,15 +626,15 @@
             }
             if (config.showType == 1)
             {
-                tmpAttrs[config.ID] = (long)GetPropertyVaule(config.ID, hero, propertyFormula);
+                tmpAttrs[config.ID] = (long)GetPropertyVaule(config.ID, hero, 0);
             }
             else
             {
-                tmpAttrs[config.ID] = (long)GetPropertyVaule(config.ID, hero, fightPropertyFormula);
+                tmpAttrs[config.ID] = (long)GetPropertyVaule(config.ID, hero, 1);
             }
         }
 #if UNITY_EDITOR
-        Debug.Log($"鎴樺姏锛氭灏咺D {hero.heroId} 灞炴�т俊鎭� {propertyStrForDebug}");
+        // Debug.Log($"鎴樺姏锛氭灏咺D {hero.heroId} 灞炴�т俊鎭� {propertyStrForDebug}");
 #endif
         return tmpAttrs;
     }
diff --git a/Main/System/Main/MainWin.cs b/Main/System/Main/MainWin.cs
index 0828ab3..36a0809 100644
--- a/Main/System/Main/MainWin.cs
+++ b/Main/System/Main/MainWin.cs
@@ -28,7 +28,7 @@
     [SerializeField] UIEffectPlayer openCloseAnim;
     [SerializeField] FillTween cdTween;
     [SerializeField] Text hammerText;
-    
+
     bool isForcePlayFightUIAnim = true; //寮哄埗鎾斁鎴樻枟閿ゅ瓙妗嗗姩鐢�
 
     public static event Action TabChangeEvent;
@@ -36,7 +36,10 @@
     {
         base.InitComponent();
 
-        avatarCell.button.AddListener(() => { });
+        avatarCell.button.SetListener(() =>
+        {
+            UIManager.Instance.OpenWindow<PlayerProfileWin>();
+        });
     }
 
     void Display()
@@ -50,6 +53,7 @@
     {
         PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh;
         AutoFightModel.Instance.OnFightEvent += OnSkillCast;
+        RenameManager.Instance.OnUpdateRenameResultEvent += OnUpdateRenameResultEvent;
         base.OnPreOpen();
 
         // 鍒锋柊UI
@@ -60,17 +64,22 @@
     {
         PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh;
         AutoFightModel.Instance.OnFightEvent -= OnSkillCast;
+        RenameManager.Instance.OnUpdateRenameResultEvent -= OnUpdateRenameResultEvent;
         base.OnPreClose();
         isForcePlayFightUIAnim = true;
     }
 
+    private void OnUpdateRenameResultEvent()
+    {
+        Display();
+    }
 
     void DisplayTopBar()
     {
         topBar.SetActive(functionOrder == 0 || functionOrder == 2);
     }
 
-  
+
     //鎴樻枟鎸夐挳鍔ㄧ敾
     void ClickAnimation(int index)
     {
@@ -199,7 +208,7 @@
         {
             return;
         }
-        
+
 
         ClickAnimation(index);
         // 鏇存柊褰撳墠閫変腑鐨勬爣绛剧储寮�
@@ -433,6 +442,6 @@
         OnTabButtonClicked(lastWinOrder);
     }
 
-    
+
     #endregion
 }
\ No newline at end of file
diff --git a/Main/System/Main/MoneyMoveByPath.cs b/Main/System/Main/MoneyMoveByPath.cs
index bcd0f0f..e290ff8 100644
--- a/Main/System/Main/MoneyMoveByPath.cs
+++ b/Main/System/Main/MoneyMoveByPath.cs
@@ -20,6 +20,10 @@
     public Transform targetPosition;
     List<ImageEx> imgMoneys = new List<ImageEx>();
     
+    int pointCount = 30;
+    Vector3[] points = new Vector3[30];
+    Vector3[] points2 = new Vector3[30];
+
     /// <summary>
     /// 鎾斁鎺夎惤鍔ㄧ敾
     /// </summary>
@@ -54,8 +58,7 @@
         }
 
         //閫氳繃 heightCurve 鐢熸垚璺緞锛屾椂闂翠负x 鎬绘椂闂翠负1锛寉涓洪珮搴︼紝鍋忕Щ閲忎负100
-        int pointCount = 30;
-        Vector3[] points = new Vector3[pointCount];
+
         for (int i = 0; i < pointCount; i++)
         {
             float x = i / (pointCount - 1f);
@@ -64,8 +67,6 @@
 
         }
 
-
-        
 
         for (int i = 0; i < imgMoneys.Count; i++)
         {
@@ -84,13 +85,12 @@
                 // x y 闅忔満涓嬪樊寮�
                 float randX = Random.Range(0.2f, 1f);
                 float randY = Random.Range(0.6f, 1f);
-                Vector3[] points2 = new Vector3[pointCount];
+                
                 for (int j = 0; j < points.Length; j++)
                 {
                     points2[j] = new Vector3((points[j].x + offsetX)* randDir * randX, points[j].y * randY, points[j].z);
                 }
                 moneyImg.transform.localPosition = points2[0];
-
 
                 moneyImg.transform.DOLocalPath(points2, duration1, PathType.CatmullRom).SetEase(Ease.InOutSine).OnComplete(() =>
                 {
diff --git a/Main/System/PhantasmPavilion/AvatarCell.cs b/Main/System/PhantasmPavilion/AvatarCell.cs
index 4a73a2c..354704e 100644
--- a/Main/System/PhantasmPavilion/AvatarCell.cs
+++ b/Main/System/PhantasmPavilion/AvatarCell.cs
@@ -56,6 +56,7 @@
         {
             if (m_button == null)
             {
+                LoadPrefab();
                 m_button = this.GetComponent<ButtonEx>("AvatarCell/Img_BG");
             }
             return m_button;
diff --git a/Main/System/PlayerProfile.meta b/Main/System/PlayerProfile.meta
new file mode 100644
index 0000000..11bfd63
--- /dev/null
+++ b/Main/System/PlayerProfile.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: d96838ad917e38e418d0c8df7594ac01
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/PlayerProfile/ExchangeCodeWin.cs b/Main/System/PlayerProfile/ExchangeCodeWin.cs
new file mode 100644
index 0000000..6d25424
--- /dev/null
+++ b/Main/System/PlayerProfile/ExchangeCodeWin.cs
@@ -0,0 +1,89 @@
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class ExchangeCodeWin : UIBase
+{
+    [SerializeField] InputField input;
+    [SerializeField] Button receiveBtn;
+    const string exchangeUrl = "http://gamecenter.secondworld.net.cn:53003/Coupon/CouponCode.php?";
+    bool isCool = false;
+    float time = 0;
+
+    protected override void InitComponent()
+    {
+        base.InitComponent();
+        receiveBtn.AddListener(ClickRecevieBtn);
+    }
+
+    protected override void OnPreOpen()
+    {
+        base.OnPreOpen();
+        time = 0;
+        isCool = false;
+        InitUI();
+    }
+
+    protected override void OnPreClose()
+    {
+        base.OnPreClose();
+    }
+
+    void LateUpdate()
+    {
+        if (isCool)
+        {
+            time += Time.deltaTime;
+            if (time >= 3)
+            {
+                time = 0;
+                isCool = false;
+            }
+        }
+    }
+
+    private void InitUI()
+    {
+        input.text = string.Empty;
+    }
+
+    private void ClickRecevieBtn()
+    {
+        if (isCool) return;
+
+        string passward = input.text;
+        if (string.IsNullOrEmpty(passward))
+        {
+            SysNotifyMgr.Instance.ShowTip("InputExchangeCode");
+            return;
+        }
+        else
+        {
+            isCool = true;
+            var tables = new Dictionary<string, string>();
+            tables["channel"] = VersionConfig.Get().appId;
+            tables["code"] = passward;
+#if UNITY_EDITOR
+            //tables["accid"] = ModelCenter.Instance.GetModel<LoginModel>().accountBuf;
+            tables["accid"] = PlayerDatas.Instance.baseData.AccID;
+#else
+                tables["accid"] = ynmbxxjUtil.Instance.FreePlatformInfo.account;
+#endif
+            tables["sid"] = ServerListCenter.Instance.currentServer.region_flag.ToString();
+            tables["pushurl"] = ServerListCenter.Instance.currentServer.region_domain;
+            tables["spid"] = VersionConfig.Get().SpID;
+            tables["roleid"] = UIHelper.ServerStringTrim(PlayerDatas.Instance.baseData.PlayerName);
+            tables["level"] = PlayerDatas.Instance.baseData.LV.ToString();
+            tables["viplevel"] = PlayerDatas.Instance.baseData.VIPLv.ToString();
+            HttpRequest.Instance.RequestHttpGet(StringUtility.Contact(exchangeUrl, HttpRequest.HashtablaToString(tables)), HttpRequest.defaultHttpContentType, 1, null);
+        }
+        // if (passward.Length > 1)
+        // {
+        //     string wxCode = passward.Substring(0, 2);
+        //     if (wxCode == "wx")
+        //     {
+        //         WindowCenter.Instance.Close<WelfareWin>();
+        //     }
+        // }
+    }
+}
diff --git a/Main/System/PlayerProfile/ExchangeCodeWin.cs.meta b/Main/System/PlayerProfile/ExchangeCodeWin.cs.meta
new file mode 100644
index 0000000..3dc2c71
--- /dev/null
+++ b/Main/System/PlayerProfile/ExchangeCodeWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4fc65570fe03ebc41bddb56d98345fce
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/PlayerProfile/PlayerProfileWin.cs b/Main/System/PlayerProfile/PlayerProfileWin.cs
new file mode 100644
index 0000000..98c6a8f
--- /dev/null
+++ b/Main/System/PlayerProfile/PlayerProfileWin.cs
@@ -0,0 +1,86 @@
+using UnityEngine;
+
+public class PlayerProfileWin : UIBase
+{
+    [SerializeField] AvatarCell avatarCell;
+    [SerializeField] OfficialTitleCell officialTitleCell;
+    [SerializeField] TextEx txtPlayerName;
+    [SerializeField] TextEx txtFightPoint;
+    [SerializeField] TextEx txtPlayerID;
+    [SerializeField] TextEx txtServerName;
+    [SerializeField] TextEx txtFamilyName;
+    [SerializeField] ButtonEx btnSetting;
+    [SerializeField] ButtonEx btnAnnouncement;
+    [SerializeField] ButtonEx btnCustomerService;
+    [SerializeField] ButtonEx btnRedemptionCode;
+    [SerializeField] ButtonEx btnForum;
+    [SerializeField] ButtonEx btnAssistant;
+    [SerializeField] ButtonEx btnGamingCommunity;
+    [SerializeField] ButtonEx btnSwitchServer;
+    [SerializeField] ButtonEx btnSyncPlatformAvatar;
+    [SerializeField] ButtonEx btnCopy;
+    [SerializeField] ButtonEx btnChangeName;
+    [SerializeField] ButtonEx btnText1;
+    [SerializeField] ButtonEx btnText2;
+    protected override void InitComponent()
+    {
+        base.InitComponent();
+        btnSetting.SetListener(() => { UIManager.Instance.OpenWindow<SystemSetWin>(); });
+        btnAnnouncement.SetListener(() => { GameNotice.OpenGameNoticeForce(); });
+        btnSwitchServer.SetListener(() => { GameNetSystem.Instance.LoginOut(); });
+        btnRedemptionCode.SetListener(() => { UIManager.Instance.OpenWindow<ExchangeCodeWin>(); });
+        btnCopy.SetListener(() =>
+        {
+            UIHelper.CopyToClipboard(PlayerDatas.Instance.baseData.PlayerID.ToString());
+            SysNotifyMgr.Instance.ShowTip("CopySuccess");
+        });
+        btnChangeName.SetListener(() => { UIManager.Instance.OpenWindow<RenameWin>(); });
+        btnText1.SetListener(() =>
+        {
+            GameAgeWarnWin.data = 1;
+            UIManager.Instance.OpenWindow<GameAgeWarnWin>();
+        });
+        btnText2.SetListener(() =>
+        {
+            GameAgeWarnWin.data = 2;
+            UIManager.Instance.OpenWindow<GameAgeWarnWin>();
+        });
+    }
+
+    protected override void OnPreOpen()
+    {
+        base.OnPreOpen();
+        RenameManager.Instance.OnUpdatePlayerNameCountEvent += OnUpdatePlayerNameCount;
+        RenameManager.Instance.OnUpdateRenameResultEvent += OnUpdateRenameResultEvent;
+        Display();
+    }
+
+    protected override void OnPreClose()
+    {
+        base.OnPreClose();
+        RenameManager.Instance.OnUpdatePlayerNameCountEvent -= OnUpdatePlayerNameCount;
+        RenameManager.Instance.OnUpdateRenameResultEvent -= OnUpdateRenameResultEvent;
+    }
+    private void OnUpdateRenameResultEvent()
+    {
+        Display();
+    }
+
+    private void OnUpdatePlayerNameCount()
+    {
+        Display();
+    }
+
+    void Display()
+    {
+        txtPlayerName.text = PlayerDatas.Instance.baseData.PlayerName;
+        txtFightPoint.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPower);
+        txtPlayerID.text = Language.Get("PlayerProfile10", PlayerDatas.Instance.baseData.PlayerID.ToString());
+        txtServerName.text = Language.Get("PlayerProfile11", ServerListCenter.Instance.GetServerName(UIHelper.GetServerIDByAccount(PlayerDatas.Instance.baseData.AccID)));
+        txtFamilyName.text = Language.Get("PlayerProfile12", PlayerDatas.Instance.fairyData.HasFairy ? PlayerDatas.Instance.baseData.FamilyName : Language.Get("PlayerProfile14"));
+        avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)PlayerDatas.Instance.baseData.PlayerID,
+                                                    PlayerDatas.Instance.baseData.face,
+                                                    PlayerDatas.Instance.baseData.facePic));
+        officialTitleCell.InitUI(PlayerDatas.Instance.baseData.realmLevel, PlayerDatas.Instance.baseData.TitleID);
+    }
+}
\ No newline at end of file
diff --git a/Main/System/PlayerProfile/PlayerProfileWin.cs.meta b/Main/System/PlayerProfile/PlayerProfileWin.cs.meta
new file mode 100644
index 0000000..b238260
--- /dev/null
+++ b/Main/System/PlayerProfile/PlayerProfileWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ea72bcc95f8931247844dde3088e0440
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/PlayerProfile/RenameManager.cs b/Main/System/PlayerProfile/RenameManager.cs
new file mode 100644
index 0000000..31c8642
--- /dev/null
+++ b/Main/System/PlayerProfile/RenameManager.cs
@@ -0,0 +1,145 @@
+using System;
+using System.Text;
+
+public class RenameManager : GameSystemManager<RenameManager>
+{
+    public int moneyType;
+    public int moneyNeed;
+    public override void Init()
+    {
+        DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitializeEvent;
+
+        FuncConfigConfig config = FuncConfigConfig.Get("PlayerRename");
+        int[] arr = ConfigParse.GetMultipleStr<int>(config.Numerical3);
+        moneyType = arr[0];
+        moneyNeed = arr[1];
+    }
+
+    public override void Release()
+    {
+        DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitializeEvent;
+    }
+
+    private void OnBeforePlayerDataInitializeEvent()
+    {
+        RenameManagerCount = 0;
+    }
+
+    public event Action OnUpdateRenameResultEvent;
+    public void UpdateRenameResult(HA921_tagSCRenameResult vNetData)
+    {
+        if (vNetData == null)
+            return;
+        PlayerDatas.Instance.baseData.PlayerName = UIHelper.ServerStringTrim(vNetData.PlayerName);
+        SysNotifyMgr.Instance.ShowTip("RenameSuccess");
+        OnUpdateRenameResultEvent?.Invoke();
+    }
+
+    int RenameManagerCount = 0; // 鏀瑰悕娆℃暟 涓�1 浠h〃宸茬粡棣栨鏀瑰悕杩囷紝鏈敼杩囦笂绾夸笉浼氭敹鍒拌灏佸寘
+    public event Action OnUpdatePlayerNameCountEvent;
+    public void UpdatePlayerNameCount(HA123_tagUpdatePlayerNameCount vNetData)
+    {
+        if (vNetData == null)
+            return;
+        RenameManagerCount = (int)vNetData.Count;
+        OnUpdatePlayerNameCountEvent?.Invoke();
+    }
+
+    public void SendRenamePack(string name)
+    {
+        CA122_tagUpdatePlayerName pack = new CA122_tagUpdatePlayerName();
+        pack.NewName = name;
+        pack.NewNameLen = (byte)GetUTF8InfoLen(name);
+        GameNetSystem.Instance.SendInfo(pack);
+    }
+
+    public bool IsFirstRename()
+    {
+        return RenameManagerCount == 0;
+    }
+
+    public string GetRondomNameByJob(int job)
+    {
+        if (!RandomNameConfig.TryGetRandomName1ByJob(job, out var randomNameList1))
+            return string.Empty;
+        if (!RandomNameConfig.TryGetRandomName2ByJob(job, out var randomNameList2))
+            return string.Empty;
+
+        int randomNameIndex1 = UnityEngine.Random.Range(0, randomNameList1.Count - 1);
+        int randomNameIndex2 = UnityEngine.Random.Range(0, randomNameList2.Count - 1);
+        return StringUtility.Contact(randomNameList1[randomNameIndex1], randomNameList2[randomNameIndex2]);
+    }
+
+    public bool CheckNameLimit(string name, out int errorCode)
+    {
+        errorCode = 0;
+        if (string.IsNullOrEmpty(name))
+        {
+            errorCode = 0;
+            return false;
+        }
+
+        if (!UIHelper.SatisfyNameLength(name, out errorCode))
+        {
+            return false;
+        }
+
+        if (DirtyWordConfig.IsDirtWord(name) || UIHelper.HasSpecialCharac(name)
+            || DirtyNameConfig.IsDirtName(name))
+        {
+            errorCode = 3;
+            return false;
+        }
+
+        if (name == PlayerDatas.Instance.baseData.PlayerName)
+        {
+            errorCode = 4;
+            return false;
+        }
+        return true;
+    }
+
+    public void ShowNameErrorTip(int _errorCode)
+    {
+        switch (_errorCode)
+        {
+            case 0:
+                //绌�
+                SysNotifyMgr.Instance.ShowTip("FamilyNameChangeNoNull");
+                break;
+            case 1:
+                // 鍚嶅瓧闀垮害杩囬暱
+                SysNotifyMgr.Instance.ShowTip("NameError2", 7);
+                break;
+            case 2:
+                // 鍚嶅瓧闀垮害杩囩煭
+                SysNotifyMgr.Instance.ShowTip("NameError1", 2);
+                break;
+            case 3:
+                // 鑴忓瓧
+                SysNotifyMgr.Instance.ShowTip("NameSensitive");
+                break;
+            case 4:
+                // 鍚嶅瓧宸插瓨鍦�
+                SysNotifyMgr.Instance.ShowTip("NameExists");
+                break;
+        }
+    }
+
+    public string GetSafeRandomName()
+    {
+        int job = PlayerDatas.Instance.baseData.Job;
+        for (int i = 0; i < 9999; i++)
+        {
+            string name = GetRondomNameByJob(job);
+            if (CheckNameLimit(name, out int errorCode))
+                return name;
+        }
+        return string.Empty;
+    }
+
+    public static int GetUTF8InfoLen(string msg)
+    {
+        return Encoding.UTF8.GetBytes(msg).Length;
+    }
+}
diff --git a/Main/System/PlayerProfile/RenameManager.cs.meta b/Main/System/PlayerProfile/RenameManager.cs.meta
new file mode 100644
index 0000000..52c0c93
--- /dev/null
+++ b/Main/System/PlayerProfile/RenameManager.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b180558cd4c7e69429210cc1750a4789
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/PlayerProfile/RenameWin.cs b/Main/System/PlayerProfile/RenameWin.cs
new file mode 100644
index 0000000..1cb91eb
--- /dev/null
+++ b/Main/System/PlayerProfile/RenameWin.cs
@@ -0,0 +1,93 @@
+using System;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class RenameWin : UIBase
+{
+    [SerializeField] InputField input;
+    [SerializeField] Button btnOk;
+    [SerializeField] Button btnRandom;
+    [SerializeField] TextEx txtFirst;
+    [SerializeField] TextEx txtMoney;
+    [SerializeField] ImageEx imgMoney;
+
+    RenameManager manager { get { return RenameManager.Instance; } }
+    protected override void InitComponent()
+    {
+        base.InitComponent();
+        btnRandom.SetListener(() =>
+        {
+            input.text = manager.GetSafeRandomName();
+        });
+        btnOk.SetListener(() =>
+        {
+            bool isFirstRename = manager.IsFirstRename();
+            if (!isFirstRename && !UIHelper.CheckMoneyCount(manager.moneyType, manager.moneyNeed))
+            {
+                string title = Language.Get("Mail101");
+                string info = Language.Get("PlayerProfile22");
+                ConfirmCancel.ShowPopConfirm(title, info, (bool isOk) =>
+                {
+                    if (isOk)
+                    {
+
+                    }
+                    else
+                    {
+                        CloseWindow();
+                    }
+                });
+                return;
+            }
+
+            if (!manager.CheckNameLimit(input.text, out var errorCode))
+            {
+                manager.ShowNameErrorTip(errorCode);
+                return;
+            }
+
+            manager.SendRenamePack(input.text);
+        });
+    }
+
+    protected override void OnPreOpen()
+    {
+        base.OnPreOpen();
+        manager.OnUpdatePlayerNameCountEvent += OnUpdatePlayerNameCount;
+        manager.OnUpdateRenameResultEvent += OnUpdateRenameResultEvent;
+        PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh;
+        Display();
+    }
+
+    protected override void OnPreClose()
+    {
+        base.OnPreClose();
+        manager.OnUpdatePlayerNameCountEvent -= OnUpdatePlayerNameCount;
+        manager.OnUpdateRenameResultEvent -= OnUpdateRenameResultEvent;
+        PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh;
+    }
+
+    private void PlayerDataRefresh(PlayerDataType type)
+    {
+        Display();
+    }
+
+    private void OnUpdateRenameResultEvent()
+    {
+        Display();
+    }
+
+    private void OnUpdatePlayerNameCount()
+    {
+        Display();
+    }
+
+    void Display()
+    {
+        bool isFirstRename = manager.IsFirstRename();
+        txtFirst.SetActive(isFirstRename);
+        txtMoney.SetActive(!isFirstRename);
+        imgMoney.SetIconWithMoneyType(manager.moneyType);
+        txtMoney.text = UIHelper.ShowUseMoney(manager.moneyType, manager.moneyNeed);
+    }
+}
diff --git a/Main/System/PlayerProfile/RenameWin.cs.meta b/Main/System/PlayerProfile/RenameWin.cs.meta
new file mode 100644
index 0000000..7763a5d
--- /dev/null
+++ b/Main/System/PlayerProfile/RenameWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 31a79aad128b21e449af2a82bd367cfe
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/PlayerProfile/SystemSetWin.cs b/Main/System/PlayerProfile/SystemSetWin.cs
new file mode 100644
index 0000000..6483c05
--- /dev/null
+++ b/Main/System/PlayerProfile/SystemSetWin.cs
@@ -0,0 +1,40 @@
+using UnityEngine;
+using UnityEngine.UI;
+
+public class SystemSetWin : UIBase
+{
+    [SerializeField] Slider musicSlider;
+    [SerializeField] Slider soundEffectSlider;
+
+    protected override void InitComponent()
+    {
+        base.InitComponent();
+    }
+
+    protected override void OnPreOpen()
+    {
+        base.OnPreOpen();
+        musicSlider.onValueChanged.RemoveListener(OnSliderBgMusic);
+        musicSlider.onValueChanged.AddListener(OnSliderBgMusic);
+        soundEffectSlider.onValueChanged.RemoveListener(OnSliderSoundEffect);
+        soundEffectSlider.onValueChanged.AddListener(OnSliderSoundEffect);
+
+        musicSlider.value = SystemSetting.Instance.GetSoundVolume();
+        soundEffectSlider.value = SystemSetting.Instance.GetSoundEffect();
+    }
+
+    protected override void OnPreClose()
+    {
+        base.OnPreClose();
+    }
+
+    private void OnSliderSoundEffect(float arg0)
+    {
+        SystemSetting.Instance.SetSoundEffect(arg0);
+    }
+
+    private void OnSliderBgMusic(float arg0)
+    {
+        SystemSetting.Instance.SetSoundVolume(arg0);
+    }
+}
diff --git a/Main/System/PlayerProfile/SystemSetWin.cs.meta b/Main/System/PlayerProfile/SystemSetWin.cs.meta
new file mode 100644
index 0000000..988929a
--- /dev/null
+++ b/Main/System/PlayerProfile/SystemSetWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 30dc70a9e7b94c34a8a1ea801f59837f
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/SystemSetting/SystemSetting.cs b/Main/System/SystemSetting/SystemSetting.cs
index aeed313..077b8d4 100644
--- a/Main/System/SystemSetting/SystemSetting.cs
+++ b/Main/System/SystemSetting/SystemSetting.cs
@@ -42,7 +42,7 @@
 
     public float GetSoundVolume()
     {
-        return LocalSave.GetFloat(SOUND_VOLUME_KEY, .55f);
+        return LocalSave.GetFloat(SOUND_VOLUME_KEY, 1.0f);
     }
 
     public void SetSoundEffect(float value)
@@ -52,7 +52,7 @@
 
     public float GetSoundEffect()
     {
-        return LocalSave.GetFloat(SOUND_EFFECT_KEY, .8f);
+        return LocalSave.GetFloat(SOUND_EFFECT_KEY, 1.0f);
     }
 
     public void SetGameFps(GameFps _frame)
diff --git a/Main/Utility/GlobalTimeEvent.cs b/Main/Utility/GlobalTimeEvent.cs
index 9da381a..f6605cf 100644
--- a/Main/Utility/GlobalTimeEvent.cs
+++ b/Main/Utility/GlobalTimeEvent.cs
@@ -6,7 +6,7 @@
 
 public class GlobalTimeEvent : SingletonMonobehaviour<GlobalTimeEvent>
 {
-    public event Action MS100Event;
+    public event Action MSEvent; // 姣�50ms
     public event Action secondEvent;
     public event Action fiveSecondEvent;
     public event Action minuteEvent;
@@ -34,11 +34,11 @@
     private void Update()
     {
         var ms = Time.time;
-        if (ms - msBuf >= 0.1f)
+        if (ms - msBuf >= 0.05f)
         {
-            if (MS100Event != null)
+            if (MSEvent != null)
             {
-                MS100Event();
+                MSEvent();
             }
             msBuf = ms;
         }
diff --git a/Main/Utility/JaceCalculator.cs b/Main/Utility/JaceCalculator.cs
index 941f833..f1ca3b2 100644
--- a/Main/Utility/JaceCalculator.cs
+++ b/Main/Utility/JaceCalculator.cs
@@ -5,9 +5,15 @@
 public static class JaceCalculator
 {
     private static readonly CalculationEngine Engine = new CalculationEngine();
+    private static readonly Dictionary<string, double> _reusableVariables = new Dictionary<string, double>();
+    private static readonly object _lockObject = new object();
+    
+    // 鍏紡缂撳瓨锛岄伩鍏嶉噸澶嶈В鏋�
+    private static readonly Dictionary<string, Func<Dictionary<string, double>, double>> _formulaCache = 
+        new Dictionary<string, Func<Dictionary<string, double>, double>>();
 
     /// <summary>
-    /// 瑙f瀽骞惰绠楁暟瀛﹁〃杈惧紡
+    /// 瑙f瀽骞惰绠楁暟瀛﹁〃杈惧紡锛堜紭鍖栫増鏈紝鍑忓皯GC锛�
     /// </summary>
     /// <param name="formula">鏁板琛ㄨ揪寮忓瓧绗︿覆</param>
     /// <param name="variables">鍙橀噺瀛楀吀</param>
@@ -26,7 +32,14 @@
 
         try
         {
-            return Engine.Calculate(formula, variables);
+            // 浣跨敤缂撳瓨浼樺寲
+            if (!_formulaCache.TryGetValue(formula, out var compiledFormula))
+            {
+                compiledFormula = Engine.Build(formula);
+                _formulaCache[formula] = compiledFormula;
+            }
+            
+            return compiledFormula(variables);
         }
         catch (Exception ex)
         {
@@ -34,9 +47,49 @@
         }
     }
 
+    /// <summary>
+    /// 棰勭紪璇戝父鐢ㄥ叕寮忥紝鍑忓皯杩愯鏃惰В鏋愬紑閿�
+    /// </summary>
+    /// <param name="formulas">闇�瑕侀缂栬瘧鐨勫叕寮忔暟缁�</param>
+    public static void PrecompileFormulas(params string[] formulas)
+    {
+        if (formulas == null || formulas.Length == 0) return;
+        
+        lock (_lockObject)
+        {
+            foreach (var formula in formulas)
+            {
+                if (!string.IsNullOrEmpty(formula) && !_formulaCache.ContainsKey(formula))
+                {
+                    try
+                    {
+                        var compiledFormula = Engine.Build(formula);
+                        _formulaCache[formula] = compiledFormula;
+                    }
+                    catch (Exception ex)
+                    {
+                        UnityEngine.Debug.LogWarning($"Failed to precompile formula '{formula}': {ex.Message}");
+                    }
+                }
+            }
+        }
+    }
+
+    /// <summary>
+    /// 娓呯┖鍏紡缂撳瓨锛堢敤浜庡唴瀛樼鐞嗭級
+    /// </summary>
+    public static void ClearCache()
+    {
+        lock (_lockObject)
+        {
+            _formulaCache.Clear();
+        }
+    }
+
     public static void Init()
     {
         Engine.AddFunction("int", (Func<double, double>)(x => (int)x));
         Engine.AddFunction("long", (Func<double, double>)(x => (long)x));
+        
     }
 }
\ No newline at end of file
diff --git a/Main/Utility/UIHelper.cs b/Main/Utility/UIHelper.cs
index bb0b2ad..2cd0ea7 100644
--- a/Main/Utility/UIHelper.cs
+++ b/Main/Utility/UIHelper.cs
@@ -66,6 +66,8 @@
 
 
     #region UI閫氱敤
+
+    //榛樿璐у竵鍥剧墖鐢ㄩ珮娓呯殑锛屽瘜鏂囨湰鐨勫彲浠ョ敤灏忓浘鏍囧埄浜庢帓鐗堟樉绀�
     public static void SetIconWithMoneyType(this Image _image, int moneyType)
     {
         if (_image == null) return;
@@ -1308,7 +1310,7 @@
         //bool pureChinese = Regex.IsMatch(name, "^[\u4e00-\u9fa5]+$");
         //var chsCount = GetChsCount(name);
         int length = Encoding.Default.GetBytes(name).Length;
-        var maxlength = 14;  //绾腑鏂囦笉寤鸿瓒呰繃7涓瓧
+        var maxlength = 21;  //绾腑鏂囦笉寤鸿瓒呰繃7涓瓧
         var minlength = 3;
         if (length > maxlength)
         {

--
Gitblit v1.8.0