Browse Source

[2.0.3.9] Import of Meteoroid Subworlds

Zariteis 4 years ago
parent
commit
5d029ef701
89 changed files with 1288 additions and 504 deletions
  1. 0 0
      Assets/Core/aOldTecArmor.png
  2. 0 0
      Assets/Core/bOldTecArmor.png
  3. 0 0
      Assets/Core/dOldTecDroidBase.png
  4. 0 0
      Assets/Core/dOldTecDroidTop.png
  5. 0 0
      Assets/Core/hOldTecHelmet.png
  6. 0 0
      Assets/Core/iOldCore.png
  7. 0 0
      Assets/Core/iOldTec.png
  8. 0 0
      Assets/Core/iOldTecArmor.png
  9. 0 0
      Assets/Core/iOldTecDroid.png
  10. 0 0
      Assets/Core/iOldTecHelmet.png
  11. 0 0
      Assets/Core/iOldTecMod.png
  12. 0 0
      Assets/Core/iOldTecShield.png
  13. 0 0
      Assets/Meteoroid/bgNone.png
  14. BIN
      Assets/Meteoroid/bgStars.png
  15. BIN
      Assets/Meteoroid/button.png
  16. BIN
      Assets/Meteoroid/icon.png
  17. BIN
      Assets/Meteoroid/meteor1.png
  18. BIN
      Assets/Meteoroid/meteor2.png
  19. BIN
      Assets/Meteoroid/meteor3.png
  20. BIN
      Assets/Meteoroid/meteor4.png
  21. BIN
      Assets/Meteoroid/meteorBaseBG.png
  22. BIN
      Assets/Meteoroid/meteorBaseFG.png
  23. 0 0
      Assets/Meteoroid/parallax.png
  24. BIN
      Assets/Meteoroid/sign.png
  25. BIN
      Assets/Meteoroid/spaceOre.png
  26. BIN
      Assets/Meteoroid/spaceOreBig.png
  27. BIN
      Assets/Meteoroid/spaceOreCrack.png
  28. BIN
      Assets/Ship/bgNone.png
  29. 0 0
      Assets/Ship/bgStars.png
  30. 0 0
      Assets/Ship/brokenChest.png
  31. 0 0
      Assets/Ship/brokenCrates1.png
  32. 0 0
      Assets/Ship/brokenCrates2.png
  33. 0 0
      Assets/Ship/brokenCrates3.png
  34. 0 0
      Assets/Ship/brokenCrates4.png
  35. 0 0
      Assets/Ship/brokenItemMod.png
  36. 0 0
      Assets/Ship/brokenLaser.png
  37. 0 0
      Assets/Ship/brokenPirate1.png
  38. 0 0
      Assets/Ship/brokenPirate2.png
  39. 0 0
      Assets/Ship/brokenPirate3.png
  40. 0 0
      Assets/Ship/brokenPirate4.png
  41. 0 0
      Assets/Ship/brokenPirate5.png
  42. 0 0
      Assets/Ship/brokenPirate6.png
  43. 0 0
      Assets/Ship/brokenSliverHead.png
  44. 0 0
      Assets/Ship/brokenSliverTail.png
  45. 0 0
      Assets/Ship/brokenSliverbody.png
  46. 0 0
      Assets/Ship/brokenTeleporter.png
  47. 0 0
      Assets/Ship/button.png
  48. 0 0
      Assets/Ship/droid.png
  49. 0 0
      Assets/Ship/icon.png
  50. 0 0
      Assets/Ship/oldChest.png
  51. 0 0
      Assets/Ship/oldChestOpen.png
  52. BIN
      Assets/Ship/parallax.png
  53. 0 0
      Assets/Ship/recipesOldTec.png
  54. 0 0
      Assets/Ship/shipAEntranceBG.png
  55. 0 0
      Assets/Ship/shipAEntranceFG.png
  56. 0 0
      Assets/Ship/shipAExitBG.png
  57. 0 0
      Assets/Ship/shipAExitFG.png
  58. 0 0
      Assets/Ship/shipAMainBG.png
  59. 0 0
      Assets/Ship/shipAMainFG.png
  60. 0 0
      Assets/Ship/shuttleMainBG.png
  61. 0 0
      Assets/Ship/shuttleMainFG.png
  62. 0 0
      Assets/Ship/sign.png
  63. 4 1
      Core.cs
  64. 93 0
      Gadgets/CoreGadget.cs
  65. 120 0
      Gadgets/Meteoroid/MeteoroidGadget.Create.cs
  66. 76 0
      Gadgets/Meteoroid/MeteoroidGadget.Init.cs
  67. 247 0
      Gadgets/Ship/ShipsGadget.Create.cs
  68. 125 0
      Gadgets/Ship/ShipsGadget.Init.cs
  69. 311 0
      Generator/MeteroidGenerator.cs
  70. 28 32
      Generator/ShipGenerator.cs
  71. 2 2
      Manifest.ini
  72. 3 3
      Patches/Patch_Chunk_OnDestroy.cs
  73. 3 3
      Patches/Patch_Chunk_SpawnBiomeSlot.cs
  74. 2 2
      Patches/Patch_DroidManager_UA.cs
  75. 2 2
      Patches/Patch_GameScript_AddMod.cs
  76. 2 2
      Patches/Patch_GameScript_GetGearAspect.cs
  77. 2 2
      Patches/Patch_GameScript_InitializeDroids.cs
  78. 2 2
      Patches/Patch_GameScript_RefreshGearMods.cs
  79. 3 3
      Patches/Patch_ObjectScript_Die.cs
  80. 2 2
      Patches/Patch_PlanetRegistry_get_PlanetSelectorPages.cs
  81. 2 2
      Patches/Patch_SceneInjector_InjectIngame.cs
  82. 3 3
      Properties/AssemblyInfo.cs
  83. 1 1
      Properties/launchSettings.json
  84. 1 1
      Scripts/AttackDroidScript.cs
  85. 1 1
      Scripts/BrokenLaserScript.cs
  86. 1 1
      Scripts/OldChestScript.cs
  87. 0 419
      Ships.cs
  88. 249 17
      Subworlds.csproj
  89. 3 3
      Subworlds.sln

+ 0 - 0
Assets/aOldTecArmor.png → Assets/Core/aOldTecArmor.png


+ 0 - 0
Assets/bOldTecArmor.png → Assets/Core/bOldTecArmor.png


+ 0 - 0
Assets/dOldTecDroidBase.png → Assets/Core/dOldTecDroidBase.png


+ 0 - 0
Assets/dOldTecDroidTop.png → Assets/Core/dOldTecDroidTop.png


+ 0 - 0
Assets/hOldTecHelmet.png → Assets/Core/hOldTecHelmet.png


+ 0 - 0
Assets/iOldCore.png → Assets/Core/iOldCore.png


+ 0 - 0
Assets/iOldTec.png → Assets/Core/iOldTec.png


+ 0 - 0
Assets/iOldTecArmor.png → Assets/Core/iOldTecArmor.png


+ 0 - 0
Assets/iOldTecDroid.png → Assets/Core/iOldTecDroid.png


+ 0 - 0
Assets/iOldTecHelmet.png → Assets/Core/iOldTecHelmet.png


+ 0 - 0
Assets/iOldTecMod.png → Assets/Core/iOldTecMod.png


+ 0 - 0
Assets/iOldTecShield.png → Assets/Core/iOldTecShield.png


+ 0 - 0
Assets/bgNone.png → Assets/Meteoroid/bgNone.png


BIN
Assets/Meteoroid/bgStars.png


BIN
Assets/Meteoroid/button.png


BIN
Assets/Meteoroid/icon.png


BIN
Assets/Meteoroid/meteor1.png


BIN
Assets/Meteoroid/meteor2.png


BIN
Assets/Meteoroid/meteor3.png


BIN
Assets/Meteoroid/meteor4.png


BIN
Assets/Meteoroid/meteorBaseBG.png


BIN
Assets/Meteoroid/meteorBaseFG.png


+ 0 - 0
Assets/parallax.png → Assets/Meteoroid/parallax.png


BIN
Assets/Meteoroid/sign.png


BIN
Assets/Meteoroid/spaceOre.png


BIN
Assets/Meteoroid/spaceOreBig.png


BIN
Assets/Meteoroid/spaceOreCrack.png


BIN
Assets/Ship/bgNone.png


+ 0 - 0
Assets/bgStars.png → Assets/Ship/bgStars.png


+ 0 - 0
Assets/brokenChest.png → Assets/Ship/brokenChest.png


+ 0 - 0
Assets/brokenCrates1.png → Assets/Ship/brokenCrates1.png


+ 0 - 0
Assets/brokenCrates2.png → Assets/Ship/brokenCrates2.png


+ 0 - 0
Assets/brokenCrates3.png → Assets/Ship/brokenCrates3.png


+ 0 - 0
Assets/brokenCrates4.png → Assets/Ship/brokenCrates4.png


+ 0 - 0
Assets/brokenItemMod.png → Assets/Ship/brokenItemMod.png


+ 0 - 0
Assets/brokenLaser.png → Assets/Ship/brokenLaser.png


+ 0 - 0
Assets/brokenPirate1.png → Assets/Ship/brokenPirate1.png


+ 0 - 0
Assets/brokenPirate2.png → Assets/Ship/brokenPirate2.png


+ 0 - 0
Assets/brokenPirate3.png → Assets/Ship/brokenPirate3.png


+ 0 - 0
Assets/brokenPirate4.png → Assets/Ship/brokenPirate4.png


+ 0 - 0
Assets/brokenPirate5.png → Assets/Ship/brokenPirate5.png


+ 0 - 0
Assets/brokenPirate6.png → Assets/Ship/brokenPirate6.png


+ 0 - 0
Assets/brokenSliverHead.png → Assets/Ship/brokenSliverHead.png


+ 0 - 0
Assets/brokenSliverTail.png → Assets/Ship/brokenSliverTail.png


+ 0 - 0
Assets/brokenSliverbody.png → Assets/Ship/brokenSliverbody.png


+ 0 - 0
Assets/brokenTeleporter.png → Assets/Ship/brokenTeleporter.png


+ 0 - 0
Assets/planetShipPrev.png → Assets/Ship/button.png


+ 0 - 0
Assets/droid.png → Assets/Ship/droid.png


+ 0 - 0
Assets/planetShip.png → Assets/Ship/icon.png


+ 0 - 0
Assets/oldChest.png → Assets/Ship/oldChest.png


+ 0 - 0
Assets/oldChestOpen.png → Assets/Ship/oldChestOpen.png


BIN
Assets/Ship/parallax.png


+ 0 - 0
Assets/recipesOldTec.png → Assets/Ship/recipesOldTec.png


+ 0 - 0
Assets/shipAEntranceBG.png → Assets/Ship/shipAEntranceBG.png


+ 0 - 0
Assets/shipAEntranceFG.png → Assets/Ship/shipAEntranceFG.png


+ 0 - 0
Assets/shipAExitBG.png → Assets/Ship/shipAExitBG.png


+ 0 - 0
Assets/shipAExitFG.png → Assets/Ship/shipAExitFG.png


+ 0 - 0
Assets/shipAMainBG.png → Assets/Ship/shipAMainBG.png


+ 0 - 0
Assets/shipAMainFG.png → Assets/Ship/shipAMainFG.png


+ 0 - 0
Assets/shuttleMainBG.png → Assets/Ship/shuttleMainBG.png


+ 0 - 0
Assets/shuttleMainFG.png → Assets/Ship/shuttleMainFG.png


+ 0 - 0
Assets/signShip.png → Assets/Ship/sign.png


+ 4 - 1
Core.cs

@@ -2,12 +2,15 @@
 using GadgetCore.API;
 using GadgetCore.API;
 using System.Collections.Generic;
 using System.Collections.Generic;
 
 
