Sfoglia il codice sorgente

Merge branch 'master' of http://192.168.123.2:3000/ck/XiuXianGame

# Conflicts:
#	Excel2Json/Excel/DaoyouConfig.xlsx   resolved by master version
zg 5 giorni fa
parent
commit
305a6dcb91

+ 180 - 0
Assets/Res/UI/MainPanel/MainPanel.prefab

@@ -164,6 +164,86 @@ MonoBehaviour:
   topOrLeftColor: {r: 0, g: 0, b: 0, a: 1}
   bottomOrRightColor: {r: 0.509434, g: 0.33882165, b: 0.33882165, a: 1}
   direction: 1
+--- !u!1 &1603581646805343573
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 7
+  m_Component:
+  - component: {fileID: 1103492875219824872}
+  - component: {fileID: 8750832862381625297}
+  - component: {fileID: 6334637622796270846}
+  m_Layer: 5
+  m_HasEditorInfo: 1
+  m_Name: Text_DaoyouCount
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &1103492875219824872
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1603581646805343573}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 6224376037976265680}
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0.5, y: 0.5}
+  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchoredPosition: {x: 21.4, y: -20.1}
+  m_SizeDelta: {x: 52.143, y: 35.6069}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!222 &8750832862381625297
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1603581646805343573}
+  m_CullTransparentMesh: 1
+--- !u!114 &6334637622796270846
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1603581646805343573}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_RaycastTarget: 1
+  m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
+  m_Maskable: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+  m_FontData:
+    m_Font: {fileID: 12800000, guid: e588d93665211944387ec8c03c8726ae, type: 3}
+    m_FontSize: 30
+    m_FontStyle: 1
+    m_BestFit: 0
+    m_MinSize: 10
+    m_MaxSize: 40
+    m_Alignment: 4
+    m_AlignByGeometry: 0
+    m_RichText: 1
+    m_HorizontalOverflow: 0
+    m_VerticalOverflow: 0
+    m_LineSpacing: 1
+  m_Text: 5
 --- !u!1 &1760937640502948944
 GameObject:
   m_ObjectHideFlags: 0
@@ -197,6 +277,7 @@ RectTransform:
   - {fileID: 6120901728442020656}
   - {fileID: 8620268506487690809}
   - {fileID: 3932465254798203391}
+  - {fileID: 6224376037976265680}
   - {fileID: 1509586097304940563}
   m_Father: {fileID: 9037135992368401232}
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -2176,6 +2257,95 @@ MonoBehaviour:
   m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5}
   m_EffectDistance: {x: 1, y: -1}
   m_UseGraphicAlpha: 1
+--- !u!1 &8816327462997807595
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 7
+  m_Component:
+  - component: {fileID: 6224376037976265680}
+  - component: {fileID: 8210925538578532506}
+  - component: {fileID: 8753960067471709537}
+  m_Layer: 5
+  m_HasEditorInfo: 1
+  m_Name: Icon_Daoyou
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &6224376037976265680
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 8816327462997807595}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children:
+  - {fileID: 1103492875219824872}
+  m_Father: {fileID: 1798015912972164048}
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0, y: 1}
+  m_AnchorMax: {x: 0, y: 1}
+  m_AnchoredPosition: {x: 623.8, y: -300.7}
+  m_SizeDelta: {x: 56.4862, y: 56.4862}
+  m_Pivot: {x: 0, y: 1}
+--- !u!222 &8210925538578532506
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 8816327462997807595}
+  m_CullTransparentMesh: 1
+--- !u!114 &8753960067471709537
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 8816327462997807595}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 3c247620ca3a1fd4ab2a2f3a5b287e07, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_RaycastTarget: 1
+  m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
+  m_Maskable: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+  m_Sprite: {fileID: 0}
+  m_Type: 0
+  m_PreserveAspect: 0
+  m_FillCenter: 1
+  m_FillMethod: 4
+  m_FillAmount: 1
+  m_FillClockwise: 1
+  m_FillOrigin: 0
+  m_UseSpriteMesh: 0
+  m_PixelsPerUnitMultiplier: 1
+  _icon_name: dec_touxiang
+  isNotLoadDeftIcon: 0
+  CurrSpriteAtlas: {fileID: 100100200, guid: bec1e4479c1593746876da07861f4d67, type: 3}
+  packInfo:
+    packName: mainUI
+    packgJsonPath: /Art/UIAssets/TextrueJson\mainUI.txt
+    packgSpritePath: Assets/Res/UIAtlas/mainUI.spriteatlasv2
+    lasetJsonGUID: e1c5b270b3ca9ddf87be5864ad756cc0
+  useGradient: 0
+  topOrLeftColor: {r: 1, g: 1, b: 1, a: 1}
+  bottomOrRightColor: {r: 0, g: 0, b: 0, a: 1}
+  direction: 0
 --- !u!1 &8986363544919513421
 GameObject:
   m_ObjectHideFlags: 0
