From 5ee7add3559ea63914fe103b0a50e7642ace726f Mon Sep 17 00:00:00 2001 From: Clansty Date: Tue, 17 Sep 2024 02:34:38 +0800 Subject: [PATCH] [+] Force Paid play --- AquaMai/AquaMai.csproj | 1 + AquaMai/AquaMai.toml | 3 +++ AquaMai/AquaMai.zh.toml | 3 +++ AquaMai/Config.cs | 1 + AquaMai/Fix/ForcePaidPlay.cs | 30 ++++++++++++++++++++++++++++++ 5 files changed, 38 insertions(+) create mode 100644 AquaMai/Fix/ForcePaidPlay.cs diff --git a/AquaMai/AquaMai.csproj b/AquaMai/AquaMai.csproj index d60a9092..14c311de 100644 --- a/AquaMai/AquaMai.csproj +++ b/AquaMai/AquaMai.csproj @@ -295,6 +295,7 @@ + diff --git a/AquaMai/AquaMai.toml b/AquaMai/AquaMai.toml index f8d101cf..57e2a228 100644 --- a/AquaMai/AquaMai.toml +++ b/AquaMai/AquaMai.toml @@ -68,7 +68,10 @@ ImproveLoadSpeed=true SkipVersionCheck=true RemoveEncryption=true ForceAsServer=true +# Force the game to be in FreePlay mode ForceFreePlay=true +# Force the game to be in PaidPlay mode with 24 coins locked, conflicts with ForceFreePlay +ForcePaidPlay=false # Add notes sprite to the pool to prevent use up ExtendNotesPool=128 diff --git a/AquaMai/AquaMai.zh.toml b/AquaMai/AquaMai.zh.toml index 9db0287d..42569743 100644 --- a/AquaMai/AquaMai.zh.toml +++ b/AquaMai/AquaMai.zh.toml @@ -84,7 +84,10 @@ SkipVersionCheck=true RemoveEncryption=true # 如果要配置店内招募的话,应该要把这个关闭 ForceAsServer=true +# 强制改为免费游玩(FreePlay) ForceFreePlay=true +# 强制付费游玩并锁定 24 个币,和 ForceFreePlay 冲突 +ForcePaidPlay=false # 增加更多待命的音符贴图,防止奇怪的自制谱用完音符贴图池 ExtendNotesPool=128 diff --git a/AquaMai/Config.cs b/AquaMai/Config.cs index dfd0c511..99e8bd52 100644 --- a/AquaMai/Config.cs +++ b/AquaMai/Config.cs @@ -55,6 +55,7 @@ public class FixConfig public bool RemoveEncryption { get; set; } public bool ForceAsServer { get; set; } = true; public bool ForceFreePlay { get; set; } = true; + public bool ForcePaidPlay { get; set; } public int ExtendNotesPool { get; set; } } diff --git a/AquaMai/Fix/ForcePaidPlay.cs b/AquaMai/Fix/ForcePaidPlay.cs new file mode 100644 index 00000000..2e66ccbc --- /dev/null +++ b/AquaMai/Fix/ForcePaidPlay.cs @@ -0,0 +1,30 @@ +using HarmonyLib; + +namespace AquaMai.Fix; + +public class ForcePaidPlay +{ + [HarmonyPrefix] + [HarmonyPatch(typeof(Manager.Credit), "IsFreePlay")] + private static bool PreIsFreePlay(ref bool __result) + { + __result = false; + return false; + } + + [HarmonyPrefix] + [HarmonyPatch(typeof(Manager.Credit), "IsGameCostEnough")] + private static bool PreIsGameCostEnough(ref bool __result) + { + __result = true; + return false; + } + + [HarmonyPrefix] + [HarmonyPatch(typeof(AMDaemon.CreditUnit), "Credit", MethodType.Getter)] + private static bool PreCredit(ref uint __result) + { + __result = 24; + return false; + } +}