-namespace Ships
+namespace Subworlds
 {
 {
   internal static class Core
   internal static class Core
   {
   {
     public static GadgetLogger logger;
     public static GadgetLogger logger;
+
     public static PlanetInfo shipPlanet;
     public static PlanetInfo shipPlanet;
+    public static PlanetInfo meteroidPlanet;
+
     public static bool shipPorterPlaced;
     public static bool shipPorterPlaced;
     public static List<int> spawnObjects = new List<int>();
     public static List<int> spawnObjects = new List<int>();
 
 

+ 93 - 0
Gadgets/CoreGadget.cs

@@ -0,0 +1,93 @@
+using GadgetCore.API;
+using GadgetCore.Util;
+using RecipeMenuCore.API;
+using System.Collections;
+using UnityEngine;
+
+namespace Subworlds
+{
+  [Gadget("SubworldCore", LoadAfter: new string[] { "RecipeMenuCore" }, Dependencies: new string[] { "RecipeMenuCore" })]
+  public class CoreGadget : Gadget<CoreGadget>
+  {
+    public const string MOD_VERSION = "1.0"; // Set this to the version of your mod.
+    public const string CONFIG_VERSION = "1.0"; // Increment this whenever you change your mod's config file.
+
+    protected override void LoadConfig()
+    {
+      Config.Load();
+
+      string fileVersion = Config.ReadString("ConfigVersion", CONFIG_VERSION, comments: "The Config Version (not to be confused with mod version)");
+
+      if (fileVersion != CONFIG_VERSION)
+      {
+        Config.Reset();
+        Config.WriteString("ConfigVersion", CONFIG_VERSION, comments: "The Config Version (not to be confused with mod version)");
+      }
+
+      Config.Save();
+    }
+
+    public override string GetModDescription()
+    {
+      return "A mod that adds ships that can be reaided.";
+    }
+
+    protected override void Initialize()
+    {
+      Logger.Log("Subworlds v" + Info.Mod.Version);
+      Core.logger = Logger;
+
+      ItemInfo itemInfo = new ItemInfo(ItemType.GENERIC, "port5", "", null as Texture2D).Register("port5");
+      TileInfo tile = new TileInfo(TileType.INTERACTIVE, null as Texture2D, new GameObject("port5"), itemInfo).Register("port5");
+
+      Core.itemOldTex = new ItemInfo(ItemType.GENERIC, "Old Tec", "Some piece of old\ntechnology", GadgetCoreAPI.LoadTexture2D("Core/iOldTec.png"));
+      ItemRegistry.Singleton.Register(Core.itemOldTex, "oldtec");
+
+      Core.itemOldTexShield = new ItemInfo(ItemType.OFFHAND, "Old Tec Shield", "", GadgetCoreAPI.LoadTexture2D("Core/iOldTecShield.png"), Stats: new EquipStats(1, 1, 1, 1, 3, 0),
+         HeldTex: GadgetCoreAPI.LoadTexture2D("Core/iOldTecShield.png"));
+      ItemRegistry.Singleton.Register(Core.itemOldTexShield, "oldtecshield");
+
+      Core.itemOldTexHelmet = new ItemInfo(ItemType.HELMET, "Old Tec Helmet", "", GadgetCoreAPI.LoadTexture2D("Core/iOldTecHelmet.png"), Stats: new EquipStats(1, 1, 1, 1, 3, 0),
+         HeadTex: GadgetCoreAPI.LoadTexture2D("Core/hOldTecHelmet.png"));
+      ItemRegistry.Singleton.Register(Core.itemOldTexHelmet, "oldtechelmet");
+
+      Core.itemOldTexArmor = new ItemInfo(ItemType.ARMOR, "Old Tec Armor", "", GadgetCoreAPI.LoadTexture2D("Core/iOldTecArmor.png"), Stats: new EquipStats(1, 1, 1, 1, 3, 0),
+         BodyTex: GadgetCoreAPI.LoadTexture2D("Core/bOldTecArmor.png"), ArmTex: GadgetCoreAPI.LoadTexture2D("Core/aOldTecArmor.png"));
+      ItemRegistry.Singleton.Register(Core.itemOldTexArmor, "oldtecarmor");
+
+      Core.itemOldTexDroid = new ItemInfo(ItemType.DROID, "Old Tec Droid", "", GadgetCoreAPI.LoadTexture2D("Core/iOldTecDroid.png"), Stats: new EquipStats(1, 1, 1, 1, 3, 0),
+         BodyTex: GadgetCoreAPI.LoadTexture2D("Core/dOldTecDroidBase.png"), HeadTex: GadgetCoreAPI.LoadTexture2D("Core/dOldTecDroidTop.png"));
+      ItemRegistry.Singleton.Register(Core.itemOldTexDroid, "oldtecdroid");
+
+      Core.itemOldTexMod = new ItemInfo(ItemType.MOD, "GearModStackSize+", "GEAR MOD\nAttach to weapons\nand armor in Mech City.", GadgetCoreAPI.LoadTexture2D("Core/iOldTecMod.png"));
+      ItemRegistry.Singleton.Register(Core.itemOldTexMod, "oldtecmod");
+
+      var recipePage = new RecipePage(RecipePageType.UniversalCrafter, "Old Tec", GadgetCoreAPI.LoadTexture2D("Core/recipesOldTec.png")).Register();
+      recipePage.AddRecipePageEntry(new RecipePageEntry(Core.itemOldTex.GetID(), Core.itemOldTex.GetID(), 133, Core.itemOldTexShield.GetID(), allwaysShowInput: true));
+      recipePage.AddRecipePageEntry(new RecipePageEntry(Core.itemOldTex.GetID(), Core.itemOldTex.GetID(), 123, Core.itemOldTexHelmet.GetID(), allwaysShowInput: true));
+      recipePage.AddRecipePageEntry(new RecipePageEntry(Core.itemOldTex.GetID(), Core.itemOldTex.GetID(), 103, Core.itemOldTexArmor.GetID(), allwaysShowInput: true));
+      recipePage.AddRecipePageEntry(new RecipePageEntry(Core.itemOldTex.GetID(), Core.itemOldTex.GetID(), 113, Core.itemOldTexDroid.GetID(), allwaysShowInput: true));
+      recipePage.AddRecipePageEntry(new RecipePageEntry(Core.itemOldTex.GetID(), Core.itemOldTex.GetID(), 210, Core.itemOldTexMod.GetID(), allwaysShowInput: true));
+
+      var universalCrafter = ((CraftMenuInfo)MenuRegistry.Singleton["Gadget Core:Crafter Menu"]);
+      universalCrafter.AddCraftPerformer(CraftMenuInfo.CreateSimpleCraftPerformer(
+        Tuple.Create(new int[] { Core.itemOldTex.GetID(), Core.itemOldTex.GetID(), 133 }, new Item(Core.itemOldTexShield.GetID(), 1, 0, 0, 0, new int[3], new int[3]), 0)));
+      universalCrafter.AddCraftPerformer(CraftMenuInfo.CreateSimpleCraftPerformer(
+       Tuple.Create(new int[] { Core.itemOldTex.GetID(), Core.itemOldTex.GetID(), 123 }, new Item(Core.itemOldTexHelmet.GetID(), 1, 0, 0, 0, new int[3], new int[3]), 0)));
+      universalCrafter.AddCraftPerformer(CraftMenuInfo.CreateSimpleCraftPerformer(
+        Tuple.Create(new int[] { Core.itemOldTex.GetID(), Core.itemOldTex.GetID(), 103 }, new Item(Core.itemOldTexArmor.GetID(), 1, 0, 0, 0, new int[3], new int[3]), 0)));
+      universalCrafter.AddCraftPerformer(CraftMenuInfo.CreateSimpleCraftPerformer(
+        Tuple.Create(new int[] { Core.itemOldTex.GetID(), Core.itemOldTex.GetID(), 113 }, new Item(Core.itemOldTexDroid.GetID(), 1, 0, 0, 0, new int[3], new int[3]), 0)));
+      universalCrafter.AddCraftPerformer(CraftMenuInfo.CreateSimpleCraftPerformer(
+        Tuple.Create(new int[] { Core.itemOldTex.GetID(), Core.itemOldTex.GetID(), 210 }, new Item(Core.itemOldTexMod.GetID(), 1, 0, 0, 0, new int[3], new int[3]), 0)));
+
+      tile.OnInteract += Tile_OnInteract;
+    }
+
+    private IEnumerator Tile_OnInteract()
+    {
+      InstanceTracker.PlayerScript.Portal(5);
+      yield break;
+    }
+  }
+}

+ 120 - 0
Gadgets/Meteoroid/MeteoroidGadget.Create.cs

@@ -0,0 +1,120 @@
+using GadgetCore.API;
+using UnityEngine;
+
+namespace Subworlds
+{
+  public partial class MeteroidGadget : Gadget<MeteroidGadget>
+  {
+    private void CreateBaseBlock(string name, Texture2D texture, float w, float h)
+    {
+      GameObject gameObject = Object.Instantiate<GameObject>((GameObject)Resources.Load("prop/2501"));
+      Renderer renderer = gameObject.GetComponentInChildren<Renderer>();
+      renderer.material = new Material(Shader.Find("Unlit/Transparent"))
+      {
+        mainTexture = texture
+      };
+      gameObject.transform.localScale = new Vector3(w * 2, h * 2, 1);
+      var boxCollider = gameObject.AddComponent<BoxCollider>();
+      boxCollider.size = new Vector3(4, 4, 20);
+      gameObject.layer = 23;
+
+      GadgetCoreAPI.AddCustomResource("z/Subworlds/" + name, gameObject);
+    }
+
+    private void CreateBrakableObject(string name, Texture2D texture, bool large = false, ObjectType type = ObjectType.ORE, int itemId = 57)
+    {
+      var i = new ObjectInfo(type, new Item(itemId, 1, 0, 0, 0, new int[3], new int[3]), 16, texture).Register(name);
+      if (large)
+      {
+        var t = i.Object.transform.GetChild(0);
+        t.localScale = new Vector3(4, 4, 1);
+      }
+      GadgetCoreAPI.AddCustomResource("obj/Subworlds/" + name, i.Object);
+    }
+
+    private void CreateShipPart(string name, Texture texture, Texture textureBG, int[][] collisions, int[][] lamp, int tileW = 32, int tileH = 16)
+    {
+      var gameObject = Object.Instantiate((GameObject)Resources.Load("z/chunk"));
+      gameObject.transform.localScale = new Vector3(tileW * 2, tileH * 2, 1);
+
+      var rendererBody = gameObject.GetComponentInChildren<Renderer>();
+      rendererBody.material = new Material(Shader.Find("Transparent/Diffuse"))
+      {
+        mainTexture = texture
+      };
+
+      for (int i = 0; i < 6; i++)
+        GameObject.DestroyImmediate(gameObject.transform.GetChild(0).gameObject);
+      for (int i = 0; i < 16; i++)
+        GameObject.DestroyImmediate(gameObject.transform.GetChild(1).gameObject);
+
+      for (int i = 0; i < 7; i++)
+        GameObject.DestroyImmediate(gameObject.transform.GetChild(0).GetChild(0).gameObject);
+
+      Component.DestroyImmediate(gameObject.GetComponent<Chunk>());
+
+      var bgRenderObject = GameObject.Instantiate(gameObject);
+      for (int i = 0; i < bgRenderObject.transform.childCount; i++)
+        GameObject.DestroyImmediate(bgRenderObject.transform.GetChild(0).gameObject);
+
+      bgRenderObject.transform.SetParent(gameObject.transform);
+      bgRenderObject.transform.localScale = new Vector3(1, 1, 1);
+      bgRenderObject.transform.localPosition = new Vector3(0, 0, -0.3f);
+      var rendererBG = bgRenderObject.GetComponent<Renderer>();
+      rendererBG.material = new Material(Shader.Find("Transparent/Diffuse"))
+      {
+        mainTexture = textureBG
+      };
+
+      GameObject root = gameObject.transform.GetChild(0).gameObject;
+      GameObject inst = root.transform.GetChild(0).gameObject;
+
+      for (int i = 0; i < collisions.Length; i++)
+      {
+        GameObject entry = GameObject.Instantiate(inst);
+
+        entry.transform.SetParent(root.transform);
+
+        int[] coll = collisions[i];
+
+        float w = coll[2] * (2.0f / tileW);
+        float h = coll[3] * (2.0f / tileH);
+
+        float x = coll[0] * (2.0f / tileW) + w / 2;
+        float y = coll[1] * (2.0f / tileH) + h / 2;
+
+        entry.transform.localScale = new Vector3(w, h, 1);
+        entry.transform.localPosition = new Vector3(x - 1, y - 1, 0);
+      }
+
+      for (int i = 0; i < lamp.Length; i++)
+      {
+        int[] coll = lamp[i];
+
+        float w = (2.0f / tileW);
+        float h = (2.0f / tileH);
+        int type = coll[2];
+
+        float x = coll[0] * (2.0f / tileW) + w / 2;
+        float y = coll[1] * (2.0f / tileH) + h / 2;
+
+        GameObject entry = null;
+
+        if (type == 0)
+          entry = Object.Instantiate<GameObject>((GameObject)Resources.Load("prop/" + 2401));
+        if (type == 1)
+          entry = Object.Instantiate<GameObject>((GameObject)Resources.Load("prop/" + 2402));
+
+        entry.transform.SetParent(root.transform);
+
+        entry.transform.localScale = new Vector3(w / 4, h / 4, 1);
+        entry.transform.localPosition = new Vector3(x - 1, y - 1, -1);
+      }
+
+      GameObject.DestroyImmediate(gameObject.transform.GetChild(0).GetChild(0).gameObject);
+
+      GadgetCoreAPI.AddCustomResource("z/Subworlds/" + name, gameObject);
+    }
+
+  }
+}

+ 76 - 0
Gadgets/Meteoroid/MeteoroidGadget.Init.cs

@@ -0,0 +1,76 @@
+using GadgetCore.API;
+using GadgetCore.Util;
+using RecipeMenuCore.API;
+using Subworlds.Scripts;
+using System.Collections;
+using UnityEngine;
+
+namespace Subworlds
+{
+  [Gadget("SubworldMeteoroid", LoadAfter: new string[] { "RecipeMenuCore", "SubworldCore" }, Dependencies: new string[] { "RecipeMenuCore", "SubworldCore" })]
+  public partial class MeteroidGadget : Gadget<MeteroidGadget>
+  {
+    protected override void LoadConfig()
+    {
+      Config.Load();
+
+      string fileVersion = Config.ReadString("ConfigVersion", CoreGadget.CONFIG_VERSION, comments: "The Config Version (not to be confused with mod version)");
+
+      if (fileVersion != CoreGadget.CONFIG_VERSION)
+      {
+        Config.Reset();
+        Config.WriteString("ConfigVersion", CoreGadget.CONFIG_VERSION, comments: "The Config Version (not to be confused with mod version)");
+      }
+
+      Config.Save();
+    }
+
+    public override string GetModDescription()
+    {
+      return "A mod that adds ships that can be reaided.";
+    }
+
+    protected override void Initialize()
+    {
+      Logger.Log("Subworlds v" + Info.Mod.Version);
+      Core.logger = Logger;
+
+      Texture2D texturePlanetIcon = GadgetCoreAPI.LoadTexture2D("Meteoroid/icon.png");
+      Texture2D texturePlanetPrevIcon = GadgetCoreAPI.LoadTexture2D("Meteoroid/button.png");
+      Texture2D texturePortalSign = GadgetCoreAPI.LoadTexture2D("Meteoroid/sign.png");
+
+      AudioClip audioShip = GadgetCoreAPI.LoadAudioClip("01_space.ogg");
+
+      Core.meteroidPlanet = new PlanetInfo(PlanetType.SPECIAL, "Subworld Meteoroid", new GadgetCore.Util.Tuple<int, int>[] { new GadgetCore.Util.Tuple<int, int>(1, 100) }, audioShip);
+      var planet = Core.meteroidPlanet;
+      planet.SetPortalInfo(texturePortalSign, texturePlanetPrevIcon, texturePlanetIcon);
+
+      planet.OnGenerateWorld += MeteroidGenerator.GenarateTown;
+      planet.OnGenerateTown += MeteroidGenerator.Genarate;
+      planet.Register("SubworldMeteoroid");
+
+      planet.PortalUses = -1;
+
+      // Create World Parts
+      CreateBaseBlock("BaseBlockSmall", GadgetCoreAPI.LoadTexture2D("Meteoroid/meteor3.png"), 0.75f, 0.75f);
+      CreateBaseBlock("BaseBlockNormal", GadgetCoreAPI.LoadTexture2D("Meteoroid/meteor1.png"), 1, 1);
+      CreateBaseBlock("BaseBlockLarge", GadgetCoreAPI.LoadTexture2D("Meteoroid/meteor4.png"), 2, 2);
+
+      CreateShipPart("MeteorBase", GadgetCoreAPI.LoadTexture2D("Meteoroid/meteorBaseFG.png"), GadgetCoreAPI.LoadTexture2D("Meteoroid/meteorBaseBG.png"), new int[][] {
+        new int[] { 0, 10, 16, 1}
+      , new int[] { 2, 7, 1, 3}
+      , new int[] { 3, 6, 2, 1}
+      , new int[] { 5, 5, 6, 1}
+      , new int[] { 11, 6, 2, 1}
+      , new int[] { 13, 7, 1, 3}
+      }, new int[][] {
+        new int[] { 5, 7, 0 }
+      , new int[] { 10, 7, 0 }
+      }, 16, 16);
+
+      // Create Breakables
+      CreateBrakableObject("SpaceOre1", GadgetCoreAPI.LoadTexture2D("Meteoroid/spaceOre.png"), itemId: 1);
+      CreateBrakableObject("SpaceOre2", GadgetCoreAPI.LoadTexture2D("Meteoroid/spaceOreBig.png"), itemId: 1);
+    }
+  }
+}

+ 247 - 0
Gadgets/Ship/ShipsGadget.Create.cs

@@ -0,0 +1,247 @@
+using GadgetCore.API;
+using Subworlds.Scripts;
+using UnityEngine;
+
+namespace Subworlds
+{
+  public partial class SubworldsGadget : Gadget<SubworldsGadget>
+  {
+    private void CreateShipPart(string name, Texture texture, Texture textureBG, int[][] collisions, int[][] lamp, int tileW = 32, int tileH = 16)
+    {
+      var gameObject = Object.Instantiate((GameObject)Resources.Load("z/chunk"));
+      gameObject.transform.localScale = new Vector3(tileW * 2, tileH * 2, 1);
+
+      var rendererBody = gameObject.GetComponentInChildren<Renderer>();
+      rendererBody.material = new Material(Shader.Find("Transparent/Diffuse"))
+      {
+        mainTexture = texture
+      };
+
+      for (int i = 0; i < 6; i++)
+        GameObject.DestroyImmediate(gameObject.transform.GetChild(0).gameObject);
+      for (int i = 0; i < 16; i++)
+        GameObject.DestroyImmediate(gameObject.transform.GetChild(1).gameObject);
+
+      for (int i = 0; i < 7; i++)
+        GameObject.DestroyImmediate(gameObject.transform.GetChild(0).GetChild(0).gameObject);
+
+      Component.DestroyImmediate(gameObject.GetComponent<Chunk>());
+
+      var bgRenderObject = GameObject.Instantiate(gameObject);
+      for (int i = 0; i < bgRenderObject.transform.childCount; i++)
+        GameObject.DestroyImmediate(bgRenderObject.transform.GetChild(0).gameObject);
+
+      bgRenderObject.transform.SetParent(gameObject.transform);
+      bgRenderObject.transform.localScale = new Vector3(1, 1, 1);
+      bgRenderObject.transform.localPosition = new Vector3(0, 0, -0.3f);
+      var rendererBG = bgRenderObject.GetComponent<Renderer>();
+      rendererBG.material = new Material(Shader.Find("Transparent/Diffuse"))
+      {
+        mainTexture = textureBG
+      };
+
+      GameObject root = gameObject.transform.GetChild(0).gameObject;
+      GameObject inst = root.transform.GetChild(0).gameObject;
+
+      for (int i = 0; i < collisions.Length; i++)
+      {
+        GameObject entry = GameObject.Instantiate(inst);
+
+        entry.transform.SetParent(root.transform);
+
+        int[] coll = collisions[i];
+
+        float w = coll[2] * (2.0f / tileW);
+        float h = coll[3] * (2.0f / tileH);
+
+        float x = coll[0] * (2.0f / tileW) + w / 2;
+        float y = coll[1] * (2.0f / tileH) + h / 2;
+
+        entry.transform.localScale = new Vector3(w, h, 1);
+        entry.transform.localPosition = new Vector3(x - 1, y - 1, 0);
+      }
+
+      for (int i = 0; i < lamp.Length; i++)
+      {
+        int[] coll = lamp[i];
+
+        float w = (2.0f / tileW);
+        float h = (2.0f / tileH);
+        int type = coll[2];
+
+        float x = coll[0] * (2.0f / tileW) + w / 2;
+        float y = coll[1] * (2.0f / tileH) + h / 2;
+
+        GameObject entry = null;
+
+        if (type == 0)
+          entry = Object.Instantiate<GameObject>((GameObject)Resources.Load("prop/" + 2401));
+        if (type == 1)
+          entry = Object.Instantiate<GameObject>((GameObject)Resources.Load("prop/" + 2402));
+
+        entry.transform.SetParent(root.transform);
+
+        entry.transform.localScale = new Vector3(w / 4, h / 4, 1);
+        entry.transform.localPosition = new Vector3(x - 1, y - 1, -1);
+      }
+
+      GameObject.DestroyImmediate(gameObject.transform.GetChild(0).GetChild(0).gameObject);
+
+      GadgetCoreAPI.AddCustomResource("z/Subworlds/" + name, gameObject);
+    }
+
+    private void CreateObject(string name, Texture2D texture, bool large = false)
+    {
+      GameObject gameObject = Object.Instantiate<GameObject>((GameObject)Resources.Load("prop/2501"));
+      Renderer renderer = gameObject.GetComponentInChildren<Renderer>();
+      renderer.material = new Material(Shader.Find("Unlit/Transparent"))
+      {
+        mainTexture = texture
+      };
+      if (large)
+        gameObject.transform.localScale = new Vector3(gameObject.transform.localScale.x * 2, gameObject.transform.localScale.y * 2, 1);
+      GadgetCoreAPI.AddCustomResource("obj/Subworlds/" + name, gameObject);
+    }
+
+    private void CreateBrakableObject(string name, Texture2D texture, bool large = false, ObjectType type = ObjectType.ORE)
+    {
+      var i = new ObjectInfo(type, new Item(57, 1, 0, 0, 0, new int[3], new int[3]), 16, texture).Register(name);
+      if (large)
+      {
+        var t = i.Object.transform.GetChild(0);
+        t.localScale = new Vector3(4, 4, 1);
+      }
+      GadgetCoreAPI.AddCustomResource("obj/Subworlds/" + name, i.Object);
+      Core.spawnObjects.Add(i.GetID());
+    }
+
+    private void CreateSliverEnemy(string name, Texture2D textureHead, Texture2D textureBody, Texture2D textureTail)
+    {
+      GameObject gameObject = Object.Instantiate<GameObject>((GameObject)Resources.Load("e/sliver"));
+      Renderer rendererHead = gameObject.transform.GetChild(4).GetChild(0).GetChild(0).GetComponentInChildren<Renderer>();
+      rendererHead.material = new Material(Shader.Find("Unlit/Transparent"))
+      {
+        mainTexture = textureHead
+      };
+      Renderer rendererBody = gameObject.transform.GetChild(4).GetChild(0).GetChild(1).GetComponentInChildren<Renderer>();
+      rendererBody.material = new Material(Shader.Find("Unlit/Transparent"))
+      {
+        mainTexture = textureBody
+      };
+      Renderer rendererTail = gameObject.transform.GetChild(4).GetChild(0).GetChild(2).GetComponentInChildren<Renderer>();
+      rendererTail.material = new Material(Shader.Find("Unlit/Transparent"))
+      {
+        mainTexture = textureTail
+      };
+      GadgetCoreAPI.AddCustomResource("e/Subworlds/" + name, gameObject);
+    }
+
+    private void CreateDroidEnemy(string name, Texture2D texture)
+    {
+      GameObject gameObject = Object.Instantiate<GameObject>((GameObject)Resources.Load("e/wisp"));
+      gameObject.name = name;
+      gameObject.transform.GetChild(0).GetChild(0).gameObject.name = name;
+      Renderer rendererHead = gameObject.transform.GetChild(0).GetChild(0).GetChild(0).GetComponentInChildren<Renderer>();
+      rendererHead.material = new Material(Shader.Find("Unlit/Transparent"))
+      {
+        mainTexture = texture
+      };
+      GameObject.DestroyImmediate(gameObject.transform.GetChild(0).GetChild(0).GetChild(1).gameObject);
+      Component.DestroyImmediate(gameObject.GetComponent<WispScript>());
+      gameObject.AddComponent<AttackDroidScript>();
+
+      gameObject.transform.GetChild(1).gameObject.SetActive(true);
+      gameObject.transform.GetChild(1).localScale = new Vector3(65, 40, 1);
+
+      AnimationClip clip = new AnimationClip
+      {
+        name = "spinn",
+        wrapMode = WrapMode.Once,
+        legacy = true
+      };
+      clip.SetCurve("", typeof(Transform), "localEulerAngles.z", AnimationCurve.Linear(0, 0, 0.5f, 360));
+      var animation = gameObject.transform.GetChild(0).gameObject.AddComponent<Animation>();
+      animation.AddClip(clip, "spinn");
+      animation.clip = clip;
+
+      GadgetCoreAPI.AddCustomResource("e/Subworlds/" + name, gameObject);
+    }
+
+    private void CreateLaserHazard(string name, Texture2D texture)
+    {
+      GameObject gameObjectWisp = Object.Instantiate<GameObject>((GameObject)Resources.Load("e/wisp"));
+      var gameObject = gameObjectWisp.transform.GetChild(0).GetChild(0).GetChild(0).gameObject;
+      gameObjectWisp.transform.GetChild(3).SetParent(gameObject.transform);
+      gameObject.transform.SetParent(null);
+      GameObject.DestroyImmediate(gameObjectWisp);
+      gameObject.name = name;
+      Renderer rendererHead = gameObject.GetComponentInChildren<Renderer>();
+      rendererHead.material = new Material(Shader.Find("Unlit/Transparent"))
+      {
+        mainTexture = texture
+      };
+      gameObject.AddComponent<BrokenLaserScript>();
+
+      var haz = gameObject.transform.GetChild(0).GetComponent<HazardScript>();
+      haz.damage = 3;
+
+      gameObject.transform.localScale = new Vector3(2f, 8f, 1);
+      gameObject.transform.localRotation = Quaternion.Euler(0, 180, 0);
+      gameObject.transform.GetChild(0).localScale = new Vector3(1, 1, 1);
+      var trigger = gameObject.transform.GetChild(0).GetComponent<BoxCollider>();
+      trigger.size = new Vector3(0.6f, 2, 1);
+      trigger.isTrigger = true;
+      var collider = gameObject.transform.GetChild(0).gameObject.AddComponent<BoxCollider>();
+      collider.size = new Vector3(0.3f, 2, 1);
+      collider.isTrigger = false;
+
+      GadgetCoreAPI.AddCustomResource("haz/Subworlds/" + name, gameObject);
+    }
+
+    private void CreateOldChest(string name, Texture texture)
+    {
+      GameObject gameObject = Object.Instantiate<GameObject>((GameObject)Resources.Load("obj/chest"));
+      Renderer renderer = gameObject.transform.GetChild(0).gameObject.GetComponentInChildren<Renderer>();
+      renderer.material = new Material(Shader.Find("Unlit/Transparent"))
+      {
+        mainTexture = texture
+      };
+      Component.DestroyImmediate(gameObject.GetComponent<ChestScript>());
+      gameObject.AddComponent<OldChestScript>();
+      GadgetCoreAPI.AddCustomResource("obj/Subworlds/" + name, gameObject);
+    }
+    private void CreateBaseBlock(string name, Texture2D texture, float w, float h)
+    {
+      var gameObject = Object.Instantiate((GameObject)Resources.Load("z/chunk"));
+      gameObject.transform.localScale = new Vector3(w, h, 1);
+
+      var rendererBody = gameObject.GetComponentInChildren<Renderer>();
+      rendererBody.material = new Material(Shader.Find("Transparent/Diffuse"))
+      {
+        mainTexture = texture
+      };
+
+      for (int i = 0; i < 6; i++)
+        GameObject.DestroyImmediate(gameObject.transform.GetChild(0).gameObject);
+      for (int i = 0; i < 16; i++)
+        GameObject.DestroyImmediate(gameObject.transform.GetChild(1).gameObject);
+
+      for (int i = 0; i < 7; i++)
+        GameObject.DestroyImmediate(gameObject.transform.GetChild(0).GetChild(0).gameObject);
+
+      Component.DestroyImmediate(gameObject.GetComponent<Chunk>());
+
+
+      GameObject root = gameObject.transform.GetChild(0).gameObject;
+      GameObject collision = root.transform.GetChild(0).gameObject;
+
+      collision.transform.localScale = new Vector3(1, 1, 1);
+      collision.transform.localPosition = new Vector3(0, 0, 0);
+
+      Core.logger.LogConsole("created: " + "z/Subworlds/" + name);
+
+      GadgetCoreAPI.AddCustomResource("z/Subworlds/" + name, gameObject);
+    }
+
+  }
+}

+ 125 - 0
Gadgets/Ship/ShipsGadget.Init.cs

@@ -0,0 +1,125 @@
+using GadgetCore.API;
+using UnityEngine;
+
+namespace Subworlds
+{
+  [Gadget("SubworldShip", LoadAfter: new string[] { "RecipeMenuCore", "SubworldCore" }, Dependencies: new string[] { "RecipeMenuCore", "SubworldCore" })]
+  public partial class SubworldsGadget : Gadget<SubworldsGadget>
+  {
+    protected override void LoadConfig()
+    {
+      Config.Load();
+
+      string fileVersion = Config.ReadString("ConfigVersion", CoreGadget.CONFIG_VERSION, comments: "The Config Version (not to be confused with mod version)");
+
+      if (fileVersion != CoreGadget.CONFIG_VERSION)
+      {
+        Config.Reset();
+        Config.WriteString("ConfigVersion", CoreGadget.CONFIG_VERSION, comments: "The Config Version (not to be confused with mod version)");
+      }
+
+      Config.Save();
+    }
+
+    public override string GetModDescription()
+    {
+      return "A mod that adds ships that can be reaided.";
+    }
+
+    protected override void Initialize()
+    {
+      Logger.Log("Subworlds v" + Info.Mod.Version);
+      Core.logger = Logger;
+
+      Texture2D texturePlanetIcon = GadgetCoreAPI.LoadTexture2D("Ship/icon.png");
+      Texture2D texturePlanetPrevIcon = GadgetCoreAPI.LoadTexture2D("Ship/button.png");
+      Texture2D texturePortalSign = GadgetCoreAPI.LoadTexture2D("Ship/sign.png");
+
+      AudioClip audioShip = GadgetCoreAPI.LoadAudioClip("01_space.ogg");
+
+      Core.shipPlanet = new PlanetInfo(PlanetType.SPECIAL, "Subworld Ship", new GadgetCore.Util.Tuple<int, int>[] { new GadgetCore.Util.Tuple<int, int>(1, 100) }, audioShip);
+      var planet = Core.shipPlanet;
+      planet.SetPortalInfo(texturePortalSign, texturePlanetPrevIcon, texturePlanetIcon);
+
+      planet.OnGenerateWorld += ShipGenerator.GenarateTown;
+      planet.OnGenerateTown += ShipGenerator.Genarate;
+      planet.Register("SubworldShip");
+
+      planet.PortalUses = -1;
+
+      // Create World Parts
+      CreateShipPart("ShipAEntrance", GadgetCoreAPI.LoadTexture2D("Ship/shipAEntranceFG.png"), GadgetCoreAPI.LoadTexture2D("Ship/shipAEntranceBG.png"), new int[][] {
+        new int[] { 11, 5, 5, 1}
+      , new int[] { 11, 5, 1, 6}
+      , new int[] { 11, 10, 5, 1}
+      }, new int[][] { }, 16, 16);
+
+      CreateShipPart("ShipAMain", GadgetCoreAPI.LoadTexture2D("Ship/shipAMainFG.png"), GadgetCoreAPI.LoadTexture2D("Ship/shipAMainBG.png"), new int[][] {
+        new int[] { 0, 0, 32, 1}
+      , new int[] { 0, 15, 32, 1}
+      , new int[] { 0, 0, 1, 6}
+      , new int[] { 31, 0, 1, 6}
+      , new int[] { 0, 10, 1, 6}
+      , new int[] { 31, 10, 1, 6}
+      , new int[] { 3, 5, 4, 1}
+      , new int[] { 9, 5, 4, 1}
+      , new int[] { 19, 5, 4, 1}
+      , new int[] { 25, 5, 4, 1}
+      , new int[] { 3, 10, 4, 1}
+      , new int[] { 9, 10, 4, 1}
+      , new int[] { 19, 10, 4, 1}
+      , new int[] { 25, 10, 4, 1}
+      }, new int[][] {
+        new int[] { 3, 7, 0 }
+      , new int[] { 6, 7, 1 }
+      , new int[] { 25, 7, 1 }
+      , new int[] { 28, 7, 0 }
+      });
+
+      CreateShipPart("ShipAExit", GadgetCoreAPI.LoadTexture2D("Ship/shipAExitFG.png"), GadgetCoreAPI.LoadTexture2D("Ship/shipAExitBG.png"), new int[][] {
+        new int[] { 0, 5, 10, 1}
+      , new int[] { 0, 10, 13, 1}
+      , new int[] { 10, 6, 2, 1}
+      , new int[] { 12, 7, 1, 4}
+      }, new int[][] {
+        new int[] { 5, 7, 0 }
+      }, 16, 16);
+
+      CreateShipPart("ShuttleMain", GadgetCoreAPI.LoadTexture2D("Ship/shuttleMainFG.png"), GadgetCoreAPI.LoadTexture2D("Ship/shuttleMainBG.png"), new int[][] {
+        new int[] { 3, 5, 10, 1}
+      , new int[] { 3, 10, 11, 1}
+      , new int[] { 3, 5, 1, 5}
+      , new int[] { 13, 6, 1, 1}
+      , new int[] { 14, 7, 1, 3}
+      }, new int[][] {
+        new int[] { 5, 7, 0 }
+      }, 16, 16);
+
+      // Create Decorations
+      CreateObject("BrokenTeleporter", GadgetCoreAPI.LoadTexture2D("Ship/brokenTeleporter.png"), true);
+
+      CreateBrakableObject("BrokenPirate1", GadgetCoreAPI.LoadTexture2D("Ship/brokenPirate1.png"), true);
+      CreateBrakableObject("BrokenPirate2", GadgetCoreAPI.LoadTexture2D("Ship/brokenPirate2.png"), true);
+      CreateBrakableObject("BrokenPirate3", GadgetCoreAPI.LoadTexture2D("Ship/brokenPirate3.png"), true);
+      CreateBrakableObject("BrokenPirate4", GadgetCoreAPI.LoadTexture2D("Ship/brokenPirate4.png"), true);
+      CreateBrakableObject("BrokenPirate5", GadgetCoreAPI.LoadTexture2D("Ship/brokenPirate5.png"), true);
+      CreateBrakableObject("BrokenPirate6", GadgetCoreAPI.LoadTexture2D("Ship/brokenPirate6.png"), true);
+
+      CreateBrakableObject("BrokenCrates1", GadgetCoreAPI.LoadTexture2D("Ship/brokenCrates1.png"));
+      CreateBrakableObject("BrokenCrates2", GadgetCoreAPI.LoadTexture2D("Ship/brokenCrates2.png"));
+      CreateBrakableObject("BrokenCrates3", GadgetCoreAPI.LoadTexture2D("Ship/brokenCrates3.png"));
+      CreateBrakableObject("BrokenCrates4", GadgetCoreAPI.LoadTexture2D("Ship/brokenCrates4.png"));
+      CreateBrakableObject("BrokenItemMod", GadgetCoreAPI.LoadTexture2D("Ship/brokenItemMod.png"));
+      CreateBrakableObject("BrokenChest", GadgetCoreAPI.LoadTexture2D("Ship/brokenChest.png"));
+
+      // Create Enemies
+      CreateSliverEnemy("BrokenSliver", GadgetCoreAPI.LoadTexture2D("Ship/brokenSliverHead.png"), GadgetCoreAPI.LoadTexture2D("Ship/brokenSliverBody.png"), GadgetCoreAPI.LoadTexture2D("Ship/brokenSliverTail.png"));
+      CreateDroidEnemy("BrokenDroid", GadgetCoreAPI.LoadTexture2D("Ship/droid.png"));
+
+      // Create Hazards
+      CreateLaserHazard("LaserHazard", GadgetCoreAPI.LoadTexture2D("Ship/brokenLaser.png"));
+
+      CreateOldChest("OldChest", GadgetCoreAPI.LoadTexture2D("Ship/oldChest.png"));
+    }
+  }
+}

+ 311 - 0
Generator/MeteroidGenerator.cs

@@ -0,0 +1,311 @@
+using GadgetCore.API;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using UnityEngine;
+using Random = System.Random;
+
+namespace Subworlds
+{
+  public class MeteroidGenerator
+  {
+    private static readonly FieldInfo chunksField = typeof(SpawnerScript).GetField("chunks", BindingFlags.NonPublic | BindingFlags.Instance);
+    private static readonly Material materialaBackLight = new Material(Shader.Find("Unlit/Transparent")) { mainTexture = GadgetCoreAPI.LoadTexture2D("Meteoroid/parallax.png") };
+
+    private static readonly Material materialaParalexStars = new Material(Shader.Find("Unlit/Transparent")) { mainTexture = GadgetCoreAPI.LoadTexture2D("Meteoroid/bgStars.png") };
+    private static readonly Material materialaParalexNone = new Material(Shader.Find("Unlit/Transparent")) { mainTexture = GadgetCoreAPI.LoadTexture2D("Meteoroid/bgNone.png") };
+
+    public static readonly FieldInfo networkStuffField = typeof(Chunk).GetField("networkStuff", BindingFlags.NonPublic | BindingFlags.Instance);
+    public static readonly FieldInfo tempField = typeof(Chunk).GetField("temp", BindingFlags.NonPublic | BindingFlags.Instance);
+
+    private static int W = 32; //128 + 64;
+    private static int H = 32; //128 - 32;
+
+    private static float GetSizeForPixels(int px)
+    {
+      return 1f / 16f * px;
+    }
+
+    private static void MarkGeneration(int x, int y, int[][] arr)
+    {
+      if (x >= 0 && x < W && y >= 0 && y < H)
+        arr[x][y] = 1;
+    }
+
+    private static bool CheckGeneration(int x, int y, int[][] arr)
+    {
+      if (x >= 0 && x < W && y >= 0 && y < H)
+        if (arr[x][y] == 0)
+          return true;
+        else return false;
+      return true;
+    }
+    public static void GenarateTown(SpawnerScript s, int[] param)
+    {
+      GameScript.isTown = true;
+      if (GameScript.districtLevel % 2 != 0)
+      {
+        GameScript.districtLevel++;
+      }
+
+      s.backLights.SetActive(true);
+      s.mainLight.SetActive(false);
+      s.backLights.GetComponent<Renderer>().material = materialaBackLight;
+      //s.mainLight.GetComponentInChildren<Light>().color = new Color(0.05f, 0.05f, 0.05f, 0.1f);
+
+      s.bg[0].GetComponent<Renderer>().material = materialaParalexStars;
+      s.bg[1].GetComponent<Renderer>().material = materialaParalexNone;
+      s.bg[2].GetComponent<Renderer>().material = materialaParalexNone;
+      s.bg[3].GetComponent<Renderer>().material = materialaParalexNone;
+
+      var chunks = (GameObject[])chunksField.GetValue(s);
+      var num = 0;
+
+      chunks[num] = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("z/Subworlds/MeteorBase"), new Vector3((float)(218 + 0 * 128 + 4 * 8), 0f, 5f), Quaternion.Euler(0f, 180f, 180f));
+      num++;
+
+      if (Network.isServer)
+      {
+        chunks[num] = new GameObject("chunk");
+        var chunk = chunks[num].AddComponent<Chunk>();
+        PopulateTown(chunk);
+        num++;
+      }
+    }
+
+    public static void Genarate(SpawnerScript s, int[] param)
+    {
+      GameScript.isTown = false;
+
+      s.backLights.SetActive(true);
+      s.mainLight.SetActive(false);
+      s.backLights.GetComponent<Renderer>().material = materialaBackLight;
+
+      s.bg[0].GetComponent<Renderer>().material = materialaParalexStars;
+      s.bg[1].GetComponent<Renderer>().material = materialaParalexNone;
+      s.bg[2].GetComponent<Renderer>().material = materialaParalexNone;
+      s.bg[3].GetComponent<Renderer>().material = materialaParalexNone;
+
+      //s.backLights.SetActive(true);
+      s.mainLight.SetActive(true);
+      s.mainLight.GetComponentInChildren<Light>().color = new Color(1f, 1f, 1f, 1f);
+
+      var chunks = (GameObject[])chunksField.GetValue(s);
+      var num = 0;
+      try
+      {
+        if (Network.isServer)
+        {
+          chunks[num] = new GameObject("chunk");
+          var chunk = chunks[num].AddComponent<Chunk>();
+          PopulateWorld(chunk);
+          num++;
+        }
+      }
+      catch (System.Exception e) { Core.logger.LogConsole(e); }
+    }
+
+    private static List<int[]> spawnLocations = new List<int[]>();
+    private static System.Random random = new System.Random();
+    public static void PopulateTown(Chunk chunk)
+    {
+      var networkStuff = new GameObject[400];
+      networkStuffField.SetValue(chunk, networkStuff);
+
+      try
+      {
+
+        int temp = (int)tempField.GetValue(chunk);
+
+        networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("npcStorage"), new Vector3(248f - 4 * 1, -6.118f, 0.3f), Quaternion.identity, 0);
+        temp++;
+        networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("npc2103"), new Vector3(248f + 4 * 0, -6.118f, 0.3f), Quaternion.identity, 0);
+        temp++;
+        networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("npc/npcQuest"), new Vector3(248f + 4 * 2, -6.118f, 0.3f), Quaternion.identity, 0);
+        temp++;
+      }
+      catch (System.Exception e) { Core.logger.LogError(e); }
+
+      GameScript.endPortal[0] = (GameObject)Network.Instantiate((GameObject)Resources.Load("portal"), new Vector3(248f + 4 * 4, -6.118f, 0f), Quaternion.identity, 0);
+      GameScript.endPortalUA[0] = GameScript.endPortal[0].transform.GetChild(0).gameObject;
+      GameScript.endPortal[0].GetComponent<NetworkView>().RPC("Activate", RPCMode.All, new object[0]);
+      GameScript.endPortalUA[0].GetComponent<NetworkView>().RPC("Set", RPCMode.AllBuffered, new object[] { Core.lastBiome == -1 ? Core.meteroidPlanet.GetID() : Core.lastBiome, 0, 0 });
+
+      GameScript.endPortal[3] = (GameObject)Network.Instantiate((GameObject)Resources.Load("portal"), new Vector3(248f - 4 * 3, -6.118f, 0f), Quaternion.identity, 0);
+      GameScript.endPortalUA[3] = GameScript.endPortal[3].transform.GetChild(0).gameObject;
+      GameScript.endPortal[3].GetComponent<NetworkView>().RPC("Activate", RPCMode.All, new object[0]);
+      GameScript.endPortalUA[3].GetComponent<NetworkView>().RPC("Set", RPCMode.AllBuffered, new object[] { 98, 0, 3 });
+    }
+
+    public static void PopulateWorld(Chunk chunk)
+    {
+      var networkStuff = new GameObject[400];
+      networkStuffField.SetValue(chunk, networkStuff);
+
+      int temp = (int)tempField.GetValue(chunk);
+
+      int[][] genSpots = new int[W][];
+      for (int i = 0; i < W; i++)
+        genSpots[i] = new int[H];
+
+      {
+        int x = 15;
+        int y = 10;
+        for (int xOff = -2; xOff < 3; xOff++)
+          for (int yOff = -2; yOff < 6; yOff++)
+            MarkGeneration(x + xOff, y + yOff, genSpots);
+        networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("z/Subworlds/BaseBlockNormal"), new Vector3(242 + 4 * x - 60, y * 4 - 60, 5), Quaternion.identity, 0);
+        temp++;
+      }
+      {
+        int porterGenerated = 0;
+        int overflow = 0;
+        int x = random.Next(W / 2) + W / 2;
+        int y = random.Next(H / 2) + H / 2;
+
+        bool addLoopPortal = false;
+        foreach (var gadget in GadgetCore.API.Gadgets.ListAllEnabledGadgets())
+          if (gadget.Info?.ModName == "Loop Portal")
+          {
+            addLoopPortal = true;
+            break;
+          }
+
+        while (overflow < 1000 && porterGenerated < 1)
+        {
+          overflow++;
+          bool noGen = false;
+          for (int xOff = -1; xOff < 2; xOff++)
+            for (int yOff = -1; yOff < 4; yOff++)
+              if (!CheckGeneration(x + xOff, y + yOff, genSpots))
+                noGen = true;
+          if (!noGen)
+          {
+            for (int xOff = -1; xOff < 2; xOff++)
+              for (int yOff = -1; yOff < 4; yOff++)
+                MarkGeneration(x + xOff, y + yOff, genSpots);
+            networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("z/Subworlds/BaseBlockNormal"), new Vector3(242 + 4 * x - 60, y * 4 - 60, 5), Quaternion.identity, 0);
+            temp++;
+            GameScript.endPortal[porterGenerated] = (GameObject)Network.Instantiate((GameObject)Resources.Load("portal"), new Vector3(242 + x * 4 - 60, y * 4 - 60 + GetSizeForPixels(54) + 1.451f + 1, 0f), Quaternion.identity, 0);
+            GameScript.endPortalUA[porterGenerated] = GameScript.endPortal[porterGenerated].transform.GetChild(0).gameObject;
+            GameScript.endPortal[porterGenerated].GetComponent<NetworkView>().RPC("Activate", RPCMode.All, new object[0]);
+            GameScript.endPortalUA[porterGenerated].GetComponent<NetworkView>().RPC("Set", RPCMode.AllBuffered, new object[] { SpawnerScript.curBiome, 0, porterGenerated });
+            porterGenerated++;
+          }
+          x = Mathf.Min(x + random.Next(5) - 2, W);
+          y = Mathf.Min(y + random.Next(5) - 2, H);
+        }
+        //while (addLoopPortal && overflow < 5000)
+        //{
+        //  overflow++;
+        //  bool noGen = false;
+        //  for (int xOff = -1; xOff < 2; xOff++)
+        //    for (int yOff = -1; yOff < 4; yOff++)
+        //      if (!CheckGeneration(x + xOff, y + yOff, genSpots))
+        //        noGen = true;
+        //  if (!noGen)
+        //  {
+        //    for (int xOff = -1; xOff < 2; xOff++)
+        //      for (int yOff = -1; yOff < 4; yOff++)
+        //        MarkGeneration(x + xOff, y + yOff, genSpots);
+        //    networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("z/Subworlds/BaseBlockNormal"), new Vector3(242 + 4 * x - 60, y * 4 - 60, 5), Quaternion.identity, 0);
+        //    temp++;
+        //    var i = (GameObject)Network.Instantiate((GameObject)Resources.Load("portal"), new Vector3(242 + x * 4 - 60, y * 4 - 60 + GetSizeForPixels(54) + 1.451f + 1, 0f), Quaternion.identity, 0);
+        //    var iUA = i.transform.GetChild(0).gameObject;
+        //    i.GetComponent<NetworkView>().RPC("Activate", RPCMode.All, new object[0]);
+        //    iUA.GetComponent<NetworkView>().RPC("Set", RPCMode.AllBuffered, new object[] { SpawnerScript.curBiome, 0, 4 });
+        //    i.transform.parent = GameScript.endPortal[0].transform;
+        //    networkStuff[temp] = i;
+        //    temp++;
+        //    break;
+        //  }
+        //  x = Mathf.Min(x + random.Next(5) - 2, W);
+        //  y = Mathf.Min(y + random.Next(5) - 2, H);
+        //}
+      }
+      {
+        int r = 0;
+        int overflow = 0;
+
+        while (overflow < 15000 && r < 700)
+        {
+          overflow++;
+          int i = random.Next(6);
+          int x = random.Next(W);
+          int y = random.Next(H);
+
+          bool noGen = false;
+          switch (i)
+          {
+            case 0:
+            case 1:
+            case 2:
+              for (int xOff = -1; xOff < 2; xOff++)
+                for (int yOff = -1; yOff < 2; yOff++)
+                  if (!CheckGeneration(x + xOff, y + yOff, genSpots))
+                    noGen = true;
+              break;
+            case 3:
+            case 4:
+              for (int xOff = -1; xOff < 2; xOff++)
+                for (int yOff = -1; yOff < 2; yOff++)
+                  if (!CheckGeneration(x + xOff, y + yOff, genSpots))
+                    noGen = true;
+              break;
+            case 5:
+              for (int xOff = -2; xOff < 3; xOff++)
+                for (int yOff = -2; yOff < 3; yOff++)
+                  if (!CheckGeneration(x + xOff, y + yOff, genSpots))
+                    noGen = true;
+              break;
+          }
+          if (!noGen)
+          {
+            r++;
+            switch (i)
+            {
+              case 0:
+              case 1:
+              case 2:
+                for (int xOff = -1; xOff < 2; xOff++)
+                  for (int yOff = -1; yOff < 2; yOff++)
+                    MarkGeneration(x + xOff, y + yOff, genSpots);
+                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("z/Subworlds/BaseBlockNormal"), new Vector3(242 + 4 * x - 60, y * 4 - 60, 5), Quaternion.identity, 0);
+                temp++;
+                var position = new Vector3((float)(242 + x * 4 - 60), y * 4 - 60 + GetSizeForPixels(54) + 1.049f, 0f);
+
+                if (random.Next(2) == 0)
+                {
+                  networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Subworlds/SpaceOre1"), position, Quaternion.identity, 0);
+                  temp++;
+                }
+                else
+                {
+                  networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Subworlds/SpaceOre2"), position, Quaternion.identity, 0);
+                  temp++;
+                }
+                break;
+              case 3:
+              case 4:
+                for (int xOff = -1; xOff < 2; xOff++)
+                  for (int yOff = -1; yOff < 2; yOff++)
+                    MarkGeneration(x + xOff, y + yOff, genSpots);
+                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("z/Subworlds/BaseBlockSmall"), new Vector3(242 + 4 * x - 60, y * 4 - 60, 5), Quaternion.identity, 0);
+                temp++;
+                break;
+              case 5:
+                for (int xOff = -2; xOff < 3; xOff++)
+                  for (int yOff = -2; yOff < 3; yOff++)
+                    MarkGeneration(x + xOff, y + yOff, genSpots);
+                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("z/Subworlds/BaseBlockLarge"), new Vector3(242 + 4 * x - 60, y * 4 - 60, 5), Quaternion.identity, 0);
+                temp++;
+                break;
+            }
+          }
+        }
+      }
+    }
+  }
+}

