mirror of
https://github.com/MikuLeaks/MikuSB.git
synced 2026-06-04 04:03:58 +00:00
add all support card
This commit is contained in:
18
Common/Data/Excel/SupportCardExcel.cs
Normal file
18
Common/Data/Excel/SupportCardExcel.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace MikuSB.Data.Excel;
|
||||
|
||||
[ResourceEntity("support_card.json")]
|
||||
public class SupportCardExcel : 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 override uint GetId() => Icon;
|
||||
|
||||
public override void Loaded()
|
||||
{
|
||||
GameData.SupportCardData.Add(this);
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@ public static class GameData
|
||||
public static Dictionary<uint, Rogue3DDifficultExcel> Rogue3DDifficultData { get; private set; } = [];
|
||||
public static Dictionary<uint, SpineExcel> SpineData { get; private set; } = [];
|
||||
public static Dictionary<uint, NodeConditionExcel> NodeConditionData { get; private set; } = [];
|
||||
public static List<SupportCardExcel> SupportCardData { get; private set; } = [];
|
||||
}
|
||||
|
||||
public static class GameResourceTemplateId
|
||||
|
||||
@@ -110,6 +110,26 @@ public class InventoryManager(PlayerInstance player) : BasePlayerManager(player)
|
||||
return arInfo;
|
||||
}
|
||||
|
||||
public async ValueTask<BaseGameItemInfo?> AddSupportCardItem(uint detail, uint particular, uint level = 1, bool sendPacket = true)
|
||||
{
|
||||
const ItemTypeEnum genre = ItemTypeEnum.TYPE_SUPPORT;
|
||||
var templateId = GameResourceTemplateId.FromGdpl((uint)genre, detail, particular, level);
|
||||
if (InventoryData.Items.Values.Any(x => x.TemplateId == templateId)) return null;
|
||||
|
||||
var info = new BaseGameItemInfo
|
||||
{
|
||||
TemplateId = templateId,
|
||||
UniqueId = InventoryData.NextUniqueUid++,
|
||||
ItemType = genre,
|
||||
ItemCount = 1
|
||||
};
|
||||
InventoryData.Items[info.UniqueId] = info;
|
||||
|
||||
if (sendPacket) await Player.SendPacket(new PacketNtfCallScript([info]));
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
public async ValueTask<BaseGameItemInfo?> AddManifestationItem(ItemTypeEnum genre, uint detail, uint particular, uint level = 1, bool sendPacket = true)
|
||||
{
|
||||
if (genre != ItemTypeEnum.TYPE_MANIFESTATION) return null;
|
||||
|
||||
@@ -66,6 +66,10 @@ public class PlayerInstance(PlayerGameData data)
|
||||
{
|
||||
await CharacterManager.AddCharacter((ItemTypeEnum)card.Genre, card.Detail, card.Particular, card.Level, sendPacket:false);
|
||||
}
|
||||
foreach (var sc in GameData.SupportCardData)
|
||||
{
|
||||
await InventoryManager.AddSupportCardItem(sc.Detail, sc.Particular, sc.Level, sendPacket: false);
|
||||
}
|
||||
foreach (var supplies in GameData.AllSuppliesData)
|
||||
{
|
||||
await InventoryManager.AddSuppliesItem(supplies, 90000, false);
|
||||
|
||||
Reference in New Issue
Block a user