renamed Wulfrum Pylon to Amplifier

This commit is contained in:
ben-tk authored and Cameron Ewell committed 2022-09-12 20:45:14 -04:00
1 parent 3375462c86
commit fce23937b9
11 files changed
+28 -26

No files matched your search

File renamed without changes.

Before

Width:  |  Height:  |  Size: 524 B

After

Width:  |  Height:  |  Size: 524 B

@@ -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()
File renamed without changes.

Before

Width:  |  Height:  |  Size: 364 B

After

Width:  |  Height:  |  Size: 364 B

+1 -1
View File
@@ -4612,7 +4612,7 @@ namespace CalamityMod.NPCs
spawnRate = (int)(spawnRate * 0.2);
maxSpawns = (int)(maxSpawns * 5f);
}
if (NPC.AnyNPCs(NPCType<WulfrumPylon>()))
if (NPC.AnyNPCs(NPCType<WulfrumAmplifier>()))
{
int otherWulfrumEnemies = NPC.CountNPCS(NPCType<WulfrumDrone>()) + NPC.CountNPCS(NPCType<WulfrumGyrator>()) + NPC.CountNPCS(NPCType<WulfrumHovercraft>()) + NPC.CountNPCS(NPCType<WulfrumRover>());
if (otherWulfrumEnemies < 4)
@@ -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<int> SuperchargableEnemies = new List<int>()
{
ModContent.NPCType<WulfrumDrone>(),
ModContent.NPCType<WulfrumGyrator>(),
ModContent.NPCType<WulfrumHovercraft>()
};
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<WulfrumPylonBanner>();
BannerItem = ModContent.ItemType<WulfrumAmplifierBanner>();
NPC.Calamity().VulnerableToSickness = false;
NPC.Calamity().VulnerableToElectricity = true;
}
@@ -79,6 +73,14 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void AI()
{
List<int> SuperchargableEnemies = new List<int>()
{
ModContent.NPCType<WulfrumDrone>(),
ModContent.NPCType<WulfrumGyrator>(),
ModContent.NPCType<WulfrumHovercraft>(),
ModContent.NPCType<WulfrumRover>()
};
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<WulfrumRover>())
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<WulfrumPylon>()) ? 1.3f : 1f;
float amplifierMult = !NPC.AnyNPCs(ModContent.NPCType<WulfrumAmplifier>()) ? 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<ModGore>("WulfrumPylonGore").Type, 1f);
Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find<ModGore>("WulfrumAmplifierGore").Type, 1f);
int randomGoreCount = Main.rand.Next(1, 4);
for (int i = 0; i < randomGoreCount; i++)
File renamed without changes.

Before

Width:  |  Height:  |  Size: 616 B

After

Width:  |  Height:  |  Size: 616 B

+1 -1
View File
@@ -198,7 +198,7 @@ namespace CalamityMod.NPCs.NormalNPCs
public override float SpawnChance(NPCSpawnInfo spawnInfo)
{
float pylonMult = NPC.AnyNPCs(ModContent.NPCType<WulfrumPylon>()) ? 5.5f : 1f;
float pylonMult = NPC.AnyNPCs(ModContent.NPCType<WulfrumAmplifier>()) ? 5.5f : 1f;
if (spawnInfo.PlayerSafe || spawnInfo.Player.Calamity().ZoneSulphur)
return 0f;
+1 -1
View File
@@ -176,7 +176,7 @@ namespace CalamityMod.NPCs.NormalNPCs
public override float SpawnChance(NPCSpawnInfo spawnInfo)
{
float pylonMult = NPC.AnyNPCs(ModContent.NPCType<WulfrumPylon>()) ? 5.5f : 1f;
float pylonMult = NPC.AnyNPCs(ModContent.NPCType<WulfrumAmplifier>()) ? 5.5f : 1f;
if (spawnInfo.PlayerSafe || spawnInfo.Player.Calamity().ZoneSulphur)
return 0f;
return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.020f : 0.115f) * pylonMult;
+1 -1
View File
@@ -265,7 +265,7 @@ namespace CalamityMod.NPCs.NormalNPCs
public override float SpawnChance(NPCSpawnInfo spawnInfo)
{
float pylonMult = NPC.AnyNPCs(ModContent.NPCType<WulfrumPylon>()) ? 5.5f : 1f;
float pylonMult = NPC.AnyNPCs(ModContent.NPCType<WulfrumAmplifier>()) ? 5.5f : 1f;
if (spawnInfo.PlayerSafe || spawnInfo.Player.Calamity().ZoneSulphur)
return 0f;
+1 -1
View File
@@ -137,7 +137,7 @@ namespace CalamityMod.NPCs.NormalNPCs
public override float SpawnChance(NPCSpawnInfo spawnInfo)
{
float pylonMult = NPC.AnyNPCs(ModContent.NPCType<WulfrumPylon>()) ? 5.5f : 1f;
float pylonMult = NPC.AnyNPCs(ModContent.NPCType<WulfrumAmplifier>()) ? 5.5f : 1f;
if (spawnInfo.PlayerSafe || spawnInfo.Player.Calamity().ZoneSulphur)
return 0f;
return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.010f : 0.135f) * pylonMult;
+2 -2
View File
@@ -725,7 +725,7 @@ namespace CalamityMod
item = ModContent.ItemType<WulfrumRoverBanner>();
break;
case 126:
item = ModContent.ItemType<WulfrumPylonBanner>();
item = ModContent.ItemType<WulfrumAmplifierBanner>();
break;
default:
break;
@@ -1084,7 +1084,7 @@ namespace CalamityMod
npc = ModContent.NPCType<WulfrumRover>();
break;
case 126:
npc = ModContent.NPCType<WulfrumPylon>();
npc = ModContent.NPCType<WulfrumAmplifier>();
break;
default:
break;