Browse Source

[2.0.4.1] EntityInfo / Descriptors

Zariteis 4 years ago
parent
commit
841d172885

+ 2 - 2
Gadgets/CoreGadget.cs

@@ -9,7 +9,7 @@ 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 MOD_VERSION = "0.1"; // 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()
@@ -29,7 +29,7 @@ namespace Subworlds
 
     public override string GetModDescription()
     {
-      return "A mod that adds ships that can be reaided.";
+      return "Core module for Subworlds.";
     }
 
     protected override void Initialize()

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

@@ -139,6 +139,8 @@ namespace Subworlds
       gameObject.transform.GetChild(1).localScale = new Vector3(65, 40, 1);
 
       GadgetCoreAPI.AddCustomResource("e/Subworlds/" + name, gameObject);
+
+      new EntityInfo(EntityType.COMMON, gameObject).Register(name);
     }
 
   }

+ 2 - 2
Gadgets/Meteoroid/MeteoroidGadget.Init.cs

@@ -27,7 +27,7 @@ namespace Subworlds
 
     public override string GetModDescription()
     {
-      return "A mod that adds ships that can be reaided.";
+      return "Module that adds meteor fields to explore.";
     }
 
     protected override void Initialize()
@@ -49,7 +49,7 @@ namespace Subworlds
       planet.OnGenerateTown += MeteroidGenerator.Genarate;
       planet.Register("SubworldMeteoroid");
 
-      planet.PortalUses = -1;
+      planet.PortalUses = 0;
 
       // Create World Parts
       CreateBaseBlock("BaseBlockSmall", GadgetCoreAPI.LoadTexture2D("Meteoroid/meteor3.png"), 0.75f, 0.75f);

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

@@ -166,6 +166,8 @@ namespace Subworlds
       animation.clip = clip;
 
       GadgetCoreAPI.AddCustomResource("e/Subworlds/" + name, gameObject);
+
+      new EntityInfo(EntityType.COMMON, gameObject).Register(name);
     }
 
     private void CreateTurretEnemy(string name, Texture2D texture, Texture2D texture2)
@@ -200,6 +202,8 @@ namespace Subworlds
       collider.isTrigger = true;
 
       GadgetCoreAPI.AddCustomResource("e/Subworlds/" + name, gameObject);
+
+      new EntityInfo(EntityType.COMMON, gameObject).Register(name);
     }
 
     private void CreateLaserHazard(string name, Texture2D texture)
@@ -277,6 +281,8 @@ namespace Subworlds
       Core.logger.LogConsole("created: " + "z/Subworlds/" + name);
 
       GadgetCoreAPI.AddCustomResource("z/Subworlds/" + name, gameObject);
+
+      new EntityInfo(EntityType.COMMON, gameObject).Register(name);
     }
 
   }

+ 2 - 2
Gadgets/Ship/ShipsGadget.Init.cs

@@ -23,7 +23,7 @@ namespace Subworlds
 
     public override string GetModDescription()
     {
-      return "A mod that adds ships that can be reaided.";
+      return "Module that adds ship worlds to enter.";
     }
 
     protected override void Initialize()
@@ -45,7 +45,7 @@ namespace Subworlds
       planet.OnGenerateTown += ShipGenerator.Genarate;
       planet.Register("SubworldShip");
 
-      planet.PortalUses = -1;
+      planet.PortalUses = 0;
 
       // Create World Parts
       CreateShipPart("ShipAEntrance", GadgetCoreAPI.LoadTexture2D("Ship/shipAEntranceFG.png"), GadgetCoreAPI.LoadTexture2D("Ship/shipAEntranceBG.png"), new int[][] {

+ 2 - 2
Generator/MeteroidGenerator.cs

@@ -20,8 +20,8 @@ namespace Subworlds
     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 int W = 128 + 64;
+    private static int H = 128 - 32;
 
     private static float GetSizeForPixels(int px)
     {

+ 1 - 1
ModInfo.txt

@@ -1 +1 @@
-A mod that adds ships that can be reaided.
+A mod that adds subwords.

+ 1 - 1
Properties/AssemblyInfo.cs

@@ -3,7 +3,7 @@ using static Subworlds.CoreGadget;
 
 [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 subwords.")] //This is a short description for your mod's assembly.
 [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: AssemblyVersion(MOD_VERSION)]

+ 10 - 3
Scripts/BrokenTurretScript.cs

@@ -65,11 +65,18 @@ namespace Subworlds.Scripts
 
       for (int i = 0; i < 3; i++)
       {
+        this.dir = this.target.transform.position - this.t.position;
+        this.dir.Normalize();
+        var newRotation = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg;
+        z = (int) newRotation;
+        z = (z + 360) % 360;
+        gameObject.transform.GetChild(0).GetChild(0).GetChild(0).localEulerAngles = new Vector3(0, ((z + 360 - 90) % 360) > 180 ? 0 : 180, ((z + 360 - 90) % 360) > 180 ? z : 180 - z);
         var pos = this.target.transform.position;
-        yield return new WaitForSeconds(0.125f);
-        var p = (GameObject)Network.Instantiate(Resources.Load("proj/pirateproj"), this.t.position, Quaternion.identity, 0);
+        var dist = 2.1f;
+        var endPosition = new Vector3(this.t.position.x + Mathf.Cos((Mathf.PI / 180) * z) * dist, this.t.position.y + Mathf.Sin((Mathf.PI / 180) * z) * dist, this.t.position.z);
+        var p = (GameObject)Network.Instantiate(Resources.Load("proj/pirateproj"), endPosition, Quaternion.identity, 0);
         p.SendMessage("EnemySet", pos, SendMessageOptions.DontRequireReceiver);
-        yield return new WaitForSeconds(0.125f);
+        yield return new WaitForSeconds(0.625f);
         yield return Seach(10);
       }