UltimateNPCWeapons.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. using UltimateNPCWeapons.Infos;
  2. using GadgetCore.API;
  3. using GadgetCore.API.ConfigMenu;
  4. using GadgetCore.Util;
  5. using RecipeMenuCore.API;
  6. using UnityEngine;
  7. namespace UltimateNPCWeapons
  8. {
  9. [Gadget("UltimateNPCWeapons", RequiredOnClients: true, LoadAfter: new string[] { "RecipeMenuCore" }, Dependencies: new string[] { "RecipeMenuCore" })]
  10. public class UltimateNPCWeapons : Gadget<UltimateNPCWeapons>
  11. {
  12. public const string MOD_VERSION = "1.0"; // Set this to the version of your mod.
  13. public const string CONFIG_VERSION = "1.0"; // Increment this whenever you change your mod's config file.
  14. public static int objectCrystalOreID;
  15. public static int objectCrystalWormWeakID;
  16. public static int objecWormOreID;
  17. public static bool objectWormOrePlaced;
  18. // Disable the config menu
  19. public override IGadgetConfigMenu GetConfigMenu() { return null; }
  20. public override string GetModDescription()
  21. {
  22. return "A mod adding ultimate variants for NPC weapons.\n\nArt by Saewin, Code by Zariteis";
  23. }
  24. protected override void Initialize()
  25. {
  26. Logger.Log("Ultimate NPC Weapons v" + Info.Mod.Version);
  27. // --
  28. // Creating items
  29. // --
  30. // Galactic
  31. var itemGalacticDarkfire = new GalacticDarkfireItemInfo(ItemType.WEAPON, "Galactic Darkfire", "", GadgetCoreAPI.LoadTexture2D("item/inventory/galacticDarkfire.png"), 20, new EquipStats(3, 0, 3, 0, 4, 0),
  32. HeldTex: GadgetCoreAPI.LoadTexture2D("item/hand/galacticDarkfire.png"));
  33. itemGalacticDarkfire.SetWeaponInfo(new float[] { 0.25f, 0, 0.25f, 0, 1, 0 }, GadgetCoreAPI.GetAttackSound(497));
  34. ItemRegistry.Singleton.Register(itemGalacticDarkfire, "galacticDarkfire");
  35. itemGalacticDarkfire.CreateProjectile("projectile/galacticDarkfireSmall.png", "projectile/galacticDarkfire.png");
  36. itemGalacticDarkfire.OnAttack += itemGalacticDarkfire.Attack;
  37. var itemGalacticSilence = new GalacticSilenceItemInfo(ItemType.WEAPON, "Galactic Silence", "", GadgetCoreAPI.LoadTexture2D("item/inventory/galacticSilence.png"), 20, new EquipStats(0, 0, 4, 0, 0, 0),
  38. HeldTex: GadgetCoreAPI.LoadTexture2D("item/hand/galacticSilence.png"));
  39. itemGalacticSilence.SetWeaponInfo(new float[] { 0, 0, 3, 0, 0, 0 }, GadgetCoreAPI.GetAttackSound(470));
  40. ItemRegistry.Singleton.Register(itemGalacticSilence, "galacticSilence");
  41. itemGalacticSilence.CreateProjectile("projectile/galacticSilence.png", "projectile/galacticSilenceSmoke.png");
  42. itemGalacticSilence.OnAttack += itemGalacticSilence.Attack;
  43. var itemGalacticRagnarok = new GalacticRagnarokItemInfo(ItemType.WEAPON, "Galactic Ragnarok", "", GadgetCoreAPI.LoadTexture2D("item/inventory/galacticRagnarok.png"), 20, new EquipStats(0, 0, 4, 0, 0, 0),
  44. HeldTex: GadgetCoreAPI.LoadTexture2D("item/hand/galacticRagnarok.png"));
  45. itemGalacticRagnarok.SetWeaponInfo(new float[] { 0, 0, 1, 0, 0, 0 }, GadgetCoreAPI.GetAttackSound(497));
  46. ItemRegistry.Singleton.Register(itemGalacticRagnarok, "galacticRagnarok");
  47. itemGalacticRagnarok.CreateProjectile("projectile/galacticRagnarokSmall.png", "projectile/galacticRagnarok.png");
  48. itemGalacticRagnarok.OnAttack += itemGalacticRagnarok.Attack;
  49. // Ringabolt
  50. var itemRingaboltsFury = new RingaboltsFuryItemInfo(ItemType.WEAPON, "Ringabolt's Fury", "", GadgetCoreAPI.LoadTexture2D("item/inventory/ringaboltsFury.png"), 20, new EquipStats(4, 5, 0, 0, 0, 0),
  51. HeldTex: GadgetCoreAPI.LoadTexture2D("item/hand/ringaboltsFury.png"));
  52. itemRingaboltsFury.SetWeaponInfo(new float[] { 0.5f, 0.5f, 0, 0, 0, 0 }, (AudioClip)Resources.Load("Au/excal"));
  53. ItemRegistry.Singleton.Register(itemRingaboltsFury, "ringaboltsFury");
  54. itemRingaboltsFury.CreateProjectile("projectile/ringaboltsFury.png");
  55. itemRingaboltsFury.OnAttack += itemRingaboltsFury.Attack;
  56. var itemRingaboltsVengeance = new RingaboltsVengeanceItemInfo(ItemType.WEAPON, "Ringabolt's Vengeance", "", GadgetCoreAPI.LoadTexture2D("item/inventory/ringaboltsVengeance.png"), 20, new EquipStats(0, 4, 0, 0, 0, 0),
  57. HeldTex: GadgetCoreAPI.LoadTexture2D("item/hand/ringaboltsVengeance.png"));
  58. itemRingaboltsVengeance.SetWeaponInfo(new float[] { 0, 5, 0, 0, 0, 0 }, (AudioClip)Resources.Load("Au/excal"));
  59. ItemRegistry.Singleton.Register(itemRingaboltsVengeance, "ringaboltsVengeance");
  60. itemRingaboltsVengeance.OnAttack += itemRingaboltsVengeance.Attack;
  61. var itemRingaboltsOath = new RingaboltsOathItemInfo(ItemType.WEAPON, "Ringabolt's Oath", "", GadgetCoreAPI.LoadTexture2D("item/inventory/ringaboltsOath.png"), 20, new EquipStats(0, 5, 0, 0, 0, 4),
  62. HeldTex: GadgetCoreAPI.LoadTexture2D("item/hand/ringaboltsOath.png"));
  63. itemRingaboltsOath.SetWeaponInfo(new float[] { 0, 1, 0, 0, 0, 0.5f }, (AudioClip)Resources.Load("Au/excal"));
  64. ItemRegistry.Singleton.Register(itemRingaboltsOath, "ringaboltsOath");
  65. itemRingaboltsOath.CreateProjectile("projectile/ringaboltsLightninin.png", "projectile/ringaboltsLightnininSpark.png");
  66. itemRingaboltsOath.OnAttack += itemRingaboltsOath.Attack;
  67. // Perceval
  68. var itemPercevalsPact = new PercevalsPactItemInfo(ItemType.WEAPON, "Perceval's Pact", "", GadgetCoreAPI.LoadTexture2D("item/inventory/percevalsPact.png"), 20, new EquipStats(0, 5, 0, 0, 0, 4),
  69. HeldTex: GadgetCoreAPI.LoadTexture2D("item/hand/percevalsPact.png"));
  70. itemPercevalsPact.SetWeaponInfo(new float[] { 0, 2, 0, 0, 0, 0.25f }, (AudioClip)Resources.Load("Au/excal"));
  71. ItemRegistry.Singleton.Register(itemPercevalsPact, "percevalsPact");
  72. itemPercevalsPact.CreateProjectile("projectile/percevalsPactSword.png", "projectile/percevalsPact.png");
  73. itemPercevalsPact.OnAttack += itemPercevalsPact.Attack;
  74. var itemPercevalsDiscipline = new PercevalsDisciplineItemInfo(ItemType.WEAPON, "Perceval's Discipline", "", GadgetCoreAPI.LoadTexture2D("item/inventory/percevalsDiscipline.png"), 20, new EquipStats(0, 0, 0, 0, 4, 3),
  75. HeldTex: GadgetCoreAPI.LoadTexture2D("item/hand/percevalsDiscipline.png"));
  76. itemPercevalsDiscipline.SetWeaponInfo(new float[] { 0, 0, 0, 0, 0.5f, 0.5f }, (AudioClip)Resources.Load("Au/excal"));
  77. ItemRegistry.Singleton.Register(itemPercevalsDiscipline, "percevalsDiscipline");
  78. itemPercevalsDiscipline.CreateProjectile("projectile/percevalsDisciplineSword.png", "projectile/percevalsDiscipline.png");
  79. itemPercevalsDiscipline.OnAttack += itemPercevalsDiscipline.Attack;
  80. var itemPercevalsVolley = new PercevalsVolleyItemInfo(ItemType.WEAPON, "Perceval's Volley", "", GadgetCoreAPI.LoadTexture2D("item/inventory/percevalsVolley.png"), 20, new EquipStats(0, 0, 0, 0, 0, 4),
  81. HeldTex: GadgetCoreAPI.LoadTexture2D("item/hand/percevalsVolley.png"));
  82. itemPercevalsVolley.SetWeaponInfo(new float[] { 0, 0, 0, 0, 0, 0.5f }, (AudioClip)Resources.Load("Au/excal"));
  83. ItemRegistry.Singleton.Register(itemPercevalsVolley, "percevalsVolley");
  84. itemPercevalsVolley.CreateProjectile("projectile/percevalsVolleySword.png", "projectile/percevalsVolley.png");
  85. itemPercevalsVolley.OnAttack += itemPercevalsVolley.Attack;
  86. // Wallace
  87. var itemWallacesBirthright = new WallacesBirthrightItemInfo(ItemType.WEAPON, "Wallace's Birthright", "", GadgetCoreAPI.LoadTexture2D("item/inventory/wallacesBirthright.png"), 20, new EquipStats(4, 0, 0, 0, 5, 5),
  88. HeldTex: GadgetCoreAPI.LoadTexture2D("item/hand/wallacesBirthright.png"));
  89. itemWallacesBirthright.SetWeaponInfo(new float[] { 1, 0, 0, 0, 0.5f, 0.5f }, (AudioClip)Resources.Load("Au/excal"));
  90. ItemRegistry.Singleton.Register(itemWallacesBirthright, "wallacesBirthright");
  91. itemWallacesBirthright.CreateProjectile("projectile/wallacesBirthright.png", "projectile/wallacesBirthrightSmall.png");
  92. itemWallacesBirthright.OnAttack += itemWallacesBirthright.Attack;
  93. var itemWallacesFealty = new WallacesFealtyItemInfo(ItemType.WEAPON, "Wallace's Fealty", "", GadgetCoreAPI.LoadTexture2D("item/inventory/wallacesFealty.png"), 20, new EquipStats(3, 3, 0, 0, 0, 1),
  94. HeldTex: GadgetCoreAPI.LoadTexture2D("item/hand/wallacesFealty.png"));
  95. itemWallacesFealty.SetWeaponInfo(new float[] { 4, 1, 0, 0, 0, 0.5f }, (AudioClip)Resources.Load("Au/excal"));
  96. ItemRegistry.Singleton.Register(itemWallacesFealty, "wallacesFealty");
  97. itemWallacesFealty.OnAttack += itemWallacesFealty.Attack;
  98. var itemWallacesEndurance = new WallacesEnduranceItemInfo(ItemType.WEAPON, "Wallace's Endurance", "", GadgetCoreAPI.LoadTexture2D("item/inventory/wallacesEndurance.png"), 20, new EquipStats(5, 0, 0, 0, 0, 0),
  99. HeldTex: GadgetCoreAPI.LoadTexture2D("item/hand/wallacesEndurance.png"));
  100. itemWallacesEndurance.SetWeaponInfo(new float[] { 2, 0, 0, 0, 0, 0 }, (AudioClip)Resources.Load("Au/excal"));
  101. ItemRegistry.Singleton.Register(itemWallacesEndurance, "wallacesEndurance");
  102. itemWallacesEndurance.CreateProjectile("projectile/wallacesEndurance.png");
  103. itemWallacesEndurance.OnAttack += itemWallacesEndurance.Attack;
  104. // --
  105. // Other Item stuff
  106. // --
  107. GadgetCoreAPI.AddUltimateForgeRecipe(new Tuple<int, int>(497, 89), itemGalacticSilence.GetID());
  108. GadgetCoreAPI.AddUltimateForgeRecipe(new Tuple<int, int>(497, 90), itemGalacticDarkfire.GetID());
  109. GadgetCoreAPI.AddUltimateForgeRecipe(new Tuple<int, int>(497, 91), itemGalacticRagnarok.GetID());
  110. GadgetCoreAPI.AddUltimateForgeRecipe(new Tuple<int, int>(346, 89), itemRingaboltsOath.GetID());
  111. GadgetCoreAPI.AddUltimateForgeRecipe(new Tuple<int, int>(346, 90), itemRingaboltsVengeance.GetID());
  112. GadgetCoreAPI.AddUltimateForgeRecipe(new Tuple<int, int>(346, 91), itemRingaboltsFury.GetID());
  113. GadgetCoreAPI.AddUltimateForgeRecipe(new Tuple<int, int>(597, 89), itemPercevalsDiscipline.GetID());
  114. GadgetCoreAPI.AddUltimateForgeRecipe(new Tuple<int, int>(597, 90), itemPercevalsPact.GetID());
  115. GadgetCoreAPI.AddUltimateForgeRecipe(new Tuple<int, int>(597, 91), itemPercevalsVolley.GetID());
  116. GadgetCoreAPI.AddUltimateForgeRecipe(new Tuple<int, int>(397, 89), itemWallacesFealty.GetID());
  117. GadgetCoreAPI.AddUltimateForgeRecipe(new Tuple<int, int>(397, 90), itemWallacesBirthright.GetID());
  118. GadgetCoreAPI.AddUltimateForgeRecipe(new Tuple<int, int>(397, 91), itemWallacesEndurance.GetID());
  119. var recipePage = new RecipePage(RecipePageType.UltimateForge, "Ultimate NPC Weapons", GadgetCoreAPI.LoadTexture2D("gui/recipesNPC.png")).Register();
  120. recipePage.AddRecipePageEntry(new RecipePageEntry(itemGalacticSilence.GetID(), itemGalacticDarkfire.GetID(), itemGalacticRagnarok.GetID(), 497));
  121. recipePage.AddRecipePageEntry(new RecipePageEntry(itemRingaboltsOath.GetID(), itemRingaboltsVengeance.GetID(), itemRingaboltsFury.GetID(), 346));
  122. recipePage.AddRecipePageEntry(new RecipePageEntry(itemPercevalsDiscipline.GetID(), itemPercevalsPact.GetID(), itemPercevalsVolley.GetID(), 597));
  123. recipePage.AddRecipePageEntry(new RecipePageEntry(itemWallacesFealty.GetID(), itemWallacesBirthright.GetID(), itemWallacesEndurance.GetID(), 397));
  124. }
  125. }
  126. }