1
0
mirror of synced 2025-02-20 20:41:46 +01:00

Locked puchicharas are now buyable using medals/coins ingame

This commit is contained in:
0aubsq 2022-02-06 13:59:32 +01:00
parent f2e132a08e
commit 5b2f18f0ea
3 changed files with 20 additions and 3 deletions

View File

@ -171,6 +171,14 @@ namespace TJAPlayer3
[JsonProperty("namePlateTitles")]
public Dictionary<string, CNamePlateTitle>[] NamePlateTitles = new Dictionary<string, CNamePlateTitle>[2];
[JsonProperty("unlockedPuchicharas")]
public List<int>[] UnlockedPuchicharas = new List<int>[2]
{
new List<int>(),
new List<int>()
};
}
public Data data = new Data();

View File

@ -469,6 +469,12 @@ namespace TJAPlayer3
iCurrentMenu = -1;
this.tResetOpts();
}
else if (ess == ESelectStatus.SUCCESS)
{
TJAPlayer3.NamePlateConfig.data.UnlockedPuchicharas[iPlayer].Add(iPuchiCharaCurrent);
TJAPlayer3.NamePlateConfig.tSpendCoins(puchiUnlockables[iPuchiCharaCurrent].Values[0], iPlayer);
}
}
else if (iCurrentMenu == 1)
@ -639,7 +645,8 @@ namespace TJAPlayer3
{
#region [Check unlockable]
if (puchiUnlockables.ContainsKey(iPuchiCharaCurrent))
if (puchiUnlockables.ContainsKey(iPuchiCharaCurrent)
&& !TJAPlayer3.NamePlateConfig.data.UnlockedPuchicharas[iPlayer].Contains(iPuchiCharaCurrent))
{
// To update then when bought unlockables will be implemented
this.ttkInfoSection = new TitleTextureKey(puchiUnlockables[iPuchiCharaCurrent].tConditionMessage()
@ -654,8 +661,10 @@ namespace TJAPlayer3
private ESelectStatus tSelectPuchi()
{
// Add "If unlocked" to select directly
if (puchiUnlockables.ContainsKey(iPuchiCharaCurrent))
if (puchiUnlockables.ContainsKey(iPuchiCharaCurrent)
&& !TJAPlayer3.NamePlateConfig.data.UnlockedPuchicharas[iPlayer].Contains(iPuchiCharaCurrent))
{
(bool, string) response = puchiUnlockables[iPuchiCharaCurrent].tConditionMet(new int[]{ TJAPlayer3.NamePlateConfig.data.Medals[TJAPlayer3.SaveFile] } );
Color responseColor = (response.Item1) ? Color.Lime : Color.Red;
@ -666,7 +675,7 @@ namespace TJAPlayer3
return (response.Item1) ? ESelectStatus.SUCCESS : ESelectStatus.FAILED;
}
this.ttkInfoSection = null;
return ESelectStatus.SELECTED;
}

Binary file not shown.