[+] Force Paid play

This commit is contained in:
Clansty 2024-09-17 02:34:38 +08:00
parent 81c1e6e887
commit 5ee7add355
No known key found for this signature in database
GPG Key ID: 3A6BE8BAF2EDE134
5 changed files with 38 additions and 0 deletions

View File

@ -295,6 +295,7 @@
<Compile Include="Fix\FixCharaCrash.cs" />
<Compile Include="Fix\ForceAsServer.cs" />
<Compile Include="Fix\ForceFreePlay.cs" />
<Compile Include="Fix\ForcePaidPlay.cs" />
<Compile Include="Fix\RemoveEncryption.cs" />
<Compile Include="Fix\SkipVersionCheck.cs" />
<Compile Include="Helpers\MessageHelper.cs" />

View File

@ -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

View File

@ -84,7 +84,10 @@ SkipVersionCheck=true
RemoveEncryption=true
# 如果要配置店内招募的话,应该要把这个关闭
ForceAsServer=true
# 强制改为免费游玩FreePlay
ForceFreePlay=true
# 强制付费游玩并锁定 24 个币,和 ForceFreePlay 冲突
ForcePaidPlay=false
# 增加更多待命的音符贴图,防止奇怪的自制谱用完音符贴图池
ExtendNotesPool=128

View File

@ -55,6 +55,7 @@ namespace AquaMai
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; }
}

View File

@ -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;
}
}