+ 28 - 32
ShipGenerator.cs → Generator/ShipGenerator.cs

@@ -4,7 +4,7 @@ using System.Collections.Generic;
 using System.Reflection;
 using System.Reflection;
 using UnityEngine;
 using UnityEngine;
 
 
-namespace Ships
+namespace Subworlds
 {
 {
   internal enum ShipGeneratorObjectPoolType
   internal enum ShipGeneratorObjectPoolType
   {
   {
@@ -20,14 +20,10 @@ namespace Ships
   public class ShipGenerator
   public class ShipGenerator
   {
   {
     private static readonly FieldInfo chunksField = typeof(SpawnerScript).GetField("chunks", BindingFlags.NonPublic | BindingFlags.Instance);
     private static readonly FieldInfo chunksField = typeof(SpawnerScript).GetField("chunks", BindingFlags.NonPublic | BindingFlags.Instance);
-    private static readonly Material materialaBackLight = new Material(Shader.Find("Unlit/Transparent")) { mainTexture = GadgetCoreAPI.LoadTexture2D("parallax.png") };
-    private static readonly Material materialaParalex0 = new Material(Shader.Find("Unlit/Transparent")) { mainTexture = GadgetCoreAPI.LoadTexture2D("bg0.png") };
-    private static readonly Material materialaParalex1 = new Material(Shader.Find("Unlit/Transparent")) { mainTexture = GadgetCoreAPI.LoadTexture2D("bg1.png") };
-    private static readonly Material materialaParalex2 = new Material(Shader.Find("Unlit/Transparent")) { mainTexture = GadgetCoreAPI.LoadTexture2D("bg2.png") };
-    private static readonly Material materialaParalex3 = new Material(Shader.Find("Unlit/Transparent")) { mainTexture = GadgetCoreAPI.LoadTexture2D("bg3.png") };
+    private static readonly Material materialaBackLight = new Material(Shader.Find("Unlit/Transparent")) { mainTexture = GadgetCoreAPI.LoadTexture2D("Ship/parallax.png") };
 
 
-    private static readonly Material materialaParalexStars = new Material(Shader.Find("Unlit/Transparent")) { mainTexture = GadgetCoreAPI.LoadTexture2D("bgStars.png") };
-    private static readonly Material materialaParalexNone = new Material(Shader.Find("Unlit/Transparent")) { mainTexture = GadgetCoreAPI.LoadTexture2D("bgNone.png") };
+    private static readonly Material materialaParalexStars = new Material(Shader.Find("Unlit/Transparent")) { mainTexture = GadgetCoreAPI.LoadTexture2D("Ship/bgStars.png") };
+    private static readonly Material materialaParalexNone = new Material(Shader.Find("Unlit/Transparent")) { mainTexture = GadgetCoreAPI.LoadTexture2D("Ship/bgNone.png") };
 
 
     public static readonly FieldInfo networkStuffField = typeof(Chunk).GetField("networkStuff", BindingFlags.NonPublic | BindingFlags.Instance);
     public static readonly FieldInfo networkStuffField = typeof(Chunk).GetField("networkStuff", BindingFlags.NonPublic | BindingFlags.Instance);
     public static readonly FieldInfo tempField = typeof(Chunk).GetField("temp", BindingFlags.NonPublic | BindingFlags.Instance);
     public static readonly FieldInfo tempField = typeof(Chunk).GetField("temp", BindingFlags.NonPublic | BindingFlags.Instance);
@@ -53,7 +49,7 @@ namespace Ships
       var chunks = (GameObject[])chunksField.GetValue(s);
       var chunks = (GameObject[])chunksField.GetValue(s);
       var num = 0;
       var num = 0;
 
 
-      chunks[num] = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("z/Ships/ShuttleMain"), new Vector3((float)(218 + 0 * 128 + 4 * 8), 0f, 5f), Quaternion.Euler(0f, 180f, 180f));
+      chunks[num] = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("z/Subworlds/ShuttleMain"), new Vector3((float)(218 + 0 * 128 + 4 * 8), 0f, 5f), Quaternion.Euler(0f, 180f, 180f));
       num++;
       num++;
 
 
       if (Network.isServer)
       if (Network.isServer)
@@ -86,9 +82,9 @@ namespace Ships
         var chunks = (GameObject[])chunksField.GetValue(s);
         var chunks = (GameObject[])chunksField.GetValue(s);
         var num = 0;
         var num = 0;
 
 
-        chunks[num] = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("z/Ships/ShipAEntrance"), new Vector3((float)(218 + 0 * 128), 0f, 5f), Quaternion.Euler(0f, 180f, 180f));
+        chunks[num] = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("z/Subworlds/ShipAEntrance"), new Vector3((float)(218 + 0 * 128), 0f, 5f), Quaternion.Euler(0f, 180f, 180f));
         num++;
         num++;
-        chunks[num] = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("z/Ships/ShipAMain"), new Vector3((float)(218 + 0.75 * 128), 0f, 5f), Quaternion.Euler(0f, 180f, 180f));
+        chunks[num] = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("z/Subworlds/ShipAMain"), new Vector3((float)(218 + 0.75 * 128), 0f, 5f), Quaternion.Euler(0f, 180f, 180f));
         num++;
         num++;
 
 
         spawnLocations.Add(new int[] { 7, 7, (int)ShipGeneratorObjectPoolType.FlyingEnemy });
         spawnLocations.Add(new int[] { 7, 7, (int)ShipGeneratorObjectPoolType.FlyingEnemy });
