From 2df1999cde3d0d6009a860a035cdc7011bb56d25 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期二, 21 十月 2025 15:49:37 +0800
Subject: [PATCH] 305 子 【配套功能】新手引导 / 软引导战斗指引
---
Main/System/MainLevel/MainLevelManager.cs | 17 ++++++++
Main/System/NewBieGuidance/NewBieGuideScriptableObject.cs | 8 ++-
Main/Utility/TimeUtility.cs | 8 ++--
Main/System/Battle/BattleManager.cs | 9 ++++
Main/System/Battle/BattleWin.cs | 45 +++++++++++++++++++++-
Main/System/KnapSack/Logic/SinglePack.cs | 5 ++
Main/System/Battle/BattleField/StoryBattleField.cs | 5 ++
Main/System/NewBieGuidance/NewBieCenter.cs | 9 +++-
8 files changed, 93 insertions(+), 13 deletions(-)
diff --git a/Main/System/Battle/BattleField/StoryBattleField.cs b/Main/System/Battle/BattleField/StoryBattleField.cs
index c43571d..e491dce 100644
--- a/Main/System/Battle/BattleField/StoryBattleField.cs
+++ b/Main/System/Battle/BattleField/StoryBattleField.cs
@@ -139,7 +139,10 @@
protected override void OnSettlement(JsonData turnFightStateData)
{
base.OnSettlement(turnFightStateData);
- BattleManager.Instance.MainFightRequest(4);
+ if (battleState == StoryBattleState.Battle)
+ {
+ BattleManager.Instance.MainFightRequest(4);
+ }
}
diff --git a/Main/System/Battle/BattleManager.cs b/Main/System/Battle/BattleManager.cs
index 766ccb8..732c309 100644
--- a/Main/System/Battle/BattleManager.cs
+++ b/Main/System/Battle/BattleManager.cs
@@ -24,6 +24,10 @@
}
}
+ public int fightGuideID;
+ public int fightGuideMainLevelLimit;
+ public int fightGuideNoClickSeconds;
+
public Action<string, BattleField> onBattleFieldCreate;
public Action<string, BattleField> onBattleFieldDestroy;
@@ -45,6 +49,11 @@
{
var config = FuncConfigConfig.Get("AutoGuaji");
speedGear = JsonMapper.ToObject<float[]>(config.Numerical4);
+
+ config = FuncConfigConfig.Get("FightGuide");
+ fightGuideID = int.Parse(config.Numerical1);
+ fightGuideMainLevelLimit = int.Parse(config.Numerical2);
+ fightGuideNoClickSeconds = int.Parse(config.Numerical3);
}
diff --git a/Main/System/Battle/BattleWin.cs b/Main/System/Battle/BattleWin.cs
index 6489673..2fda744 100644
--- a/Main/System/Battle/BattleWin.cs
+++ b/Main/System/Battle/BattleWin.cs
@@ -13,6 +13,8 @@
private BattleField battleField;
+ float lastClickTime;
+ bool needGuide = false;
// 鐢熷懡鍛ㄦ湡
protected override void InitComponent()
{
@@ -40,14 +42,15 @@
protected override void OnPreOpen()
{
- base.OnPreOpen();
+ lastClickTime = Time.realtimeSinceStartup;
+ needGuide = !MainLevelManager.Instance.IsPassedByMainLevelID(BattleManager.Instance.fightGuideMainLevelLimit);
+
// SetBattleField(BattleManager.Instance.storyBattleField);
BattleManager.Instance.onBattleFieldCreate += OnCreateBattleField;
}
protected override void OnPreClose()
{
- base.OnPreClose();
UIManager.Instance.CloseWindow<BattleHUDWin>();
BattleManager.Instance.onBattleFieldCreate -= OnCreateBattleField;
}
@@ -113,4 +116,42 @@
ui.SetBattleField(battleField);
battleField.UpdateCanvas(canvas);
}
+
+
+
+
+ void LateUpdate()
+ {
+ if (!needGuide)
+ return;
+
+ if (Input.GetMouseButtonDown(0))
+ {
+ lastClickTime = Time.realtimeSinceStartup;
+ }
+
+
+ if (Time.realtimeSinceStartup - lastClickTime > BattleManager.Instance.fightGuideNoClickSeconds)
+ {
+ if (AutoFightModel.Instance.isAutoAttack)
+ {
+ return;
+ }
+
+ if (NewBieCenter.Instance.inGuiding)
+ {
+ return;
+ }
+
+ if (UIManager.Instance.ExistAnyFullScreenOrMaskWin(""))
+ {
+ return;
+ }
+
+ NewBieCenter.Instance.StartNewBieGuide(BattleManager.Instance.fightGuideID);
+ needGuide = !MainLevelManager.Instance.IsPassedByMainLevelID(BattleManager.Instance.fightGuideMainLevelLimit);
+ BattleManager.Instance.storyBattleField.IsPause = false;
+ lastClickTime = Time.realtimeSinceStartup;
+ }
+ }
}
diff --git a/Main/System/KnapSack/Logic/SinglePack.cs b/Main/System/KnapSack/Logic/SinglePack.cs
index 39c0366..5765d52 100644
--- a/Main/System/KnapSack/Logic/SinglePack.cs
+++ b/Main/System/KnapSack/Logic/SinglePack.cs
@@ -228,6 +228,11 @@
{
return items.Values.ToList();
}
+
+ public List<int> GetItemIndexs()
+ {
+ return items.Keys.ToList();
+ }
public List<ItemModel> GetItems(FilterParams filterParams)
{
diff --git a/Main/System/MainLevel/MainLevelManager.cs b/Main/System/MainLevel/MainLevelManager.cs
index 492f4ea..0bebb67 100644
--- a/Main/System/MainLevel/MainLevelManager.cs
+++ b/Main/System/MainLevel/MainLevelManager.cs
@@ -53,5 +53,20 @@
return true;
}
-
+
+ //levelID 涓哄鎴风閰嶇疆鐨処D
+ public bool IsPassedByMainLevelID(int levelID)
+ {
+ var value = PlayerDatas.Instance.baseData.ExAttr1;
+ var chapterID = value / 10000;
+ var levelNum = value % 10000 / 100;
+
+ var config = MainLevelConfig.Get(levelID);
+ if (chapterID > config.ChapterID || (chapterID == config.ChapterID && levelNum > config.LevelNum))
+ {
+ return true;
+ }
+
+ return false;
+ }
}
\ No newline at end of file
diff --git a/Main/System/NewBieGuidance/NewBieCenter.cs b/Main/System/NewBieGuidance/NewBieCenter.cs
index 2d3bd0c..1b05f90 100644
--- a/Main/System/NewBieGuidance/NewBieCenter.cs
+++ b/Main/System/NewBieGuidance/NewBieCenter.cs
@@ -251,11 +251,16 @@
{
waitGuideWinNames.Remove(config.WinName);
}
-
- BattleManager.Instance.storyBattleField.IsPause = true;
currentGuide = _id;
guideStep = config.Steps.Length > 0 ? config.Steps[0] : 0;
+ var stepConfig = ScriptableObjectLoader.LoadSoNewBieGuideStep(guideStep);
+ if (!(stepConfig.guideType == GuideType.NewBie && stepConfig.clickCompleteNoMask))
+ {
+ // 闈炲己鍒跺紩瀵间笉鏆傚仠鎴樻枟锛屽鏈夊叿浣撻渶瑕佸彲浠ュ鍔犲瓧娈�
+ BattleManager.Instance.storyBattleField.IsPause = true;
+ }
+
if (guideBeginEvent != null)
{
diff --git a/Main/System/NewBieGuidance/NewBieGuideScriptableObject.cs b/Main/System/NewBieGuidance/NewBieGuideScriptableObject.cs
index 50f948c..e54b2db 100644
--- a/Main/System/NewBieGuidance/NewBieGuideScriptableObject.cs
+++ b/Main/System/NewBieGuidance/NewBieGuideScriptableObject.cs
@@ -17,9 +17,11 @@
public Vector2 usherPosition;
public UsherOrientation usherOrientation;
public int usherAction;
- public bool clickAnyWhereComplete = false;
- public bool clickCompleteNoMask = false; //浠绘剰鐐瑰嚮鍏抽棴 鍕鹃�夋椤逛細闅愯棌钂欑増
-
+ //鏈夎挋鐗堢殑 浜︽湁寮哄埗鐐瑰嚮鐨勬晥鏋�
+ // 鐗规畩渚嬪瓙锛氶晜绌鸿寖鍥磋秴杩囧睆骞曞氨鍙互瀹炵幇鐪嬭捣鏉ヤ笉鏄己鍒跺紩瀵� 鐐瑰嚮浠绘剰浣嶇疆鏈夋晥
+ // 濡傛灉鍚庣画鎯冲仛锛氫笉鎯宠钂欑増 鍙堟兂瑕佺偣鍑诲紩瀵肩殑浣嶇疆鎵嶆湁鏁� 鍒欏彲浠ユ槸鍦ㄥ嬀閫塩lickAnyWhereComplete鎯呭喌涓嬶紝鏀瑰彉mask鐨刟lpha鍊煎嵆鍙厤鍚堟彁绀�
+ public bool clickAnyWhereComplete = false;
+ public bool clickCompleteNoMask = false; //闈炲己鍒跺紩瀵硷紝浠绘剰鐐瑰嚮鍏抽棴锛屽嬀閫夋椤逛細闅愯棌钂欑増锛屼笖鐐瑰嚮鍏朵粬鍖哄煙涓嶄細鍝嶅簲鎸夐挳浜嬩欢
// 寮曞鐨勬枃鏈殑绠ご浣嶇疆
diff --git a/Main/Utility/TimeUtility.cs b/Main/Utility/TimeUtility.cs
index 22c4141..9504f09 100644
--- a/Main/Utility/TimeUtility.cs
+++ b/Main/Utility/TimeUtility.cs
@@ -424,7 +424,7 @@
//渚嬪瓙
//x澶�
//x鏃�
- //x鍒唜绉�
+ //x鍒�
//x绉�
public static string SecondsToConsumeRebate(int _seconds)
{
@@ -438,15 +438,15 @@
}
else if (hours >= 1)
{
- return StringUtility.Contact(Mathf.CeilToInt(hours), Language.Get("Hour"));
+ return StringUtility.Contact(Mathf.CeilToInt(hours), Language.Get("L1072"));
}
else if (mins >= 1)
{
- return StringUtility.Contact(mins, Language.Get("Minute"), seconds, Language.Get("RealmWin_Bewrite_35"));
+ return StringUtility.Contact(mins, Language.Get("L1073"));
}
else
{
- return StringUtility.Contact(seconds, Language.Get("RealmWin_Bewrite_35"));
+ return StringUtility.Contact(seconds, Language.Get("L1075"));
}
}
--
Gitblit v1.8.0