From f106a31990f409f54d94c1f6bb34345b39f77b68 Mon Sep 17 00:00:00 2001 From: Clansty Date: Tue, 21 May 2024 03:49:19 +0800 Subject: [PATCH] [+] Unlock maps that are not in this version --- AquaMai/AquaMai.csproj | 1 + AquaMai/AquaMai.toml | 2 ++ AquaMai/Cheat/MapUnlock.cs | 26 ++++++++++++++++++++++++++ AquaMai/Config.cs | 1 + 4 files changed, 30 insertions(+) create mode 100644 AquaMai/Cheat/MapUnlock.cs diff --git a/AquaMai/AquaMai.csproj b/AquaMai/AquaMai.csproj index 617c41b7..090320cc 100644 --- a/AquaMai/AquaMai.csproj +++ b/AquaMai/AquaMai.csproj @@ -266,6 +266,7 @@ + diff --git a/AquaMai/AquaMai.toml b/AquaMai/AquaMai.toml index d246aedb..182abdfa 100644 --- a/AquaMai/AquaMai.toml +++ b/AquaMai/AquaMai.toml @@ -4,6 +4,8 @@ [Cheat] # Unlock normally event-only tickets TicketUnlock=true +# Unlock maps that are not in this version +MapUnlock=true # =================================== # UX: User Experience Improvements diff --git a/AquaMai/Cheat/MapUnlock.cs b/AquaMai/Cheat/MapUnlock.cs new file mode 100644 index 00000000..49ab1a07 --- /dev/null +++ b/AquaMai/Cheat/MapUnlock.cs @@ -0,0 +1,26 @@ +using Manager.MaiStudio; +using HarmonyLib; + +namespace AquaMai.Cheat +{ + public class MapUnlock + { + // For any map, return the event ID 1 to unlock it + [HarmonyPrefix] + [HarmonyPatch(typeof(MapData), "get_OpenEventId")] + public static bool get_OpenEventId(ref StringID __result) + { + var id = new Manager.MaiStudio.Serialize.StringID + { + id = 1, + str = "無期限常時解放" + }; + + var sid = new StringID(); + sid.Init(id); + + __result = sid; + return false; + } + } +} \ No newline at end of file diff --git a/AquaMai/Config.cs b/AquaMai/Config.cs index 42c1a361..3d5f41a3 100644 --- a/AquaMai/Config.cs +++ b/AquaMai/Config.cs @@ -12,6 +12,7 @@ namespace AquaMai public class CheatConfig { public bool TicketUnlock { get; set; } + public bool MapUnlock { get; set; } } public class UXConfig