@@ -114,7 +110,7 @@ namespace Ships
         Add4(26, 5);
         Add4(26, 5);
         Add4Floor(26, -5);
         Add4Floor(26, -5);
 
 
-        chunks[num] = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("z/Ships/ShipAMain"), new Vector3((float)(218 + 1.75 * 128), 0f, 5f), Quaternion.Euler(0f, 180f, 180f));
+        chunks[num] = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("z/Subworlds/ShipAMain"), new Vector3((float)(218 + 1.75 * 128), 0f, 5f), Quaternion.Euler(0f, 180f, 180f));
         num++;
         num++;
 
 
         spawnLocations.Add(new int[] { 7 + 32, 7, (int)ShipGeneratorObjectPoolType.FlyingEnemy });
         spawnLocations.Add(new int[] { 7 + 32, 7, (int)ShipGeneratorObjectPoolType.FlyingEnemy });
@@ -140,7 +136,7 @@ namespace Ships
         Add4(26 + 32, 5);
         Add4(26 + 32, 5);
         Add4Floor(26 + 32, -5);
         Add4Floor(26 + 32, -5);
 
 
-        chunks[num] = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("z/Ships/ShipAExit"), new Vector3((float)(218 + 2.5 * 128), 0f, 5f), Quaternion.Euler(0f, 180f, 180f));
+        chunks[num] = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("z/Subworlds/ShipAExit"), new Vector3((float)(218 + 2.5 * 128), 0f, 5f), Quaternion.Euler(0f, 180f, 180f));
         num++;
         num++;
 
 
         if (Network.isServer)
         if (Network.isServer)
