diff --git a/Gores/Wulfrum/WulfrumPylonGore.png b/Gores/Wulfrum/WulfrumAmplifierGore.png similarity index 100% rename from Gores/Wulfrum/WulfrumPylonGore.png rename to Gores/Wulfrum/WulfrumAmplifierGore.png diff --git a/Items/Placeables/Banners/WulfrumPylonBanner.cs b/Items/Placeables/Banners/WulfrumAmplifierBanner.cs similarity index 88% rename from Items/Placeables/Banners/WulfrumPylonBanner.cs rename to Items/Placeables/Banners/WulfrumAmplifierBanner.cs index 93a31975e9..75e8bc424d 100644 --- a/Items/Placeables/Banners/WulfrumPylonBanner.cs +++ b/Items/Placeables/Banners/WulfrumAmplifierBanner.cs @@ -4,12 +4,13 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { - public class WulfrumPylonBanner : ModItem + [LegacyName("WulfrumPylonBanner")] + public class WulfrumAmplifierBanner : ModItem { public override void SetStaticDefaults() { SacrificeTotal = 1; - Tooltip.SetDefault("{$CommonItemTooltip.BannerBonus}Wulfrum Pylon"); + Tooltip.SetDefault("{$CommonItemTooltip.BannerBonus}Wulfrum Amplifier"); } public override void SetDefaults() diff --git a/Items/Placeables/Banners/WulfrumPylonBanner.png b/Items/Placeables/Banners/WulfrumAmplifierBanner.png similarity index 100% rename from Items/Placeables/Banners/WulfrumPylonBanner.png rename to Items/Placeables/Banners/WulfrumAmplifierBanner.png diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index deabdd40e4..972f454685 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -4612,7 +4612,7 @@ namespace CalamityMod.NPCs spawnRate = (int)(spawnRate * 0.2); maxSpawns = (int)(maxSpawns * 5f); } - if (NPC.AnyNPCs(NPCType())) + if (NPC.AnyNPCs(NPCType())) { int otherWulfrumEnemies = NPC.CountNPCS(NPCType()) + NPC.CountNPCS(NPCType()) + NPC.CountNPCS(NPCType()) + NPC.CountNPCS(NPCType()); if (otherWulfrumEnemies < 4) diff --git a/NPCs/NormalNPCs/WulfrumPylon.cs b/NPCs/NormalNPCs/WulfrumAmplifier.cs similarity index 88% rename from NPCs/NormalNPCs/WulfrumPylon.cs rename to NPCs/NormalNPCs/WulfrumAmplifier.cs index 8d98169cb4..a04abe97b0 100644 --- a/NPCs/NormalNPCs/WulfrumPylon.cs +++ b/NPCs/NormalNPCs/WulfrumAmplifier.cs @@ -14,7 +14,7 @@ using CalamityMod.Sounds; namespace CalamityMod.NPCs.NormalNPCs { - public class WulfrumPylon : ModNPC + public class WulfrumAmplifier : ModNPC { public bool Charging { @@ -26,17 +26,11 @@ namespace CalamityMod.NPCs.NormalNPCs get => NPC.ai[1]; set => NPC.ai[1] = value; } - public static List SuperchargableEnemies = new List() - { - ModContent.NPCType(), - ModContent.NPCType(), - ModContent.NPCType() - }; public const float ChargeRadiusMax = 495f; public const float SuperchargeTime = 720f; public override void SetStaticDefaults() { - DisplayName.SetDefault("Wulfrum Pylon"); + DisplayName.SetDefault("Wulfrum Amplifier"); Main.npcFrameCount[NPC.type] = 6; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers(0) { @@ -61,7 +55,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = CommonCalamitySounds.WulfrumNPCDeathSound; Banner = NPC.type; - BannerItem = ModContent.ItemType(); + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } @@ -79,6 +73,14 @@ namespace CalamityMod.NPCs.NormalNPCs public override void AI() { + List SuperchargableEnemies = new List() + { + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType() + }; + NPC.TargetClosest(false); Player player = Main.player[NPC.target]; @@ -129,15 +131,14 @@ namespace CalamityMod.NPCs.NormalNPCs } } - for (int i = 0; i < Main.npc.Length; i++) + for (int i = 0; i < Main.maxNPCs; i++) { NPC npcAtIndex = Main.npc[i]; if (!npcAtIndex.active) continue; - // For some strange reason, the Wulfrum Rover is not counted when it's added to a static list. - // What I assume is going on is that it hasn't been loaded yet since it's later alphabetically (Pylon is before Rover). - // As a result, they are checked separately. + // For some strange reason, the Wulfrum enemies are not counted when SuperchargableEnemies is a static list declared up front. + // What I assume is going on is that it hasn't been loaded yet since it's later alphabetically (Amplifier is before the other enemies). if (!SuperchargableEnemies.Contains(npcAtIndex.type) && npcAtIndex.type != ModContent.NPCType()) continue; if (npcAtIndex.ai[3] > 0f) @@ -172,16 +173,16 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - float pylonMult = !NPC.AnyNPCs(ModContent.NPCType()) ? 1.3f : 1f; + float amplifierMult = !NPC.AnyNPCs(ModContent.NPCType()) ? 1.3f : 1f; if (spawnInfo.PlayerSafe || spawnInfo.Player.Calamity().ZoneSulphur) return 0f; // Spawn less frequently in the inner third of the world. if (spawnInfo.PlayerFloorX > Main.maxTilesX * 0.333f && spawnInfo.PlayerFloorX < Main.maxTilesX - Main.maxTilesX * 0.333f) - return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.01f : 0.06f) * pylonMult; + return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.01f : 0.06f) * amplifierMult; - return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.033f : 0.15f) * pylonMult; + return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.033f : 0.15f) * amplifierMult; } public override void HitEffect(int hitDirection, double damage) @@ -199,7 +200,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (!Main.dedServ) { - Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("WulfrumPylonGore").Type, 1f); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("WulfrumAmplifierGore").Type, 1f); int randomGoreCount = Main.rand.Next(1, 4); for (int i = 0; i < randomGoreCount; i++) diff --git a/NPCs/NormalNPCs/WulfrumPylon.png b/NPCs/NormalNPCs/WulfrumAmplifier.png similarity index 100% rename from NPCs/NormalNPCs/WulfrumPylon.png rename to NPCs/NormalNPCs/WulfrumAmplifier.png diff --git a/NPCs/NormalNPCs/WulfrumDrone.cs b/NPCs/NormalNPCs/WulfrumDrone.cs index cc8c140f3d..e51feb5ea8 100644 --- a/NPCs/NormalNPCs/WulfrumDrone.cs +++ b/NPCs/NormalNPCs/WulfrumDrone.cs @@ -198,7 +198,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - float pylonMult = NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f; + float pylonMult = NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f; if (spawnInfo.PlayerSafe || spawnInfo.Player.Calamity().ZoneSulphur) return 0f; diff --git a/NPCs/NormalNPCs/WulfrumGyrator.cs b/NPCs/NormalNPCs/WulfrumGyrator.cs index ce07a5f501..905ebcc267 100644 --- a/NPCs/NormalNPCs/WulfrumGyrator.cs +++ b/NPCs/NormalNPCs/WulfrumGyrator.cs @@ -176,7 +176,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - float pylonMult = NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f; + float pylonMult = NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f; if (spawnInfo.PlayerSafe || spawnInfo.Player.Calamity().ZoneSulphur) return 0f; return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.020f : 0.115f) * pylonMult; diff --git a/NPCs/NormalNPCs/WulfrumHovercraft.cs b/NPCs/NormalNPCs/WulfrumHovercraft.cs index b47b25c475..1e99f1a5c5 100644 --- a/NPCs/NormalNPCs/WulfrumHovercraft.cs +++ b/NPCs/NormalNPCs/WulfrumHovercraft.cs @@ -265,7 +265,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - float pylonMult = NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f; + float pylonMult = NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f; if (spawnInfo.PlayerSafe || spawnInfo.Player.Calamity().ZoneSulphur) return 0f; diff --git a/NPCs/NormalNPCs/WulfrumRover.cs b/NPCs/NormalNPCs/WulfrumRover.cs index 021f76770e..f311386932 100644 --- a/NPCs/NormalNPCs/WulfrumRover.cs +++ b/NPCs/NormalNPCs/WulfrumRover.cs @@ -137,7 +137,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - float pylonMult = NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f; + float pylonMult = NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f; if (spawnInfo.PlayerSafe || spawnInfo.Player.Calamity().ZoneSulphur) return 0f; return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.010f : 0.135f) * pylonMult; diff --git a/Utilities/MiscUtils.cs b/Utilities/MiscUtils.cs index 853884cdac..5e1d1d60d8 100644 --- a/Utilities/MiscUtils.cs +++ b/Utilities/MiscUtils.cs @@ -725,7 +725,7 @@ namespace CalamityMod item = ModContent.ItemType(); break; case 126: - item = ModContent.ItemType(); + item = ModContent.ItemType(); break; default: break; @@ -1084,7 +1084,7 @@ namespace CalamityMod npc = ModContent.NPCType(); break; case 126: - npc = ModContent.NPCType(); + npc = ModContent.NPCType(); break; default: break;