@@ -2374,6 +2544,16 @@ MonoBehaviour:
     isAssetBundle: 0
     isList: 0
     ListCollectorDatas: []
+  - key: Icon_Daoyou
+    gameObject: {fileID: 8753960067471709537}
+    isAssetBundle: 0
+    isList: 0
+    ListCollectorDatas: []
+  - key: Text_DaoyouCount
+    gameObject: {fileID: 6334637622796270846}
+    isAssetBundle: 0
+    isList: 0
+    ListCollectorDatas: []
   isAssetBundle: 0
 --- !u!1 &9153091249090986804
 GameObject:

+ 2 - 1
Assets/Scripts/Core/Event/Event/CustomEventType.cs

@@ -114,7 +114,8 @@ namespace Fort23.Core
       /// <summary>
       /// 获得道具
       /// </summary>
-      AddItem
+      AddItem,
+      DaoYouCounUpdate
       
     }
 }

+ 16 - 0
Assets/Scripts/GameLogic/Hero/HeroInfo.cs

@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using System.Linq;
 using Common.Utility.CombatEvent;
 using Excel2Json;
 using Fort23.Core;
@@ -26,6 +27,21 @@ namespace GameLogic.Hero
         }
 
 
+        public HeroInfo CopyHero()
+        {
+            AccountFileInfo.HeroData heroDataCopy = new AccountFileInfo.HeroData();
+            heroDataCopy.heroModelId = heroData.heroModelId;
+            heroDataCopy.heroPowerId = heroData.heroPowerId ;
+            heroDataCopy.exp = heroData.exp;
+            heroDataCopy.upTime = heroData.upTime;
+            heroDataCopy.isCombat = heroData.isCombat;
+            heroDataCopy.TaoismSkillId = heroData.TaoismSkillId;
+            heroDataCopy.ImmortalBond = heroData.ImmortalBond.ToList();
+            HeroInfo heroInfo = new HeroInfo();
+            heroInfo.InitHero(heroData);
+            return heroInfo;
+        }
+
         public void InitHero(AccountFileInfo.HeroData heroData)
         {
             this.heroData = heroData;

+ 13 - 7
Assets/Scripts/GameLogic/Player/AccountFileInfo.cs

@@ -59,7 +59,7 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
         /// 英雄信息
         /// </summary>
         public HeroData heroData;
-        
+
         public List<DaoYouData> daoYouDatas = new List<DaoYouData>();
 
 
@@ -104,8 +104,8 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
         /// </summary>
         public List<EventList> eventList = new List<EventList>();
     }
-    
-    
+
+
     /// <summary>
     ///  道友数据
     /// </summary>
@@ -113,6 +113,7 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
     public class DaoYouData
     {
         public int id;
+
         /// <summary>
         /// 喜爱礼物
         /// </summary>
@@ -122,11 +123,12 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
         /// 好感等级
         /// </summary>
         public int favorabilityLv;
+
         /// <summary>
         /// 经验
         /// </summary>
         public int exp;
-        
+
         /// <summary>
         /// 已经领取奖励的好感等级
         /// </summary>
@@ -141,6 +143,9 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
         /// 心情刷新时间
         /// </summary>
         public long emotionTime;
+
+        //心情值
+        public int emotionValue;
     }
 
     //地图区域数据
@@ -438,7 +443,7 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
         playerData.ItemListData.Add(coin);
         playerData.ItemListData.Add(diamond);
         playerData.ItemListData.Add(heroExp);
-        
+
         // DaoYouData daoYouData = new DaoYouData();
         // daoYouData.id = 1;
         // daoYouData.favorabilityLv = 1;
@@ -448,7 +453,7 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
         //测试道具
         playerData.ItemListData.Add(new ItemData(1201, 10));
         playerData.ItemListData.Add(new ItemData(1202, 10));