@@ -264,7 +260,7 @@ namespace Ships
       GameScript.endPortal[0] = (GameObject)Network.Instantiate((GameObject)Resources.Load("portal"), new Vector3(248f + 4 * 5, -6.118f, 0f), Quaternion.identity, 0);
       GameScript.endPortal[0] = (GameObject)Network.Instantiate((GameObject)Resources.Load("portal"), new Vector3(248f + 4 * 5, -6.118f, 0f), Quaternion.identity, 0);
       GameScript.endPortalUA[0] = GameScript.endPortal[0].transform.GetChild(0).gameObject;
       GameScript.endPortalUA[0] = GameScript.endPortal[0].transform.GetChild(0).gameObject;
       GameScript.endPortal[0].GetComponent<NetworkView>().RPC("Activate", RPCMode.All, new object[0]);
       GameScript.endPortal[0].GetComponent<NetworkView>().RPC("Activate", RPCMode.All, new object[0]);
-      GameScript.endPortalUA[0].GetComponent<NetworkView>().RPC("Set", RPCMode.AllBuffered, new object[] { Core.lastBiome, 0, 0 });
+      GameScript.endPortalUA[0].GetComponent<NetworkView>().RPC("Set", RPCMode.AllBuffered, new object[] { Core.lastBiome == -1 ? Core.shipPlanet.GetID() : Core.lastBiome, 0, 0 });
 
 
       GameScript.endPortal[3] = (GameObject)Network.Instantiate((GameObject)Resources.Load("portal"), new Vector3(248f - 4 * 2, -6.118f, 0f), Quaternion.identity, 0);
       GameScript.endPortal[3] = (GameObject)Network.Instantiate((GameObject)Resources.Load("portal"), new Vector3(248f - 4 * 2, -6.118f, 0f), Quaternion.identity, 0);
       GameScript.endPortalUA[3] = GameScript.endPortal[3].transform.GetChild(0).gameObject;
       GameScript.endPortalUA[3] = GameScript.endPortal[3].transform.GetChild(0).gameObject;
@@ -282,7 +278,7 @@ namespace Ships
 
 
         int temp = (int)tempField.GetValue(chunk);
         int temp = (int)tempField.GetValue(chunk);
 
 
-        networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Ships/BrokenTeleporter"), new Vector3(248f - 4 * 1, -4f + 0.118f, 0.3f), Quaternion.identity, 0);
+        networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Subworlds/BrokenTeleporter"), new Vector3(248f - 4 * 1, -4f + 0.118f, 0.3f), Quaternion.identity, 0);
         temp++;
         temp++;
 
 
 
 
@@ -292,45 +288,45 @@ namespace Ships
           {
           {
             case ShipGeneratorObjectPoolType.SmallObject:
             case ShipGeneratorObjectPoolType.SmallObject:
               if (random.Next(30) == 0)
               if (random.Next(30) == 0)
-                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Ships/BrokenItemMod"), new Vector3(248f + 4 * e[0], -8f + 0.118f * 4 + 4 * e[1], 0.2f), Quaternion.identity, 0);
+                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Subworlds/BrokenItemMod"), new Vector3(248f + 4 * e[0], -8f + 0.118f * 4 + 4 * e[1], 0.2f), Quaternion.identity, 0);
               else if (random.Next(4) == 0)
               else if (random.Next(4) == 0)
-                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Ships/BrokenCrates1"), new Vector3(248f + 4 * e[0], -8f + 0.118f * 4 + 4 * e[1], 0.2f), Quaternion.identity, 0);
+                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Subworlds/BrokenCrates1"), new Vector3(248f + 4 * e[0], -8f + 0.118f * 4 + 4 * e[1], 0.2f), Quaternion.identity, 0);
               else if (random.Next(3) == 0)
               else if (random.Next(3) == 0)
-                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Ships/BrokenCrates2"), new Vector3(248f + 4 * e[0], -8f + 0.118f * 4 + 4 * e[1], 0.2f), Quaternion.identity, 0);
+                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Subworlds/BrokenCrates2"), new Vector3(248f + 4 * e[0], -8f + 0.118f * 4 + 4 * e[1], 0.2f), Quaternion.identity, 0);
               else if (random.Next(2) == 0)
               else if (random.Next(2) == 0)
-                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Ships/BrokenCrates3"), new Vector3(248f + 4 * e[0], -8f + 0.118f * 4 + 4 * e[1], 0.2f), Quaternion.identity, 0);
+                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Subworlds/BrokenCrates3"), new Vector3(248f + 4 * e[0], -8f + 0.118f * 4 + 4 * e[1], 0.2f), Quaternion.identity, 0);
               else
               else
-                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Ships/BrokenCrates4"), new Vector3(248f + 4 * e[0], -8f + 0.118f * 4 + 4 * e[1], 0.2f), Quaternion.identity, 0);
+                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Subworlds/BrokenCrates4"), new Vector3(248f + 4 * e[0], -8f + 0.118f * 4 + 4 * e[1], 0.2f), Quaternion.identity, 0);
               break;
               break;
             case ShipGeneratorObjectPoolType.LargeObject:
             case ShipGeneratorObjectPoolType.LargeObject:
               if (random.Next(6) == 0)
               if (random.Next(6) == 0)
-                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Ships/BrokenPirate1"), new Vector3(248f + 4 * e[0], -5.75f + 0.118f + 4 * e[1], 0.2f), Quaternion.identity, 0);
+                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Subworlds/BrokenPirate1"), new Vector3(248f + 4 * e[0], -5.75f + 0.118f + 4 * e[1], 0.2f), Quaternion.identity, 0);
               else if (random.Next(5) == 0)
               else if (random.Next(5) == 0)
-                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Ships/BrokenPirate2"), new Vector3(248f + 4 * e[0], -5.75f + 0.118f + 4 * e[1], 0.2f), Quaternion.identity, 0);
+                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Subworlds/BrokenPirate2"), new Vector3(248f + 4 * e[0], -5.75f + 0.118f + 4 * e[1], 0.2f), Quaternion.identity, 0);
               else if (random.Next(4) == 0)
               else if (random.Next(4) == 0)
-                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Ships/BrokenPirate3"), new Vector3(248f + 4 * e[0], -5.75f + 0.118f + 4 * e[1], 0.2f), Quaternion.identity, 0);
+                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Subworlds/BrokenPirate3"), new Vector3(248f + 4 * e[0], -5.75f + 0.118f + 4 * e[1], 0.2f), Quaternion.identity, 0);
               else if (random.Next(3) == 0)
               else if (random.Next(3) == 0)
-                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Ships/BrokenPirate4"), new Vector3(248f + 4 * e[0], -5.75f + 0.118f + 4 * e[1], 0.2f), Quaternion.identity, 0);
+                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Subworlds/BrokenPirate4"), new Vector3(248f + 4 * e[0], -5.75f + 0.118f + 4 * e[1], 0.2f), Quaternion.identity, 0);
               else if (random.Next(2) == 0)
               else if (random.Next(2) == 0)
-                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Ships/BrokenPirate5"), new Vector3(248f + 4 * e[0], -5.75f + 0.118f + 4 * e[1], 0.2f), Quaternion.identity, 0);
+                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Subworlds/BrokenPirate5"), new Vector3(248f + 4 * e[0], -5.75f + 0.118f + 4 * e[1], 0.2f), Quaternion.identity, 0);
               else
               else
-                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Ships/BrokenPirate6"), new Vector3(248f + 4 * e[0], -5.75f + 0.118f + 4 * e[1], 0.2f), Quaternion.identity, 0);
+                networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Subworlds/BrokenPirate6"), new Vector3(248f + 4 * e[0], -5.75f + 0.118f + 4 * e[1], 0.2f), Quaternion.identity, 0);
               break;
               break;
             case ShipGeneratorObjectPoolType.FlyingEnemy:
             case ShipGeneratorObjectPoolType.FlyingEnemy:
-              Network.Instantiate(Resources.Load("e/Ships/BrokenSliver"), new Vector3(248f + 4 * e[0], -8f + 0.118f * 4 + 1.1f + 4 * e[1], 0f), Quaternion.identity, 0);
-              Network.Instantiate(Resources.Load("e/Ships/BrokenDroid"), new Vector3(248f + 4 * e[0], -8f + 0.118f * 4 + 1.1f + 4 * e[1], 0f), Quaternion.identity, 0);
+              Network.Instantiate(Resources.Load("e/Subworlds/BrokenSliver"), new Vector3(248f + 4 * e[0], -8f + 0.118f * 4 + 1.1f + 4 * e[1], 0f), Quaternion.identity, 0);
+              Network.Instantiate(Resources.Load("e/Subworlds/BrokenDroid"), new Vector3(248f + 4 * e[0], -8f + 0.118f * 4 + 1.1f + 4 * e[1], 0f), Quaternion.identity, 0);
               break;
               break;
             case ShipGeneratorObjectPoolType.BrokenItemMod:
             case ShipGeneratorObjectPoolType.BrokenItemMod:
-              networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Ships/BrokenItemMod"), new Vector3(248f + 4 * e[0], -8f + 0.118f * 4 + 4 * e[1], 0.2f), Quaternion.identity, 0);
+              networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Subworlds/BrokenItemMod"), new Vector3(248f + 4 * e[0], -8f + 0.118f * 4 + 4 * e[1], 0.2f), Quaternion.identity, 0);
               break;
               break;
             case ShipGeneratorObjectPoolType.BrokenChest:
             case ShipGeneratorObjectPoolType.BrokenChest:
-              networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Ships/BrokenChest"), new Vector3(248f + 4 * e[0], -8f + 0.118f * 4 + 4 * e[1], 0.2f), Quaternion.identity, 0);
+              networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Subworlds/BrokenChest"), new Vector3(248f + 4 * e[0], -8f + 0.118f * 4 + 4 * e[1], 0.2f), Quaternion.identity, 0);
               break;
               break;
             case ShipGeneratorObjectPoolType.OldChest:
             case ShipGeneratorObjectPoolType.OldChest:
-              networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Ships/OldChest"), new Vector3(248f + 4 * e[0], -8f + 0.118f * 4 + 4 * e[1], 0.2f), Quaternion.identity, 0);
+              networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("obj/Subworlds/OldChest"), new Vector3(248f + 4 * e[0], -8f + 0.118f * 4 + 4 * e[1], 0.2f), Quaternion.identity, 0);
               break;
               break;
             case ShipGeneratorObjectPoolType.BrokenLaser:
             case ShipGeneratorObjectPoolType.BrokenLaser:
-              networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("haz/Ships/LazerHazard"), new Vector3(248f + 4 * (e[0] + 0.5f), 4 * (e[1]), 0.2f), Quaternion.identity, 0);
+              networkStuff[temp] = (GameObject)Network.Instantiate(Resources.Load("haz/Subworlds/LaserHazard"), new Vector3(248f + 4 * (e[0] + 0.5f), 4 * (e[1]), 0.2f), Quaternion.identity, 0);
               break;
               break;
           }
           }
           if (networkStuff[temp] != null)
           if (networkStuff[temp] != null)

+ 2 - 2
Manifest.ini

@@ -1,4 +1,4 @@
 [Metadata]
 [Metadata]
-Name=Ships
-Assembly=Ships.dll
+Name=Subworlds
+Assembly=Subworlds.dll
 Dependencies=Recipe Menu Core
 Dependencies=Recipe Menu Core

