Skip to content

Commit

Permalink
[+] Force Paid play
Browse files Browse the repository at this point in the history
  • Loading branch information
clansty committed Sep 16, 2024
1 parent 81c1e6e commit 5ee7add
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions AquaMai/AquaMai.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
3 changes: 3 additions & 0 deletions AquaMai/AquaMai.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions AquaMai/AquaMai.zh.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ SkipVersionCheck=true
RemoveEncryption=true
# 如果要配置店内招募的话,应该要把这个关闭
ForceAsServer=true
# 强制改为免费游玩(FreePlay)
ForceFreePlay=true
# 强制付费游玩并锁定 24 个币,和 ForceFreePlay 冲突
ForcePaidPlay=false
# 增加更多待命的音符贴图,防止奇怪的自制谱用完音符贴图池
ExtendNotesPool=128

Expand Down
1 change: 1 addition & 0 deletions AquaMai/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}

Expand Down
30 changes: 30 additions & 0 deletions AquaMai/Fix/ForcePaidPlay.cs
Original file line number Diff line number Diff line change
@@ -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;
}
}

0 comments on commit 5ee7add

Please sign in to comment.