From 2e2469cf0051ca1eb3897cf59a45ecc04c2d9d16 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sat, 10 May 2025 17:45:59 +0200 Subject: [PATCH] Added GachaWeaponPoolTable but weapons banners not work (idk why) --- Campofinale/Packets/Sc/PacketScGachaSync.cs | 44 ++++++++++++++++++- Campofinale/Resource/ResourceManager.cs | 8 +++- .../Resource/Table/GachaWeaponPoolTable.cs | 11 +++++ 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 Campofinale/Resource/Table/GachaWeaponPoolTable.cs diff --git a/Campofinale/Packets/Sc/PacketScGachaSync.cs b/Campofinale/Packets/Sc/PacketScGachaSync.cs index 92a9137..c1c4601 100644 --- a/Campofinale/Packets/Sc/PacketScGachaSync.cs +++ b/Campofinale/Packets/Sc/PacketScGachaSync.cs @@ -30,8 +30,50 @@ namespace Campofinale.Packets.Sc WeaponGachaPool = new() { - } + }, + }; + foreach(var item in gachaWeaponPoolTable) + { + (int fiveStarPity, int sixStarPity, GachaTransaction? lastSixStar, bool isFiftyFiftyLost) + PityInfo = client.gachaManager.GetCurrentPity(item.Value.id); + ScdGachaPoolInfo wPool = new ScdGachaPoolInfo() + { + GachaPoolId = item.Value.id, + IsClosed = false, + CloseTime = DateTime.UtcNow.AddDays(20).ToUnixTimestampMilliseconds() / 1000, + OpenTime = DateTime.UtcNow.ToUnixTimestampMilliseconds() / 1000, + PublicCloseReason = 0, + + + }; + if (item.Value.closeTimes.Count == 0) + { + wPool.CloseTime = 0; + wPool.OpenTime = 0; + } + proto.WeaponGachaPool.GachaPoolInfos.Add(wPool); + proto.WeaponGachaPool.GachaPoolRoleDatas.Add(new ScdGachaPoolRoleData() + { + GachaPoolId = item.Value.id, + IsClosed = false, + PersonalCloseReason = 0, + SoftGuaranteeProgress = PityInfo.sixStarPity, + TotalPullCount = PityInfo.sixStarPity, + Star5SoftGuaranteeProgress = PityInfo.fiveStarPity, + HardGuaranteeProgress = PityInfo.sixStarPity, + + }); + proto.WeaponGachaPool.GachaPoolCategoryRoleDatas.Add(new ScdGachaPoolCategoryRoleData() + { + GachaPoolType = item.Value.type, + TotalPullCount = PityInfo.sixStarPity, + Star5SoftGuaranteeProgress = PityInfo.fiveStarPity, + SoftGuaranteeProgress = PityInfo.sixStarPity, + + }); + + } //TODO: Implement banner config for opentime etc foreach (var item in gachaCharPoolTable) { diff --git a/Campofinale/Resource/ResourceManager.cs b/Campofinale/Resource/ResourceManager.cs index 4c76a71..5583c83 100644 --- a/Campofinale/Resource/ResourceManager.cs +++ b/Campofinale/Resource/ResourceManager.cs @@ -37,15 +37,19 @@ namespace Campofinale.Resource public static Dictionary itemTable = new(); public static Dictionary domainDataTable = new(); public static Dictionary collectionTable = new(); - public static Dictionary gachaCharPoolTable = new(); public static Dictionary charBreakNodeTable = new(); public static Dictionary enemyAttributeTemplateTable = new(); public static Dictionary charLevelUpTable = new(); public static Dictionary expItemDataMap = new(); public static Dictionary charGrowthTable = new(); public static Dictionary weaponUpgradeTemplateTable = new(); + //Gacha + public static Dictionary gachaCharPoolTable = new(); public static Dictionary gachaCharPoolContentTable = new(); public static Dictionary gachaCharPoolTypeTable = new(); + + public static Dictionary gachaWeaponPoolTable = new(); + // public static Dictionary enemyTable = new(); public static Dictionary equipTable = new(); public static Dictionary equipSuitTable = new(); @@ -63,6 +67,8 @@ namespace Campofinale.Resource public static Dictionary itemTypeTable = new(); // public static Dictionary snsChatTable = new();// public static Dictionary giftItemTable = new(); + public static Dictionary missionDataTable = new(); + public static InteractiveTable interactiveTable = new(); // public static List levelDatas = new(); public static List interactiveData = new(); diff --git a/Campofinale/Resource/Table/GachaWeaponPoolTable.cs b/Campofinale/Resource/Table/GachaWeaponPoolTable.cs new file mode 100644 index 0000000..fb1be48 --- /dev/null +++ b/Campofinale/Resource/Table/GachaWeaponPoolTable.cs @@ -0,0 +1,11 @@ +namespace Campofinale.Resource.Table +{ + [TableCfgType("TableCfg/GachaWeaponPoolTable.json", LoadPriority.LOW)] + public class GachaWeaponPoolTable + { + public string id; + public int type; + public List upWeaponIds; + public List closeTimes; + } +}