-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
14bd248
commit de12ec6
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |