mirror of
https://github.com/MikuLeaks/MikuSB.git
synced 2026-06-04 08:04:01 +00:00
Add character & inventory manager
This commit is contained in:
31
Common/Data/Excel/CardExcel.cs
Normal file
31
Common/Data/Excel/CardExcel.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
24
Common/Data/Excel/CardSkinExcel.cs
Normal file
24
Common/Data/Excel/CardSkinExcel.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
29
Common/Data/Excel/WeaponExcel.cs
Normal file
29
Common/Data/Excel/WeaponExcel.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user