|
@@ -129,33 +129,55 @@ 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);
|
|
|
+ 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();
|
|
|
+
|
|
|
UpdateUI();
|
|
|
UpdateGiveGiftRoot();
|
|
|
});
|
|
@@ -315,6 +337,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);
|
|
|
}
|
|
@@ -375,6 +405,7 @@ namespace Fort23.Mono
|
|
|
}
|
|
|
|
|
|
widgetItem1.InitWidget(widgetItem.itemInfo);
|
|
|
+ daoyouGiftConfig = default;
|
|
|
|
|
|
foreach (var giftConfig in daoyouGiftConfigs)
|
|
|
{
|
|
@@ -422,7 +453,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()
|