mirror of
https://github.com/MikuLeaks/MikuSB.git
synced 2026-06-04 06:43:57 +00:00
VirCaptureTower_EnterLevel
This commit is contained in:
44
Common/Data/Excel/VirCaptureTowerExcel.cs
Normal file
44
Common/Data/Excel/VirCaptureTowerExcel.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace MikuSB.Data.Excel;
|
||||
|
||||
[ResourceEntity("dlc/vircapture/tower.json")]
|
||||
public class VirCaptureTowerExcel : ExcelResource
|
||||
{
|
||||
[JsonProperty("ID")] public uint Id { get; set; }
|
||||
[JsonProperty("Condition")] public JToken? ConditionRaw { get; set; }
|
||||
[JsonProperty("MapID")] public uint MapId { get; set; }
|
||||
[JsonProperty("TrialCard")] public List<uint> TrialCard { get; set; } = [];
|
||||
[JsonProperty("TaskPath")] public string TaskPath { get; set; } = "";
|
||||
|
||||
[JsonIgnore]
|
||||
public Dictionary<int, uint> Condition { get; } = [];
|
||||
|
||||
public override uint GetId() => Id;
|
||||
|
||||
public override void Loaded()
|
||||
{
|
||||
Condition.Clear();
|
||||
if (ConditionRaw is JObject obj)
|
||||
{
|
||||
foreach (var property in obj.Properties())
|
||||
{
|
||||
if (!int.TryParse(property.Name, out var key))
|
||||
continue;
|
||||
|
||||
uint value = 0;
|
||||
if (property.Value.Type == JTokenType.Integer)
|
||||
value = property.Value.Value<uint>();
|
||||
else if (property.Value.Type == JTokenType.String &&
|
||||
uint.TryParse(property.Value.Value<string>(), out var parsed))
|
||||
value = parsed;
|
||||
|
||||
if (value > 0)
|
||||
Condition[key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
GameData.VirCaptureTowerData[Id] = this;
|
||||
}
|
||||
}
|
||||
@@ -57,6 +57,7 @@ public static class GameData
|
||||
public static Dictionary<uint, VirCaptureLevelListExcel> VirCaptureLevelListData { get; private set; } = [];
|
||||
public static Dictionary<ulong, MonsterCardExcel> MonsterCardData { get; private set; } = [];
|
||||
public static Dictionary<uint, FishingFoodExcel> FishingFoodData { get; private set; } = [];
|
||||
public static Dictionary<uint, VirCaptureTowerExcel> VirCaptureTowerData { get; private set; } = [];
|
||||
}
|
||||
|
||||
public static class GameResourceTemplateId
|
||||
|
||||
Reference in New Issue
Block a user