From 1e5c1240333315187a53addc1165b9c5732f2c21 Mon Sep 17 00:00:00 2001 From: Mikhail Date: Wed, 25 Sep 2024 18:36:22 -0400 Subject: [PATCH] fix gacha system giving already existing characters --- EpinelPS/Database/JsonDb.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/EpinelPS/Database/JsonDb.cs b/EpinelPS/Database/JsonDb.cs index c0f84da..870e3da 100644 --- a/EpinelPS/Database/JsonDb.cs +++ b/EpinelPS/Database/JsonDb.cs @@ -123,7 +123,11 @@ namespace EpinelPS.Database public NetJukeboxLocation Location; public NetJukeboxBgmType Type; public int TableId; + } + public class MogMinigameInfo + { + public List CompletedScenarios = []; } public class User { @@ -192,11 +196,11 @@ namespace EpinelPS.Database public JukeBoxSetting LobbyMusic = new() { Location = NetJukeboxLocation.NetJukeboxLocationLobby, TableId = 2, Type = NetJukeboxBgmType.NetJukeboxBgmTypeJukeboxTableId }; public JukeBoxSetting CommanderMusic = new() { Location = NetJukeboxLocation.NetJukeboxLocationCommanderRoom, TableId = 5, Type = NetJukeboxBgmType.NetJukeboxBgmTypeJukeboxTableId }; + public OutpostBuffs OutpostBuffs = new(); // Event data public Dictionary EventInfo = new(); - - public OutpostBuffs OutpostBuffs = new(); + public MogMinigameInfo MogInfo = new(); public void SetQuest(int tid, bool recievedReward) { @@ -291,7 +295,7 @@ namespace EpinelPS.Database public bool HasCharacter(int c) { - return Characters.Any(x => x.Tid == c); + return Characters.Any(x => c <= x.Tid && x.Tid <= c + 12); } public Character? GetCharacterBySerialNumber(long value)