From 1d1ebf14cad077474e671baf8c34e4bdbfc1a933 Mon Sep 17 00:00:00 2001 From: 0auBSQ <58159635+0auBSQ@users.noreply.github.com> Date: Fri, 1 Nov 2024 19:53:18 +0900 Subject: [PATCH] 0.6.0.13 - Unlockables with fulfilled conditions can be obtained directly on the select screen/my room by Decide input - Unlockables with fulfilled conditions can be obtained directly on the select screen/my room by Decide input --- OpenTaiko/src/Databases/DBUnlockables.cs | 32 +++++++++++++++++++ .../src/Stages/05.SongSelect/CStage選曲.cs | 3 +- OpenTaiko/src/Stages/11.Heya/CStageHeya.cs | 6 ++-- OpenTaiko/src/Stages/CActNewHeya.cs | 7 ++-- 4 files changed, 42 insertions(+), 6 deletions(-) diff --git a/OpenTaiko/src/Databases/DBUnlockables.cs b/OpenTaiko/src/Databases/DBUnlockables.cs index ae7cb594..f58afdc2 100644 --- a/OpenTaiko/src/Databases/DBUnlockables.cs +++ b/OpenTaiko/src/Databases/DBUnlockables.cs @@ -187,6 +187,22 @@ class DBUnlockables { this.Type = "me"; bool fulfiled = this.tValueRequirementMet(inputValues[0], this.Values[0]); return (fulfiled, CLangManager.LangInstance.GetString(fulfiled ? "UNLOCK_COIN_BOUGHT" : "UNLOCK_COIN_MORE")); + case "ce": + case "tp": + case "ap": + case "aw": + case "sd": + fulfiled = this.tValueRequirementMet(inputValues[0], this.Values[0]); + return (fulfiled, null); + case "dp": + case "lp": + fulfiled = this.tValueRequirementMet(inputValues[0], this.Values[2]); + return (fulfiled, null); + case "sp": + case "sg": + case "sc": + fulfiled = this.tValueRequirementMet(inputValues[0], this.Reference.Length); + return (fulfiled, null); default: return (false, null); // Return the same text if my room } @@ -239,6 +255,22 @@ class DBUnlockables { this.Type = "me"; bool fulfiled = this.tValueRequirementMet(inputValues[0], this.Values[0]); return (fulfiled, CLangManager.LangInstance.GetString(fulfiled ? "UNLOCK_COIN_BOUGHT" : "UNLOCK_COIN_MORE")); + case "ce": + case "tp": + case "ap": + case "aw": + case "sd": + fulfiled = this.tValueRequirementMet(inputValues[0], this.Values[0]); + return (fulfiled, null); + case "dp": + case "lp": + fulfiled = this.tValueRequirementMet(inputValues[0], this.Values[2]); + return (fulfiled, null); + case "sp": + case "sg": + case "sc": + fulfiled = this.tValueRequirementMet(inputValues[0], this.Reference.Length); + return (fulfiled, null); default: return (false, null); } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CStage選曲.cs b/OpenTaiko/src/Stages/05.SongSelect/CStage選曲.cs index d821b8de..33cf8399 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CStage選曲.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CStage選曲.cs @@ -871,7 +871,8 @@ internal class CStage選曲 : CStage { "unlocked_songs", this.rNowSelectedSong?.tGetUniqueId() ?? "" // Can't be null in this context ); - OpenTaiko.SaveFileInstances[OpenTaiko.SaveFile].tSpendCoins(SongToUnlock.unlockConditions.Values[0]); + if (SongToUnlock.unlockConditions.Condition == "cm") + OpenTaiko.SaveFileInstances[OpenTaiko.SaveFile].tSpendCoins(SongToUnlock.unlockConditions.Values[0]); // Play modal animation here ? } else OpenTaiko.Skin.soundError.tPlay(); diff --git a/OpenTaiko/src/Stages/11.Heya/CStageHeya.cs b/OpenTaiko/src/Stages/11.Heya/CStageHeya.cs index acb2f0a2..2067a697 100644 --- a/OpenTaiko/src/Stages/11.Heya/CStageHeya.cs +++ b/OpenTaiko/src/Stages/11.Heya/CStageHeya.cs @@ -569,7 +569,8 @@ class CStageHeya : CStage { //TJAPlayer3.NamePlateConfig.tSpendCoins(TJAPlayer3.Tx.Puchichara[iPuchiCharaCurrent].unlock.Values[0], iPlayer); OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedPuchicharas.Add(OpenTaiko.Skin.Puchicharas_Name[iPuchiCharaCurrent]); DBSaves.RegisterStringUnlockedAsset(OpenTaiko.SaveFileInstances[iPlayer].data.SaveId, "unlocked_puchicharas", OpenTaiko.Skin.Puchicharas_Name[iPuchiCharaCurrent]); - OpenTaiko.SaveFileInstances[iPlayer].tSpendCoins(OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent].unlock.Values[0]); + if (OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent].unlock.Condition == "ch") + OpenTaiko.SaveFileInstances[iPlayer].tSpendCoins(OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent].unlock.Values[0]); } } else if (iCurrentMenu == 1) { @@ -597,7 +598,8 @@ class CStageHeya : CStage { } else if (ess == ESelectStatus.SUCCESS) { OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedCharacters.Add(OpenTaiko.Skin.Characters_DirName[iCharacterCurrent]); DBSaves.RegisterStringUnlockedAsset(OpenTaiko.SaveFileInstances[iPlayer].data.SaveId, "unlocked_characters", OpenTaiko.Skin.Characters_DirName[iCharacterCurrent]); - OpenTaiko.SaveFileInstances[iPlayer].tSpendCoins(OpenTaiko.Tx.Characters[iCharacterCurrent].unlock.Values[0]); + if (OpenTaiko.Tx.Characters[iCharacterCurrent].unlock.Condition == "ch") + OpenTaiko.SaveFileInstances[iPlayer].tSpendCoins(OpenTaiko.Tx.Characters[iCharacterCurrent].unlock.Values[0]); // Play modal animation here ? } } else if (iCurrentMenu == 2) { diff --git a/OpenTaiko/src/Stages/CActNewHeya.cs b/OpenTaiko/src/Stages/CActNewHeya.cs index 26fcd519..a3ea0c87 100644 --- a/OpenTaiko/src/Stages/CActNewHeya.cs +++ b/OpenTaiko/src/Stages/CActNewHeya.cs @@ -1,5 +1,4 @@ using System.Drawing; -using DiscordRPC; using FDK; namespace OpenTaiko; @@ -254,7 +253,8 @@ class CActNewHeya : CActivity { //TJAPlayer3.NamePlateConfig.data.UnlockedPuchicharas[iPlayer].Add(TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent]); //TJAPlayer3.NamePlateConfig.tSpendCoins(TJAPlayer3.Tx.Puchichara[iPuchiCharaCurrent].unlock.Values[0], iPlayer); OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedPuchicharas.Add(OpenTaiko.Skin.Puchicharas_Name[CurrentIndex]); - OpenTaiko.SaveFileInstances[CurrentPlayer].tSpendCoins(OpenTaiko.Tx.Puchichara[CurrentIndex].unlock.Values[0]); + if (OpenTaiko.Tx.Puchichara[CurrentIndex].unlock.Condition == "ch") + OpenTaiko.SaveFileInstances[CurrentPlayer].tSpendCoins(OpenTaiko.Tx.Puchichara[CurrentIndex].unlock.Values[0]); OpenTaiko.Skin.soundDecideSFX.tPlay(); } else { OpenTaiko.Skin.soundError.tPlay(); @@ -286,7 +286,8 @@ class CActNewHeya : CActivity { CurrentMode = ModeType.None; } else if (ess == ESelectStatus.SUCCESS) { OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedCharacters.Add(OpenTaiko.Skin.Characters_DirName[CurrentIndex]); - OpenTaiko.SaveFileInstances[CurrentPlayer].tSpendCoins(OpenTaiko.Tx.Characters[CurrentIndex].unlock.Values[0]); + if (OpenTaiko.Tx.Characters[CurrentIndex].unlock.Condition == "ch") + OpenTaiko.SaveFileInstances[CurrentPlayer].tSpendCoins(OpenTaiko.Tx.Characters[CurrentIndex].unlock.Values[0]); OpenTaiko.Skin.soundDecideSFX.tPlay(); } else { OpenTaiko.Skin.soundError.tPlay();