+ 3 - 3
Patches/Patch_Chunk_OnDestroy.cs

@@ -2,11 +2,11 @@
 using HarmonyLib;
 using HarmonyLib;
 using UnityEngine;
 using UnityEngine;
 
 
-namespace Ships.Patches
+namespace Subworlds.Patches
 {
 {
   [HarmonyPatch(typeof(Chunk))]
   [HarmonyPatch(typeof(Chunk))]
   [HarmonyPatch("OnDestroy")]
   [HarmonyPatch("OnDestroy")]
-  [HarmonyGadget("Ships")]
+  [HarmonyGadget("SubworldCore")]
   public static class Patch_Chunk_OnDestroyy
   public static class Patch_Chunk_OnDestroyy
   {
   {
     [HarmonyPrefix]
     [HarmonyPrefix]
@@ -29,7 +29,7 @@ namespace Ships.Patches
         }
         }
         ___networkStuff = new GameObject[40];
         ___networkStuff = new GameObject[40];
       }
       }
-      if (GameScript.townBiome != Core.shipPlanet.GetID())
+      if (GameScript.townBiome != Core.meteroidPlanet.GetID() && GameScript.townBiome != Core.shipPlanet.GetID())
         Core.lastBiome = GameScript.townBiome;
         Core.lastBiome = GameScript.townBiome;
     }
     }
   }
   }

+ 3 - 3
Patches/Patch_Chunk_SpawnBiomeSlot.cs

@@ -6,12 +6,12 @@ using System.Threading;
 using System.Windows.Threading;
 using System.Windows.Threading;
 using UnityEngine;
 using UnityEngine;
 
 
