From c310e51244b8ea3dbc56dfecf91e9577eb1513e2 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期三, 03 九月 2025 14:38:36 +0800
Subject: [PATCH] 117 【武将】武将系统 - 吞噬,升级飘字显示
---
Main/System/Hero/HeroInfo.Talent.cs | 53 +++++++++----
Main/Utility/UIHelper.cs | 2
Main/System/HeroUI/HeroGiftLineCell.cs.meta | 11 ++
Main/System/HeroUI/HeroGiftWin.cs.meta | 11 ++
Main/System/HeroUI/HeroUIManager.Gift.cs | 2
Main/System/HeroUI/GiftBaseCell.cs | 16 ++--
Main/System/HeroUI/HeroGiftLineCell.cs | 33 ++++++++
Main/System/HeroUI/HeroGiftWin.cs | 54 +++++++++++++
Main/System/HeroUI/HeroTrainWin.cs | 54 +++++++++++++
9 files changed, 208 insertions(+), 28 deletions(-)
diff --git a/Main/System/Hero/HeroInfo.Talent.cs b/Main/System/Hero/HeroInfo.Talent.cs
index b692c86..d493875 100644
--- a/Main/System/Hero/HeroInfo.Talent.cs
+++ b/Main/System/Hero/HeroInfo.Talent.cs
@@ -7,15 +7,15 @@
{
public int heroStar
- {
- get
- {
- if (itemHero == null)
- return 0;
- return itemHero.GetUseDataFirstValue(72);
- }
- }
-
+ {
+ get
+ {
+ if (itemHero == null)
+ return 0;
+ return itemHero.GetUseDataFirstValue(72);
+ }
+ }
+
// 75 # 鑻遍泟澶╄祴娲楃偧閿佸畾绱㈠紩鍒楄〃锛屽搴�71澶╄祴ID绱㈠紩
// 77 # 鑻遍泟澶╄祴娲楃偧闅忔満ID鍒楄〃
// 79 # 鑻遍泟瑙夐啋鏃堕殢鏈哄ぉ璧嬮�夐」ID鍒楄〃
@@ -61,7 +61,7 @@
talentAttrDic[config.AttrID] = config.AttrValue * talentLvList[i];
}
else
- {
+ {
talentAttrDic[config.AttrID] += config.AttrValue * talentLvList[i];
}
}
@@ -76,13 +76,32 @@
}
public int GetTalentAttrPer(int attrType)
- {
- if (PlayerPropertyConfig.baseAttr2perDict.ContainsKey(attrType))
- {
- var pertype = PlayerPropertyConfig.baseAttr2perDict[attrType];
- return talentAttrDic.ContainsKey(pertype) ? talentAttrDic[pertype] : 0;
- }
- return 0;
+ {
+ if (PlayerPropertyConfig.baseAttr2perDict.ContainsKey(attrType))
+ {
+ var pertype = PlayerPropertyConfig.baseAttr2perDict[attrType];
+ return talentAttrDic.ContainsKey(pertype) ? talentAttrDic[pertype] : 0;
+ }
+ return 0;
+ }
+
+ public int GetMaxStarCount()
+ {
+ if (Quality < 4)
+ return HeroUIManager.normalGiftMaxCnt * HeroUIManager.Instance.maxGiftLevel;
+ return HeroUIManager.giftMaxCnt * HeroUIManager.Instance.maxGiftLevel;
+ }
+
+ public int GetTotalStarCount()
+ {
+ //talentLvList閲岀殑鍏冪礌鍏ㄩ儴鐩稿姞
+ return talentLvList.Sum();
+ }
+
+ public bool IsFullStar()
+ {
+ //妫�鏌alentLvList 鎵�鏈夊厓绱犻兘澶т簬绛変簬10
+ return talentLvList.All(x => x >= HeroUIManager.Instance.maxGiftLevel);
}
}
diff --git a/Main/System/HeroUI/GiftBaseCell.cs b/Main/System/HeroUI/GiftBaseCell.cs
index 56b9f68..efa2179 100644
--- a/Main/System/HeroUI/GiftBaseCell.cs
+++ b/Main/System/HeroUI/GiftBaseCell.cs
@@ -160,23 +160,23 @@
{
if (quality == 1)
{
- //692088
- return new Color32(105, 32, 136, 128);
+ //1D0029
+ return new Color32(29, 0, 41, 128);
}
else if (quality == 2)
{
- //886220
- return new Color32(136, 98, 32, 128);
+ //372300
+ return new Color32(55, 35, 0, 128);
}
else if (quality == 3)
{
- //884a20
- return new Color32(136, 74, 32, 128);
+ //3A1800
+ return new Color32(58, 24, 0, 128);
}
else if (quality == 4)
{
- //882020
- return new Color32(136, 32, 32, 128);
+ //3A0000
+ return new Color32(58, 0, 0, 128);
}
return new Color32(0, 0, 0, 128);
}
diff --git a/Main/System/HeroUI/HeroGiftLineCell.cs b/Main/System/HeroUI/HeroGiftLineCell.cs
new file mode 100644
index 0000000..b4702fa
--- /dev/null
+++ b/Main/System/HeroUI/HeroGiftLineCell.cs
@@ -0,0 +1,33 @@
+锘縰sing System.Collections.Generic;
+using UnityEngine;
+
+public class HeroGiftLineCell : CellView
+{
+ [SerializeField] GiftBaseCell[] cardList;
+
+ public void Display(int index, List<int> configList)
+ {
+ for (int i = 0; i < cardList.Length; i++)
+ {
+ if (index < configList.Count)
+ {
+ var giftID = configList[index];
+ var giftLV = HeroUIManager.Instance.maxGiftLevel;
+ cardList[i].SetActive(true);
+ cardList[i].Init(giftID, giftLV, () =>
+ {
+ var giftConfig = HeroTalentConfig.Get(giftID);
+ SmallTipWin.showText = Language.Get("SmallTipFomat", giftConfig.Name + " " + Language.Get("L1113", giftLV),
+ Language.Get("HeroGift5", PlayerPropertyConfig.Get(giftConfig.AttrID).Name, PlayerPropertyConfig.GetValueDescription(giftConfig.AttrID, giftConfig.AttrValue)));
+ SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition);
+ UIManager.Instance.OpenWindow<SmallTipWin>();
+ });
+ }
+ else
+ {
+ cardList[i].SetActive(false);
+ }
+ }
+ }
+}
+
diff --git a/Main/System/HeroUI/HeroGiftLineCell.cs.meta b/Main/System/HeroUI/HeroGiftLineCell.cs.meta
new file mode 100644
index 0000000..69e4303
--- /dev/null
+++ b/Main/System/HeroUI/HeroGiftLineCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: fe49c2bc0fa1bbf4eb5389f355876ebb
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroUI/HeroGiftWin.cs b/Main/System/HeroUI/HeroGiftWin.cs
new file mode 100644
index 0000000..e5b2c2c
--- /dev/null
+++ b/Main/System/HeroUI/HeroGiftWin.cs
@@ -0,0 +1,54 @@
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+/// <summary>
+/// 姝﹀皢澶╄祴鎬昏鐣岄潰
+/// </summary>
+public class HeroGiftWin : UIBase
+{
+ [SerializeField] ScrollerController scroller;
+
+
+
+
+ protected override void OnPreOpen()
+ {
+ scroller.OnRefreshCell += OnRefreshCell;
+
+ CreateScroller();
+ }
+
+ protected override void OnPreClose()
+ {
+ scroller.OnRefreshCell -= OnRefreshCell;
+
+ }
+
+ List<int> configList = new List<int>();
+ void CreateScroller()
+ {
+ configList = HeroTalentConfig.GetKeys().ToList();
+ var totalCount = configList.Count;
+
+ scroller.Refresh();
+ for (int i = 0; i < totalCount; i++)
+ {
+ if (i % 5 == 0)
+ {
+ scroller.AddCell(ScrollerDataType.Header, i);
+ }
+ }
+ scroller.Restart();
+ }
+
+ void OnRefreshCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell as HeroGiftLineCell;
+ _cell.Display(cell.index, configList);
+ }
+
+
+}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroGiftWin.cs.meta b/Main/System/HeroUI/HeroGiftWin.cs.meta
new file mode 100644
index 0000000..b3ada05
--- /dev/null
+++ b/Main/System/HeroUI/HeroGiftWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 01bd2b445a469e24281b88ed69b39166
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroUI/HeroTrainWin.cs b/Main/System/HeroUI/HeroTrainWin.cs
index 386285d..02ec3ad 100644
--- a/Main/System/HeroUI/HeroTrainWin.cs
+++ b/Main/System/HeroUI/HeroTrainWin.cs
@@ -68,6 +68,7 @@
[SerializeField] GiftBaseCell[] giftBaseCells;
[SerializeField] Button totalGiftBtn;
[SerializeField] Button starUPBtn;
+ [SerializeField] Text starUPBtnText;
[SerializeField] Button washBtn;
@@ -127,6 +128,13 @@
});
lvupBtn.AddListener(LVUp);
lvupBtn.onPress.AddListener(LVUp);
+
+ totalGiftBtn.AddListener(() =>
+ {
+ UIManager.Instance.OpenWindow<HeroGiftWin>();
+ });
+
+ starUPBtn.AddListener(StarUP);
}
@@ -468,7 +476,7 @@
addPerObject.SetActive(true);
for (int i = 0; i < addPerText.Length; i++)
{
- addPerText[i].text = "+" + PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i], hero.qualityConfig.BreakLVAddPer);
+ addPerText[i].text = "+" + PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i], hero.qualityConfig.LVAddPer);
}
addPerObject.Play(() =>
{
@@ -576,6 +584,30 @@
void RefreshGift()
{
+ RefreshGiftCell();
+
+ if (hero.GetTotalStarCount() >= hero.GetMaxStarCount())
+ {
+ starUPBtn.interactable = false;
+ starUPBtn.SetColorful(null, false);
+ starUPBtnText.text = Language.Get("HeroGift7");
+ }
+ else if (hero.IsFullStar())
+ {
+ starUPBtn.interactable = true;
+ starUPBtn.SetColorful(null, false);
+ starUPBtnText.text = Language.Get("HeroGift3");
+ }
+ else
+ {
+ starUPBtn.interactable = true;
+ starUPBtn.SetColorful(null, true);
+ starUPBtnText.text = Language.Get("HeroGift3");
+ }
+ }
+
+ void RefreshGiftCell()
+ {
//浼犺浠ヤ笅鍙湁4涓�
int showCount = hero.Quality < 4 ? HeroUIManager.normalGiftMaxCnt : HeroUIManager.giftMaxCnt;
for (int i = 0; i < giftBaseCells.Length; i++)
@@ -625,4 +657,24 @@
}
}
+
+ void StarUP()
+ {
+ if (hero.GetTotalStarCount() >= hero.GetMaxStarCount())
+ {
+ return;
+ }
+ else if (hero.IsFullStar())
+ {
+ starUPBtn.interactable = true;
+ starUPBtn.SetColorful(null, false);
+ starUPBtnText.text = Language.Get("HeroGift3");
+ }
+ else
+ {
+ starUPBtn.interactable = true;
+ starUPBtn.SetColorful(null, true);
+ starUPBtnText.text = Language.Get("HeroGift3");
+ }
+ }
}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroUIManager.Gift.cs b/Main/System/HeroUI/HeroUIManager.Gift.cs
index 8252aef..4771a2d 100644
--- a/Main/System/HeroUI/HeroUIManager.Gift.cs
+++ b/Main/System/HeroUI/HeroUIManager.Gift.cs
@@ -10,7 +10,7 @@
{
public const int normalGiftMaxCnt = 4; //浼犺4浠ヤ笅
public const int giftMaxCnt = 8;
- public int maxGiftLevel; //澶╄祴鏈�楂樼瓑绾э紝鍏朵粬鍔熻兘鍙兘浼氬鍔犺繖涓笂闄�
+ public int maxGiftLevel; //鍗曞ぉ璧嬫渶楂樼瓑绾э紝鍏朵粬鍔熻兘鍙兘浼氬鍔犺繖涓笂闄�
public int starLevelCanAwake; //x鏄熷彲浠ヨ閱�
public int washItemID;
diff --git a/Main/Utility/UIHelper.cs b/Main/Utility/UIHelper.cs
index 4513e1f..6e47226 100644
--- a/Main/Utility/UIHelper.cs
+++ b/Main/Utility/UIHelper.cs
@@ -372,7 +372,7 @@
public static readonly Color s_NavyYellow = new Color32(242, 238, 2, 255); //f2ee02
public static readonly Color s_LightGreen = new Color32(42, 227, 55, 255);//2ae337
public static readonly Color s_LightWhite = new Color32(245, 246, 230, 255); //f5f6e6
- public static readonly Color s_Gray = new Color32(104, 104, 104,255); //bbbbbb
+ public static readonly Color s_Gray = new Color32(187, 187, 187, 255); //bbbbbb
public static readonly Color s_Gold = new Color32(255, 239, 71, 255);//ffef47
public static readonly Color s_EarthYellow = new Color32(248, 152, 59, 255);//f8983b
--
Gitblit v1.8.0