MonsterNests.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using UnityEngine;
  2. using GadgetCore.API;
  3. using GadgetCore.Util;
  4. using GadgetCore.API.ConfigMenu;
  5. namespace MonsterNests
  6. {
  7. [Gadget("MonsterNests")]
  8. public class MonsterNests : Gadget<MonsterNests>
  9. {
  10. public const string MOD_VERSION = "1.0"; // Set this to the version of your mod.
  11. public const string CONFIG_VERSION = "1.0"; // Increment this whenever you change your mod's config file.
  12. protected override void LoadConfig()
  13. {
  14. Config.Load();
  15. string fileVersion = Config.ReadString("ConfigVersion", CONFIG_VERSION, comments: "The Config Version (not to be confused with mod version)");
  16. if (fileVersion != CONFIG_VERSION)
  17. {
  18. Config.Reset();
  19. Config.WriteString("ConfigVersion", CONFIG_VERSION, comments: "The Config Version (not to be confused with mod version)");
  20. }
  21. Config.Reset();
  22. Config.Save();
  23. }
  24. public override IGadgetConfigMenu GetConfigMenu() { return null; }
  25. public override string GetModDescription()
  26. {
  27. return "A mod that adds some monster nests.";
  28. }
  29. protected override void Initialize()
  30. {
  31. Logger.Log("Monster Nests v" + Info.Mod.Version);
  32. Core.logger = Logger;
  33. Texture2D textureBugspotBig = GadgetCoreAPI.LoadTexture2D("bugspotBig.png");
  34. Texture2D textureSpikePlant = GadgetCoreAPI.LoadTexture2D("spikePlant.png");
  35. Texture2D textureSpikePlantCM = GadgetCoreAPI.LoadTexture2D("spikePlantCM.png");
  36. Texture2D textureSpiderEgg = GadgetCoreAPI.LoadTexture2D("spiderEgg.png");
  37. Texture2D textureSpiderEggCM = GadgetCoreAPI.LoadTexture2D("spiderEggCM.png");
  38. Texture2D textureGoldenShroom = GadgetCoreAPI.LoadTexture2D("goldenShroom.png");
  39. Texture2D textureAncientCrystal = GadgetCoreAPI.LoadTexture2D("ancientCrystal.png");
  40. Texture2D textureAncientCrystalCM = GadgetCoreAPI.LoadTexture2D("ancientCrystalCM.png");
  41. Texture2D texturePlagueNest = GadgetCoreAPI.LoadTexture2D("plagueNest.png");
  42. Texture2D textureFrozenWisp = GadgetCoreAPI.LoadTexture2D("frozenWisp.png");
  43. Texture2D textureMolten = GadgetCoreAPI.LoadTexture2D("frozenWisp.png");
  44. Core.objectBugspotBig = new ObjectInfo(ObjectType.BUGSPOT, new Item(31, 1, 0, 0, 0, new int[3], new int[3]), 16, textureBugspotBig).Register("bugspotBig");
  45. Core.objectSpikePlant = new ObjectInfo(ObjectType.PLANT, new Item(11, 1, 0, 0, 0, new int[3], new int[3]), 16, textureSpikePlant).Register("spikePlant");
  46. Core.objectSpikePlantCM = new ObjectInfo(ObjectType.PLANT, new Item(11, 1, 0, 0, 0, new int[3], new int[3]), 16, textureSpikePlantCM).Register("spikePlantCM");
  47. Core.objectSpiderEgg = new ObjectInfo(ObjectType.ORE, new Item(2, 1, 0, 0, 0, new int[3], new int[3]), 16, textureSpiderEgg).Register("spiderEgg");
  48. Core.objectSpiderEggCM = new ObjectInfo(ObjectType.ORE, new Item(2, 1, 0, 0, 0, new int[3], new int[3]), 16, textureSpiderEggCM).Register("spiderEggCM");
  49. Core.objectGoldenShroom = new ObjectInfo(ObjectType.PLANT, new Item(12, 1, 0, 0, 0, new int[3], new int[3]), 16, textureGoldenShroom).Register("goldenShroom");
  50. Core.objectAncientCrystal = new ObjectInfo(ObjectType.ORE, new Item(57, 1, 0, 0, 0, new int[3], new int[3]), 106, textureAncientCrystal).Register("ancientCrystal");
  51. Core.objectAncientCrystalCM = new ObjectInfo(ObjectType.ORE, new Item(57, 1, 0, 0, 0, new int[3], new int[3]), 106, textureAncientCrystalCM).Register("ancientCrystalCM");
  52. Core.objectPlagueNest = new ObjectInfo(ObjectType.TREE, new Item(51, 1, 0, 0, 0, new int[3], new int[3]), 106, texturePlagueNest).Register("plagueNest");
  53. Core.objectFrozenWisp = new ObjectInfo(ObjectType.ORE, new Item(3, 1, 0, 0, 0, new int[3], new int[3]), 16, textureFrozenWisp).Register("frozenWisp");
  54. }
  55. }
  56. }