1313
1414namespace API . Patches
1515{
16+ [ HarmonyPatch ( typeof ( ResourceDrone ) , "SetOnBoard" ) ]
17+ public class ResourceDrone_SetOnBoard
18+ {
19+ public static void Postfix ( ResourceDrone __instance )
20+ {
21+ __instance . Gems . gameObject . SetActive ( Plugin . configDroneMox . Value ) ;
22+ }
23+ }
24+
1625 [ HarmonyPatch ( typeof ( Part1ResourcesManager ) , "CleanUp" ) ]
1726 public class Part1ResourcesManager_CleanUp
1827 {
@@ -21,14 +30,23 @@ public static void Prefix(Part1ResourcesManager __instance)
2130 ResourcesManager baseResourceManager = ( ResourcesManager ) __instance ;
2231 if ( Plugin . configEnergy . Value )
2332 {
24- var baseTraverse = Traverse . Create ( baseResourceManager ) ;
25- baseTraverse . Property ( "PlayerEnergy" ) . SetValue ( 0 ) ;
26- baseTraverse . Property ( "PlayerMaxEnergy" ) . SetValue ( 0 ) ;
33+ var baseTraverse = Traverse . Create ( baseResourceManager ) ;
34+ baseTraverse . Property ( "PlayerEnergy" ) . SetValue ( 0 ) ;
35+ baseTraverse . Property ( "PlayerMaxEnergy" ) . SetValue ( 0 ) ;
2736 }
2837 if ( Plugin . configDrone . Value )
2938 {
39+ Singleton < ResourceDrone > . Instance . Gems . SetAllGemsOn ( false , false ) ;
3040 Singleton < ResourceDrone > . Instance . CloseAllCells ( false ) ;
3141 Singleton < ResourceDrone > . Instance . SetOnBoard ( false , false ) ;
42+ if ( Plugin . configDroneMox . Value )
43+ {
44+ Singleton < ResourceDrone > . Instance . Gems . SetAllGemsOn ( false , false ) ;
45+ }
46+ }
47+ if ( Plugin . configMox . Value )
48+ {
49+ __instance . gems . Clear ( ) ;
3250 }
3351 }
3452 }
@@ -41,6 +59,10 @@ public static void Prefix(ResourcesManager __instance)
4159 if ( __instance is Part1ResourcesManager && Plugin . configDrone . Value )
4260 {
4361 Singleton < ResourceDrone > . Instance . SetOnBoard ( true , false ) ;
62+ if ( Plugin . configDroneMox . Value )
63+ {
64+ Singleton < ResourceDrone > . Instance . Gems . SetAllGemsOn ( false , true ) ;
65+ }
4466 }
4567 }
4668 }
@@ -98,6 +120,43 @@ public static IEnumerator Postfix(IEnumerator result, int amount, ResourcesManag
98120 }
99121 }
100122
123+ [ HarmonyPatch ( typeof ( ResourcesManager ) , "ShowAddGem" ) ]
124+ public class ResourcesManager_ShowAddGem
125+ {
126+ public static IEnumerator Postfix ( IEnumerator result , GemType gem , ResourcesManager __instance )
127+ {
128+ if ( __instance is Part1ResourcesManager && Plugin . configDroneMox . Value )
129+ {
130+ __instance . SetGemOnImmediate ( gem , true ) ;
131+ yield return new WaitForSeconds ( 0.05f ) ;
132+ }
133+ yield return result ;
134+ }
135+ }
136+
137+ [ HarmonyPatch ( typeof ( ResourcesManager ) , "ShowLoseGem" ) ]
138+ public class ResourcesManager_ShowLoseGem
139+ {
140+ public static IEnumerator Postfix ( IEnumerator result , GemType gem , ResourcesManager __instance )
141+ {
142+ if ( __instance is Part1ResourcesManager && Plugin . configDroneMox . Value )
143+ {
144+ __instance . SetGemOnImmediate ( gem , false ) ;
145+ yield return new WaitForSeconds ( 0.05f ) ;
146+ }
147+ yield return result ;
148+ }
149+ }
150+
151+ [ HarmonyPatch ( typeof ( ResourcesManager ) , "SetGemOnImmediate" ) ]
152+ public class ResourcesManager_SetGemOnImmediate
153+ {
154+ public static void Postfix ( GemType gem , bool on )
155+ {
156+ Singleton < ResourceDrone > . Instance . Gems . SetGemOn ( gem , on , false ) ;
157+ }
158+ }
159+
101160 [ HarmonyPatch ]
102161 public class TurnManager_PlayerTurn
103162 {
0 commit comments