mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-15 16:34:40 +01:00
Implement stage skipping
This commit is contained in:
@@ -26,6 +26,7 @@ namespace nksrv.StaticInfo
|
||||
/// Can be Normal or Hard
|
||||
/// </summary>
|
||||
public string chapter_mod = "";
|
||||
public string stage_type = "";
|
||||
}
|
||||
public class RewardTableRecord
|
||||
{
|
||||
|
||||
@@ -448,5 +448,22 @@ namespace nksrv.StaticInfo
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
internal IEnumerable<int> GetStageIdsForChapter(int chapterNumber, bool normal)
|
||||
{
|
||||
string mod = normal ? "Normal" : "Hard";
|
||||
foreach (JObject item in stageDataRecords)
|
||||
{
|
||||
CampaignStageRecord? data = JsonConvert.DeserializeObject<CampaignStageRecord>(item.ToString());
|
||||
if (data == null) throw new Exception("failed to deserialize stage data");
|
||||
|
||||
int chVal = data.chapter_id - 1;
|
||||
|
||||
if (chapterNumber == chVal && data.chapter_mod == mod && data.stage_type == "Main")
|
||||
{
|
||||
yield return data.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user