|
@@ -11,7 +11,8 @@ namespace GFGGame
|
|
|
public static string priorId = "prior";//首次登录前置剧情id
|
|
|
public static int currentChapter = 0;
|
|
|
public static int currentLevel = 0;
|
|
|
- public static string currentLevelID;
|
|
|
+ //配置表的id
|
|
|
+ public static int currentLevelCfgId;
|
|
|
public static int currentScoreType;
|
|
|
public static int currentCardId = 0;
|
|
|
public static bool usedRecommend;
|
|
@@ -19,107 +20,93 @@ namespace GFGGame
|
|
|
public static int _passLevel = 0;
|
|
|
private static int _passChapterJY = 10000;
|
|
|
private static int _passLevelJY = 0;
|
|
|
- private static int _recommendCount = 0;
|
|
|
public static int recommendDay = -1;
|
|
|
- public static int recommendCount
|
|
|
- {
|
|
|
- get
|
|
|
- {
|
|
|
- return _recommendCount;
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- private static Dictionary<string, int> _highestScoreDic = new Dictionary<string, int>();
|
|
|
- private static Dictionary<int, int> _chapterStarCountDic = new Dictionary<int, int>();
|
|
|
- private static Dictionary<int, Dictionary<int, int>> _chapterBonusDic = new Dictionary<int, Dictionary<int, int>>();
|
|
|
+ //关卡最高分数记录
|
|
|
+ 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 InitServerData(RoleInfo roleInfo)
|
|
|
+ public static void InitScoreList(List<int> ks, List<int> vs)
|
|
|
{
|
|
|
usedRecommend = false;
|
|
|
- _recommendCount = roleInfo.recommendCount;
|
|
|
- recommendDay = roleInfo.recommendDay;
|
|
|
+ _highestScoreDic.Clear();
|
|
|
+ for (var i = 0; i < ks.Count; ++i)
|
|
|
+ {
|
|
|
+ _highestScoreDic.Add(ks[i], vs[i]);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- public static void InitScoreList(List<StoryScore> list)
|
|
|
+ public static void InitStarList(List<int> ks, List<int> vs)
|
|
|
{
|
|
|
- _highestScoreDic.Clear();
|
|
|
- if (list != null)
|
|
|
+ _starDic.Clear();
|
|
|
+ for(var i = 0; i < ks.Count; ++i)
|
|
|
{
|
|
|
- foreach (StoryScore value in list)
|
|
|
- {
|
|
|
- _highestScoreDic[value.lvlId] = value.score;
|
|
|
- }
|
|
|
+ _starDic.Add(ks[i], vs[i]);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static void InitStarList(List<StoryStar> list)
|
|
|
+ public static void InitBoxBonusStates(List<int> ks, List<int> vs)
|
|
|
{
|
|
|
- _chapterStarCountDic.Clear();
|
|
|
_chapterBonusDic.Clear();
|
|
|
- if (list != null)
|
|
|
+ for (var i = 0; i < ks.Count; ++i)
|
|
|
{
|
|
|
- foreach (StoryStar value in list)
|
|
|
- {
|
|
|
- int chapterID = value.chapterId;
|
|
|
- _chapterStarCountDic[chapterID] = value.star;
|
|
|
- if (value.boxStatus != null && value.boxStatus.Length > 0)
|
|
|
- {
|
|
|
- Dictionary<int, int> statusDic = null;
|
|
|
- if (_chapterBonusDic.ContainsKey(chapterID))
|
|
|
- {
|
|
|
- statusDic = _chapterBonusDic[chapterID];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- statusDic = new Dictionary<int, int>();
|
|
|
- _chapterBonusDic.Add(chapterID, statusDic);
|
|
|
- }
|
|
|
- string[] statusStrs = value.boxStatus.Split(';');
|
|
|
- for (int i = 0; i < statusStrs.Length; i++)
|
|
|
- {
|
|
|
- string statusStr = statusStrs[i];
|
|
|
- int status = int.Parse(statusStr);
|
|
|
- statusDic[i] = status;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ var states = new int[] { 0, 0, 0 };
|
|
|
+ var value = vs[i];
|
|
|
+ CalculateHelper.GenerateChapterBoxStates(states, value);
|
|
|
+ _chapterBonusDic.Add(ks[i], states);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static void ResetDailyData()
|
|
|
+ public static void UpdateBoxBonusStates(int chapter, int stateInt)
|
|
|
{
|
|
|
- _recommendCount = GameConst.MAX_COUNT_RECOMMEND;
|
|
|
- int day = ServerDataManager.CurrentDay;
|
|
|
- recommendDay = day;
|
|
|
- GameProxy.ReqUpdateRecommendCount(_recommendCount);
|
|
|
+ if (!_chapterBonusDic.TryGetValue(chapter, out var states))
|
|
|
+ {
|
|
|
+ states = new int[] { 0, 0, 0 };
|
|
|
+ _chapterBonusDic.Add(chapter, states);
|
|
|
+ }
|
|
|
+ CalculateHelper.GenerateChapterBoxStates(states, stateInt);
|
|
|
}
|
|
|
|
|
|
- public static void SetPassData(int chapter, int chapterLvl)
|
|
|
+ //检查更新最高分
|
|
|
+ public static void TryUpdateScore(int levelCfgId, int score)
|
|
|
{
|
|
|
- if (StoryUtil.CheckChapterIsHard(chapter))
|
|
|
+ _highestScoreDic.TryGetValue(levelCfgId, out var scoreHighest);
|
|
|
+ if (score > scoreHighest)
|
|
|
{
|
|
|
- //_passChapterJY = chapter;
|
|
|
- //_passLevelJY = chapterLvl;
|
|
|
+ _highestScoreDic[currentLevelCfgId] = score;
|
|
|
}
|
|
|
- else
|
|
|
+ }
|
|
|
+
|
|
|
+ //检查并更新关卡星数
|
|
|
+ public static void TryUpdateLevelStar(int levelCfgId, int star)
|
|
|
+ {
|
|
|
+ _starDic.TryGetValue(levelCfgId, out var OldStar);
|
|
|
+ if(star > OldStar)
|
|
|
{
|
|
|
- //_passChapter = chapter;
|
|
|
- //_passLevel = chapterLvl;
|
|
|
+ _starDic[levelCfgId] = star;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public static void ResetDailyData()
|
|
|
+ {
|
|
|
+ //_recommendCount = GameConst.MAX_COUNT_RECOMMEND;
|
|
|
+ int day = ServerDataManager.CurrentDay;
|
|
|
+ //recommendDay = day;
|
|
|
+ //GameProxy.ReqUpdateRecommendCount(_recommendCount);
|
|
|
+ }
|
|
|
|
|
|
+ //获取宝箱奖励状态
|
|
|
public static int GetChapterBonusStatus(int chapterID, int index)
|
|
|
{
|
|
|
if (_chapterBonusDic.ContainsKey(chapterID))
|
|
|
{
|
|
|
- Dictionary<int, int> statusDic = _chapterBonusDic[chapterID];
|
|
|
- if (statusDic != null)
|
|
|
+ var states = _chapterBonusDic[chapterID];
|
|
|
+ if (states != null)
|
|
|
{
|
|
|
- if (statusDic.ContainsKey(index))
|
|
|
- {
|
|
|
- return statusDic[index];
|
|
|
- }
|
|
|
+ return states[index];
|
|
|
}
|
|
|
}
|
|
|
return ConstBonusStatus.CAN_NOT_GET;
|
|
@@ -128,63 +115,30 @@ namespace GFGGame
|
|
|
public static List<ItemData> GetChapterBonus(int chapterID, int 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);
|
|
|
+ //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;
|
|
|
}
|
|
|
|
|
|
- public static void UpdateChapterBonusStatus(int chapterID, int starCount)
|
|
|
- {
|
|
|
- StoryChapterCfg storyChapterCfg = StoryChapterCfgArray.Instance.GetCfg(chapterID);
|
|
|
- if (starCount >= storyChapterCfg.bonusStar1)
|
|
|
- {
|
|
|
- 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;
|
|
|
- }
|
|
|
- if (statusDic[0] == ConstBonusStatus.CAN_NOT_GET)
|
|
|
- {
|
|
|
- statusDic[0] = ConstBonusStatus.CAN_GET;
|
|
|
- }
|
|
|
- if (starCount >= storyChapterCfg.bonusStar2 && statusDic[1] == ConstBonusStatus.CAN_NOT_GET)
|
|
|
- {
|
|
|
- statusDic[1] = ConstBonusStatus.CAN_GET;
|
|
|
- }
|
|
|
- if (starCount >= storyChapterCfg.bonusStar3 && statusDic[2] == ConstBonusStatus.CAN_NOT_GET)
|
|
|
- {
|
|
|
- statusDic[2] = ConstBonusStatus.CAN_GET;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
public static bool CheckOpenMainUI()
|
|
|
{
|
|
|
return CheckLevelPass(1, 4) && GuideDataManager.GetGuideCountCopy(ConstGuideId.SINGLE_FIGHT) > 0;
|
|
@@ -204,7 +158,7 @@ namespace GFGGame
|
|
|
{
|
|
|
return false;
|
|
|
}
|
|
|
- if (StoryUtil.CheckChapterIsHard(chapterId))
|
|
|
+ if (CalculateHelper.CheckChapterIsHard(chapterId))
|
|
|
{
|
|
|
//对应普通剧情的章需要开启
|
|
|
if (!CheckNormalChapterPass(chapterId))
|
|
@@ -231,15 +185,7 @@ namespace GFGGame
|
|
|
{
|
|
|
int passChapter = GetPassChapter(chapterId);
|
|
|
int passLevel = GetPassLevel(chapterId);
|
|
|
- if (chapterId <= passChapter)
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- if (chapterId == passChapter + 1 && level <= passLevel)
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- return false;
|
|
|
+ return CalculateHelper.CheckLevelPass(chapterId, level, passChapter, passLevel);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -264,7 +210,7 @@ namespace GFGGame
|
|
|
return CheckLevelPass(currentChapter, currentLevel);
|
|
|
}
|
|
|
|
|
|
- public static int GetScoreHighest(string levelID)
|
|
|
+ public static int GetScoreHighest(int levelID)
|
|
|
{
|
|
|
if (_highestScoreDic.ContainsKey(levelID))
|
|
|
{
|
|
@@ -273,73 +219,57 @@ namespace GFGGame
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
- public static void GetStoryId(string levelIdStr, out int chapterIdP, out int levelIdP)
|
|
|
+ public static bool GetFightResult(int score, out int npcScore)
|
|
|
{
|
|
|
- string[] ids = levelIdStr.Split('_');
|
|
|
- chapterIdP = int.Parse(ids[0]);
|
|
|
- levelIdP = int.Parse(ids[1]);
|
|
|
- }
|
|
|
+ npcScore = 0;
|
|
|
+ bool equipedNeeded = EquipDataCache.cacher.CheckEquipedFightNeeded();
|
|
|
+ if (!equipedNeeded)
|
|
|
+ {
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("未穿必需物品");
|
|
|
+ return false;//没穿必需品
|
|
|
+ }
|
|
|
|
|
|
- public static int GetResultStarCount(int score)
|
|
|
- {
|
|
|
- if (!EquipDataCache.cacher.CheckEquipedFightNeeded())
|
|
|
+ int starCount = StoryDataManager.GetResultStarCount(score);
|
|
|
+ if (starCount <= 0)
|
|
|
{
|
|
|
- return 0;
|
|
|
+ return false;//低于一星
|
|
|
}
|
|
|
- return CalculateHelper.GetStoryChapterStar(currentLevelID, score);
|
|
|
- }
|
|
|
|
|
|
- public static int GetStarCountHistory(string levelID, int score)
|
|
|
- {
|
|
|
- int chapterIdT = 0;
|
|
|
- int levelIdT = 0;
|
|
|
- GetStoryId(levelID, out chapterIdT, out levelIdT);
|
|
|
- if (!CheckLevelPass(chapterIdT, levelIdT))
|
|
|
+ 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)
|
|
|
{
|
|
|
- return 0;
|
|
|
+ npcScore = EquipDataCache.cacher.npcTotalScore;
|
|
|
+ if(score < npcScore)
|
|
|
+ {
|
|
|
+ return false;//分数低于对战对象
|
|
|
+ }
|
|
|
}
|
|
|
- return CalculateHelper.GetStoryChapterStar(levelID, score);
|
|
|
- }
|
|
|
|
|
|
- public static bool CheckCurrentScoreEnough(int score)
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ public static int GetResultStarCount(int score)
|
|
|
{
|
|
|
- StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(currentLevelID);
|
|
|
- StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
|
|
|
- return (score > fightCfg.score1);
|
|
|
+ return CalculateHelper.GetStoryChapterStar(currentLevelCfgId, score);
|
|
|
}
|
|
|
|
|
|
- public static void SetScore(int score, int starCount)
|
|
|
+ public static int GetStarCountHistory(int levelID)
|
|
|
{
|
|
|
- int scoreHighest = 0;
|
|
|
- if (_highestScoreDic.ContainsKey(currentLevelID))
|
|
|
- {
|
|
|
- scoreHighest = _highestScoreDic[currentLevelID];
|
|
|
- }
|
|
|
- if (score > scoreHighest)
|
|
|
- {
|
|
|
- _highestScoreDic[currentLevelID] = score;
|
|
|
- GameProxy.ReqUpdateStoryScore(currentLevelID, score);
|
|
|
+ _starDic.TryGetValue(levelID, out var star);
|
|
|
+ return star;
|
|
|
+ }
|
|
|
|
|
|
- int starCountSaved = GetStarCountHistory(currentLevelID, scoreHighest);
|
|
|
- int starCountChapter = 0;
|
|
|
- if (_chapterStarCountDic.ContainsKey(currentChapter))
|
|
|
- {
|
|
|
- starCountChapter = _chapterStarCountDic[currentChapter];
|
|
|
- }
|
|
|
- if (starCount > starCountSaved)
|
|
|
- {
|
|
|
- starCountChapter = starCountChapter + starCount - starCountSaved;
|
|
|
- _chapterStarCountDic[currentChapter] = starCountChapter;
|
|
|
- UpdateChapterBonusStatus(currentChapter, starCountChapter);
|
|
|
- string boxStatus = GetBoxStatus(currentChapter);
|
|
|
- GameProxy.ReqUpdateStoryStar(currentChapter, starCountChapter, boxStatus);
|
|
|
- }
|
|
|
- }
|
|
|
+ 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 GetPassChapter(int fromChapter)
|
|
|
{
|
|
|
- if (StoryUtil.CheckChapterIsHard(fromChapter))
|
|
|
+ if (CalculateHelper.CheckChapterIsHard(fromChapter))
|
|
|
{
|
|
|
return GameGlobal.myNumericComponent.GetAsInt(NumericType.ChapterJY);
|
|
|
}
|
|
@@ -348,7 +278,7 @@ namespace GFGGame
|
|
|
|
|
|
public static int GetPassLevel(int fromChapter)
|
|
|
{
|
|
|
- if (StoryUtil.CheckChapterIsHard(fromChapter))
|
|
|
+ if (CalculateHelper.CheckChapterIsHard(fromChapter))
|
|
|
{
|
|
|
return GameGlobal.myNumericComponent.GetAsInt(NumericType.ChapterLvlJY);
|
|
|
}
|
|
@@ -360,93 +290,81 @@ namespace GFGGame
|
|
|
fistPassLastLvl = false;
|
|
|
curLvfirstPass = false;
|
|
|
List<ItemData> currentBonusList = new List<ItemData>();
|
|
|
- if (!CheckCurrentLevelPass())
|
|
|
- {
|
|
|
- curLvfirstPass = true;
|
|
|
- int tempPassLevel = currentLevel;
|
|
|
- int tempPassChapter = GetPassChapter(currentChapter);
|
|
|
- int nextLevel = currentLevel + 1;
|
|
|
- string nextLevelID = currentChapter + "_" + nextLevel;
|
|
|
- StoryLevelCfg nextLevelCfg = StoryLevelCfgArray.Instance.GetCfg(nextLevelID);
|
|
|
- if (nextLevelCfg == null)
|
|
|
- {
|
|
|
- tempPassChapter = currentChapter;
|
|
|
- tempPassLevel = 0;
|
|
|
- fistPassLastLvl = true;
|
|
|
- }
|
|
|
- SetPassData(tempPassChapter, tempPassLevel);
|
|
|
- //GameProxy.ReqUpdateStoryProgress(_passChapter, _passLevel, _passChapterJY, _passLevelJY);
|
|
|
- currentBonusList = StoryBonusDataCache.GetBonusList(currentLevelID, true, true);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- currentBonusList = StoryBonusDataCache.GetBonusList(currentLevelID, false, true);
|
|
|
- }
|
|
|
- StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelID);
|
|
|
- //消耗体力
|
|
|
- if (currentBonusList != null && currentBonusList.Count > 0)
|
|
|
- {
|
|
|
- if (GameGlobal.myNumericComponent.GetAsInt(NumericType.Power) >= levelCfg.power)
|
|
|
- {
|
|
|
- RoleDataManager.power -= levelCfg.power;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- RoleDataManager.power = 0;
|
|
|
- }
|
|
|
- }
|
|
|
+ //if (!CheckCurrentLevelPass())
|
|
|
+ //{
|
|
|
+ // curLvfirstPass = true;
|
|
|
+ // int tempPassLevel = currentLevel;
|
|
|
+ // int tempPassChapter = GetPassChapter(currentChapter);
|
|
|
+ // int nextLevel = currentLevel + 1;
|
|
|
+ // int nextLevelID = currentChapter*GameConst.STORY_LEVEL_KEY_NUM + nextLevel;
|
|
|
+ // StoryLevelCfg nextLevelCfg = StoryLevelCfgArray.Instance.GetCfg(nextLevelID);
|
|
|
+ // if (nextLevelCfg == null)
|
|
|
+ // {
|
|
|
+ // tempPassChapter = currentChapter;
|
|
|
+ // tempPassLevel = 0;
|
|
|
+ // fistPassLastLvl = true;
|
|
|
+ // }
|
|
|
+ //SetPassData(tempPassChapter, tempPassLevel);
|
|
|
+ //GameProxy.ReqUpdateStoryProgress(_passChapter, _passLevel, _passChapterJY, _passLevelJY);
|
|
|
+ //currentBonusList = StoryBonusDataCache.GetBonusList(currentLevelID, true, true);
|
|
|
+ //}
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ //currentBonusList = StoryBonusDataCache.GetBonusList(currentLevelID, false, true);
|
|
|
+ //}
|
|
|
+ //StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelID);
|
|
|
+ ////消耗体力
|
|
|
+ //if (currentBonusList != null && currentBonusList.Count > 0)
|
|
|
+ //{
|
|
|
+ // if (GameGlobal.myNumericComponent.GetAsInt(NumericType.Power) >= levelCfg.power)
|
|
|
+ // {
|
|
|
+ // RoleDataManager.power -= levelCfg.power;
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // RoleDataManager.power = 0;
|
|
|
+ // }
|
|
|
+ //}
|
|
|
//消耗推荐次数
|
|
|
- if (usedRecommend)
|
|
|
- {
|
|
|
- usedRecommend = false;
|
|
|
- _recommendCount--;
|
|
|
- GameProxy.ReqUpdateRecommendCount(_recommendCount);
|
|
|
- }
|
|
|
+ //if (usedRecommend)
|
|
|
+ //{
|
|
|
+ // usedRecommend = false;
|
|
|
+ // //_recommendCount--;
|
|
|
+ // //GameProxy.ReqUpdateRecommendCount(_recommendCount);
|
|
|
+ //}
|
|
|
//经验奖励
|
|
|
- if (levelCfg.fightID != null && levelCfg.fightID.Length > 0)
|
|
|
- {
|
|
|
- StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
|
|
|
- RoleDataManager.exp += fightCfg.exp;
|
|
|
- }
|
|
|
- foreach (ItemData itemData in currentBonusList)
|
|
|
- {
|
|
|
- ItemDataManager.Add(itemData.id, itemData.num);
|
|
|
- }
|
|
|
+ //if (levelCfg.fightID != null && levelCfg.fightID.Length > 0)
|
|
|
+ //{
|
|
|
+ // StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
|
|
|
+ // RoleDataManager.exp += fightCfg.exp;
|
|
|
+ //}
|
|
|
+ //foreach (ItemData itemData in currentBonusList)
|
|
|
+ //{
|
|
|
+ // ItemDataManager.Add(itemData.id, itemData.num);
|
|
|
+ //}
|
|
|
return currentBonusList;
|
|
|
}
|
|
|
|
|
|
public static int GetChapterStarCount(int chapterID)
|
|
|
{
|
|
|
- if (_chapterStarCountDic.ContainsKey(chapterID))
|
|
|
+ var star = 0;
|
|
|
+ foreach(var item in _starDic)
|
|
|
{
|
|
|
- return _chapterStarCountDic[chapterID];
|
|
|
+ var tempChapter = item.Key / GameConst.STORY_LEVEL_KEY_NUM;
|
|
|
+ if(tempChapter == chapterID)
|
|
|
+ {
|
|
|
+ star += item.Value;
|
|
|
+ }
|
|
|
}
|
|
|
- return 0;
|
|
|
+ return star;
|
|
|
}
|
|
|
|
|
|
- public static int GetCanFightTime(string levelID)
|
|
|
+ public static int GetCanFightTime(int levelID)
|
|
|
{
|
|
|
StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(levelID);
|
|
|
- int time = (int)Math.Floor((float)GameGlobal.myNumericComponent.GetAsInt(NumericType.Power) / levelCfg.power);
|
|
|
- return time;
|
|
|
+ int times = (int)Math.Floor((float)GameGlobal.myNumericComponent.GetAsInt(NumericType.Power) / levelCfg.power);
|
|
|
+ return times;
|
|
|
}
|
|
|
|
|
|
- private static string GetBoxStatus(int chapterId)
|
|
|
- {
|
|
|
- string boxStatus = "0;0;0";
|
|
|
- if (_chapterBonusDic.ContainsKey(chapterId))
|
|
|
- {
|
|
|
- boxStatus = "{0};{1};{2}";
|
|
|
- Dictionary<int, int> tempDic = _chapterBonusDic[chapterId];
|
|
|
- int value0 = GetChapterBonusStatus(chapterId, 0);
|
|
|
- int value1 = GetChapterBonusStatus(chapterId, 1);
|
|
|
- int value2 = GetChapterBonusStatus(chapterId, 2);
|
|
|
- boxStatus = string.Format(boxStatus, value0, value1, value2);
|
|
|
- }
|
|
|
- return boxStatus;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
}
|