File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- using AquaMai . Core . Attributes ;
1+ using System . Collections . Generic ;
2+ using System . Reflection . Emit ;
3+ using AquaMai . Core . Attributes ;
24using AquaMai . Config . Attributes ;
35using HarmonyLib ;
46using MAI2 . Util ;
@@ -49,4 +51,30 @@ public static void ExecutePostfix(double ____pushTimer)
4951 if ( ____pushTimer < 500 ) return ;
5052 Singleton < GamePlayManager > . Instance . SetQuickRetryFrag ( flag : true ) ;
5153 }
54+
55+ // if (GameManager.GetFreedomModeMSec() > 0)
56+ public static long GetFreedomModeMSecOverride ( )
57+ {
58+ return 999999 ;
59+ }
60+
61+ [ HarmonyTranspiler ]
62+ [ HarmonyPatch ( typeof ( Monitor . QuickRetry ) , "Execute" ) ]
63+ public static IEnumerable < CodeInstruction > ExecuteTranspiler ( IEnumerable < CodeInstruction > instructions )
64+ {
65+ var original = AccessTools . Method ( typeof ( GameManager ) , nameof ( GameManager . GetFreedomModeMSec ) ) ;
66+ var replacement = AccessTools . Method ( typeof ( QuickRetry ) , nameof ( GetFreedomModeMSecOverride ) ) ;
67+
68+ foreach ( var instruction in instructions )
69+ {
70+ if ( instruction . Calls ( original ) )
71+ {
72+ yield return new CodeInstruction ( OpCodes . Call , replacement ) ;
73+ }
74+ else
75+ {
76+ yield return instruction ;
77+ }
78+ }
79+ }
5280}
You can’t perform that action at this time.
0 commit comments