示例#1
0
 internal static void DisableQueuedGadgets()
 {
     Logger.Log("Unloading Gadgets...");
     foreach (GadgetInfo gadget in QueuedGadgets)
     {
         gadget.Gadget.Unload();
         LootTables.RemoveModEntries(gadget.Gadget.ModID);
         GadgetCoreAPI.RemoveModResources(gadget.Gadget.ModID);
         GadgetCoreAPI.UnregisterStatModifiers(gadget.Gadget.ModID);
         GadgetNetwork.UnregisterSyncVars(gadget.Gadget.ModID);
         PlanetRegistry.UnregisterGadget(gadget.Gadget.ModID);
         foreach (Registry reg in GameRegistry.ListAllRegistries())
         {
             reg.UnregisterGadget(gadget);
         }
     }
     Logger.Log("Done unloading Gadgets.");
     Logger.Log("Unpatching Gadgets...");
     foreach (GadgetInfo gadget in QueuedGadgets.ToList())
     {
         try
         {
             gadget.Gadget.HarmonyInstance.UnpatchAll(gadget.Mod.Name + "." + gadget.Attribute.Name + ".gadget");
         }
         catch (Exception e)
         {
             Logger.LogError("Exception Unpatching Gadget '" + gadget.Attribute.Name + "':" + Environment.NewLine + e.ToString());
         }
     }
     Logger.Log("Done patching Gadgets.");
     Logger.Log("Sorting Gadgets...");
     Gadgets.SortGadgets();
     Logger.Log("Done sorting Gadgets.");
     QueuedGadgets.Clear();
 }
 public static bool Prefix(int b, ref int __result)
 {
     if (b < PlanetRegistry.VanillaWeightedExitPortalIDs.Length)
     {
         if (PlanetRegistry.Singleton.HasEntry(b))
         {
             PlanetInfo planet = PlanetRegistry.Singleton[b];
             int[]      weightedExitPortals = planet.WeightedExitPortalIDs.Union(PlanetRegistry.GetVanillaExitPortalWeights(b).Where(x => x.Item3 != -1).Select(x => Tuple.Create(x.Item1, x.Item2)), new ComparisonComparer <Tuple <int, int> >((p1, p2) => p1.Item1 - p2.Item1)).SelectMany(x => Enumerable.Repeat(x.Item1, x.Item2)).ToArray();
             __result = weightedExitPortals[Random.Range(0, weightedExitPortals.Length)];
         }
         else
         {
             int[] weightedExitPortals = PlanetRegistry.GetVanillaExitPortalWeights(b).SelectMany(x => Enumerable.Repeat(x.Item1, x.Item2)).ToArray();
             __result = weightedExitPortals[Random.Range(0, weightedExitPortals.Length)];
         }
         return(false);
     }
     else if (PlanetRegistry.Singleton.HasEntry(b))
     {
         PlanetInfo planet = PlanetRegistry.Singleton[b];
         int[]      weightedExitPortals = planet.WeightedExitPortalIDs.SelectMany(x => Enumerable.Repeat(x.Item1, x.Item2)).ToArray();
         __result = weightedExitPortals[Random.Range(0, weightedExitPortals.Length)];
         return(false);
     }
     return(true);
 }