-namespace Ships.Patches
+namespace Subworlds.Patches
 {
 {
 
 
   [HarmonyPatch(typeof(Chunk))]
   [HarmonyPatch(typeof(Chunk))]
   [HarmonyPatch("SpawnBiomeSlot")]
   [HarmonyPatch("SpawnBiomeSlot")]
-  [HarmonyGadget("Ships")]
+  [HarmonyGadget("SubworldCore")]
   public static class Patch_Chunk_SpawnBiomeSlot
   public static class Patch_Chunk_SpawnBiomeSlot
   {
   {
     [HarmonyPostfix]
     [HarmonyPostfix]
@@ -36,7 +36,7 @@ namespace Ships.Patches
           iUA.GetComponent<NetworkView>().RPC("Set", RPCMode.AllBuffered, new object[] { Core.shipPlanet.GetID(), 0, 5 });
           iUA.GetComponent<NetworkView>().RPC("Set", RPCMode.AllBuffered, new object[] { Core.shipPlanet.GetID(), 0, 5 });
           ___networkStuff[___temp] = portal;
           ___networkStuff[___temp] = portal;
           ___temp++;
           ___temp++;
-          var crates = (GameObject)Network.Instantiate(Resources.Load("obj/Ships/BrokenCrates1"), transform.position + new Vector3(2, 0, 0.2f), Quaternion.identity, 0);
+          var crates = (GameObject)Network.Instantiate(Resources.Load("obj/Subworlds/BrokenCrates1"), transform.position + new Vector3(2, 0, 0.2f), Quaternion.identity, 0);
           ___networkStuff[___temp] = crates;
           ___networkStuff[___temp] = crates;
           ___temp++;
           ___temp++;
           return false;
           return false;

+ 2 - 2
Patches/Patch_DroidManager_UA.cs

@@ -3,12 +3,12 @@ using HarmonyLib;
 using System.Reflection;
 using System.Reflection;
 using UnityEngine;
 using UnityEngine;
 
 
-namespace Ships.Patches
+namespace Subworlds.Patches
 {
 {
 
 
   [HarmonyPatch(typeof(DroidManager))]
   [HarmonyPatch(typeof(DroidManager))]
   [HarmonyPatch("UA")]
   [HarmonyPatch("UA")]
-  [HarmonyGadget("Ships")]
+  [HarmonyGadget("SubworldCore")]
 	public static class Patch_DroidManager_UA
 	public static class Patch_DroidManager_UA
 	{
 	{
 		public static readonly MethodInfo RPCMethod = typeof(DroidManager).GetMethod("UA", BindingFlags.Public | BindingFlags.Instance);
 		public static readonly MethodInfo RPCMethod = typeof(DroidManager).GetMethod("UA", BindingFlags.Public | BindingFlags.Instance);

+ 2 - 2
Patches/Patch_GameScript_AddMod.cs

@@ -2,12 +2,12 @@
 using HarmonyLib;
 using HarmonyLib;
 using UnityEngine;
 using UnityEngine;
 
 
-namespace Ships.Patches
+namespace Subworlds.Patches
 {
 {
 
 
   [HarmonyPatch(typeof(GameScript))]
   [HarmonyPatch(typeof(GameScript))]
   [HarmonyPatch("AddMod")]
   [HarmonyPatch("AddMod")]
-  [HarmonyGadget("Ships")]
+  [HarmonyGadget("SubworldCore")]
 	public static class Patch_GameScript_AddMod
 	public static class Patch_GameScript_AddMod
 	{
 	{
 
 

+ 2 - 2
Patches/Patch_GameScript_GetGearAspect.cs

@@ -3,12 +3,12 @@ using HarmonyLib;
 using System.Reflection;
 using System.Reflection;
 using UnityEngine;
 using UnityEngine;
 
 
-namespace Ships.Patches
+namespace Subworlds.Patches
 {
 {
 
 
   [HarmonyPatch(typeof(GameScript))]
   [HarmonyPatch(typeof(GameScript))]
   [HarmonyPatch("GetGearAspect")]
   [HarmonyPatch("GetGearAspect")]
-  [HarmonyGadget("Ships")]
+  [HarmonyGadget("SubworldCore")]
   public static class Patch_GameScript_GetGearAspect
   public static class Patch_GameScript_GetGearAspect
   {
   {
     [HarmonyPostfix]
     [HarmonyPostfix]

+ 2 - 2
Patches/Patch_GameScript_InitializeDroids.cs

@@ -3,12 +3,12 @@ using HarmonyLib;
 using System.Reflection;
 using System.Reflection;
 using UnityEngine;
 using UnityEngine;
 
 
-namespace Ships.Patches
+namespace Subworlds.Patches
 {
 {
 
 
   [HarmonyPatch(typeof(GameScript))]
   [HarmonyPatch(typeof(GameScript))]
   [HarmonyPatch("InitializeDroids")]
   [HarmonyPatch("InitializeDroids")]
-  [HarmonyGadget("Ships")]
+  [HarmonyGadget("SubworldCore")]
 	public static class Patch_GameScript_InitializeDroids
 	public static class Patch_GameScript_InitializeDroids
 	{
 	{
 		[HarmonyPostfix]
 		[HarmonyPostfix]

+ 2 - 2
Patches/Patch_GameScript_RefreshGearMods.cs

@@ -3,12 +3,12 @@ using HarmonyLib;
 using System.Reflection;
 using System.Reflection;
 using UnityEngine;
 using UnityEngine;
 
 
-namespace Ships.Patches
+namespace Subworlds.Patches
 {
 {
 
 
   [HarmonyPatch(typeof(GameScript))]
   [HarmonyPatch(typeof(GameScript))]
   [HarmonyPatch("RefreshGearMods")]
   [HarmonyPatch("RefreshGearMods")]
-  [HarmonyGadget("Ships")]
+  [HarmonyGadget("SubworldCore")]
   public static class Patch_GameScript_RefreshGearMods
   public static class Patch_GameScript_RefreshGearMods
   {
   {
     [HarmonyPostfix]
     [HarmonyPostfix]

+ 3 - 3
Patches/Patch_ObjectScript_Die.cs

@@ -6,12 +6,12 @@ using System.Threading;
 using System.Windows.Threading;
 using System.Windows.Threading;
 using UnityEngine;
 using UnityEngine;
 
 
-namespace Ships.Patches
+namespace Subworlds.Patches
 {
 {
 
 
   [HarmonyPatch(typeof(ObjectScript))]
   [HarmonyPatch(typeof(ObjectScript))]
   [HarmonyPatch("Die")]
   [HarmonyPatch("Die")]
-  [HarmonyGadget("Ships")]
+  [HarmonyGadget("SubworldCore")]
   public static class Patch_ObjectScript_Die
   public static class Patch_ObjectScript_Die
   {
   {
     [HarmonyPostfix]
     [HarmonyPostfix]
@@ -21,7 +21,7 @@ namespace Ships.Patches
       if (Network.isServer && Core.spawnObjects.Contains(___id))
       if (Network.isServer && Core.spawnObjects.Contains(___id))
       {
       {
         if (Random.Range(0, 2) == 0)
         if (Random.Range(0, 2) == 0)
-          __instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x + 2, __instance.transform.position.y, 2, 1 + Random.Range(0, 3), "e/Ships/BrokenSliver", 0.1f));
+          __instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x + 2, __instance.transform.position.y, 2, 1 + Random.Range(0, 3), "e/Subworlds/BrokenSliver", 0.1f));
         else if (Random.Range(0, 10) == 0)
         else if (Random.Range(0, 10) == 0)
         {
         {
           Item item = GadgetCoreAPI.EmptyItem();
           Item item = GadgetCoreAPI.EmptyItem();

+ 2 - 2
Patches/Patch_PlanetRegistry_get_PlanetSelectorPages.cs

@@ -3,11 +3,11 @@ using HarmonyLib;
 using System.Linq;
 using System.Linq;
 using System.Reflection;
 using System.Reflection;
 
 
-namespace Ships.Patches
+namespace Subworlds.Patches
 {
 {
 
 
   [HarmonyPatch]
   [HarmonyPatch]
-  [HarmonyGadget("Ships_")]
+  [HarmonyGadget("SubworldCore_")]
   public static class Patch_PlanetRegistry_get_PlanetSelectorPages
   public static class Patch_PlanetRegistry_get_PlanetSelectorPages
   {
   {
 
 

+ 2 - 2
Patches/Patch_SceneInjector_InjectIngame.cs

@@ -9,11 +9,11 @@ using System.Reflection;
 using System.Reflection.Emit;
 using System.Reflection.Emit;
 using UnityEngine;
 using UnityEngine;
 
 
-namespace Ships.Patches
+namespace Subworlds.Patches
 {
 {
 
 
   [HarmonyPatch]
   [HarmonyPatch]
-  [HarmonyGadget("Ships_")]
+  [HarmonyGadget("SubworldCore_")]
   public static class Patch_SceneInjector_InjectIngame
   public static class Patch_SceneInjector_InjectIngame
   {
   {
 
 

+ 3 - 3
Properties/AssemblyInfo.cs

@@ -1,8 +1,8 @@
 using System.Reflection;
 using System.Reflection;
-using static Ships.Ships;
+using static Subworlds.CoreGadget;
 
 
-[assembly: AssemblyProduct("Ships")] //Set this to the full name of the mod including spaces.
-[assembly: AssemblyTitle("Ships")] //This is only used when mousing over a dll file in Windows explorer.
+[assembly: AssemblyProduct("Subworlds")] //Set this to the full name of the mod including spaces.
+[assembly: AssemblyTitle("Subworlds")] //This is only used when mousing over a dll file in Windows explorer.
 [assembly: AssemblyDescription("A mod that adds ships that can be reaided.")] //This is a short description for your mod's assembly.
 [assembly: AssemblyDescription("A mod that adds ships that can be reaided.")] //This is a short description for your mod's assembly.
 [assembly: AssemblyCompany("")] //Set this to your name/nickname and/or website
 [assembly: AssemblyCompany("")] //Set this to your name/nickname and/or website
 [assembly: AssemblyCopyright("© 2021 Zariteis. All rights reserved.")] //Set this to your copyright name.
 [assembly: AssemblyCopyright("© 2021 Zariteis. All rights reserved.")] //Set this to your copyright name.

+ 1 - 1
Properties/launchSettings.json

@@ -1,6 +1,6 @@
 {
 {
   "profiles": {
   "profiles": {
-    "Ships": {
+    "Subworlds": {
       "commandName": "Executable",
       "commandName": "Executable",
       "executablePath": "C:\\Program Files (x86)\\Steam\\steamapps\\common\\Roguelands\\Roguelands.exe"
       "executablePath": "C:\\Program Files (x86)\\Steam\\steamapps\\common\\Roguelands\\Roguelands.exe"
     }
     }

+ 1 - 1
Scripts/AttackDroidScript.cs

@@ -5,7 +5,7 @@ using System;
 using System.Collections;
 using System.Collections;
 using UnityEngine;
 using UnityEngine;
 
 
-namespace Ships.Scripts
+namespace Subworlds.Scripts
 {
 {
   class AttackDroidScript : EnemyScript
   class AttackDroidScript : EnemyScript
   {
   {

+ 1 - 1
Scripts/BrokenLaserScript.cs

@@ -1,7 +1,7 @@
 using System.Collections;
 using System.Collections;
 using UnityEngine;
 using UnityEngine;
 
 
-namespace Ships.Scripts
+namespace Subworlds.Scripts
 {
 {
   class BrokenLaserScript : MonoBehaviour
   class BrokenLaserScript : MonoBehaviour
   {
   {

+ 1 - 1
Scripts/OldChestScript.cs

@@ -2,7 +2,7 @@
 using System.Collections;
 using System.Collections;
 using UnityEngine;
 using UnityEngine;
 
 
-namespace Ships.Scripts
+namespace Subworlds.Scripts
 {
 {
   public class OldChestScript : MonoBehaviour
   public class OldChestScript : MonoBehaviour
   {
   {

+ 0 - 419
Ships.cs

@@ -1,419 +0,0 @@
-using GadgetCore.API;
-using GadgetCore.Util;
-using RecipeMenuCore.API;
-using Ships.Scripts;
-using System.Collections;
-using System.Reflection;
-using UnityEngine;
-using UnityEngine.SceneManagement;
-
-namespace Ships
-{
-  [Gadget("Ships", LoadAfter: new string[] { "RecipeMenuCore" }, Dependencies: new string[] { "RecipeMenuCore" })]
-  public class Ships : Gadget<Ships>
-  {
-    public const string MOD_VERSION = "1.0"; // Set this to the version of your mod.
-    public const string CONFIG_VERSION = "1.0"; // Increment this whenever you change your mod's config file.
-
-    protected override void LoadConfig()
-    {
-      Config.Load();
-
-      string fileVersion = Config.ReadString("ConfigVersion", CONFIG_VERSION, comments: "The Config Version (not to be confused with mod version)");
-
-      if (fileVersion != CONFIG_VERSION)
-      {
-        Config.Reset();
-        Config.WriteString("ConfigVersion", CONFIG_VERSION, comments: "The Config Version (not to be confused with mod version)");
-      }
-
-      Config.Save();
-    }
-
-    public override string GetModDescription()
-    {
-      return "A mod that adds ships that can be reaided.";
-    }
-
-    protected override void Initialize()
-    {
-      Logger.Log("Ships v" + Info.Mod.Version);
-      Core.logger = Logger;
-
-      Texture2D texturePlanetIcon = GadgetCoreAPI.LoadTexture2D("planetShip.png");
-      Texture2D texturePlanetPrevIcon = GadgetCoreAPI.LoadTexture2D("planetShipsPrev.png");
-      Texture2D texturePortalSign = GadgetCoreAPI.LoadTexture2D("signShip.png");
-
-      Texture2D textureBG = GadgetCoreAPI.LoadTexture2D("bgShips.png");
-      Texture2D textureBGExtension = GadgetCoreAPI.LoadTexture2D("bgShipsExtension.png");
-      Texture2D textureBGTop = GadgetCoreAPI.LoadTexture2D("bgShipsTop.png");
-
-      Texture2D textureParalex = GadgetCoreAPI.LoadTexture2D("parallax.png");
-      Texture2D textureParalex0 = GadgetCoreAPI.LoadTexture2D("bShipsbg0.png");
-      Texture2D textureParalex1 = GadgetCoreAPI.LoadTexture2D("bShipsbg1.png");
-      Texture2D textureParalex2 = GadgetCoreAPI.LoadTexture2D("bShipsbg2.png");
-      Texture2D textureParalex3 = GadgetCoreAPI.LoadTexture2D("bShipsbg3.png");
-
-      Texture2D textureEntrance = GadgetCoreAPI.LoadTexture2D("entranceShips.png");
-      Texture2D textureSmallSide = GadgetCoreAPI.LoadTexture2D("sideSmallShips.png");
-      Texture2D textureBigSide = GadgetCoreAPI.LoadTexture2D("sideBigShips.png");
-
-      Texture2D textureMid0 = GadgetCoreAPI.LoadTexture2D("midShipsChunk0.png");
-      Texture2D textureMid1 = GadgetCoreAPI.LoadTexture2D("midShipsChunk1.png");
-
-      Texture2D textureScrapTrophy = GadgetCoreAPI.LoadTexture2D("iScrapTrophy.png");
-
-      AudioClip audioShip = GadgetCoreAPI.LoadAudioClip("01_space.ogg");
-
-      Core.shipPlanet = new PlanetInfo(PlanetType.SPECIAL, "Ship", new GadgetCore.Util.Tuple<int, int>[] { new GadgetCore.Util.Tuple<int, int>(1, 100) }, audioShip);
-      var scrapYardPlanet = Core.shipPlanet;
-      scrapYardPlanet.SetPortalInfo(texturePortalSign, texturePlanetPrevIcon, texturePlanetIcon);
-      scrapYardPlanet.SetBackgroundInfo(textureParalex, textureParalex0, textureParalex1, textureParalex2, textureParalex3);
-      scrapYardPlanet.SetTerrainInfo(textureEntrance, textureBG, textureMid0, textureMid1, textureBigSide, textureSmallSide);
-
-      scrapYardPlanet.OnGenerateWorld += ShipGenerator.GenarateTown;
-      scrapYardPlanet.OnGenerateTown += ShipGenerator.Genarate;
-      scrapYardPlanet.Register("Ship");
-
-      scrapYardPlanet.PortalUses = -1;
-
-      Texture2D textureShipAEntranceFG = GadgetCoreAPI.LoadTexture2D("shipAEntranceFG.png");
-      Texture2D textureShipAEntranceBG = GadgetCoreAPI.LoadTexture2D("shipAEntranceBG.png");
-      CreateShipPart("ShipAEntrance", textureShipAEntranceFG, textureShipAEntranceBG, new int[][] {
-        new int[] { 11, 5, 5, 1}
-      , new int[] { 11, 5, 1, 6}
-      , new int[] { 11, 10, 5, 1}
-      }, new int[][] { }, 16, 16);
-
-      Texture2D textureShipAMainFG = GadgetCoreAPI.LoadTexture2D("shipAMainFG.png");
-      Texture2D textureShipAMainBG = GadgetCoreAPI.LoadTexture2D("shipAMainBG.png");
-      CreateShipPart("ShipAMain", textureShipAMainFG, textureShipAMainBG, new int[][] {
-        new int[] { 0, 0, 32, 1}
-      , new int[] { 0, 15, 32, 1}
-      , new int[] { 0, 0, 1, 6}
-      , new int[] { 31, 0, 1, 6}
-      , new int[] { 0, 10, 1, 6}
-      , new int[] { 31, 10, 1, 6}
-      , new int[] { 3, 5, 4, 1}
-      , new int[] { 9, 5, 4, 1}
-      , new int[] { 19, 5, 4, 1}
-      , new int[] { 25, 5, 4, 1}
-      , new int[] { 3, 10, 4, 1}
-      , new int[] { 9, 10, 4, 1}
-      , new int[] { 19, 10, 4, 1}
-      , new int[] { 25, 10, 4, 1}
-      }, new int[][] {
-        new int[] { 3, 7, 0 }
-      , new int[] { 6, 7, 1 }
-      , new int[] { 25, 7, 1 }
-      , new int[] { 28, 7, 0 }
-      });
-
-      Texture2D textureShipAExitFG = GadgetCoreAPI.LoadTexture2D("shipAExitFG.png");
-      Texture2D textureShipAExitBG = GadgetCoreAPI.LoadTexture2D("shipAExitBG.png");
-      CreateShipPart("ShipAExit", textureShipAExitFG, textureShipAExitBG, new int[][] {
-        new int[] { 0, 5, 10, 1}
-      , new int[] { 0, 10, 13, 1}
-      , new int[] { 10, 6, 2, 1}
-      , new int[] { 12, 7, 1, 4}
-      }, new int[][] {
-        new int[] { 5, 7, 0 }
-      }, 16, 16);
-
-      Texture2D textureShuttleMainFG = GadgetCoreAPI.LoadTexture2D("shuttleMainFG.png");
-      Texture2D textureShuttleMainBG = GadgetCoreAPI.LoadTexture2D("shuttleMainBG.png");
-      CreateShipPart("ShuttleMain", textureShuttleMainFG, textureShuttleMainBG, new int[][] {
-        new int[] { 3, 5, 10, 1}
-      , new int[] { 3, 10, 11, 1}
-      , new int[] { 3, 5, 1, 5}
-      , new int[] { 13, 6, 1, 1}
-      , new int[] { 14, 7, 1, 3}
-      }, new int[][] {
-        new int[] { 5, 7, 0 }
-      }, 16, 16);
-
-      CreateObject("BrokenTeleporter", GadgetCoreAPI.LoadTexture2D("brokenTeleporter.png"), true);
-
-      CreateBrakableObject("BrokenPirate1", GadgetCoreAPI.LoadTexture2D("brokenPirate1.png"), true);
-      CreateBrakableObject("BrokenPirate2", GadgetCoreAPI.LoadTexture2D("brokenPirate2.png"), true);
-      CreateBrakableObject("BrokenPirate3", GadgetCoreAPI.LoadTexture2D("brokenPirate3.png"), true);
-      CreateBrakableObject("BrokenPirate4", GadgetCoreAPI.LoadTexture2D("brokenPirate4.png"), true);
-      CreateBrakableObject("BrokenPirate5", GadgetCoreAPI.LoadTexture2D("brokenPirate5.png"), true);
-      CreateBrakableObject("BrokenPirate6", GadgetCoreAPI.LoadTexture2D("brokenPirate6.png"), true);
-
-      CreateBrakableObject("BrokenCrates1", GadgetCoreAPI.LoadTexture2D("brokenCrates1.png"));
-      CreateBrakableObject("BrokenCrates2", GadgetCoreAPI.LoadTexture2D("brokenCrates2.png"));
-      CreateBrakableObject("BrokenCrates3", GadgetCoreAPI.LoadTexture2D("brokenCrates3.png"));
-      CreateBrakableObject("BrokenCrates4", GadgetCoreAPI.LoadTexture2D("brokenCrates4.png"));
-      CreateBrakableObject("BrokenItemMod", GadgetCoreAPI.LoadTexture2D("brokenItemMod.png"));
-      CreateBrakableObject("BrokenChest", GadgetCoreAPI.LoadTexture2D("brokenChest.png"));
-
-      CreateSliverEnemy("BrokenSliver", GadgetCoreAPI.LoadTexture2D("brokenSliverHead.png"), GadgetCoreAPI.LoadTexture2D("brokenSliverBody.png"), GadgetCoreAPI.LoadTexture2D("brokenSliverTail.png"));
-
-      CreateDroidEnemy("BrokenDroid", GadgetCoreAPI.LoadTexture2D("droid.png"));
-
-      CreateLaserHazard("LazerHazard", GadgetCoreAPI.LoadTexture2D("brokenLaser.png"));
-
-      ItemInfo itemInfo = new ItemInfo(ItemType.GENERIC, "port5", "", null as Texture2D).Register("port5");
-      TileInfo tile = new TileInfo(TileType.INTERACTIVE, null as Texture2D, new GameObject("port5"), itemInfo).Register("port5");
-
-      CreateOldChest("OldChest", GadgetCoreAPI.LoadTexture2D("oldChest.png"));
-
-
-      Core.itemOldTex = new ItemInfo(ItemType.GENERIC, "Old Tec", "Some piece of old\ntechnology", GadgetCoreAPI.LoadTexture2D("iOldTec.png"));
-      ItemRegistry.Singleton.Register(Core.itemOldTex, "oldtec");
-
-
-      Core.itemOldTexShield = new ItemInfo(ItemType.OFFHAND, "Old Tec Shield", "", GadgetCoreAPI.LoadTexture2D("iOldTecShield.png"), Stats: new EquipStats(1, 1, 1, 1, 3, 0),
-         HeldTex: GadgetCoreAPI.LoadTexture2D("iOldTecShield.png"));
-      ItemRegistry.Singleton.Register(Core.itemOldTexShield, "oldtecshield");
-
-      Core.itemOldTexHelmet = new ItemInfo(ItemType.HELMET, "Old Tec Helmet", "", GadgetCoreAPI.LoadTexture2D("iOldTecHelmet.png"), Stats: new EquipStats(1, 1, 1, 1, 3, 0),
-         HeadTex: GadgetCoreAPI.LoadTexture2D("hOldTecHelmet.png"));
-      ItemRegistry.Singleton.Register(Core.itemOldTexHelmet, "oldtechelmet");
-
-      Core.itemOldTexArmor = new ItemInfo(ItemType.ARMOR, "Old Tec Armor", "", GadgetCoreAPI.LoadTexture2D("iOldTecArmor.png"), Stats: new EquipStats(1, 1, 1, 1, 3, 0),
-         BodyTex: GadgetCoreAPI.LoadTexture2D("bOldTecArmor.png"), ArmTex: GadgetCoreAPI.LoadTexture2D("aOldTecArmor.png"));
-      ItemRegistry.Singleton.Register(Core.itemOldTexArmor, "oldtecarmor");
-
-      Core.itemOldTexDroid = new ItemInfo(ItemType.DROID, "Old Tec Droid", "", GadgetCoreAPI.LoadTexture2D("iOldTecDroid.png"), Stats: new EquipStats(1, 1, 1, 1, 3, 0),
-         BodyTex: GadgetCoreAPI.LoadTexture2D("dOldTecDroidBase.png"), HeadTex: GadgetCoreAPI.LoadTexture2D("dOldTecDroidTop.png"));
-      ItemRegistry.Singleton.Register(Core.itemOldTexDroid, "oldtecdroid");
-
-      Core.itemOldTexMod = new ItemInfo(ItemType.MOD, "GearModStackSize+", "GEAR MOD\nAttach to weapons\nand armor in Mech City.", GadgetCoreAPI.LoadTexture2D("iOldTecMod.png"));
-      ItemRegistry.Singleton.Register(Core.itemOldTexMod, "oldtecmod");
-
-      var recipePage = new RecipePage(RecipePageType.UniversalCrafter, "Old Tec", GadgetCoreAPI.LoadTexture2D("recipesOldTec")).Register();
-      recipePage.AddRecipePageEntry(new RecipePageEntry(Core.itemOldTex.GetID(), Core.itemOldTex.GetID(), 133, Core.itemOldTexShield.GetID(), allwaysShowInput: true));
-      recipePage.AddRecipePageEntry(new RecipePageEntry(Core.itemOldTex.GetID(), Core.itemOldTex.GetID(), 123, Core.itemOldTexHelmet.GetID(), allwaysShowInput: true));
-      recipePage.AddRecipePageEntry(new RecipePageEntry(Core.itemOldTex.GetID(), Core.itemOldTex.GetID(), 103, Core.itemOldTexArmor.GetID(), allwaysShowInput: true));
-      recipePage.AddRecipePageEntry(new RecipePageEntry(Core.itemOldTex.GetID(), Core.itemOldTex.GetID(), 113, Core.itemOldTexDroid.GetID(), allwaysShowInput: true));
-      recipePage.AddRecipePageEntry(new RecipePageEntry(Core.itemOldTex.GetID(), Core.itemOldTex.GetID(), 210, Core.itemOldTexMod.GetID(), allwaysShowInput: true));
-
-      var universalCrafter = ((CraftMenuInfo)MenuRegistry.Singleton["Gadget Core:Crafter Menu"]);
-      universalCrafter.AddCraftPerformer(CraftMenuInfo.CreateSimpleCraftPerformer(
-        Tuple.Create(new int[] { Core.itemOldTex.GetID(), Core.itemOldTex.GetID(), 133 }, new Item(Core.itemOldTexShield.GetID(), 1, 0, 0, 0, new int[3], new int[3]), 0)));
-      universalCrafter.AddCraftPerformer(CraftMenuInfo.CreateSimpleCraftPerformer(
-       Tuple.Create(new int[] { Core.itemOldTex.GetID(), Core.itemOldTex.GetID(), 123 }, new Item(Core.itemOldTexHelmet.GetID(), 1, 0, 0, 0, new int[3], new int[3]), 0)));
-      universalCrafter.AddCraftPerformer(CraftMenuInfo.CreateSimpleCraftPerformer(
-        Tuple.Create(new int[] { Core.itemOldTex.GetID(), Core.itemOldTex.GetID(), 103 }, new Item(Core.itemOldTexArmor.GetID(), 1, 0, 0, 0, new int[3], new int[3]), 0)));
-      universalCrafter.AddCraftPerformer(CraftMenuInfo.CreateSimpleCraftPerformer(
-        Tuple.Create(new int[] { Core.itemOldTex.GetID(), Core.itemOldTex.GetID(), 113 }, new Item(Core.itemOldTexDroid.GetID(), 1, 0, 0, 0, new int[3], new int[3]), 0)));
-      universalCrafter.AddCraftPerformer(CraftMenuInfo.CreateSimpleCraftPerformer(
-        Tuple.Create(new int[] { Core.itemOldTex.GetID(), Core.itemOldTex.GetID(), 210 }, new Item(Core.itemOldTexMod.GetID(), 1, 0, 0, 0, new int[3], new int[3]), 0)));
-
-      tile.OnInteract += Tile_OnInteract;
-    }
-
-    private IEnumerator Tile_OnInteract()
-    {
-      InstanceTracker.PlayerScript.Portal(5);
-      yield break;
-    }
-
-    private void CreateShipPart(string name, Texture texture, Texture textureBG, int[][] collisions, int[][] lamp, int tileW = 32, int tileH = 16)
-    {
-      var gameObject = Object.Instantiate((GameObject)Resources.Load("z/chunk"));
-      gameObject.transform.localScale = new Vector3(tileW * 2, tileH * 2, 1);
-
-      var rendererBody = gameObject.GetComponentInChildren<Renderer>();
-      rendererBody.material = new Material(Shader.Find("Transparent/Diffuse"))
-      {
-        mainTexture = texture
-      };
-
-      for (int i = 0; i < 6; i++)
-        GameObject.DestroyImmediate(gameObject.transform.GetChild(0).gameObject);
-      for (int i = 0; i < 16; i++)
-        GameObject.DestroyImmediate(gameObject.transform.GetChild(1).gameObject);
-
-      for (int i = 0; i < 7; i++)
-        GameObject.DestroyImmediate(gameObject.transform.GetChild(0).GetChild(0).gameObject);
-
-      Component.DestroyImmediate(gameObject.GetComponent<Chunk>());
-
-      var bgRenderObject = GameObject.Instantiate(gameObject);
-      for (int i = 0; i < bgRenderObject.transform.childCount; i++)
-        GameObject.DestroyImmediate(bgRenderObject.transform.GetChild(0).gameObject);
-
-      bgRenderObject.transform.SetParent(gameObject.transform);
-      bgRenderObject.transform.localScale = new Vector3(1, 1, 1);
-      bgRenderObject.transform.localPosition = new Vector3(0, 0, -0.3f);
-      var rendererBG = bgRenderObject.GetComponent<Renderer>();
-      rendererBG.material = new Material(Shader.Find("Transparent/Diffuse"))
-      {
-        mainTexture = textureBG
-      };
-
-      GameObject root = gameObject.transform.GetChild(0).gameObject;
-      GameObject inst = root.transform.GetChild(0).gameObject;
-
-      for (int i = 0; i < collisions.Length; i++)
-      {
-        GameObject entry = GameObject.Instantiate(inst);
-
-        entry.transform.SetParent(root.transform);
-
-        int[] coll = collisions[i];
-
-        float w = coll[2] * (2.0f / tileW);
-        float h = coll[3] * (2.0f / tileH);
-
-        float x = coll[0] * (2.0f / tileW) + w / 2;
-        float y = coll[1] * (2.0f / tileH) + h / 2;
-
-        entry.transform.localScale = new Vector3(w, h, 1);
-        entry.transform.localPosition = new Vector3(x - 1, y - 1, 0);
-      }
-
-      for (int i = 0; i < lamp.Length; i++)
-      {
-        int[] coll = lamp[i];
-
-        float w = (2.0f / tileW);
-        float h = (2.0f / tileH);
-        int type = coll[2];
-
-        float x = coll[0] * (2.0f / tileW) + w / 2;
-        float y = coll[1] * (2.0f / tileH) + h / 2;
-
-        GameObject entry = null;
-
-        if (type == 0)
-          entry = Object.Instantiate<GameObject>((GameObject)Resources.Load("prop/" + 2401));
-        if (type == 1)
-          entry = Object.Instantiate<GameObject>((GameObject)Resources.Load("prop/" + 2402));
-
-        entry.transform.SetParent(root.transform);
-
-        entry.transform.localScale = new Vector3(w / 4, h / 4, 1);
-        entry.transform.localPosition = new Vector3(x - 1, y - 1, -1);
-      }
-
-      GameObject.DestroyImmediate(gameObject.transform.GetChild(0).GetChild(0).gameObject);
-
-      GadgetCoreAPI.AddCustomResource("z/Ships/" + name, gameObject);
-    }
-
-    private void CreateObject(string name, Texture2D texture, bool large = false)
-    {
-      GameObject gameObject = Object.Instantiate<GameObject>((GameObject)Resources.Load("prop/2501"));
-      Renderer renderer = gameObject.GetComponentInChildren<Renderer>();
-      renderer.material = new Material(Shader.Find("Unlit/Transparent"))
-      {
-        mainTexture = texture
-      };
-      if (large)
-        gameObject.transform.localScale = new Vector3(gameObject.transform.localScale.x * 2, gameObject.transform.localScale.y * 2, 1);
-      GadgetCoreAPI.AddCustomResource("obj/Ships/" + name, gameObject);
-    }
-
-    private void CreateBrakableObject(string name, Texture2D texture, bool large = false, ObjectType type = ObjectType.ORE)
-    {
-      var i = new ObjectInfo(type, new Item(57, 1, 0, 0, 0, new int[3], new int[3]), 16, texture).Register(name);
-      if (large)
-      {
-        var t = i.Object.transform.GetChild(0);
-        t.localScale = new Vector3(4, 4, 1);
-      }
-      GadgetCoreAPI.AddCustomResource("obj/Ships/" + name, i.Object);
-      Core.spawnObjects.Add(i.GetID());
-    }
-
-    private void CreateSliverEnemy(string name, Texture2D textureHead, Texture2D textureBody, Texture2D textureTail)
-    {
-      GameObject gameObject = Object.Instantiate<GameObject>((GameObject)Resources.Load("e/sliver"));
-      Renderer rendererHead = gameObject.transform.GetChild(4).GetChild(0).GetChild(0).GetComponentInChildren<Renderer>();
-      rendererHead.material = new Material(Shader.Find("Unlit/Transparent"))
-      {
-        mainTexture = textureHead
-      };
-      Renderer rendererBody = gameObject.transform.GetChild(4).GetChild(0).GetChild(1).GetComponentInChildren<Renderer>();
-      rendererBody.material = new Material(Shader.Find("Unlit/Transparent"))
-      {
-        mainTexture = textureBody
-      };
-      Renderer rendererTail = gameObject.transform.GetChild(4).GetChild(0).GetChild(2).GetComponentInChildren<Renderer>();
-      rendererTail.material = new Material(Shader.Find("Unlit/Transparent"))
-      {
-        mainTexture = textureTail
-      };
-      GadgetCoreAPI.AddCustomResource("e/Ships/" + name, gameObject);
-    }
-
-    private void CreateDroidEnemy(string name, Texture2D texture)
-    {
-      GameObject gameObject = Object.Instantiate<GameObject>((GameObject)Resources.Load("e/wisp"));
-      gameObject.name = name;
-      gameObject.transform.GetChild(0).GetChild(0).gameObject.name = name;
-      Renderer rendererHead = gameObject.transform.GetChild(0).GetChild(0).GetChild(0).GetComponentInChildren<Renderer>();
-      rendererHead.material = new Material(Shader.Find("Unlit/Transparent"))
-      {
-        mainTexture = texture
-      };
-      GameObject.DestroyImmediate(gameObject.transform.GetChild(0).GetChild(0).GetChild(1).gameObject);
-      Component.DestroyImmediate(gameObject.GetComponent<WispScript>());
-      gameObject.AddComponent<AttackDroidScript>();
-
-      gameObject.transform.GetChild(1).gameObject.SetActive(true);
-      gameObject.transform.GetChild(1).localScale = new Vector3(65, 40, 1);
-
-      AnimationClip clip = new AnimationClip
-      {
-        name = "spinn",
-        wrapMode = WrapMode.Once,
-        legacy = true
-      };
-      clip.SetCurve("", typeof(Transform), "localEulerAngles.z", AnimationCurve.Linear(0, 0, 0.5f, 360));
-      var animation = gameObject.transform.GetChild(0).gameObject.AddComponent<Animation>();
-      animation.AddClip(clip, "spinn");
-      animation.clip = clip;
-
-      GadgetCoreAPI.AddCustomResource("e/Ships/" + name, gameObject);
-    }
-
-    private void CreateLaserHazard(string name, Texture2D texture)
-    {
-      GameObject gameObjectWisp = Object.Instantiate<GameObject>((GameObject)Resources.Load("e/wisp"));
-      var gameObject = gameObjectWisp.transform.GetChild(0).GetChild(0).GetChild(0).gameObject;
-      gameObjectWisp.transform.GetChild(3).SetParent(gameObject.transform);
-      gameObject.transform.SetParent(null);
-      GameObject.DestroyImmediate(gameObjectWisp);
-      gameObject.name = name;
-      Renderer rendererHead = gameObject.GetComponentInChildren<Renderer>();
-      rendererHead.material = new Material(Shader.Find("Unlit/Transparent"))
-      {
-        mainTexture = texture
-      };
-      gameObject.AddComponent<BrokenLaserScript>();
-
-      var haz = gameObject.transform.GetChild(0).GetComponent<HazardScript>();
-      haz.damage = 3;
-
-      gameObject.transform.localScale = new Vector3(2f, 8f, 1);
-      gameObject.transform.localRotation = Quaternion.Euler(0, 180, 0);
-      gameObject.transform.GetChild(0).localScale = new Vector3(1, 1, 1);
-      var trigger = gameObject.transform.GetChild(0).GetComponent<BoxCollider>();
-      trigger.size = new Vector3(0.6f, 2, 1);
-      trigger.isTrigger = true;
-      var collider = gameObject.transform.GetChild(0).gameObject.AddComponent<BoxCollider>();
-      collider.size = new Vector3(0.3f, 2, 1);
-      collider.isTrigger = false;
-
-      GadgetCoreAPI.AddCustomResource("haz/Ships/" + name, gameObject);
-    }
-
-    private void CreateOldChest(string name, Texture texture)
-    {
-      GameObject gameObject = Object.Instantiate<GameObject>((GameObject)Resources.Load("obj/chest"));
-      Renderer renderer = gameObject.transform.GetChild(0).gameObject.GetComponentInChildren<Renderer>();
-      renderer.material = new Material(Shader.Find("Unlit/Transparent"))
-      {
-        mainTexture = texture
-      };
-      Component.DestroyImmediate(gameObject.GetComponent<ChestScript>());
-      gameObject.AddComponent<OldChestScript>();
-      GadgetCoreAPI.AddCustomResource("obj/Ships/" + name, gameObject);
-    }
-  }
-}

+ 249 - 17
Ships.csproj → Subworlds.csproj

@@ -9,8 +9,8 @@
     <ProjectGuid>{91AB81DE-EAEE-47D1-93DD-541179208219}</ProjectGuid>
     <ProjectGuid>{91AB81DE-EAEE-47D1-93DD-541179208219}</ProjectGuid>
     <OutputType>Library</OutputType>
     <OutputType>Library</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>Ships</RootNamespace>
-    <AssemblyName>Ships</AssemblyName>
+    <RootNamespace>Subworlds</RootNamespace>
+    <AssemblyName>Subworlds</AssemblyName>
     <TargetFrameworks>net35</TargetFrameworks>
     <TargetFrameworks>net35</TargetFrameworks>
     <FileAlignment>512</FileAlignment>
     <FileAlignment>512</FileAlignment>
     <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
     <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
@@ -42,7 +42,11 @@
     <None Remove="Assets\a16.png" />
     <None Remove="Assets\a16.png" />
     <None Remove="Assets\brokenLazer.png" />
     <None Remove="Assets\brokenLazer.png" />
     <None Remove="Assets\d17b.png" />
     <None Remove="Assets\d17b.png" />
+    <None Remove="Assets\Meteoroid\planetSpace.png" />
+    <None Remove="Assets\Meteoroid\stars.png" />
     <None Remove="Assets\planetScrapYardPrev.png" />
     <None Remove="Assets\planetScrapYardPrev.png" />
+    <None Remove="Assets\Ship\aOldTecArmor.png" />
+    <None Remove="Assets\Ship\planetShip.png" />
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <Reference Include="0Harmony">
     <Reference Include="0Harmony">
@@ -137,13 +141,13 @@
     <None Update="Assets\bgScrapYardTop.png">
     <None Update="Assets\bgScrapYardTop.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
-    <None Update="Assets\bgShips.png">
+    <None Update="Assets\bgSubworlds.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
-    <None Update="Assets\bgShipsExtension.png">
+    <None Update="Assets\bgSubworldsExtension.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
-    <None Update="Assets\bgShipsTop.png">
+    <None Update="Assets\bgSubworldsTop.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
     <None Update="Assets\bgStars.png">
     <None Update="Assets\bgStars.png">
@@ -218,16 +222,16 @@
     <None Update="Assets\bScrapYardbg3.png">
     <None Update="Assets\bScrapYardbg3.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
-    <None Update="Assets\bShipsbg0.png">
+    <None Update="Assets\bSubworldsbg0.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
-    <None Update="Assets\bShipsbg1.png">
+    <None Update="Assets\bSubworldsbg1.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
-    <None Update="Assets\bShipsbg2.png">
+    <None Update="Assets\bSubworldsbg2.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
-    <None Update="Assets\bShipsbg3.png">
+    <None Update="Assets\bSubworldsbg3.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
     <None Update="Assets\cGreenLamp.png">
     <None Update="Assets\cGreenLamp.png">
@@ -239,6 +243,42 @@
     <None Update="Assets\cOrangeLamp.png">
     <None Update="Assets\cOrangeLamp.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
+    <None Update="Assets\Core\aOldTecArmor.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Core\bOldTecArmor.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Core\dOldTecDroidBase.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Core\dOldTecDroidTop.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Core\hOldTecHelmet.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Core\iOldCore.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Core\iOldTec.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Core\iOldTecArmor.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Core\iOldTecDroid.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Core\iOldTecHelmet.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Core\iOldTecMod.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Core\iOldTecShield.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
     <None Update="Assets\cPlatform.png">
     <None Update="Assets\cPlatform.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
@@ -263,7 +303,7 @@
     <None Update="Assets\entranceScrapYard.png">
     <None Update="Assets\entranceScrapYard.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
-    <None Update="Assets\entranceShips.png">
+    <None Update="Assets\entranceSubworlds.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
     <None Update="Assets\First\one">
     <None Update="Assets\First\one">
@@ -344,16 +384,61 @@
     <None Update="Assets\metalPlatformClean.png">
     <None Update="Assets\metalPlatformClean.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
+    <None Update="Assets\Meteoroid\bgNone.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Meteoroid\bgStars.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Meteoroid\button.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Meteoroid\icon.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Meteoroid\meteor1.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Meteoroid\meteor2.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Meteoroid\meteor3.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Meteoroid\meteor4.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Meteoroid\meteorBaseBG.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Meteoroid\meteorBaseFG.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Meteoroid\parallax.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Meteoroid\sign.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Meteoroid\spaceOre.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Meteoroid\spaceOreBig.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Meteoroid\spaceOreCrack.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
     <None Update="Assets\midCoverChunk0.png">
     <None Update="Assets\midCoverChunk0.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
     <None Update="Assets\midHiddenChunk0.png">
     <None Update="Assets\midHiddenChunk0.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
-    <None Update="Assets\midShipsChunk0.png">
+    <None Update="Assets\midSubworldsChunk0.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
-    <None Update="Assets\midShipsChunk1.png">
+    <None Update="Assets\midSubworldsChunk1.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
     <None Update="Assets\oldChest.png">
     <None Update="Assets\oldChest.png">
@@ -380,10 +465,10 @@
     <None Update="Assets\planetShipPrev.png">
     <None Update="Assets\planetShipPrev.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
-    <None Update="Assets\planetShips.png">
+    <None Update="Assets\planetSubworlds.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
-    <None Update="Assets\planetShipsPrev.png">
+    <None Update="Assets\planetSubworldsPrev.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
     <None Update="Assets\planetSpacePrev.png">
     <None Update="Assets\planetSpacePrev.png">
@@ -425,6 +510,150 @@
     <None Update="Assets\shipAMainFG.png">
     <None Update="Assets\shipAMainFG.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
+    <None Update="Assets\Ship\bgNone.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\bgStars.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\bOldTecArmor.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\brokenChest.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\brokenCrates1.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\brokenCrates2.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\brokenCrates3.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\brokenCrates4.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\brokenItemMod.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\brokenLaser.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\brokenPirate1.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\brokenPirate2.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\brokenPirate3.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\brokenPirate4.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\brokenPirate5.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\brokenPirate6.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\brokenSliverbody.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\brokenSliverHead.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\brokenSliverTail.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\brokenTeleporter.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\button.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\dOldTecDroidBase.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\dOldTecDroidTop.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\droid.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\hOldTecHelmet.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\icon.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\iOldCore.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\iOldTec.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\iOldTecArmor.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\iOldTecDroid.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\iOldTecHelmet.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\iOldTecMod.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\iOldTecShield.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\oldChest.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\oldChestOpen.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\parallax.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\planetShipPrev.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\recipesOldTec.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\shipAEntranceBG.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\shipAEntranceFG.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\shipAExitBG.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\shipAExitFG.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\shipAMainBG.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\shipAMainFG.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\shuttleMainBG.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\shuttleMainFG.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\sign.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\Ship\signShip.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
     <None Update="Assets\shuttleMainBG.png">
     <None Update="Assets\shuttleMainBG.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
@@ -437,16 +666,16 @@
     <None Update="Assets\shopStand_old.png">
     <None Update="Assets\shopStand_old.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
-    <None Update="Assets\sideBigShips.png">
+    <None Update="Assets\sideBigSubworlds.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
-    <None Update="Assets\sidesmallShips.png">
+    <None Update="Assets\sidesmallSubworlds.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
     <None Update="Assets\signShip.png">
     <None Update="Assets\signShip.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
-    <None Update="Assets\signShips.png">
+    <None Update="Assets\signSubworlds.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     </None>
     <None Update="Manifest.ini">
     <None Update="Manifest.ini">
@@ -494,4 +723,7 @@
       <EmbedInteropTypes>false</EmbedInteropTypes>
       <EmbedInteropTypes>false</EmbedInteropTypes>
     </Reference>
     </Reference>
   </ItemGroup>
   </ItemGroup>
+  <ItemGroup>
+    <Folder Include="Assets\Core\" />
+  </ItemGroup>
 </Project>
 </Project>

+ 3 - 3
Ships.sln → Subworlds.sln

@@ -1,9 +1,9 @@
 
 
 Microsoft Visual Studio Solution File, Format Version 12.00
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio Version 16
 # Visual Studio Version 16
-VisualStudioVersion = 16.0.31205.134
+VisualStudioVersion = 16.0.31229.75
 MinimumVisualStudioVersion = 10.0.40219.1
 MinimumVisualStudioVersion = 10.0.40219.1
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ships", "Ships.csproj", "{91AB81DE-EAEE-47D1-93DD-541179208219}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Subworlds", "Subworlds.csproj", "{91AB81DE-EAEE-47D1-93DD-541179208219}"
 EndProject
 EndProject
 Global
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -17,6 +17,6 @@ Global
 		HideSolutionNode = FALSE
 		HideSolutionNode = FALSE
 	EndGlobalSection
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 	GlobalSection(ExtensibilityGlobals) = postSolution
-		SolutionGuid = {FA4A3404-09B6-4951-A5C2-5FAEB4A683AB}
+		SolutionGuid = {41F0A9C5-1A61-4D8E-880D-213CA3B17521}
 	EndGlobalSection
 	EndGlobalSection
 EndGlobal
 EndGlobal