using GadgetCore.API;
using HarmonyLib;
using System.Reflection;
using UnityEngine;

namespace Subworlds.Patches
{

  [HarmonyPatch(typeof(GameScript))]
  [HarmonyPatch("InitializeDroids")]
  [HarmonyGadget("SubworldCore")]
	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);
					}
				}
			}
		}
  }
}