示例#3
0
        public static void Postfix(GameScript __instance, ref RaycastHit ___hit, ref int ___craftType, ref int ___slotID, ref bool ___shifting, ref Item[] ___inventory, ref Item[] ___craft, ref Item[] ___modSlot, ref int ___curBlockSlot, ref ChunkWorld ___chunkWorld, ref ChunkWorld ___chunkWorldWall, ref Item __state)
        {
            if (!GameScript.pausing && !GameScript.inventoryOpen && GameScript.buildMode && Input.GetMouseButtonDown(0) && ___inventory[___curBlockSlot].q > 0 && ItemRegistry.Singleton.HasEntry(___inventory[___curBlockSlot].id))
            {
                int num4 = (int)__instance.hoverBuild.transform.position.x;
                int num5 = (int)__instance.hoverBuild.transform.position.y;
                int num6 = (num4 + 62) / 4;
                int num7 = (num5 + 62) / 4;
                if (num6 < 64 && num6 >= 0 && num7 < 64 && num7 >= 0)
                {
                    ItemInfo item = ItemRegistry.Singleton.GetEntry(___inventory[___curBlockSlot].id);
                    if (item.Tile != null && item.Tile.TryPlaceTile())
                    {
                        if (item.Tile.Type == TileType.WALL)
                        {
                            if (___chunkWorldWall.grid[num6, num7] == 0)
                            {
                                int[] value = new int[]
                                {
                                    num4,
                                    num5,
                                    GameScript.curBlockID
                                };
                                __instance.WallManager.SendMessage("PlaceTile", value);
                                __instance.hoverBuild.SendMessage("Refresh");
                                __instance.GetComponent <AudioSource>().PlayOneShot((AudioClip)Resources.Load("Au/emblem"), Menuu.soundLevel / 10f);
                                ___inventory[___curBlockSlot].q--;
                                RefreshSlot.Invoke(__instance, new object[] { ___curBlockSlot });
                                if (___inventory[___curBlockSlot].q <= 0 && GameScript.buildMode)
                                {
                                    __instance.ExitBuildMode();
                                    __instance.hoverSprite.GetComponent <Renderer>().material = (Material)Resources.Load("mat/trans");
                                    GameScript.curBlockID = 0;
                                }
                            }
                        }
                        else if (item.Tile.Type == TileType.SOLID)
                        {
                            if (___chunkWorld.gridSpecial[num6, num7] == 0 && ___chunkWorld.grid[num6, num7] == 0)
                            {
                                int[] value3 = new int[]
                                {
                                    num4,
                                    num5,
                                    GameScript.curBlockID
                                };
                                __instance.TileManager.SendMessage("PlaceTile", value3);
                                __instance.hoverBuild.SendMessage("Refresh");
                                __instance.GetComponent <AudioSource>().PlayOneShot((AudioClip)Resources.Load("Au/emblem"), Menuu.soundLevel / 10f);
                                ___inventory[___curBlockSlot].q--;
                                RefreshSlot.Invoke(__instance, new object[] { ___curBlockSlot });
                                if (___inventory[___curBlockSlot].q <= 0 && GameScript.buildMode)
                                {
                                    __instance.ExitBuildMode();
                                    __instance.hoverSprite.GetComponent <Renderer>().material = (Material)Resources.Load("mat/trans");
                                    GameScript.curBlockID = 0;
                                }
                            }
                        }
                        else
                        {
                            if (___chunkWorld.gridSpecial[num6, num7] == 0 && ___chunkWorld.grid[num6, num7] == 0)
                            {
                                if (GameScript.curBlockID == 2107 && __instance.gatherer)
                                {
                                    __instance.Error(11);
                                }
                                else
                                {
                                    int[] value2 = new int[]
                                    {
                                        num4,
                                        num5,
                                        GameScript.curBlockID
                                    };
                                    __instance.TileManager.SendMessage("PlaceTileSpecial", value2);
                                    __instance.hoverBuild.SendMessage("Refresh");
                                    __instance.GetComponent <AudioSource>().PlayOneShot((AudioClip)Resources.Load("Au/emblem"), Menuu.soundLevel / 10f);
                                    ___inventory[___curBlockSlot].q--;
                                    RefreshSlot.Invoke(__instance, new object[] { ___curBlockSlot });
                                    if (___inventory[___curBlockSlot].q <= 0 && GameScript.buildMode)
                                    {
                                        __instance.ExitBuildMode();
                                        __instance.hoverSprite.GetComponent <Renderer>().material = (Material)Resources.Load("mat/trans");
                                        GameScript.curBlockID = 0;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            else if (MenuScript.player && !GameScript.pausing)
            {
                if (Input.GetMouseButtonDown(0) && GameScript.inventoryOpen && Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out ___hit, 7f))
                {
                    if (___hit.transform.gameObject.layer == 16)
                    {
                        if (___hit.transform.gameObject.tag == "craft")
                        {
                            if (MenuRegistry.Singleton[___craftType] is CraftMenuInfo craftMenu)
                            {
                                ___slotID = int.Parse(___hit.transform.gameObject.name);
                                if (__state.id != 0)
                                {
                                    Item   holdingItem = __state;
                                    Item[] craftItems  = ___craft;
                                    int    slotID      = ___slotID;
                                    if (craftMenu.SlotValidators.Any(x => x(holdingItem, craftItems, slotID)))
                                    {
                                        if (___craft[___slotID].id == __state.id)
                                        {
                                            __instance.InvokeMethod("CombineItemCraft", ___slotID);
                                        }
                                        else if (___craft[___slotID].id == 0)
                                        {
                                            __instance.InvokeMethod("PlaceItemCraft", ___slotID);
                                        }
                                    }
                                }
                                else if (___craft[___slotID].id != 0)
                                {
                                    if (!___shifting)
                                    {
                                        __instance.InvokeMethod("SelectItemCraft", ___slotID);
                                    }
                                    else if (___shifting && __instance.menuCraft.activeSelf)
                                    {
                                        __instance.StartCoroutine(__instance.InvokeMethod <IEnumerator>("ShiftClickCraft", ___slotID));
                                    }
                                }
                            }
                            else if (___craftType == 0)
                            {
                                ___slotID = int.Parse(___hit.transform.gameObject.name);
                                if (__state.id != 0 && ___craft[___slotID].id != __state.id)
                                {
                                    if ((__state.id <= 100 || __state.id >= 200) && __instance.InvokeMethod <bool>("CanPlaceCraft", __state.id))
                                    {
                                        ItemType?itemType = ItemRegistry.GetItem(__state.id)?.Type;
                                        if (itemType.HasValue && (itemType.Value & (ItemType.EMBLEM | ItemType.EQUIPABLE)) == ItemType.EMBLEM)
                                        {
                                            if (___craft[___slotID].id == 0)
                                            {
                                                __instance.InvokeMethod("PlaceItemCraft", ___slotID);
                                            }
                                            else
                                            {
                                                __instance.InvokeMethod("SwapItemCraft", ___slotID);
                                            }
                                        }
                                    }
                                }
                            }
                            else if (___craftType == 1)
                            {
                                ___slotID = int.Parse(___hit.transform.gameObject.name);
                                if (__state.id != 0 && ___craft[___slotID].id != __state.id)
                                {
                                    if ((__state.id <= 10 || __state.id >= 40) && __instance.InvokeMethod <bool>("CanPlaceCraft", __state.id))
                                    {
                                        ItemType?itemType = ItemRegistry.GetItem(__state.id)?.Type;
                                        if (itemType.HasValue && (itemType.Value & (ItemType.EMBLEM | ItemType.EQUIPABLE)) == ItemType.LOOT && (itemType.Value & ItemType.ORGANIC) == ItemType.ORGANIC)
                                        {
                                            if (___craft[___slotID].id == 0)
                                            {
                                                __instance.InvokeMethod("PlaceItemCraft", ___slotID);
                                            }
                                            else
                                            {
                                                __instance.InvokeMethod("SwapItemCraft", ___slotID);
                                            }
                                        }
                                    }
                                }
                            }
                            else if (___craftType == 2)
                            {
                                ___slotID = int.Parse(___hit.transform.gameObject.name);
                                if (__state.id != 0)
                                {
                                    if (___slotID == 0 && ___craft[___slotID].id != __state.id)
                                    {
                                        if (___craft[0].id == 0 &&
                                            (__state.id < 1000 || __state.id >= 1006) && (__state.id < 450 || __state.id >= 456) &&
                                            (__state.id < 500 || __state.id >= 506) && (__state.id < 600 || __state.id >= 612) &&
                                            (__state.id < 550 || __state.id >= 562) && (__state.id < 350 || __state.id >= 362) &&
                                            (__state.id < 400 || __state.id >= 412) && (__state.id < 300 || __state.id >= 312) &&
                                            (__state.id < 700 || __state.id >= 712) && (__state.id < 800 || __state.id >= 812))
                                        {
                                            Item holdingItem = __state;
                                            if (GadgetCoreAPI.ultimateForgeRecipes.Any(x => x.Key.Item1 == holdingItem.id))
                                            {
                                                if (__instance.InvokeMethod <int>("GetItemLevel", holdingItem.exp) >= 10)
                                                {
                                                    __instance.InvokeMethod("PlaceItemCraft", ___slotID);
                                                }
                                                else
                                                {
                                                    __instance.InvokeMethod("Error", 12);
                                                }
                                            }
                                        }
                                    }
                                    else if (___slotID == 2)
                                    {
                                        if (___craft[2].id == 0 && (__state.id < 89 || __state.id >= 92))
                                        {
                                            Item holdingItem = __state;
                                            if (GadgetCoreAPI.ultimateForgeRecipes.Any(x => x.Key.Item2 == holdingItem.id))
                                            {
                                                __instance.InvokeMethod("PlaceItemCraft", ___slotID);
                                            }
                                        }
                                    }
                                }
                            }
                            else if (___craftType == 3)
                            {
                                ___slotID = int.Parse(___hit.transform.gameObject.name);
                                if (__state.id != 0 && ___craft[___slotID].id != __state.id)
                                {
                                    if ((__state.id <= 103 || __state.id >= 107) && (__state.id <= 113 || __state.id >= 117) &&
                                        (__state.id <= 123 || __state.id >= 127) && (__state.id <= 133 || __state.id >= 137) &&
                                        __instance.InvokeMethod <bool>("CanPlaceCraft2", __state.id))
                                    {
                                        Item holdingItem = __state;
                                        if (GadgetCoreAPI.creationMachineRecipes.Any(x => x.Key == holdingItem.id))
                                        {
                                            if (___craft[___slotID].id == 0)
                                            {
                                                __instance.InvokeMethod("PlaceItemCraft", ___slotID);
                                            }
                                            else
                                            {
                                                __instance.InvokeMethod("SwapItemCraft", ___slotID);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        else if (___hit.transform.gameObject.tag == "planet")
                        {
                            ___slotID = int.Parse(___hit.transform.gameObject.name);
                            if (___slotID >= 14)
                            {
                                while (___slotID >= 14)
                                {
                                    ___slotID -= 14;
                                    PlanetRegistry.PlanetSelectorPage++;
                                }
                                PlanetRegistry.UpdatePlanetSelector();
                            }
                            int planetIndex = (PlanetRegistry.PlanetSelectorPage - 2) * 14 + ___slotID;
                            if (planetIndex >= 0 && planetIndex < PlanetRegistry.selectorPlanets.Length && PlanetRegistry.selectorPlanets[planetIndex] is PlanetInfo planet)
                            {
                                if (planet.PortalUses > 0 || planet.PortalUses == -1)
                                {
                                    InstanceTracker.GameScript.GetComponent <AudioSource>().PlayOneShot((AudioClip)Resources.Load("Au/confirm"), Menuu.soundLevel / 10f);
                                    InstanceTracker.GameScript.planetSelector.transform.position = new Vector3(InstanceTracker.GameScript.planetGuard[___slotID].transform.position.x, InstanceTracker.GameScript.planetGuard[___slotID].transform.position.y, InstanceTracker.GameScript.planetSelector.transform.position.z);
                                    GameScript.curPlanet = ___slotID;
                                    InstanceTracker.GameScript.planetObj.GetComponent <Renderer>().material = (Material)Resources.Load("mat/planet" + planet.ID);
                                    InstanceTracker.GameScript.planetObj.GetComponent <Animation>().Play();
                                    InstanceTracker.GameScript.txtPlanetName[0].text = planet.Name;
                                    InstanceTracker.GameScript.txtPlanetName[1].text = InstanceTracker.GameScript.txtPlanetName[0].text;
                                    InstanceTracker.GameScript.txtHostile[0].text    = "Hostile Lv." + InstanceTracker.GameScript.InvokeMethod("GetPlanetHostile", planet.ID);
                                    InstanceTracker.GameScript.txtHostile[1].text    = InstanceTracker.GameScript.txtHostile[0].text;
                                    if (planet.PortalUses > 0)
                                    {
                                        InstanceTracker.GameScript.txtPortalUses[0].text = "Portal Uses: " + planet.PortalUses;
                                        InstanceTracker.GameScript.txtPortalUses[1].text = InstanceTracker.GameScript.txtPortalUses[0].text;
                                    }
                                    else if (planet.PortalUses == -1)
                                    {
                                        InstanceTracker.GameScript.txtPortalUses[0].text = "Portal Uses: Infinite";
                                        InstanceTracker.GameScript.txtPortalUses[1].text = InstanceTracker.GameScript.txtPortalUses[0].text;
                                    }
                                }
                            }
                        }
                        else if (___hit.transform.gameObject.tag == "mod")
                        {
                            ___slotID = int.Parse(___hit.transform.gameObject.name);
                            Item holdingItem = __state;
                            if (holdingItem.id != 0)
                            {
                                if ((holdingItem.id < 300 || holdingItem.id >= 1000) && (ItemRegistry.GetItem(holdingItem.id).Type & ItemType.MODABLE) == ItemType.MODABLE)
                                {
                                    if (___modSlot[___slotID].id == 0)
                                    {
                                        __instance.PlaceItemMod(___slotID);
                                    }
                                    else
                                    {
                                        __instance.SwapItemMod(___slotID);
                                    }
                                }
                            }
                            else if ((___modSlot[___slotID].id < 300 || ___modSlot[___slotID].id >= 1000) && (ItemRegistry.GetItem(___modSlot[___slotID].id).Type & ItemType.MODABLE) == ItemType.MODABLE)
                            {
                                __instance.SelectItemMod(___slotID);
                            }
                        }
                    }
                    else if (___hit.transform.gameObject.layer != 17)
                    {
                        switch (___hit.transform.gameObject.name)
                        {
                        case "bPlanetPageBack":
                            __instance.GetComponent <AudioSource>().PlayOneShot((AudioClip)Resources.Load("Au/confirm"), Menuu.soundLevel / 10f);
                            if (PlanetRegistry.PlanetSelectorPage <= 1)
                            {
                                PlanetRegistry.PlanetSelectorPage = PlanetRegistry.PlanetSelectorPages;
                            }
                            else
                            {
                                PlanetRegistry.PlanetSelectorPage--;
                            }
                            PlanetRegistry.UpdatePlanetSelector();
                            break;

                        case "bPlanetPageForward":
                            __instance.GetComponent <AudioSource>().PlayOneShot((AudioClip)Resources.Load("Au/confirm"), Menuu.soundLevel / 10f);
                            if (PlanetRegistry.PlanetSelectorPage >= PlanetRegistry.PlanetSelectorPages)
                            {
                                PlanetRegistry.PlanetSelectorPage = 1;
                            }
                            else
                            {
                                PlanetRegistry.PlanetSelectorPage++;
                            }
                            PlanetRegistry.UpdatePlanetSelector();
                            break;
                        }
                    }
                }
                else if (Input.GetMouseButtonDown(1) && GameScript.inventoryOpen && Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out ___hit, 7f))
                {
                    if (___hit.transform.gameObject.layer == 16)
                    {
                        if (___hit.transform.gameObject.tag == "craft")
                        {
                            if (MenuRegistry.Singleton.GetEntry(___craftType) is CraftMenuInfo craftMenu)
                            {
                                ___slotID = int.Parse(___hit.transform.gameObject.name);
                                if (__state.id != 0)
                                {
                                    Item   holdingItem = __state;
                                    Item[] craftItems  = ___craft;
                                    int    slotID      = ___slotID;
                                    if (craftMenu.SlotValidators.Any(x => x(holdingItem, craftItems, slotID)))
                                    {
                                        if (___craft[___slotID].id == 0 || (GadgetCoreAPI.CanItemsStack(___craft[___slotID], __state) && ___craft[___slotID].q < 9999))
                                        {
                                            __instance.InvokeMethod("PlaceOneItemCraft", ___slotID);
                                        }
                                        else
                                        {
                                            __instance.InvokeMethod("SwapItemCraft", ___slotID);
                                        }
                                    }
                                }
                            }
                        }
                        else if (___hit.transform.gameObject.tag == "mod")
                        {
                            ___slotID = int.Parse(___hit.transform.gameObject.name);
                            Item holdingItem = __state;
                            if (holdingItem.id != 0)
                            {
                                if ((holdingItem.id < 300 || holdingItem.id >= 1000) && (ItemRegistry.GetItem(holdingItem.id).Type & ItemType.MODABLE) == ItemType.MODABLE)
                                {
                                    if (___modSlot[___slotID].id == 0)
                                    {
                                        __instance.PlaceItemMod(___slotID);
                                    }
                                    else
                                    {
                                        __instance.SwapItemMod(___slotID);
                                    }
                                }
                            }
                            else if ((___modSlot[___slotID].id < 300 || ___modSlot[___slotID].id >= 1000) && (ItemRegistry.GetItem(holdingItem.id).Type & ItemType.MODABLE) == ItemType.MODABLE)
                            {
                                __instance.SelectItemMod(___slotID);
                            }
                        }
                    }
                }
            }
        }
 public static void Postfix(GameScript __instance)
 {
     PlanetRegistry.UpdatePlanetSelector();
 }
示例#5
0
        protected override void Initialize()
        {
            Logger.Log("Tiers+ v" + Info.Mod.Version);
            Logger.Log("Plasmathrower v" + Info.Mod.Version);
            PlasmaCannon = new ItemInfo(ItemType.WEAPON, "Plasmathrower", "", GadgetCoreAPI.LoadTexture2D("items/PlasmaCannonItem"), Stats: new EquipStats(5, 0, 10, 10, 0, 0), HeldTex: GadgetCoreAPI.LoadTexture2D("items/PlasmaCannonHeld"));
            PlasmaCannon.SetWeaponInfo(new float[] { 0, 0, 0.5f, 0.25f, 0, 0 }, GadgetCoreAPI.GetAttackSound(497));
            PlasmaCannon.Register("PlasmaCannon");
            GameObject PlasmaCannonProj = UnityEngine.Object.Instantiate(GadgetCoreAPI.GetWeaponProjectileResource(471));

            PlasmaCannonProj.GetComponentInChildren <ParticleSystemRenderer>().material = new Material(Shader.Find("Particles/Additive"))
            {
                mainTexture = GadgetCoreAPI.LoadTexture2D("CustomParticleTextureFileName"),
            };
            PlasmaCannonProj.GetComponentInChildren <MeshRenderer>().material = new Material(Shader.Find("Unlit/Transparent Cutout"))
            {
                mainTexture = GadgetCoreAPI.LoadTexture2D("items/PlasmaCannonProj"),
            };
            Vector3 particleSystemPos = PlasmaCannonProj.transform.Find("Particle System").localPosition;

            UnityEngine.Object.DestroyImmediate(PlasmaCannonProj.transform.Find("Particle System").gameObject);
            GameObject customParticleSystem = UnityEngine.Object.Instantiate(PlasmaCannonProj.GetComponent <Projectile>().particleAtalanta);

            customParticleSystem.name = "Particle System";
            customParticleSystem.transform.SetParent(PlasmaCannonProj.transform);
            customParticleSystem.transform.localPosition = particleSystemPos;
            customParticleSystem.SetActive(true);
            customParticleSystem.GetComponent <ParticleSystemRenderer>().material = new Material(Shader.Find("Particles/Additive"))
            {
                mainTexture = GadgetCoreAPI.LoadTexture2D("items/particleplasma"),
            };
            GadgetCoreAPI.AddCustomResource("proj/shot" + PlasmaCannon.GetID(), PlasmaCannonProj);


            PlasmaCannon.OnAttack += TripleShot;
            //plasmacannon
            ItemInfo
                particleAccelerator = new ItemInfo(ItemType.WEAPON, "Particle Accelerator", "", GadgetCoreAPI.LoadTexture2D("items/ParticleAccItem"), Stats: new EquipStats(3, 0, 7, 0, 7, 3), HeldTex: GadgetCoreAPI.LoadTexture2D("items/ParticleAccHeld"));

            particleAccelerator.SetWeaponInfo(new float[] { 0, 0, 1.5f, 0, 1, 0 }, GadgetCoreAPI.GetAttackSound(426));
            particleAccelerator.Register("ParticleAcc");
            GameObject particleAccProj = UnityEngine.Object.Instantiate(GadgetCoreAPI.GetWeaponProjectileResource(427));

            GadgetCoreAPI.AddCustomResource("proj/shot" + particleAccelerator.GetID(), particleAccProj);
            particleAccProj.GetComponent <Projectile>().speed = 45;
            particleAccelerator.OnAttack += particleAccelerator.ShootGun;

            NebulaCannon = new ItemInfo(ItemType.WEAPON, "Nebular Grenadier", "", GadgetCoreAPI.LoadTexture2D("items/NebulaCannonItem"), Stats: new EquipStats(0, 0, 10, 10, 0, 0), HeldTex: GadgetCoreAPI.LoadTexture2D("items/NebulaCannonHeld"));
            NebulaCannon.SetWeaponInfo(new float[] { 0, 0, 0.5f, 2, 0, 0 }, GadgetCoreAPI.GetAttackSound(473));
            NebulaCannon.Register("NebulaCannon");
            NebulaCannon.OnAttack += CustomPlasma;

            ItemInfo plantain = new ItemInfo(ItemType.WEAPON, "Plantain", "", GadgetCoreAPI.LoadTexture2D("items/PlantainItem"), Stats: new EquipStats(0, 0, 0, 0, 10, 7), HeldTex: GadgetCoreAPI.LoadTexture2D("items/PlantainHeld"));

            plantain.SetWeaponInfo(new float[] { 0, 0, 0, 0, 1.5f, 0.5f }, GadgetCoreAPI.GetAttackSound(529));
            plantain.Register("Plantain");
            GameObject plantainProj = UnityEngine.Object.Instantiate(GadgetCoreAPI.GetWeaponProjectileResource(596));

            GadgetCoreAPI.AddCustomResource("proj/shot" + plantain.GetID(), plantainProj);
            plantainProj.GetComponent <Projectile>().speed = 45;
            plantainProj.GetComponentInChildren <MeshRenderer>().material = new Material(Shader.Find("Unlit/Transparent Cutout"))
            {
                mainTexture = GadgetCoreAPI.LoadTexture2D("items/PlantainItem"),
            };
            plantain.OnAttack += plantain.CastStaff;

            ItemInfo closeCombatant = new ItemInfo(ItemType.WEAPON, "Close Combatant", "", GadgetCoreAPI.LoadTexture2D("items/ParticleGauntlet"), Stats: new EquipStats(0, 8, 0, 0, 7, 0), HeldTex: GadgetCoreAPI.LoadTexture2D("items/Blank"));

            closeCombatant.SetWeaponInfo(new float[] { 0, 0.5f, 0, 0, 1f, 0 }, GadgetCoreAPI.GetAttackSound(523));
            closeCombatant.Register("CloseCombat");
            GameObject closeCombatProj = UnityEngine.Object.Instantiate(GadgetCoreAPI.GetWeaponProjectileResource(523));

            GadgetCoreAPI.AddCustomResource("proj/shot" + closeCombatant.GetID(), closeCombatProj);
            closeCombatProj.GetComponent <Projectile>().speed = 0;
            closeCombatant.OnAttack += closeCombatant.CastGauntlet;
            closeCombatant.OnAttack += closeCombatant.CastGauntlet;
            closeCombatant.OnAttack += closeCombatant.CastGauntlet;
            closeCombatant.OnAttack += closeCombatant.CastGauntlet;

            GameObject proj = (GameObject)UnityEngine.Object.Instantiate((GameObject)Resources.Load("proj/wyvern"));

            proj.GetComponent <HazardScript>().damage = 40;
            GadgetCoreAPI.AddCustomResource("proj/wyvernCustom", proj);

            GameObject proj2 = (GameObject)UnityEngine.Object.Instantiate((GameObject)Resources.Load("proj/spongeProj"));

            proj2.GetComponent <HazardScript>().damage = 45;
            GadgetCoreAPI.AddCustomResource("proj/spongeProjCustom", proj2);

            //projectiles
            PlasmaLance = new PlasmaLanceItemInfo(ItemType.WEAPON, "Plasma Lance", "", GadgetCoreAPI.LoadTexture2D("items/Plasmaspearitem"), Stats: new EquipStats(5, 20, 0, 0, 0, 0), HeldTex: GadgetCoreAPI.LoadTexture2D("items/PlasmaSpear"));
            PlasmaLance.SetWeaponInfo(new float[] { 2f, 4f, 0, 0, 0, 0 }, GadgetCoreAPI.GetAttackSound(367));
            PlasmaLance.Register("PlasmaLance");
            PlasmaLance.OnAttack += PlasmaLance.ThrustLance;
            //plasmalance
            PlasmaArmor = new ItemInfo(ItemType.ARMOR, "Plasmatic Armor", "", GadgetCoreAPI.LoadTexture2D("items/PlasmaArmor"), Stats: new EquipStats(7, 4, 8, 4, 8, 4), BodyTex: GadgetCoreAPI.LoadTexture2D("Items/PlasmaArmorEquip"), ArmTex: GadgetCoreAPI.LoadTexture2D("items/PlasmaHand"));
            PlasmaArmor.Register("PlasmaArmor");
            PlasmaHelmet = new ItemInfo(ItemType.HELMET, "Plasmatic Helmet", "", GadgetCoreAPI.LoadTexture2D("items/PlasmaHelm"), Stats: new EquipStats(8, 4, 4, 8, 4, 8), HeadTex: GadgetCoreAPI.LoadTexture2D("items/PlasmaHelmEquip"));
            PlasmaHelmet.Register("PlasmaHelmet");
            ItemInfo NexusArmor = new ItemInfo(ItemType.ARMOR, "Nexus Armor", "", GadgetCoreAPI.LoadTexture2D("items/NexusArmor"), Stats: new EquipStats(6, 5, 5, 5, 8, 8), BodyTex: GadgetCoreAPI.LoadTexture2D("Items/NexusArmor"), ArmTex: GadgetCoreAPI.LoadTexture2D("items/NexusHand"));

            NexusArmor.Register("NexusArmor");
            ItemInfo NexusHelmet = new ItemInfo(ItemType.HELMET, "Nexus Helmet", "", GadgetCoreAPI.LoadTexture2D("items/NexusHelmItem"), Stats: new EquipStats(4, 4, 4, 4, 10, 10), HeadTex: GadgetCoreAPI.LoadTexture2D("items/NexusHelm"));

            NexusHelmet.Register("NexusHelmet");
            PlasmaShield = new ItemInfo(ItemType.OFFHAND, "Nexus Shield", "", GadgetCoreAPI.LoadTexture2D("items/NexusShield"), Stats: new EquipStats(5, 3, 3, 3, 3, 8), HeldTex: GadgetCoreAPI.LoadTexture2D("items/NexusShield"));
            PlasmaShield.Register("NexusShield");
            ItemInfo NexusShield = new ItemInfo(ItemType.OFFHAND, "Plasmatic Shield", "", GadgetCoreAPI.LoadTexture2D("items/PlasmaShield"), Stats: new EquipStats(7, 5, 5, 5, 5, 5), HeldTex: GadgetCoreAPI.LoadTexture2D("items/PlasmaShield"));

            NexusShield.Register("Plasmahield");
            //equipment
            ItemInfo   SliverCard       = new ItemInfo(ItemType.GENERIC, "Sliver Card", "A rare card \nCan be placed \nIn your ship", GadgetCoreAPI.LoadTexture2D("Cards/SliverCard")).Register("Slivercard");
            GameObject SliverCardPlaced = UnityEngine.Object.Instantiate(GadgetCoreAPI.GetPropResource(2518));
            TileInfo   SliverCardTile   = new TileInfo(TileType.NONSOLID, GadgetCoreAPI.LoadTexture2D("Cards/SliverCardPlaced"), SliverCardPlaced, SliverCard).Register("SliverCardPlaced");

            SliverCardPlaced.GetComponentInChildren <MeshRenderer>().material = new Material(Shader.Find("Unlit/Transparent Cutout"))
            {
                mainTexture = GadgetCoreAPI.LoadTexture2D("Cards/SliverCardPlaced"),
            };
            ItemInfo   GhostCard       = new ItemInfo(ItemType.GENERIC, "Ghostshroom Card", "A rare card \nCan be placed \nIn your ship", GadgetCoreAPI.LoadTexture2D("Cards/GhostShroomCard")).Register("Ghostcard");
            GameObject GhostCardPlaced = UnityEngine.Object.Instantiate(GadgetCoreAPI.GetPropResource(2518));
            TileInfo   GhostCardTile   = new TileInfo(TileType.NONSOLID, GadgetCoreAPI.LoadTexture2D("Cards/GhostShroomCardPlaced"), GhostCardPlaced, GhostCard).Register("GhostCardPlaced");

            GhostCardPlaced.GetComponentInChildren <MeshRenderer>().material = new Material(Shader.Find("Unlit/Transparent Cutout"))
            {
                mainTexture = GadgetCoreAPI.LoadTexture2D("Cards/GhostShroomCardPlaced"),
            };
            ItemInfo   GuardianCard       = new ItemInfo(ItemType.GENERIC, "Guardian Card", "A rare card \nCan be placed \nIn your ship", GadgetCoreAPI.LoadTexture2D("Cards/GuardianCard")).Register("Guardcard");
            GameObject GuardianCardPlaced = UnityEngine.Object.Instantiate(GadgetCoreAPI.GetPropResource(2518));
            TileInfo   GuardianCardTile   = new TileInfo(TileType.NONSOLID, GadgetCoreAPI.LoadTexture2D("Cards/GuardianCardPlaced"), GuardianCardPlaced, GuardianCard).Register("GuardianCardPlaced");

            GuardianCardPlaced.GetComponentInChildren <MeshRenderer>().material = new Material(Shader.Find("Unlit/Transparent Cutout"))
            {
                mainTexture = GadgetCoreAPI.LoadTexture2D("Cards/GuardianCardPlaced"),
            };
            ItemInfo   BlankCard       = new ItemInfo(ItemType.GENERIC, "Blank Card", "A rare card \nCard Mimic.", GadgetCoreAPI.LoadTexture2D("Cards/BlankCard")).Register("Blankcard");
            GameObject BlankCardPlaced = UnityEngine.Object.Instantiate(GadgetCoreAPI.GetPropResource(2518));
            TileInfo   BlankCardTile   = new TileInfo(TileType.NONSOLID, GadgetCoreAPI.LoadTexture2D("Cards/BlankCardPlaced"), BlankCardPlaced, BlankCard).Register("BlankCardPlaced");

            BlankCardPlaced.GetComponentInChildren <MeshRenderer>().material = new Material(Shader.Find("Unlit/Transparent Cutout"))
            {
                mainTexture = GadgetCoreAPI.LoadTexture2D("Cards/BlankCardPlaced"),
            };
            //cards
            MykonogreToken = new ItemInfo(ItemType.EMBLEM, "Mykonogre Token", "A token dropped from \n Mykonogre \n used to craft items at the universal crafter.", GadgetCoreAPI.LoadTexture2D("MykonogreToken"));
            MykonogreToken.Register("MykonogreToken");

            FellbugToken = new ItemInfo(ItemType.EMBLEM, "Fellbug Token", "A token dropped from \n Fellbug. \n Used to craft items at the universal crafter.", GadgetCoreAPI.LoadTexture2D("FellbugToken"));
            FellbugToken.Register("FellbugToken");

            GladriaToken = new ItemInfo(ItemType.EMBLEM, "Gladria Token", "A token dropped from \n Glaedria. \n used to craft items at the universal crafter.", GadgetCoreAPI.LoadTexture2D("GladriaToken"));
            GladriaToken.Register("GladriaToken");
            //tokens
            //FellbugToken.AddToLootTable("entity:fellbug", 1.0f, 1);
            //GladriaToken.AddToLootTable("entity:glaedria", 1.0f, 1);
            //loot pools
            //plasmathrower
            ItemInfo energiteItem = new ItemInfo(ItemType.LOOT | ItemType.ORE | ItemType.TIER7, "Energite", "LOOT - ORE\nTIER: 7",
                                                 GadgetCoreAPI.LoadTexture2D("Items/Energite")).Register("energyore");
            ItemInfo plasmaFernItem = new ItemInfo(ItemType.LOOT | ItemType.PLANT | ItemType.TIER7, "Plasma Fern", "LOOT - PLANT\nTIER: 7",
                                                   GadgetCoreAPI.LoadTexture2D("Items/PlasmaFern")).Register("fern");
            ItemInfo powerCrystalItem = new ItemInfo(ItemType.LOOT | ItemType.MONSTER | ItemType.TIER7, "Power Crystal", "LOOT - MONSTER PART\nTIER: 7",
                                                     GadgetCoreAPI.LoadTexture2D("Items/PowerCrystal")).Register("powercrystal");
            ItemInfo lightingBugItem = new ItemInfo(ItemType.LOOT | ItemType.BUG | ItemType.TIER7, "Lightning Bug", "LOOT - BUG\nTIER: 7",
                                                    GadgetCoreAPI.LoadTexture2D("Items/LightningBug")).Register("lightningbug");

            //Resin
            //Needle
            //Worm Tooth
            //Bookworm Larva
            ItemInfo resinItem = new ItemInfo(ItemType.LOOT | ItemType.ORE | ItemType.TIER7, "Resin", "LOOT - ORE\nTIER: 8",
                                              GadgetCoreAPI.LoadTexture2D("Items/Energite")).Register("resin");
            ItemInfo pineNeedleItem = new ItemInfo(ItemType.LOOT | ItemType.PLANT | ItemType.TIER7, "Pine Needle", "LOOT - PLANT\nTIER: 8",
                                                   GadgetCoreAPI.LoadTexture2D("Items/PlasmaFern")).Register("pineneedle");
            ItemInfo WormToothItem = new ItemInfo(ItemType.LOOT | ItemType.MONSTER | ItemType.TIER7, "Worm Tooth", "LOOT - MONSTER PART\nTIER: 8",
                                                  GadgetCoreAPI.LoadTexture2D("Items/PowerCrystal")).Register("wormtooth");
            ItemInfo bookwormLarvaItem = new ItemInfo(ItemType.LOOT | ItemType.BUG | ItemType.TIER7, "Bookworm Larva", "LOOT - BUG\nTIER: 8",
                                                      GadgetCoreAPI.LoadTexture2D("Items/LightningBug")).Register("bookwormlarva");


            ItemInfo energiteEmblemItem = new ItemInfo(ItemType.EMBLEM | ItemType.ORE | ItemType.TIER7, "Energite Emblem", "Tier 7.\nA shiny Token. Used\nto forge items.",
                                                       GadgetCoreAPI.LoadTexture2D("Items/EnergiteEmblem")).Register("energyemblem");
            ItemInfo fernEmblemItem = new ItemInfo(ItemType.EMBLEM | ItemType.PLANT | ItemType.TIER7, "Fern Emblem", "Tier 7.\nA shiny Token. Used\nto forge items.",
                                                   GadgetCoreAPI.LoadTexture2D("Items/FernEmblem")).Register("fernemblem");
            ItemInfo powerEmblemItem = new ItemInfo(ItemType.EMBLEM | ItemType.MONSTER | ItemType.TIER7, "Power Emblem", "Tier 7.\nA shiny Token. Used\nto forge items.",
                                                    GadgetCoreAPI.LoadTexture2D("Items/PowerEmblem")).Register("poweremblem");
            ItemInfo lightingEmblemItem = new ItemInfo(ItemType.EMBLEM | ItemType.BUG | ItemType.TIER7, "Lightning Emblem", "Tier 7.\nA shiny Token. Used\nto forge items.",
                                                       GadgetCoreAPI.LoadTexture2D("Items/LightningEmblem")).Register("lightningemblem");

            ItemInfo plasmaTracerItem = new ItemInfo(ItemType.CONSUMABLE, "Plasma Tracer", "Grants 3 portal uses to\nThe Plasma Zone.",
                                                     GadgetCoreAPI.LoadTexture2D("Items/PlasmaTracer"), 32).Register();

            ItemInfo healthPack4Item = new ItemInfo(ItemType.CONSUMABLE, "Health Pack IV", "Restores 18 Health.",
                                                    GadgetCoreAPI.LoadTexture2D("Items/HealthPack4")).Register();

            ItemInfo TydusRing  = new ItemInfo(ItemType.RING, "Tydus Ring", "", GadgetCoreAPI.GetItemMaterial(909), Stats: new EquipStats(0, 0, 3, 3, 0, 0)).Register(909);
            ItemInfo OwainPearl = new ItemInfo(ItemType.RING, "Owain's Pearl", "", GadgetCoreAPI.LoadTexture2D("Items/OwainPearl"), Stats: new EquipStats(2, 1, 1, 1, 1, 1)).Register("OwainRing", 908);
            ItemInfo VaatiBadge = new ItemInfo(ItemType.RING, "Vaati Badge", "", GadgetCoreAPI.GetItemMaterial(910), Stats: new EquipStats(2, 0, 2, 0, 2, 1)).Register(910);

            healthPack4Item.OnUse += (slot) =>
            {
                InstanceTracker.GameScript.GetComponent <AudioSource>().PlayOneShot((AudioClip)Resources.Load("Au/drink"), Menuu.soundLevel / 10f);
                InstanceTracker.GameScript.RecoverHP(18);
                return(true);
            };
            ItemInfo manaPack4Item = new ItemInfo(ItemType.CONSUMABLE, "Mana Pack IV", "Restores 50 Mana.",
                                                  GadgetCoreAPI.LoadTexture2D("Items/ManaPack4")).Register();

            manaPack4Item.OnUse += (slot) =>
            {
                InstanceTracker.GameScript.GetComponent <AudioSource>().PlayOneShot((AudioClip)Resources.Load("Au/drink"), Menuu.soundLevel / 10f);
                InstanceTracker.GameScript.RecoverMana(50);
                return(true);
            };
            ItemInfo energyPack4Item = new ItemInfo(ItemType.CONSUMABLE, "Energy Pack IV", "Restores 100 Stamina.\nGrants a temporary\nspeed boost.",
                                                    GadgetCoreAPI.LoadTexture2D("Items/EnergyPack4")).Register();

            energyPack4Item.OnUse += (slot) =>
            {
                InstanceTracker.GameScript.GetComponent <AudioSource>().PlayOneShot((AudioClip)Resources.Load("Au/drink"), Menuu.soundLevel / 10f);
                InstanceTracker.GameScript.RecoverStamina(100);
                InstanceTracker.GameScript.StartCoroutine(EnergyPackSpeedBoost(15, 10));
                return(true);
            };

            GadgetCoreAPI.AddAlchemyStationRecipe(Tuple.Create(plasmaFernItem.GetID(), powerCrystalItem.GetID(), lightingBugItem.GetID()), new Item(healthPack4Item.GetID(), 1, 0, 0, 0, new int[3], new int[3]), 2);
            GadgetCoreAPI.AddAlchemyStationRecipe(Tuple.Create(plasmaFernItem.GetID(), lightingBugItem.GetID(), powerCrystalItem.GetID()), new Item(manaPack4Item.GetID(), 1, 0, 0, 0, new int[3], new int[3]), 2);
            GadgetCoreAPI.AddAlchemyStationRecipe(Tuple.Create(lightingBugItem.GetID(), plasmaFernItem.GetID(), powerCrystalItem.GetID()), new Item(energyPack4Item.GetID(), 1, 0, 0, 0, new int[3], new int[3]), 2);
            GadgetCoreAPI.AddAlchemyStationRecipe(Tuple.Create(lightingBugItem.GetID(), powerCrystalItem.GetID(), plasmaFernItem.GetID()), new Item(63, 4, 0, 0, 0, new int[3], new int[3]), 3);

            ((CraftMenuInfo)MenuRegistry.Singleton["Gadget Core:Crafter Menu"]).AddCraftPerformer(CraftMenuInfo.CreateSimpleCraftPerformer(
                                                                                                      Tuple.Create(new int[] { 136, 74, 136 }, new Item(plasmaTracerItem.GetID(), 1, 0, 0, 0, new int[3], new int[3]), 0)
                                                                                                      ));
            ((CraftMenuInfo)MenuRegistry.Singleton["Gadget Core:Crafter Menu"]).AddCraftPerformer(CraftMenuInfo.CreateSimpleCraftPerformer(Tuple.Create(new int[] { fernEmblemItem.GetID(), powerEmblemItem.GetID(), energiteEmblemItem.GetID() }, new Item(PlasmaCannon.GetID(), 1, 0, 3, 0, new int[3], new int[3]), 0)));
            ((CraftMenuInfo)MenuRegistry.Singleton["Gadget Core:Crafter Menu"]).AddCraftPerformer(CraftMenuInfo.CreateSimpleCraftPerformer(Tuple.Create(new int[] { energiteEmblemItem.GetID(), fernEmblemItem.GetID(), lightingEmblemItem.GetID() }, new Item(PlasmaShield.GetID(), 1, 0, 3, 0, new int[3], new int[3]), 0)));
            //((CraftMenuInfo)MenuRegistry.Singleton["Gadget Core:Crafter Menu"]).AddCraftPerformer(CraftMenuInfo.CreateSimpleCraftPerformer(Tuple.Create(new int[] { energiteEmblemItem.GetID(), powerEmblemItem.GetID(), fernEmblemItem.GetID() }, new Item(PlasmaLance.GetID(), 1, 0, 3, 0, new int[3], new int[3]), 0)));
            ((CraftMenuInfo)MenuRegistry.Singleton["Gadget Core:Crafter Menu"]).AddCraftPerformer(CraftMenuInfo.CreateSimpleCraftPerformer(Tuple.Create(new int[] { energiteEmblemItem.GetID(), lightingEmblemItem.GetID(), fernEmblemItem.GetID() }, new Item(PlasmaArmor.GetID(), 1, 0, 3, 0, new int[3], new int[3]), 0)));
            ((CraftMenuInfo)MenuRegistry.Singleton["Gadget Core:Crafter Menu"]).AddCraftPerformer(CraftMenuInfo.CreateSimpleCraftPerformer(Tuple.Create(new int[] { fernEmblemItem.GetID(), lightingEmblemItem.GetID(), energiteEmblemItem.GetID() }, new Item(PlasmaHelmet.GetID(), 1, 0, 3, 0, new int[3], new int[3]), 0)));
            ((CraftMenuInfo)MenuRegistry.Singleton["Gadget Core:Crafter Menu"]).AddCraftPerformer(CraftMenuInfo.CreateSimpleCraftPerformer(Tuple.Create(new int[] { powerEmblemItem.GetID(), lightingEmblemItem.GetID(), energiteEmblemItem.GetID() }, new Item(NebulaCannon.GetID(), 1, 0, 3, 0, new int[3], new int[3]), 0)));
            ((CraftMenuInfo)MenuRegistry.Singleton["Gadget Core:Crafter Menu"]).AddCraftPerformer(CraftMenuInfo.CreateSimpleCraftPerformer(Tuple.Create(new int[] { fernEmblemItem.GetID(), energiteEmblemItem.GetID(), powerEmblemItem.GetID() }, new Item(particleAccelerator.GetID(), 1, 0, 3, 0, new int[3], new int[3]), 0)));
            ((CraftMenuInfo)MenuRegistry.Singleton["Gadget Core:Crafter Menu"]).AddCraftPerformer(CraftMenuInfo.CreateSimpleCraftPerformer(Tuple.Create(new int[] { fernEmblemItem.GetID(), powerEmblemItem.GetID(), lightingEmblemItem.GetID() }, new Item(NexusHelmet.GetID(), 1, 0, 3, 0, new int[3], new int[3]), 0)));
            ((CraftMenuInfo)MenuRegistry.Singleton["Gadget Core:Crafter Menu"]).AddCraftPerformer(CraftMenuInfo.CreateSimpleCraftPerformer(Tuple.Create(new int[] { powerEmblemItem.GetID(), fernEmblemItem.GetID(), lightingEmblemItem.GetID() }, new Item(NexusArmor.GetID(), 1, 0, 3, 0, new int[3], new int[3]), 0)));
            ((CraftMenuInfo)MenuRegistry.Singleton["Gadget Core:Crafter Menu"]).AddCraftPerformer(CraftMenuInfo.CreateSimpleCraftPerformer(Tuple.Create(new int[] { lightingEmblemItem.GetID(), fernEmblemItem.GetID(), powerEmblemItem.GetID() }, new Item(NexusShield.GetID(), 1, 0, 3, 0, new int[3], new int[3]), 0)));
            ((CraftMenuInfo)MenuRegistry.Singleton["Gadget Core:Crafter Menu"]).AddCraftPerformer(CraftMenuInfo.CreateSimpleCraftPerformer(Tuple.Create(new int[] { powerEmblemItem.GetID(), energiteEmblemItem.GetID(), fernEmblemItem.GetID() }, new Item(plantain.GetID(), 1, 0, 3, 0, new int[3], new int[3]), 0)));
            GadgetCoreAPI.AddCreationMachineRecipe(powerEmblemItem.GetID(), new Item(1030, 1, 0, 0, 0, new int[3], new int[3]));
            GadgetCoreAPI.AddCreationMachineRecipe(energiteEmblemItem.GetID(), new Item(909, 1, 0, 0, 0, new int[3], new int[3]));
            GadgetCoreAPI.AddCreationMachineRecipe(fernEmblemItem.GetID(), new Item(908, 1, 0, 0, 0, new int[3], new int[3]));
            GadgetCoreAPI.AddCreationMachineRecipe(lightingEmblemItem.GetID(), new Item(910, 1, 0, 0, 0, new int[3], new int[3]));
            GadgetCoreAPI.AddAlchemyStationRecipe(Tuple.Create(21, 31, 11), new Item(64, 1, 0, 0, 0, new int[3], new int[3]), 3);
            GadgetCoreAPI.AddAlchemyStationRecipe(Tuple.Create(32, 22, 12), new Item(68, 1, 0, 0, 0, new int[3], new int[3]), 3);
            GadgetCoreAPI.AddAlchemyStationRecipe(Tuple.Create(33, 23, 13), new Item(69, 1, 0, 0, 0, new int[3], new int[3]), 3);
            GadgetCoreAPI.AddAlchemyStationRecipe(Tuple.Create(34, 24, 14), new Item(63, 1, 0, 0, 0, new int[3], new int[3]), 3);
            //crafting recipes

            ObjectInfo EnergiteOre      = new ObjectInfo(ObjectType.ORE, new Item(energiteItem.GetID(), 1, 0, 0, 0, new int[3], new int[3]), 1, GadgetCoreAPI.LoadTexture2D("Planets/Plasma Zone/Energite")).Register("TestObject");
            ObjectInfo PlasmaFern       = new ObjectInfo(ObjectType.PLANT, new Item(plasmaFernItem.GetID(), 1, 0, 0, 0, new int[3], new int[3]), 1, GadgetCoreAPI.LoadTexture2D("Planets/Plasma Zone/Fern")).Register("PlasmaFern");
            ObjectInfo LightningBugTree = new ObjectInfo(ObjectType.BUGSPOT, new Item(lightingBugItem.GetID(), 1, 0, 0, 0, new int[3], new int[3]), 1, GadgetCoreAPI.LoadTexture2D("Planets/Plasma Zone/LightningBugNode"), GadgetCoreAPI.LoadTexture2D("Planets/Plasma Zone/LightningBugBody"), GadgetCoreAPI.LoadTexture2D("Planets/Plasma Zone/LightningBugWing")).Register("LightningBugTree");
            GameObject ParticleDragon   = UnityEngine.Object.Instantiate(GadgetCoreAPI.GetEntityResource("wyvern"));

            ParticleDragon.name = "particleWyvern";
            UnityEngine.Object.Destroy(ParticleDragon.GetComponent <WyvernScript>());
            ParticleDragon.AddComponent <ParticleWyvernScript>();
            ParticleDragon.transform.Find("e").Find("wyvern").Find("Plane").GetComponent <MeshRenderer>().material = new Material(Shader.Find("Unlit/Transparent Cutout"))
            {
                mainTexture = GadgetCoreAPI.LoadTexture2D("enemies/particlewyvernhead"),
            };
            ParticleDragon.transform.Find("e").Find("wyvern").Find("Plane_001").GetComponent <MeshRenderer>().material = new Material(Shader.Find("Unlit/Transparent Cutout"))
            {
                mainTexture = GadgetCoreAPI.LoadTexture2D("enemies/particlewyvernbody"),
            };
            ParticleDragon.transform.Find("e").Find("wyvern").Find("Plane_002").GetComponent <MeshRenderer>().material = new Material(Shader.Find("Unlit/Transparent Cutout"))
            {
                mainTexture = GadgetCoreAPI.LoadTexture2D("enemies/particlewyverntail"),
            };
            ParticleDragon.transform.Find("e").Find("wyvern").Find("Plane_003").GetComponent <MeshRenderer>().material = new Material(Shader.Find("Unlit/Transparent Cutout"))
            {
                mainTexture = GadgetCoreAPI.LoadTexture2D("enemies/particlewyvernwing"),
            };
            ParticleDragon.transform.Find("e").Find("wyvern").Find("Plane_004").GetComponent <MeshRenderer>().material = new Material(Shader.Find("Unlit/Transparent Cutout"))
            {
                mainTexture = GadgetCoreAPI.LoadTexture2D("enemies/particlewyvernwing"),
            };
            EntityInfo ParticleWyvern = new EntityInfo(EntityType.COMMON, ParticleDragon).Register("ParticleWyvern");

            powerCrystalItem.AddToLootTable("entity:particleWyvern", 1.0f, 0, 4);

            GameObject MykBug = UnityEngine.Object.Instantiate(GadgetCoreAPI.GetEntityResource("spider"));

            MykBug.name = "Mykdunebug";
            MykBug.SetActive(false);
            MykBug.ReplaceComponent <SpiderScript, MykBugScript>();
            MykBug.GetComponent <Rigidbody>().useGravity = true;
            //SpiderScript spiderScript = MykBug.GetComponent<SpiderScript>();
            //GameObject mykBugHead = spiderScript.head;
            //GameObject mykBugBody = spiderScript.body;
            //GameObject mykBugLeg = spiderScript.leg;
            //GameObject mykBugB = spiderScript.b;
            //UnityEngine.Object.Destroy(spiderScript);
            //MykBugScript mykBugScript = MykBug.AddComponent<MykBugScript>();
            //mykBugScript.head = mykBugHead;
            //mykBugScript.body = mykBugBody;
            //mykBugScript.leg = mykBugLeg;
            //mykBugScript.b = mykBugB;
            MykBug.transform.Find("e").Find("dunebug").Find("Plane").GetComponent <MeshRenderer>().material = new Material(Shader.Find("Unlit/Transparent Cutout"))
            {
                mainTexture = GadgetCoreAPI.LoadTexture2D("enemies/MykDunebug/Head"),
            };
            MykBug.transform.Find("e").Find("dunebug").Find("Plane_001").GetComponent <MeshRenderer>().material = new Material(Shader.Find("Unlit/Transparent Cutout"))
            {
                mainTexture = GadgetCoreAPI.LoadTexture2D("enemies/MykDunebug/Body"),
            };
            MykBug.transform.Find("e").Find("dunebug").Find("Plane_002").GetComponent <MeshRenderer>().material = new Material(Shader.Find("Unlit/Transparent Cutout"))
            {
                mainTexture = GadgetCoreAPI.LoadTexture2D("enemies/MykDunebug/Back"),
            };
            MykBug.transform.Find("e").Find("dunebug").Find("Plane_003").GetComponent <MeshRenderer>().material = new Material(Shader.Find("Unlit/Transparent Cutout"))
            {
                mainTexture = GadgetCoreAPI.LoadTexture2D("enemies/MykDunebug/Legs"),
            };
            MykBug.transform.Find("e").Find("dunebug").Find("Plane_004").GetComponent <MeshRenderer>().material = new Material(Shader.Find("Unlit/Transparent Cutout"))
            {
                mainTexture = GadgetCoreAPI.LoadTexture2D("enemies/MykDunebug/Wings"),
            };
            MykBug.transform.Find("e").Find("dunebug").Find("Plane_005").GetComponent <MeshRenderer>().material = new Material(Shader.Find("Unlit/Transparent Cutout"))
            {
                mainTexture = GadgetCoreAPI.LoadTexture2D("enemies/MykDunebug/Wings"),
            };
            EntityInfo MykDunebug = new EntityInfo(EntityType.COMMON, MykBug).Register("Mykdunebug");

            GameObject MykWasp = UnityEngine.Object.Instantiate(GadgetCoreAPI.GetEntityResource("wasp"));

            MykWasp.name = "MykWasp";
            MykWasp.SetActive(false);
            MykWasp.ReplaceComponent <WaspScript, MykWaspScript>();
            EntityInfo mykWasp = new EntityInfo(EntityType.COMMON, MykWasp).Register("MykWasp");

            GameObject testProjEnemy = UnityEngine.Object.Instantiate(GadgetCoreAPI.GetEntityResource("sponge"));

            testProjEnemy.name = "testProjEnemy";
            testProjEnemy.SetActive(false);
            testProjEnemy.ReplaceComponent <SpongeScript, TestProjScript>();
            EntityInfo TestProjEnemy = new EntityInfo(EntityType.COMMON, testProjEnemy).Register("testProjEnemy");

            manaPack4Item.AddToLootTable("entity:testProjEnemy", 0.5f, 0, 2);
            powerCrystalItem.AddToLootTable("entity:testProjEnemy", 0.5f, 0, 4);


            GameObject lavadragonPrefab = GadgetCoreAPI.GetEntityResource("lavadragon");

            lavadragonPrefab.SetActive(false);
            GameObject bigPlasmaDragon = UnityEngine.Object.Instantiate(lavadragonPrefab);
            //bigPlasmaDragon.name = "bigplasmadragon";
            //foreach (Millipede m in bigPlasmaDragon.GetComponentsInChildren<Millipede>())
            //{
            //Transform part = m.transform;

            //m.gameObject.ReplaceComponent<Millipede, Millipede>();
            //part.gameObject.AddComponent<PlasmaDragonScript>().isMainHead = part.name == "0";
            //}
            EntityInfo bigPlasmaDerg = new EntityInfo(EntityType.BOSS, bigPlasmaDragon).Register("bigplasmadragon");


            PlanetInfo plasmaZonePlanet = new PlanetInfo(PlanetType.NORMAL, "Plasmatic Rift", new Tuple <int, int>[] { Tuple.Create(-1, 1), Tuple.Create(13, 1) }, GadgetCoreAPI.LoadAudioClip("Planets/Plasma Zone/Music"));

            plasmaZonePlanet.SetTerrainInfo(GadgetCoreAPI.LoadTexture2D("Planets/Plasma Zone/Entrance"), GadgetCoreAPI.LoadTexture2D("Planets/Plasma Zone/Zone"),
                                            GadgetCoreAPI.LoadTexture2D("Planets/Plasma Zone/MidChunkFull"), GadgetCoreAPI.LoadTexture2D("Planets/Plasma Zone/MidChunkOpen"),
                                            GadgetCoreAPI.LoadTexture2D("Planets/Plasma Zone/SideH"), GadgetCoreAPI.LoadTexture2D("Planets/Plasma Zone/SideV"));
            plasmaZonePlanet.SetBackgroundInfo(GadgetCoreAPI.LoadTexture2D("Planets/Plasma Zone/Parallax"),
                                               GadgetCoreAPI.LoadTexture2D("Planets/Plasma Zone/Background0"), GadgetCoreAPI.LoadTexture2D("Planets/Plasma Zone/Background1"),
                                               GadgetCoreAPI.LoadTexture2D("Planets/Plasma Zone/Background2"), GadgetCoreAPI.LoadTexture2D("Planets/Plasma Zone/Background3"));
            plasmaZonePlanet.SetPortalInfo(GadgetCoreAPI.LoadTexture2D("Planets/Plasma Zone/Sign"), GadgetCoreAPI.LoadTexture2D("Planets/Plasma Zone/Button"),
                                           GadgetCoreAPI.LoadTexture2D("Planets/Plasma Zone/Icon"));
            plasmaZonePlanet.Register("Plasma Zone");
            plasmaZonePlanet.AddWeightedWorldSpawn(EnergiteOre, 15);
            plasmaZonePlanet.AddWeightedWorldSpawn(ParticleWyvern, 25);
            plasmaZonePlanet.AddWeightedWorldSpawn(LightningBugTree, 15);
            plasmaZonePlanet.AddWeightedWorldSpawn(PlasmaFern, 15);
            plasmaZonePlanet.AddWeightedWorldSpawn(TestProjEnemy, 15);
            //plasmaZonePlanet.AddWeightedWorldSpawn(bigPlasmaDerg, 40);
            plasmaZonePlanet.AddWeightedWorldSpawn("obj/chest", 20);
            plasmaZonePlanet.AddWeightedWorldSpawn("obj/chestGold", 1);
            plasmaZonePlanet.AddWeightedTownSpawn("obj/chest", 25);
            plasmaZonePlanet.AddWeightedTownSpawn("obj/itemStand", 25);
            plasmaZonePlanet.AddWeightedTownSpawn("obj/chipStand", 25);
            plasmaZonePlanet.AddWeightedWorldSpawn((pos) => (GameObject)null, 2);
            plasmaZonePlanet.AddWeightedTownSpawn((pos) => (GameObject)null, 25);
            plasmaZonePlanet.AddWeightedWorldSpawn("obj/relic", 5);
            //plasmaZonePlanet.AddWeightedWorldSpawn();
            PlanetRegistry.SetVanillaExitPortalWeight(13, plasmaZonePlanet.GetID(), 75);

            PlanetInfo MykPlanet = new PlanetInfo(PlanetType.NORMAL, "Mykonogre's Zone", new Tuple <int, int>[] { Tuple.Create(-1, 1) }, GadgetCoreAPI.LoadAudioClip("Planets/Plasma Zone/Music"));

            MykPlanet.SetTerrainInfo(GadgetCoreAPI.LoadTexture2D("Planets/MykWorld/Entrance"), GadgetCoreAPI.LoadTexture2D("Planets/MykWorld/Zone"),
                                     GadgetCoreAPI.LoadTexture2D("Planets/MykWorld/MidChunkFull"), GadgetCoreAPI.LoadTexture2D("Planets/MykWorld/MidChunkOpen"),
                                     GadgetCoreAPI.LoadTexture2D("Planets/MykWorld/SideH"), GadgetCoreAPI.LoadTexture2D("Planets/MykWorld/SideV"));
            MykPlanet.SetBackgroundInfo(GadgetCoreAPI.LoadTexture2D("Planets/MykWorld/Parallax"),
                                        GadgetCoreAPI.LoadTexture2D("Planets/MykWorld/bg0"), GadgetCoreAPI.LoadTexture2D("Planets/MykWorld/bg1"),
                                        GadgetCoreAPI.LoadTexture2D("Planets/MykWorld/bg2"), GadgetCoreAPI.LoadTexture2D("Planets/MykWorld/bg3"));
            MykPlanet.SetPortalInfo(GadgetCoreAPI.LoadTexture2D("Planets/Mykworld/MykSign"), GadgetCoreAPI.LoadTexture2D("Planets/MykWorld/Button"),
                                    GadgetCoreAPI.LoadTexture2D("Planets/MykWorld/Planet"));
            MykPlanet.Register("Mykonogre Zone");
            MykPlanet.AddWeightedWorldSpawn(MykDunebug, 1);
            MykPlanet.AddWeightedWorldSpawn(mykWasp, 1);
            MykPlanet.OnGenerateWorld += (spawner, s) => spawner.StartCoroutine(SpawnMykonogre2());


            plasmaTracerItem.OnUse += (slot) =>
            {
                plasmaZonePlanet.PortalUses += 3;
                InstanceTracker.GameScript.GetComponent <AudioSource>().PlayOneShot((AudioClip)Resources.Load("Au/glitter"), Menuu.soundLevel / 10f);
                return(true);
            };
            BlankCard.AddToLootTable("entity:all", 0.00013f, 1);
            SliverCard.AddToLootTable("entity:sliver", 0.013f, 1);
            GuardianCard.AddToLootTable("entity:guardian", 0.013f, 1);
            GhostCard.AddToLootTable("entity:shroomy1", 0.013f, 1);
            //MykonogreToken.AddToLootTable("entity:mykonogre", 1.0f, 1, CustomDropBehavior: (item, pos) => {
            //MykPlanet.PortalUses += 3;
            //return true;
            //});
            var recAlchemy = new RecipePage(RecipePageType.AlchemyStation, "Stamina/Misc. Recipes", GadgetCoreAPI.LoadTexture2D("recipesAlch.png")).RegisterAsVanilla(1);

            recAlchemy.AddRecipePageEntry(new RecipePageEntry(21, 11, 31, 62, 1, 2));
            recAlchemy.AddRecipePageEntry(new RecipePageEntry(22, 12, 32, 62, 4, 3));
            recAlchemy.AddRecipePageEntry(new RecipePageEntry(33, 13, 23, 67, 1, 2));
            recAlchemy.AddRecipePageEntry(new RecipePageEntry(34, 14, 24, 67, 4, 3));
            recAlchemy.AddRecipePageEntry(new RecipePageEntry(35, 15, 25, 72, 1, 2));
            recAlchemy.AddRecipePageEntry(new RecipePageEntry(26, 36, 16, 72, 4, 3));

            recAlchemy.AddRecipePageEntry(new RecipePageEntry(21, 31, 11, 64, 1, 2));
            recAlchemy.AddRecipePageEntry(new RecipePageEntry(32, 32, 12, 68, 1, 2));
            recAlchemy.AddRecipePageEntry(new RecipePageEntry(33, 23, 13, 69, 1, 2));
            recAlchemy.AddRecipePageEntry(new RecipePageEntry(34, 24, 14, 63, 1, 2)); // Nuldmg
            recAlchemy.AddRecipePageEntry(new RecipePageEntry(35, 25, 15, 73, 1, 2));
            recAlchemy.AddRecipePageEntry(new RecipePageEntry(36, 16, 26, 74, 1, 2));
        }