mirror of
https://github.com/MikuLeaks/MikuSB.git
synced 2026-06-04 06:23:58 +00:00
Implement BossPvP logic (I implemented this based on undownding's code. Thank you!)
This commit is contained in:
32
Common/Data/Excel/BossPvpBossChallengeExcel.cs
Normal file
32
Common/Data/Excel/BossPvpBossChallengeExcel.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Globalization;
|
||||
|
||||
namespace MikuSB.Data.Excel;
|
||||
|
||||
[ResourceEntity("challenge/bosspvp/boss_challenge.json")]
|
||||
public class BossPvpBossChallengeExcel : ExcelResource
|
||||
{
|
||||
public uint ID { get; set; }
|
||||
public string StartTime { get; set; } = "";
|
||||
public string EndTime { get; set; } = "";
|
||||
public List<uint> tbTaskID { get; set; } = [];
|
||||
|
||||
[JsonExtensionData] public IDictionary<string, JToken> ExtraData { get; set; } = new Dictionary<string, JToken>();
|
||||
|
||||
[JsonIgnore] public List<uint> BossIds { get; private set; } = [];
|
||||
|
||||
public override uint GetId() => ID;
|
||||
|
||||
public override void Loaded()
|
||||
{
|
||||
BossIds = ExtraData
|
||||
.Where(x => x.Key.StartsWith("Boss", StringComparison.Ordinal) && int.TryParse(x.Key[4..], out _))
|
||||
.OrderBy(x => int.Parse(x.Key[4..], CultureInfo.InvariantCulture))
|
||||
.Select(x => x.Value.Type == JTokenType.Integer ? x.Value.Value<uint>() : 0u)
|
||||
.Where(x => x > 0)
|
||||
.ToList();
|
||||
|
||||
GameData.BossPvpBossChallengeData[ID] = this;
|
||||
}
|
||||
}
|
||||
17
Common/Data/Excel/BossPvpBossExcel.cs
Normal file
17
Common/Data/Excel/BossPvpBossExcel.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace MikuSB.Data.Excel;
|
||||
|
||||
[ResourceEntity("challenge/bosspvp/boss.json")]
|
||||
public class BossPvpBossExcel : ExcelResource
|
||||
{
|
||||
public uint ID { get; set; }
|
||||
public uint LevelID { get; set; }
|
||||
public uint BossID { get; set; }
|
||||
public List<List<int>> BossLevel { get; set; } = [];
|
||||
|
||||
public override uint GetId() => ID;
|
||||
|
||||
public override void Loaded()
|
||||
{
|
||||
GameData.BossPvpBossData[ID] = this;
|
||||
}
|
||||
}
|
||||
15
Common/Data/Excel/BossPvpNumExcel.cs
Normal file
15
Common/Data/Excel/BossPvpNumExcel.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace MikuSB.Data.Excel;
|
||||
|
||||
[ResourceEntity("challenge/bosspvp/num.json")]
|
||||
public class BossPvpNumExcel : ExcelResource
|
||||
{
|
||||
public uint Week { get; set; }
|
||||
public uint Num { get; set; }
|
||||
|
||||
public override uint GetId() => Week;
|
||||
|
||||
public override void Loaded()
|
||||
{
|
||||
GameData.BossPvpNumData[Week] = this;
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,9 @@ public static class GameData
|
||||
public static Dictionary<int, SupportFixedExcel> SupportFixedData { get; private set; } = [];
|
||||
public static Dictionary<uint, WeaponSkinExcel> WeaponSkinData { get; private set; } = [];
|
||||
public static Dictionary<uint, DailyLevelExcel> DailyLevelData { get; private set; } = [];
|
||||
public static Dictionary<uint, BossPvpBossChallengeExcel> BossPvpBossChallengeData { get; private set; } = [];
|
||||
public static Dictionary<uint, BossPvpBossExcel> BossPvpBossData { get; private set; } = [];
|
||||
public static Dictionary<uint, BossPvpNumExcel> BossPvpNumData { get; private set; } = [];
|
||||
public static Dictionary<uint, ProfileExcel> ProfileData { get; private set; } = [];
|
||||
public static Dictionary<uint, CardSkinPartsExcel> CardSkinPartsData { get; private set; } = [];
|
||||
public static Dictionary<uint, CallItemExcel> CallItemData { get; private set; } = [];
|
||||
|
||||
Reference in New Issue
Block a user