Add character & inventory manager

This commit is contained in:
Naruse
2026-04-21 14:39:26 +08:00
parent c98fa7efa6
commit 7a8cab5723
16 changed files with 558 additions and 53 deletions

View File

@@ -0,0 +1,31 @@
using Newtonsoft.Json;
namespace MikuSB.Data.Excel;
[ResourceEntity("card.json")]
public class CardExcel : ExcelResource
{
public uint Genre { get; set; }
public uint Detail { get; set; }
public uint Particular { get; set; }
public uint Level { get; set; }
public uint Icon { get; set; }
public uint InitBreak { get; set; }
public int BreakMatID { get; set; }
public int LevelLimitID { get; set; }
public int GrowupID { get; set; }
public int AppearID { get; set; }
public List<uint> DefaultWeaponGPDL { get; set; } = [];
[JsonProperty("profile")] public List<List<int>> Profile { get; set; } = [];
public List<List<int>> Pieces { get; set; } = [];
public List<int> Attribute { get; set; } = [];
public override uint GetId()
{
return Icon;
}
public override void Loaded()
{
GameData.CardData.Add(Icon, this);
}
}

View File

@@ -0,0 +1,24 @@
using Newtonsoft.Json;
namespace MikuSB.Data.Excel;
[ResourceEntity("card_skin.json")]
public class CardSkinExcel : ExcelResource
{
public uint Genre { get; set; }
public uint Detail { get; set; }
public uint Particular { get; set; }
public uint Level { get; set; }
public uint Icon { get; set; }
public int AppearID { get; set; }
[JsonProperty("profile")] public List<List<int>> Profile { get; set; } = [];
public override uint GetId()
{
return Icon;
}
public override void Loaded()
{
GameData.CardSkinData.Add(Icon, this);
}
}

View File

@@ -0,0 +1,29 @@
namespace MikuSB.Data.Excel;
[ResourceEntity("weapon.json")]
public class WeaponExcel : ExcelResource
{
public uint Genre { get; set; }
public uint Detail { get; set; }
public uint Particular { get; set; }
public uint Level { get; set; }
public int Class { get; set; }
public uint Icon { get; set; }
public int EvolutionMatID { get; set; }
public int BreakMatID { get; set; }
public int LevelLimitID { get; set; }
public int BreakLimitID { get; set; }
public int AppearID { get; set; }
public List<int> DefaultSkillID { get; set; } = [];
public List<int> WeaponPartsLimit { get; set; } = [];
public string I18n { get; set; } = "";
public override uint GetId()
{
return (uint)I18n.GetHashCode();
}
public override void Loaded()
{
GameData.WeaponData.Add(GetId(), this);
}
}

View File

@@ -1,5 +1,19 @@
namespace MikuSB.Data;
using MikuSB.Data.Excel;
namespace MikuSB.Data;
public static class GameData
{
public static Dictionary<uint, CardExcel> CardData { get; private set; } = [];
public static Dictionary<uint, WeaponExcel> WeaponData { get; private set; } = [];
public static Dictionary<uint, CardSkinExcel> CardSkinData { get; private set; } = [];
}
public static class GameResourceTemplateId
{
public static ulong FromGdpl(uint genre, uint detail, uint particular, uint level) =>
((ulong)genre << 48) | ((ulong)detail << 32) | ((ulong)particular << 16) | level;
public static ulong FromGdpl(IReadOnlyList<uint> gdpl) =>
gdpl.Count >= 4 ? FromGdpl(gdpl[0], gdpl[1], gdpl[2], gdpl[3]) : 0;
}