From 22c7740bee16435d51090e26e6777fc5cece45cd Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期四, 20 十一月 2025 00:00:55 +0800
Subject: [PATCH] 213 【付费内容】特权卡
---
Main/System/Dungeon/DungeonManager.cs | 29 +++++++++++++++++++++++++++--
1 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/Main/System/Dungeon/DungeonManager.cs b/Main/System/Dungeon/DungeonManager.cs
index bbfbb11..d1bd6c2 100644
--- a/Main/System/Dungeon/DungeonManager.cs
+++ b/Main/System/Dungeon/DungeonManager.cs
@@ -9,7 +9,6 @@
{
private Dictionary<int, FBInfo> fbInfoDict = new Dictionary<int, FBInfo>();
public event Action<int> UpdateFBInfoListEvent;//int mapID
- public event Action<int, bool, bool, bool> UpdateFBInfoChangeEvent;
Dictionary<int, DungeonRecord> dungeonRecords = new Dictionary<int, DungeonRecord>();
public event Action updateDungeonBuyCnt;
@@ -31,6 +30,33 @@
public bool TryGetFBInfoByMapID(int mapID, out FBInfo info)
{
return fbInfoDict.TryGetValue(mapID, out info);
+ }
+
+ //鑾峰緱鍓湰鐨勬渶澶ф鏁板拰鍓╀綑鍙敤娆℃暟
+
+ //maxCount 鏈�澶ф鏁帮細鍙兘浼氬洜鍚勪釜鍓湰灞曠ず瑙勫垯涓嶅悓鑰屼笉鍚�
+ // 榛樿涓轰粠鍔熻兘鎿嶄綔褰掑睘鍑哄彂璐拱娆℃暟灞炰簬姣忔棩涓婇檺娆℃暟 姣忔棩娆℃暟 + 鍙渶澶ц喘涔版鏁� + 鐗规潈娆℃暟
+ //useCount 鍓╀綑鍙敤娆℃暟锛氫粖鏃ユ�荤殑鍙敤娆℃暟 - 浠婃棩宸茶繘鍏ユ鏁�
+ // 浠婃棩鎬荤殑鍙敤娆℃暟锛氭瘡鏃ユ鏁� + 鍙喘鎬讳拱娆℃暟 + 骞垮憡娆℃暟 + 閬撳叿娆℃暟 + 鐗规潈娆℃暟
+ // 榛樿涓轰粠鍔熻兘鎿嶄綔褰掑睘鍑哄彂璐拱娆℃暟灞炰簬鍙敤娆℃暟鍐�
+ public bool TryGetDungeonCount(int dataMapID, out int maxCount, out int useCount)
+ {
+ maxCount = 0;
+ useCount = 0;
+ if (!TryGetFBInfoByMapID(dataMapID, out FBInfo fbInfo))
+ return false;
+
+ DungeonOpenTimeConfig dungeonOpenTimeConfig = DungeonOpenTimeConfig.Get(dataMapID);
+ if (dungeonOpenTimeConfig == null)
+ {
+ return false;
+ }
+ //鎬荤殑鍙敤娆℃暟锛氭瘡鏃ユ鏁� + 鍙喘鎬讳拱娆℃暟 + 骞垮憡娆℃暟 + 閬撳叿娆℃暟 + 鐗规潈娆℃暟
+ int totalCount = dungeonOpenTimeConfig.DayTimes + dungeonOpenTimeConfig.PayCntMax + InvestModel.Instance.GetAddFBBuyCount(dataMapID) + fbInfo.ADAddCnt + fbInfo.ItemAddCnt;
+ maxCount = dungeonOpenTimeConfig.DayTimes + dungeonOpenTimeConfig.PayCntMax + InvestModel.Instance.GetAddFBBuyCount(dataMapID);
+ useCount = totalCount - fbInfo.EnterCnt;
+
+ return true;
}
public void UpdateFBInfoList(HA320_tagSCFBInfoList vNetData)
@@ -63,7 +89,6 @@
fbInfoDict[mapID].PassGrade = item.PassGrade;
UpdateFBInfoListEvent?.Invoke(mapID);
- UpdateFBInfoChangeEvent?.Invoke(mapID, isADAddCntChange, isBuyAddCntChange, isItemAddCntChange);
}
}
--
Gitblit v1.8.0