From e6269ae16fea2462c32705ce0fbe7e4f3bf364a4 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期三, 24 十二月 2025 18:51:46 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
---
/dev/null | 11 --
Main/System/HeroUI/HeroPosWin.cs | 2
Main/System/Battle/BattleManager.cs | 6
Main/System/LineupRecommend/LineupRecommendWin.cs | 54 ----------
Main/System/Main/MainWin.cs | 7 +
Main/System/Battle/BaseBattleWin.cs | 176 ++++++++++++++++++++++-------------
Main/System/HeroUI/HeroListWin.cs | 2
7 files changed, 123 insertions(+), 135 deletions(-)
diff --git a/Main/System/Battle/BaseBattleWin.cs b/Main/System/Battle/BaseBattleWin.cs
index 8d514ed..a71b94e 100644
--- a/Main/System/Battle/BaseBattleWin.cs
+++ b/Main/System/Battle/BaseBattleWin.cs
@@ -1,4 +1,5 @@
-锘縰sing UnityEngine;
+锘縰sing System.Collections.Generic;
+using UnityEngine;
using UnityEngine.UI;
/// <summary>
@@ -185,8 +186,6 @@
battleField.OnRoundChange += OnRoundChange;
OnRoundChange(battleField.round, battleField.turnMax); // 绔嬪嵆鎵ц涓�娆′互鏄剧ず鍒濆鍥炲悎
}
-
-
/// <summary>
/// 璺宠繃鎴樻枟
/// </summary>
@@ -201,87 +200,132 @@
{
if (null == battleField)
return true;
- // 妫�鏌ユ槸鍚︿负姘镐箙鐗规潈鍗$帺瀹�
+
bool hasForeverPrivilege = InvestModel.Instance.IsInvested(InvestModel.foreverCardType);
-
string battleFieldName = battleField.ToString();
- if (!hasForeverPrivilege && !FuncOpen.Instance.IsFuncOpen(BattleManager.Instance.passFuncId))
- {
- if (battleFieldName != BattleConst.StoryBossBattleField)
- {
- //绛夌骇杈惧埌20绾у悗瑙i攣鎴栧紑閫氱粓韬壒鏉冭В閿�
- SysNotifyMgr.Instance.ShowTip("BattlePass2");
- }
- else
- {
- FuncOpen.Instance.ProcessorFuncErrorTip(BattleManager.Instance.passFuncId);
- }
+
+ // 妫�鏌ュ姛鑳藉紑鍚姸鎬�
+ if (!IsPassOpen(hasForeverPrivilege, battleFieldName))
return false;
- }
- int passRound = BattleManager.Instance.defaultPassRound;
- var name = battleField.ToString();
-
-
- if (hasForeverPrivilege)
+ // 鑾峰彇閰嶇疆鐨勫洖鍚堥檺鍒�
+ int configRoundLimit = GetRequiredPassRound(hasForeverPrivilege, battleFieldName);
+ int nowRound = battleField.round > 0 ? battleField.round : 1;
+ if (nowRound >= configRoundLimit + 1)
{
- // 姘镐箙鐗规潈鍗$帺瀹堕�昏緫
- if (BattleConst.FieldNameToIndex.ContainsKey(name))
+ return true;
+ }
+ ShowSkipWaitTip(configRoundLimit, battleFieldName, hasForeverPrivilege);
+ return false;
+ }
+
+ private bool IsPassOpen(bool hasForeverPrivilege, string battleFieldName)
+ {
+ // 鎷ユ湁姘镐箙鐗规潈鍗★紝鏃犺鍔熻兘寮�鍚檺鍒�
+ if (hasForeverPrivilege)
+ return true;
+
+ int passFuncId = BattleManager.Instance.passFuncId;
+ // 妫�鏌ュ姛鑳絀D鏄惁寮�鍚�
+ if (FuncOpen.Instance.IsFuncOpen(passFuncId))
+ return true;
+
+ if (!FuncOpenLVConfig.HasKey(passFuncId))
+ return true;
+ int lv = FuncOpenLVConfig.Get(passFuncId).LimitLV;
+ SysNotifyMgr.Instance.ShowTip("BattlePass2", lv);
+ return false;
+ }
+
+ private int GetRequiredPassRound(bool hasForeverPrivilege, string battleFieldName)
+ {
+ // 鍒濆鍖栭粯璁ゅ��
+ int resultRound = BattleManager.Instance.defaultPassRound;
+
+ // 灏濊瘯鑾峰彇鏅�氶厤缃紙瑕嗙洊榛樿鍊硷級
+ if (BattleConst.FieldNameToIndex.TryGetValue(battleFieldName, out int index))
+ {
+ if (BattleManager.Instance.passDict.TryGetValue(index, out int normalRound))
{
- int index = BattleConst.FieldNameToIndex[name];
- if (BattleManager.Instance.foreverPrivilegePassDict.ContainsKey(index))
- {
- passRound = BattleManager.Instance.foreverPrivilegePassDict[index];
- }
- else
- {
- // 鏈厤缃殑鎴樺満绫诲瀷锛屼娇鐢ㄦ櫘閫氱帺瀹惰鍒�
- if (BattleManager.Instance.passDict.ContainsKey(index))
- {
- passRound = BattleManager.Instance.passDict[index];
- }
- // 鍚﹀垯浣跨敤榛樿閰嶇疆
- }
+ resultRound = normalRound;
}
- // 濡傛灉鎴樺満绫诲瀷涓嶅湪 FieldNameToIndex 涓紝浣跨敤榛樿閰嶇疆
}
else
{
- // 鏅�氱帺瀹堕�昏緫
- if (BattleConst.FieldNameToIndex.ContainsKey(name))
- {
- int index = BattleConst.FieldNameToIndex[name];
- if (BattleManager.Instance.passDict.ContainsKey(index))
- {
- passRound = BattleManager.Instance.passDict[index];
- }
- // 鍚﹀垯浣跨敤榛樿閰嶇疆
- }
- // 濡傛灉鎴樺満绫诲瀷涓嶅湪 FieldNameToIndex 涓紝浣跨敤榛樿閰嶇疆
+ // 濡傛灉杩炵储寮曢兘鎵句笉鍒帮紝鐩存帴杩斿洖榛樿鍊硷紝鏃犻渶鍚庣画鍒ゆ柇
+ return resultRound;
}
- if (passRound != 0)
+ // 濡傛灉娌℃湁鐗规潈锛岀洿鎺ヨ繑鍥炴櫘閫氶厤缃�
+ if (!hasForeverPrivilege)
+ return resultRound;
+
+ // 鍒ゆ柇鐗规潈鏄惁鐢熸晥
+ bool isPrivilegeEffective = true;
+
+ // 鐗规畩瑙勫垯锛氫富绾緽OSS闇�瑕佽揪鍒版寚瀹氱珷鑺傦紝鐗规潈鎵嶇敓鏁�
+ if (battleFieldName == BattleConst.StoryBossBattleField)
{
- int nowRound = battleField.round;
- int realPassRound = passRound + 1; // 閰嶇疆鏄秴杩噚鍥炲悎鍙互璺�,鎰忓懗鐫�x+1鍥炲悎鍙互璺�
- if (nowRound < realPassRound)
+ if (IsStoryBossChapterLimited())
{
- if (battleFieldName != BattleConst.StoryBossBattleField)
- {
- //%s0鍥炲悎鍚庡彲璺宠繃锛屽紑閫氱粓韬壒鏉冪珛鍗宠烦杩�
- SysNotifyMgr.Instance.ShowTip("BattlePass1", realPassRound - nowRound);
- }
- else
- {
- SysNotifyMgr.Instance.ShowTip("BattlePass", realPassRound - nowRound);
- }
-
- return false;
+ isPrivilegeEffective = false;
}
}
- return true;
+
+ if (isPrivilegeEffective)
+ {
+ var vipDict = BattleManager.Instance.foreverPrivilegePassDict;
+ // 鍙湁褰撶壒鏉冭〃閲屾樉寮忛厤缃簡璇ユ垬鍦猴紝鎵嶈繘琛岃鐩�
+ if (vipDict.TryGetValue(index, out int vipRound))
+ {
+ resultRound = vipRound;
+ }
+ }
+
+ return resultRound;
}
+ private void ShowSkipWaitTip(int configRoundLimit, string battleFieldName, bool hasForeverPrivilege)
+ {
+ int waitRound = Mathf.Max(configRoundLimit - battleField.round + 1, 0);
+
+ // 涓荤嚎BOSS鎴樺満鐗规畩鎻愮ず
+ if (battleFieldName == BattleConst.StoryBossBattleField)
+ {
+ if (!hasForeverPrivilege || IsStoryBossChapterLimited())
+ {
+ SysNotifyMgr.Instance.ShowTip("BattlePass3", waitRound, BattleManager.Instance.passChapterID);
+ }
+ else
+ {
+ SysNotifyMgr.Instance.ShowTip("BattlePass", waitRound);
+ }
+ }
+ // 鍏朵粬鎴樺満鎻愮ず
+ else
+ {
+ if (hasForeverPrivilege)
+ {
+ SysNotifyMgr.Instance.ShowTip("BattlePass", waitRound);
+ }
+ else
+ {
+ SysNotifyMgr.Instance.ShowTip("BattlePass1", waitRound);
+ }
+
+ }
+ }
+
+ /// <summary>
+ /// 妫�鏌ヤ富绾緽OSS鏄惁鍙楀埌绔犺妭闄愬埗
+ /// </summary>
+ private bool IsStoryBossChapterLimited()
+ {
+ long currentProgress = PlayerDatas.Instance.baseData.ExAttr2;
+ int nowChapterID = (int)(currentProgress / 10000);
+
+ return nowChapterID <= BattleManager.Instance.passChapterID;
+ }
/// <summary>
/// 鏀瑰彉閫熷害
diff --git a/Main/System/Battle/BattleManager.cs b/Main/System/Battle/BattleManager.cs
index 5d92cc1..3b1094e 100644
--- a/Main/System/Battle/BattleManager.cs
+++ b/Main/System/Battle/BattleManager.cs
@@ -27,9 +27,10 @@
public readonly int[] speedIndexfuncIdArr = new int[] { 34, 35, 36 }; // 鎴樻枟鍊嶆暟瀵瑰簲鐨勫姛鑳絀D
public readonly int passFuncId = 33; // 璺宠繃鎴樻枟瀵瑰簲鐨勫姛鑳絀D
- public int defaultPassRound;
- public Dictionary<int, int> passDict = new Dictionary<int, int>();
+ public int defaultPassRound;
+ public Dictionary<int, int> passDict = new Dictionary<int, int>();
public Dictionary<int, int> foreverPrivilegePassDict = new Dictionary<int, int>();
+ public int passChapterID;
public int fightBossGuideID;
public int fightGuideMainLevelLimit;
@@ -70,6 +71,7 @@
defaultPassRound = int.Parse(config.Numerical1);
passDict = ConfigParse.ParseIntDict(config.Numerical2);
foreverPrivilegePassDict = ConfigParse.ParseIntDict(config.Numerical3);
+ passChapterID = int.Parse(config.Numerical4);
}
diff --git a/Main/System/HeroUI/HeroListWin.cs b/Main/System/HeroUI/HeroListWin.cs
index 3c5fedd..73ebc3b 100644
--- a/Main/System/HeroUI/HeroListWin.cs
+++ b/Main/System/HeroUI/HeroListWin.cs
@@ -45,7 +45,7 @@
fiterManager = HeroSelectBehaviour.Create(heroSelectBehaviour);
lineupRecommendBtn.AddListener(() =>
{
- UIManager.Instance.OpenWindow<LineupRecommendBaseWin>();
+ UIManager.Instance.OpenWindow<LineupRecommendWin>();
});
}
diff --git a/Main/System/HeroUI/HeroPosWin.cs b/Main/System/HeroUI/HeroPosWin.cs
index 868bb05..f305634 100644
--- a/Main/System/HeroUI/HeroPosWin.cs
+++ b/Main/System/HeroUI/HeroPosWin.cs
@@ -110,7 +110,7 @@
lineupRecommendBtn.AddListener(() =>
{
- UIManager.Instance.OpenWindow<LineupRecommendBaseWin>();
+ UIManager.Instance.OpenWindow<LineupRecommendWin>();
});
m_IsToggleOn = LocalSave.GetBool("ShowConn" + PlayerDatas.Instance.baseData.PlayerID, false);
diff --git a/Main/System/LineupRecommend/LineupRecommendBaseWin.cs b/Main/System/LineupRecommend/LineupRecommendBaseWin.cs
deleted file mode 100644
index a921412..0000000
--- a/Main/System/LineupRecommend/LineupRecommendBaseWin.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-
-using UnityEngine;
-
-public class LineupRecommendBaseWin : OneLevelWin
-{
- protected override void OpenSubUIByTabIndex()
- {
- switch (functionOrder)
- {
- case 0:
- currentSubUI = UIManager.Instance.OpenWindow<LineupRecommendWin>();
- break;
-
- default:
- Debug.LogWarning("鏈煡鐨勬爣绛剧储寮�: " + functionOrder);
- break;
- }
-
- }
-}
\ No newline at end of file
diff --git a/Main/System/LineupRecommend/LineupRecommendBaseWin.cs.meta b/Main/System/LineupRecommend/LineupRecommendBaseWin.cs.meta
deleted file mode 100644
index 93d5fb5..0000000
--- a/Main/System/LineupRecommend/LineupRecommendBaseWin.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 9441087b3e26ee84aa8e21ea77bd78e1
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Main/System/LineupRecommend/LineupRecommendWin.cs b/Main/System/LineupRecommend/LineupRecommendWin.cs
index c212ec5..17c4628 100644
--- a/Main/System/LineupRecommend/LineupRecommendWin.cs
+++ b/Main/System/LineupRecommend/LineupRecommendWin.cs
@@ -1,36 +1,19 @@
using System.Collections.Generic;
using UnityEngine;
-using UnityEngine.UI;
public class LineupRecommendWin : UIBase
{
- [SerializeField] AvatarCell avatarCell;
- [SerializeField] Text txtPlayerName;
- [SerializeField] Text txtFightPoint;
- [SerializeField] OfficialTitleCell officialRankText;
-
[SerializeField] ScrollerController scroller;
LineupRecommendManager manager { get { return LineupRecommendManager.Instance; } }
- protected override void InitComponent()
- {
- base.InitComponent();
- avatarCell.redpoint.redpointId = MainRedDot.PhantasmPavilionRepoint;
- avatarCell.button.SetListener(() =>
- {
- UIManager.Instance.OpenWindow<PlayerProfileWin>();
- });
- }
protected override void OnPreOpen()
{
- PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh;
scroller.OnRefreshCell += OnRefreshCell;
scroller.OnGetDynamicSize += OnGetDynamicSize;
manager.OnUpdateLineupRecommendInfoEvent += OnUpdateLineupRecommendInfoEvent;
manager.OnUpdateSwitchOnOrOffEvent += OnUpdateSwitchOnOrOffEvent;
manager.ClearOnList();
- UpdatePlayerInfo();
scroller.lockType = EnhanceLockType.KeepVertical;
CreateScoller();
int index = 0;
@@ -41,7 +24,6 @@
protected override void OnPreClose()
{
- PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh;
scroller.OnRefreshCell -= OnRefreshCell;
scroller.OnGetDynamicSize -= OnGetDynamicSize;
manager.OnUpdateLineupRecommendInfoEvent -= OnUpdateLineupRecommendInfoEvent;
@@ -77,28 +59,6 @@
return true;
}
- void PlayerDataRefresh(PlayerDataType type)
- {
- switch (type)
- {
- case PlayerDataType.FightPower:
- txtFightPoint.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPower);
- break;
- case PlayerDataType.RealmLevel:
- officialRankText.InitUI(PlayerDatas.Instance.baseData.realmLevel, PlayerDatas.Instance.baseData.TitleID);
- break;
- case PlayerDataType.Face:
- case PlayerDataType.FacePic:
- avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)PlayerDatas.Instance.baseData.PlayerID,
- PlayerDatas.Instance.baseData.face,
- PlayerDatas.Instance.baseData.facePic));
- break;
- case PlayerDataType.ExAttr3:
- officialRankText.InitUI(PlayerDatas.Instance.baseData.realmLevel, PlayerDatas.Instance.baseData.TitleID);
- break;
- }
-
- }
void RefreshScoller()
{
@@ -118,19 +78,5 @@
}
scroller.Restart();
}
-
- private void UpdatePlayerInfo()
- {
- // 浠庣帺瀹舵暟鎹腑鑾峰彇淇℃伅骞舵洿鏂癠I
- avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)PlayerDatas.Instance.baseData.PlayerID,
- PlayerDatas.Instance.baseData.face,
- PlayerDatas.Instance.baseData.facePic));
-
- txtPlayerName.text = PlayerDatas.Instance.baseData.PlayerName;
- txtFightPoint.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPower);
-
- officialRankText.InitUI(PlayerDatas.Instance.baseData.realmLevel, PlayerDatas.Instance.baseData.TitleID);
- }
-
}
\ No newline at end of file
diff --git a/Main/System/Main/MainWin.cs b/Main/System/Main/MainWin.cs
index 94aded5..a19babd 100644
--- a/Main/System/Main/MainWin.cs
+++ b/Main/System/Main/MainWin.cs
@@ -299,6 +299,13 @@
currentSubUI = UIManager.Instance.OpenWindow<AffairBaseWin>();
break;
case 2:
+ if (gameTip.gameObject.activeSelf)
+ {
+ if (!NewBieCenter.Instance.inGuiding)
+ {
+ NewBieCenter.Instance.StartNewBieGuide(HappyXBModel.Instance.tenCallGuideID);
+ }
+ }
currentSubUI = UIManager.Instance.OpenWindow<HeroBaseWin>(0);
break;
// case 3:
--
Gitblit v1.8.0