|
|
@@ -0,0 +1,29 @@
|
|
|
+using GadgetCore.API;
|
|
|
+using HarmonyLib;
|
|
|
+using System.Reflection;
|
|
|
+using UnityEngine;
|
|
|
+
|
|
|
+namespace Ships.Patches
|
|
|
+{
|
|
|
+
|
|
|
+ [HarmonyPatch(typeof(GameScript))]
|
|
|
+ [HarmonyPatch("InitializeDroids")]
|
|
|
+ [HarmonyGadget("Ships")]
|
|
|
+ public static class Patch_GameScript_InitializeDroids
|
|
|
+ {
|
|
|
+ [HarmonyPostfix]
|
|
|
+ public static void Postfix(GameScript __instance, Item[] ___inventory, GameObject[] ___droid)
|
|
|
+ {
|
|
|
+ if (MenuScript.player)
|
|
|
+ {
|
|
|
+ for (int i = 42; i < 45; i++)
|
|
|
+ {
|
|
|
+ if (___inventory[i].id >= 1000)
|
|
|
+ {
|
|
|
+ ___droid[i - 42].SendMessage("SetStats", ___inventory[i].id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|