-        
+
         playerData.ItemListData.Add(new ItemData(1301, 10));
         playerData.ItemListData.Add(new ItemData(1302, 10));
         playerData.ItemListData.Add(new ItemData(1303, 10));
@@ -458,6 +463,7 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
         playerData.ItemListData.Add(new ItemData(1402, 10));
         playerData.ItemListData.Add(new ItemData(1403, 10));
         playerData.ItemListData.Add(new ItemData(1404, 10));
+        playerData.ItemListData.Add(new ItemData(1601, 10));
 
         // var allSkill = new[] { 1101};
         // foreach (var i in allSkill)
@@ -533,7 +539,7 @@ public class AccountFileInfo : Singleton<AccountFileInfo>
         public bool isCombat;
 
         public int TaoismSkillId;
-        
+
         public List<int> ImmortalBond = new List<int>();
     }
 

+ 142 - 5
Assets/Scripts/GameLogic/Player/PlayerManager.cs

@@ -22,7 +22,7 @@ public class PlayerManager : Singleton<PlayerManager>
     public FaBaoControl FaBaoControl;
     public BagController BagController;
 
-    public List<AccountFileInfo.DaoYouData> GuaijiDaoYou = new List<AccountFileInfo.DaoYouData>();
+    public Map<long, List<AccountFileInfo.DaoYouData>> GuaijiDaoYou = new Map<long, List<AccountFileInfo.DaoYouData>>();
 
     public bool isTest;
 
@@ -51,8 +51,8 @@ public class PlayerManager : Singleton<PlayerManager>
 
         InitGameData();
 
-        int m = Random.Range(0, 4 * 60 * 1000);
-        RandownDaoYou(m);
+        // int m = Random.Range(0, 4 * 60 * 1000);
+        RandownDaoYou(gameConstantConfig.Daoyoushowuptime + 1000);
     }
 
     public void RandownDaoYou(int m)
@@ -61,19 +61,91 @@ public class PlayerManager : Singleton<PlayerManager>
         _timerEntity = null;
         _timerEntity = TimerComponent.Instance.AddTimer(m, () =>
         {
-            int count = Random.Range(0, AccountFileInfo.Instance.playerData.daoYouDatas.Count);
             List<AccountFileInfo.DaoYouData> daoYouDatas = AccountFileInfo.Instance.playerData.daoYouDatas.ToList();
+            foreach (var keyValuePair in GuaijiDaoYou)
+            {
+                foreach (var daoYouData in keyValuePair.Value)
+                {
+                    if (daoYouDatas.Contains(daoYouData))
+                    {
+                        daoYouDatas.Remove(daoYouData);
+                    }
+                }
+            }
+
+            int count = Random.Range(0, daoYouDatas.Count + 1);
+            List<AccountFileInfo.DaoYouData> daoyou = new List<AccountFileInfo.DaoYouData>();
             for (int i = 0; i < count; i++)
             {
                 int index = Random.Range(0, daoYouDatas.Count);
-                GuaijiDaoYou.Add(daoYouDatas[index]);
+
+                daoyou.Add(daoYouDatas[index]);
+
                 daoYouDatas.RemoveAt(index);
                 _timerEntity?.Dispose();
                 _timerEntity = null;
             }
+
+            if (daoyou.Count > 0)
+            {
+                GuaijiDaoYou.Add(TimeHelper.ClientNow() + Random.Range(gameConstantConfig.DaoyouguajiDuration[0], gameConstantConfig.DaoyouguajiDuration[1]) * 1000, daoyou);
+                EventManager.Instance.Dispatch(CustomEventType.DaoYouCounUpdate, null);
+            }
+
+            RandownDaoYou(gameConstantConfig.Daoyoushowuptime * 1000);
         });
     }
 
