|
@@ -11,57 +11,40 @@ namespace GFGGame
|
|
{
|
|
{
|
|
public static string priorId = "prior";//首次登录前置剧情id
|
|
public static string priorId = "prior";//首次登录前置剧情id
|
|
|
|
|
|
|
|
+ //剧情副本专用当前章节
|
|
public static int currentChapterCfgId = 0;
|
|
public static int currentChapterCfgId = 0;
|
|
- public static int currentLevelOrder = 0;
|
|
|
|
- //关卡配置表的id
|
|
|
|
- public static int currentLevelCfgId;
|
|
|
|
-
|
|
|
|
- //当前关卡序号,从1开始
|
|
|
|
|
|
+ //剧情副本专用当前关卡序号,从1开始
|
|
public static int CurrentChapterOrder
|
|
public static int CurrentChapterOrder
|
|
{
|
|
{
|
|
get
|
|
get
|
|
{
|
|
{
|
|
var chapterCfg = StoryChapterCfgArray.Instance.GetCfg(currentChapterCfgId);
|
|
var chapterCfg = StoryChapterCfgArray.Instance.GetCfg(currentChapterCfgId);
|
|
- if(chapterCfg != null)
|
|
|
|
|
|
+ if (chapterCfg != null)
|
|
{
|
|
{
|
|
return chapterCfg.order;
|
|
return chapterCfg.order;
|
|
}
|
|
}
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- public static int currentScoreType;
|
|
|
|
- public static int currentCardId = 0;
|
|
|
|
- public static bool usedRecommend;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- //关卡最高分数记录
|
|
|
|
- private static Dictionary<int, int> _highestScoreDic = new Dictionary<int, int>();
|
|
|
|
- //关卡星数记录
|
|
|
|
- private static Dictionary<int, int> _starDic = new Dictionary<int, int>();
|
|
|
|
- //关卡宝箱状态记录
|
|
|
|
- private static Dictionary<int, int[]> _chapterBonusDic = new Dictionary<int, int[]>();
|
|
|
|
-
|
|
|
|
- public static void InitScoreList(List<int> ks, List<int> vs)
|
|
|
|
|
|
+ //剧情副本专用关卡编号
|
|
|
|
+ private static int _currentLevelCfgId;
|
|
|
|
+ public static int currentLevelCfgId
|
|
{
|
|
{
|
|
- usedRecommend = false;
|
|
|
|
- _highestScoreDic.Clear();
|
|
|
|
- for (var i = 0; i < ks.Count; ++i)
|
|
|
|
|
|
+ get
|
|
{
|
|
{
|
|
- _highestScoreDic.Add(ks[i], vs[i]);
|
|
|
|
|
|
+ return _currentLevelCfgId;
|
|
}
|
|
}
|
|
- }
|
|
|
|
-
|
|
|
|
- public static void InitStarList(List<int> ks, List<int> vs)
|
|
|
|
- {
|
|
|
|
- _starDic.Clear();
|
|
|
|
- for(var i = 0; i < ks.Count; ++i)
|
|
|
|
|
|
+ set
|
|
{
|
|
{
|
|
- _starDic.Add(ks[i], vs[i]);
|
|
|
|
|
|
+ _currentLevelCfgId = value;
|
|
|
|
+ var levelCfg = StoryLevelCfgArray.Instance.GetCfg(_currentLevelCfgId);
|
|
|
|
+ currentChapterCfgId = levelCfg.chapterId;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //剧情副本专用关卡宝箱状态记录
|
|
|
|
+ private static Dictionary<int, int[]> _chapterBonusDic = new Dictionary<int, int[]>();
|
|
|
|
+
|
|
public static void InitBoxBonusStates(List<int> ks, List<int> vs)
|
|
public static void InitBoxBonusStates(List<int> ks, List<int> vs)
|
|
{
|
|
{
|
|
_chapterBonusDic.Clear();
|
|
_chapterBonusDic.Clear();
|
|
@@ -84,26 +67,6 @@ namespace GFGGame
|
|
CalculateHelper.GenerateChapterBoxStates(states, stateInt);
|
|
CalculateHelper.GenerateChapterBoxStates(states, stateInt);
|
|
}
|
|
}
|
|
|
|
|
|
- //检查更新最高分
|
|
|
|
- public static void TryUpdateScore(int levelCfgId, int score)
|
|
|
|
- {
|
|
|
|
- _highestScoreDic.TryGetValue(levelCfgId, out var scoreHighest);
|
|
|
|
- if (score > scoreHighest)
|
|
|
|
- {
|
|
|
|
- _highestScoreDic[currentLevelCfgId] = score;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //检查并更新关卡星数
|
|
|
|
- public static void TryUpdateLevelStar(int levelCfgId, int star)
|
|
|
|
- {
|
|
|
|
- _starDic.TryGetValue(levelCfgId, out var OldStar);
|
|
|
|
- if(star > OldStar)
|
|
|
|
- {
|
|
|
|
- _starDic[levelCfgId] = star;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
//获取宝箱奖励状态
|
|
//获取宝箱奖励状态
|
|
public static int GetChapterBonusStatus(int chapterID, int index)
|
|
public static int GetChapterBonusStatus(int chapterID, int index)
|
|
{
|
|
{
|
|
@@ -121,27 +84,6 @@ namespace GFGGame
|
|
public static List<ItemData> GetChapterBonus(int chapterID, int index)
|
|
public static List<ItemData> GetChapterBonus(int chapterID, int index)
|
|
{
|
|
{
|
|
List<ItemData> bonusList = StoryBonusDataCache.GetChapterBonusList(chapterID, index);
|
|
List<ItemData> bonusList = StoryBonusDataCache.GetChapterBonusList(chapterID, index);
|
|
- //foreach (ItemData itemData in bonusList)
|
|
|
|
- //{
|
|
|
|
- // ItemDataManager.Add(itemData.id, itemData.num);
|
|
|
|
- //}
|
|
|
|
- //Dictionary<int, int> statusDic = null;
|
|
|
|
- //if (_chapterBonusDic.ContainsKey(chapterID))
|
|
|
|
- //{
|
|
|
|
- // statusDic = _chapterBonusDic[chapterID];
|
|
|
|
- //}
|
|
|
|
- //else
|
|
|
|
- //{
|
|
|
|
- // statusDic = new Dictionary<int, int>();
|
|
|
|
- // _chapterBonusDic.Add(chapterID, statusDic);
|
|
|
|
- // statusDic[0] = ConstBonusStatus.CAN_NOT_GET;
|
|
|
|
- // statusDic[1] = ConstBonusStatus.CAN_NOT_GET;
|
|
|
|
- // statusDic[2] = ConstBonusStatus.CAN_NOT_GET;
|
|
|
|
- //}
|
|
|
|
- //statusDic[index] = ConstBonusStatus.GOT;
|
|
|
|
- //string boxStatus = GetBoxStatus(currentChapter);
|
|
|
|
- //int starCountChapter = GetChapterStarCount(currentChapter);
|
|
|
|
- //GameProxy.ReqUpdateStoryStar(currentChapter, starCountChapter, boxStatus);
|
|
|
|
return bonusList;
|
|
return bonusList;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -199,89 +141,11 @@ namespace GFGGame
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
public static bool CheckCurrentLevelPass()
|
|
public static bool CheckCurrentLevelPass()
|
|
{
|
|
{
|
|
return InstanceZonesDataManager.CheckLevelPass(currentLevelCfgId);
|
|
return InstanceZonesDataManager.CheckLevelPass(currentLevelCfgId);
|
|
}
|
|
}
|
|
|
|
|
|
- public static int GetScoreHighest(int levelID)
|
|
|
|
- {
|
|
|
|
- if (_highestScoreDic.ContainsKey(levelID))
|
|
|
|
- {
|
|
|
|
- return _highestScoreDic[levelID];
|
|
|
|
- }
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static bool GetFightResult(int score, out int npcScore)
|
|
|
|
- {
|
|
|
|
- npcScore = 0;
|
|
|
|
- bool equipedNeeded = EquipDataCache.cacher.CheckEquipedFightNeeded();
|
|
|
|
- if (!equipedNeeded)
|
|
|
|
- {
|
|
|
|
- PromptController.Instance.ShowFloatTextPrompt("未穿必需物品");
|
|
|
|
- return false;//没穿必需品
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- int starCount = StoryDataManager.GetResultStarCount(score);
|
|
|
|
- if (starCount <= 0)
|
|
|
|
- {
|
|
|
|
- return false;//低于一星
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelCfgId);
|
|
|
|
- StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
|
|
|
|
- bool hasFightTarget = fightCfg.targetName != null && fightCfg.targetName.Length > 0;
|
|
|
|
- if (hasFightTarget)
|
|
|
|
- {
|
|
|
|
- npcScore = EquipDataCache.cacher.npcTotalScore;
|
|
|
|
- if(score < npcScore)
|
|
|
|
- {
|
|
|
|
- return false;//分数低于对战对象
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
- public static int GetResultStarCount(int score)
|
|
|
|
- {
|
|
|
|
- return CalculateHelper.GetStoryChapterStar(currentLevelCfgId, score);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static int GetStarCountHistory(int levelID)
|
|
|
|
- {
|
|
|
|
- _starDic.TryGetValue(levelID, out var star);
|
|
|
|
- return star;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static bool CheckCurrentScoreEnough(int score)
|
|
|
|
- {
|
|
|
|
- StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(currentLevelCfgId);
|
|
|
|
- StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
|
|
|
|
- return (score > fightCfg.score1);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static int GetChapterStarCount(int chapterID)
|
|
|
|
- {
|
|
|
|
- var star = 0;
|
|
|
|
- foreach(var item in _starDic)
|
|
|
|
- {
|
|
|
|
- CalculateHelper.GetStoryChapterLevel(item.Key, out var tempChapter, out var levelOrder);
|
|
|
|
- if(tempChapter == chapterID)
|
|
|
|
- {
|
|
|
|
- star += item.Value;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return star;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static int GetCanFightTime(int levelID)
|
|
|
|
- {
|
|
|
|
- StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(levelID);
|
|
|
|
- int times = (int)Math.Floor((float)GameGlobal.myNumericComponent.GetAsInt(NumericType.Power) / levelCfg.power);
|
|
|
|
- return times;
|
|
|
|
- }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|