Skip to content

Commit

Permalink
[+] Ticket unlock patch
Browse files Browse the repository at this point in the history
  • Loading branch information
hykilpikonna committed Feb 7, 2024
1 parent 14bd248 commit de12ec6
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions AquaMai/Cheat/TicketUnlock.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using Manager.MaiStudio;
using HarmonyLib;

namespace AquaMai.Cheat
{
/**
* Unlock tickets that are typically locked unless a specific event is open.
*/
public class TicketUnlock
{
// For any ticket, return the event ID 1 to unlock it
[HarmonyPrefix]
[HarmonyPatch(typeof(TicketData), "get_ticketEvent")]
public static bool get_ticketEvent(ref StringID __result)
{
var id = new Manager.MaiStudio.Serialize.StringID
{
id = 1,
str = "無期限常時解放"
};

var sid = new StringID();
sid.Init(id);

__result = sid;
return false;
}

// Modify the maxTicketNum to 0
// this is because TicketManager.GetTicketData adds the ticket to the list if either
// the player owns at least one ticket or the maxTicketNum = 0
[HarmonyPrefix]
[HarmonyPatch(typeof(TicketData), "get_maxCount")]
public static bool get_maxCount(ref int __result)
{
__result = 0;
return false;
}
}
}

0 comments on commit de12ec6

Please sign in to comment.