+    public int GetDaoYouLevel(AccountFileInfo.DaoYouData daoYouData)
+    {
+        DaoyouModelConfig daoyouModelConfig = ConfigComponent.Instance.Get<DaoyouModelConfig>(daoYouData.id);
+        int level = (int)(myHero.level.Value * daoyouModelConfig.growupRate * 0.01f);
+        if (level < 1) level = 1;
+        return level;
+    }
+
+    public int GetBl(AccountFileInfo.DaoYouData daoYouData, int guajibuffId)
+    {
+        DaoyouLevelupConfig daoyouLevelupConfig = ConfigComponent.Instance.Get<DaoyouLevelupConfig>(daoYouData.favorabilityLv);
+        int level = GetDaoYouLevel(daoYouData);
+        DaoyouguajiResourcLevel daoyouguajiResourcLevel = ConfigComponent.Instance.Get<DaoyouguajiResourcLevel>(level);
+        guajibuff guajibuff = ConfigComponent.Instance.Get<guajibuff>(guajibuffId);
+
+        int levelBl = 0;
+        int bl = 0;
+        switch (guajibuff.paraValue)
+        {
+            case 1:
+                levelBl = daoyouguajiResourcLevel.para2;
+                bl = (int)(guajibuff.GivingRate * levelBl * daoyouLevelupConfig.guajiGrowup * 0.01f * 0.01f);
+                return bl;
+    
+                break;
+            case 2:
+                levelBl = daoyouguajiResourcLevel.para2;
+                bl = (int)(guajibuff.GivingRate * levelBl * daoyouLevelupConfig.guajiGrowup * 0.01f * 0.01f);
+                return bl;
+                break;
+            case 3:
+                levelBl = daoyouguajiResourcLevel.para3;
+                bl = (int)(guajibuff.GivingRate * levelBl * daoyouLevelupConfig.guajiGrowup * 0.01f * 0.01f);
+                return bl;
+                break;
+            case 4:
+                levelBl = daoyouguajiResourcLevel.para4;
+                bl = (int)(guajibuff.GivingRate * levelBl * daoyouLevelupConfig.guajiGrowup * 0.01f * 0.01f);
+                return bl;
+                break;
+            case 5:
+                levelBl = daoyouguajiResourcLevel.para1;
+                bl = (int)(guajibuff.GivingRate * levelBl * daoyouLevelupConfig.guajiGrowup * 0.01f * 0.001f);
+                return bl;
+                break;
+            default:
+                return 0;
+        }
+    }
+
     private void SetConfigs()
     {
         gameConstantConfig = ConfigComponent.Instance.Get<GameConstantConfig>(1);
@@ -130,6 +202,10 @@ public class PlayerManager : Singleton<PlayerManager>
         // ))
     }
 
+    List<long> removeKey = new List<long>();
+
+    private bool isUpdate = false;
+
     private void Update()
     {
         timer += Time.deltaTime;
@@ -148,6 +224,67 @@ public class PlayerManager : Singleton<PlayerManager>
             AccountFileInfo.Instance.playerData.todayUseExpElixrPanelCount = 0;
             AccountFileInfo.Instance.SavePlayerData();
         }
+
+
+        foreach (var keyValuePair in GuaijiDaoYou)
+        {
+            if (TimeHelper.ClientNow() > keyValuePair.Key)
+            {
+                //判断概率给奖励
+                isUpdate = true;
+
+                foreach (var daoYouData in keyValuePair.Value)
+                {
+                    DaoyouModelConfig daoyouModelConfig = ConfigComponent.Instance.Get<DaoyouModelConfig>(daoYouData.id);
+                    int bl = GetBl(daoYouData, daoyouModelConfig.guajiBuffID[0]);
+
+                    int randomValue1 = Random.Range(0, 101);
+                    LogTool.Log("道友随机怪率:" + randomValue1 + " 比例:" + bl);
+                    if (randomValue1 >= bl)
+                    {
+                        for (var i = 1; i < daoyouModelConfig.guajiBuffID.Length; i++)
+                        {
+                            int count = GetBl(daoYouData, daoyouModelConfig.guajiBuffID[i]);
+                            guajibuff guajibuff = ConfigComponent.Instance.Get<guajibuff>(daoyouModelConfig.guajiBuffID[i]);
+                            switch (guajibuff.paraValue)
+                            {
+                                case 1:
+                                    BagController.AddItem(1003, count);
+                                    LogTool.Log("道友获得道具id:" + 1003 + " 数量:" + count);
+                                    break;
+                                case 2:
+                                    BagController.AddItem(1001, count);
+                                    LogTool.Log("道友获得道具id:" + 1001 + " 数量:" + count);
+                                    break;
+                                case 3:
+                                    BagController.AddItem(1005, count);
+                                    LogTool.Log("道友获得道具id:" + 1005 + " 数量:" + count);
+                                    break;
+                                case 4:
+                                    BagController.AddItem(1006, count);
+                                    LogTool.Log("道友获得道具id:" + 1006 + " 数量:" + count);
+                                    break;
+                            }
+                        }
+                    }
+                }
+
+
+                //移除
+                removeKey.Add(keyValuePair.Key);
+            }
+        }
+
+        foreach (var l in removeKey)
+        {
+            GuaijiDaoYou.Remove(l);
+        }
+
+        if (isUpdate)
+        {
+            EventManager.Instance.Dispatch(CustomEventType.DaoYouCounUpdate, null);
+            isUpdate = false;
+        }
     }
 
 

+ 1 - 0
Assets/Scripts/GameUI/EventManager/DialogueManager.cs

@@ -87,6 +87,7 @@ public class DialogueManager : Singleton<DialogueManager>
                     daoYouData.favorabilityLv = 1;
                     daoYouData.emotion = Random.Range(1, 4);
                     daoYouData.emotionTime = TimeHelper.ClientNow();
+                    daoYouData.emotionValue = (int)(100 / (float)daoYouData.emotion);
                     AccountFileInfo.Instance.playerData.daoYouDatas.Add(daoYouData);
                     AccountFileInfo.Instance.SavePlayerData();
                 }

+ 67 - 16
Assets/Scripts/GameUI/UI/DaoYouPanel/DaoYouInfoPanel.cs

@@ -129,33 +129,64 @@ namespace Fort23.Mono
                     return;
                 }
 
-                if (daoyouGiftConfig.ID == 0)
-                    return;
+                //加好感
+                if (widgetItem1 != null && daoyouGiftConfig.ID != 0)
+                {
+                    PlayerManager.Instance.BagController.DeductItem(daoyouGiftConfig.ItemID, count);
 
 
-                PlayerManager.Instance.BagController.DeductItem(daoyouGiftConfig.ItemID, count);
+                    emotionConfig emotionConfig = ConfigComponent.Instance.Get<emotionConfig>(daoYouData.emotion);
 
-                emotionConfig emotionConfig = ConfigComponent.Instance.Get<emotionConfig>(daoYouData.emotion);
+                    if (_daoyouModelConfig.PreferGiftID.Contains(daoyouGiftConfig.ItemID) && !daoYouData.loveIds.Contains(daoyouGiftConfig.ItemID))
+                    {
+                        daoYouData.loveIds.Add(daoyouGiftConfig.ItemID);
+                    }
+                    //加经验
+                    for (int i = 0; i < count; i++)
+                    {
+                        int bl = Random.Range(emotionConfig.hanganUpRate[0], emotionConfig.hanganUpRate[1] + 1);
+                        daoYouData.exp += (int)(daoyouGiftConfig.emotionValue * bl * 0.001f);
+                    }
+
+           
 
-                for (int i = 0; i < count; i++)
-                {
-                    int bl = Random.Range(emotionConfig.hanganUpRate[0], emotionConfig.hanganUpRate[1] + 1);
-                    daoYouData.exp += (int)(daoyouGiftConfig.emotionValue * bl * 0.001f);
-                }
 
+                    DaoyouLevelupConfig[] configs = ConfigComponent.Instance.GetAll<DaoyouLevelupConfig>();
 
-                DaoyouLevelupConfig[] configs = ConfigComponent.Instance.GetAll<DaoyouLevelupConfig>();
+                    for (var i = daoYouData.favorabilityLv; i < configs.Length; i++)
+                    {
+                        if (daoYouData.exp >= configs[i].exp)
+                        {
+                            daoYouData.exp -= configs[i].exp;
+                            daoYouData.favorabilityLv++;
+                        }
+                    }
 
-                for (var i = daoYouData.favorabilityLv; i < configs.Length; i++)
+                    AccountFileInfo.Instance.SavePlayerData();
+                }
+                //加心情
+                else
                 {
-                    if (daoYouData.exp >= configs[i].exp)
+                    if (daoYouData.emotionValue >= 100)
                     {
-                        daoYouData.exp -= configs[i].exp;
-                        daoYouData.favorabilityLv++;
+                        TipMessagePanel.OpenTipMessagePanel("心情已经到最高");
+                        return;
                     }
+
+                    PlayerManager.Instance.BagController.DeductItem(widgetItem1.itemInfo.itemID, count);
+                    daoYouData.emotionValue += widgetItem1.itemInfo.config.associateVlaue[0];
+
+                    int emotionId = 4 - (int)(daoYouData.emotionValue / (100 / (float)3));
+                    if (emotionId > 3)
+                        emotionId = 3;
+
+                    daoYouData.emotion = emotionId;
+                    emotionConfig emotionConfig = ConfigComponent.Instance.Get<emotionConfig>(daoYouData.emotion);
+                    Text_message.text = LanguageManager.Instance.Text(emotionConfig.des);
+                    AccountFileInfo.Instance.SavePlayerData();
                 }
 
-                AccountFileInfo.Instance.SavePlayerData();
+
                 UpdateUI();
                 UpdateGiveGiftRoot();
             });
@@ -227,6 +258,10 @@ namespace Fort23.Mono
                 Btn_Eveent.gameObject.SetActive(false);
             }
 
+            HeroPowerUpConfig heroPowerUpConfig = ConfigComponent.Instance.Get<HeroPowerUpConfig>(PlayerManager.Instance.GetDaoYouLevel(daoYouData));
+            Text_JingJie.text = LanguageManager.Instance.Text(heroPowerUpConfig.jingjieLanIDs[0]) +
+                                LanguageManager.Instance.Text(heroPowerUpConfig.jingjieLanIDs[1]) +
+                                LanguageManager.Instance.Text(heroPowerUpConfig.jingjieLanIDs[2]);
 
             Text_Name.text = LanguageManager.Instance.Text(_daoyouModelConfig.name);
 
@@ -311,6 +346,14 @@ namespace Fort23.Mono
                 }
             }
 
+            foreach (var keyValuePair in PlayerManager.Instance.BagController.allBagDic)
+            {
+                if (keyValuePair.Value.config.itemTag == 7 && !allItems.Contains(keyValuePair.Value))
+                {
+                    allItems.Add(keyValuePair.Value);
+                }
+            }
+
             List<ItemInfo> showItems = SaiXuan(saiXuanType);
             CreatItem(showItems);
         }
@@ -371,6 +414,7 @@ namespace Fort23.Mono
             }
 
             widgetItem1.InitWidget(widgetItem.itemInfo);
+            daoyouGiftConfig = default;
 
             foreach (var giftConfig in daoyouGiftConfigs)
             {
@@ -418,7 +462,14 @@ namespace Fort23.Mono
         {
             emotionConfig emotionConfig = ConfigComponent.Instance.Get<emotionConfig>(daoYouData.emotion);
             Text_Count.text = $"当前选择数量{count}";
-            Text_GiveGiftDesc.text = $"好感度+{daoyouGiftConfig.emotionValue} ({daoyouGiftConfig.emotionValue * emotionConfig.hanganUpRate[0] * 0.001} - {daoyouGiftConfig.emotionValue * emotionConfig.hanganUpRate[1] * 0.001})";
+            if (widgetItem1 != null && daoyouGiftConfig.ID != 0)
+            {
+                Text_GiveGiftDesc.text = $"好感度+{daoyouGiftConfig.emotionValue} ({daoyouGiftConfig.emotionValue * emotionConfig.hanganUpRate[0] * 0.001} - {daoyouGiftConfig.emotionValue * emotionConfig.hanganUpRate[1] * 0.001})";
+            }
+            else if (widgetItem1 != null && daoyouGiftConfig.ID == 0)
+            {
+                Text_GiveGiftDesc.text = $"心情+{widgetItem1.itemInfo.config.associateVlaue[0]} )";
+            }
         }
 
         public override CTask GetFocus()

+ 1 - 0
Assets/Scripts/GameUI/UI/DaoYouPanel/DaoYouWidget.cs

@@ -49,6 +49,7 @@ namespace Fort23.Mono
                 if (TimeHelper.ClientNow() - _daoYouData.emotionTime >= 60 * 60 * 1000)
                 {
                     _daoYouData.emotion = Random.Range(1, 4);
+                    _daoYouData.emotionValue = (int)(100 / (float)_daoYouData.emotion);
                     _daoYouData.emotionTime = TimeHelper.ClientNow();
                 }
 

+ 2 - 1
Assets/Scripts/GameUI/UI/HeroInformationPanel/HeroBreakthroughSuccessPanel.cs

@@ -40,7 +40,8 @@ namespace Fort23.Mono
 
         public async void CustomInit(int type, List<HeroAttributeData> heroAttributes)
         {
-            HeroInfo heroInfo = new HeroInfo();
+            // HeroInfo heroInfo = new HeroInfo();
+            HeroInfo heroInfo = PlayerManager.Instance.myHero.CopyHero();
             heroInfo.InitHero(PlayerManager.Instance.myHero.heroData.heroModelId, PlayerManager.Instance.myHero.heroData.heroPowerId + 1);
             Text_CurretnJIngjie.text = LanguageManager.Instance.Text(PlayerManager.Instance.myHero.powerUpConfig.jingjieLanIDs[0]) +
                                        LanguageManager.Instance.Text(PlayerManager.Instance.myHero.powerUpConfig.jingjieLanIDs[1]) +

+ 28 - 4
Assets/Scripts/GameUI/UI/MainPanel/MainPanel.cs

@@ -30,6 +30,12 @@ namespace Fort23.Mono
             EventManager.Instance.AddEventListener(CustomEventType.CompleteEvent, CompleteEvent);
             EventManager.Instance.AddEventListener(CustomEventType.RemoveEvent, RemoveEvent);
             EventManager.Instance.AddEventListener(CustomEventType.ChangeMap, ChangeMap);
+            EventManager.Instance.AddEventListener(CustomEventType.DaoYouCounUpdate, DaoYouCounUpdate);
+        }
+
+        private void DaoYouCounUpdate(IEventData e)
+        {
+            UpdateDaoYouCoun();
         }
 
 
@@ -54,6 +60,25 @@ namespace Fort23.Mono
             ChagneShenshiBtnActive();
         }
 
+        public void UpdateDaoYouCoun()
+        {
+            int count = 0;
+            foreach (var keyValuePair in PlayerManager.Instance.GuaijiDaoYou)
+            {
+                count += keyValuePair.Value.Count;
+            }
+
+            if (count > 0)
+            {
+                Icon_Daoyou.gameObject.SetActive(true);
+                Text_DaoyouCount.text = count.ToString();
+            }
+            else
+            {
+                Icon_Daoyou.gameObject.SetActive(false);
+            }
+        }
+
 
         private void ChagneShenshiBtnActive()
         {
@@ -66,6 +91,7 @@ namespace Fort23.Mono
             EventManager.Instance.RemoveEventListener(CustomEventType.RemoveEvent, RemoveEvent);
             EventManager.Instance.RemoveEventListener(CustomEventType.ShengShiOnClick, ShengShiOnClick);
             EventManager.Instance.RemoveEventListener(CustomEventType.ChangeMap, ChangeMap);
+            EventManager.Instance.RemoveEventListener(CustomEventType.DaoYouCounUpdate, DaoYouCounUpdate);
         }
 
         public override void AddButtonEvent()
@@ -81,10 +107,7 @@ namespace Fort23.Mono
                 DivineSenceEventPreviewPanel.OpenPanel();
             });
             Btn_Map.onClick.AddListener(() => { LevelChoosePanel.OpenPanel(); });
-            Btn_DaoYou.onClick.AddListener(() =>
-            {
-                DaoYouPanel.OpenPanel();
-            });
+            Btn_DaoYou.onClick.AddListener(() => { DaoYouPanel.OpenPanel(); });
         }
 
         public override CTask<bool> AsyncInit(object[] uiData)
@@ -102,6 +125,7 @@ namespace Fort23.Mono
             ChagneShenshiBtnActive();
             CreatShengShiEvent();
             ChangeMap(null);
+            UpdateDaoYouCoun();
 
             bool isHIde = false;
             foreach (var skillInfo in PlayerManager.Instance.GongFaControl.allUseSkill)

+ 22 - 0
Assets/Scripts/GameUI/UI/MainPanel/MainPanelData.cs

@@ -151,6 +151,28 @@ namespace Fort23.Mono
 	      return _Btn_DaoYou;
 	     }
 	   }
+	  private MyImage _Icon_Daoyou;
+	  public MyImage Icon_Daoyou
+	   {
+	   get{
+	      if (_Icon_Daoyou == null)
+	       {
+	         _Icon_Daoyou  = GetUIUnit<MyImage>("Icon_Daoyou"); 
+	       }
+	      return _Icon_Daoyou;
+	     }
+	   }
+	  private Text _Text_DaoyouCount;
+	  public Text Text_DaoyouCount
+	   {
+	   get{
+	      if (_Text_DaoyouCount == null)
+	       {
+	         _Text_DaoyouCount  = GetUIUnit<Text>("Text_DaoyouCount"); 
+	       }
+	      return _Text_DaoyouCount;
+	     }
+	   }
 	  #endregion 自定义数据结束 
 	 public override async CTask SetUIGameObject(GameObject gObjectPoolInterface)
 	{