diff --git a/Backgrounds/SunkenSeaBurrowsBG.cs b/Backgrounds/SunkenSeaBurrowsBG.cs index d464073728..bff3bd212f 100644 --- a/Backgrounds/SunkenSeaBurrowsBG.cs +++ b/Backgrounds/SunkenSeaBurrowsBG.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Backgrounds /// public override void PreUpdatePlayers() { - if (!Main.dedServ && Main.LocalPlayer.InModBiome()) + if (!Main.dedServ && Main.LocalPlayer.InModBiome()) { for (int i = 0; i < Main.screenWidth / 16; i++) { @@ -68,7 +68,7 @@ namespace CalamityMod.Backgrounds private static void DrawBurrowsBG() { - if (Main.LocalPlayer.InModBiome(ModContent.GetInstance())) + if (Main.LocalPlayer.InModBiome(ModContent.GetInstance())) { Transparency += TransitionSpeed; diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index c4b21f2707..9006ab3ca5 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -307,6 +307,9 @@ namespace CalamityMod.Balancing // 50% resist to true melee. NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), ResistTrueMelee(0.5f))); + // 50% resist to Galactus Blade. + NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.5f, ProjectileType()))); + // 40% resist to Stellar Torus Staff. NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.6f, ProjectileType()))); #endregion @@ -416,9 +419,6 @@ namespace CalamityMod.Balancing // 60% resist to Dynamic Pursuer. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.4f, ProjectileType(), ProjectileType(), ProjectileType())))); - // 60% resist to Prismatic Breaker's deathray. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.4f, ProjectileType())))); - // 50% resist to Chicken Cannon. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); @@ -434,6 +434,9 @@ namespace CalamityMod.Balancing // 50% resist to Yharim's Crystal. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + // 45% resist to Prismatic Breaker's deathray. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType())))); + // 45% resist to Wrathwing's stealth strike fireballs. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType())))); diff --git a/Balancing/BalancingConstants.cs b/Balancing/BalancingConstants.cs index 4b931a4b1f..0bc145c879 100644 --- a/Balancing/BalancingConstants.cs +++ b/Balancing/BalancingConstants.cs @@ -3,8 +3,8 @@ public static class BalancingConstants { #region Movement - // When the relevant config is enabled: Gives the player a substantial +50% move speed boost at all times - internal static readonly float DefaultMoveSpeedBoost = 0.5f; + // When the relevant config is enabled: Multiplies the player's movement speed by 1.5x at all times + internal static readonly float DefaultMoveSpeedBoost = 1.5f; // When the relevant config is enabled: Increases the player's base jump height by 10% internal static readonly float ConfigBoostedBaseJumpHeight = 5.51f; // vanilla = 5.01f diff --git a/BiomeManagers/BasaltGullyBiome.cs b/BiomeManagers/BasaltGullyBiome.cs new file mode 100644 index 0000000000..5f4b388829 --- /dev/null +++ b/BiomeManagers/BasaltGullyBiome.cs @@ -0,0 +1,9 @@ +using Terraria.ModLoader; + +namespace CalamityMod.BiomeManagers +{ + public class BasaltGullyBiome : ModBiome + { + + } +} diff --git a/BiomeManagers/SunkenSeaBurrowsBiome.cs b/BiomeManagers/GleamingBurrowsBiome.cs similarity index 96% rename from BiomeManagers/SunkenSeaBurrowsBiome.cs rename to BiomeManagers/GleamingBurrowsBiome.cs index b4e07aab9a..94bd09ac08 100644 --- a/BiomeManagers/SunkenSeaBurrowsBiome.cs +++ b/BiomeManagers/GleamingBurrowsBiome.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.BiomeManagers { - public class SunkenSeaBurrowsBiome : ModBiome + public class GleamingBurrowsBiome : ModBiome { public override ModWaterStyle WaterStyle => SunkenSeaBurrowsWater.Instance; public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find("CalamityMod/SunkenSeaBGStyle"); diff --git a/BiomeManagers/SunkenSeaPolypBiome.cs b/BiomeManagers/PolypForestBiome.cs similarity index 97% rename from BiomeManagers/SunkenSeaPolypBiome.cs rename to BiomeManagers/PolypForestBiome.cs index 7d1ead79a5..b440b5d7a9 100644 --- a/BiomeManagers/SunkenSeaPolypBiome.cs +++ b/BiomeManagers/PolypForestBiome.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.BiomeManagers { - public class SunkenSeaPolypBiome : ModBiome + public class PolypForestBiome : ModBiome { public override ModWaterStyle WaterStyle => SunkenSeaPolypWater.Instance; public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find("CalamityMod/SunkenSeaBGStyle"); diff --git a/BiomeManagers/SunkenSeaReefsBiome.cs b/BiomeManagers/RadiantReefsBiome.cs similarity index 97% rename from BiomeManagers/SunkenSeaReefsBiome.cs rename to BiomeManagers/RadiantReefsBiome.cs index 09f15f24c2..7dd90a03fb 100644 --- a/BiomeManagers/SunkenSeaReefsBiome.cs +++ b/BiomeManagers/RadiantReefsBiome.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.BiomeManagers { - public class SunkenSeaReefsBiome : ModBiome + public class RadiantReefsBiome : ModBiome { public override ModWaterStyle WaterStyle => SunkenSeaReefsWater.Instance; public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find("CalamityMod/SunkenSeaBGStyle"); diff --git a/BiomeManagers/SunkenSeaShoresBiome.cs b/BiomeManagers/TimelessShoresBiome.cs similarity index 96% rename from BiomeManagers/SunkenSeaShoresBiome.cs rename to BiomeManagers/TimelessShoresBiome.cs index 5e73170976..cb44c6cdc8 100644 --- a/BiomeManagers/SunkenSeaShoresBiome.cs +++ b/BiomeManagers/TimelessShoresBiome.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.BiomeManagers { - public class SunkenSeaShoresBiome : ModBiome + public class TimelessShoresBiome : ModBiome { public override ModWaterStyle WaterStyle => SunkenSeaShoresWater.Instance; public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find("CalamityMod/SunkenSeaBGStyle"); diff --git a/Buffs/Alcohol/AlcoholPoisoning.png b/Buffs/Alcohol/AlcoholPoisoning.png index 7c001df28c..224cdd155d 100644 Binary files a/Buffs/Alcohol/AlcoholPoisoning.png and b/Buffs/Alcohol/AlcoholPoisoning.png differ diff --git a/Buffs/Alcohol/Trippy.cs b/Buffs/Alcohol/Trippy.cs index e791bdd796..21b5357e8e 100644 --- a/Buffs/Alcohol/Trippy.cs +++ b/Buffs/Alcohol/Trippy.cs @@ -1,10 +1,14 @@ -using Terraria; +using CalamityMod.Items.Potions.Alcohol; +using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol { public class Trippy : ModBuff { + public override LocalizedText Description => base.Description.WithFormatArgs(OddMushroom.DamageBoost.ToPercent()); + public override void SetStaticDefaults() { Main.debuff[Type] = false; diff --git a/Buffs/DamageOverTime/BrainRot.png b/Buffs/DamageOverTime/BrainRot.png index f242db9951..3210eece1e 100644 Binary files a/Buffs/DamageOverTime/BrainRot.png and b/Buffs/DamageOverTime/BrainRot.png differ diff --git a/Buffs/DamageOverTime/BurningBlood.cs b/Buffs/DamageOverTime/BurningBlood.cs index 4e93df4ebc..e8d988b9a4 100644 --- a/Buffs/DamageOverTime/BurningBlood.cs +++ b/Buffs/DamageOverTime/BurningBlood.cs @@ -63,10 +63,10 @@ namespace CalamityMod.Buffs.DamageOverTime { if (Main.rand.NextBool(3)) { - int dust = Dust.NewDust(npc.position - new Vector2(2f), npc.width + 4, npc.height + 4, Main.rand.NextBool(8) ? 296 : 5, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1.25f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 1.3f; - Main.dust[dust].velocity.Y -= 0.5f; + Dust blood = Dust.NewDustDirect(npc.position - new Vector2(2f), npc.width + 4, npc.height + 4, Main.rand.NextBool(8) ? 296 : 5, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1.25f); + blood.noGravity = true; + blood.velocity *= 1.3f; + blood.velocity.Y -= 0.5f; } Lighting.AddLight(npc.Center, 0.08f, 0f, 0f); } diff --git a/Buffs/DamageOverTime/CrushDepth.cs b/Buffs/DamageOverTime/CrushDepth.cs index 094c92c425..b10bc709aa 100644 --- a/Buffs/DamageOverTime/CrushDepth.cs +++ b/Buffs/DamageOverTime/CrushDepth.cs @@ -53,15 +53,15 @@ namespace CalamityMod.Buffs.DamageOverTime } // Blue n black dust - int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, Main.rand.NextBool(3) ? 104 : 186, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.4f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0.75f; - Main.dust[dust].velocity.X = Main.dust[dust].velocity.X * 0.75f; - Main.dust[dust].velocity.Y = Main.dust[dust].velocity.Y - 1f; + Dust water = Dust.NewDustDirect(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, Main.rand.NextBool(3) ? 104 : 186, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.4f); + water.noGravity = true; + water.velocity *= 0.75f; + water.velocity.X *= 0.75f; + water.velocity.Y -= 1f; if (Main.rand.NextBool(4)) { - Main.dust[dust].noGravity = false; - Main.dust[dust].scale *= 0.2f; + water.noGravity = false; + water.scale *= 0.2f; } } @@ -84,15 +84,15 @@ namespace CalamityMod.Buffs.DamageOverTime BloodParticle blood = new BloodParticle(npcSize, bloodVelocity, bloodLifetime, bloodScale, bloodColor); GeneralParticleHandler.SpawnParticle(blood); } - int dust = Dust.NewDust(npc.position - new Vector2(2f), npc.width + 4, npc.height + 4, Main.rand.NextBool(3) ? 104 : 186, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1.4f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0.75f; - Main.dust[dust].velocity.X = Main.dust[dust].velocity.X * 0.75f; - Main.dust[dust].velocity.Y = Main.dust[dust].velocity.Y - 1f; + Dust water = Dust.NewDustDirect(npc.position - new Vector2(2f), npc.width + 4, npc.height + 4, Main.rand.NextBool(3) ? 104 : 186, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1.4f); + water.noGravity = true; + water.velocity *= 0.75f; + water.velocity.X = water.velocity.X * 0.75f; + water.velocity.Y = water.velocity.Y - 1f; if (Main.rand.NextBool(4)) { - Main.dust[dust].noGravity = false; - Main.dust[dust].scale *= 0.2f; + water.noGravity = false; + water.scale *= 0.2f; } } } diff --git a/Buffs/DamageOverTime/HolyFlames.cs b/Buffs/DamageOverTime/HolyFlames.cs index ca809682e8..c4936b2e2a 100644 --- a/Buffs/DamageOverTime/HolyFlames.cs +++ b/Buffs/DamageOverTime/HolyFlames.cs @@ -45,10 +45,10 @@ namespace CalamityMod.Buffs.DamageOverTime { Vector2 dustCorner = Player.position - 2f * Vector2.One; Vector2 dustVel = Player.velocity + new Vector2(0f, Main.rand.NextFloat(-5f, -1f)); - int d = Dust.NewDust(dustCorner, Player.width + 4, Player.height + 4, DustID.GemTopaz, dustVel.X, dustVel.Y); - Main.dust[d].noGravity = true; - Main.dust[d].scale = Main.rand.NextFloat(0.7f, 1.2f); - Main.dust[d].alpha = 235; + Dust fire = Dust.NewDustDirect(dustCorner, Player.width + 4, Player.height + 4, DustID.GemTopaz, dustVel.X, dustVel.Y); + fire.noGravity = true; + fire.scale = Main.rand.NextFloat(0.7f, 1.2f); + fire.alpha = 235; } } @@ -66,10 +66,10 @@ namespace CalamityMod.Buffs.DamageOverTime { Vector2 dustCorner = npc.position - 2f * Vector2.One; Vector2 dustVel = npc.velocity + new Vector2(0f, Main.rand.NextFloat(-5f, -1f)); - int d = Dust.NewDust(dustCorner, npc.width + 4, npc.height + 4, DustID.GemTopaz, dustVel.X, dustVel.Y); - Main.dust[d].noGravity = true; - Main.dust[d].scale = Main.rand.NextFloat(0.7f, 1.2f); - Main.dust[d].alpha = 235; + Dust fire = Dust.NewDustDirect(dustCorner, npc.width + 4, npc.height + 4, DustID.GemTopaz, dustVel.X, dustVel.Y); + fire.noGravity = true; + fire.scale = Main.rand.NextFloat(0.7f, 1.2f); + fire.alpha = 235; } Lighting.AddLight(npc.position, 0.25f, 0.25f, 0.1f); } diff --git a/Buffs/DamageOverTime/Nightwither.cs b/Buffs/DamageOverTime/Nightwither.cs index 6b3db2fead..a6d24f65c1 100644 --- a/Buffs/DamageOverTime/Nightwither.cs +++ b/Buffs/DamageOverTime/Nightwither.cs @@ -44,10 +44,10 @@ namespace CalamityMod.Buffs.DamageOverTime { Vector2 dustCorner = Player.position - 2f * Vector2.One; Vector2 dustVel = Player.velocity + new Vector2(0f, Main.rand.NextFloat(-11f, -2f)); - int d = Dust.NewDust(dustCorner, Player.width + 4, Player.height + 4, Main.rand.NextBool(4) ? 300 : 323, dustVel.X, dustVel.Y); - Main.dust[d].noGravity = true; - Main.dust[d].scale = hasDebuffResistance ? Main.rand.NextFloat(0.3f, 0.3f) : Main.rand.NextFloat(0.5f, 0.5f); - Main.dust[d].alpha = 235; + Dust moonDust = Dust.NewDustDirect(dustCorner, Player.width + 4, Player.height + 4, Main.rand.NextBool(4) ? 300 : 323, dustVel.X, dustVel.Y); + moonDust.noGravity = true; + moonDust.scale = hasDebuffResistance ? Main.rand.NextFloat(0.3f, 0.3f) : Main.rand.NextFloat(0.5f, 0.5f); + moonDust.alpha = 235; } } @@ -64,10 +64,10 @@ namespace CalamityMod.Buffs.DamageOverTime { Vector2 dustCorner = npc.position - 2f * Vector2.One; Vector2 dustVel = npc.velocity + new Vector2(0f, Main.rand.NextFloat(-11f, -2f)); - int d = Dust.NewDust(dustCorner, npc.width + 4, npc.height + 4, Main.rand.NextBool(4) ? 300 : 323, dustVel.X, dustVel.Y); - Main.dust[d].noGravity = true; - Main.dust[d].scale = Main.rand.NextFloat(0.5f, 0.5f); - Main.dust[d].alpha = 235; + Dust moonDust = Dust.NewDustDirect(dustCorner, npc.width + 4, npc.height + 4, Main.rand.NextBool(4) ? 300 : 323, dustVel.X, dustVel.Y); + moonDust.noGravity = true; + moonDust.scale = Main.rand.NextFloat(0.5f, 0.5f); + moonDust.alpha = 235; } } } diff --git a/Buffs/DamageOverTime/RiptideDebuff.cs b/Buffs/DamageOverTime/RiptideDebuff.cs index 44ab9c9d92..62816f8004 100644 --- a/Buffs/DamageOverTime/RiptideDebuff.cs +++ b/Buffs/DamageOverTime/RiptideDebuff.cs @@ -36,11 +36,11 @@ namespace CalamityMod.Buffs.DamageOverTime if (Main.rand.NextBool(14)) { - int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, DustID.FungiHit, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1f); - Main.dust[dust].noGravity = false; - Main.dust[dust].velocity *= 1.2f; - Main.dust[dust].velocity.Y += 0.8f; - drawInfo.DustCache.Add(dust); + Dust dust = Dust.NewDustDirect(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, DustID.FungiHit, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1f); + dust.noGravity = false; + dust.velocity *= 1.2f; + dust.velocity.Y += 0.8f; + drawInfo.DustCache.Add(dust.dustIndex); } if (Main.rand.NextBool(9)) { diff --git a/Buffs/DamageOverTime/Shadowflame.cs b/Buffs/DamageOverTime/Shadowflame.cs index c67307c354..d97c8889ed 100644 --- a/Buffs/DamageOverTime/Shadowflame.cs +++ b/Buffs/DamageOverTime/Shadowflame.cs @@ -30,15 +30,15 @@ namespace CalamityMod.Buffs.DamageOverTime if (Main.rand.Next(5) < 4) { - int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, DustID.Shadowflame, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.1f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0.75f; - Main.dust[dust].velocity.X = Main.dust[dust].velocity.X * 0.75f; - Main.dust[dust].velocity.Y = Main.dust[dust].velocity.Y - 3f; + Dust flame = Dust.NewDustDirect(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, DustID.Shadowflame, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.1f); + flame.noGravity = true; + flame.velocity *= 0.75f; + flame.velocity.X *= 0.75f; + flame.velocity.Y -= 3f; if (Main.rand.NextBool(4)) { - Main.dust[dust].noGravity = false; - Main.dust[dust].scale *= 0.3f; + flame.noGravity = false; + flame.scale *= 0.3f; } } } diff --git a/Buffs/DamageOverTime/SulphuricPoisoning.cs b/Buffs/DamageOverTime/SulphuricPoisoning.cs index ebf3b5af1d..f71550c714 100644 --- a/Buffs/DamageOverTime/SulphuricPoisoning.cs +++ b/Buffs/DamageOverTime/SulphuricPoisoning.cs @@ -45,15 +45,15 @@ namespace CalamityMod.Buffs.DamageOverTime if (Main.rand.Next(5) < 4) { - int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, DustID.JungleTorch, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 0.6f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0.75f; - Main.dust[dust].velocity.X = Main.dust[dust].velocity.X * 0.75f; - Main.dust[dust].velocity.Y = Main.dust[dust].velocity.Y - 1f; + Dust microbe = Dust.NewDustDirect(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, DustID.JungleTorch, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 0.6f); + microbe.noGravity = true; + microbe.velocity *= 0.75f; + microbe.velocity.X *= 0.75f; + microbe.velocity.Y -= 1f; if (Main.rand.NextBool(4)) { - Main.dust[dust].noGravity = false; - Main.dust[dust].scale *= 0.2f; + microbe.noGravity = false; + microbe.scale *= 0.2f; } if (Main.rand.NextBool(5)) { @@ -68,15 +68,15 @@ namespace CalamityMod.Buffs.DamageOverTime if (Main.rand.NextBool()) { Vector2 npcSize = npc.Center + new Vector2(Main.rand.NextFloat(-npc.width / 2, npc.width / 2), Main.rand.NextFloat(-npc.height / 2, npc.height / 2)); - int dust = Dust.NewDust(npc.position - new Vector2(2f), npc.width + 4, npc.height + 4, DustID.JungleTorch, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1.2f + +(0.000003f * npc.width * npc.height)); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0.75f; - Main.dust[dust].velocity.X = Main.dust[dust].velocity.X * 0.75f; - Main.dust[dust].velocity.Y = Main.dust[dust].velocity.Y - 1f; + Dust microbe = Dust.NewDustDirect(npc.position - new Vector2(2f), npc.width + 4, npc.height + 4, DustID.JungleTorch, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1.2f + +(0.000003f * npc.width * npc.height)); + microbe.noGravity = true; + microbe.velocity *= 0.75f; + microbe.velocity.X *= 0.75f; + microbe.velocity.Y -= 1f; if (Main.rand.NextBool(4)) { - Main.dust[dust].noGravity = false; - Main.dust[dust].scale *= 0.4f; + microbe.noGravity = false; + microbe.scale *= 0.4f; } if (Main.rand.NextBool()) { diff --git a/Buffs/DamageOverTime/Vaporfied.cs b/Buffs/DamageOverTime/Vaporfied.cs index ef80343f1c..15064126fb 100644 --- a/Buffs/DamageOverTime/Vaporfied.cs +++ b/Buffs/DamageOverTime/Vaporfied.cs @@ -48,16 +48,16 @@ namespace CalamityMod.Buffs.DamageOverTime }); if (Main.rand.NextBool(4)) { - int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, dustType, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 1.8f; - Main.dust[dust].velocity.Y -= 0.5f; + Dust dust = Dust.NewDustDirect(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, dustType, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); + dust.noGravity = true; + dust.velocity *= 1.8f; + dust.velocity.Y -= 0.5f; if (Main.rand.NextBool(4)) { - Main.dust[dust].noGravity = false; - Main.dust[dust].scale *= 0.5f; + dust.noGravity = false; + dust.scale *= 0.5f; } - drawInfo.DustCache.Add(dust); + drawInfo.DustCache.Add(dust.dustIndex); } } @@ -76,14 +76,14 @@ namespace CalamityMod.Buffs.DamageOverTime if (Main.rand.Next(5) < 4) { - int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, dustType, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 3f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 1.8f; - Main.dust[dust].velocity.Y -= 0.5f; + Dust dust = Dust.NewDustDirect(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, dustType, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 3f); + dust.noGravity = true; + dust.velocity *= 1.8f; + dust.velocity.Y -= 0.5f; if (Main.rand.NextBool(4)) { - Main.dust[dust].noGravity = false; - Main.dust[dust].scale *= 0.5f; + dust.noGravity = false; + dust.scale *= 0.5f; } } } diff --git a/Buffs/DamageOverTime/Voidfrost.cs b/Buffs/DamageOverTime/Voidfrost.cs index fb3b694d61..8452f0b9cb 100644 --- a/Buffs/DamageOverTime/Voidfrost.cs +++ b/Buffs/DamageOverTime/Voidfrost.cs @@ -48,10 +48,10 @@ namespace CalamityMod.Buffs.DamageOverTime } Vector2 dustCorner = Player.position - 2f * Vector2.One; Vector2 dustVel = Player.velocity + new Vector2(0f, Main.rand.NextFloat(-11f, -2f)); - int d = Dust.NewDust(dustCorner, Player.width + 4, Player.height + 4, Main.rand.NextBool(4) ? 20 : 113, dustVel.X, dustVel.Y); - Main.dust[d].noGravity = true; - Main.dust[d].scale = Main.rand.NextFloat(1f, 0.3f); - Main.dust[d].alpha = 10; + Dust dust = Dust.NewDustDirect(dustCorner, Player.width + 4, Player.height + 4, Main.rand.NextBool(4) ? 20 : 113, dustVel.X, dustVel.Y); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(1f, 0.3f); + dust.alpha = 10; } internal static void DrawEffects(NPC npc, ref Color drawColor) @@ -72,10 +72,10 @@ namespace CalamityMod.Buffs.DamageOverTime Vector2 dustCorner = npc.position - 2f * Vector2.One; Vector2 dustVel = npc.velocity + new Vector2(0f, Main.rand.NextFloat(-11f, -2f)); - int d = Dust.NewDust(dustCorner, npc.width + 4, npc.height + 4, Main.rand.NextBool(4) ? 20 : 113, dustVel.X, dustVel.Y); - Main.dust[d].noGravity = true; - Main.dust[d].scale = Main.rand.NextFloat(1f, 0.3f); - Main.dust[d].alpha = 10; + Dust dust = Dust.NewDustDirect(dustCorner, npc.width + 4, npc.height + 4, Main.rand.NextBool(4) ? 20 : 113, dustVel.X, dustVel.Y); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(1f, 0.3f); + dust.alpha = 10; } } } diff --git a/Buffs/Potions/CalciumBuff.cs b/Buffs/Potions/CalciumBuff.cs index 0a55b80590..5ec698247a 100644 --- a/Buffs/Potions/CalciumBuff.cs +++ b/Buffs/Potions/CalciumBuff.cs @@ -1,10 +1,14 @@ -using Terraria; +using CalamityMod.Items.Potions; +using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions { public class CalciumBuff : ModBuff { + public override LocalizedText Description => base.Description.WithFormatArgs(CalciumPotion.KnockbackResistance.ToPercent()); + public override void SetStaticDefaults() { Main.debuff[Type] = false; diff --git a/Buffs/Potions/PhotosynthesisBuff.cs b/Buffs/Potions/PhotosynthesisBuff.cs index 202952cb86..db53347ad2 100644 --- a/Buffs/Potions/PhotosynthesisBuff.cs +++ b/Buffs/Potions/PhotosynthesisBuff.cs @@ -1,10 +1,14 @@ -using Terraria; +using CalamityMod.Items.Potions; +using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions { public class PhotosynthesisBuff : ModBuff { + public override LocalizedText Description => base.Description.WithFormatArgs(PhotosynthesisPotion.IncreasedHeartHeal); + public override void SetStaticDefaults() { Main.debuff[Type] = false; diff --git a/Buffs/Potions/ShadowBuff.cs b/Buffs/Potions/ShadowBuff.cs index 0244cb7c0b..d06152f5f2 100644 --- a/Buffs/Potions/ShadowBuff.cs +++ b/Buffs/Potions/ShadowBuff.cs @@ -1,10 +1,14 @@ -using Terraria; +using CalamityMod.Items.Potions; +using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions { public class ShadowBuff : ModBuff { + public override LocalizedText Description => base.Description.WithFormatArgs(ShadowPotion.StealthRegenBoost.ToPercent()); + public override void SetStaticDefaults() { Main.debuff[Type] = false; diff --git a/Buffs/Potions/Soaring.cs b/Buffs/Potions/Soaring.cs index bb5e481442..a9a75af3c5 100644 --- a/Buffs/Potions/Soaring.cs +++ b/Buffs/Potions/Soaring.cs @@ -1,10 +1,14 @@ -using Terraria; +using CalamityMod.Items.Potions; +using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions { public class Soaring : ModBuff { + public override LocalizedText Description => base.Description.WithFormatArgs(SoaringPotion.FlightBoost.ToPercent()); + public override void SetStaticDefaults() { Main.debuff[Type] = false; diff --git a/Buffs/StatBuffs/AdrenalineMode.cs b/Buffs/StatBuffs/AdrenalineMode.cs index 2f5a6dfbb2..f1bf99e362 100644 --- a/Buffs/StatBuffs/AdrenalineMode.cs +++ b/Buffs/StatBuffs/AdrenalineMode.cs @@ -35,12 +35,11 @@ namespace CalamityMod.Buffs.StatBuffs { int dustID = ModContent.DustType(); Vector2 dustVel = Player.velocity * 0.5f; - int idx = Dust.NewDust(Main.rand.NextBool(5) ? drawInfo.Position : drawInfo.Position - Player.velocity * 1.5f, Player.width, Player.height, dustID, dustVel.X, dustVel.Y); - Dust d = Main.dust[idx]; - d.scale = Main.rand.NextFloat(0.4f, 1.2f); - d.noGravity = true; - d.noLight = false; - drawInfo.DustCache.Add(idx); + Dust dust = Dust.NewDustDirect(Main.rand.NextBool(5) ? drawInfo.Position : drawInfo.Position - Player.velocity * 1.5f, Player.width, Player.height, dustID, dustVel.X, dustVel.Y); + dust.scale = Main.rand.NextFloat(0.4f, 1.2f); + dust.noGravity = true; + dust.noLight = false; + drawInfo.DustCache.Add(dust.dustIndex); } } } diff --git a/Buffs/StatBuffs/EmpyreanRage.cs b/Buffs/StatBuffs/EmpyreanRage.cs deleted file mode 100644 index 9315409e24..0000000000 --- a/Buffs/StatBuffs/EmpyreanRage.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Buffs.StatBuffs -{ - public class EmpyreanRage : ModBuff - { - public override void SetStaticDefaults() - { - Main.debuff[Type] = false; - Main.pvpBuff[Type] = true; - Main.buffNoSave[Type] = true; - } - - public override void Update(Player player, ref int buffIndex) - { - player.Calamity().xRage = true; - } - } -} diff --git a/Buffs/StatBuffs/TarraLifeRegen.cs b/Buffs/StatBuffs/TarraLifeRegen.cs index c2e48518e0..a38a9bd7f3 100644 --- a/Buffs/StatBuffs/TarraLifeRegen.cs +++ b/Buffs/StatBuffs/TarraLifeRegen.cs @@ -26,11 +26,11 @@ namespace CalamityMod.Buffs.StatBuffs if (Main.rand.NextBool(10)) { - int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, DustID.TerraBlade, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0.75f; - Main.dust[dust].velocity.Y -= 0.35f; - drawInfo.DustCache.Add(dust); + Dust dust = Dust.NewDustDirect(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, DustID.TerraBlade, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1f); + dust.noGravity = true; + dust.velocity *= 0.75f; + dust.velocity.Y -= 0.35f; + drawInfo.DustCache.Add(dust.dustIndex); } } } diff --git a/Buffs/StatDebuffs/AbsorberAffliction.cs b/Buffs/StatDebuffs/AbsorberAffliction.cs index f916745edd..9a7fd181ab 100644 --- a/Buffs/StatDebuffs/AbsorberAffliction.cs +++ b/Buffs/StatDebuffs/AbsorberAffliction.cs @@ -32,11 +32,11 @@ namespace CalamityMod.Buffs.StatDebuffs if (Main.rand.Next(5) >= 0) { - int dust = Dust.NewDust(npc.position - new Vector2(2f), npc.width + 4, npc.height + 4, ModContent.DustType(), npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 2.5f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity.Y -= 1.8f; - Main.dust[dust].velocity.Y *= 2.5f; - Main.dust[dust].noGravity = true; + Dust dust = Dust.NewDustDirect(npc.position - new Vector2(2f), npc.width + 4, npc.height + 4, ModContent.DustType(), npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 2.5f); + dust.noGravity = true; + dust.velocity.Y -= 1.8f; + dust.velocity.Y *= 2.5f; + dust.noGravity = true; } } } diff --git a/Buffs/StatDebuffs/IcarusFolly.cs b/Buffs/StatDebuffs/IcarusFolly.cs index aa460be72e..bb4e560b6d 100644 --- a/Buffs/StatDebuffs/IcarusFolly.cs +++ b/Buffs/StatDebuffs/IcarusFolly.cs @@ -28,11 +28,11 @@ namespace CalamityMod.Buffs.StatDebuffs if (Main.rand.NextBool(12)) { - int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, (int)CalamityDusts.ProfanedFire, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 1.8f; - Main.dust[dust].velocity.Y -= 0.5f; - drawInfo.DustCache.Add(dust); + Dust dust = Dust.NewDustDirect(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, (int)CalamityDusts.ProfanedFire, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); + dust.noGravity = true; + dust.velocity *= 1.8f; + dust.velocity.Y -= 0.5f; + drawInfo.DustCache.Add(dust.dustIndex); } } } diff --git a/Buffs/Summon/BrittleStar.png b/Buffs/Summon/BrittleStar.png index 30f00daabc..3ae1924e0d 100644 Binary files a/Buffs/Summon/BrittleStar.png and b/Buffs/Summon/BrittleStar.png differ diff --git a/Buffs/Summon/CosmilampBuff.png b/Buffs/Summon/CosmilampBuff.png index 71e298b541..41a50f7e2c 100644 Binary files a/Buffs/Summon/CosmilampBuff.png and b/Buffs/Summon/CosmilampBuff.png differ diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 5072e3ce80..a89b766d1e 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -29,6 +29,8 @@ using CalamityMod.Items.Dyes; using CalamityMod.Items.Mounts; using CalamityMod.Items.Mounts.Minecarts; using CalamityMod.Items.PermanentBoosters; +using CalamityMod.Items.Potions; +using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.TreasureBags.MiscGrabBags; using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.Items.Weapons.DraedonsArsenal; @@ -234,7 +236,6 @@ namespace CalamityMod.CalPlayer public int profanedSoulWeaponType = 0; public int hurtSoundTimer = 0; public int danceOfLightCharge = 0; - public int shadowPotCooldown = 0; public int dogTextCooldown = 0; public float auralisStealthCounter = 0f; public int auralisAuroraCounter = 0; @@ -531,6 +532,7 @@ namespace CalamityMod.CalPlayer public int ascendantInsigniaCooldown = 0; public bool ascendantTrail = false; public bool frozenWingsCold = false; + public bool flameWingsHeat = false; public bool magmaStoneVisuals = true; public bool eGauntlet = false; public bool eGauntletVisuals = true; // Used to control dust spawned when swinging @@ -727,7 +729,7 @@ namespace CalamityMod.CalPlayer public int phantomicBulwarkCooldown = 0; public int phantomicHeartRegen = 0; // 0 = can spawn, 720 = regen applied, 600 = regen stops and 10 sec cd before it can spawn again public bool silvaWings = false; - public int icicleCooldown = 0; + public int wingProjectileCooldown = 0; public bool RustyMedallionDroplets = false; public bool MiniSwarmers = false; public bool noStupidNaturalARSpawns = false; @@ -964,7 +966,6 @@ namespace CalamityMod.CalPlayer public bool decayEffigy = false; public bool rRage = false; public bool tRegen = false; - public bool xRage = false; public bool xWrath = false; public bool graxDefense = false; public bool encased = false; @@ -1147,20 +1148,25 @@ namespace CalamityMod.CalPlayer #endregion #region Biome - public bool ZoneCalamity => Player.InModBiome(GetInstance()); - public bool ZoneAstral => Player.InModBiome(GetInstance()) && !ZoneAbyss; - public bool ZoneSunkenSea => ZoneSunkenBurrows || ZoneSunkenSeaReefs || ZoneSunkenSeaPolyp || ZoneSunkenSeaShores; - public bool ZoneSunkenBurrows => Player.InModBiome(GetInstance()); - public bool ZoneSunkenSeaReefs => Player.InModBiome(GetInstance()); - public bool ZoneSunkenSeaPolyp => Player.InModBiome(GetInstance()); - public bool ZoneSunkenSeaShores => Player.InModBiome(GetInstance()); - public bool ZoneSulphur => Player.InModBiome(GetInstance()); + public bool ZoneSunkenSea => ZoneTimelessShores || ZoneRadiantReefs || ZonePolypForest || ZoneGleamingBurrows || ZoneBasaltGully; + public bool ZoneTimelessShores => Player.InModBiome(); + public bool ZonePolypForest => Player.InModBiome(); + public bool ZoneRadiantReefs => Player.InModBiome(); + public bool ZoneGleamingBurrows => Player.InModBiome(); + public bool ZoneBasaltGully => Player.InModBiome(); + + public bool ZoneSulphur => Player.InModBiome(); public bool ZoneAbyss => ZoneAbyssLayer1 || ZoneAbyssLayer2 || ZoneAbyssLayer3 || ZoneAbyssLayer4; - public bool ZoneAbyssLayer1 => Player.InModBiome(GetInstance()); - public bool ZoneAbyssLayer2 => Player.InModBiome(GetInstance()); - public bool ZoneAbyssLayer3 => Player.InModBiome(GetInstance()); - public bool ZoneAbyssLayer4 => Player.InModBiome(GetInstance()); - public bool ZoneFloralParadise => Player.InModBiome(GetInstance()); + public bool ZoneAbyssLayer1 => Player.InModBiome(); + public bool ZoneAbyssLayer2 => Player.InModBiome(); + public bool ZoneAbyssLayer3 => Player.InModBiome(); + public bool ZoneAbyssLayer4 => Player.InModBiome(); + + public bool ZoneFloralParadise => Player.InModBiome(); + + public bool ZoneCalamity => Player.InModBiome(); + + public bool ZoneAstral => Player.InModBiome() && !ZoneAbyss; public bool InAnyCalamityBiome => ZoneAbyss || ZoneCalamity || ZoneFloralParadise || ZoneSulphur || ZoneSunkenSea || ZoneAstral; @@ -1781,6 +1787,7 @@ namespace CalamityMod.CalPlayer ascendantInsignia = false; ascendantTrail = false; frozenWingsCold = false; + flameWingsHeat = false; magmaStoneVisuals = true; eGauntlet = false; eGauntletVisuals = true; @@ -2059,7 +2066,6 @@ namespace CalamityMod.CalPlayer crimEffigy = false; decayEffigy = false; rRage = false; - xRage = false; xWrath = false; graxDefense = false; encased = false; @@ -2393,7 +2399,6 @@ namespace CalamityMod.CalPlayer planarSpeedBoost = 0; galileoCooldown = 0; soundCooldown = 0; - shadowPotCooldown = 0; dogTextCooldown = 0; auralisStealthCounter = 0f; auralisAuroraCounter = 0; @@ -2442,7 +2447,7 @@ namespace CalamityMod.CalPlayer killSpikyBalls = false; scuttlerCooldown = 0; rogueCrownCooldown = 0; - icicleCooldown = 0; + wingProjectileCooldown = 0; statisTimer = 0; hallowedRuneCooldown = 0; sulphurBubbleCooldown = 0; @@ -2543,7 +2548,6 @@ namespace CalamityMod.CalPlayer corrEffigy = false; crimEffigy = false; rRage = false; - xRage = false; xWrath = false; kamiBoost = false; graxDefense = false; @@ -2825,7 +2829,7 @@ namespace CalamityMod.CalPlayer if (ascendantInsignia && Main.myPlayer == Player.whoAmI && CalamityKeybinds.AscendantInsigniaHotKey.JustPressed && ascendantInsigniaCooldown <= 0) { var source = Player.GetSource_Accessory(FindAccessory(ItemType())); - Projectile.NewProjectileDirect(source, Player.Center - Vector2.UnitY * 45f, Vector2.Zero, ProjectileType(), 0, 0f); + Projectile.NewProjectile(source, Player.Center - Vector2.UnitY * 45f, Vector2.Zero, ProjectileType(), 0, 0f); SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/AscendantActivate")); ascendantInsigniaCooldown = 2400; ascendantInsigniaBuffTime = 240; //4 seconds @@ -2899,9 +2903,8 @@ namespace CalamityMod.CalPlayer { Projectile proj = Main.projectile[projIndex]; float start = 360f / angelAmt; - int damage = Player.ApplyArmorAccDamageBonusesTo(proj.damage / 10); - Projectile.NewProjectile(source, new Vector2((int)(Player.Center.X + (Math.Sin(projIndex * start) * 300)), (int)(Player.Center.Y + (Math.Cos(projIndex * start) * 300))), Vector2.Zero, ProjectileType(), damage, proj.knockBack / 10f, Player.whoAmI, Main.rand.Next(180), projIndex * start); + Projectile.NewProjectile(source, new Vector2((int)(Player.Center.X + (Math.Sin(projIndex * start) * 300)), (int)(Player.Center.Y + (Math.Cos(projIndex * start) * 300))), Vector2.Zero, ProjectileType(), proj.damage / 10, proj.knockBack / 10f, Player.whoAmI, Main.rand.Next(180), projIndex * start); Player.HealPlayer(2); } } @@ -2910,10 +2913,9 @@ namespace CalamityMod.CalPlayer Player.AddCooldown(Cooldowns.SandCloak.ID, CalamityUtils.SecondsToFrames(20)); var source = Player.GetSource_Accessory(FindAccessory(ItemType())); - int damage = Player.ApplyArmorAccDamageBonusesTo(12); float knockback = 2.5f; - int veil = Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ProjectileType(), damage, knockback, Player.whoAmI); + int veil = Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ProjectileType(), 12, knockback, Player.whoAmI); Main.projectile[veil].Center = Player.Center; SoundEngine.PlaySound(SoundID.Item45, Player.Center); } @@ -2953,9 +2955,9 @@ namespace CalamityMod.CalPlayer Vector2 step = teleportOffset / numDust; for (int i = 0; i < numDust; i++) { - int dustIndex = Dust.NewDust(Player.Center - (step * i), 1, 1, DustID.VilePowder, step.X, step.Y); - Main.dust[dustIndex].noGravity = true; - Main.dust[dustIndex].noLight = true; + Dust dust = Dust.NewDustDirect(Player.Center - (step * i), 1, 1, DustID.VilePowder, step.X, step.Y); + dust.noGravity = true; + dust.noLight = true; } spectralVeilImmunity = SpectralVeil.VeilIFrames; @@ -2993,9 +2995,9 @@ namespace CalamityMod.CalPlayer SoundEngine.PlaySound(BrimflameScowl.ActivationSound, Player.Center); for (int i = 0; i < 36; i++) { - int brimDust = Dust.NewDust(new Vector2(Player.position.X, Player.position.Y + 16f), Player.width, Player.height - 16, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 1f); - Main.dust[brimDust].velocity *= 3f; - Main.dust[brimDust].scale *= 1.15f; + Dust brimDust = Dust.NewDustDirect(new Vector2(Player.position.X, Player.position.Y + 16f), Player.width, Player.height - 16, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 1f); + brimDust.velocity *= 3f; + brimDust.scale *= 1.15f; } int dustAmt = 36; for (int j = 0; j < dustAmt; j++) @@ -3003,10 +3005,10 @@ namespace CalamityMod.CalPlayer Vector2 dustRotation = Vector2.Normalize(Player.velocity) * new Vector2((float)Player.width / 2f, (float)Player.height) * 0.75f; dustRotation = dustRotation.RotatedBy((double)((float)(j - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + Player.Center; Vector2 dustVelocity = dustRotation - Player.Center; - int brimDust2 = Dust.NewDust(dustRotation + dustVelocity, 0, 0, (int)CalamityDusts.Brimstone, dustVelocity.X * 1.5f, dustVelocity.Y * 1.5f, 100, default, 1.4f); - Main.dust[brimDust2].noGravity = true; - Main.dust[brimDust2].noLight = true; - Main.dust[brimDust2].velocity = dustVelocity; + Dust brimDust2 = Dust.NewDustDirect(dustRotation + dustVelocity, 0, 0, (int)CalamityDusts.Brimstone, dustVelocity.X * 1.5f, dustVelocity.Y * 1.5f, 100, default, 1.4f); + brimDust2.noGravity = true; + brimDust2.noLight = true; + brimDust2.velocity = dustVelocity; } } } @@ -3026,9 +3028,9 @@ namespace CalamityMod.CalPlayer SoundEngine.PlaySound(BloodflareHeadRanged.ActivationSound, Player.Center); for (int d = 0; d < 64; d++) { - int dust = Dust.NewDust(new Vector2(Player.position.X, Player.position.Y + 16f), Player.width, Player.height - 16, (int)CalamityDusts.Necroplasm, 0f, 0f, 0, default, 1f); - Main.dust[dust].velocity *= 3f; - Main.dust[dust].scale *= 1.15f; + Dust dust = Dust.NewDustDirect(new Vector2(Player.position.X, Player.position.Y + 16f), Player.width, Player.height - 16, (int)CalamityDusts.Necroplasm, 0f, 0f, 0, default, 1f); + dust.velocity *= 3f; + dust.scale *= 1.15f; } int dustAmt = 36; for (int d = 0; d < dustAmt; d++) @@ -3036,10 +3038,10 @@ namespace CalamityMod.CalPlayer Vector2 source = Vector2.Normalize(Player.velocity) * new Vector2((float)Player.width / 2f, (float)Player.height) * 0.75f; source = source.RotatedBy((double)((float)(d - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + Player.Center; Vector2 dustVel = source - Player.Center; - int phanto = Dust.NewDust(source + dustVel, 0, 0, (int)CalamityDusts.Necroplasm, dustVel.X * 1.5f, dustVel.Y * 1.5f, 100, default, 1.4f); - Main.dust[phanto].noGravity = true; - Main.dust[phanto].noLight = true; - Main.dust[phanto].velocity = dustVel; + Dust phanto = Dust.NewDustDirect(source + dustVel, 0, 0, (int)CalamityDusts.Necroplasm, dustVel.X * 1.5f, dustVel.Y * 1.5f, 100, default, 1.4f); + phanto.noGravity = true; + phanto.noLight = true; + phanto.velocity = dustVel; } float spread = 45f * 0.0174f; double startAngle = Math.Atan2(Player.velocity.X, Player.velocity.Y) - spread / 2; @@ -3047,7 +3049,6 @@ namespace CalamityMod.CalPlayer double offsetAngle; int damage = (int)(Player.GetTotalDamage().ApplyTo(300f)); - damage = Player.ApplyArmorAccDamageBonusesTo(damage); if (Player.whoAmI == Main.myPlayer) { @@ -3077,11 +3078,11 @@ namespace CalamityMod.CalPlayer SoundEngine.PlaySound(OmegaBlueHelmet.ActivationSound, Player.Center); for (int i = 0; i < 66; i++) { - int d = Dust.NewDust(Player.position, Player.width, Player.height, DustID.PurificationPowder, 0, 0, 100, Color.Transparent, 2.6f); - Main.dust[d].noGravity = true; - Main.dust[d].noLight = true; - Main.dust[d].fadeIn = 1f; - Main.dust[d].velocity *= 6.6f; + Dust dust = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.PurificationPowder, 0, 0, 100, Color.Transparent, 2.6f); + dust.noGravity = true; + dust.noLight = true; + dust.fadeIn = 1f; + dust.velocity *= 6.6f; } } if (dsSetBonus) @@ -3089,9 +3090,9 @@ namespace CalamityMod.CalPlayer SoundEngine.PlaySound(DemonshadeHelm.ActivationSound, Player.Center); for (int i = 0; i < 36; i++) { - int brimDust = Dust.NewDust(new Vector2(Player.position.X, Player.position.Y + 16f), Player.width, Player.height - 16, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 1f); - Main.dust[brimDust].velocity *= 3f; - Main.dust[brimDust].scale *= 1.15f; + Dust brimDust = Dust.NewDustDirect(new Vector2(Player.position.X, Player.position.Y + 16f), Player.width, Player.height - 16, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 1f); + brimDust.velocity *= 3f; + brimDust.scale *= 1.15f; } int dustAmt = 36; for (int j = 0; j < dustAmt; j++) @@ -3099,10 +3100,10 @@ namespace CalamityMod.CalPlayer Vector2 dustRotation = Vector2.Normalize(Player.velocity) * new Vector2((float)Player.width / 2f, (float)Player.height) * 0.75f; dustRotation = dustRotation.RotatedBy((double)((float)(j - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + Player.Center; Vector2 dustVelocity = dustRotation - Player.Center; - int brimDust2 = Dust.NewDust(dustRotation + dustVelocity, 0, 0, (int)CalamityDusts.Brimstone, dustVelocity.X * 1.5f, dustVelocity.Y * 1.5f, 100, default, 1.4f); - Main.dust[brimDust2].noGravity = true; - Main.dust[brimDust2].noLight = true; - Main.dust[brimDust2].velocity = dustVelocity; + Dust brimDust2 = Dust.NewDustDirect(dustRotation + dustVelocity, 0, 0, (int)CalamityDusts.Brimstone, dustVelocity.X * 1.5f, dustVelocity.Y * 1.5f, 100, default, 1.4f); + brimDust2.noGravity = true; + brimDust2.noLight = true; + brimDust2.velocity = dustVelocity; } if (Player.whoAmI == Main.myPlayer) { @@ -3142,7 +3143,6 @@ namespace CalamityMod.CalPlayer // To compute Forbidden Circlet tornado damage, create a fake stat modifier on the spot which combines both classes. StatModifier forbidden = Player.GetTotalDamage().CombineWith(Player.GetDamage()); int damage = (int)forbidden.ApplyTo(ForbiddenCirclet.tornadoBaseDmg); - damage = Player.ApplyArmorAccDamageBonusesTo(damage); float kBack = Player.GetTotalKnockback().ApplyTo(ForbiddenCirclet.tornadoBaseKB); @@ -3226,12 +3226,12 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < 30; i++) { float angle = MathHelper.TwoPi * i / 30f; - int dustIndex = Dust.NewDust(Player.position, 120, 120, DustID.Rain_BloodMoon, 0f, 0f, 0, default, 2f); - Main.dust[dustIndex].noGravity = true; - Main.dust[dustIndex].velocity *= 4f; - dustIndex = Dust.NewDust(Player.position, 120, 120, DustID.Rain_BloodMoon, 0f, 0f, 100, default, 1f); - Main.dust[dustIndex].velocity *= 2.25f; - Main.dust[dustIndex].noGravity = true; + Dust dust = Dust.NewDustDirect(Player.position, 120, 120, DustID.Rain_BloodMoon, 0f, 0f, 0, default, 2f); + dust.noGravity = true; + dust.velocity *= 4f; + dust = Dust.NewDustDirect(Player.position, 120, 120, DustID.Rain_BloodMoon, 0f, 0f, 100, default, 1f); + dust.velocity *= 2.25f; + dust.noGravity = true; Dust.NewDust(Player.Center + angle.ToRotationVector2() * 160f, 0, 0, DustID.Rain_BloodMoon, 0f, 0f, 100, default, 1f); } @@ -3404,44 +3404,44 @@ namespace CalamityMod.CalPlayer // Make some dust for (int index = 0; index < 100; ++index) { - Main.dust[Dust.NewDust(player.position, player.width, player.height, DustID.TeleportationPotion, player.velocity.X * 0.2f, player.velocity.Y * 0.2f, 150, Color.Cyan, 1.2f)].velocity *= 0.5f; + Dust.NewDust(player.position, player.width, player.height, DustID.TeleportationPotion, player.velocity.X * 0.1f, player.velocity.Y * 0.1f, 150, Color.Cyan, 1.2f); } Rectangle rect = player.getRect(); int dustAmt = rect.Width * rect.Height / 5; for (int k = 0; k < dustAmt; k++) { - int idx = Dust.NewDust(new Vector2(rect.X, rect.Y), rect.Width, rect.Height, DustID.TeleportationPotion); - Main.dust[idx].scale = Main.rand.NextFloat(0.2f, 0.7f); + Dust dust = Dust.NewDustDirect(new Vector2(rect.X, rect.Y), rect.Width, rect.Height, DustID.TeleportationPotion); + dust.scale = Main.rand.NextFloat(0.2f, 0.7f); if (k < 10) - Main.dust[idx].scale += 0.25f; + dust.scale += 0.25f; if (k < 5) - Main.dust[idx].scale += 0.25f; + dust.scale += 0.25f; } for (int k = 0; k < 50; k++) { - int idx = Dust.NewDust(new Vector2(rect.X, rect.Y), rect.Width, rect.Height, DustID.DungeonSpirit); - Main.dust[idx].noGravity = true; + Dust dust = Dust.NewDustDirect(new Vector2(rect.X, rect.Y), rect.Width, rect.Height, DustID.DungeonSpirit); + dust.noGravity = true; for (int i = 0; i < 5; i++) { if (Main.rand.NextBool(3)) - Main.dust[idx].velocity *= 0.75f; + dust.velocity *= 0.75f; } if (Main.rand.NextBool(3)) { - Main.dust[idx].velocity *= 2f; - Main.dust[idx].scale *= 1.2f; + dust.velocity *= 2f; + dust.scale *= 1.2f; } if (Main.rand.NextBool(3)) { - Main.dust[idx].velocity *= 2f; - Main.dust[idx].scale *= 1.2f; + dust.velocity *= 2f; + dust.scale *= 1.2f; } if (Main.rand.NextBool()) { - Main.dust[idx].fadeIn = Main.rand.NextFloat(0.75f, 1f); - Main.dust[idx].scale = Main.rand.NextFloat(0.25f, 0.75f); + dust.fadeIn = Main.rand.NextFloat(0.75f, 1f); + dust.scale = Main.rand.NextFloat(0.25f, 0.75f); } - Main.dust[idx].scale *= 0.8f; + dust.scale *= 0.8f; } if (playSound) @@ -3581,7 +3581,7 @@ namespace CalamityMod.CalPlayer var source = Player.GetSource_Accessory(FindAccessory(ItemType())); //Spawn explosion. ai[0] is used for transferring the recorded falling time - int damage = Player.ApplyArmorAccDamageBonusesTo(Player.CalcIntDamage(InterstellarStompers.SlamDamage)); + int damage = Player.CalcIntDamage(InterstellarStompers.SlamDamage); Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ProjectileType(), damage, 4f, Player.whoAmI, gSabatonFall); gSabatonFall = 0; @@ -3866,7 +3866,7 @@ namespace CalamityMod.CalPlayer (kamiBoost ? KamiBuff.RunAccelerationBoost : 0f) + (CobaltSet ? CobaltArmorSetChange.SpeedBoostSetBonusPercentage * 0.01f : 0f) + (silvaSet ? 0.05f : 0f) + - (nimbleBounderBoost ? 0.1f : 0f) + + (nimbleBounderBoost ? NimbleBounder.AccelerationBoost : 0f) + (blueCandle ? CirrusBlueCandleBuff.AccelerationBoost : 0f) + (planarSpeedBoost > 0 ? (0.01f * planarSpeedBoost) : 0f) + (hasteLevel * 0.05f); @@ -3882,7 +3882,7 @@ namespace CalamityMod.CalPlayer (kamiBoost ? KamiBuff.RunSpeedBoost : 0f) + (CobaltSet ? CobaltArmorSetChange.SpeedBoostSetBonusPercentage * 0.01f : 0f) + (silvaSet ? 0.05f : 0f) + - (nimbleBounderBoost ? 0.1f : 0f) + + (nimbleBounderBoost ? NimbleBounder.AccelerationBoost : 0f) + (planarSpeedBoost > 0 ? (0.01f * planarSpeedBoost) : 0f) + (hasteLevel * 0.05f); @@ -3966,16 +3966,16 @@ namespace CalamityMod.CalPlayer knockback.Flat += item.knockBack * ((1f - modStealth) * 0.5f); if (whiskey) - knockback.Flat += item.knockBack * 0.2f; + knockback.Flat += item.knockBack * Whiskey.KnockbackBoost; if (tequila && Main.dayTime) - knockback += item.knockBack * 0.1f; + knockback += item.knockBack * Tequila.KnockbackBoost; if (tequilaSunrise && Main.dayTime) - knockback += item.knockBack * 0.2f; + knockback += item.knockBack * TequilaSunrise.KnockbackBoost; if (moscowMule) - knockback += item.knockBack * 0.5f; + knockback += item.knockBack * MoscowMule.KnockbackBoost; if (titanHeartMask && rogue) knockback += item.knockBack * 0.05f; @@ -4021,12 +4021,12 @@ namespace CalamityMod.CalPlayer if (Main.rand.NextBool(20)) { int confettiDust = Main.rand.Next(139, 143); - int confetti = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, confettiDust, Player.velocity.X, Player.velocity.Y, 0, new Color(), 1.2f); - Main.dust[confetti].velocity.X *= (float)(1.0 + Main.rand.Next(-50, 51) * 0.01); - Main.dust[confetti].velocity.Y *= (float)(1.0 + Main.rand.Next(-50, 51) * 0.01); - Main.dust[confetti].velocity.X += Main.rand.Next(-50, 51) * 0.05f; - Main.dust[confetti].velocity.Y += Main.rand.Next(-50, 51) * 0.05f; - Main.dust[confetti].scale *= (float)(1.0 + Main.rand.Next(-30, 31) * 0.01); + Dust confetti = Dust.NewDustDirect(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, confettiDust, Player.velocity.X, Player.velocity.Y, 0, new Color(), 1.2f); + confetti.velocity.X *= (float)(1.0 + Main.rand.Next(-50, 51) * 0.01); + confetti.velocity.Y *= (float)(1.0 + Main.rand.Next(-50, 51) * 0.01); + confetti.velocity.X += Main.rand.Next(-50, 51) * 0.05f; + confetti.velocity.Y += Main.rand.Next(-50, 51) * 0.05f; + confetti.scale *= (float)(1.0 + Main.rand.Next(-30, 31) * 0.01); } if (Main.rand.NextBool(40) && Main.netMode != NetmodeID.Server) { @@ -4134,8 +4134,8 @@ namespace CalamityMod.CalPlayer { if (Main.rand.NextBool(3)) { - int element = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, DustID.RainbowTorch, Player.velocity.X * 0.2f + Player.direction * 3f, Player.velocity.Y * 0.2f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.25f); - Main.dust[element].noGravity = true; + Dust rainbow = Dust.NewDustDirect(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, DustID.RainbowTorch, Player.velocity.X * 0.2f + Player.direction * 3f, Player.velocity.Y * 0.2f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.25f); + rainbow.noGravity = true; } } if (dsSetBonus) @@ -4157,6 +4157,7 @@ namespace CalamityMod.CalPlayer if (veneratedLocket) { + var LocketSource = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); if (item.CountsAsClass()) { if (!CalamityLists.VeneratedLocketBanlist.Contains(item.type)) @@ -4202,9 +4203,8 @@ namespace CalamityMod.CalPlayer float speedY5 = veneratedCloneYPos + (float)Main.rand.Next(-30, 31) * 0.02f; // 08DEC2023: Ozzatron: Locket + Old Fashioned may need to be a corner case. We should probably just rework Locket instead. - int locketDamage = Player.ApplyArmorAccDamageBonusesTo((int)(damage * 0.07f)); - - int p = Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, speedX4, speedY5, type, locketDamage, knockBack * 0.5f, Player.whoAmI); + int locketDamage = (int)(damage * 0.07f); + int p = Projectile.NewProjectile(LocketSource, realPlayerPos.X, realPlayerPos.Y, speedX4, speedY5, type, locketDamage, knockBack * 0.5f, Player.whoAmI); if (p.WithinBounds(Main.maxProjectiles)) { @@ -4223,7 +4223,6 @@ namespace CalamityMod.CalPlayer { int knifeCount = 12; int knifeDamage = (int)Player.GetTotalDamage().ApplyTo(55); - knifeDamage = Player.ApplyArmorAccDamageBonusesTo(knifeDamage); float angleStep = MathHelper.TwoPi / knifeCount; float speed = 14f; @@ -4234,7 +4233,7 @@ namespace CalamityMod.CalPlayer velocity2 = velocity2.RotatedBy(angleStep * i); int knifeCol = Main.rand.Next(0, 2); - int knife = Projectile.NewProjectile(source, Player.Center, velocity2, ProjectileType(), knifeDamage, 0f, Player.whoAmI, knifeCol, 0); + int knife = Projectile.NewProjectile(LocketSource, Player.Center, velocity2, ProjectileType(), knifeDamage, 0f, Player.whoAmI, knifeCol, 0); if (knife.WithinBounds(Main.maxProjectiles)) Main.projectile[knife].DamageType = DamageClass.Generic; } @@ -4246,12 +4245,12 @@ namespace CalamityMod.CalPlayer { if (item.CountsAsClass()) { + var MedallionSource = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); int d = (int)Player.GetTotalDamage().ApplyTo(RustyMedallion.AcidDropBaseDamage); - d = Player.ApplyArmorAccDamageBonusesTo(d); Vector2 startingPosition = Main.MouseWorld - Vector2.UnitY.RotatedByRandom(0.3f) * 1250f; Vector2 directionToMouse = (Main.MouseWorld - startingPosition).SafeNormalize(Vector2.UnitX); - int drop = Projectile.NewProjectile(source, startingPosition, directionToMouse * 15f, ProjectileType(), d, 0f, Player.whoAmI, 3); + int drop = Projectile.NewProjectile(MedallionSource, startingPosition, directionToMouse * 15f, ProjectileType(), d, 0f, Player.whoAmI, 3); if (drop.WithinBounds(Main.maxProjectiles)) { Main.projectile[drop].penetrate = 2; @@ -4265,9 +4264,9 @@ namespace CalamityMod.CalPlayer { if (item.CountsAsClass() && !item.channel) { + var SwarmerSource = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); int newDamage = (int)(damage * (6 - 5 * (item.useTime >= 25 ? 1 : item.useTime / 25))); - newDamage = Player.ApplyArmorAccDamageBonusesTo(newDamage); - Projectile.NewProjectile(source, position, velocity * 1.25f, ProjectileType(), newDamage, 2f, Player.whoAmI); + Projectile.NewProjectile(SwarmerSource, position, velocity * 1.25f, ProjectileType(), newDamage, 2f, Player.whoAmI); MiniSwamerCooldown = DynamoStemCells.MiniSwamerCooldown; } @@ -4462,9 +4461,6 @@ namespace CalamityMod.CalPlayer if (Player.ownedProjectileCounts[ProjectileType()] > 0) Player.yoraiz0rEye = 0; - if (Player.HeldItem != null && Player.HeldItem.type == ItemID.FalconBlade) - Player.moveSpeed += 0.2f; - int totalMoonlightDyes = Player.dye.Count(dyeItem => dyeItem.type == ItemType()); if (totalMoonlightDyes > 0) { @@ -4855,8 +4851,8 @@ namespace CalamityMod.CalPlayer if (shadow) { - stealthGenStandstill += 0.08f; - stealthGenMoving += 0.08f; + stealthGenStandstill += ShadowPotion.StealthRegenBoost; + stealthGenMoving += ShadowPotion.StealthRegenBoost; } if (eArtifact) diff --git a/CalPlayer/CalamityPlayerDashEffects.cs b/CalPlayer/CalamityPlayerDashEffects.cs index f8b0ad844e..224a409e07 100644 --- a/CalPlayer/CalamityPlayerDashEffects.cs +++ b/CalPlayer/CalamityPlayerDashEffects.cs @@ -142,7 +142,8 @@ namespace CalamityMod.CalPlayer if (HasCustomDash) { - Player.vortexStealthActive = false; + if (Player.wingsLogic != (int)VanillaWingID.WingsVortex) + Player.vortexStealthActive = false; // Decide the player's facing direction. if (Player.velocity.X != 0f) @@ -489,6 +490,7 @@ namespace CalamityMod.CalPlayer if (WorldGen.SolidOrSlopedTile(upwardTilePoint.X, upwardTilePoint.Y) || WorldGen.SolidOrSlopedTile(aheadTilePoint.X, aheadTilePoint.Y)) Player.velocity.X /= 2f; + Player.timeSinceLastDashStarted = 0; Player.dashDelay = -1; } @@ -567,6 +569,7 @@ namespace CalamityMod.CalPlayer hitDirection = Player.direction; // TODO -- This should probably use DirectStrike? + // If this does use DirectStrike, remember to remove the Old Fashioned bonus as it'd be a projectile. if (Player.whoAmI == Main.myPlayer) Player.ApplyDamageToNPC(n, (int)Damage, Knockback, hitDirection, false); diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index 88af62a2d8..33b65d6b27 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -131,10 +131,10 @@ namespace CalamityMod.CalPlayer { if (Main.rand.NextBool()) { - int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, DustID.Vortex, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0.5f; - drawInfo.DustCache.Add(dust); + Dust dust = Dust.NewDustDirect(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, DustID.Vortex, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1f); + dust.noGravity = true; + dust.velocity *= 0.5f; + drawInfo.DustCache.Add(dust.dustIndex); } } } @@ -146,10 +146,10 @@ namespace CalamityMod.CalPlayer { if (Main.rand.NextBool()) { - int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, DustID.GoldCoin, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0.5f; - drawInfo.DustCache.Add(dust); + Dust dust = Dust.NewDustDirect(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, DustID.GoldCoin, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1f); + dust.noGravity = true; + dust.velocity *= 0.5f; + drawInfo.DustCache.Add(dust.dustIndex); } } } @@ -166,10 +166,10 @@ namespace CalamityMod.CalPlayer { if (Main.rand.NextBool()) { - int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, DustID.Shadowflame, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.5f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0.5f; - drawInfo.DustCache.Add(dust); + Dust dust = Dust.NewDustDirect(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, DustID.Shadowflame, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.5f); + dust.noGravity = true; + dust.velocity *= 0.5f; + drawInfo.DustCache.Add(dust.dustIndex); } } } @@ -332,11 +332,11 @@ namespace CalamityMod.CalPlayer { if (Main.rand.NextBool(3)) { - int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, Main.rand.NextBool(8) ? 296 : 5, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.25f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 1.3f; - Main.dust[dust].velocity.Y -= 0.5f; - drawInfo.DustCache.Add(dust); + Dust dust = Dust.NewDustDirect(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, Main.rand.NextBool(8) ? 296 : 5, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1.25f); + dust.noGravity = true; + dust.velocity *= 1.3f; + dust.velocity.Y -= 0.5f; + drawInfo.DustCache.Add(dust.dustIndex); } if (Main.rand.NextBool(16)) { diff --git a/CalPlayer/CalamityPlayerFishing.cs b/CalPlayer/CalamityPlayerFishing.cs index b43276306b..7037db3070 100644 --- a/CalPlayer/CalamityPlayerFishing.cs +++ b/CalPlayer/CalamityPlayerFishing.cs @@ -8,7 +8,7 @@ using CalamityMod.Items.Fishing.BrimstoneCragCatches; using CalamityMod.Items.Fishing.FishingRods; using CalamityMod.Items.Fishing.SulphurCatches; using CalamityMod.Items.Fishing.SunkenSeaCatches; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Items.SummonItems; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index daee95936e..2729765d0f 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -20,6 +20,8 @@ using CalamityMod.Items.Armor.LunicCorps; using CalamityMod.Items.Armor.Silva; using CalamityMod.Items.Armor.Wulfrum; using CalamityMod.Items.Mounts; +using CalamityMod.Items.Potions; +using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.Tools; using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.Items.Weapons.DraedonsArsenal; @@ -71,12 +73,12 @@ namespace CalamityMod.CalPlayer for (int j = 0; j < 20; j++) { - int sVeilDustIndex1 = Dust.NewDust(Player.Center, 1, 1, DustID.VilePowder, sVeilDustDir.X * j, sVeilDustDir.Y * j); - int sVeilDustIndex2 = Dust.NewDust(Player.Center, 1, 1, DustID.VilePowder, -sVeilDustDir.X * j, -sVeilDustDir.Y * j); - Main.dust[sVeilDustIndex1].noGravity = false; - Main.dust[sVeilDustIndex1].noLight = false; - Main.dust[sVeilDustIndex2].noGravity = false; - Main.dust[sVeilDustIndex2].noLight = false; + Dust sVeilDust1 = Dust.NewDustDirect(Player.Center, 1, 1, DustID.VilePowder, sVeilDustDir.X * j, sVeilDustDir.Y * j); + Dust sVeilDust2 = Dust.NewDustDirect(Player.Center, 1, 1, DustID.VilePowder, -sVeilDustDir.X * j, -sVeilDustDir.Y * j); + sVeilDust1.noGravity = false; + sVeilDust1.noLight = false; + sVeilDust2.noGravity = false; + sVeilDust2.noLight = false; } SoundEngine.PlaySound(SilvaHeadSummon.DispelSound, Player.Center); @@ -94,8 +96,7 @@ namespace CalamityMod.CalPlayer for (int j = 0; j < 30; j++) { - int num = Dust.NewDust(Player.position, Player.width, Player.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); - Dust dust = Main.dust[num]; + Dust dust = Dust.NewDustDirect(Player.position, Player.width, Player.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); dust.position.X += Main.rand.Next(-20, 21); dust.position.Y += Main.rand.Next(-20, 21); dust.velocity *= 0.4f; @@ -122,8 +123,7 @@ namespace CalamityMod.CalPlayer for (int j = 0; j < 100; j++) { - int scarfDodgeDust = Dust.NewDust(Player.position, Player.width, Player.height, DustID.LifeDrain, 0f, 0f, 100, default, 2f); - Dust dust = Main.dust[scarfDodgeDust]; + Dust dust = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.LifeDrain, 0f, 0f, 100, default, 2f); dust.position.X += Main.rand.Next(-20, 21); dust.position.Y += Main.rand.Next(-20, 21); dust.velocity *= 0.4f; @@ -166,7 +166,6 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < 10; i++) { int damage = (int)Player.GetTotalDamage().ApplyTo(55); - damage = Player.ApplyArmorAccDamageBonusesTo(damage); int lumenyl = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, Main.rand.NextFloat(-2f, 2f), Main.rand.NextFloat(-2f, 2f), ModContent.ProjectileType(), damage, 0, Player.whoAmI); Main.projectile[lumenyl].rotation = Main.rand.NextFloat(0, 360); @@ -208,7 +207,6 @@ namespace CalamityMod.CalPlayer var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); int damage = (int)Player.GetTotalDamage().ApplyTo(2750); - damage = Player.ApplyArmorAccDamageBonusesTo(damage); int eclipse = Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0, Player.whoAmI); if (eclipse.WithinBounds(Main.maxProjectiles)) @@ -266,8 +264,7 @@ namespace CalamityMod.CalPlayer for (int j = 0; j < 50; j++) { - int nebulousReviveDust = Dust.NewDust(Player.position, Player.width, Player.height, DustID.ShadowbeamStaff, 0f, 0f, 100, default, 2f); - Dust dust = Main.dust[nebulousReviveDust]; + Dust dust = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.ShadowbeamStaff, 0f, 0f, 100, default, 2f); dust.position.X += Main.rand.Next(-20, 21); dust.position.Y += Main.rand.Next(-20, 21); dust.velocity *= 0.9f; @@ -351,9 +348,9 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < 60; i++) { - int d = Dust.NewDust(Player.position, Player.width, Player.height, DustID.GemSapphire, 0f, 0f, 0, default, 2.5f); - Main.dust[d].noGravity = true; - Main.dust[d].velocity *= 5f; + Dust dust = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.GemSapphire, 0f, 0f, 0, default, 2.5f); + dust.noGravity = true; + dust.velocity *= 5f; } return false; @@ -541,32 +538,6 @@ namespace CalamityMod.CalPlayer if (yellowCandle && cgn.DR < 0.99f && target.takenDamageMultiplier > 0.05f) modifiers.ModifyHitInfo += CirrusYellowCandleBuff.ModifyHitInfo_Spite; - // Excalibur and True Excalibur deal +100% damage to targets above 75% HP. - if (item.type == ItemID.Excalibur || item.type == ItemID.TrueExcalibur) - { - if (target.life > (int)(target.lifeMax * 0.75)) - modifiers.ScalingBonusDamage += 1f; - } - - // Titanium Sword deals up to +15% damage based on the target's knockback resistance. - if (item.type == ItemID.TitaniumSword) - { - float knockbackResistBonus = 0.15f * (1f - target.knockBackResist); - modifiers.ScalingBonusDamage += knockbackResistBonus; - } - - // Antlion Claw, Bone Sword and Breaker Blade ignore 50% of the enemy's defense. - if (item.type == ItemID.AntlionClaw || item.type == ItemID.BoneSword || item.type == ItemID.BreakerBlade) - { - modifiers.ScalingArmorPenetration += 0.5f; - } - - // Stylish Scissors, all Phaseblades and all Phasesabers ignore 100% of the enemy's defense. - if (item.type == ItemID.StylistKilLaKillScissorsIWish || (item.type >= ItemID.BluePhaseblade && item.type <= ItemID.YellowPhaseblade) || (item.type >= ItemID.BluePhasesaber && item.type <= ItemID.YellowPhasesaber) || item.type == ItemID.OrangePhaseblade || item.type == ItemID.OrangePhasesaber) - { - modifiers.ScalingArmorPenetration += 1f; - } - // Frost Armor's rework gives +X% melee damage and +Y% ranged damage based on distance, where X+Y = 15. if (frostSet) { @@ -658,14 +629,7 @@ namespace CalamityMod.CalPlayer if (screwdriver) { if (proj.penetrate > 1 || proj.penetrate == -1) - modifiers.ScalingBonusDamage += 0.05f; - } - - // Excalibur and True Excalibur deal +100% damage to targets above 75% HP. - if (proj.type == ProjectileID.Excalibur || proj.type == ProjectileID.TrueExcalibur) - { - if (target.life > (int)(target.lifeMax * 0.75)) - modifiers.ScalingBonusDamage += 1f; + modifiers.ScalingBonusDamage += Screwdriver.PiercingDamageBuff; } // Calamity buffs Inferno Fork by 20%. This is multiplicative because it's supposed to be a buff to the weapon's base damage. @@ -673,20 +637,6 @@ namespace CalamityMod.CalPlayer if (proj.type == ProjectileID.InfernoFriendlyBlast) modifiers.SourceDamage *= 1.2f; - // Gungnir deals +100% damage to targets above 75% HP. - if (proj.type == ProjectileID.Gungnir) - { - if (target.life > (int)(target.lifeMax * 0.75)) - modifiers.ScalingBonusDamage += 1f; - } - - // Titanium Trident deals up to +15% damage based on the target's knockback resistance. - if (proj.type == ProjectileID.TitaniumTrident) - { - float knockbackResistBonus = 0.15f * (1f - target.knockBackResist); - modifiers.ScalingBonusDamage += knockbackResistBonus; - } - // Frost Armor's rework gives +X% melee damage and +Y% ranged damage based on distance, where X+Y = 15. if (frostSet) { @@ -1549,7 +1499,6 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < 9; i++) { int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(15); - seekerDamage = Player.ApplyArmorAccDamageBonusesTo(seekerDamage); Projectile bee = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.2f), ModContent.ProjectileType(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2); bee.ArmorPenetration = 35; @@ -1615,7 +1564,7 @@ namespace CalamityMod.CalPlayer Rectangle npcHitbox = n.getRect(); if ((Player.getRect()).Intersects(npcHitbox) && (n.noTileCollide || Collision.CanHit(Player.position, Player.width, Player.height, n.position, n.width, n.height))) { - int damage = Player.ApplyArmorAccDamageBonusesTo(Player.CalcIntDamage(InterstellarStompers.PassthroughDamage)); + int damage = Player.CalcIntDamage(InterstellarStompers.PassthroughDamage); Projectile.NewProjectile(Player.GetSource_FromThis(), n.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0, Main.myPlayer); @@ -1716,6 +1665,10 @@ namespace CalamityMod.CalPlayer #region Modify Hurt public override void ModifyHurt(ref Player.HurtModifiers modifiers) { + // Calcium Potion knockback reduction + if (calcium) + modifiers.Knockback *= (1f - CalciumPotion.KnockbackResistance); + // Handles energy shields and Boss Rush, in that order modifiers.ModifyHurtInfo += ModifyHurtInfo_Calamity; @@ -2355,22 +2308,22 @@ namespace CalamityMod.CalPlayer for (int d = 0; d < 20; d++) { - int dust = Dust.NewDust(Player.position, Player.width, Player.height, DustID.Smoke, 0f, 0f, 100, default, 2f); - Main.dust[dust].velocity *= 3f; + Dust dust = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.Smoke, 0f, 0f, 100, default, 2f); + dust.velocity *= 3f; if (Main.rand.NextBool()) { - Main.dust[dust].scale = 0.5f; - Main.dust[dust].fadeIn = 1f + Main.rand.Next(10) * 0.1f; + dust.scale = 0.5f; + dust.fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int d = 0; d < 35; d++) { - int fire = Dust.NewDust(Player.position, Player.width, Player.height, DustID.Torch, 0f, 0f, 100, default, 3f); - Main.dust[fire].noGravity = true; - Main.dust[fire].velocity *= 5f; - fire = Dust.NewDust(Player.position, Player.width, Player.height, DustID.Torch, 0f, 0f, 100, default, 2f); - Main.dust[fire].velocity *= 2f; + Dust fire = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.Torch, 0f, 0f, 100, default, 3f); + fire.noGravity = true; + fire.velocity *= 5f; + fire = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.Torch, 0f, 0f, 100, default, 2f); + fire.velocity *= 2f; } } } @@ -2382,21 +2335,21 @@ namespace CalamityMod.CalPlayer for (int d = 0; d < 10; d++) { - int ice = Dust.NewDust(Player.position, Player.width, Player.height, DustID.IceRod, 0f, 0f, 100, default, 2f); - Main.dust[ice].velocity *= 3f; + Dust ice = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.IceRod, 0f, 0f, 100, default, 2f); + ice.velocity *= 3f; if (Main.rand.NextBool()) { - Main.dust[ice].scale = 0.5f; - Main.dust[ice].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + ice.scale = 0.5f; + ice.fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } for (int d = 0; d < 15; d++) { - int ice = Dust.NewDust(Player.position, Player.width, Player.height, DustID.IceRod, 0f, 0f, 100, default, 3f); - Main.dust[ice].noGravity = true; - Main.dust[ice].velocity *= 5f; - ice = Dust.NewDust(Player.position, Player.width, Player.height, DustID.IceRod, 0f, 0f, 100, default, 2f); - Main.dust[ice].velocity *= 2f; + Dust ice = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.IceRod, 0f, 0f, 100, default, 3f); + ice.noGravity = true; + ice.velocity *= 5f; + ice = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.IceRod, 0f, 0f, 100, default, 2f); + ice.velocity *= 2f; } } @@ -2406,7 +2359,6 @@ namespace CalamityMod.CalPlayer } else if (xerocSet) { - Player.AddBuff(ModContent.BuffType(), 180); Player.AddBuff(ModContent.BuffType(), 180); } else if (reaverDefense) @@ -2544,7 +2496,6 @@ namespace CalamityMod.CalPlayer for (int n = 0; n < 4; n++) { int featherDamage = (int)Player.GetBestClassDamage().ApplyTo(30); - featherDamage = Player.ApplyArmorAccDamageBonusesTo(featherDamage); CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 20f, ModContent.ProjectileType(), featherDamage, 1f, Player.whoAmI); } @@ -2555,10 +2506,7 @@ namespace CalamityMod.CalPlayer SoundEngine.PlaySound(SoundID.Item74, Player.Center); int blazeDamage = (int)Player.GetBestClassDamage().ApplyTo(25); - blazeDamage = Player.ApplyArmorAccDamageBonusesTo(blazeDamage); - int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(320); - astralStarDamage = Player.ApplyArmorAccDamageBonusesTo(astralStarDamage); Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, 0f, 0f, ModContent.ProjectileType(), blazeDamage, 5f, Player.whoAmI, 0f, 1f); for (int n = 0; n < 12; n++) @@ -2573,7 +2521,6 @@ namespace CalamityMod.CalPlayer for (int n = 0; n < 3; n++) { int deificStarDamage = (int)Player.GetBestClassDamage().ApplyTo(130); - deificStarDamage = Player.ApplyArmorAccDamageBonusesTo(deificStarDamage); Projectile star = CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 29f, ProjectileID.StarVeilStar, deificStarDamage, 4f, Player.whoAmI); if (star.whoAmI.WithinBounds(Main.maxProjectiles)) @@ -2614,7 +2561,6 @@ namespace CalamityMod.CalPlayer int effectStrength = amalgam ? 3 : aBrain ? 2 : 1; int effectDamage = amalgam ? 400 : aBrain ? 50 : 15; effectDamage = (int)Player.GetBestClassDamage().ApplyTo(effectDamage); - effectDamage = Player.ApplyArmorAccDamageBonusesTo(effectDamage); Vector2 spawnerVelocity = -Vector2.UnitY.RotatedByRandom(MathHelper.Pi / 40f) * 12.5f; Projectile.NewProjectile(source, Player.Center, spawnerVelocity, ModContent.ProjectileType(), effectDamage, 0f, Player.whoAmI, 0f, 0f, effectStrength); @@ -2643,7 +2589,6 @@ namespace CalamityMod.CalPlayer { SoundEngine.PlaySound(SoundID.Item74, Player.Center); int eDamage = (int)Player.GetBestClassDamage().ApplyTo(230); - eDamage = Player.ApplyArmorAccDamageBonusesTo(eDamage); if (Player.whoAmI == Main.myPlayer) Projectile.NewProjectile(fuckYouBitch, Player.Center, Vector2.Zero, ModContent.ProjectileType(), eDamage, 1f, Player.whoAmI, 0f, 0f); @@ -2660,7 +2605,6 @@ namespace CalamityMod.CalPlayer double deltaAngle = spread / 8f; double offsetAngle; int sDamage = (int)Player.GetTotalDamage().ApplyTo(60); - sDamage = Player.ApplyArmorAccDamageBonusesTo(sDamage); if (Player.whoAmI == Main.myPlayer) { @@ -2685,7 +2629,6 @@ namespace CalamityMod.CalPlayer if (hurtInfo.Damage > 0) { int rDamage = (int)Player.GetBestClassDamage().ApplyTo(240); - rDamage = Player.ApplyArmorAccDamageBonusesTo(rDamage); if (Player.whoAmI == Main.myPlayer) Projectile.NewProjectile(source, Player.Center.X, Player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType(), rDamage, 0f, Player.whoAmI, 0f, 0f); @@ -2701,7 +2644,7 @@ namespace CalamityMod.CalPlayer double startAngle = Math.Atan2(Player.velocity.X, Player.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; double offsetAngle; - int shrapnelDamage = Player.ApplyArmorAccDamageBonusesTo(Player.CalcIntDamage(675)); + int shrapnelDamage = Player.CalcIntDamage(675); if (Player.whoAmI == Main.myPlayer) { for (int i = 0; i < 4; i++) @@ -2722,7 +2665,6 @@ namespace CalamityMod.CalPlayer for (int l = 0; l < 2; l++) { int shadowbeamDamage = (int)Player.GetBestClassDamage().ApplyTo(300); - shadowbeamDamage = Player.ApplyArmorAccDamageBonusesTo(shadowbeamDamage); Projectile beam = CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 22f, ProjectileID.ShadowBeamFriendly, shadowbeamDamage, 7f, Player.whoAmI); if (beam.whoAmI.WithinBounds(Main.maxProjectiles)) @@ -2735,7 +2677,6 @@ namespace CalamityMod.CalPlayer for (int l = 0; l < 5; l++) { int scytheDamage = (int)Player.GetBestClassDamage().ApplyTo(500); - scytheDamage = Player.ApplyArmorAccDamageBonusesTo(scytheDamage); Projectile scythe = CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 22f, ProjectileID.DemonScythe, scytheDamage, 7f, Player.whoAmI); if (scythe.whoAmI.WithinBounds(Main.maxProjectiles)) diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index c143bb4e06..e1961cd604 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -6,6 +6,8 @@ using CalamityMod.Buffs.Placeables; using CalamityMod.Cooldowns; using CalamityMod.Enums; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Potions; +using CalamityMod.Items.Potions.Alcohol; using CalamityMod.NPCs; using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Typeless; @@ -177,14 +179,12 @@ namespace CalamityMod.CalPlayer if (vodka) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 1; + totalNegativeLifeRegen += Vodka.RegenLoss; } if (redWine) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 1; - if (baguette) - totalNegativeLifeRegen += 3; + totalNegativeLifeRegen += baguette ? Baguette.RedWineBuffedRegenLoss : RedWine.RegenLoss; } if (grapeBeer) { @@ -193,7 +193,7 @@ namespace CalamityMod.CalPlayer if (moonshine) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 1; + totalNegativeLifeRegen += Moonshine.RegenLoss; } if (rum) { @@ -206,7 +206,7 @@ namespace CalamityMod.CalPlayer if (fireball) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 1; + totalNegativeLifeRegen += Fireball.RegenLoss; } if (whiskey) { @@ -215,27 +215,27 @@ namespace CalamityMod.CalPlayer if (everclear) { alcoholPoisonLevel += 2; - totalNegativeLifeRegen += 10; + totalNegativeLifeRegen += Everclear.RegenLoss; } if (bloodyMary) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 4; + totalNegativeLifeRegen += BloodyMary.RegenLoss; } if (tequila) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 1; + totalNegativeLifeRegen += Tequila.RegenLoss; } if (tequilaSunrise) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 2; + totalNegativeLifeRegen += TequilaSunrise.RegenLoss; } if (screwdriver) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 1; + totalNegativeLifeRegen += Screwdriver.RegenLoss; } if (caribbeanRum) { @@ -252,27 +252,27 @@ namespace CalamityMod.CalPlayer if (margarita) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 1; + totalNegativeLifeRegen += Margarita.RegenLoss; } if (starBeamRye) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 2; + totalNegativeLifeRegen += StarBeamRye.RegenLoss; } if (moscowMule) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 4; + totalNegativeLifeRegen += MoscowMule.RegenLoss; } if (whiteWine) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 1; + totalNegativeLifeRegen += WhiteWine.RegenLoss; } if (evergreenGin) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 1; + totalNegativeLifeRegen += EvergreenGin.RegenLoss; } if (Player.tipsy) { @@ -615,10 +615,10 @@ namespace CalamityMod.CalPlayer public override void UpdateLifeRegen() { if (rum) - Player.lifeRegen += 2; + Player.lifeRegen += Rum.RegenBoost; if (caribbeanRum) - Player.lifeRegen += 2; + Player.lifeRegen += CaribbeanRum.RegenBoost; if (aChicken) Player.lifeRegen += 1; @@ -679,14 +679,14 @@ namespace CalamityMod.CalPlayer Player.lifeRegen += 2; if (Main.rand.NextBool()) { - int regen = Dust.NewDust(Player.position, Player.width, Player.height, DustID.Blood, 0f, 0f, 200, new Color(99, 54, 84), 2f); - Main.dust[regen].noGravity = true; - Main.dust[regen].fadeIn = 1.3f; + Dust regen = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.Blood, 0f, 0f, 200, new Color(99, 54, 84), 2f); + regen.noGravity = true; + regen.fadeIn = 1.3f; Vector2 velocity = CalamityUtils.RandomVelocity(100f, 50f, 100f, 0.04f); - Main.dust[regen].velocity = velocity; + regen.velocity = velocity; velocity.Normalize(); velocity *= 34f; - Main.dust[regen].position = Player.Center - velocity; + regen.position = Player.Center - velocity; } } @@ -769,8 +769,7 @@ namespace CalamityMod.CalPlayer if (!Player.shinyStone && Player.StandingStill() && Player.velocity.Y == 0 && Player.itemAnimation == 0) { bool honeyDewWorking = honeyTurboRegen && Player.honeyWet; - bool anyStandingStillLifeRegen = shadeRegen || cFreeze || honeyDewWorking || photosynthesis || aAmpoule || purity; - bool onlyPhotosynthesisAtNight = !shadeRegen && !cFreeze && !honeyDewWorking && photosynthesis && !Main.dayTime; + bool anyStandingStillLifeRegen = shadeRegen || cFreeze || honeyDewWorking || aAmpoule || purity; // Divides all negative life regen by two before applying any other effects. if (anyStandingStillLifeRegen && Player.lifeRegen < 0) @@ -779,32 +778,31 @@ namespace CalamityMod.CalPlayer // Spawn dust of some flavor while actually regenerating, aAmpule and purity have a slightly different looking style if (Player.lifeRegen > 0 && Player.statLife < actualMaxLife) { - int dustType = shadeRegen ? 173 : cFreeze ? 67 : honeyDewWorking ? DustID.Honey2 : photosynthesis ? 244 : aAmpoule ? 228 : purity ? 187 : -1; + int dustType = shadeRegen ? 173 : cFreeze ? 67 : honeyDewWorking ? DustID.Honey2 : aAmpoule ? 228 : purity ? 187 : -1; bool dustSpawnRolled = Main.rand.Next(30000) < Player.lifeRegenTime || purity ? Main.rand.NextBool() : aAmpoule ? Main.rand.NextBool(4) : Main.rand.NextBool(30); if (dustType != -1 && dustSpawnRolled) { - int regen = Dust.NewDust(Player.position, Player.width, Player.height, dustType, 0f, 0f, purity || aAmpoule ? 80 : 200, default, purity || aAmpoule ? 0.5f : 1f); - Main.dust[regen].noGravity = true; - Main.dust[regen].fadeIn = 1.3f; + Dust regen = Dust.NewDustDirect(Player.position, Player.width, Player.height, dustType, 0f, 0f, purity || aAmpoule ? 80 : 200, default, purity || aAmpoule ? 0.5f : 1f); + regen.noGravity = true; + regen.fadeIn = 1.3f; Vector2 velocity = CalamityUtils.RandomVelocity(100f, 50f, 100f, 0.04f); - Main.dust[regen].velocity = velocity; + regen.velocity = velocity; velocity.Normalize(); velocity *= purity || aAmpoule ? 55f : 34f; - Main.dust[regen].position = Player.Center - velocity; + regen.position = Player.Center - velocity; } } // Actually apply "standing still" regeneration (the stats are granted even at full health) - float regenTimeNeededForTurboRegen = shadeRegen ? 40f : cFreeze ? 60f : honeyDewWorking ? 90f : photosynthesis ? 90f : aAmpoule ? 90f : purity ? 60f : -1f; + float regenTimeNeededForTurboRegen = shadeRegen ? 40f : cFreeze ? 60f : honeyDewWorking ? 90f : aAmpoule ? 90f : purity ? 60f : -1f; // 4 = vanilla Shiny Stone - int turboRegenPower = shadeRegen || cFreeze || purity ? 4 : honeyDewWorking || aAmpoule ? 3 : photosynthesis ? 1 : -1; + int turboRegenPower = shadeRegen || cFreeze || purity ? 4 : honeyDewWorking || aAmpoule ? 3 : -1; if (turboRegenPower > 0) { // After a brief delay determined by your form of standing still regen, min-cap life regen time at 1800 / 3600. - // Photosynthesis Potion does not do this at night. - if (Player.lifeRegenTime > regenTimeNeededForTurboRegen && Player.lifeRegenTime < 1800f && !onlyPhotosynthesisAtNight) + if (Player.lifeRegenTime > regenTimeNeededForTurboRegen && Player.lifeRegenTime < 1800f) Player.lifeRegenTime = 1800f; Player.lifeRegen += turboRegenPower; @@ -826,14 +824,14 @@ namespace CalamityMod.CalPlayer if (Main.rand.Next(30000) < Player.lifeRegenTime || Main.rand.NextBool()) { - int regen = Dust.NewDust(Player.position, Player.width, Player.height, DustID.HeartCrystal, 0f, 0f, 200, Color.OrangeRed, 1f); - Main.dust[regen].noGravity = true; - Main.dust[regen].fadeIn = 1.3f; + Dust regen = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.HeartCrystal, 0f, 0f, 200, Color.OrangeRed, 1f); + regen.noGravity = true; + regen.fadeIn = 1.3f; Vector2 velocity = CalamityUtils.RandomVelocity(100f, 50f, 100f, 0.04f); - Main.dust[regen].velocity = velocity; + regen.velocity = velocity; velocity.Normalize(); velocity *= 34f; - Main.dust[regen].position = Player.Center - velocity; + regen.position = Player.Center - velocity; } } @@ -841,9 +839,9 @@ namespace CalamityMod.CalPlayer if (Player.statLife < actualMaxLife) { // The soft cap doesn't apply if the player is not moving and not using a weapon while having any of the following: - // Shiny Stone, Cosmic Freeze buff from the Cosmic Discharge, Demonshade Armor, Photosynthesis Potion buff or The Camper. + // Shiny Stone, Cosmic Freeze buff from the Cosmic Discharge, Demonshade Armor, or The Camper. int baseLifeRegenBoost = 4; - bool noLifeRegenCap = (Player.shinyStone || cFreeze || shadeRegen || photosynthesis || camper) && + bool noLifeRegenCap = (Player.shinyStone || cFreeze || shadeRegen || camper) && Player.StandingStill() && Player.itemAnimation == 0; if (!noLifeRegenCap) @@ -881,12 +879,11 @@ namespace CalamityMod.CalPlayer if (toxicHeart) // Since it needs to know your life regen, it must be placed here { int auraDamage = (int)Player.GetBestClassDamage().ApplyTo(200); - auraDamage = Player.ApplyArmorAccDamageBonusesTo(auraDamage); var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); pulseRate = Utils.Remap(Player.lifeRegen, -30, 10, 20, 1, true); if (pulseCounter >= 420) { - Projectile.NewProjectileDirect(source, Player.Center, Vector2.Zero, ModContent.ProjectileType(), auraDamage, 0f, Player.whoAmI, 0, 0, 0); + Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType(), auraDamage, 0f, Player.whoAmI, 0, 0, 0); pulseCounter = 0; float soundVolume = Utils.Remap(Player.lifeRegen, -30, 10, 1f, 0.3f, true); SoundStyle heartbeat = new("CalamityMod/Sounds/Item/Heartbeat"); diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index ce4c00e059..1525c93530 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -32,6 +32,7 @@ using CalamityMod.Items.DraedonMisc; using CalamityMod.Items.Dyes; using CalamityMod.Items.Fishing.FishingRods; using CalamityMod.Items.Mounts.Minecarts; +using CalamityMod.Items.PermanentBoosters; using CalamityMod.Items.Potions; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.VanillaArmorChanges; @@ -244,7 +245,7 @@ namespace CalamityMod.CalPlayer if (!HasIncreasedDashFirstFrame) { Player.velocity.X *= 1.2f; - int damage = Player.ApplyArmorAccDamageBonusesTo(Player.GetBestClassDamage().ApplyTo(75)); + int damage = (int)Player.GetBestClassDamage().ApplyTo(75); Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Player.whoAmI); HasIncreasedDashFirstFrame = true; @@ -274,7 +275,7 @@ namespace CalamityMod.CalPlayer } if (Player.miscCounter % 4 == 0 && Player.velocity != Vector2.Zero) //every other frame spawn the hitbox { - int damage = Player.ApplyArmorAccDamageBonusesTo(Player.GetBestClassDamage().ApplyTo(90)); + int damage = (int)Player.GetBestClassDamage().ApplyTo(90); Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Player.whoAmI); } } @@ -290,7 +291,7 @@ namespace CalamityMod.CalPlayer if (!HasReducedDashFirstFrame) // Dash isn't reduced, this is used to determine the first frame of dashing { SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact with { Volume = 0.4f, PitchVariance = 0.4f }, Player.Center); - int damage = Player.ApplyArmorAccDamageBonusesTo(Player.GetBestClassDamage().ApplyTo(67)); + int damage = (int)Player.GetBestClassDamage().ApplyTo(67); Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType(), damage, 16f, Player.whoAmI); HasReducedDashFirstFrame = true; @@ -318,7 +319,7 @@ namespace CalamityMod.CalPlayer if (Player.miscCounter % 6 == 0 && Player.velocity != Vector2.Zero) { - int damage = Player.ApplyArmorAccDamageBonusesTo(Player.GetBestClassDamage().ApplyTo(170)); + int damage = (int)Player.GetBestClassDamage().ApplyTo(170); Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType(), damage, 10f, Player.whoAmI); } } @@ -422,6 +423,21 @@ namespace CalamityMod.CalPlayer else HasReducedDashFirstFrame = false; } + + // Solar Wings increase dash velocity of Solar Flare armor dash + if (Player.wingsLogic == (int)VanillaWingID.WingsSolar) + { + if (Player.dashDelay == -1 && Player.dash == 3) + { + if (!HasReducedDashFirstFrame) + { + Player.velocity.X *= 1.3f; + HasReducedDashFirstFrame = true; + } + } + else + HasReducedDashFirstFrame = false; + } } #endregion @@ -632,14 +648,14 @@ namespace CalamityMod.CalPlayer // Old Draedon's Heart dust effect from its standing still regen. Works just fine. int dustID = DustID.TerraBlade; { - int regen = Dust.NewDust(Player.position, Player.width, Player.height, dustID, 0f, 0f, 200, default, 1f); - Main.dust[regen].noGravity = true; - Main.dust[regen].fadeIn = 1.3f; + Dust regen = Dust.NewDustDirect(Player.position, Player.width, Player.height, dustID, 0f, 0f, 200, default, 1f); + regen.noGravity = true; + regen.fadeIn = 1.3f; Vector2 velocity = CalamityUtils.RandomVelocity(100f, 50f, 100f, 0.04f); - Main.dust[regen].velocity = velocity; + regen.velocity = velocity; velocity.Normalize(); velocity *= 34f; - Main.dust[regen].position = Player.Center - velocity; + regen.position = Player.Center - velocity; } } } @@ -721,8 +737,7 @@ namespace CalamityMod.CalPlayer if (Player.velocity.Length() == 0f) return; - Dust dust; - dust = Main.dust[Dust.NewDust(Player.Center, 16, 16, DustID.Firefly, 0.23255825f, 10f, 0, new Color(117, 55, 15), 1.5116279f)]; + Dust dust = Dust.NewDustDirect(Player.Center, 16, 16, DustID.Firefly, 0.23255825f, 10f, 0, new Color(117, 55, 15), 1.5116279f); dust.noGravity = true; dust.noLight = true; dust.fadeIn = 2.5813954f; @@ -788,7 +803,6 @@ namespace CalamityMod.CalPlayer Rectangle sigilHitbox = Utils.CenteredRectangle(Main.MouseWorld, new Vector2(35f, 62f)); int sigilDamage = (int)Player.GetBestClassDamage().ApplyTo(Calamity.BaseDamage); - sigilDamage = Player.ApplyArmorAccDamageBonusesTo(sigilDamage); bool brightenedSigil = false; foreach (NPC target in Main.ActiveNPCs) @@ -860,12 +874,27 @@ namespace CalamityMod.CalPlayer private void MiscEffects() { - // Update Carpet textures + // Update textures if (Main.netMode != NetmodeID.Server && Player.whoAmI == Main.myPlayer) { Asset carpetAuric = ExtraTextureRefs.FlyingCarpetAuric; Asset carpetOriginal = ExtraTextureRefs.FlyingCarpetVanilla; TextureAssets.FlyingCarpet = (auricSet ? carpetAuric : carpetOriginal); + + for (int l = 0; l < Player.MaxBuffs; l++) + { + if (Player.buffType[l] != BuffID.Lucky) + continue; + + if (Player.buffTime[l] > CalamityUtils.SecondsToFrames(600f)) + TextureAssets.Buff[BuffID.Lucky] = ExtraTextureRefs.LuckIconGreater; + else if (Player.buffTime[l] > CalamityUtils.SecondsToFrames(300f)) + TextureAssets.Buff[BuffID.Lucky] = ExtraTextureRefs.LuckIconVanilla; + else + TextureAssets.Buff[BuffID.Lucky] = ExtraTextureRefs.LuckIconLesser; + + break; + } } // Calculate/reset DoG cart rotations based on whether the DoG cart is in use. @@ -1327,7 +1356,6 @@ namespace CalamityMod.CalPlayer if (!tentaclesPresent[i]) { int damage = (int)Player.GetBestClassDamage().ApplyTo(390); - damage = Player.ApplyArmorAccDamageBonusesTo(damage); var source = Player.GetSource_FromThis(OmegaBlueHelmet.TentacleEntitySourceContext); Vector2 vel = new Vector2(Main.rand.Next(-13, 14), Main.rand.Next(-13, 14)) * 0.25f; @@ -1391,12 +1419,12 @@ namespace CalamityMod.CalPlayer if (i % dustDivisor == 0) { currentDustPos = Vector2.Lerp(dustLineStart, dustLineEnd, i / (float)maxHealDustIterations); - int holyDust = Dust.NewDust(currentDustPos, 0, 0, DustID.RainbowMk2, 0f, 0f, 0, dustColor, 1f); - Main.dust[holyDust].position = currentDustPos; - Main.dust[holyDust].velocity = spinningpoint.RotatedBy(MathHelper.TwoPi * i / maxHealDustIterations) * healerDustVel * (0.8f + Main.rand.NextFloat() * 0.4f) + Player.velocity; - Main.dust[holyDust].noGravity = true; - Main.dust[holyDust].scale = 1f; - Main.dust[holyDust].fadeIn = Main.rand.NextFloat() * 2f; + Dust holyDust = Dust.NewDustDirect(currentDustPos, 0, 0, DustID.RainbowMk2, 0f, 0f, 0, dustColor, 1f); + holyDust.position = currentDustPos; + holyDust.velocity = spinningpoint.RotatedBy(MathHelper.TwoPi * i / maxHealDustIterations) * healerDustVel * (0.8f + Main.rand.NextFloat() * 0.4f) + Player.velocity; + holyDust.noGravity = true; + holyDust.scale = 1f; + holyDust.fadeIn = Main.rand.NextFloat() * 2f; Dust dustClone = Dust.CloneDust(holyDust); Dust extraDust = dustClone; extraDust.scale /= 2f; @@ -1434,7 +1462,7 @@ namespace CalamityMod.CalPlayer { unstableSelectedTarget = Main.npc[target]; unstableSelectedTarget.Calamity().arcZapCooldown = 18; - int damage = Player.ApplyArmorAccDamageBonusesTo(Player.GetBestClassDamage().ApplyTo(18)); + int damage = (int)Player.GetBestClassDamage().ApplyTo(18); Projectile.NewProjectile(Player.GetSource_FromThis(), new Vector2(Player.Center.X, Player.Center.Y - 20f), new Vector2(0f, -2f), ModContent.ProjectileType(), damage, 0f, Player.whoAmI, target, 3f); target = -1; @@ -1555,8 +1583,6 @@ namespace CalamityMod.CalPlayer dragonRageCooldown--; if (soundCooldown > 0) soundCooldown--; - if (shadowPotCooldown > 0) - shadowPotCooldown--; if (raiderCritLifespan > 0f) raiderCritLifespan--; if (raiderSoundCooldown > 0) @@ -1603,8 +1629,8 @@ namespace CalamityMod.CalPlayer evolutionLifeRegenCounter--; if (hurtSoundTimer > 0) hurtSoundTimer--; - if (icicleCooldown > 0) - icicleCooldown--; + if (wingProjectileCooldown > 0) + wingProjectileCooldown--; if (statisTimer > 0 && Player.dashDelay >= 0) statisTimer = 0; if (hallowedRuneCooldown > 0) @@ -1842,15 +1868,15 @@ namespace CalamityMod.CalPlayer for (int j = 0; j < 2; j++) { - int green = Dust.NewDust(Player.position, Player.width, Player.height, DustID.ChlorophyteWeapon, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 2f); - Main.dust[green].position.X += (float)Main.rand.Next(-20, 21); - Main.dust[green].position.Y += (float)Main.rand.Next(-20, 21); - Main.dust[green].velocity *= 0.9f; - Main.dust[green].noGravity = true; - Main.dust[green].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; - Main.dust[green].shader = GameShaders.Armor.GetSecondaryShader(Player.ArmorSetDye(), Player); + Dust green = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.ChlorophyteWeapon, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 2f); + green.position.X += (float)Main.rand.Next(-20, 21); + green.position.Y += (float)Main.rand.Next(-20, 21); + green.velocity *= 0.9f; + green.noGravity = true; + green.scale *= 1f + (float)Main.rand.Next(40) * 0.01f; + green.shader = GameShaders.Armor.GetSecondaryShader(Player.ArmorSetDye(), Player); if (Main.rand.NextBool()) - Main.dust[green].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; + green.scale *= 1f + (float)Main.rand.Next(40) * 0.01f; } } if (!Player.HasCooldown(SilvaRevive.ID) && hasSilvaEffect && silvaCountdown <= 0 && !areThereAnyDamnBosses && !areThereAnyDamnEvents) @@ -1944,16 +1970,15 @@ namespace CalamityMod.CalPlayer for (int j = 0; j < 2; j++) { - int blood = Dust.NewDust(Player.position, Player.width, Player.height, DustID.Blood, 0f, 0f, 100, default, 2f); - Dust dust = Main.dust[blood]; - dust.position.X += (float)Main.rand.Next(-20, 21); - dust.position.Y += (float)Main.rand.Next(-20, 21); - dust.velocity *= 0.9f; - dust.noGravity = true; - dust.scale *= 1f + (float)Main.rand.Next(40) * 0.01f; - dust.shader = GameShaders.Armor.GetSecondaryShader(Player.ArmorSetDye(), Player); + Dust blood = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.Blood, 0f, 0f, 100, default, 2f); + blood.position.X += (float)Main.rand.Next(-20, 21); + blood.position.Y += (float)Main.rand.Next(-20, 21); + blood.velocity *= 0.9f; + blood.noGravity = true; + blood.scale *= 1f + (float)Main.rand.Next(40) * 0.01f; + blood.shader = GameShaders.Armor.GetSecondaryShader(Player.ArmorSetDye(), Player); if (Main.rand.NextBool()) - dust.scale *= 1f + (float)Main.rand.Next(40) * 0.01f; + blood.scale *= 1f + (float)Main.rand.Next(40) * 0.01f; } } } @@ -1994,8 +2019,8 @@ namespace CalamityMod.CalPlayer // Nimble Bounder bonus if (nimbleBounderBoost) { - Player.moveSpeed += 0.05f; - Player.jumpSpeedBoost += 0.25f; + Player.moveSpeed += NimbleBounder.MoveSpeedBoost; + Player.jumpSpeedBoost += NimbleBounder.JumpSpeedBoost; } // Affliction bonus @@ -2053,9 +2078,9 @@ namespace CalamityMod.CalPlayer Player.velocity.X = 0f; Player.velocity.Y = -0.4f; // Should negate gravity - int ice = Dust.NewDust(Player.position, Player.width, Player.height, DustID.GemSapphire); - Main.dust[ice].noGravity = true; - Main.dust[ice].velocity *= 2f; + Dust ice = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.GemSapphire); + ice.noGravity = true; + ice.velocity *= 2f; Player.buffImmune[BuffID.Frozen] = true; Player.buffImmune[BuffID.Chilled] = true; @@ -2112,10 +2137,6 @@ namespace CalamityMod.CalPlayer } } - // Calcium Potion buff - if (calcium) - Player.noFallDmg = true; - // Ceaseless Hunger Potion buff if (ceaselessHunger) { @@ -2190,7 +2211,6 @@ namespace CalamityMod.CalPlayer lightningVel.Normalize(); lightningVel *= Main.rand.NextFloat(1f, 2f); int damage = (int)Player.GetTotalDamage().ApplyTo(30); - damage = Player.ApplyArmorAccDamageBonusesTo(damage); int projectile = Projectile.NewProjectile(source, Player.Center, lightningVel, ModContent.ProjectileType(), damage, 0, Player.whoAmI, Main.rand.Next(2), 0f); Main.projectile[projectile].timeLeft = Main.rand.Next(180, 240); @@ -2200,10 +2220,10 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < 3; i++) { - int dust = Dust.NewDust(Player.Center, 1, 1, DustID.RedTorch, Player.velocity.X * -0.1f, Player.velocity.Y * -0.1f, 100, default, 3.5f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 1.2f; - Main.dust[dust].velocity.Y -= 0.15f; + Dust dust = Dust.NewDustDirect(Player.Center, 1, 1, DustID.RedTorch, Player.velocity.X * -0.1f, Player.velocity.Y * -0.1f, 100, default, 3.5f); + dust.noGravity = true; + dust.velocity *= 1.2f; + dust.velocity.Y -= 0.15f; } } else if (plaguedFuelPack) @@ -2216,7 +2236,6 @@ namespace CalamityMod.CalPlayer cloudVelocity.Normalize(); cloudVelocity *= Main.rand.NextFloat(0f, 1f); int damage = (int)Player.GetTotalDamage().ApplyTo(20); - damage = Player.ApplyArmorAccDamageBonusesTo(damage); int projectile = Projectile.NewProjectile(source, Player.Center, cloudVelocity, ModContent.ProjectileType(), damage, 0, Player.whoAmI, 0, 0); Main.projectile[projectile].timeLeft = Main.rand.Next(180, 240); @@ -2226,10 +2245,10 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < 3; i++) { - int dust = Dust.NewDust(Player.Center, 1, 1, DustID.GemEmerald, Player.velocity.X * -0.1f, Player.velocity.Y * -0.1f, 100, default, 3.5f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 1.2f; - Main.dust[dust].velocity.Y -= 0.15f; + Dust dust = Dust.NewDustDirect(Player.Center, 1, 1, DustID.GemEmerald, Player.velocity.X * -0.1f, Player.velocity.Y * -0.1f, 100, default, 3.5f); + dust.noGravity = true; + dust.velocity *= 1.2f; + dust.velocity.Y -= 0.15f; } } } @@ -2721,20 +2740,20 @@ namespace CalamityMod.CalPlayer Vector2 source = Vector2.Normalize(Player.velocity) * new Vector2((float)Player.width / 2f, (float)Player.height) * 1f; //0.75 source = source.RotatedBy((double)((float)(d - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + Player.Center; Vector2 dustVel = source - Player.Center; - int blue = Dust.NewDust(source + dustVel, 0, 0, DustID.Vortex, dustVel.X, dustVel.Y, 100, default, 1.2f); - Main.dust[blue].noGravity = true; - Main.dust[blue].noLight = false; - Main.dust[blue].velocity = dustVel; + Dust blue = Dust.NewDustDirect(source + dustVel, 0, 0, DustID.Vortex, dustVel.X, dustVel.Y, 100, default, 1.2f); + blue.noGravity = true; + blue.noLight = false; + blue.velocity = dustVel; } for (int d = 0; d < dustAmt; d++) { Vector2 source = Vector2.Normalize(Player.velocity) * new Vector2((float)Player.width / 2f, (float)Player.height) * 0.75f; source = source.RotatedBy((double)((float)(d - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + Player.Center; Vector2 dustVel = source - Player.Center; - int green = Dust.NewDust(source + dustVel, 0, 0, DustID.TerraBlade, dustVel.X, dustVel.Y, 100, default, 1.2f); - Main.dust[green].noGravity = true; - Main.dust[green].noLight = false; - Main.dust[green].velocity = dustVel; + Dust green = Dust.NewDustDirect(source + dustVel, 0, 0, DustID.TerraBlade, dustVel.X, dustVel.Y, 100, default, 1.2f); + green.noGravity = true; + green.noLight = false; + green.velocity = dustVel; } } auralisAuroraCounter = 0; @@ -2749,7 +2768,7 @@ namespace CalamityMod.CalPlayer if (gravityNormalizer) { Player.buffImmune[BuffID.VortexDebuff] = true; - if (Player.InSpace()) + if (Player.ReducedSpaceGravity()) { Player.gravity = Player.defaultGravity; if (Player.wet) @@ -2800,7 +2819,7 @@ namespace CalamityMod.CalPlayer if (astralInjection) { if (Player.statMana < Player.statManaMax2) - Player.statMana += 2; + Player.statMana += AstralInjection.ManaPerFrame; if (Player.statMana > Player.statManaMax2) Player.statMana = Player.statManaMax2; } @@ -2814,11 +2833,11 @@ namespace CalamityMod.CalPlayer Player.statDefense += 5; } - if (xRage) - Player.GetDamage() += 0.1f; - if (xWrath) - Player.GetCritChance() += 5; + { + Player.GetDamage() += 0.1f; + Player.GetCritChance() += 5; + } if (graxDefense) { @@ -2942,10 +2961,10 @@ namespace CalamityMod.CalPlayer --bloodflareCoreRemainingHealOverTime; } - // 50% movement speed bonus so that you don't feel like a snail in the early game + // Multiplies base movement speed by 1.5x so that you don't feel like a snail in the early game // Disabled while Overhaul is enabled, because Overhaul does very similar things to make movement more snappy if (ExternalMods.overhaul is null && CalamityServerConfig.Instance.FasterBaseSpeed) - Player.moveSpeed += BalancingConstants.DefaultMoveSpeedBoost; + Player.maxRunSpeed *= BalancingConstants.DefaultMoveSpeedBoost; // Reduce how slow Chilled makes the player, because it's cancerous right now // The moveSpeed multiplier for Chilled in vanilla is 0.75, so we just multiply by 1.166667 here to make it 0.875, effectively cutting the reduction in half @@ -2956,38 +2975,38 @@ namespace CalamityMod.CalPlayer Player.moveSpeed -= 0.2f; if (fabsolVodka) - Player.GetDamage() += 0.08f; + Player.GetDamage() += FabsolsVodka.DamageBoost; if (vodka) { - Player.GetDamage() += 0.06f; + Player.GetDamage() += Vodka.DamageBoost; Player.GetCritChance() += Vodka.CritBoost; } if (moonshine) { - Player.statDefense += 10; - Player.endurance += 0.03f; + Player.statDefense += Moonshine.DefenseBoost; + Player.endurance += Moonshine.DamageReductionBoost; } if (rum) - Player.moveSpeed += 0.1f; + Player.moveSpeed += Rum.MoveSpeedBoost; if (whiskey) { - Player.GetDamage() += 0.04f; + Player.GetDamage() += Whiskey.DamageBoost; Player.GetCritChance() += Whiskey.CritBoost; } if (everclear) - Player.GetDamage() += 0.25f; + Player.GetDamage() += Everclear.DamageBoost; if (bloodyMary) { if (Main.bloodMoon) { - Player.GetDamage() += 0.1f; - Player.moveSpeed += 0.1f; + Player.GetDamage() += BloodyMary.DamageMovementBoost; + Player.moveSpeed += BloodyMary.DamageMovementBoost; } } @@ -2995,7 +3014,7 @@ namespace CalamityMod.CalPlayer { if (Main.dayTime) { - Player.statDefense += 5; + Player.statDefense += Tequila.DefenseBoost; Player.GetCritChance() += Tequila.CritBoost; } } @@ -3004,38 +3023,35 @@ namespace CalamityMod.CalPlayer { if (Main.dayTime) { - Player.statDefense += 10; + Player.statDefense += TequilaSunrise.DefenseBoost; Player.GetCritChance() += TequilaSunrise.CritBoost; } } if (caribbeanRum) - Player.moveSpeed += 0.1f; + Player.moveSpeed += CaribbeanRum.MoveSpeedBoost; if (cinnamonRoll) { - Player.manaRegenDelay--; - Player.manaRegenBonus += 10; + Player.manaRegenDelayBonus += CinnamonRoll.ManaRegenDelayBonus; + Player.manaRegenBonus += CinnamonRoll.ManaRegenBonus; } if (starBeamRye) { - Player.GetDamage() += 0.08f; - Player.manaCost *= 0.9f; - Player.statManaMax2 += 50; + Player.GetDamage() += StarBeamRye.MagicDamageBoost; + Player.manaCost *= (1f - StarBeamRye.ManaCostReduction); + Player.statManaMax2 += StarBeamRye.MaxManaBoost; } if (moscowMule) { - Player.GetDamage() += 0.09f; + Player.GetDamage() += MoscowMule.DamageBoost; Player.GetCritChance() += MoscowMule.CritBoost; } - if (oldFashioned) - Player.GetDamage() -= OldFashioned.DamageStatReduction; - if (whiteWine) - Player.GetDamage() += 0.08f; + Player.GetDamage() += WhiteWine.MagicDamageBoost; // Adjustment to the Tipsy debuff if (Player.tipsy) @@ -3092,7 +3108,7 @@ namespace CalamityMod.CalPlayer (reaverSpeed ? 0.1 : 0D) + (angelTreads ? 0.1 : 0D) + (blueCandle ? CirrusBlueCandleBuff.WingTimeBoost : 0D) + - (soaring ? 0.1 : 0D) + + (soaring ? SoaringPotion.FlightBoost : 0D) + (prismaticGreaves ? 0.1 : 0D) + (plagueReaper ? 0.05 : 0D) + (ascendantInsignia ? 0.05 : 0D) + // Added to soaring insignia's flight to get 30% @@ -3113,13 +3129,6 @@ namespace CalamityMod.CalPlayer if (shatteredCommunity) flightTimeMult += 0.2f; - if (profanedCrystalBuffs) - { - bool offenseBuffs = pscState == (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Buffs || (Main.dayTime && !Player.wet) || Player.lavaWet; - if (offenseBuffs || pscState == (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Empowered) - flightTimeMult += 0.1; - } - // Reaver Tank set nuke flight time if (reaverDefense) flightTimeMult -= 0.3f; @@ -3155,9 +3164,8 @@ namespace CalamityMod.CalPlayer if (bounding) { - Player.jumpSpeedBoost += 0.25f; - Player.jumpHeight += 10; - Player.extraFall += 25; + Player.jumpSpeedBoost += BoundingPotion.JumpSpeedBoost; + Player.jumpHeight += (int)(BoundingPotion.JumpHeightPercentBoost * 15); } if (mushy) @@ -3326,15 +3334,13 @@ namespace CalamityMod.CalPlayer { float ai1 = I * 120; - // 08DEC2023: Ozzatron: Bloodflare mines spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. - int baseDamage = Player.ApplyArmorAccDamageBonusesTo(3750); - int damage = Player.CalcIntDamage(baseDamage); + int damage = (int)Player.CalcIntDamage(3750); int projectile = Projectile.NewProjectile(source, Player.Center.X + (float)(Math.Sin(I * 120) * 550), Player.Center.Y + (float)(Math.Cos(I * 120) * 550), 0f, 0f, ModContent.ProjectileType(), damage, 1f, Player.whoAmI, ai1, 0f); if (projectile.WithinBounds(Main.maxProjectiles)) { - Main.projectile[projectile].originalDamage = baseDamage; + Main.projectile[projectile].originalDamage = 3750; Main.projectile[projectile].DamageType = DamageClass.Generic; } } @@ -3350,13 +3356,11 @@ namespace CalamityMod.CalPlayer } if (Player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - // 08DEC2023: Ozzatron: Silva Crystals spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. - int baseDamage = Player.ApplyArmorAccDamageBonusesTo(600); - var damage = (int)Player.GetTotalDamage().ApplyTo(baseDamage); + int damage = (int)Player.GetTotalDamage().ApplyTo(600); var p = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, 0f, -1f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, -20f, 0f); if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = baseDamage; + Main.projectile[p].originalDamage = 600; } } @@ -3397,7 +3401,7 @@ namespace CalamityMod.CalPlayer // If the timer rolls over, it's time to deal damage. Only run this code for the client which is wearing the armor. if (tarraLifeAuraTimer == 0 && Player.whoAmI == Main.myPlayer) { - int damage = Player.ApplyArmorAccDamageBonusesTo(Player.CalcDamage(120)); + int damage = (int)Player.CalcDamage(120); // https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list var source = Player.GetSource_FromThis(TarragonHeadSummon.LifeAuraEntitySourceContext); @@ -3409,7 +3413,7 @@ namespace CalamityMod.CalPlayer continue; if (Vector2.Distance(Player.Center, npc.Center) <= range) - Projectile.NewProjectileDirect(source, npc.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Player.whoAmI, npc.whoAmI); + Projectile.NewProjectile(source, npc.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Player.whoAmI, npc.whoAmI); } } } @@ -3436,7 +3440,7 @@ namespace CalamityMod.CalPlayer continue; if (Vector2.Distance(Player.Center, npc.Center) <= range) - Projectile.NewProjectileDirect(source, npc.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Player.whoAmI, npc.whoAmI); + Projectile.NewProjectile(source, npc.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Player.whoAmI, npc.whoAmI); // Occasionally spawn cute sparks so it looks like an electrical aura if (Main.rand.NextBool(10)) @@ -3462,7 +3466,7 @@ namespace CalamityMod.CalPlayer // Brimstone flames is applied every single frame, but direct damage is only dealt twice per second. if (Player.whoAmI == Main.myPlayer) { - int damage = Player.ApplyArmorAccDamageBonusesTo(Player.GetBestClassDamage().ApplyTo(50)); + int damage = (int)Player.GetBestClassDamage().ApplyTo(50); // https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list var source = Player.GetSource_FromThis(HydrothermicArmor.InfernoPotionEntitySourceContext); @@ -3477,7 +3481,7 @@ namespace CalamityMod.CalPlayer { npc.AddBuff(ModContent.BuffType(), 120); if (brimLoreInfernoTimer == 0) - Projectile.NewProjectileDirect(source, npc.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Player.whoAmI, npc.whoAmI); + Projectile.NewProjectile(source, npc.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Player.whoAmI, npc.whoAmI); } } } @@ -3503,7 +3507,7 @@ namespace CalamityMod.CalPlayer Player.GetDamage() *= 1.2f; if (trippy) - Player.GetDamage() += 0.5f; + Player.GetDamage() += OddMushroom.DamageBoost; if (eArtifact) { @@ -3528,7 +3532,6 @@ namespace CalamityMod.CalPlayer int guardianAmt = 1; float babCheck = profanedCrystal ? 1f : 0f; int babDamage = profanedCrystal ? 346 : 52; - babDamage = Player.ApplyArmorAccDamageBonusesTo(babDamage); if (Player.ownedProjectileCounts[ModContent.ProjectileType()] < guardianAmt) { @@ -3552,38 +3555,44 @@ namespace CalamityMod.CalPlayer } } - if (profanedCrystalBuffs) + if (profanedCrystal) { - if (Player.whoAmI == Main.myPlayer) + ProfanedSoulCrystal.DetermineTransformationEligibility(Player); + var calPlayer = Player.Calamity(); + bool vanity = calPlayer.pscState == (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Vanity; + if (!vanity) { - bool empowered = pscState == (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Empowered; + + bool empowered = calPlayer.pscState == (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Empowered; + bool night = empowered || calPlayer.pscState == (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Enraged; + bool day = empowered || calPlayer.pscState == (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Buffs; + Player.lavaImmune = true; Player.fireWalk = true; - Player.buffImmune[ModContent.BuffType()] = Main.dayTime || empowered; + Player.buffImmune[ModContent.BuffType()] = true; Player.buffImmune[BuffID.OnFire] = true; Player.buffImmune[BuffID.Burning] = true; Player.buffImmune[BuffID.Daybreak] = true; - bool offenseBuffs = (Main.dayTime && !Player.wet) || Player.lavaWet || empowered; - if (offenseBuffs) + + if (Player.wingTimeMax > 0) + Player.wingTimeMax = (int)(Player.wingTimeMax * 1.1D); + Player.GetDamage() += 0.15f; + if (day) { - Player.GetDamage() += 0.15f; Player.GetKnockback() += 0.15f; Player.moveSpeed += 0.1f; - if (!empowered) - Player.statDefense -= 15; Player.ignoreWater = true; Player.GetAttackSpeed(DamageClass.SummonMeleeSpeed) += 1f; //this only ever affects psc whip and should not be problematic } - else if (empowered || !offenseBuffs) + else if (night) { Player.endurance += 0.05f; Player.statDefense += 15; Player.lifeRegen += 5; } - bool enrage = pscState >= (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Enraged; - if (!ZoneAbyss) //No abyss memes. - Lighting.AddLight(Player.Center, enrage ? 1.2f : offenseBuffs ? 1f : 0.2f, enrage ? 0.21f : offenseBuffs ? 0.2f : 0.01f, 0); + if (!calPlayer.ZoneAbyss) //No abyss memes. + Lighting.AddLight(Player.Center, night ? 1.2f : day ? 1f : 0.2f, night ? 0.21f : day ? 0.2f : 0.01f, 0); } } @@ -3626,7 +3635,7 @@ namespace CalamityMod.CalPlayer if (Player.whoAmI == Main.myPlayer) { var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); - int damage = Player.ApplyArmorAccDamageBonusesTo(Player.CalcDamage(30)); + int damage = (int)Player.CalcDamage(30); if (Player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Player.whoAmI, 0f, 0f); @@ -3696,7 +3705,6 @@ namespace CalamityMod.CalPlayer { var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); int damage = (int)Player.GetBestClassDamage().ApplyTo(70); - damage = Player.ApplyArmorAccDamageBonusesTo(damage); if (Player.whoAmI == Main.myPlayer && Player.ownedProjectileCounts[ModContent.ProjectileType()] == 0) Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Player.whoAmI); @@ -3718,7 +3726,6 @@ namespace CalamityMod.CalPlayer { float shootSpeed = 18f; int dmg = (int)Player.GetTotalDamage().ApplyTo(30); - dmg = Player.ApplyArmorAccDamageBonusesTo(dmg); Vector2 startPos = Player.RotatedRelativePoint(Player.MountedCenter, true); Vector2 velocity = Main.MouseWorld - startPos; @@ -3798,10 +3805,10 @@ namespace CalamityMod.CalPlayer Vector2 source = Vector2.Normalize(Player.velocity) * new Vector2(Player.width / 2f, Player.height) * 0.75f; source = source.RotatedBy((dustIndex - (dustAmt / 2 - 1)) * MathHelper.TwoPi / dustAmt, default) + Player.Center; Vector2 dustVel = source - Player.Center; - int dusty = Dust.NewDust(source + dustVel, 0, 0, DustID.RainbowMk2, dustVel.X * 1f, dustVel.Y * 1f, 100, color, 1f); - Main.dust[dusty].noGravity = true; - Main.dust[dusty].noLight = true; - Main.dust[dusty].velocity = dustVel; + Dust dusty = Dust.NewDustDirect(source + dustVel, 0, 0, DustID.RainbowMk2, dustVel.X * 1f, dustVel.Y * 1f, 100, color, 1f); + dusty.noGravity = true; + dusty.noLight = true; + dusty.velocity = dustVel; } } @@ -3944,8 +3951,7 @@ namespace CalamityMod.CalPlayer int numDust = 2; for (int i = 0; i < numDust; i++) { - int dustIndex = Dust.NewDust(Player.position, Player.width, Player.height, DustID.VilePowder, 0f, 0f); - Dust dust = Main.dust[dustIndex]; + Dust dust = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.VilePowder, 0f, 0f); dust.position.X += Main.rand.Next(-5, 6); dust.position.Y += Main.rand.Next(-5, 6); dust.velocity *= 0.2f; @@ -4251,37 +4257,37 @@ namespace CalamityMod.CalPlayer if (fabsolVodka) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.05); + Player.statDefense -= (int)(Player.statDefense * FabsolsVodka.DefenseLossPercent); } if (vodka) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.05); + Player.statDefense -= (int)(Player.statDefense * Vodka.DefenseLossPercent); } if (grapeBeer) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.03); + Player.statDefense -= (int)(Player.statDefense * GrapeBeer.DefenseLossPercent); } if (rum) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.05); + Player.statDefense -= (int)(Player.statDefense * Rum.DefenseLossPercent); } if (whiskey) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.05); + Player.statDefense -= (int)(Player.statDefense * Whiskey.DefenseLossPercent); } if (everclear) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.3); + Player.statDefense -= (int)(Player.statDefense * Everclear.DefenseLossPercent); } if (bloodyMary) @@ -4289,38 +4295,38 @@ namespace CalamityMod.CalPlayer if (Main.bloodMoon) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.04); + Player.statDefense -= (int)(Player.statDefense * BloodyMary.DefenseLossPercent); } } if (caribbeanRum) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.1); + Player.statDefense -= (int)(Player.statDefense * CaribbeanRum.DefenseLossPercent); } if (cinnamonRoll) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.1); + Player.statDefense -= (int)(Player.statDefense * CinnamonRoll.DefenseLossPercent); } if (margarita) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.06); + Player.statDefense -= (int)(Player.statDefense * Margarita.DefenseLossPercent); } if (starBeamRye) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.06); + Player.statDefense -= (int)(Player.statDefense * StarBeamRye.DefenseLossPercent); } if (whiteWine) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.06); + Player.statDefense -= (int)(Player.statDefense * WhiteWine.DefenseLossPercent); } if (Player.tipsy) @@ -4595,7 +4601,7 @@ namespace CalamityMod.CalPlayer if (item.type == ModContent.ItemType()) CalamityUtils.ConsumeItemViaQuickBuff(Player, item, HadalStew.BuffType, HadalStew.BuffDuration, true); if (item.type == ModContent.ItemType()) - CalamityUtils.ConsumeItemViaQuickBuff(Player, item, Margarita.BuffType, Margarita.BuffDuration, false); + CalamityUtils.ConsumeItemViaQuickBuff(Player, item, Margarita.BuffType, CalamityUtils.MinutesToFrames(Margarita.MinuteDuration), false); } } } diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 1517171627..00c96499f5 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -80,6 +80,7 @@ namespace CalamityMod.CalPlayer target.Calamity().IncreasedHeatEffects_CinnamonRoll = cinnamonRoll; target.Calamity().IncreasedHeatEffects_FlameWakerBoots = flameWakerBoots; target.Calamity().IncreasedHeatEffects_HellfireTreads = hellfireTreads; + target.Calamity().IncreasedHeatEffects_FlameWings = flameWingsHeat; target.Calamity().IncreasedSicknessEffects_ToxicHeart = toxicHeart; @@ -87,43 +88,6 @@ namespace CalamityMod.CalPlayer switch (item.type) { - case ItemID.CobaltSword: - target.Calamity().cobaltNerfTimer = CalamityGlobalNPC.cobaltAndMythrilNerfTime; - break; - - case ItemID.PalladiumSword: - if (Player.moonLeech) - return; - Player.lifeRegenTime += 2; - break; - - case ItemID.MythrilSword: - target.Calamity().mythrilNerfTimer = CalamityGlobalNPC.cobaltAndMythrilNerfTime; - break; - - case ItemID.OrichalcumSword: - if (Player.petalTimer > 0) - Player.petalTimer /= 2; - break; - - case ItemID.AdamantiteSword: - float slowDownMult = 0.5f; - if (CalamityLists.enemyImmunityList.Contains(target.type) || target.boss) - slowDownMult = 0.95f; - target.velocity *= slowDownMult; - break; - - case ItemID.CandyCaneSword: - - if (Player.moonLeech || Player.lifeSteal <= 0f || target.lifeMax <= 5) - return; - - int heal = 2; - Player.lifeSteal -= heal; - Player.HealPlayer(heal); - - break; - case ItemID.DeathSickle: target.AddBuff(BuffType(), 120); break; @@ -169,12 +133,14 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffID.OnFire3, 120); } + bool targetIsDummy = target.type == NPCID.TargetDummy || target.type == NPCType(); + ItemLifesteal(target, item, damageDone); - ItemOnHit(item, damageDone, target.Center, hit.Crit, target.IsAnEnemy(false, true)); + ItemOnHit(item, damageDone, target.Center, hit.Crit, target.IsAnEnemy(false, true), targetIsDummy); NPCDebuffs(target, item.CountsAsClass(), item.CountsAsClass(), item.CountsAsClass(), item.CountsAsClass(), item.CountsAsClass(), item.CountsAsClass()); // Shattered Community tracks all damage dealt with Rage Mode (ignoring dummies). - if (target.type == NPCID.TargetDummy || target.type == NPCType()) + if (targetIsDummy) return; if (rageModeActive && shatteredCommunity) @@ -218,6 +184,7 @@ namespace CalamityMod.CalPlayer cgn.IncreasedHeatEffects_Fireball = fireball; cgn.IncreasedHeatEffects_CinnamonRoll = cinnamonRoll; cgn.IncreasedHeatEffects_HellfireTreads = hellfireTreads; + cgn.IncreasedHeatEffects_FlameWings = flameWingsHeat; cgn.IncreasedSicknessEffects_ToxicHeart = toxicHeart; @@ -225,43 +192,6 @@ namespace CalamityMod.CalPlayer switch (proj.type) { - case ProjectileID.CobaltNaginata: - target.Calamity().cobaltNerfTimer = CalamityGlobalNPC.cobaltAndMythrilNerfTime; - break; - - case ProjectileID.PalladiumPike: - if (Player.moonLeech) - return; - Player.lifeRegenTime += 2; - break; - - case ProjectileID.MythrilHalberd: - target.Calamity().mythrilNerfTimer = CalamityGlobalNPC.cobaltAndMythrilNerfTime; - break; - - case ProjectileID.OrichalcumHalberd: - if (Player.petalTimer > 0) - Player.petalTimer /= 2; - break; - - case ProjectileID.AdamantiteGlaive: - float slowDownMult = 0.5f; - if (CalamityLists.enemyImmunityList.Contains(target.type) || target.boss) - slowDownMult = 0.95f; - target.velocity *= slowDownMult; - break; - - case ProjectileID.FruitcakeChakram: - - if (Player.moonLeech || Main.player[Main.myPlayer].lifeSteal <= 0f || target.lifeMax <= 5) - return; - - int heal = 2; - Main.player[Main.myPlayer].lifeSteal -= heal; - Player.HealPlayer(heal); - - break; - case ProjectileID.ObsidianSwordfish: target.AddBuff(BuffID.OnFire3, 180); break; @@ -427,7 +357,8 @@ namespace CalamityMod.CalPlayer int onHitDamage = Player.CalcIntDamage(0.2f * proj.damage); Player.ApplyDamageToNPC(target, onHitDamage, 0f, 0, false); - + Projectile shock = Projectile.NewProjectileDirect(proj.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), onHitDamage, 0f, Player.whoAmI, target.whoAmI); + shock.DamageType = proj.DamageType; SoundStyle hitSound = new("CalamityMod/Sounds/Item/ElectricHit"); SoundEngine.PlaySound(hitSound with { Volume = 0.2f, Pitch = 0.7f, PitchVariance = 0.2f }, proj.Center); } @@ -475,7 +406,8 @@ namespace CalamityMod.CalPlayer } int onHitDamage = Player.CalcIntDamage(0.2f * proj.damage); - Player.ApplyDamageToNPC(target, onHitDamage, 0f, 0, false); + Projectile blast = Projectile.NewProjectileDirect(proj.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), onHitDamage, 0f, Player.whoAmI, target.whoAmI); + blast.DamageType = proj.DamageType; SoundStyle hitSound = new("CalamityMod/Sounds/Item/HadalUrnClose"); SoundEngine.PlaySound(hitSound with { Volume = 0.4f, Pitch = 0.4f, PitchVariance = 0.2f }, proj.Center); @@ -522,12 +454,14 @@ namespace CalamityMod.CalPlayer } } + bool targetIsDummy = target.type == NPCID.TargetDummy || target.type == NPCType(); + ProjLifesteal(target, proj, damageDone, hit.Crit); - ProjOnHit(proj, target.Center, hit.Crit, target.IsAnEnemy(false)); + ProjOnHit(proj, target.Center, hit.Crit, target.IsAnEnemy(false), targetIsDummy); NPCDebuffs(target, proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), true, proj.noEnchantments); // Shattered Community tracks all damage dealt with Rage Mode (ignoring dummies). - if (target.type == NPCID.TargetDummy || target.type == NPCType()) + if (targetIsDummy) return; if (rageModeActive && shatteredCommunity) @@ -537,7 +471,7 @@ namespace CalamityMod.CalPlayer #endregion #region Item - public void ItemOnHit(Item item, int damage, Vector2 position, bool crit, bool npcCheck) + public void ItemOnHit(Item item, int damage, Vector2 position, bool crit, bool npcCheck, bool targetIsDummy) { var source = Player.GetSource_ItemUse(item); if (!item.CountsAsClass() && Player.meleeEnchant == 7) @@ -552,7 +486,6 @@ namespace CalamityMod.CalPlayer { hideOfDeusTimer = 10; int bulwarkStarDamage = (int)Player.GetTotalDamage().ApplyTo(320); - bulwarkStarDamage = Player.ApplyArmorAccDamageBonusesTo(bulwarkStarDamage); for (int n = 0; n < 3; n++) CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 29f, ProjectileType(), bulwarkStarDamage, 5f, Player.whoAmI); @@ -571,7 +504,6 @@ namespace CalamityMod.CalPlayer }); int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(120); - astralStarDamage = Player.ApplyArmorAccDamageBonusesTo(astralStarDamage); Projectile star = CalamityUtils.ProjectileRain(source, position, 400f, 100f, 500f, 800f, 12f, projectileType, astralStarDamage, 5f, Player.whoAmI); if (star.whoAmI.WithinBounds(Main.maxProjectiles)) @@ -588,24 +520,10 @@ namespace CalamityMod.CalPlayer { // Ataxia True Melee Geysers: 15%, softcap starts at 300 base damage int geyserDamage = CalamityUtils.DamageSoftCap(damage * 0.15, 45); - geyserDamage = Player.ApplyArmorAccDamageBonusesTo(geyserDamage); Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType(), geyserDamage, 2f, Player.whoAmI, 0f, 0f); } - if (soaring) - { - double useTimeMultiplier = 0.85 + (item.useTime * item.useAnimation / 3600D); //28 * 28 = 784 is average so that equals 784 / 3600 = 0.217777 + 1 = 21.7% boost - double wingTimeFraction = Player.wingTimeMax / 20D; - // TODO -- this scaling function is probably totally screwed. What is it supposed to do? - double meleeStatMultiplier = (double)(Player.GetTotalDamage().Additive * (float)(Player.GetTotalCritChance() / 10f)); - - if (Player.wingTime < Player.wingTimeMax) - Player.wingTime += (int)(useTimeMultiplier * (wingTimeFraction + meleeStatMultiplier)); - - if (Player.wingTime > Player.wingTimeMax) - Player.wingTime = Player.wingTimeMax; - } if (bloodflareMelee && item.CountsAsClass() && bloodflareMeleeHits < 15 && !bloodflareFrenzy && !Player.HasCooldown(BloodflareFrenzy.ID)) bloodflareMeleeHits++; } @@ -614,7 +532,7 @@ namespace CalamityMod.CalPlayer #endregion #region Proj On Hit - public void ProjOnHit(Projectile proj, Vector2 position, bool crit, bool npcCheck) + public void ProjOnHit(Projectile proj, Vector2 position, bool crit, bool npcCheck, bool targetIsDummy) { CalamityGlobalProjectile modProj = proj.Calamity(); var source = proj.GetSource_FromThis(); @@ -627,7 +545,6 @@ namespace CalamityMod.CalPlayer if (alchFlask && AlchFlaskCooldown == 0 && proj.type != ProjectileType()) { int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(10); - seekerDamage = Player.ApplyArmorAccDamageBonusesTo(seekerDamage); Vector2 seekerVelocity = new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.2f); Projectile bee = Projectile.NewProjectileDirect(source, position, seekerVelocity, ProjectileType(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2); @@ -660,7 +577,6 @@ namespace CalamityMod.CalPlayer }); int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(120); - astralStarDamage = Player.ApplyArmorAccDamageBonusesTo(astralStarDamage); Projectile star = CalamityUtils.ProjectileRain(source, position, 400f, 100f, 500f, 800f, 25f, projectileType, astralStarDamage, 5f, Player.whoAmI); if (star.whoAmI.WithinBounds(Main.maxProjectiles)) @@ -688,13 +604,12 @@ namespace CalamityMod.CalPlayer ursaSergeantCooldown = 300; int ursaSlashdamage = (int)Player.GetBestClassDamage().ApplyTo(200); - ursaSlashdamage = Player.ApplyArmorAccDamageBonusesTo(ursaSlashdamage); Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType(), ursaSlashdamage, 0f, Player.whoAmI); } if (proj.CountsAsClass()) - MeleeOnHit(proj, modProj, position, crit, npcCheck); + MeleeOnHit(proj, modProj, position, crit, npcCheck, targetIsDummy); if (proj.CountsAsClass()) RangedOnHit(proj, modProj, position, crit, npcCheck); if (proj.CountsAsClass()) @@ -706,32 +621,17 @@ namespace CalamityMod.CalPlayer } #region Melee - private void MeleeOnHit(Projectile proj, CalamityGlobalProjectile modProj, Vector2 position, bool crit, bool npcCheck) + private void MeleeOnHit(Projectile proj, CalamityGlobalProjectile modProj, Vector2 position, bool crit, bool npcCheck, bool targetIsDummy) { var source = proj.GetSource_FromThis(); Item heldItem = Player.ActiveItem(); if (proj.IsTrueMelee()) { - if (soaring) - { - double useTimeMultiplier = 0.85 + (heldItem.useTime * heldItem.useAnimation / 3600D); //28 * 28 = 784 is average so that equals 784 / 3600 = 0.217777 + 1 = 21.7% boost - double wingTimeFraction = Player.wingTimeMax / 20D; - - // TODO -- this scaling function is probably totally screwed. What is it supposed to do? - double meleeStatMultiplier = (double)(Player.GetTotalDamage().Additive * (float)(Player.GetTotalCritChance() / 10f)); - - if (Player.wingTime < Player.wingTimeMax) - Player.wingTime += (int)(useTimeMultiplier * (wingTimeFraction + meleeStatMultiplier)); - - if (Player.wingTime > Player.wingTimeMax) - Player.wingTime = Player.wingTimeMax; - } if (hideOfDeus && hideOfDeusTimer == 0) { hideOfDeusTimer = 10; int bulwarkStarDamage = (int)Player.GetTotalDamage().ApplyTo(320); - bulwarkStarDamage = Player.ApplyArmorAccDamageBonusesTo(bulwarkStarDamage); for (int n = 0; n < 3; n++) CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 29f, ProjectileType(), bulwarkStarDamage, 5f, Player.whoAmI); @@ -744,7 +644,6 @@ namespace CalamityMod.CalPlayer { // Ataxia Melee Geysers: 15%, softcap starts at 240 base damage int geyserDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.15, 36); - geyserDamage = Player.ApplyArmorAccDamageBonusesTo(geyserDamage); Projectile.NewProjectile(source, proj.Center, Vector2.Zero, ProjectileType(), geyserDamage, 0f, Player.whoAmI, 0f, 0f); } @@ -767,7 +666,7 @@ namespace CalamityMod.CalPlayer for (int l = 0; l < 2; l++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); - int leafDamage = Player.ApplyArmorAccDamageBonusesTo(0.25f * proj.damage); + int leafDamage = (int)(0.25f * proj.damage); int leaf = Projectile.NewProjectile(source, position, velocity, ProjectileID.Leaf, leafDamage, 0f, Player.whoAmI); if (leaf.WithinBounds(Main.maxProjectiles)) { @@ -780,7 +679,7 @@ namespace CalamityMod.CalPlayer for (int projCount = 0; projCount < 2; projCount++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); - int energyDamage = Player.ApplyArmorAccDamageBonusesTo(0.33f * proj.damage); + int energyDamage = (int)(0.33f * proj.damage); Projectile.NewProjectile(source, proj.Center, velocity, ProjectileType(), energyDamage, 0f, proj.owner); } } @@ -795,7 +694,7 @@ namespace CalamityMod.CalPlayer var source = proj.GetSource_FromThis(); if (ataxiaMage && ataxiaDmg <= 0) { - int orbDamage = Player.ApplyArmorAccDamageBonusesTo(proj.damage * 0.6f); + int orbDamage = (int)(proj.damage * 0.6f); CalamityUtils.SpawnOrb(proj, orbDamage, ProjectileType(), 800f, 20f); int cooldown = (int)(orbDamage * 0.5); @@ -811,7 +710,7 @@ namespace CalamityMod.CalPlayer { bloodflareMageCooldown = 120; // Bloodflare Mage Explosion: 50%, softcap starts at 500 base damage to not overly punish slow weapons - int bloodflareFireballDamage = Player.ApplyArmorAccDamageBonusesTo(CalamityUtils.DamageSoftCap(proj.damage * 0.5, 250)); + int bloodflareFireballDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.5, 250); int fire = Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType(), bloodflareFireballDamage, 0f, Player.whoAmI, 0f, 0f, 1f); if (fire.WithinBounds(Main.maxProjectiles)) @@ -826,7 +725,7 @@ namespace CalamityMod.CalPlayer silvaMageCooldown = 300; SoundEngine.PlaySound(SoundID.Zombie103, proj.Center); //So scuffed, just because zombie sounds werent ported normally // Silva Mage Blasts: 800 + 60%, softcap on the whole combined thing starts at 1400 - int silvaBurstDamage = Player.ApplyArmorAccDamageBonusesTo(CalamityUtils.DamageSoftCap(800.0 + 0.6 * proj.damage, 1400)); + int silvaBurstDamage = CalamityUtils.DamageSoftCap(800.0 + 0.6 * proj.damage, 1400); Projectile.NewProjectile(source, proj.Center, Vector2.Zero, ProjectileType(), silvaBurstDamage, 8f, Player.whoAmI); } } @@ -866,7 +765,6 @@ namespace CalamityMod.CalPlayer if (Player.ownedProjectileCounts[ProjectileType()] < 3 && Main.rand.NextBool(10)) { int damage = (int)Player.GetTotalDamage().ApplyTo(100); - damage = Player.ApplyArmorAccDamageBonusesTo(damage); Projectile.NewProjectile(source, proj.position, proj.velocity, ProjectileType(), damage, 1f, Player.whoAmI); } } @@ -923,28 +821,24 @@ namespace CalamityMod.CalPlayer if (nucleogenesis) { int apparatusDamage = (int)Player.GetTotalDamage().ApplyTo(60); - apparatusDamage = Player.ApplyArmorAccDamageBonusesTo(apparatusDamage); Projectile.NewProjectile(source, proj.Center, Vector2.Zero, ProjectileType(), apparatusDamage, 4f, proj.owner); summonProjCooldown = 100f; } else if (starbusterCore) { int starburstDamage = (int)Player.GetTotalDamage().ApplyTo(40); - starburstDamage = Player.ApplyArmorAccDamageBonusesTo(starburstDamage); Projectile.NewProjectile(source, proj.Center, Vector2.Zero, ProjectileType(), starburstDamage, 3.5f, proj.owner); summonProjCooldown = 60f; } else if (nuclearFuelRod) { int nuclearDamage = (int)Player.GetTotalDamage().ApplyTo(20); - nuclearDamage = Player.ApplyArmorAccDamageBonusesTo(nuclearDamage); Projectile.NewProjectile(source, proj.Center, Vector2.Zero, ProjectileType(), nuclearDamage, 0f, proj.owner); summonProjCooldown = 60f; } else if (jellyChargedBattery) { int batteryDamage = (int)Player.GetTotalDamage().ApplyTo(15); - batteryDamage = Player.ApplyArmorAccDamageBonusesTo(batteryDamage); CalamityUtils.SpawnOrb(proj, batteryDamage, ProjectileType(), 800f, 15f); summonProjCooldown = 60f; } @@ -958,7 +852,6 @@ namespace CalamityMod.CalPlayer Vector2 spawnPosition = position - new Vector2(0f, 920f).RotatedByRandom(0.3f); float speed = Main.rand.NextFloat(17f, 23f); int hallowedDamage = (int)Player.GetTotalDamage().ApplyTo(50); - hallowedDamage = Player.ApplyArmorAccDamageBonusesTo(hallowedDamage); Projectile.NewProjectile(source, spawnPosition, Vector2.Normalize(position - spawnPosition) * speed, ProjectileType(), hallowedDamage, 3f, proj.owner); } } @@ -974,7 +867,6 @@ namespace CalamityMod.CalPlayer if (modProj.stealthStrike && dragonScales && Main.projectile.Count(proj => proj.type == Type && proj.active) < 1) { int damage = (int)Player.GetTotalDamage().ApplyTo(DragonScales.TornadoBaseDamage); - damage = Player.ApplyArmorAccDamageBonusesTo(damage); int projectileIndex = Projectile.NewProjectile(spawnSource, proj.Center.X, proj.Center.Y, 0f, 0f, ProjectileType(), damage, 15f, Main.myPlayer, 10f, 9f); //First overload seems to deal with timing, second is segment amount if (projectileIndex.WithinBounds(Main.maxProjectiles)) Main.projectile[projectileIndex].netUpdate = true; @@ -989,33 +881,33 @@ namespace CalamityMod.CalPlayer { case 0: // Exodus Rogue Stars: 80% - int starDamage = Player.ApplyArmorAccDamageBonusesTo(proj.damage * 0.8f); + int starDamage = (int)(proj.damage * 0.8f); CalamityUtils.SpawnOrb(proj, starDamage, ProjectileType(), 800f, Main.rand.Next(15, 30)); xerocDmg += (int)(starDamage * 0.5f); break; case 1: // Exodus Rogue Orbs: 60% - int orbDamage = Player.ApplyArmorAccDamageBonusesTo(proj.damage * 0.6f); + int orbDamage = (int)(proj.damage * 0.6f); CalamityUtils.SpawnOrb(proj, orbDamage, ProjectileType(), 800f, 30f); xerocDmg += (int)(orbDamage * 0.5f); break; case 2: // Exodus Rogue Fire: 15% - int fireDamage = Player.ApplyArmorAccDamageBonusesTo(proj.damage * 0.15f); + int fireDamage = (int)(proj.damage * 0.15f); Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType(), fireDamage, 0f, proj.owner, 0f, 0f); break; case 3: // Exodus Rogue Blast: 20% - int blastDamage = Player.ApplyArmorAccDamageBonusesTo(proj.damage * 0.2f); + int blastDamage = (int)(proj.damage * 0.2f); Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType(), blastDamage, 0f, proj.owner, 0f, 0f); break; case 4: // Exodus Rogue Bubble: 60% - int bubbleDamage = Player.ApplyArmorAccDamageBonusesTo(proj.damage * 0.6f); + int bubbleDamage = (int)(proj.damage * 0.6f); CalamityUtils.SpawnOrb(proj, bubbleDamage, ProjectileType(), 800f, 15f); xerocDmg += (int)(bubbleDamage * 0.5); break; @@ -1035,14 +927,12 @@ namespace CalamityMod.CalPlayer Vector2 source = new Vector2(position.X + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); Vector2 velocity = (position - source) / 40f; int damage = (int)Player.GetTotalDamage().ApplyTo(120); - damage = Player.ApplyArmorAccDamageBonusesTo(damage); Projectile.NewProjectile(spawnSource, source, velocity, ProjectileType(), damage, 3f, proj.owner); } } else if (moonCrown) { int lunarFlareDamage = (int)Player.GetTotalDamage().ApplyTo(MoonstoneCrown.BaseDamage); - lunarFlareDamage = Player.ApplyArmorAccDamageBonusesTo(lunarFlareDamage); float lunarFlareKB = 3f; for (int i = 0; i < 3; i++) @@ -1064,7 +954,6 @@ namespace CalamityMod.CalPlayer Vector2 velocity = new Vector2(speedX, speedY); int featherDamage = (int)Player.GetTotalDamage().ApplyTo(25); - featherDamage = Player.ApplyArmorAccDamageBonusesTo(featherDamage); int feather = Projectile.NewProjectile(spawnSource, source, velocity, ProjectileType(), featherDamage, 3f, proj.owner); if (feather.WithinBounds(Main.maxProjectiles)) @@ -1087,7 +976,6 @@ namespace CalamityMod.CalPlayer xVector *= 10f; yVector *= 10f; int damage = (int)Player.GetTotalDamage().ApplyTo(40); - damage = Player.ApplyArmorAccDamageBonusesTo(damage); int eater = Projectile.NewProjectile(spawnSource, proj.Center.X, proj.Center.Y, xVector, yVector, ProjectileType(), damage, proj.knockBack, proj.owner); if (eater.WithinBounds(Main.maxProjectiles)) @@ -1099,17 +987,14 @@ namespace CalamityMod.CalPlayer if (titanHeartSet && modProj.stealthStrike && titanCooldown <= 0 && modProj.stealthStrikeHitCount < 3) { int damage = (int)Player.GetTotalDamage().ApplyTo(40); - damage = Player.ApplyArmorAccDamageBonusesTo(damage); Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType(), damage, proj.knockBack, proj.owner, 1f, 0f); SoundEngine.PlaySound(SoundID.Item14, proj.Center); for (int dustexplode = 0; dustexplode < 180; dustexplode++) { - Vector2 dustd = new Vector2(17f, 17f).RotatedBy(MathHelper.ToRadians(dustexplode * 2)); - int d = Dust.NewDust(proj.Center, proj.width, proj.height, Main.rand.NextBool() ? DustType() : DustType(), dustd.X, dustd.Y, 100, default, 1f); - Main.dust[d].noGravity = true; - Main.dust[d].position = proj.Center; - Main.dust[d].velocity *= 0.1f; + Vector2 dustd = Vector2.One.RotatedBy(MathHelper.ToRadians(dustexplode * 2)) * 1.7f; + Dust dust = Dust.NewDustPerfect(proj.Center, Main.rand.NextBool() ? DustType() : DustType(), dustd, Alpha: 100); + dust.noGravity = true; } titanCooldown = 15; } @@ -1137,7 +1022,6 @@ namespace CalamityMod.CalPlayer if (type != -1) { int damage = (int)Player.GetTotalDamage().ApplyTo(22); - damage = Player.ApplyArmorAccDamageBonusesTo(damage); float speed = Main.rand.NextFloat(5f, 11f); int cloud = Projectile.NewProjectile(spawnSource, position, Vector2.One.RotatedByRandom(MathHelper.TwoPi) * speed, type, damage, proj.knockBack, Player.whoAmI); @@ -1148,16 +1032,6 @@ namespace CalamityMod.CalPlayer } } - if (shadow && shadowPotCooldown <= 0 && modProj.stealthStrikeHitCount < 3) - { - int randrot = Main.rand.Next(-30, 391); - Vector2 SoulSpeed = new Vector2(13f, 13f).RotatedBy(MathHelper.ToRadians(randrot)); - int soul = Projectile.NewProjectile(spawnSource, proj.Center, SoulSpeed, ProjectileType(), (int)(proj.damage * 0.1), 3f, proj.owner, 0f, 0f); - if (soul.WithinBounds(Main.maxProjectiles)) - Main.projectile[soul].DamageType = DamageClass.Generic; - shadowPotCooldown = 30; - } - if (raiderTalisman && modProj.stealthStrike) { raiderCritLifespan = CalamityUtils.SecondsToFrames(RaidersTalisman.RaiderCooldown); @@ -1175,7 +1049,6 @@ namespace CalamityMod.CalPlayer { // Umbraphile Rogue Blasts: 20%, softcap starts at 50 base damage int umbraBlastDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.20, 50); - umbraBlastDamage = Player.ApplyArmorAccDamageBonusesTo(umbraBlastDamage); Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType(), umbraBlastDamage, 0f, Player.whoAmI); } @@ -1185,7 +1058,6 @@ namespace CalamityMod.CalPlayer { Vector2 velocity = CalamityUtils.RandomVelocity(50f, 30f, 60f); int damage = (int)Player.GetTotalDamage().ApplyTo(9); - damage = Player.ApplyArmorAccDamageBonusesTo(damage); int spark = Projectile.NewProjectile(spawnSource, position, velocity, ProjectileType(), damage, 0f, Player.whoAmI); if (spark.WithinBounds(Main.maxProjectiles)) diff --git a/CalPlayer/Dashes/AsgardianAegisDash.cs b/CalPlayer/Dashes/AsgardianAegisDash.cs index 162f1275bf..e3797e4f2d 100644 --- a/CalPlayer/Dashes/AsgardianAegisDash.cs +++ b/CalPlayer/Dashes/AsgardianAegisDash.cs @@ -77,14 +77,12 @@ namespace CalamityMod.CalPlayer.Dashes hitContext.PlayerImmunityFrames = AsgardianAegis.ShieldSlamIFrames; // Define damage parameters. - int dashDamage = AsgardianAegis.ShieldSlamDamage; hitContext.damageClass = DamageClass.Melee; - hitContext.BaseDamage = player.ApplyArmorAccDamageBonusesTo(dashDamage); + hitContext.BaseDamage = AsgardianAegis.ShieldSlamDamage; hitContext.BaseKnockback = AsgardianAegis.ShieldSlamKnockback; // On-hit Cosmic Dash Explosion int explosionDamage = (int)player.GetBestClassDamage().ApplyTo(AsgardianAegis.RamExplosionDamage); - explosionDamage = player.ApplyArmorAccDamageBonusesTo(explosionDamage); Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), explosionDamage, AsgardianAegis.RamExplosionKnockback, Main.myPlayer, 3f, 0f); npc.AddBuff(ModContent.BuffType(), 300); } diff --git a/CalPlayer/Dashes/AsgardsValorDash.cs b/CalPlayer/Dashes/AsgardsValorDash.cs index 499d16ebcb..34262feeae 100644 --- a/CalPlayer/Dashes/AsgardsValorDash.cs +++ b/CalPlayer/Dashes/AsgardsValorDash.cs @@ -61,9 +61,8 @@ namespace CalamityMod.CalPlayer.Dashes hitContext.PlayerImmunityFrames = AsgardsValor.ShieldSlamIFrames; // Define damage parameters. - int dashDamage = AsgardsValor.ShieldSlamDamage; hitContext.damageClass = DamageClass.Melee; - hitContext.BaseDamage = player.ApplyArmorAccDamageBonusesTo(dashDamage); + hitContext.BaseDamage = AsgardsValor.ShieldSlamDamage; hitContext.BaseKnockback = AsgardsValor.ShieldSlamKnockback; int Dusts = 12; diff --git a/CalPlayer/Dashes/DeepDiverDash.cs b/CalPlayer/Dashes/DeepDiverDash.cs index 6ec6a025e8..d28627ac48 100644 --- a/CalPlayer/Dashes/DeepDiverDash.cs +++ b/CalPlayer/Dashes/DeepDiverDash.cs @@ -100,9 +100,8 @@ namespace CalamityMod.CalPlayer.Dashes hitContext.PlayerImmunityFrames = DeepDiver.ShieldSlamIFrames; // Define damage parameters. - int dashDamage = DeepDiver.ShieldSlamDamage; hitContext.damageClass = DamageClass.Melee; - hitContext.BaseDamage = player.ApplyArmorAccDamageBonusesTo(dashDamage); + hitContext.BaseDamage = DeepDiver.ShieldSlamDamage; hitContext.BaseKnockback = DeepDiver.ShieldSlamKnockback; } } diff --git a/CalPlayer/Dashes/ElysianAegisDash.cs b/CalPlayer/Dashes/ElysianAegisDash.cs index 4b9c9d6509..7451ed5044 100644 --- a/CalPlayer/Dashes/ElysianAegisDash.cs +++ b/CalPlayer/Dashes/ElysianAegisDash.cs @@ -74,14 +74,12 @@ namespace CalamityMod.CalPlayer.Dashes hitContext.PlayerImmunityFrames = ElysianAegis.ShieldSlamIFrames; // Define damage parameters. - int dashDamage = ElysianAegis.ShieldSlamDamage; hitContext.damageClass = DamageClass.Melee; - hitContext.BaseDamage = player.ApplyArmorAccDamageBonusesTo(dashDamage); + hitContext.BaseDamage = ElysianAegis.ShieldSlamDamage; hitContext.BaseKnockback = ElysianAegis.ShieldSlamKnockback; // On-hit Supreme Holy Explosion int supremeExplosionDamage = (int)player.GetBestClassDamage().ApplyTo(ElysianAegis.RamExplosionDamage); - supremeExplosionDamage = player.ApplyArmorAccDamageBonusesTo(supremeExplosionDamage); Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), supremeExplosionDamage, ElysianAegis.RamExplosionKnockback, Main.myPlayer, 1f, 0f); npc.AddBuff(ModContent.BuffType(), 300); } diff --git a/CalPlayer/Dashes/GodslayerArmorDash.cs b/CalPlayer/Dashes/GodslayerArmorDash.cs index 32828a7ce7..5452bc59ae 100644 --- a/CalPlayer/Dashes/GodslayerArmorDash.cs +++ b/CalPlayer/Dashes/GodslayerArmorDash.cs @@ -140,9 +140,8 @@ namespace CalamityMod.CalPlayer.Dashes hitContext.PlayerImmunityFrames = AsgardianAegis.ShieldSlamIFrames; // Define damage parameters. - int dashDamage = 3000; hitContext.damageClass = player.GetBestClass(); - hitContext.BaseDamage = player.ApplyArmorAccDamageBonusesTo(dashDamage); + hitContext.BaseDamage = 3000; hitContext.BaseKnockback = 15f; // God Slayer Dash intentionally does not use the vanilla function for collision attack iframes. diff --git a/CalPlayer/Dashes/OrnateShieldDash.cs b/CalPlayer/Dashes/OrnateShieldDash.cs index 16da12241f..9c94df600a 100644 --- a/CalPlayer/Dashes/OrnateShieldDash.cs +++ b/CalPlayer/Dashes/OrnateShieldDash.cs @@ -51,9 +51,8 @@ namespace CalamityMod.CalPlayer.Dashes hitContext.PlayerImmunityFrames = OrnateShield.ShieldSlamIFrames; // Define damage parameters. - int dashDamage = OrnateShield.ShieldSlamDamage; hitContext.damageClass = DamageClass.Melee; - hitContext.BaseDamage = player.ApplyArmorAccDamageBonusesTo(dashDamage); + hitContext.BaseDamage = OrnateShield.ShieldSlamDamage; hitContext.BaseKnockback = OrnateShield.ShieldSlamKnockback; npc.AddBuff(BuffID.Frostburn2, 180); //Great, Frostbite is ACTUALLY called Frostburn 2 diff --git a/CalPlayer/Dashes/PlaguebringerArmorDash.cs b/CalPlayer/Dashes/PlaguebringerArmorDash.cs index 82d5619337..df2248ff57 100644 --- a/CalPlayer/Dashes/PlaguebringerArmorDash.cs +++ b/CalPlayer/Dashes/PlaguebringerArmorDash.cs @@ -64,9 +64,8 @@ namespace CalamityMod.CalPlayer.Dashes hitContext.PlayerImmunityFrames = AsgardsValor.ShieldSlamIFrames; // Define damage parameters. - int dashDamage = 50; hitContext.damageClass = DamageClass.Summon; - hitContext.BaseDamage = player.ApplyArmorAccDamageBonusesTo(dashDamage); + hitContext.BaseDamage = 50; hitContext.BaseKnockback = 3f; } } diff --git a/CalPlayer/Dashes/StatisVoidSashDash.cs b/CalPlayer/Dashes/StatisVoidSashDash.cs index 4a09578ad0..e1931be364 100644 --- a/CalPlayer/Dashes/StatisVoidSashDash.cs +++ b/CalPlayer/Dashes/StatisVoidSashDash.cs @@ -41,7 +41,6 @@ namespace CalamityMod.CalPlayer.Dashes if (Main.myPlayer == player.whoAmI && player.Calamity().statisTimer % 5 == 0) { int scytheDamage = (int)player.GetBestClassDamage().ApplyTo(250); - scytheDamage = player.ApplyArmorAccDamageBonusesTo(scytheDamage); int scythe = Projectile.NewProjectile(player.GetSource_FromAI(), player.Center, player.velocity.RotatedBy(player.direction * (AngleSwap ? 30 : -30), default) * 0.1f - player.velocity / 2f, ModContent.ProjectileType(), scytheDamage, 5f, player.whoAmI); ; if (scythe.WithinBounds(Main.maxProjectiles)) diff --git a/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs b/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs index 184274f3b4..b49e6f1f4a 100644 --- a/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs +++ b/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs @@ -68,6 +68,8 @@ namespace CalamityMod.CalPlayer.DrawLayers glowMask = ModContent.Request("CalamityMod/Items/Weapons/Magic/FatesRevealGlow").Value; else if (itemType == ModContent.ItemType()) glowMask = ModContent.Request("CalamityMod/Items/Weapons/Melee/GreatswordofJudgementGlow").Value; + else if (itemType == ModContent.ItemType()) + glowMask = ModContent.Request("CalamityMod/Items/Weapons/Melee/GalactusBladeGlow").Value; else if (itemType == ModContent.ItemType()) glowMask = ModContent.Request("CalamityMod/Items/Weapons/Summon/LegionofCelestiaGlow").Value; else if (itemType == ModContent.ItemType()) diff --git a/CalamityLists.cs b/CalamityLists.cs index 857b88d06f..14931c33cf 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -1,17 +1,20 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; +using CalamityMod.BiomeManagers; using CalamityMod.Buffs; using CalamityMod.Buffs.Alcohol; using CalamityMod.Buffs.Cooldowns; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.Potions; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Enums; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.DraedonMisc; using CalamityMod.Items.Fishing.FishingRods; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.Tools; using CalamityMod.Items.TreasureBags; @@ -61,7 +64,6 @@ using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.NPCs.Yharon; using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.DraedonsArsenal; -using CalamityMod.Projectiles.Enemy; using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Melee.MaceFlails; @@ -157,6 +159,11 @@ namespace CalamityMod public static List VeneratedLocketBanlist; //To ban projectiles from locket, mainly spikeballs altho Toasty asked me to add mod calls for adding stuff like Dreamtastic + /// + /// Each Sunken Sea subbiome has a correspoding spawn condition boolean value and a biome type. + /// + public static SortedDictionary SpawnCondition, int BiomeType)> SunkenSeaBiomeCorrespondentValues { get; private set; } + public override void OnModLoad() { donatorList = new List() @@ -1956,6 +1963,7 @@ namespace CalamityMod ProjectileID.NettleBurstEnd, ProjectileID.NettleBurstLeft, ProjectileID.NettleBurstRight, + ProjectileID.PrincessWeapon, ProjectileType(), ProjectileType(), ProjectileType(), @@ -2713,6 +2721,16 @@ namespace CalamityMod ItemType(), ItemType() }; + + SunkenSeaBiomeCorrespondentValues = new() + { + { SunkenSeaBiomeFlags.UndergroundDesert, (spawnInfo => spawnInfo.Player.ZoneDesert, -1 /* None needed. */) }, + { SunkenSeaBiomeFlags.TimelessShores, (spawnInfo => spawnInfo.Player.Calamity().ZoneTimelessShores, GetInstance().Type) }, + { SunkenSeaBiomeFlags.RadiantReefs, (spawnInfo => spawnInfo.Player.Calamity().ZoneRadiantReefs, GetInstance().Type) }, + { SunkenSeaBiomeFlags.PolypForest, (spawnInfo => spawnInfo.Player.Calamity().ZonePolypForest, GetInstance().Type) }, + { SunkenSeaBiomeFlags.GleamingBurrows, (spawnInfo => spawnInfo.Player.Calamity().ZoneGleamingBurrows, GetInstance().Type) }, + { SunkenSeaBiomeFlags.BasaltGully, (spawnInfo => spawnInfo.Player.Calamity().ZoneBasaltGully, GetInstance().Type) }, + }; } public override void Unload() @@ -2794,6 +2812,8 @@ namespace CalamityMod DisabledSummonerNerfMinions = null; VeneratedLocketBanlist = null; + + SunkenSeaBiomeCorrespondentValues = null; } } } diff --git a/Cooldowns/OmegaBlue.cs b/Cooldowns/OmegaBlue.cs index 179509e020..6399514371 100644 --- a/Cooldowns/OmegaBlue.cs +++ b/Cooldowns/OmegaBlue.cs @@ -27,11 +27,11 @@ namespace CalamityMod.Cooldowns { for (int i = 0; i < 66; i++) { - int d = Dust.NewDust(instance.player.position, instance.player.width, instance.player.height, DustID.PurificationPowder, 0, 0, 100, Color.Transparent, 2.6f); - Main.dust[d].noGravity = true; - Main.dust[d].noLight = true; - Main.dust[d].fadeIn = 1f; - Main.dust[d].velocity *= 6.6f; + Dust dust = Dust.NewDustDirect(instance.player.position, instance.player.width, instance.player.height, DustID.PurificationPowder, 0, 0, 100, Color.Transparent, 2.6f); + dust.noGravity = true; + dust.noLight = true; + dust.fadeIn = 1f; + dust.velocity *= 6.6f; } } diff --git a/Cooldowns/PlagueBlackout.cs b/Cooldowns/PlagueBlackout.cs index e63253123b..824b240000 100644 --- a/Cooldowns/PlagueBlackout.cs +++ b/Cooldowns/PlagueBlackout.cs @@ -28,9 +28,9 @@ namespace CalamityMod.Cooldowns int h = instance.player.height; for (int i = 0; i < 66; i++) { - int d = Dust.NewDust(pos, w, h, DustID.GemEmerald, 0, 0, 100, default, 1.5f); - Main.dust[d].noGravity = true; - Main.dust[d].velocity *= 6.6f; + Dust dust = Dust.NewDustDirect(pos, w, h, DustID.GemEmerald, 0, 0, 100, default, 1.5f); + dust.noGravity = true; + dust.velocity *= 6.6f; } } diff --git a/DataStructures/GemTechArmorState.cs b/DataStructures/GemTechArmorState.cs index 8cdc3cc0d4..9ec1260c35 100644 --- a/DataStructures/GemTechArmorState.cs +++ b/DataStructures/GemTechArmorState.cs @@ -149,7 +149,6 @@ namespace CalamityMod.DataStructures return; int damage = (int)Owner.GetTotalDamage().ApplyTo(GemTechHeadgear.MeleeShardBaseDamage); - damage = Owner.ApplyArmorAccDamageBonusesTo(damage); for (int i = 0; i < 14; i++) { @@ -167,7 +166,6 @@ namespace CalamityMod.DataStructures return; int damage = CalamityUtils.DamageSoftCap((int)(hitDamage * 0.32f), 400); - damage = Owner.ApplyArmorAccDamageBonusesTo(damage); Vector2 spawnPosition = Owner.Center + Main.rand.NextVector2Circular(Owner.width, Owner.height) * 1.35f; Vector2 shootVelocity = (target.Center - spawnPosition) * 0.04f; @@ -277,7 +275,6 @@ namespace CalamityMod.DataStructures // Softcap the damage. This is done primarily to dampen stealth interactions. gemDamage = CalamityUtils.DamageSoftCap(gemDamage, GemTechHeadgear.GemDamageSoftcapThreshold); - gemDamage = Owner.ApplyArmorAccDamageBonusesTo(gemDamage); if (Main.myPlayer == OwnerIndex) Projectile.NewProjectile(Owner.GetSource_ItemUse(Owner.ActiveItem()), gemPosition, Vector2.Zero, ModContent.ProjectileType(), gemDamage, 0f, OwnerIndex, 0f, (int)GemThatShouldBeLost); diff --git a/Enums/SunkenSeaBiomeFlags.cs b/Enums/SunkenSeaBiomeFlags.cs new file mode 100644 index 0000000000..60de02c354 --- /dev/null +++ b/Enums/SunkenSeaBiomeFlags.cs @@ -0,0 +1,19 @@ +using System; + +namespace CalamityMod.Enums +{ + /// + /// The flags corresponding for the possible spawns for a Sunken Sea NPC. + /// + [Flags] + public enum SunkenSeaBiomeFlags : byte + { + None = 0, + UndergroundDesert = 1, + TimelessShores = 2, + RadiantReefs = 4, + PolypForest = 8, + GleamingBurrows = 16, + BasaltGully = 32, + } +} diff --git a/Enums/VanillaWingID.cs b/Enums/VanillaWingID.cs index d6951d0d70..1604736eea 100644 --- a/Enums/VanillaWingID.cs +++ b/Enums/VanillaWingID.cs @@ -2,57 +2,51 @@ { public enum VanillaWingID { - FledglingWings = 46, - // Early HM Wings DemonWings = 1, AngelWings = 2, - FairyWings = 6, - FinWings = 25, - // Post-Mech Wings + RedsWings = 3, Jetpack = 4, ButterflyWings = 5, + FairyWings = 6, HarpyWings = 7, + BoneWings = 8, FlameWings = 9, FrozenWings = 10, + SpectreWings = 11, + SteampunkWings = 12, + LeafWings = 13, BatWings = 14, BeeWings = 15, - // Post-Plantera Wings - BoneWings = 8, - SpectreWings = 11, - LeafWings = 13, - Hoverboard = 22, - MothronWings = 27, - // Post-Golem Wings - BeetleWings = 24, - SteampunkWings = 12, - TatteredFairyWings = 20, - SpookyWings = 21, - FestiveWings = 23, - FishronWings = 26, - RainbowWings = 44, // Empress Wings - BetsyWings = 37, - // Post-Moon Lord Wings - WingsSolar = 29, - WingsNebula = 30, - WingsVortex = 31, - WingsStardust = 32, - LongRainbowTrailWings = 45, // Celestial Starboard - // Dev Wings - RedsWings = 3, DTownsWings = 16, WillsWings = 17, CrownosWings = 18, CenxsWings = 19, + TatteredFairyWings = 20, + SpookyWings = 21, + Hoverboard = 22, + FestiveWings = 23, + BeetleWings = 24, + FinWings = 25, + FishronWings = 26, + MothronWings = 27, BejeweledValkyrieWing = 28, // Lazure's Barrier Platform + WingsSolar = 29, + WingsVortex = 30, + WingsNebula = 31, + WingsStardust = 32, Yoraiz0rWings = 33, // Yoraiz0r's Spell JimsWings = 34, SkiphsWings = 35, LokisWings = 36, + BetsyWings = 37, ArkhalisWings = 38, LeinforsWings = 39, GhostarsWings = 40, SafemanWings = 41, FoodBarbarianWings = 42, GroxTheGreatWings = 43, + RainbowWings = 44, // Empress Wings + LongRainbowTrailWings = 45, // Celestial Starboard + FledglingWings = 46, } } diff --git a/ExtraJumps/SulphurJump.cs b/ExtraJumps/SulphurJump.cs index 4c0866b529..eef2cbb6c1 100644 --- a/ExtraJumps/SulphurJump.cs +++ b/ExtraJumps/SulphurJump.cs @@ -47,7 +47,6 @@ namespace CalamityMod.ExtraJumps { var source = player.GetSource_Misc("0"); int damage = (int)player.GetTotalDamage().ApplyTo(20); - damage = player.ApplyArmorAccDamageBonusesTo(damage); int bubble = Projectile.NewProjectile(source, new Vector2(player.position.X, player.position.Y + (player.gravDir == -1f ? 20 : -20)), Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI, 1f, 0f); if (bubble.WithinBounds(Main.maxProjectiles)) diff --git a/ExtraTextures/ExtraTextureRefs.cs b/ExtraTextures/ExtraTextureRefs.cs index 724db66b6e..aaf5d76299 100644 --- a/ExtraTextures/ExtraTextureRefs.cs +++ b/ExtraTextures/ExtraTextureRefs.cs @@ -7,6 +7,7 @@ using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; using Terraria.GameContent; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.ExtraTextures @@ -32,6 +33,11 @@ namespace CalamityMod.ExtraTextures public static Asset FlyingCarpetVanilla; public static Asset FlyingCarpetAuric; + // Lucky Buff icon replacements + public static Asset LuckIconGreater; + public static Asset LuckIconVanilla; + public static Asset LuckIconLesser; + // Boss Heads // I know it's not exactly a Texture2D but it belongs to ExtraTextures. public static int BossHeadIndex_ChadPrime; @@ -60,6 +66,10 @@ namespace CalamityMod.ExtraTextures FlyingCarpetVanilla = TextureAssets.FlyingCarpet; FlyingCarpetAuric = ModContent.Request("CalamityMod/ExtraTextures/AuricCarpet", AssetRequestMode.AsyncLoad); + + LuckIconGreater = ModContent.Request("CalamityMod/ExtraTextures/VanillaBuffs/LuckyGreater", AssetRequestMode.AsyncLoad); + LuckIconVanilla = TextureAssets.Buff[BuffID.Lucky]; + LuckIconLesser = ModContent.Request("CalamityMod/ExtraTextures/VanillaBuffs/LuckyLesser", AssetRequestMode.AsyncLoad); } public override void Unload() @@ -67,6 +77,7 @@ namespace CalamityMod.ExtraTextures if (!Main.dedServ) { TextureAssets.FlyingCarpet = FlyingCarpetVanilla; + TextureAssets.Buff[BuffID.Lucky] = LuckIconVanilla; } } } diff --git a/ExtraTextures/VanillaBuffs/LuckyGreater.png b/ExtraTextures/VanillaBuffs/LuckyGreater.png new file mode 100644 index 0000000000..76441d55cd Binary files /dev/null and b/ExtraTextures/VanillaBuffs/LuckyGreater.png differ diff --git a/ExtraTextures/VanillaBuffs/LuckyLesser.png b/ExtraTextures/VanillaBuffs/LuckyLesser.png new file mode 100644 index 0000000000..95ed2f505f Binary files /dev/null and b/ExtraTextures/VanillaBuffs/LuckyLesser.png differ diff --git a/Fonts/CodebreakerDialog.xnb b/Fonts/CodebreakerDialog.xnb index 910e2e5761..eef588aef5 100644 Binary files a/Fonts/CodebreakerDialog.xnb and b/Fonts/CodebreakerDialog.xnb differ diff --git a/Graphics/Renderers/CalamityRenderers/MiracleBlightRenderer.cs b/Graphics/Renderers/CalamityRenderers/MiracleBlightRenderer.cs index 802e15b113..98871deb15 100644 --- a/Graphics/Renderers/CalamityRenderers/MiracleBlightRenderer.cs +++ b/Graphics/Renderers/CalamityRenderers/MiracleBlightRenderer.cs @@ -60,24 +60,7 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers if (!npc.active || npc.type <= NPCID.None) return false; - // Do not draw other mod's bosses. - if (npc.ModNPC != null && npc.ModNPC.Mod != CalamityMod.Instance && npc.boss) - return false; - - // Don't draw excluded NPCs, or if the npc is a bestiary dummy. - if (ExcludedNPCs.Contains(npc.type) || npc.IsABestiaryIconDummy) - return false; - - // Safety check for weird MP bug when getting global npcs. - if (!npc.TryGetGlobalNPCSafer(out var calNPC) || !npc.TryGetGlobalNPCSafer(out var polNPC)) - return false; - - // Do not draw if the npc does not have miracle blight, or has the polarity effect. - if (calNPC.miracleBlight <= 0 || polNPC.CurPolarity > 0f) - return false; - - // Do not draw if the current player has the trippy effect. - if (Main.LocalPlayer.Calamity().trippy) + if (!CalamityDrawParameterNPC.DrawingMiracleBlight[npc.whoAmI]) return false; return true; diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index 3162a2dc91..28c43cb7d7 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Balancing; +using CalamityMod.Enums; using Mono.Cecil.Cil; using MonoMod.Cil; using Terraria; @@ -437,7 +438,7 @@ namespace CalamityMod.ILEditing #endregion #region Damage Variance Dampening and Luck Removal - private static int AdjustDamageVariance(Terraria.On_Main.orig_DamageVar_float_int_float orig, float dmg, int percent, float luck) + private static int AdjustDamageVariance(On_Main.orig_DamageVar_float_int_float orig, float dmg, int percent, float luck) { // Change the default damage variance from +-15% to +-5%. // If other mods decide to change the scale, they can override this. We're solely killing the default value. @@ -566,6 +567,21 @@ namespace CalamityMod.ILEditing } #endregion + #region Vortex Booster Keeps Vortex Stealth When Dashing + private static void VortexBoosterKeepsVortexStealthWhenDashing(On_Player.orig_DashMovement orig, Player self) + { + // Allows for Vortex Booster to keep Vortex armor's stealth when dashing + bool vortexStealth = self.vortexStealthActive; + orig(self); + + if (self.wingsLogic == (int)VanillaWingID.WingsVortex) + { + if (vortexStealth && !self.vortexStealthActive) + self.vortexStealthActive = true; + } + } + #endregion + #region Nebula Armor Nerfs private static void NerfNebulaArmorBaseLifeRegenAndDamage(ILContext il) { @@ -645,6 +661,54 @@ namespace CalamityMod.ILEditing } #endregion + #region Stardust Guardian Buffs + private static void StardustGuardianAttackBuffs(ILContext il) + { + // Increase the Stardust Guardian's attack range while wearing Stardust Wings. + var cursor = new ILCursor(il); + + // Move to the label after the instruction that sets num3 to 500f. + for (int i = 0; i < 2; i++) + { + if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchLdcR4(100f))) + { + LogFailure("Stardust Guardian Buffs", "Could not move to after the Stardust Guardian's attack range."); + return; + } + } + + // Define a label for the branch statement. + var label = il.DefineLabel(); + + // Load Player.wingsLogic, and check if it's Stardust Wings. + // If it is, increase the two attack range variables. + cursor.Emit(OpCodes.Ldloc_0); + cursor.Emit(OpCodes.Ldfld, typeof(Player).GetField("wingsLogic")); + cursor.Emit(OpCodes.Ldc_I4, (int)VanillaWingID.WingsStardust); + cursor.Emit(OpCodes.Bne_Un, label); + + cursor.Emit(OpCodes.Ldc_R4, 900f); + cursor.Emit(OpCodes.Stloc, 4); + cursor.Emit(OpCodes.Ldc_R4, 900f); + cursor.Emit(OpCodes.Stloc, 5); + + cursor.MarkLabel(label); + + // Now, increase the Stardust Guardian's move speed when attacking targets. + // This is applied regardless of having Stardust Wings. + // This jumps to the base speed value when moving towards a target. + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdcR4(6f))) + { + LogFailure("Stardust Guardian Buffs", "Could not locate the Stardust Guardian's attack move speed."); + return; + } + + // Remove and replace with a higher value. + cursor.EmitPop(); + cursor.Emit(OpCodes.Ldc_R4, 12f); + } + #endregion + #region Remove Melee Armor (Beetle Shell + Solar Flare) Multiplicative DR private static void RemoveBeetleAndSolarFlareMultiplicativeDR(ILContext il) { diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 970fbe41bd..e40c1c10e1 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -70,13 +70,15 @@ namespace CalamityMod.ILEditing IL_Player.ApplyEquipFunctional += ScopesRequireVisibilityToZoom; IL_Player.Hurt_PlayerDeathReason_int_int_refHurtInfo_bool_bool_int_bool_float_float_float += DodgeMechanicAdjustments; IL_Player.DashMovement += FixAllDashMechanics; + On_Player.DashMovement += VortexBoosterKeepsVortexStealthWhenDashing; On_Player.DoCommonDashHandle += ApplyDashKeybind; IL_Player.GiveImmuneTimeForCollisionAttack += MakeShieldSlamIFramesConsistent; IL_Player.Update_NPCCollision += NerfShieldOfCthulhuBonkSafety; On_WorldGen.OpenDoor += OpenDoor_LabDoorOverride; On_WorldGen.CloseDoor += CloseDoor_LabDoorOverride; On_Item.AffixName += IncorporateEnchantmentInAffix; - On_Projectile.NewProjectile_IEntitySource_float_float_float_float_int_int_float_int_float_float_float += IncorporateMinionExplodingCountdown; + On_Projectile.NewProjectile_IEntitySource_float_float_float_float_int_int_float_int_float_float_float += IncorporateExtraProjectileVariables; + On_Player.ApplyDamageToNPC += ApplyOldFashionedDamageToMiscHits; // TODO -- This should be unnecessary. There is now a TML hook for platform collision for ModNPCs. On_NPC.Collision_DecideFallThroughPlatforms += EnableCalamityBossPlatformCollision; IL_Wiring.HitWireSingle += AddTwinklersToStatue; @@ -143,6 +145,7 @@ namespace CalamityMod.ILEditing IL_NPC.ScaleStats_ApplyExpertTweaks += RemoveExpertHardmodeScaling; IL_Projectile.Damage += ReduceEoWGrenadeResist; IL_Projectile.AI_099_2 += LimitTerrarianProjectiles; + IL_Projectile.AI_120_StardustGuardian += StardustGuardianAttackBuffs; IL_Player.UpdateBuffs += NerfSharpeningStation; IL_Player.UpdateBuffs += NerfBeetleScaleMail; IL_Player.UpdateBuffs += NerfNebulaArmorBaseLifeRegenAndDamage; @@ -205,6 +208,7 @@ namespace CalamityMod.ILEditing IL_Player.TileInteractionsUse += RemovePowerCellPlanteraLock; On_Player.ItemCheck_CheckCanUse += RemoveCelestialSigilUseLock; On_Player.ItemCheck_UseEventItems += ApplyCelestialSigilChanges; + IL_Main.DrawInfoAccs += RemoveDamageConditionFromRadar; // Fix vanilla bugs exposed by Calamity mechanics IL_NPC.NPCLoot += FixSplittingWormBannerDrops; diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 3802c9688b..967ef97e33 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -11,6 +11,7 @@ using CalamityMod.Events; using CalamityMod.FluidSimulation; using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; +using CalamityMod.Items.Armor.Wulfrum; using CalamityMod.Items.Dyes; using CalamityMod.Items.Placeables.FurniturePlagued; using CalamityMod.Items.Potions.Alcohol; @@ -308,16 +309,14 @@ namespace CalamityMod.ILEditing dir = self.direction; dashing = true; - if (self.dashTime > 0) - self.dashTime--; - if (self.dashTime < 0) - self.dashTime++; - if ((self.dashTime <= 0 && self.direction == -1) || (self.dashTime >= 0 && self.direction == 1)) + // CIT 16OCT2024: Commented this code out, as there's no reason for custom dash hotkey to use Player.dashTime + // and was causing the return of Celestial Starboard's dash bug from early 1.4 versions + /*if ((self.dashTime <= 0 && self.direction == -1) || (self.dashTime >= 0 && self.direction == 1)) { self.dashTime = 15; return; - } + }*/ dashing = true; self.dashTime = 0; @@ -332,6 +331,7 @@ namespace CalamityMod.ILEditing { dir = 1; dashing = false; + self.dashTime = 0; } } #endregion @@ -540,32 +540,80 @@ namespace CalamityMod.ILEditing } #endregion - #region Hellbound Enchantment Projectile Creation Effects - private static int IncorporateMinionExplodingCountdown(Terraria.On_Projectile.orig_NewProjectile_IEntitySource_float_float_float_float_int_int_float_int_float_float_float orig, IEntitySource spawnSource, float x, float y, float xSpeed, float ySpeed, int type, int damage, float knockback, int owner, float ai0, float ai1, float ai2) + #region Apply Projectile Variables Upon Creation + private static int IncorporateExtraProjectileVariables(Terraria.On_Projectile.orig_NewProjectile_IEntitySource_float_float_float_float_int_int_float_int_float_float_float orig, IEntitySource spawnSource, float x, float y, float xSpeed, float ySpeed, int type, int damage, float knockback, int owner, float ai0, float ai1, float ai2) { // This is unfortunately not something that can be done via SetDefaults since owner is set // after that method is called. Doing it directly when the projectile is spawned appears to be the only reasonable way. int proj = orig(spawnSource, x, y, xSpeed, ySpeed, type, damage, knockback, owner, ai0, ai1, ai2); Projectile projectile = Main.projectile[proj]; - if (projectile.minion) + + Player player = Main.player[projectile.owner]; + if (Main.gameMenu || !player.active) + return proj; + + // Old Fashioned + if (spawnSource is EntitySource_Parent parentSource) { - Player player = Main.player[projectile.owner]; - if (Main.gameMenu || !player.active) - return proj; + // Parent-spawned projectiles involve 5 relevant sources: Buff, Item, NPC, Player, Projectile + // 1. Buffs: Old Fashioned inherently does not affect them, they have no effect - // Do not apply Hellbound effects to minions not spawned by the item itself, if it came out of an item - // This prevent minions like Luxor's Gift getting it, but minions spawned out of minions such as Temporal Umbrella will work fine - if (spawnSource is EntitySource_ItemUse && player.ActiveItem().shoot != projectile.type) - return proj; + /* 2. Item: If detected to be from weapons, are assumedly debuffed + *The criteria includes: A. has damage, B. has use animation, and C. came out of an item + *This rules out items such as Bombs or Shield of Cthulhu (hypothetically were it to spawn projectiles) + *This source is *not* from item use, but is still used for a multitude of purposes in weapons */ + if (parentSource.Entity is Item item && item.damage > 0 && item.useAnimation > 0) + projectile.Calamity().buffedByOldFashioned = false; + // 3. NPCs: Not considered at all; no effect + + // 4. Players: Only considered if the source owner matches the projectile's, otherwise no effect + else if (parentSource.Entity is Player parentPlayer && parentPlayer.whoAmI == projectile.owner) + { + // 4A. The primary player-based source is item use, which follows the same logic as items (see above) + // Edge case: Wulfrum Fusion Cannon is coded like a weapon. There may be a better way to approach this but an exclusion works for now + if (spawnSource is EntitySource_ItemUse itemSource && itemSource.Item is Item usedItem + && usedItem.damage > 0 && usedItem.useAnimation > 0 && usedItem.type != ModContent.ItemType()) + projectile.Calamity().buffedByOldFashioned = false; + // 4B. Every non item-use source is assumed safe to buff + else + projectile.Calamity().buffedByOldFashioned = true; + } + + // 5. Projectiles: Directly inherited by its parent projectile + else if (parentSource.Entity is Projectile parentProj) + projectile.Calamity().buffedByOldFashioned = parentProj.Calamity().buffedByOldFashioned; + } + + // Hellbound Enchantment + // This only applies to minions spawned by weapon uses, preventing other minions such as Luxor's Gift from exploding + if (projectile.minion && spawnSource is EntitySource_ItemUse useSource && useSource.Item is Item weapon && weapon.useAnimation > 0) + { CalamityPlayer.EnchantHeldItemEffects(player, player.Calamity(), player.ActiveItem()); if (player.Calamity().explosiveMinionsEnchant) projectile.Calamity().ExplosiveEnchantCountdown = CalamityGlobalProjectile.ExplosiveEnchantTime; } + // Minion shots inherit the "explode countdown" from the parent minion + // This is only to inherit the damage scaling of the minion and does NOT mean the shot will explode too + else if (ProjectileID.Sets.MinionShot[projectile.type]) + { + // Going down the chain + if (spawnSource is EntitySource_Parent trueSource && trueSource.Entity is Projectile parent) + projectile.Calamity().ExplosiveEnchantCountdown = parent.Calamity().ExplosiveEnchantCountdown; + } return proj; } #endregion + #region Apply Old Fashioned Damage to Miscellanous Hits + private static void ApplyOldFashionedDamageToMiscHits(Terraria.On_Player.orig_ApplyDamageToNPC orig, Player self, NPC npc, int damage, float knockback, int direction, bool crit = false, DamageClass? damageType = null, bool damageVariation = false) + { + if (self.Calamity().oldFashioned) + damage = (int)(damage * OldFashioned.DamageBoostMultiplier); + orig(self, npc, damage, knockback, direction, crit, damageType, damageVariation); + } + #endregion + #region Chaos Stone and Chalice of the Blood God private static void ManaSicknessAndChaliceBufferHeal(ILContext il) { @@ -1889,8 +1937,8 @@ namespace CalamityMod.ILEditing drawColor = glowMaskTile.GlowMaskPaintInteraction switch { - GlowMaskTile.PaintColorTint.OnlyByDeepPaint => GlowMaskTile.ApplyPaint(colType, drawColor, deepPaintOnly: true), - GlowMaskTile.PaintColorTint.ByEveryPaint => GlowMaskTile.ApplyPaint(colType, drawColor, deepPaintOnly: false), + GlowMaskTile.PaintColorTint.OnlyByDeepPaint => CalamityUtils.ApplyPaint(colType, drawColor, deepPaintOnly: true), + GlowMaskTile.PaintColorTint.ByEveryPaint => CalamityUtils.ApplyPaint(colType, drawColor, deepPaintOnly: false), _ => drawColor }; diff --git a/ILEditing/VanillaStupidityFixingILChanges.cs b/ILEditing/VanillaStupidityFixingILChanges.cs index 2f71ef7703..dcc3046b3b 100644 --- a/ILEditing/VanillaStupidityFixingILChanges.cs +++ b/ILEditing/VanillaStupidityFixingILChanges.cs @@ -1103,6 +1103,33 @@ namespace CalamityMod.ILEditing } #endregion + #region Remove NPC.damage Condition from Radar + private static void RemoveDamageConditionFromRadar(ILContext il) + { + var cursor = new ILCursor(il); + + Func[] searchFor = + [ + (x => x.MatchLdfld(nameof(NPC.damage))), + (x => x.MatchLdcI4(out var comp) && comp == 0), + (x => x.MatchBle(out _)) //ble.s + ]; + + if (!cursor.TryGotoNext(MoveType.After, searchFor)) + { + LogFailure("Radar Condition", "Unable to locate condition for NPC.damage > 0"); + return; + } + + // branch is used for exit condition. So setting ble.s opcode to nop will remove the condition + cursor.Prev.OpCode = OpCodes.Nop; + + // After that we pop NPC.damage and 0 from stack + cursor.EmitPop(); + cursor.EmitPop(); + } + #endregion + // 02JUN2024: Ozzatron: The below code is being kept in its initial state for historic value. #region Store The Stupid Fucking Private Wind Map In Public Property [/*TotallyNot*/Obsolete("This function serves no purpose and is included in the Calamity source code for historic value.", error: true)] diff --git a/Items/Accessories/AmbrosialAmpoule.cs b/Items/Accessories/AmbrosialAmpoule.cs index 6d42653934..90779b1ac3 100644 --- a/Items/Accessories/AmbrosialAmpoule.cs +++ b/Items/Accessories/AmbrosialAmpoule.cs @@ -43,6 +43,7 @@ namespace CalamityMod.Items.Accessories AddIngredient(). AddIngredient(). AddIngredient(3). + AddIngredient(ItemID.FragmentSolar, 6). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Accessories/ArchaicPowder.cs b/Items/Accessories/ArchaicPowder.cs index 38a7e4997d..05610d1dc1 100644 --- a/Items/Accessories/ArchaicPowder.cs +++ b/Items/Accessories/ArchaicPowder.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Crags; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Accessories/BlazingCore.cs b/Items/Accessories/BlazingCore.cs index 95911b09b7..c7e084615f 100644 --- a/Items/Accessories/BlazingCore.cs +++ b/Items/Accessories/BlazingCore.cs @@ -79,7 +79,6 @@ namespace CalamityMod.Items.Accessories { spinningPoint *= 1.5f; dmgAmt = (int)player.GetBestClassDamage().ApplyTo(dmgAmt); - dmgAmt = player.ApplyArmorAccDamageBonusesTo(dmgAmt); Projectile.NewProjectile(player.GetSource_FromThis(), player.Center, vector2, projectileType, dmgAmt, 0f, Main.myPlayer); } } diff --git a/Items/Accessories/Calamity.cs b/Items/Accessories/Calamity.cs index a510018c8f..3499c1c552 100644 --- a/Items/Accessories/Calamity.cs +++ b/Items/Accessories/Calamity.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Items.Accessories if (Main.zenithWorld) { Texture2D texture = ModContent.Request("CalamityMod/Items/Accessories/Calamity_GFB").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, Main.itemAnimations[Item.type].GetFrame(texture), lightColor, 0f, Vector2.Zero, 1f, 0, 0); + spriteBatch.Draw(texture, Item.position - Main.screenPosition, Main.itemAnimations[Type].GetFrame(texture), lightColor, 0f, Vector2.Zero, 1f, 0, 0); return false; } else diff --git a/Items/Accessories/DeepDiver.cs b/Items/Accessories/DeepDiver.cs index 33537b3241..7405576e8e 100644 --- a/Items/Accessories/DeepDiver.cs +++ b/Items/Accessories/DeepDiver.cs @@ -4,7 +4,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; namespace CalamityMod.Items.Accessories { diff --git a/Items/Accessories/DeificAmulet.cs b/Items/Accessories/DeificAmulet.cs index 22d188bd58..b79a6ea9c4 100644 --- a/Items/Accessories/DeificAmulet.cs +++ b/Items/Accessories/DeificAmulet.cs @@ -1,6 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Accessories/ElementalGauntlet.cs b/Items/Accessories/ElementalGauntlet.cs index 2d1718db05..d28518d7fb 100644 --- a/Items/Accessories/ElementalGauntlet.cs +++ b/Items/Accessories/ElementalGauntlet.cs @@ -38,9 +38,7 @@ namespace CalamityMod.Items.Accessories { CreateRecipe(). AddIngredient(ItemID.FireGauntlet). - AddIngredient(ItemID.LunarBar, 8). AddIngredient(4). - AddIngredient(4). AddTile(). Register(); } diff --git a/Items/Accessories/EnchantedPearl.cs b/Items/Accessories/EnchantedPearl.cs index 9025eb04c2..d797425333 100644 --- a/Items/Accessories/EnchantedPearl.cs +++ b/Items/Accessories/EnchantedPearl.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Accessories/EtherealTalisman.cs b/Items/Accessories/EtherealTalisman.cs index c9f97d3110..84cb1fa4bb 100644 --- a/Items/Accessories/EtherealTalisman.cs +++ b/Items/Accessories/EtherealTalisman.cs @@ -40,9 +40,7 @@ namespace CalamityMod.Items.Accessories CreateRecipe(). AddIngredient(). AddRecipeGroup("AnyManaFlower"). //Any mana flower accessory - AddIngredient(ItemID.LunarBar, 8). AddIngredient(4). - AddIngredient(4). AddTile(). Register(); } diff --git a/Items/Accessories/EyeoftheStorm.cs b/Items/Accessories/EyeoftheStorm.cs index d0db6cd67c..d787a45479 100644 --- a/Items/Accessories/EyeoftheStorm.cs +++ b/Items/Accessories/EyeoftheStorm.cs @@ -44,13 +44,10 @@ namespace CalamityMod.Items.Accessories if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { var source = player.GetSource_Accessory(Item); - - // 08DEC2023: Ozzatron: Cloud Elementals spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. - int baseDamage = player.ApplyArmorAccDamageBonusesTo(45); - int damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + int damage = (int)player.GetTotalDamage().ApplyTo(45); var p = Projectile.NewProjectileDirect(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), damage, 2f, Main.myPlayer, 0f, 0f); - p.originalDamage = baseDamage; + p.originalDamage = 45; } } } diff --git a/Items/Accessories/FlameLickedShell.cs b/Items/Accessories/FlameLickedShell.cs index 733218f7e3..b61c986c6b 100644 --- a/Items/Accessories/FlameLickedShell.cs +++ b/Items/Accessories/FlameLickedShell.cs @@ -56,7 +56,6 @@ namespace CalamityMod.Items.Accessories float offsetAngle = (float)Math.PI * radialOffset; int type = ModContent.ProjectileType(); int damage = (int)player.GetBestClassDamage().ApplyTo(200); - damage = player.ApplyArmorAccDamageBonusesTo(damage); if (player.whoAmI == Main.myPlayer) { @@ -73,7 +72,6 @@ namespace CalamityMod.Items.Accessories float radians2 = MathHelper.TwoPi / totalProjectiles; type = ModContent.ProjectileType(); damage = (int)player.GetBestClassDamage().ApplyTo(70); - damage = player.ApplyArmorAccDamageBonusesTo(damage); double angleA = radians2 * 0.5; double angleB = MathHelper.ToRadians(90f) - angleA; diff --git a/Items/Accessories/FungalClump.cs b/Items/Accessories/FungalClump.cs index e65ca7c7b0..b7a5cb048e 100644 --- a/Items/Accessories/FungalClump.cs +++ b/Items/Accessories/FungalClump.cs @@ -35,14 +35,11 @@ namespace CalamityMod.Items.Accessories if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { var source = player.GetSource_Accessory(Item); - - // 08DEC2023: Ozzatron: Fungal Clumps spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. - int baseDamage = player.ApplyArmorAccDamageBonusesTo(FungalClumpDamage); - int damage = (int)player.GetBestClassDamage().ApplyTo(baseDamage); + int damage = (int)player.GetBestClassDamage().ApplyTo(FungalClumpDamage); int p = Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), damage, 1f, player.whoAmI); if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = baseDamage; + Main.projectile[p].originalDamage = FungalClumpDamage; } } } @@ -62,12 +59,11 @@ namespace CalamityMod.Items.Accessories var source = player.GetSource_Accessory(Item); // 08DEC2023: Ozzatron: Fungal Clumps spawned with... Hold on a second. Why the fuck are we doing damage calculations when the accessory is in vanity?! - int baseDamage = player.ApplyArmorAccDamageBonusesTo(FungalClumpDamage); - int damage = (int)player.GetBestClassDamage().ApplyTo(baseDamage); + int damage = (int)player.GetBestClassDamage().ApplyTo(FungalClumpDamage); int p = Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), damage, 1f, player.whoAmI); if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = baseDamage; + Main.projectile[p].originalDamage = FungalClumpDamage; } } } diff --git a/Items/Accessories/HeartoftheElements.cs b/Items/Accessories/HeartoftheElements.cs index 536236e269..8ea3582908 100644 --- a/Items/Accessories/HeartoftheElements.cs +++ b/Items/Accessories/HeartoftheElements.cs @@ -16,6 +16,8 @@ namespace CalamityMod.Items.Accessories public class HeartoftheElements : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + public static int ElementalDamage = 50; + public override void SetStaticDefaults() { Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 8)); @@ -59,9 +61,7 @@ namespace CalamityMod.Items.Accessories var source = player.GetSource_Accessory(Item); Vector2 velocity = new Vector2(0f, -1f); - // 08DEC2023: Ozzatron: Elementals spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. - int baseDamage = player.ApplyArmorAccDamageBonusesTo(50); - int elementalDmg = (int)player.GetTotalDamage().ApplyTo(baseDamage); + int elementalDmg = (int)player.GetTotalDamage().ApplyTo(ElementalDamage); float kBack = 2f + player.GetKnockback().Additive; @@ -81,31 +81,31 @@ namespace CalamityMod.Items.Accessories { int p = Projectile.NewProjectile(source, player.Center, velocity, brimmy, elementalDmg, kBack, player.whoAmI); if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = baseDamage; + Main.projectile[p].originalDamage = ElementalDamage; } if (player.ownedProjectileCounts[siren] < 1) { int p = Projectile.NewProjectile(source, player.Center, velocity, siren, elementalDmg, kBack, player.whoAmI); if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = baseDamage; + Main.projectile[p].originalDamage = ElementalDamage; } if (player.ownedProjectileCounts[healer] < 1) { int p = Projectile.NewProjectile(source, player.Center, velocity, healer, elementalDmg, kBack, player.whoAmI); if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = baseDamage; + Main.projectile[p].originalDamage = ElementalDamage; } if (player.ownedProjectileCounts[sandy] < 1) { int p = Projectile.NewProjectile(source, player.Center, velocity, sandy, elementalDmg, kBack, player.whoAmI); if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = baseDamage; + Main.projectile[p].originalDamage = ElementalDamage; } if (player.ownedProjectileCounts[cloudy] < 1) { int p = Projectile.NewProjectile(source, player.Center, velocity, cloudy, elementalDmg, kBack, player.whoAmI); if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = baseDamage; + Main.projectile[p].originalDamage = ElementalDamage; } } } @@ -126,8 +126,7 @@ namespace CalamityMod.Items.Accessories Vector2 velocity = new Vector2(0f, -1f); // 08DEC2023: Ozzatron: Elementals spawned with... Hold on a second. Why the fuck are we doing damage calculations when the accessory is in vanity?! - int baseDamage = player.ApplyArmorAccDamageBonusesTo(50); - int elementalDmg = (int)player.GetTotalDamage().ApplyTo(baseDamage); + int elementalDmg = (int)player.GetTotalDamage().ApplyTo(ElementalDamage); float kBack = 2f + player.GetKnockback().Additive; @@ -147,31 +146,31 @@ namespace CalamityMod.Items.Accessories { int p = Projectile.NewProjectile(source, player.Center, velocity, brimmy, elementalDmg, kBack, player.whoAmI); if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = baseDamage; + Main.projectile[p].originalDamage = ElementalDamage; } if (player.ownedProjectileCounts[siren] < 1) { int p = Projectile.NewProjectile(source, player.Center, velocity, siren, elementalDmg, kBack, player.whoAmI); if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = baseDamage; + Main.projectile[p].originalDamage = ElementalDamage; } if (player.ownedProjectileCounts[healer] < 1) { int p = Projectile.NewProjectile(source, player.Center, velocity, healer, elementalDmg, kBack, player.whoAmI); if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = baseDamage; + Main.projectile[p].originalDamage = ElementalDamage; } if (player.ownedProjectileCounts[sandy] < 1) { int p = Projectile.NewProjectile(source, player.Center, velocity, sandy, elementalDmg, kBack, player.whoAmI); if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = baseDamage; + Main.projectile[p].originalDamage = ElementalDamage; } if (player.ownedProjectileCounts[cloudy] < 1) { int p = Projectile.NewProjectile(source, player.Center, velocity, cloudy, elementalDmg, kBack, player.whoAmI); if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = baseDamage; + Main.projectile[p].originalDamage = ElementalDamage; } } } diff --git a/Items/Accessories/HowlsHeart.cs b/Items/Accessories/HowlsHeart.cs index d8ed50b117..8fdf7cac32 100644 --- a/Items/Accessories/HowlsHeart.cs +++ b/Items/Accessories/HowlsHeart.cs @@ -47,12 +47,10 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[ProjectileType()] < 1) { - // 08DEC2023: Ozzatron: Howls spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. - int baseDamage = player.ApplyArmorAccDamageBonusesTo(HowlDamage); - int damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + int damage = (int)player.GetTotalDamage().ApplyTo(HowlDamage); Projectile howl = Projectile.NewProjectileDirect(source, player.Center, -Vector2.UnitY, ProjectileType(), damage, 1f, player.whoAmI, 0f, 1f); - howl.originalDamage = damage; + howl.originalDamage = HowlDamage; } if (player.ownedProjectileCounts[ProjectileType()] < 1) { @@ -77,8 +75,7 @@ namespace CalamityMod.Items.Accessories if (player.ownedProjectileCounts[ProjectileType()] < 1) { // 08DEC2023: Ozzatron: Howls spawned with... Hold on a second. Why the fuck are we doing damage calculations when the accessory is in vanity?! - int baseDamage = player.ApplyArmorAccDamageBonusesTo(HowlDamage); - int damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + int damage = (int)player.GetTotalDamage().ApplyTo(HowlDamage); int p = Projectile.NewProjectile(source, player.Center, -Vector2.UnitY, ProjectileType(), damage, 1f, player.whoAmI, 0f, 1f); if (Main.projectile.IndexInRange(p)) diff --git a/Items/Accessories/MarniteRepulsionShield.cs b/Items/Accessories/MarniteRepulsionShield.cs index 6786c4d73a..8f20c5926b 100644 --- a/Items/Accessories/MarniteRepulsionShield.cs +++ b/Items/Accessories/MarniteRepulsionShield.cs @@ -37,12 +37,11 @@ namespace CalamityMod.Items.Accessories if (player.whoAmI == Main.myPlayer) { - int baseDamage = player.ApplyArmorAccDamageBonusesTo(5); var source = player.GetSource_Accessory(Item); if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - var hitbox = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), baseDamage, 12f, Main.myPlayer); - hitbox.originalDamage = baseDamage; + var hitbox = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), 5, 12f, Main.myPlayer); + hitbox.originalDamage = 5; } } } diff --git a/Items/Accessories/Nanotech.cs b/Items/Accessories/Nanotech.cs index 96db6c958a..7d73cda868 100644 --- a/Items/Accessories/Nanotech.cs +++ b/Items/Accessories/Nanotech.cs @@ -39,9 +39,7 @@ namespace CalamityMod.Items.Accessories AddIngredient(). AddIngredient(). AddIngredient(). - AddIngredient(ItemID.LunarBar, 8). AddIngredient(4). - AddIngredient(4). AddTile(). Register(); } diff --git a/Items/Accessories/NebulousCore.cs b/Items/Accessories/NebulousCore.cs index 6c6c9be664..277820b7da 100644 --- a/Items/Accessories/NebulousCore.cs +++ b/Items/Accessories/NebulousCore.cs @@ -67,10 +67,9 @@ namespace CalamityMod.Items.Accessories { var source = player.GetSource_Accessory(Item); int damage = (int)player.GetBestClassDamage().ApplyTo(250); - damage = player.ApplyArmorAccDamageBonusesTo(damage); float knockBack = 3f; - Projectile.NewProjectile(source, center.X, center.Y, 0f, 0f, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); + Projectile.NewProjectile(source, center, Vector2.Zero, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); return; } } diff --git a/Items/Accessories/Nucleogenesis.cs b/Items/Accessories/Nucleogenesis.cs index 4d2b398086..229c3e33fe 100644 --- a/Items/Accessories/Nucleogenesis.cs +++ b/Items/Accessories/Nucleogenesis.cs @@ -48,9 +48,7 @@ namespace CalamityMod.Items.Accessories CreateRecipe(). AddIngredient(). AddIngredient(). - AddIngredient(ItemID.LunarBar, 8). AddIngredient(4). - AddIngredient(4). AddTile(). Register(); } diff --git a/Items/Accessories/PearlofEnthrallment.cs b/Items/Accessories/PearlofEnthrallment.cs index a6069a3b59..53a38c6c5a 100644 --- a/Items/Accessories/PearlofEnthrallment.cs +++ b/Items/Accessories/PearlofEnthrallment.cs @@ -13,6 +13,8 @@ namespace CalamityMod.Items.Accessories public class PearlofEnthrallment : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + public static int ElementalDamage = 65; + public override void SetDefaults() { Item.width = 56; @@ -45,13 +47,11 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - // 08DEC2023: Ozzatron: Anahitas spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. - int baseDamage = player.ApplyArmorAccDamageBonusesTo(65); - int damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + int damage = (int)player.GetTotalDamage().ApplyTo(ElementalDamage); int anahita = Projectile.NewProjectile(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), damage, 2f, Main.myPlayer); if (Main.projectile.IndexInRange(anahita)) - Main.projectile[anahita].originalDamage = baseDamage; + Main.projectile[anahita].originalDamage = ElementalDamage; } } } @@ -70,12 +70,11 @@ namespace CalamityMod.Items.Accessories if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { // 08DEC2023: Ozzatron: Anahitas spawned with... Hold on a second. Why the fuck are we doing damage calculations when the accessory is in vanity?! - int baseDamage = player.ApplyArmorAccDamageBonusesTo(65); - int damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + int damage = (int)player.GetTotalDamage().ApplyTo(ElementalDamage); int anahita = Projectile.NewProjectile(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), damage, 2f, Main.myPlayer); if (Main.projectile.IndexInRange(anahita)) - Main.projectile[anahita].originalDamage = baseDamage; + Main.projectile[anahita].originalDamage = ElementalDamage; } } } diff --git a/Items/Accessories/PlanebreakersPouch.cs b/Items/Accessories/PlanebreakersPouch.cs index 33b979b883..61da35b09b 100644 --- a/Items/Accessories/PlanebreakersPouch.cs +++ b/Items/Accessories/PlanebreakersPouch.cs @@ -36,9 +36,7 @@ namespace CalamityMod.Items.Accessories CreateRecipe(). AddRecipeGroup("AnyQuiver"). AddIngredient(). - AddIngredient(ItemID.LunarBar, 8). AddIngredient(4). - AddIngredient(4). AddTile(). Register(); } diff --git a/Items/Accessories/ProfanedSoulCrystal.cs b/Items/Accessories/ProfanedSoulCrystal.cs index f73429b6d8..2bdc73d997 100644 --- a/Items/Accessories/ProfanedSoulCrystal.cs +++ b/Items/Accessories/ProfanedSoulCrystal.cs @@ -311,7 +311,6 @@ namespace CalamityMod.Items.Accessories int separation = (i * 4) - 8; int spearBaseDamage = 350; int spearDamage = (int)player.GetTotalDamage().ApplyTo(spearBaseDamage); - spearDamage = player.ApplyArmorAccDamageBonusesTo(spearDamage); int proj = Projectile.NewProjectile(source, player.Center.X, player.Center.Y - separation, perturbedspeed.X, perturbedspeed.Y, ModContent.ProjectileType(), spearDamage, 1f, player.whoAmI, Main.rand.NextBool(player.Calamity().profanedSoulWeaponUsage == 4 ? 5 : 7) ? 1f : 0f); if (proj.WithinBounds(Main.maxProjectiles)) @@ -328,7 +327,6 @@ namespace CalamityMod.Items.Accessories { int spearBaseDamage = 250; int spearDamage = (int)player.GetTotalDamage().ApplyTo(spearBaseDamage); - spearDamage = player.ApplyArmorAccDamageBonusesTo(spearDamage); int proj = Projectile.NewProjectile(source, player.Center, correctedVelocity * 14f, ModContent.ProjectileType(), spearDamage, 1f, player.whoAmI, Main.rand.NextBool(player.Calamity().profanedSoulWeaponUsage == 4 ? 5 : 7) ? 1f : 0f, 1f); if (proj.WithinBounds(Main.maxProjectiles)) @@ -354,7 +352,6 @@ namespace CalamityMod.Items.Accessories int projType = isSmallBoomer ? isThiccBoomer ? 1 : 2 : 3; int boomBaseDamage = 200; int boomDamage = (int)player.GetTotalDamage().ApplyTo(boomBaseDamage); - boomDamage = player.ApplyArmorAccDamageBonusesTo(boomDamage); switch (projType) { @@ -409,7 +406,6 @@ namespace CalamityMod.Items.Accessories int sickPenalty = (int)(mageFireDamage * (0.05f * ((player.buffTime[player.FindBuffIndex(BuffID.ManaSickness)] + 60) / 60))); mageFireDamage -= sickPenalty; } - mageFireDamage = player.ApplyArmorAccDamageBonusesTo(mageFireDamage); int proj = Projectile.NewProjectile(source, player.position, correctedVelocity, ModContent.ProjectileType(), mageFireDamage, 1f, player.whoAmI, empowered ? 1f : 0f); if (proj.WithinBounds(Main.maxProjectiles)) @@ -437,7 +433,6 @@ namespace CalamityMod.Items.Accessories float angle = MathHelper.TwoPi / crystalCount * i; int shardBaseDamage = 176; int shardDamage = (int)player.GetTotalDamage().ApplyTo(shardBaseDamage); - shardDamage = player.ApplyArmorAccDamageBonusesTo(shardDamage); int proj = Projectile.NewProjectile(source, player.Center, angle.ToRotationVector2() * 12f, ModContent.ProjectileType(), shardDamage, 1f, player.whoAmI, 0f, 0f); if (proj.WithinBounds(Main.maxProjectiles)) @@ -455,7 +450,6 @@ namespace CalamityMod.Items.Accessories int totalShardProjectiles = empowered ? 360 / 5 : 360 / 10; int shardBaseDamage = empowered ? 125 : 220; int shardDamage = (int)player.GetTotalDamage().ApplyTo(shardBaseDamage); - shardDamage = player.ApplyArmorAccDamageBonusesTo(shardDamage); float interval = totalShardProjectiles / chains * (empowered ? 5f : 10f); double patternInterval = Math.Floor(player.Calamity().profanedSoulWeaponUsage / interval); @@ -495,7 +489,6 @@ namespace CalamityMod.Items.Accessories { int whipBaseDamage = 250; int whipDamage = (int)player.GetTotalDamage().ApplyTo(whipBaseDamage); - whipDamage = player.ApplyArmorAccDamageBonusesTo(whipDamage); var buffed = player.HasBuff(); correctedVelocity *= buffed ? 10f : 8f; diff --git a/Items/Accessories/QuiverofNihility.cs b/Items/Accessories/QuiverofNihility.cs index 90c7aada62..11717b66cd 100644 --- a/Items/Accessories/QuiverofNihility.cs +++ b/Items/Accessories/QuiverofNihility.cs @@ -32,14 +32,17 @@ namespace CalamityMod.Items.Accessories modPlayer.voidField = true; if (player.whoAmI == Main.myPlayer) { + if (player.ownedProjectileCounts[ModContent.ProjectileType()] >= 4) + return; + var source = player.GetSource_Accessory(Item); - if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 4) + int count = player.ownedProjectileCounts[ModContent.ProjectileType()]; + do { - for (int v = 0; v < 4; v++) - { - Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, v); - } + Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, count); + count++; } + while (count < 4); } } public override void AddRecipes() diff --git a/Items/Accessories/RoseStone.cs b/Items/Accessories/RoseStone.cs index d2f21afb82..e92c7f11de 100644 --- a/Items/Accessories/RoseStone.cs +++ b/Items/Accessories/RoseStone.cs @@ -11,6 +11,8 @@ namespace CalamityMod.Items.Accessories public class RoseStone : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + public static int ElementalDamage = 60; + public override void SetDefaults() { Item.width = 20; @@ -44,12 +46,11 @@ namespace CalamityMod.Items.Accessories if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { // 08DEC2023: Ozzatron: Brimstone Elementals spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. - int baseDamage = player.ApplyArmorAccDamageBonusesTo(60); - int damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + int damage = (int)player.GetTotalDamage().ApplyTo(ElementalDamage); int p = Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), damage, 2f, Main.myPlayer, 0f, 0f); if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = baseDamage; + Main.projectile[p].originalDamage = ElementalDamage; } } } @@ -68,12 +69,11 @@ namespace CalamityMod.Items.Accessories if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { // 08DEC2023: Ozzatron: Brimstone Elementals spawned with... Hold on a second. Why the fuck are we doing damage calculations when the accessory is in vanity?! - int baseDamage = player.ApplyArmorAccDamageBonusesTo(60); - int damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + int damage = (int)player.GetTotalDamage().ApplyTo(ElementalDamage); int p = Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), damage, 2f, Main.myPlayer, 0f, 0f); if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = baseDamage; + Main.projectile[p].originalDamage = ElementalDamage; } } } diff --git a/Items/Accessories/RoverDrive.cs b/Items/Accessories/RoverDrive.cs index 1001393ca3..d166994650 100644 --- a/Items/Accessories/RoverDrive.cs +++ b/Items/Accessories/RoverDrive.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Accessories } // Allows item to be extractinated and specifies custom behavior instead of copying an existing item - public override void SetStaticDefaults() => ItemID.Sets.ExtractinatorMode[Item.type] = Item.type; + public override void SetStaticDefaults() => ItemID.Sets.ExtractinatorMode[Type] = Item.type; public override void SetDefaults() { diff --git a/Items/Accessories/ScuttlersJewel.cs b/Items/Accessories/ScuttlersJewel.cs index 5a24199168..e42197a607 100644 --- a/Items/Accessories/ScuttlersJewel.cs +++ b/Items/Accessories/ScuttlersJewel.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetStaticDefaults() { - ItemID.Sets.ExtractinatorMode[Item.type] = Item.type; + ItemID.Sets.ExtractinatorMode[Type] = Item.type; } public override void SetDefaults() diff --git a/Items/Accessories/SlagsplitterPauldron.cs b/Items/Accessories/SlagsplitterPauldron.cs index f16f87060a..def664a439 100644 --- a/Items/Accessories/SlagsplitterPauldron.cs +++ b/Items/Accessories/SlagsplitterPauldron.cs @@ -1,6 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Crags; using CalamityMod.Projectiles.Typeless; using CalamityMod.Rarities; using Microsoft.Xna.Framework; diff --git a/Items/Accessories/StatisBlessing.cs b/Items/Accessories/StatisBlessing.cs index a08ba8d9a7..153d639c83 100644 --- a/Items/Accessories/StatisBlessing.cs +++ b/Items/Accessories/StatisBlessing.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Accessories AddIngredient(ItemID.PygmyNecklace). AddIngredient(ItemID.SummonerEmblem). AddIngredient(ItemID.HolyWater, 30). - AddIngredient(5). + AddIngredient(5). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Accessories/TeslasAmulet.cs b/Items/Accessories/TeslasAmulet.cs index 20063d9fa7..2b78acf72c 100644 --- a/Items/Accessories/TeslasAmulet.cs +++ b/Items/Accessories/TeslasAmulet.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using Terraria; using Terraria.DataStructures; using Terraria.ID; diff --git a/Items/Accessories/TheCamper.cs b/Items/Accessories/TheCamper.cs index 1d77244faf..b6f793c7e2 100644 --- a/Items/Accessories/TheCamper.cs +++ b/Items/Accessories/TheCamper.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Items.Accessories if (npc.IsAnEnemy() && !npc.dontTakeDamage && Vector2.Distance(player.Center, npc.Center) <= range) { int campingFireDamage = (int)player.GetBestClassDamage().ApplyTo(Main.rand.Next(20, 41)); - Projectile.NewProjectileDirect(source, npc.Center, Vector2.Zero, ModContent.ProjectileType(), campingFireDamage, 0f, player.whoAmI, npc.whoAmI); + Projectile.NewProjectile(source, npc.Center, Vector2.Zero, ModContent.ProjectileType(), campingFireDamage, 0f, player.whoAmI, npc.whoAmI); } } } diff --git a/Items/Accessories/TheSponge.cs b/Items/Accessories/TheSponge.cs index 173608b933..d94dd087fa 100644 --- a/Items/Accessories/TheSponge.cs +++ b/Items/Accessories/TheSponge.cs @@ -112,7 +112,7 @@ namespace CalamityMod.Items.Accessories if (Texture == "CalamityMod/Items/Accessories/TheSponge") { Texture2D tex = ModContent.Request("CalamityMod/Items/Accessories/TheSpongeShield").Value; - spriteBatch.Draw(tex, Item.Center - Main.screenPosition + new Vector2(0f, 0f), Main.itemAnimations[Item.type].GetFrame(tex), Color.Cyan * 0.5f, 0f, new Vector2(tex.Width / 2f, (tex.Height / 30f) * 0.8f), 1f, SpriteEffects.None, 0); + spriteBatch.Draw(tex, Item.Center - Main.screenPosition + new Vector2(0f, 0f), Main.itemAnimations[Type].GetFrame(tex), Color.Cyan * 0.5f, 0f, new Vector2(tex.Width / 2f, (tex.Height / 30f) * 0.8f), 1f, SpriteEffects.None, 0); } } @@ -148,7 +148,7 @@ namespace CalamityMod.Items.Accessories spriteBatch, texture: tex, position, - Main.itemAnimations[Item.type].GetFrame(tex), + Main.itemAnimations[Type].GetFrame(tex), Color.Cyan * 0.4f, itemColor, origin, diff --git a/Items/Accessories/VoidofCalamity.cs b/Items/Accessories/VoidofCalamity.cs index b9e35b78cb..adbefc4037 100644 --- a/Items/Accessories/VoidofCalamity.cs +++ b/Items/Accessories/VoidofCalamity.cs @@ -33,7 +33,6 @@ namespace CalamityMod.Items.Accessories if (player.miscCounter % 10 == 0) { int damage = (int)player.GetBestClassDamage().ApplyTo(30); - damage = player.ApplyArmorAccDamageBonusesTo(damage); CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), damage, 5f, player.whoAmI); } } diff --git a/Items/Accessories/VoidofExtinction.cs b/Items/Accessories/VoidofExtinction.cs index b892b0268b..f2bac57941 100644 --- a/Items/Accessories/VoidofExtinction.cs +++ b/Items/Accessories/VoidofExtinction.cs @@ -29,8 +29,8 @@ namespace CalamityMod.Items.Accessories { CreateRecipe(). AddIngredient(). - AddIngredient(). AddIngredient(3). + AddIngredient(). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Accessories/WifeinaBottle.cs b/Items/Accessories/WifeinaBottle.cs index 7954944e71..9a6e0d1919 100644 --- a/Items/Accessories/WifeinaBottle.cs +++ b/Items/Accessories/WifeinaBottle.cs @@ -49,12 +49,10 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - // 08DEC2023: Ozzatron: Sand Elementals spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. - int baseDamage = player.ApplyArmorAccDamageBonusesTo(ElementalDamage); - int damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + int damage = (int)player.GetTotalDamage().ApplyTo(ElementalDamage); var p = Projectile.NewProjectileDirect(player.GetSource_Accessory(Item), player.Center, -Vector2.UnitY, ModContent.ProjectileType(), damage, 2f, Main.myPlayer); - p.originalDamage = baseDamage; + p.originalDamage = ElementalDamage; } } } diff --git a/Items/Accessories/WifeinaBottlewithBoobs.cs b/Items/Accessories/WifeinaBottlewithBoobs.cs index 40bf02662e..9c07ecc7ef 100644 --- a/Items/Accessories/WifeinaBottlewithBoobs.cs +++ b/Items/Accessories/WifeinaBottlewithBoobs.cs @@ -12,6 +12,10 @@ namespace CalamityMod.Items.Accessories public class WifeinaBottlewithBoobs : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + // Hold on... isn't this the HEALER elemental?? + public static int ElementalDamage = 45; + public override void SetDefaults() { Item.width = 20; @@ -44,13 +48,10 @@ namespace CalamityMod.Items.Accessories if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { var source = player.GetSource_Accessory(Item); - - // 08DEC2023: Ozzatron: Rare Sand Elementals spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. - int baseDamage = player.ApplyArmorAccDamageBonusesTo(45); - int damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + int damage = (int)player.GetTotalDamage().ApplyTo(ElementalDamage); Projectile sandy = Projectile.NewProjectileDirect(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), damage, 2f, Main.myPlayer, 0f, 0f); - sandy.originalDamage = baseDamage; + sandy.originalDamage = ElementalDamage; } } } @@ -70,11 +71,10 @@ namespace CalamityMod.Items.Accessories var source = player.GetSource_Accessory(Item); // 08DEC2023: Ozzatron: Rare Sand Elementals spawned with... Hold on a second. Why the fuck are we doing damage calculations when the accessory is in vanity?! - int baseDamage = player.ApplyArmorAccDamageBonusesTo(45); - int damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + int damage = (int)player.GetTotalDamage().ApplyTo(ElementalDamage); Projectile sandy = Projectile.NewProjectileDirect(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), damage, 2f, Main.myPlayer, 0f, 0f); - sandy.originalDamage = baseDamage; + sandy.originalDamage = ElementalDamage; } } } diff --git a/Items/Accessories/Wings/ExodusWings.cs b/Items/Accessories/Wings/ExodusWings.cs index bb3548b316..1ae33e8294 100644 --- a/Items/Accessories/Wings/ExodusWings.cs +++ b/Items/Accessories/Wings/ExodusWings.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Armor.Empyrean; +using CalamityMod.Buffs.StatBuffs; +using CalamityMod.Items.Armor.Empyrean; using CalamityMod.Items.Materials; using CalamityMod.Particles; using Microsoft.Xna.Framework; @@ -33,8 +34,7 @@ namespace CalamityMod.Items.Accessories.Wings { if (player.armor[0].type == ModContent.ItemType() && player.armor[1].type == ModContent.ItemType() && player.armor[2].type == ModContent.ItemType()) { - player.GetDamage() += 0.05f; - player.GetCritChance() += 5; + player.AddBuff(ModContent.BuffType(), 2); } if (player.wingTime > 0f && player.jump == 0 && player.velocity.Y != 0f && !hideVisual) diff --git a/Items/Accessories/Wings/HadalMantle.cs b/Items/Accessories/Wings/HadalMantle.cs index 9bcf25930c..bde6c5915b 100644 --- a/Items/Accessories/Wings/HadalMantle.cs +++ b/Items/Accessories/Wings/HadalMantle.cs @@ -30,14 +30,6 @@ namespace CalamityMod.Items.Accessories.Wings public override void UpdateAccessory(Player player, bool hideVisual) { - if ((player.armor[0].type == ModContent.ItemType() || player.armor[0].type == ModContent.ItemType() || - player.armor[0].type == ModContent.ItemType() || player.armor[0].type == ModContent.ItemType() || - player.armor[0].type == ModContent.ItemType()) && - player.armor[1].type == ModContent.ItemType() && player.armor[2].type == ModContent.ItemType()) - { - player.GetDamage() += 0.05f; - } - if (player.controlJump && player.wingTime > 0f && player.jump == 0 && player.velocity.Y != 0f && !hideVisual) { int dustXOffset = 4; diff --git a/Items/Accessories/Wings/SilvaWings.cs b/Items/Accessories/Wings/SilvaWings.cs index b00db4d361..19966185a7 100644 --- a/Items/Accessories/Wings/SilvaWings.cs +++ b/Items/Accessories/Wings/SilvaWings.cs @@ -1,6 +1,6 @@ using CalamityMod.Items.Armor.Silva; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; diff --git a/Items/Accessories/Wings/SoulofCryogen.cs b/Items/Accessories/Wings/SoulofCryogen.cs index cfc3f82932..eba7f6f796 100644 --- a/Items/Accessories/Wings/SoulofCryogen.cs +++ b/Items/Accessories/Wings/SoulofCryogen.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories.Wings { Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 3)); ItemID.Sets.AnimatesAsSoul[Type] = true; - ItemID.Sets.ItemNoGravity[Item.type] = true; + ItemID.Sets.ItemNoGravity[Type] = true; ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(120, 6.25f, 1f); } @@ -52,15 +52,13 @@ namespace CalamityMod.Items.Accessories.Wings { CalamityPlayer modPlayer = player.Calamity(); modPlayer.cryogenSoul = true; - player.GetDamage() += 0.07f; player.noFallDmg = true; - if (modPlayer.icicleCooldown <= 0) + if (modPlayer.wingProjectileCooldown <= 0) { if (player.controlJump && player.jump == 0 && player.velocity.Y != 0f && !player.mount.Active && !player.mount.Cart) { var source = player.GetSource_Accessory(Item); int damage = (int)player.GetBestClassDamage().ApplyTo(32); - damage = player.ApplyArmorAccDamageBonusesTo(damage); int p = Projectile.NewProjectile(source, player.Center.X, player.Center.Y, player.velocity.X * 0f, 2f, ModContent.ProjectileType(), damage, 3f, player.whoAmI, 1f); if (p.WithinBounds(Main.maxProjectiles)) @@ -68,7 +66,7 @@ namespace CalamityMod.Items.Accessories.Wings Main.projectile[p].DamageType = DamageClass.Generic; Main.projectile[p].frame = Main.rand.Next(5); } - modPlayer.icicleCooldown = 7; + modPlayer.wingProjectileCooldown = 7; } } } diff --git a/Items/Accessories/Wings/StarlightWings.cs b/Items/Accessories/Wings/StarlightWings.cs index f80f8c7a98..d8f888028f 100644 --- a/Items/Accessories/Wings/StarlightWings.cs +++ b/Items/Accessories/Wings/StarlightWings.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Accessories.Wings public new string LocalizationCategory => "Items.Accessories.Wings"; public override void SetStaticDefaults() { - ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(150, 7.5f, 1f); + ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(160, 7.5f, 1.5f); } public override void SetDefaults() @@ -29,15 +29,6 @@ namespace CalamityMod.Items.Accessories.Wings public override void UpdateAccessory(Player player, bool hideVisual) { - if ((player.armor[0].type == ModContent.ItemType() || player.armor[0].type == ModContent.ItemType() || - player.armor[0].type == ModContent.ItemType() || player.armor[0].type == ModContent.ItemType() || - player.armor[0].type == ModContent.ItemType()) && - player.armor[1].type == ModContent.ItemType() && player.armor[2].type == ModContent.ItemType()) - { - player.GetDamage() += 0.05f; - player.GetCritChance() += 5; - } - if (player.controlJump && player.wingTime > 0f && player.jump == 0 && player.velocity.Y != 0f && !hideVisual) { int dustXOffset = 4; diff --git a/Items/Accessories/Wings/TarragonWings.cs b/Items/Accessories/Wings/TarragonWings.cs index e30e73c6bd..3ab9919643 100644 --- a/Items/Accessories/Wings/TarragonWings.cs +++ b/Items/Accessories/Wings/TarragonWings.cs @@ -32,14 +32,8 @@ namespace CalamityMod.Items.Accessories.Wings public override void UpdateAccessory(Player player, bool hideVisual) { - if ((player.armor[0].type == ModContent.ItemType() || player.armor[0].type == ModContent.ItemType() || - player.armor[0].type == ModContent.ItemType() || player.armor[0].type == ModContent.ItemType() || - player.armor[0].type == ModContent.ItemType()) && - player.armor[1].type == ModContent.ItemType() && player.armor[2].type == ModContent.ItemType()) - { - player.statDefense += 15; - player.lifeRegen += 2; - } + player.statDefense += 15; + player.lifeRegen += 2; if (player.controlJump && player.wingTime > 0f && player.jump == 0 && player.velocity.Y != 0f && !hideVisual) { diff --git a/Items/Accessories/WulfrumBattery.cs b/Items/Accessories/WulfrumBattery.cs index ea1aaca730..efa3e9f2ac 100644 --- a/Items/Accessories/WulfrumBattery.cs +++ b/Items/Accessories/WulfrumBattery.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { - ItemID.Sets.ExtractinatorMode[Item.type] = Item.type; + ItemID.Sets.ExtractinatorMode[Type] = Item.type; } public override void SetDefaults() diff --git a/Items/Accessories/YharimsGift.cs b/Items/Accessories/YharimsGift.cs index 0a59362b0f..83d180aa84 100644 --- a/Items/Accessories/YharimsGift.cs +++ b/Items/Accessories/YharimsGift.cs @@ -37,7 +37,6 @@ namespace CalamityMod.Items.Accessories if (player.whoAmI == Main.myPlayer) { int damage = (int)player.GetBestClassDamage().ApplyTo(175); - damage = player.ApplyArmorAccDamageBonusesTo(damage); int projectile1 = Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 5f, player.whoAmI, 0f, 0f); Main.projectile[projectile1].timeLeft = 60; @@ -56,7 +55,6 @@ namespace CalamityMod.Items.Accessories if (player.whoAmI == Main.myPlayer) { int damage = (int)player.GetBestClassDamage().ApplyTo(375); - damage = player.ApplyArmorAccDamageBonusesTo(damage); CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), damage, 9f, player.whoAmI); } diff --git a/Items/Ammo/AstralSolution.cs b/Items/Ammo/AstralSolution.cs index dcdd3e181b..4026fbb514 100644 --- a/Items/Ammo/AstralSolution.cs +++ b/Items/Ammo/AstralSolution.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Ammo public override void SetStaticDefaults() { Item.ResearchUnlockCount = 99; - ItemID.Sets.SortingPriorityTerraforming[Type] = 95; // Red Solution + ItemID.Sets.SortingPriorityTerraforming[Type] = 94; // Red Solution } public override void SetDefaults() => Item.DefaultToSolution(ModContent.ProjectileType()); diff --git a/Items/Armor/Aerospec/AerospecHat.cs b/Items/Armor/Aerospec/AerospecHat.cs index 5fb0715309..b423f48d9b 100644 --- a/Items/Armor/Aerospec/AerospecHat.cs +++ b/Items/Armor/Aerospec/AerospecHat.cs @@ -53,6 +53,7 @@ namespace CalamityMod.Items.Armor.Aerospec AddIngredient(ItemID.SunplateBlock, 3). AddIngredient(ItemID.Feather). AddTile(TileID.SkyMill). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Aerospec/AerospecHeadgear.cs b/Items/Armor/Aerospec/AerospecHeadgear.cs index a922ea1698..874e6b6821 100644 --- a/Items/Armor/Aerospec/AerospecHeadgear.cs +++ b/Items/Armor/Aerospec/AerospecHeadgear.cs @@ -60,6 +60,7 @@ namespace CalamityMod.Items.Armor.Aerospec AddIngredient(ItemID.SunplateBlock, 3). AddIngredient(ItemID.Feather). AddTile(TileID.SkyMill). + SortAfterFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Aerospec/AerospecHelm.cs b/Items/Armor/Aerospec/AerospecHelm.cs index bf10c1b5b2..d8303c5fee 100644 --- a/Items/Armor/Aerospec/AerospecHelm.cs +++ b/Items/Armor/Aerospec/AerospecHelm.cs @@ -52,6 +52,7 @@ namespace CalamityMod.Items.Armor.Aerospec AddIngredient(ItemID.SunplateBlock, 3). AddIngredient(ItemID.Feather). AddTile(TileID.SkyMill). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Aerospec/AerospecHelmet.cs b/Items/Armor/Aerospec/AerospecHelmet.cs index 688945d746..4147feed8f 100644 --- a/Items/Armor/Aerospec/AerospecHelmet.cs +++ b/Items/Armor/Aerospec/AerospecHelmet.cs @@ -13,6 +13,8 @@ namespace CalamityMod.Items.Armor.Aerospec public class AerospecHelmet : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + public static int ValkyrieDamage = 20; + public override void SetDefaults() { Item.width = 18; @@ -48,13 +50,11 @@ namespace CalamityMod.Items.Armor.Aerospec } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - // 08DEC2023: Ozzatron: Aerospec Valkyries spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. - int baseDamage = player.ApplyArmorAccDamageBonusesTo(20); - var damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + var damage = (int)player.GetTotalDamage().ApplyTo(ValkyrieDamage); var p = Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = baseDamage; + Main.projectile[p].originalDamage = ValkyrieDamage; } } player.GetDamage() += 0.11f; @@ -74,6 +74,7 @@ namespace CalamityMod.Items.Armor.Aerospec AddIngredient(ItemID.SunplateBlock, 3). AddIngredient(ItemID.Feather). AddTile(TileID.SkyMill). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Aerospec/AerospecHood.cs b/Items/Armor/Aerospec/AerospecHood.cs index 1d18851f55..e452f6a125 100644 --- a/Items/Armor/Aerospec/AerospecHood.cs +++ b/Items/Armor/Aerospec/AerospecHood.cs @@ -51,6 +51,7 @@ namespace CalamityMod.Items.Armor.Aerospec AddIngredient(ItemID.SunplateBlock, 3). AddIngredient(ItemID.Feather). AddTile(TileID.SkyMill). + SortAfterFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Astral/AstralHelm.cs b/Items/Armor/Astral/AstralHelm.cs index 1e8ea5ae6a..df802b0cea 100644 --- a/Items/Armor/Astral/AstralHelm.cs +++ b/Items/Armor/Astral/AstralHelm.cs @@ -53,6 +53,7 @@ namespace CalamityMod.Items.Armor.Astral AddIngredient(8). AddIngredient(ItemID.MeteoriteBar, 6). AddTile(TileID.LunarCraftingStation). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Auric/AuricTeslaHoodedFacemask.cs b/Items/Armor/Auric/AuricTeslaHoodedFacemask.cs index e78c7cebc2..db0aaa3a4e 100644 --- a/Items/Armor/Auric/AuricTeslaHoodedFacemask.cs +++ b/Items/Armor/Auric/AuricTeslaHoodedFacemask.cs @@ -70,6 +70,7 @@ namespace CalamityMod.Items.Armor.Auric AddIngredient(). AddIngredient(12). AddTile(). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Auric/AuricTeslaPlumedHelm.cs b/Items/Armor/Auric/AuricTeslaPlumedHelm.cs index 8c5b0367f3..69eaa3d741 100644 --- a/Items/Armor/Auric/AuricTeslaPlumedHelm.cs +++ b/Items/Armor/Auric/AuricTeslaPlumedHelm.cs @@ -72,6 +72,7 @@ namespace CalamityMod.Items.Armor.Auric AddIngredient(). AddIngredient(12). AddTile(). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Auric/AuricTeslaRoyalHelm.cs b/Items/Armor/Auric/AuricTeslaRoyalHelm.cs index cc0549db06..8d3b1d3a54 100644 --- a/Items/Armor/Auric/AuricTeslaRoyalHelm.cs +++ b/Items/Armor/Auric/AuricTeslaRoyalHelm.cs @@ -73,6 +73,7 @@ namespace CalamityMod.Items.Armor.Auric AddIngredient(). AddIngredient(12). AddTile(). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Auric/AuricTeslaSpaceHelmet.cs b/Items/Armor/Auric/AuricTeslaSpaceHelmet.cs index b04b7bb6e6..fdc49f0a7a 100644 --- a/Items/Armor/Auric/AuricTeslaSpaceHelmet.cs +++ b/Items/Armor/Auric/AuricTeslaSpaceHelmet.cs @@ -70,6 +70,7 @@ namespace CalamityMod.Items.Armor.Auric AddIngredient(). AddIngredient(12). AddTile(). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Auric/AuricTeslaWireHemmedVisage.cs b/Items/Armor/Auric/AuricTeslaWireHemmedVisage.cs index a2e4802bd0..18993c56ec 100644 --- a/Items/Armor/Auric/AuricTeslaWireHemmedVisage.cs +++ b/Items/Armor/Auric/AuricTeslaWireHemmedVisage.cs @@ -68,6 +68,7 @@ namespace CalamityMod.Items.Armor.Auric AddIngredient(). AddIngredient(12). AddTile(). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Bloodflare/BloodflareHeadMagic.cs b/Items/Armor/Bloodflare/BloodflareHeadMagic.cs index 92f840986d..f3da4ef71c 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadMagic.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadMagic.cs @@ -54,6 +54,7 @@ namespace CalamityMod.Items.Armor.Bloodflare AddIngredient(11). AddIngredient(2). AddTile(TileID.LunarCraftingStation). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Bloodflare/BloodflareHeadMelee.cs b/Items/Armor/Bloodflare/BloodflareHeadMelee.cs index 52523c67d6..542373cdbc 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadMelee.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadMelee.cs @@ -54,6 +54,7 @@ namespace CalamityMod.Items.Armor.Bloodflare AddIngredient(11). AddIngredient(2). AddTile(TileID.LunarCraftingStation). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Bloodflare/BloodflareHeadRanged.cs b/Items/Armor/Bloodflare/BloodflareHeadRanged.cs index df4841eaa7..a1bef0cca6 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadRanged.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadRanged.cs @@ -56,6 +56,7 @@ namespace CalamityMod.Items.Armor.Bloodflare AddIngredient(11). AddIngredient(2). AddTile(TileID.LunarCraftingStation). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Bloodflare/BloodflareHeadRogue.cs b/Items/Armor/Bloodflare/BloodflareHeadRogue.cs index a9460e2066..75e086447a 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadRogue.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadRogue.cs @@ -55,6 +55,7 @@ namespace CalamityMod.Items.Armor.Bloodflare AddIngredient(11). AddIngredient(2). AddTile(TileID.LunarCraftingStation). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Bloodflare/BloodflareHeadSummon.cs b/Items/Armor/Bloodflare/BloodflareHeadSummon.cs index 1cb061cd35..0aa577c5bb 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadSummon.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadSummon.cs @@ -56,6 +56,7 @@ namespace CalamityMod.Items.Armor.Bloodflare AddIngredient(11). AddIngredient(2). AddTile(TileID.LunarCraftingStation). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Brimflame/BrimflameRobes.cs b/Items/Armor/Brimflame/BrimflameRobes.cs index 489a3a5222..5bf558ddb0 100644 --- a/Items/Armor/Brimflame/BrimflameRobes.cs +++ b/Items/Armor/Brimflame/BrimflameRobes.cs @@ -42,6 +42,7 @@ namespace CalamityMod.Items.Armor.Brimflame AddIngredient(8). AddIngredient(4). AddTile(TileID.MythrilAnvil). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Brimflame/BrimflameScowl.cs b/Items/Armor/Brimflame/BrimflameScowl.cs index 3f6d5cae92..d141cd8f5c 100644 --- a/Items/Armor/Brimflame/BrimflameScowl.cs +++ b/Items/Armor/Brimflame/BrimflameScowl.cs @@ -87,6 +87,7 @@ namespace CalamityMod.Items.Armor.Brimflame AddIngredient(4). AddIngredient(2). AddTile(TileID.MythrilAnvil). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Daedalus/DaedalusHeadMagic.cs b/Items/Armor/Daedalus/DaedalusHeadMagic.cs index 175ea3b048..1601c041ce 100644 --- a/Items/Armor/Daedalus/DaedalusHeadMagic.cs +++ b/Items/Armor/Daedalus/DaedalusHeadMagic.cs @@ -53,6 +53,7 @@ namespace CalamityMod.Items.Armor.Daedalus AddIngredient(7). AddIngredient(). AddTile(TileID.MythrilAnvil). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Daedalus/DaedalusHeadMelee.cs b/Items/Armor/Daedalus/DaedalusHeadMelee.cs index f7fc612265..1b63761a78 100644 --- a/Items/Armor/Daedalus/DaedalusHeadMelee.cs +++ b/Items/Armor/Daedalus/DaedalusHeadMelee.cs @@ -52,6 +52,7 @@ namespace CalamityMod.Items.Armor.Daedalus AddIngredient(7). AddIngredient(). AddTile(TileID.MythrilAnvil). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Daedalus/DaedalusHeadRanged.cs b/Items/Armor/Daedalus/DaedalusHeadRanged.cs index 1209a9ebc0..bf2f380bd3 100644 --- a/Items/Armor/Daedalus/DaedalusHeadRanged.cs +++ b/Items/Armor/Daedalus/DaedalusHeadRanged.cs @@ -52,6 +52,7 @@ namespace CalamityMod.Items.Armor.Daedalus AddIngredient(7). AddIngredient(). AddTile(TileID.MythrilAnvil). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Daedalus/DaedalusHeadRogue.cs b/Items/Armor/Daedalus/DaedalusHeadRogue.cs index 67bcabda36..b6324b20b7 100644 --- a/Items/Armor/Daedalus/DaedalusHeadRogue.cs +++ b/Items/Armor/Daedalus/DaedalusHeadRogue.cs @@ -55,6 +55,7 @@ namespace CalamityMod.Items.Armor.Daedalus AddIngredient(7). AddIngredient(). AddTile(TileID.MythrilAnvil). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Daedalus/DaedalusHeadSummon.cs b/Items/Armor/Daedalus/DaedalusHeadSummon.cs index 5f85a4c3ef..a772d58d53 100644 --- a/Items/Armor/Daedalus/DaedalusHeadSummon.cs +++ b/Items/Armor/Daedalus/DaedalusHeadSummon.cs @@ -15,6 +15,8 @@ namespace CalamityMod.Items.Armor.Daedalus public class DaedalusHeadSummon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + public static int CrystalDamage = 95; + public override void SetDefaults() { Item.width = 18; @@ -49,12 +51,10 @@ namespace CalamityMod.Items.Armor.Daedalus } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - // 08DEC2023: Ozzatron: Daedalus Crystals spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. - int baseDamage = player.ApplyArmorAccDamageBonusesTo(95); - var damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + var damage = (int)player.GetTotalDamage().ApplyTo(CrystalDamage); var p = Projectile.NewProjectileDirect(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 50f, 0f); - p.originalDamage = baseDamage; + p.originalDamage = CrystalDamage; } } player.GetDamage() += 0.2f; @@ -72,6 +72,7 @@ namespace CalamityMod.Items.Armor.Daedalus AddIngredient(7). AddIngredient(). AddTile(TileID.MythrilAnvil). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Demonshade/DemonshadeHelm.cs b/Items/Armor/Demonshade/DemonshadeHelm.cs index ee253fedab..9f714219db 100644 --- a/Items/Armor/Demonshade/DemonshadeHelm.cs +++ b/Items/Armor/Demonshade/DemonshadeHelm.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Armor.Demonshade public new string LocalizationCategory => "Items.Armor.PostMoonLord"; public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Custom/AbilitySounds/DemonshadeEnrage"); internal static string ShadowScytheEntitySourceContext => "SetBonus_Calamity_Demonshade"; + public static int DevilDamage = 1000; public override void SetDefaults() { @@ -59,12 +60,10 @@ namespace CalamityMod.Items.Armor.Demonshade } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - // 08DEC2023: Ozzatron: Demonshade Red Devils spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. - var baseDamage = player.ApplyArmorAccDamageBonusesTo(1000); - var damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + int damage = (int)player.GetTotalDamage().ApplyTo(DevilDamage); var devil = Projectile.NewProjectileDirect(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - devil.originalDamage = baseDamage; + devil.originalDamage = DevilDamage; } } player.GetDamage() += 1f; @@ -82,6 +81,7 @@ namespace CalamityMod.Items.Armor.Demonshade CreateRecipe(). AddIngredient(12). AddTile(). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/DesertProwler/DesertProwlerSet.cs b/Items/Armor/DesertProwler/DesertProwlerSet.cs index d2afe3d3aa..d29bc40ab5 100644 --- a/Items/Armor/DesertProwler/DesertProwlerSet.cs +++ b/Items/Armor/DesertProwler/DesertProwlerSet.cs @@ -236,6 +236,7 @@ namespace CalamityMod.Items.Armor.DesertProwler AddIngredient(3). AddIngredient(ItemID.Silk, 10). AddTile(TileID.Loom). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Empyrean/EmpyreanMask.cs b/Items/Armor/Empyrean/EmpyreanMask.cs index 2dcd7472d1..cfed0d75cc 100644 --- a/Items/Armor/Empyrean/EmpyreanMask.cs +++ b/Items/Armor/Empyrean/EmpyreanMask.cs @@ -68,10 +68,7 @@ namespace CalamityMod.Items.Armor.Empyrean modPlayer.rogueStealthMax += 1.15f; player.setBonus = this.GetLocalizedValue("SetBonus"); if (player.statLife <= (int)(player.statLifeMax2 * 0.5)) - { player.AddBuff(ModContent.BuffType(), 2); - player.AddBuff(ModContent.BuffType(), 2); - } player.GetDamage() += 0.09f; modPlayer.rogueVelocity += 0.09f; modPlayer.wearingRogueArmor = true; @@ -90,6 +87,7 @@ namespace CalamityMod.Items.Armor.Empyrean AddIngredient(10). AddIngredient(ItemID.LunarBar, 8). AddTile(TileID.LunarCraftingStation). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/FathomSwarmer/FathomSwarmerBoots.cs b/Items/Armor/FathomSwarmer/FathomSwarmerBoots.cs index cf89c37fa3..33257e3b8b 100644 --- a/Items/Armor/FathomSwarmer/FathomSwarmerBoots.cs +++ b/Items/Armor/FathomSwarmer/FathomSwarmerBoots.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/FathomSwarmer/FathomSwarmerBreastplate.cs b/Items/Armor/FathomSwarmer/FathomSwarmerBreastplate.cs index f606b5f05e..f08a2fdb0b 100644 --- a/Items/Armor/FathomSwarmer/FathomSwarmerBreastplate.cs +++ b/Items/Armor/FathomSwarmer/FathomSwarmerBreastplate.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -46,6 +46,7 @@ namespace CalamityMod.Items.Armor.FathomSwarmer AddIngredient(10). AddIngredient(5). AddTile(TileID.MythrilAnvil). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/FathomSwarmer/FathomSwarmerVisage.cs b/Items/Armor/FathomSwarmer/FathomSwarmerVisage.cs index 0b1ccd16b7..5902d4e52b 100644 --- a/Items/Armor/FathomSwarmer/FathomSwarmerVisage.cs +++ b/Items/Armor/FathomSwarmer/FathomSwarmerVisage.cs @@ -1,6 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -70,6 +70,7 @@ namespace CalamityMod.Items.Armor.FathomSwarmer AddIngredient(6). AddIngredient(3). AddTile(TileID.MythrilAnvil). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Fearmonger/FearmongerPlateMail.cs b/Items/Armor/Fearmonger/FearmongerPlateMail.cs index 90e02017e5..5226b1d0d7 100644 --- a/Items/Armor/Fearmonger/FearmongerPlateMail.cs +++ b/Items/Armor/Fearmonger/FearmongerPlateMail.cs @@ -36,6 +36,7 @@ namespace CalamityMod.Items.Armor.Fearmonger AddIngredient(3). AddIngredient(ItemID.SoulofFright, 12). AddTile(). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/GemTech/GemTechHeadgear.cs b/Items/Armor/GemTech/GemTechHeadgear.cs index 1a7dd7e305..b35d684234 100644 --- a/Items/Armor/GemTech/GemTechHeadgear.cs +++ b/Items/Armor/GemTech/GemTechHeadgear.cs @@ -162,6 +162,7 @@ namespace CalamityMod.Items.Armor.GemTech AddIngredient(3). AddIngredient(2). AddTile(). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/GodSlayer/GodSlayerHeadMelee.cs b/Items/Armor/GodSlayer/GodSlayerHeadMelee.cs index 251f1f7b3a..f03824f29d 100644 --- a/Items/Armor/GodSlayer/GodSlayerHeadMelee.cs +++ b/Items/Armor/GodSlayer/GodSlayerHeadMelee.cs @@ -62,6 +62,7 @@ namespace CalamityMod.Items.Armor.GodSlayer AddIngredient(7). AddIngredient(2). AddTile(). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs b/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs index f5fcdee6ef..0807eb0f7a 100644 --- a/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs +++ b/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs @@ -59,6 +59,7 @@ namespace CalamityMod.Items.Armor.GodSlayer AddIngredient(7). AddIngredient(2). AddTile(). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/GodSlayer/GodSlayerHeadRogue.cs b/Items/Armor/GodSlayer/GodSlayerHeadRogue.cs index 5aa027e58f..a83dde4503 100644 --- a/Items/Armor/GodSlayer/GodSlayerHeadRogue.cs +++ b/Items/Armor/GodSlayer/GodSlayerHeadRogue.cs @@ -62,6 +62,7 @@ namespace CalamityMod.Items.Armor.GodSlayer AddIngredient(7). AddIngredient(2). AddTile(). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Hydrothermic/HydrothermicArmor.cs b/Items/Armor/Hydrothermic/HydrothermicArmor.cs index 9dcc979f64..b1801d6c38 100644 --- a/Items/Armor/Hydrothermic/HydrothermicArmor.cs +++ b/Items/Armor/Hydrothermic/HydrothermicArmor.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic { CreateRecipe(). AddIngredient(15). - AddIngredient(3). + AddIngredient(3). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs b/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs index 75ac9ea103..6bf014726a 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs @@ -54,8 +54,9 @@ namespace CalamityMod.Items.Armor.Hydrothermic { CreateRecipe(). AddIngredient(7). - AddIngredient(). + AddIngredient(). AddTile(TileID.MythrilAnvil). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadMelee.cs b/Items/Armor/Hydrothermic/HydrothermicHeadMelee.cs index 33fbbab286..c72ee844af 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadMelee.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadMelee.cs @@ -56,8 +56,9 @@ namespace CalamityMod.Items.Armor.Hydrothermic { CreateRecipe(). AddIngredient(7). - AddIngredient(). + AddIngredient(). AddTile(TileID.MythrilAnvil). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs b/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs index e62bf09a14..2a34472a13 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs @@ -53,8 +53,9 @@ namespace CalamityMod.Items.Armor.Hydrothermic { CreateRecipe(). AddIngredient(7). - AddIngredient(). + AddIngredient(). AddTile(TileID.MythrilAnvil). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadRogue.cs b/Items/Armor/Hydrothermic/HydrothermicHeadRogue.cs index 5abfac1be7..14b8cc7a60 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadRogue.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadRogue.cs @@ -56,8 +56,9 @@ namespace CalamityMod.Items.Armor.Hydrothermic { CreateRecipe(). AddIngredient(7). - AddIngredient(). + AddIngredient(). AddTile(TileID.MythrilAnvil). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs b/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs index b246aae0eb..8b736ec857 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs @@ -14,6 +14,8 @@ namespace CalamityMod.Items.Armor.Hydrothermic public class HydrothermicHeadSummon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + public static int VentDamage = 190; + public override void SetDefaults() { Item.width = 18; @@ -49,13 +51,11 @@ namespace CalamityMod.Items.Armor.Hydrothermic } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - // 08DEC2023: Ozzatron: Hydrothermic Vents spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. - int baseDamage = player.ApplyArmorAccDamageBonusesTo(190); - var damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + var damage = (int)player.GetTotalDamage().ApplyTo(VentDamage); var p = Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 38f, 0f); if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = baseDamage; + Main.projectile[p].originalDamage = VentDamage; } } player.GetDamage() += 0.4f; @@ -74,8 +74,9 @@ namespace CalamityMod.Items.Armor.Hydrothermic { CreateRecipe(). AddIngredient(7). - AddIngredient(). + AddIngredient(). AddTile(TileID.MythrilAnvil). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Hydrothermic/HydrothermicSubligar.cs b/Items/Armor/Hydrothermic/HydrothermicSubligar.cs index 95b528c3c7..7fc86d2269 100644 --- a/Items/Armor/Hydrothermic/HydrothermicSubligar.cs +++ b/Items/Armor/Hydrothermic/HydrothermicSubligar.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic { CreateRecipe(). AddIngredient(10). - AddIngredient(2). + AddIngredient(2). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Armor/LunicCorps/LunicCorpsHelmet.cs b/Items/Armor/LunicCorps/LunicCorpsHelmet.cs index 97c2c4fde9..dec4807632 100644 --- a/Items/Armor/LunicCorps/LunicCorpsHelmet.cs +++ b/Items/Armor/LunicCorps/LunicCorpsHelmet.cs @@ -107,6 +107,7 @@ namespace CalamityMod.Items.Armor.LunicCorps AddIngredient(ItemID.ChlorophyteBar, 6). AddIngredient(ItemID.Glass, 20). AddTile(TileID.LunarCraftingStation). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/LunicCorps/LunicCorpsVest.cs b/Items/Armor/LunicCorps/LunicCorpsVest.cs index 104d829934..d78dd9fed0 100644 --- a/Items/Armor/LunicCorps/LunicCorpsVest.cs +++ b/Items/Armor/LunicCorps/LunicCorpsVest.cs @@ -33,6 +33,7 @@ namespace CalamityMod.Items.Armor.LunicCorps AddIngredient(11). AddIngredient(ItemID.ChlorophyteBar, 11). AddTile(TileID.LunarCraftingStation). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Mollusk/MolluskShelleggings.cs b/Items/Armor/Mollusk/MolluskShelleggings.cs index ed92e3077d..5b2afdc3c7 100644 --- a/Items/Armor/Mollusk/MolluskShelleggings.cs +++ b/Items/Armor/Mollusk/MolluskShelleggings.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/Mollusk/MolluskShellmet.cs b/Items/Armor/Mollusk/MolluskShellmet.cs index ac81a9a397..8b5db6f70e 100644 --- a/Items/Armor/Mollusk/MolluskShellmet.cs +++ b/Items/Armor/Mollusk/MolluskShellmet.cs @@ -1,7 +1,7 @@ using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; @@ -15,6 +15,8 @@ namespace CalamityMod.Items.Armor.Mollusk public class MolluskShellmet : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + public static int ShellfishDamage = 140; + public override void SetDefaults() { Item.width = 22; @@ -52,12 +54,8 @@ namespace CalamityMod.Items.Armor.Mollusk } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 2) { - // 08DEC2023: Ozzatron: Clams spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. - int baseDamage = player.ApplyArmorAccDamageBonusesTo(140); - // wait why does this not scale with summon damage - - Projectile clam = Projectile.NewProjectileDirect(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), baseDamage, 0f, player.whoAmI); - clam.originalDamage = baseDamage; + Projectile clam = Projectile.NewProjectileDirect(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), ShellfishDamage, 0f, player.whoAmI); + clam.originalDamage = ShellfishDamage; } } player.Calamity().wearingRogueArmor = true; @@ -69,6 +67,7 @@ namespace CalamityMod.Items.Armor.Mollusk AddIngredient(6). AddIngredient(15). AddTile(TileID.Anvils). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Mollusk/MolluskShellplate.cs b/Items/Armor/Mollusk/MolluskShellplate.cs index f8813d3250..33d3dea500 100644 --- a/Items/Armor/Mollusk/MolluskShellplate.cs +++ b/Items/Armor/Mollusk/MolluskShellplate.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -32,6 +32,7 @@ namespace CalamityMod.Items.Armor.Mollusk AddIngredient(15). AddIngredient(25). AddTile(TileID.Anvils). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs b/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs index c346df4cee..60b3e78e26 100644 --- a/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs +++ b/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs @@ -94,6 +94,7 @@ namespace CalamityMod.Items.Armor.OmegaBlue AddIngredient(12). AddIngredient(). AddTile(TileID.LunarCraftingStation). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/PlagueReaper/PlagueReaperMask.cs b/Items/Armor/PlagueReaper/PlagueReaperMask.cs index 743937c551..db072699e0 100644 --- a/Items/Armor/PlagueReaper/PlagueReaperMask.cs +++ b/Items/Armor/PlagueReaper/PlagueReaperMask.cs @@ -61,7 +61,6 @@ namespace CalamityMod.Items.Armor.PlagueReaper if (player.miscCounter % 10 == 0) { var damage = (int)player.GetTotalDamage().ApplyTo(40); - damage = player.ApplyArmorAccDamageBonusesTo(damage); var cinder = CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), damage, 4f, player.whoAmI); if (cinder.whoAmI.WithinBounds(Main.maxProjectiles)) diff --git a/Items/Armor/PlagueReaper/PlagueReaperVest.cs b/Items/Armor/PlagueReaper/PlagueReaperVest.cs index 02b6c3132a..c4b5eded5b 100644 --- a/Items/Armor/PlagueReaper/PlagueReaperVest.cs +++ b/Items/Armor/PlagueReaper/PlagueReaperVest.cs @@ -33,6 +33,7 @@ namespace CalamityMod.Items.Armor.PlagueReaper AddIngredient(29). AddIngredient(ItemID.Nanites, 19). AddTile(TileID.MythrilAnvil). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Plaguebringer/PlaguebringerVisor.cs b/Items/Armor/Plaguebringer/PlaguebringerVisor.cs index 91ce5dc249..92ed645a33 100644 --- a/Items/Armor/Plaguebringer/PlaguebringerVisor.cs +++ b/Items/Armor/Plaguebringer/PlaguebringerVisor.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.Armor.Plaguebringer { public new string LocalizationCategory => "Items.Armor.Hardmode"; public const int PlagueDashIFrames = 12; + public static int BeeMinionDamage = 25; public override void SetDefaults() { @@ -58,13 +59,11 @@ namespace CalamityMod.Items.Armor.Plaguebringer } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - // 08DEC2023: Ozzatron: Plaguebringer armor dudes spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. - int baseDamage = player.ApplyArmorAccDamageBonusesTo(25); - var damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + var damage = (int)player.GetTotalDamage().ApplyTo(BeeMinionDamage); var p = Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), damage, 0f, player.whoAmI, 0f, 0f); if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = baseDamage; + Main.projectile[p].originalDamage = BeeMinionDamage; } } @@ -79,6 +78,7 @@ namespace CalamityMod.Items.Armor.Plaguebringer AddIngredient(4). AddIngredient(4). AddTile(TileID.MythrilAnvil). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Prismatic/PrismaticHelmet.cs b/Items/Armor/Prismatic/PrismaticHelmet.cs index cb71e7273a..fa39d36891 100644 --- a/Items/Armor/Prismatic/PrismaticHelmet.cs +++ b/Items/Armor/Prismatic/PrismaticHelmet.cs @@ -61,6 +61,7 @@ namespace CalamityMod.Items.Armor.Prismatic AddIngredient(4). AddIngredient(ItemID.Nanites, 300). AddTile(TileID.LunarCraftingStation). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Prismatic/PrismaticRegalia.cs b/Items/Armor/Prismatic/PrismaticRegalia.cs index cf33906e55..960e7b4a34 100644 --- a/Items/Armor/Prismatic/PrismaticRegalia.cs +++ b/Items/Armor/Prismatic/PrismaticRegalia.cs @@ -53,6 +53,7 @@ namespace CalamityMod.Items.Armor.Prismatic AddIngredient(8). AddIngredient(ItemID.Nanites, 300). AddTile(TileID.LunarCraftingStation). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Reaver/ReaverHeadExplore.cs b/Items/Armor/Reaver/ReaverHeadExplore.cs index 4fb96d018e..116c8e422e 100644 --- a/Items/Armor/Reaver/ReaverHeadExplore.cs +++ b/Items/Armor/Reaver/ReaverHeadExplore.cs @@ -78,6 +78,7 @@ namespace CalamityMod.Items.Armor.Reaver AddIngredient(7). AddIngredient(). AddTile(TileID.MythrilAnvil). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Reaver/ReaverHeadMobility.cs b/Items/Armor/Reaver/ReaverHeadMobility.cs index 5ae977cc60..f6f861a712 100644 --- a/Items/Armor/Reaver/ReaverHeadMobility.cs +++ b/Items/Armor/Reaver/ReaverHeadMobility.cs @@ -56,6 +56,7 @@ namespace CalamityMod.Items.Armor.Reaver AddIngredient(7). AddIngredient(). AddTile(TileID.MythrilAnvil). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Reaver/ReaverHeadTank.cs b/Items/Armor/Reaver/ReaverHeadTank.cs index 77d56d0339..4daabc64d8 100644 --- a/Items/Armor/Reaver/ReaverHeadTank.cs +++ b/Items/Armor/Reaver/ReaverHeadTank.cs @@ -62,6 +62,7 @@ namespace CalamityMod.Items.Armor.Reaver AddIngredient(7). AddIngredient(). AddTile(TileID.MythrilAnvil). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Reaver/ReaverScaleMail.cs b/Items/Armor/Reaver/ReaverScaleMail.cs index ef24dc9ec5..43de28e502 100644 --- a/Items/Armor/Reaver/ReaverScaleMail.cs +++ b/Items/Armor/Reaver/ReaverScaleMail.cs @@ -43,6 +43,7 @@ namespace CalamityMod.Items.Armor.Reaver AddIngredient(15). AddIngredient(3). AddTile(TileID.MythrilAnvil). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Silva/SilvaArmor.cs b/Items/Armor/Silva/SilvaArmor.cs index c9f6fa1c0a..0aa94e0c19 100644 --- a/Items/Armor/Silva/SilvaArmor.cs +++ b/Items/Armor/Silva/SilvaArmor.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; diff --git a/Items/Armor/Silva/SilvaHeadMagic.cs b/Items/Armor/Silva/SilvaHeadMagic.cs index f74ca35b2b..468d54a814 100644 --- a/Items/Armor/Silva/SilvaHeadMagic.cs +++ b/Items/Armor/Silva/SilvaHeadMagic.cs @@ -1,6 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; @@ -56,6 +56,7 @@ namespace CalamityMod.Items.Armor.Silva AddIngredient(5). AddIngredient(2). AddTile(). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Silva/SilvaHeadSummon.cs b/Items/Armor/Silva/SilvaHeadSummon.cs index 5901af6fac..d6d3c29800 100644 --- a/Items/Armor/Silva/SilvaHeadSummon.cs +++ b/Items/Armor/Silva/SilvaHeadSummon.cs @@ -1,7 +1,7 @@ using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; @@ -61,6 +61,7 @@ namespace CalamityMod.Items.Armor.Silva AddIngredient(5). AddIngredient(2). AddTile(). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Silva/SilvaLeggings.cs b/Items/Armor/Silva/SilvaLeggings.cs index 887ee8d864..9a7be46dde 100644 --- a/Items/Armor/Silva/SilvaLeggings.cs +++ b/Items/Armor/Silva/SilvaLeggings.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; diff --git a/Items/Armor/SnowRuffian/SnowRuffianMask.cs b/Items/Armor/SnowRuffian/SnowRuffianMask.cs index f995a21e32..20ea54216f 100644 --- a/Items/Armor/SnowRuffian/SnowRuffianMask.cs +++ b/Items/Armor/SnowRuffian/SnowRuffianMask.cs @@ -71,6 +71,7 @@ namespace CalamityMod.Items.Armor.SnowRuffian AddRecipeGroup("AnySnowBlock", 20). AddIngredient(ItemID.FlinxFur). AddTile(TileID.Anvils). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Statigel/StatigelHeadMagic.cs b/Items/Armor/Statigel/StatigelHeadMagic.cs index c5539d4e86..e4c60df6fc 100644 --- a/Items/Armor/Statigel/StatigelHeadMagic.cs +++ b/Items/Armor/Statigel/StatigelHeadMagic.cs @@ -50,6 +50,7 @@ namespace CalamityMod.Items.Armor.Statigel AddIngredient(5). AddIngredient(5). AddTile(). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Statigel/StatigelHeadMelee.cs b/Items/Armor/Statigel/StatigelHeadMelee.cs index e969579b15..078d4805df 100644 --- a/Items/Armor/Statigel/StatigelHeadMelee.cs +++ b/Items/Armor/Statigel/StatigelHeadMelee.cs @@ -50,6 +50,7 @@ namespace CalamityMod.Items.Armor.Statigel AddIngredient(5). AddIngredient(5). AddTile(). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Statigel/StatigelHeadRanged.cs b/Items/Armor/Statigel/StatigelHeadRanged.cs index fa19f1e0e4..25820004c8 100644 --- a/Items/Armor/Statigel/StatigelHeadRanged.cs +++ b/Items/Armor/Statigel/StatigelHeadRanged.cs @@ -48,6 +48,7 @@ namespace CalamityMod.Items.Armor.Statigel AddIngredient(5). AddIngredient(5). AddTile(). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Statigel/StatigelHeadRogue.cs b/Items/Armor/Statigel/StatigelHeadRogue.cs index eb6e0d4bbf..b53f7d2db3 100644 --- a/Items/Armor/Statigel/StatigelHeadRogue.cs +++ b/Items/Armor/Statigel/StatigelHeadRogue.cs @@ -52,6 +52,7 @@ namespace CalamityMod.Items.Armor.Statigel AddIngredient(5). AddIngredient(5). AddTile(). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Statigel/StatigelHeadSummon.cs b/Items/Armor/Statigel/StatigelHeadSummon.cs index e6cbde0e68..44b9d4b2f4 100644 --- a/Items/Armor/Statigel/StatigelHeadSummon.cs +++ b/Items/Armor/Statigel/StatigelHeadSummon.cs @@ -16,6 +16,8 @@ namespace CalamityMod.Items.Armor.Statigel public class StatigelHeadSummon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + public static int SlimeDamage = 18; + public override void SetDefaults() { Item.width = 18; @@ -49,11 +51,8 @@ namespace CalamityMod.Items.Armor.Statigel player.AddBuff(ModContent.BuffType(), 3600, true); } - var minionID = -1; - - // 08DEC2023: Ozzatron: Corruption and Crimson Slimes spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. - var baseDamage = player.ApplyArmorAccDamageBonusesTo(18); - var minionDamage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + int minionID = -1; + int minionDamage = (int)player.GetTotalDamage().ApplyTo(SlimeDamage); if (WorldGen.crimson && player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) minionID = Projectile.NewProjectile(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), minionDamage, 0f, Main.myPlayer); @@ -61,7 +60,7 @@ namespace CalamityMod.Items.Armor.Statigel minionID = Projectile.NewProjectile(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), minionDamage, 0f, Main.myPlayer); if (Main.projectile.IndexInRange(minionID)) - Main.projectile[minionID].originalDamage = baseDamage; + Main.projectile[minionID].originalDamage = SlimeDamage; } } @@ -76,6 +75,7 @@ namespace CalamityMod.Items.Armor.Statigel AddIngredient(5). AddIngredient(5). AddTile(). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Sulphurous/SulphurousBreastplate.cs b/Items/Armor/Sulphurous/SulphurousBreastplate.cs index 6848c2825b..bf6118be31 100644 --- a/Items/Armor/Sulphurous/SulphurousBreastplate.cs +++ b/Items/Armor/Sulphurous/SulphurousBreastplate.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/Sulphurous/SulphurousHelmet.cs b/Items/Armor/Sulphurous/SulphurousHelmet.cs index f7375d88c0..2f3b5b0f9f 100644 --- a/Items/Armor/Sulphurous/SulphurousHelmet.cs +++ b/Items/Armor/Sulphurous/SulphurousHelmet.cs @@ -1,7 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.ExtraJumps; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -52,6 +52,7 @@ namespace CalamityMod.Items.Armor.Sulphurous AddIngredient(10). AddIngredient(10). AddTile(TileID.Anvils). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Sulphurous/SulphurousLeggings.cs b/Items/Armor/Sulphurous/SulphurousLeggings.cs index 5968958d92..ada7ef2a1b 100644 --- a/Items/Armor/Sulphurous/SulphurousLeggings.cs +++ b/Items/Armor/Sulphurous/SulphurousLeggings.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/Tarragon/TarragonHeadMagic.cs b/Items/Armor/Tarragon/TarragonHeadMagic.cs index b46d33d1a1..d51fa12857 100644 --- a/Items/Armor/Tarragon/TarragonHeadMagic.cs +++ b/Items/Armor/Tarragon/TarragonHeadMagic.cs @@ -55,6 +55,7 @@ namespace CalamityMod.Items.Armor.Tarragon AddIngredient(7). AddIngredient(6). AddTile(TileID.LunarCraftingStation). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Tarragon/TarragonHeadMelee.cs b/Items/Armor/Tarragon/TarragonHeadMelee.cs index a4318fd9fa..435fc4eb27 100644 --- a/Items/Armor/Tarragon/TarragonHeadMelee.cs +++ b/Items/Armor/Tarragon/TarragonHeadMelee.cs @@ -56,6 +56,7 @@ namespace CalamityMod.Items.Armor.Tarragon AddIngredient(7). AddIngredient(6). AddTile(TileID.LunarCraftingStation). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Tarragon/TarragonHeadRanged.cs b/Items/Armor/Tarragon/TarragonHeadRanged.cs index 792ea770cb..7d29dbab8a 100644 --- a/Items/Armor/Tarragon/TarragonHeadRanged.cs +++ b/Items/Armor/Tarragon/TarragonHeadRanged.cs @@ -53,6 +53,7 @@ namespace CalamityMod.Items.Armor.Tarragon AddIngredient(7). AddIngredient(6). AddTile(TileID.LunarCraftingStation). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Tarragon/TarragonHeadRogue.cs b/Items/Armor/Tarragon/TarragonHeadRogue.cs index f23bb9b49f..91f8785758 100644 --- a/Items/Armor/Tarragon/TarragonHeadRogue.cs +++ b/Items/Armor/Tarragon/TarragonHeadRogue.cs @@ -56,6 +56,7 @@ namespace CalamityMod.Items.Armor.Tarragon AddIngredient(7). AddIngredient(6). AddTile(TileID.LunarCraftingStation). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Tarragon/TarragonHeadSummon.cs b/Items/Armor/Tarragon/TarragonHeadSummon.cs index c7cccc2570..ebaadb2a02 100644 --- a/Items/Armor/Tarragon/TarragonHeadSummon.cs +++ b/Items/Armor/Tarragon/TarragonHeadSummon.cs @@ -57,6 +57,7 @@ namespace CalamityMod.Items.Armor.Tarragon AddIngredient(7). AddIngredient(6). AddTile(TileID.LunarCraftingStation). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/TitanHeart/TitanHeartBoots.cs b/Items/Armor/TitanHeart/TitanHeartBoots.cs index a63ac888c6..ae7ef7e9f4 100644 --- a/Items/Armor/TitanHeart/TitanHeartBoots.cs +++ b/Items/Armor/TitanHeart/TitanHeartBoots.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Astral; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/TitanHeart/TitanHeartMantle.cs b/Items/Armor/TitanHeart/TitanHeartMantle.cs index cc8ca16d7c..25c7e691f8 100644 --- a/Items/Armor/TitanHeart/TitanHeartMantle.cs +++ b/Items/Armor/TitanHeart/TitanHeartMantle.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Astral; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -45,6 +45,7 @@ namespace CalamityMod.Items.Armor.TitanHeart AddIngredient(20). AddIngredient(). AddTile(TileID.Anvils). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/TitanHeart/TitanHeartMask.cs b/Items/Armor/TitanHeart/TitanHeartMask.cs index 850e1feb01..479a5b5b25 100644 --- a/Items/Armor/TitanHeart/TitanHeartMask.cs +++ b/Items/Armor/TitanHeart/TitanHeartMask.cs @@ -1,6 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Astral; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -49,6 +49,7 @@ namespace CalamityMod.Items.Armor.TitanHeart AddIngredient(10). AddIngredient(). AddTile(TileID.Anvils). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Umbraphile/UmbraphileHood.cs b/Items/Armor/Umbraphile/UmbraphileHood.cs index d9722652e7..b935ff30d4 100644 --- a/Items/Armor/Umbraphile/UmbraphileHood.cs +++ b/Items/Armor/Umbraphile/UmbraphileHood.cs @@ -50,6 +50,7 @@ namespace CalamityMod.Items.Armor.Umbraphile AddIngredient(12). AddIngredient(ItemID.HallowedBar, 8). AddTile(TileID.MythrilAnvil). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Umbraphile/UmbraphileRegalia.cs b/Items/Armor/Umbraphile/UmbraphileRegalia.cs index cffbf86c76..f51f69af89 100644 --- a/Items/Armor/Umbraphile/UmbraphileRegalia.cs +++ b/Items/Armor/Umbraphile/UmbraphileRegalia.cs @@ -30,6 +30,7 @@ namespace CalamityMod.Items.Armor.Umbraphile AddIngredient(18). AddIngredient(ItemID.HallowedBar, 15). AddTile(TileID.MythrilAnvil). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Victide/VictideHeadMagic.cs b/Items/Armor/Victide/VictideHeadMagic.cs index c7401a7cac..87d322f52f 100644 --- a/Items/Armor/Victide/VictideHeadMagic.cs +++ b/Items/Armor/Victide/VictideHeadMagic.cs @@ -48,6 +48,7 @@ namespace CalamityMod.Items.Armor.Victide CreateRecipe(). AddIngredient(3). AddTile(TileID.Anvils). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Victide/VictideHeadMelee.cs b/Items/Armor/Victide/VictideHeadMelee.cs index 213c0a8720..9c97518add 100644 --- a/Items/Armor/Victide/VictideHeadMelee.cs +++ b/Items/Armor/Victide/VictideHeadMelee.cs @@ -49,6 +49,7 @@ namespace CalamityMod.Items.Armor.Victide CreateRecipe(). AddIngredient(3). AddTile(TileID.Anvils). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Victide/VictideHeadRanged.cs b/Items/Armor/Victide/VictideHeadRanged.cs index c320003da6..068abd2914 100644 --- a/Items/Armor/Victide/VictideHeadRanged.cs +++ b/Items/Armor/Victide/VictideHeadRanged.cs @@ -48,6 +48,7 @@ namespace CalamityMod.Items.Armor.Victide CreateRecipe(). AddIngredient(3). AddTile(TileID.Anvils). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Victide/VictideHeadRogue.cs b/Items/Armor/Victide/VictideHeadRogue.cs index b08263d4e0..1ebfa59ea6 100644 --- a/Items/Armor/Victide/VictideHeadRogue.cs +++ b/Items/Armor/Victide/VictideHeadRogue.cs @@ -50,6 +50,7 @@ namespace CalamityMod.Items.Armor.Victide CreateRecipe(). AddIngredient(3). AddTile(TileID.Anvils). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Victide/VictideHeadSummon.cs b/Items/Armor/Victide/VictideHeadSummon.cs index 48ca1c5af8..3d2d7683ce 100644 --- a/Items/Armor/Victide/VictideHeadSummon.cs +++ b/Items/Armor/Victide/VictideHeadSummon.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.Armor.Victide public class VictideHeadSummon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + public static int SnailDamage = 7; public override void SetDefaults() { @@ -46,13 +47,11 @@ namespace CalamityMod.Items.Armor.Victide var source = player.GetSource_ItemUse(Item); if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - // 08DEC2023: Ozzatron: Victide Sea Snails spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. - var baseDamage = player.ApplyArmorAccDamageBonusesTo(7); - var minionDamage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + int minionDamage = (int)player.GetTotalDamage().ApplyTo(SnailDamage); var p = Projectile.NewProjectile(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), minionDamage, 0f, Main.myPlayer, 0f, 0f); if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = baseDamage; + Main.projectile[p].originalDamage = SnailDamage; } } player.ignoreWater = true; @@ -73,6 +72,7 @@ namespace CalamityMod.Items.Armor.Victide CreateRecipe(). AddIngredient(3). AddTile(TileID.Anvils). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Wulfrum/WulfrumFusionCannon.cs b/Items/Armor/Wulfrum/WulfrumFusionCannon.cs index 1f362e3ed1..972d5cf59f 100644 --- a/Items/Armor/Wulfrum/WulfrumFusionCannon.cs +++ b/Items/Armor/Wulfrum/WulfrumFusionCannon.cs @@ -80,9 +80,6 @@ namespace CalamityMod.Items.Armor.Wulfrum public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) { velocity = velocity.RotatedByRandom(MathHelper.PiOver4 * 0.1f); - - // This weapon is acquired through usage of an armor set bonus and thus counts as armor. This function must be used. - damage = player.ApplyArmorAccDamageBonusesTo(damage); } public override bool CanUseItem(Player player) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index a7487c8cb8..80e2cfab7a 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -7,6 +7,8 @@ using CalamityMod.CalPlayer; using CalamityMod.Enums; using CalamityMod.Events; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Potions; +using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; @@ -139,6 +141,8 @@ namespace CalamityMod.Items #region Vanilla Wing Tweaks // 170 -> 240 flight time ArmorIDs.Wing.Sets.Stats[(int)VanillaWingID.BoneWings] = new WingStats(240, 7.5f, 1f); + // 170 -> 200 flight time + ArmorIDs.Wing.Sets.Stats[(int)VanillaWingID.MothronWings] = new WingStats(200, 7.5f); // (Empress Wings) 150 -> 100 flight time ArmorIDs.Wing.Sets.Stats[(int)VanillaWingID.RainbowWings] = new WingStats(100, 8f, 2f); @@ -254,6 +258,7 @@ namespace CalamityMod.Items public override bool Shoot(Item item, Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockBack) { CalamityPlayer modPlayer = player.Calamity(); + var playerSource = player.GetSource_FromThis(); if (Main.myPlayer == player.whoAmI && player.Calamity().cursedSummonsEnchant) { if (NPC.CountNPCS(ModContent.NPCType()) < 2) @@ -298,22 +303,22 @@ namespace CalamityMod.Items { if (item.CountsAsClass()) { - int meleeDamage = player.ApplyArmorAccDamageBonusesTo(newDamage * 0.25f); + int meleeDamage = (int)(newDamage * 0.25f); if (meleeDamage >= 1) { - int projectile = Projectile.NewProjectile(source, position, velocity * 0.5f, ModContent.ProjectileType(), (int)meleeDamage, 0f, player.whoAmI); + int projectile = Projectile.NewProjectile(playerSource, position, velocity * 0.5f, ModContent.ProjectileType(), (int)meleeDamage, 0f, player.whoAmI); if (projectile.WithinBounds(Main.maxProjectiles)) Main.projectile[projectile].DamageType = DamageClass.Generic; } } else if (item.CountsAsClass()) { - int throwingDamage = player.ApplyArmorAccDamageBonusesTo(newDamage * 0.2f); + int throwingDamage = (int)(newDamage * 0.2f); if (throwingDamage >= 1) { - int projectile = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), (int)throwingDamage, 0f, player.whoAmI); + int projectile = Projectile.NewProjectile(playerSource, position, velocity, ModContent.ProjectileType(), (int)throwingDamage, 0f, player.whoAmI); if (projectile.WithinBounds(Main.maxProjectiles)) Main.projectile[projectile].DamageType = DamageClass.Generic; } @@ -326,11 +331,11 @@ namespace CalamityMod.Items // The projectile is fired inside of the scope's code instead if (type != ModContent.ProjectileType()) { - int rangedDamage = player.ApplyArmorAccDamageBonusesTo(newDamage * 0.15f); + int rangedDamage = (int)(newDamage * 0.15f); if (rangedDamage >= 1) { - int projectile = Projectile.NewProjectile(source, position, velocity * 1.5f, ModContent.ProjectileType(), (int)rangedDamage, 0f, player.whoAmI); + int projectile = Projectile.NewProjectile(playerSource, position, velocity * 1.5f, ModContent.ProjectileType(), (int)rangedDamage, 0f, player.whoAmI); if (projectile.WithinBounds(Main.maxProjectiles)) Main.projectile[projectile].DamageType = DamageClass.Generic; } @@ -338,11 +343,11 @@ namespace CalamityMod.Items } else if (item.CountsAsClass()) { - int magicDamage = player.ApplyArmorAccDamageBonusesTo(newDamage * 0.3f); + int magicDamage = (int)(newDamage * 0.3f); if (magicDamage >= 1) { - int projectile = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), (int)magicDamage, 0f, player.whoAmI); + int projectile = Projectile.NewProjectile(playerSource, position, velocity, ModContent.ProjectileType(), (int)magicDamage, 0f, player.whoAmI); if (projectile.WithinBounds(Main.maxProjectiles)) Main.projectile[projectile].DamageType = DamageClass.Generic; } @@ -351,15 +356,13 @@ namespace CalamityMod.Items { if (damage >= 1) { - // 08DEC2023: Ozzatron: Luxor Summons spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. - int baseDamage = player.ApplyArmorAccDamageBonusesTo(item.damage); - int summonDamage = baseDamage; + int summonDamage = item.damage; - int projectile = Projectile.NewProjectile(source, position, Vector2.Zero, ModContent.ProjectileType(), summonDamage, 0f, player.whoAmI); + int projectile = Projectile.NewProjectile(playerSource, position, Vector2.Zero, ModContent.ProjectileType(), summonDamage, 0f, player.whoAmI); if (projectile.WithinBounds(Main.maxProjectiles)) { Main.projectile[projectile].DamageType = DamageClass.Generic; - Main.projectile[projectile].originalDamage = baseDamage; + Main.projectile[projectile].originalDamage = item.damage; } } } @@ -374,9 +377,8 @@ namespace CalamityMod.Items { // Bloodflare Mage Bolt: 130%, soft cap starts at 2000 base damage int bloodflareBoltDamage = CalamityUtils.DamageSoftCap(damage * 1.3, 2600); - bloodflareBoltDamage = player.ApplyArmorAccDamageBonusesTo(bloodflareBoltDamage); - Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), bloodflareBoltDamage, 1f, player.whoAmI); + Projectile.NewProjectile(playerSource, position, velocity, ModContent.ProjectileType(), bloodflareBoltDamage, 1f, player.whoAmI); } } } @@ -390,9 +392,8 @@ namespace CalamityMod.Items // Bloodflare Ranged Bloodsplosion: 80%, soft cap starts at 150 base damage // This is intentionally extremely low because this effect can be grossly overpowered with sniper rifles and the like. int bloodsplosionDamage = CalamityUtils.DamageSoftCap(damage * 0.8, 120); - bloodsplosionDamage = player.ApplyArmorAccDamageBonusesTo(bloodsplosionDamage); - Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), bloodsplosionDamage, 2f, player.whoAmI); + Projectile.NewProjectile(playerSource, position, velocity, ModContent.ProjectileType(), bloodsplosionDamage, 2f, player.whoAmI); } } } @@ -403,7 +404,7 @@ namespace CalamityMod.Items modPlayer.tarraCrits = 0; // Tarragon Mage Leaves: (8-10) x 20%, soft cap starts at 200 base damage int leafAmt = 8 + Main.rand.Next(3); // 8, 9, or 10 - int leafDamage = player.ApplyArmorAccDamageBonusesTo(damage * 0.2f); + int leafDamage = (int)(damage * 0.2f); for (int l = 0; l < leafAmt; l++) { @@ -414,7 +415,7 @@ namespace CalamityMod.Items speed = item.shootSpeed / speed; xDiff *= speed; yDiff *= speed; - int projectile = Projectile.NewProjectile(source, position, new Vector2(xDiff, yDiff), ProjectileID.Leaf, leafDamage, knockBack, player.whoAmI); + int projectile = Projectile.NewProjectile(playerSource, position, new Vector2(xDiff, yDiff), ProjectileID.Leaf, leafDamage, knockBack, player.whoAmI); if (projectile.WithinBounds(Main.maxProjectiles)) Main.projectile[projectile].DamageType = DamageClass.Generic; } @@ -427,8 +428,8 @@ namespace CalamityMod.Items modPlayer.canFireAtaxiaRangedProjectile = false; if (player.whoAmI == Main.myPlayer) { - int ataxiaFlareDamage = player.ApplyArmorAccDamageBonusesTo(damage * 0.25f); - Projectile.NewProjectile(source, position, velocity * 1.25f, ModContent.ProjectileType(), ataxiaFlareDamage, 2f, player.whoAmI); + int ataxiaFlareDamage = (int)(damage * 0.25f); + Projectile.NewProjectile(playerSource, position, velocity * 1.25f, ModContent.ProjectileType(), ataxiaFlareDamage, 2f, player.whoAmI); } } } @@ -441,9 +442,8 @@ namespace CalamityMod.Items { // God Slayer Ranged Shrapnel: 100%, soft cap starts at 800 base damage int shrapnelRoundDamage = CalamityUtils.DamageSoftCap(damage, 800); - shrapnelRoundDamage = player.ApplyArmorAccDamageBonusesTo(shrapnelRoundDamage); - Projectile.NewProjectile(source, position, velocity * 1.25f, ModContent.ProjectileType(), shrapnelRoundDamage, 2f, player.whoAmI); + Projectile.NewProjectile(playerSource, position, velocity * 1.25f, ModContent.ProjectileType(), shrapnelRoundDamage, 2f, player.whoAmI); } } } @@ -456,7 +456,6 @@ namespace CalamityMod.Items // Hydrothermic Rogue Flares: 6 x (50 + 15%), soft cap starts at 90 base damage int flareDamage = CalamityUtils.DamageSoftCap(50 + damage * 0.15, 90); - flareDamage = player.ApplyArmorAccDamageBonusesTo(flareDamage); if (player.whoAmI == Main.myPlayer) { @@ -468,8 +467,8 @@ namespace CalamityMod.Items for (int i = 0; i < 3; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 30f * i; - Projectile.NewProjectile(source, player.Center.X, player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), flareID, flareDamage, 1f, player.whoAmI); - Projectile.NewProjectile(source, player.Center.X, player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), flareID, flareDamage, 1f, player.whoAmI); + Projectile.NewProjectile(playerSource, player.Center.X, player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), flareID, flareDamage, 1f, player.whoAmI); + Projectile.NewProjectile(playerSource, player.Center.X, player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), flareID, flareDamage, 1f, player.whoAmI); } } } @@ -484,9 +483,8 @@ namespace CalamityMod.Items { // Victide All-class Seashells: 200%, soft cap starts at 46 base damage int seashellDamage = CalamityUtils.DamageSoftCap(damage * 2, 46); - seashellDamage = player.ApplyArmorAccDamageBonusesTo(seashellDamage); - Projectile.NewProjectile(source, position, velocity * 1.25f, ModContent.ProjectileType(), seashellDamage, 1f, player.whoAmI); + Projectile.NewProjectile(playerSource, position, velocity * 1.25f, ModContent.ProjectileType(), seashellDamage, 1f, player.whoAmI); } } } @@ -501,7 +499,7 @@ namespace CalamityMod.Items if (i != 0) { Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i)); - int rocket = Projectile.NewProjectile(source, position, perturbedSpeed, ModContent.ProjectileType(), (int)(damage * 0.25), 2f, player.whoAmI, 0, 12f); + int rocket = Projectile.NewProjectile(playerSource, position, perturbedSpeed, ModContent.ProjectileType(), (int)(damage * 0.25), 2f, player.whoAmI, 0, 12f); //First extra value is rocket type which I just used 0 to get the default, second is the velocity I went with my gut feeling and got quite close to Scorpio's velocity with Rockets I if (rocket.WithinBounds(Main.maxProjectiles)) Main.projectile[rocket].DamageType = DamageClass.Generic; @@ -519,7 +517,7 @@ namespace CalamityMod.Items { float spreadX = velocity.X + Main.rand.NextFloat(-0.75f, 0.75f); float spreadY = velocity.Y + Main.rand.NextFloat(-0.75f, 0.75f); - int feather = Projectile.NewProjectile(source, position, new Vector2(spreadX, spreadY) * 1.25f, ModContent.ProjectileType(), (int)(damage * 0.3), 2f, player.whoAmI); + int feather = Projectile.NewProjectile(playerSource, position, new Vector2(spreadX, spreadY) * 1.25f, ModContent.ProjectileType(), (int)(damage * 0.3), 2f, player.whoAmI); if (feather.WithinBounds(Main.maxProjectiles)) { Main.projectile[feather].usesLocalNPCImmunity = true; @@ -529,21 +527,6 @@ namespace CalamityMod.Items } } } - if (item.type == ItemID.PearlwoodBow) - { - foreach (Projectile p in Main.ActiveProjectiles) - { - if ((p.type == ModContent.ProjectileType() || p.type == ModContent.ProjectileType()) && p.owner == player.whoAmI) - { - p.Kill(); - } - } - for (int i = -8; i <= 8; i += 8) - { - Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i)); - Projectile.NewProjectile(source, position, perturbedSpeed, ModContent.ProjectileType(), damage, 0f, player.whoAmI); - } - } return true; } #endregion @@ -616,7 +599,7 @@ namespace CalamityMod.Items bool boostedHeart = player.Calamity().photosynthesis; if (boostedHeart) { - player.HealPlayer(5); + player.HealPlayer(PhotosynthesisPotion.IncreasedHeartHeal); } } return true; @@ -801,6 +784,11 @@ namespace CalamityMod.Items return false; // Don't use weapons if you're charging with a spear } + // If the player if using the Drill Containment Unit, ignore all this. + // It will start to check for everything below EVERY FRAME, including attacking with PSC or using Charge + if (player.mount.Type == MountID.Drill) + return base.CanUseItem(item, player); + // Conversion for Andromeda if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) { @@ -951,6 +939,15 @@ namespace CalamityMod.Items } #endregion + #region ModifyHitNPC + public override void ModifyHitNPC(Item item, Player player, NPC target, ref NPC.HitModifiers modifiers) + { + // This assume all items with a damage hit is a weapon. There appears to be no edge cases for this thus far + if (player.Calamity().oldFashioned) + modifiers.SourceDamage *= OldFashioned.DamageReductionMultiplier; + } + #endregion + #region Armor Set Changes public override string IsArmorSet(Item head, Item body, Item legs) { @@ -1355,19 +1352,6 @@ namespace CalamityMod.Items if (item.type == ItemID.TerrasparkBoots) player.buffImmune[BuffID.OnFire] = true; - if (item.type == ItemID.AngelWings) // Boost to max life, defense, and life regen - { - player.statLifeMax2 += 20; - player.statDefense += 10; - player.lifeRegen += 2; - player.noFallDmg = true; - } - else if (item.type == ItemID.DemonWings) // Boost to all damage and crit - { - player.GetDamage() += 0.05f; - player.GetCritChance() += 5; - player.noFallDmg = true; - } else if (item.type == ItemID.FinWings) // Boosted water abilities, faster fall in water { if (player.IsUnderwater()) @@ -1385,124 +1369,42 @@ namespace CalamityMod.Items player.AddBuff(BuffID.Honey, 2); player.noFallDmg = true; } - else if (item.type == ItemID.ButterflyWings) // Boost to magic stats + else if (item.type == ItemID.ButterflyWings) // Boost to mana regen { - player.statManaMax2 += 20; - player.GetDamage() += 0.05f; - player.manaCost *= 0.95f; - player.GetCritChance() += 5; + player.manaRegen = (int)(player.manaRegen * 1.25f); player.noFallDmg = true; } - else if (item.type == ItemID.FairyWings) // Boost to max life - { - player.statLifeMax2 += 60; - player.noFallDmg = true; - } - else if (item.type == ItemID.BatWings) // Stronger at night + else if (item.type == ItemID.BatWings) // Gives night vision { player.noFallDmg = true; - if (!Main.dayTime || Main.eclipse) - { - player.GetDamage() += 0.07f; - player.GetCritChance() += 3; - } + player.nightVision = true; } else if (item.type == ItemID.HarpyWings) { modPlayer.harpyWingBoost = true; - player.moveSpeed += 0.2f; + player.moveSpeed += 0.1f; player.noFallDmg = true; } - else if (item.type == ItemID.MothronWings) // Spawn baby mothrons over time to attack enemies, max of 3 + else if (item.type == ItemID.FrozenWings) // Increases cold debuff damage { - player.statDefense += 5; - player.GetDamage() += 0.05f; player.noFallDmg = true; + player.Calamity().frozenWingsCold = true; } - else if (item.type == ItemID.FrozenWings) // Bonus to melee and ranged stats while wearing frost armor + else if (item.type == ItemID.FlameWings) // Increases heat debuff damage { player.noFallDmg = true; - if (player.head == ArmorIDs.Head.FrostHelmet && player.body == ArmorIDs.Body.FrostBreastplate && player.legs == ArmorIDs.Legs.FrostLeggings) - { - player.GetDamage() += 0.04f; - player.GetDamage() += 0.04f; - player.Calamity().frozenWingsCold = true; - } + player.Calamity().flameWingsHeat = true; } - else if (item.type == ItemID.FlameWings) // Bonus to melee stats - { - player.GetDamage() += 0.05f; - player.GetCritChance() += 5; - player.noFallDmg = true; - } - else if (item.type == ItemID.GhostWings) // Bonus to mage stats while wearing spectre armor + else if (item.type == ItemID.LeafWings) // Bonus to defensive stats { player.noFallDmg = true; - if (player.body == ArmorIDs.Body.SpectreRobe && player.legs == ArmorIDs.Legs.SpectrePants) - { - if (player.head == ArmorIDs.Head.SpectreHood) - { - player.statDefense += 10; - player.endurance += 0.05f; - } - else if (player.head == ArmorIDs.Head.SpectreMask) - { - player.GetDamage() += 0.05f; - player.GetCritChance() += 5; - } - } - } - else if (item.type == ItemID.BeetleWings) // Boosted defense and melee stats while wearing beetle armor - { - player.noFallDmg = true; - if (player.head == ArmorIDs.Head.BeetleHelmet && player.legs == ArmorIDs.Legs.BeetleLeggings) - { - if (player.body == ArmorIDs.Body.BeetleShell) - { - player.statDefense += 10; - player.endurance += 0.05f; - } - else if (player.body == ArmorIDs.Body.BeetleScaleMail) - { - player.GetDamage() += 0.05f; - player.GetCritChance() += 5; - } - } - } - else if (item.type == ItemID.Hoverboard) // Boosted ranged stats while wearing shroomite armor - { - player.noFallDmg = true; - if (player.body == ArmorIDs.Body.ShroomiteBreastplate && player.legs == ArmorIDs.Legs.ShroomiteLeggings) - { - if (player.head == ArmorIDs.Head.ShroomiteHeadgear) //arrows - { - player.arrowDamage += 0.05f; - } - else if (player.head == ArmorIDs.Head.ShroomiteMask) //bullets - { - player.bulletDamage += 0.05f; - } - else if (player.head == ArmorIDs.Head.ShroomiteHelmet) //specialists (non-arrow/bullet) - { - player.specialistDamage += 0.05f; - } - } - } - else if (item.type == ItemID.LeafWings) // Bonus to defensive stats while wearing tiki armor - { - player.noFallDmg = true; - if (player.head == ArmorIDs.Head.TikiMask && player.body == ArmorIDs.Body.TikiShirt && player.legs == ArmorIDs.Legs.TikiPants) - { - player.statDefense += 5; - player.endurance += 0.05f; - player.AddBuff(BuffID.DryadsWard, 5, true); // Dryad's Blessing - } + player.statDefense += 10; + player.AddBuff(BuffID.DryadsWard, 2); // Dryad's Blessing } else if (item.type == ItemID.FestiveWings) // Drop homing christmas tree bulbs while in flight { player.noFallDmg = true; - player.statLifeMax2 += 40; - if (modPlayer.icicleCooldown <= 0) + if (modPlayer.wingProjectileCooldown <= 0) { var source = player.GetSource_Accessory(item); if (player.controlJump && player.jump == 0 && player.velocity.Y != 0f && !player.mount.Active && !player.mount.Cart) @@ -1513,69 +1415,28 @@ namespace CalamityMod.Items { Main.projectile[p].DamageType = DamageClass.Generic; Main.projectile[p].Calamity().lineColor = 1; - modPlayer.icicleCooldown = 15; + modPlayer.wingProjectileCooldown = 15; } } } } - else if (item.type == ItemID.SpookyWings) // Bonus to summon stats while wearing spooky armor + else if (item.type == ItemID.TatteredFairyWings) // Leave a trail of damaging fairy dust while in flight { player.noFallDmg = true; - if (player.head == ArmorIDs.Head.SpookyHelmet && player.body == ArmorIDs.Body.SpookyBreastplate && player.legs == ArmorIDs.Legs.SpookyLeggings) + if (modPlayer.wingProjectileCooldown <= 0) { - player.GetKnockback(DamageClass.Summon) += 2f; - player.GetDamage() += 0.05f; + var source = player.GetSource_Accessory(item); + if (player.controlJump && player.jump == 0 && player.velocity.Y != 0f && !player.mount.Active && !player.mount.Cart) + { + int fairyDustDamage = (int)player.GetBestClassDamage().ApplyTo(35); + Vector2 fairyDustVel = Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat(0.08f, 0.2f); + + int p = Projectile.NewProjectile(source, player.Center, fairyDustVel, ModContent.ProjectileType(), fairyDustDamage, 0f, player.whoAmI); + if (p.WithinBounds(Main.maxProjectiles)) + modPlayer.wingProjectileCooldown = 10; + } } } - else if (item.type == ItemID.TatteredFairyWings) - { - player.GetDamage() += 0.05f; - player.GetCritChance() += 5; - player.noFallDmg = true; - } - else if (item.type == ItemID.SteampunkWings) - { - player.statDefense += 8; - player.GetDamage() += 0.04f; - player.GetCritChance() += 2; - player.moveSpeed += 0.1f; - player.noFallDmg = true; - } - else if (item.type == ItemID.WingsSolar) // Bonus to melee stats while wearing solar flare armor - { - player.noFallDmg = true; - if (player.head == ArmorIDs.Head.SolarFlareHelmet && player.body == ArmorIDs.Body.SolarFlareBreastplate && player.legs == ArmorIDs.Legs.SolarFlareLeggings) - { - player.GetDamage() += 0.07f; - player.GetCritChance() += 3; - } - } - else if (item.type == ItemID.WingsVortex) // Bonus to ranged stats while wearing vortex armor - { - player.noFallDmg = true; - if (player.head == ArmorIDs.Head.VortexHelmet && player.body == ArmorIDs.Body.VortexBreastplate && player.legs == ArmorIDs.Legs.VortexLeggings) - { - player.GetDamage() += 0.03f; - player.GetCritChance() += 7; - } - } - else if (item.type == ItemID.WingsNebula) // Bonus to magic stats while wearing nebula armor - { - player.noFallDmg = true; - if (player.head == ArmorIDs.Head.NebulaHelmet && player.body == ArmorIDs.Body.NebulaBreastplate && player.legs == ArmorIDs.Legs.NebulaLeggings) - { - player.GetDamage() += 0.05f; - player.GetCritChance() += 5; - player.statManaMax2 += 20; - player.manaCost *= 0.95f; - } - } - else if (item.type == ItemID.WingsStardust) // Bonus to summon stats while wearing stardust armor - { - player.noFallDmg = true; - if (player.head == ArmorIDs.Head.StardustHelmet && player.body == ArmorIDs.Body.StardustPlate && player.legs == ArmorIDs.Legs.StardustLeggings) - player.GetDamage() += 0.1f; - } else if (item.type == ItemID.FishronWings || item.type == ItemID.BetsyWings || item.type == ItemID.Yoraiz0rWings || item.type == ItemID.JimsWings || item.type == ItemID.SkiphsWings || item.type == ItemID.LokisWings || item.type == ItemID.ArkhalisWings || item.type == ItemID.LeinforsWings || item.type == ItemID.BejeweledValkyrieWing || @@ -1614,7 +1475,7 @@ namespace CalamityMod.Items float moveSpeedBoost = modPlayer.moveSpeedBonus * 0.1f; float flightSpeedMult = 1f + - (modPlayer.soaring ? 0.1f : 0f) + + (modPlayer.soaring ? SoaringPotion.FlightBoost : 0f) + (modPlayer.reaverSpeed ? 0.1f : 0f) + moveSpeedBoost; @@ -1639,6 +1500,10 @@ namespace CalamityMod.Items // For reference, Treasure Magnet adds 150 (2.625 + 9.375 = 12 tiles) if (player.Calamity().reaverExplore) grabRange += 246; + + // Nebula boosters have greater pickup range while using Nebula Mantle. + if (player.wingsLogic == (int)VanillaWingID.WingsNebula && ItemID.Sets.NebulaPickup[item.type]) + grabRange *= 2; } #endregion diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 76756babf6..3382a33487 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -170,7 +170,7 @@ namespace CalamityMod.Items { // Convert current charge ratio into a percentage. float displayedPercent = ChargeRatio * 100f; - TooltipLine line = new TooltipLine(Mod, "CalamityCharge", $"Current Charge: {displayedPercent:N1}%"); + TooltipLine line = new TooltipLine(Mod, "CalamityMod:Charge", CalamityUtils.GetText("Misc.Charge").Format(displayedPercent.ToString("N1"))); tooltips.Insert(++lastTooltipIndex, line); } @@ -407,10 +407,6 @@ namespace CalamityMod.Items #endregion #region Vanilla Item Tooltip Modification - - // Turns a number into a string of increased mining speed. - public static string MiningSpeedString(int percent) => $"\n{percent}% increased mining speed"; - private static void ModifyVanillaTooltips(Item item, IList tooltips) { #region Modular Tooltip Editing Code @@ -432,9 +428,11 @@ namespace CalamityMod.Items // These functions are shorthand to invoke ApplyTooltipEdits using the above predicates. void EditTooltipByNum(int lineNum, Action action) => ApplyTooltipEdits(tooltips, LineNum(lineNum), action); void EditTooltipByName(string lineName, Action action) => ApplyTooltipEdits(tooltips, LineName(lineName), action); + string EditedTooltip(string key) => CalamityUtils.GetTextValue($"Vanilla.EditedTooltip.{key}"); + LocalizedText GetEditedTooltip(string key) => CalamityUtils.GetText($"Vanilla.EditedTooltip.{key}"); // For items such as a Copper Helmet which literally have no tooltips at all, add a custom "Tooltip0" which mimics the vanilla Tooltip0. - void AddTooltip(string text) + void AddTooltip(string key) { // Don't add the tooltip if the item is in a social slot if (item.social) @@ -447,8 +445,44 @@ namespace CalamityMod.Items defenseIndex = i; break; } - tooltips.Insert(defenseIndex + 1, new TooltipLine(CalamityMod.Instance, "Tooltip0", text)); + tooltips.Insert(defenseIndex + 1, new TooltipLine(CalamityMod.Instance, "Tooltip0", CalamityUtils.GetTextValue($"Vanilla.AddedTooltip.{key}"))); } + string AddedTooltip(string key) => "\n" + CalamityUtils.GetTextValue($"Vanilla.AddedTooltip.{key}"); + LocalizedText GetAddedTooltip(string key) => CalamityUtils.GetText($"Vanilla.AddedTooltip.{key}"); + #endregion + + // Exact life regen descriptions + #region Life Regen Clarity Tooltips + bool isCampfire = item.type == ItemID.Campfire || item.type == ItemID.CursedCampfire || item.type == ItemID.DemonCampfire || item.type == ItemID.FrozenCampfire || item.type == ItemID.IchorCampfire || item.type == ItemID.RainbowCampfire || item.type == ItemID.UltraBrightCampfire || item.type == ItemID.BoneCampfire || item.type == ItemID.DesertCampfire || item.type == ItemID.CoralCampfire || item.type == ItemID.CorruptCampfire || item.type == ItemID.CrimsonCampfire || item.type == ItemID.HallowedCampfire || item.type == ItemID.JungleCampfire || item.type == ItemID.MushroomCampfire || item.type == ItemID.ShimmerCampfire; + if (isCampfire) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("Campfires")); + + if (item.type == ItemID.HeartLantern) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("HeartLantern")); + + if (item.type == ItemID.BottledHoney) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("BottledHoney")); + + if (item.type == ItemID.ShinyStone) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("ShinyStone")); + + if (item.type == ItemID.BandofRegeneration) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("BandofRegeneration")); + + if (item.type == ItemID.CharmofMyths) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("CharmofMyths")); + + if (item.type == ItemID.RegenerationPotion) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("RegenerationPotion")); + + if (item.type == ItemID.SoulDrain) + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("SoulDrain")); + + if (item.type == ItemID.HamBat) + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("HamBat")); + + if (item.type == ItemID.AegisCrystal) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("AegisCrystal")); #endregion // Numerous random tooltip edits which don't fit into another category @@ -456,7 +490,7 @@ namespace CalamityMod.Items // Lilies of Finality 512 edit if (item.type == ModContent.ItemType()) - EditTooltipByName("Damage", (line) => line.Text = LiliesOfFinality.TheNumber + " summon damage"); + EditTooltipByName("Damage", (line) => line.Text = LiliesOfFinality.TheNumber + Language.GetTextValue("LegacyTooltip.53")); // Apparently 612 is a homestuck reference if (item.type == ModContent.ItemType()) @@ -465,111 +499,63 @@ namespace CalamityMod.Items // Master Mode items also drop in Revengeance // Only affects vanilla and Calamity items if (item.master && (item.type < ItemID.Count || item.ModItem?.Mod is CalamityMod)) - EditTooltipByName("Master", (line) => line.Text += " or Revengeance"); + EditTooltipByName("Master", (line) => line.Text = EditedTooltip("MasterExclusive")); // Add a tooltip about Slimed's effects if (item.type == ItemID.SlimeGun) - EditTooltipByNum(0, (line) => line.Text += "\nSlimed enemies take more damage from fire-based debuffs"); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("SlimeGun")); // Replace the meme tooltip with a useful one. if (item.type == ItemID.GelBalloon) - EditTooltipByNum(0, (line) => line.Text = "Throws a mixture of slime and sparkling crystals" - + "\nSlimed enemies take more damage from fire-based debuffs"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("GelBalloon")); // Flesh Knuckles giving extra max life. if (item.type == ItemID.FleshKnuckles || item.type == ItemID.HeroShield || item.type == ItemID.BerserkerGlove) - EditTooltipByNum(0, (line) => line.Text += "\nMax life increased by 45"); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("FleshKnucklesLine")); // Rod of Discord cannot be used multiple times to hurt yourself if (item.type == ItemID.RodofDiscord) - EditTooltipByNum(1, (line) => line.Text += "\nTeleportation is disabled while Chaos State is active"); + EditTooltipByNum(1, (line) => line.Text += AddedTooltip("RodofDiscord")); // Indicate that the Ankh Shield provides sandstorm wind push immunity if (item.type == ItemID.AnkhShield) - EditTooltipByNum(1, (line) => line.Text += ", including Mighty Wind"); + { + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("AnkhShield1")); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("AnkhShield2")); + } // If Early Hardmode Rework is enabled: Remind users that ores will NOT spawn when an altar is smashed. if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && (item.type == ItemID.Pwnhammer || item.type == ItemID.Hammush)) - EditTooltipByNum(0, (line) => line.Text += "\nDemon Altars now drop Souls of Night instead of generating ores when destroyed" + - "\nHardmode ores now generate after defeating Mechanical Bosses for the first time"); - - // Exact life regen descriptions - bool isCampfire = item.type == ItemID.Campfire || item.type == ItemID.CursedCampfire || item.type == ItemID.DemonCampfire || item.type == ItemID.FrozenCampfire || item.type == ItemID.IchorCampfire || item.type == ItemID.RainbowCampfire || item.type == ItemID.UltraBrightCampfire || item.type == ItemID.BoneCampfire || item.type == ItemID.DesertCampfire || item.type == ItemID.CoralCampfire || item.type == ItemID.CorruptCampfire || item.type == ItemID.CrimsonCampfire || item.type == ItemID.HallowedCampfire || item.type == ItemID.JungleCampfire || item.type == ItemID.MushroomCampfire || item.type == ItemID.ShimmerCampfire; - if (isCampfire) - EditTooltipByNum(0, (line) => line.Text = "Life regen is increased by 0.5 HP/s when near a campfire"); - - if (item.type == ItemID.HeartLantern) - EditTooltipByNum(0, (line) => line.Text = "Grants +1 HP/s life regeneration when placed nearby"); - - if (item.type == ItemID.BottledHoney) - EditTooltipByNum(0, (line) => line.Text = "Grants +1 HP/s life regen for a short time" + - "\nGrants an additional +1 HP/s life regen while inflicted with a damaging debuff"); - - if (item.type == ItemID.ShinyStone) - EditTooltipByNum(0, (line) => line.Text = "Grants +2 HP/s life regen and accelerates natural life regen when not moving"); - - if (item.type == ItemID.BandofRegeneration) - EditTooltipByNum(0, (line) => line.Text = "Grants +1 HP/s life regeneration"); - - if (item.type == ItemID.CharmofMyths) - EditTooltipByNum(0, (line) => line.Text = "Grants +1 HP/s life regeneration and reduces the cooldown of healing potions by 25%"); - - if (item.type == ItemID.RegenerationPotion) - EditTooltipByNum(0, (line) => line.Text = "Provides +2 HP/s life regeneration"); - - if (item.type == ItemID.SoulDrain) - EditTooltipByNum(0, (line) => line.Text += "\nThis grants +1.5 HP/s life regen and accelerates natural life regen" + - "\nLife drain stacks based on the number of enemies being hit"); - - if (item.type == ItemID.HamBat) - EditTooltipByNum(1, (line) => line.Text = "Defeating enemies temporarily grants +3 HP/s life regen"); - - if (item.type == ItemID.AegisCrystal) - EditTooltipByNum(0, (line) => line.Text = "Permanently boosts natural life regeneration"); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("Pwnhammer")); // Warmth Potion reduces debuff durations if (item.type == ItemID.WarmthPotion) - { - string immunityLine = "\nGreatly reduces the duration of Chilled, Frozen, and Glacial State"; - EditTooltipByNum(0, (line) => line.Text += immunityLine); - } + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("WarmthPotion")); // Nerfed Archery Potion tooltip if (item.type == ItemID.ArcheryPotion) - EditTooltipByNum(0, (line) => line.Text = "20% increased arrow speed and 5% increased arrow damage"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("ArcheryPotion")); // Buffed Ironskin Potion tooltip if (item.type == ItemID.IronskinPotion) - EditTooltipByNum(0, (line) => line.Text = "Increase defense by " + CalamityUtils.GetScalingDefense(-1)); + EditTooltipByNum(0, (line) => line.Text = GetEditedTooltip("IronskinPotion").Format(CalamityUtils.GetScalingDefense(-1))); // Nerfed Swiftness Potion tooltip if (item.type == ItemID.SwiftnessPotion) - EditTooltipByNum(0, (line) => line.Text = "15% increased movement speed"); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "15%")); // Hand Warmer has a side bonus with Snow armor if (item.type == ItemID.HandWarmer) - { - string extraLine = "\nProvides a regeneration boost while wearing the Snow armor"; - EditTooltipByNum(0, (line) => line.Text += extraLine); - } + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("HandWarmer")); // Golden Fishing Rod inherently contains High Test Fishing Line if (item.type == ItemID.GoldenFishingRod) - EditTooltipByName("NeedsBait", (line) => line.Text += "\nIts fishing line will never break"); + EditTooltipByName("NeedsBait", (line) => line.Text += AddedTooltip("GoldenFishingRod")); // Information about graveyards // There are no item sets for tombstones wtf if (item.type == ItemID.Tombstone || item.type == ItemID.GraveMarker || item.type == ItemID.CrossGraveMarker || item.type == ItemID.Headstone || item.type == ItemID.Gravestone || item.type == ItemID.Obelisk || item.type == ItemID.RichGravestone1 || item.type == ItemID.RichGravestone2 || item.type == ItemID.RichGravestone3 || item.type == ItemID.RichGravestone4 || item.type == ItemID.RichGravestone5) - EditTooltipByName("Material", (line) => line.Text += "\n13 of any tombstone turns the surrounding area into a graveyard" - + "\nGraveyards have various new item sales and recipes"); - - // Eternity Crystal notifies the player that they can accelerate the invasion - if (item.type == ItemID.DD2ElderCrystal) - EditTooltipByNum(0, (line) => line.Text += "\nOnce placed you can right click the crystal to skip waves or increase the spawn rate of the invaders"); - - // Aerial Bane is no longer the real bane of aerial enemies (50% dmg bonus removed) - if (item.type == ItemID.DD2BetsyBow) - EditTooltipByNum(0, (line) => line.Text = "Shoots splitting arrows"); + EditTooltipByName("Material", (line) => line.Text += AddedTooltip("Tombstones")); // Modify item speed tooltips to use a new scale designed to more accurately reflect practical distributions of item speeds. // Due to the higher complexity of the action, the actual logic is delegated to its own method. @@ -577,222 +563,133 @@ namespace CalamityMod.Items EditTooltipByName("Speed", (line) => RedistributeSpeedTooltips(item, line)); if (item.healLife > 0 && Main.LocalPlayer.Calamity().healingPotionMultiplier != 1f) - { - int healAmt = (int)(item.healLife * Main.LocalPlayer.Calamity().healingPotionMultiplier); - EditTooltipByName("HealLife", (line) => line.Text = $"Restores {healAmt} life"); - } + EditTooltipByName("HealLife", (line) => line.Text = Language.GetOrRegister("CommonItemTooltip.RestoresLife").Format((int)(item.healLife * Main.LocalPlayer.Calamity().healingPotionMultiplier))); #endregion // For boss summon item clarity - #region Boss Summon Tooltip Edits - + #region Boss Summon Clarity Tooltips if (item.type == ItemID.Abeemination) - { - EditTooltipByNum(0, (line) => line.Text += " when used in the Jungle\n"); - EditTooltipByNum(0, (line) => line.Text += "Enrages outside the Underground Jungle"); - } + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("Abeemination")); if (item.type == ItemID.BloodySpine) - { - EditTooltipByNum(0, (line) => line.Text += " when used in the Crimson\n"); - EditTooltipByNum(0, (line) => line.Text += "Enrages outside the Underground Crimson"); - } + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("BloodySpine")); if (item.type == ItemID.ClothierVoodooDoll) - { - EditTooltipByNum(0, (line) => line.Text += "\nWhile equipped, summons Skeletron when the Clothier is killed during nighttime\n"); - EditTooltipByNum(0, (line) => line.Text += "Enrages during the day"); - } + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("ClothierVoodooDoll")); if (item.type == ItemID.DeerThing) - EditTooltipByNum(0, (line) => line.Text += " when used in the Snow or Ice biome"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("DeerThing")); if (item.type == ItemID.GuideVoodooDoll) - EditTooltipByNum(0, (line) => line.Text += "\nSummons the Wall of Flesh if thrown into lava in the underworld while the Guide is alive"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("GuideVoodooDoll")); if (item.type == ItemID.LihzahrdPowerCell) - { - EditTooltipByNum(0, (line) => line.Text += " to summon the Golem\n"); - EditTooltipByNum(0, (line) => line.Text += "Enrages outside the Jungle Temple"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("LihzahrdPowerCell")); - } + if (item.type == ItemID.MechanicalEye) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MechanicalEye")); - if (item.type == ItemID.MechanicalEye || item.type == ItemID.MechanicalSkull || item.type == ItemID.MechanicalWorm || item.type == ItemID.SuspiciousLookingEye) - { - EditTooltipByNum(0, (line) => line.Text += " when used during nighttime\n"); - EditTooltipByNum(0, (line) => line.Text += "Enrages during the day"); - } + if (item.type == ItemID.MechanicalSkull) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MechanicalSkull")); + + if (item.type == ItemID.MechanicalWorm) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MechanicalWorm")); if (item.type == ItemID.QueenSlimeCrystal) - EditTooltipByNum(0, (line) => line.Text += " when used in the Hallow"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("QueenSlimeCrystal")); + + if (item.type == ItemID.SuspiciousLookingEye) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("SuspiciousLookingEye")); if (item.type == ItemID.TruffleWorm) - { - EditTooltipByName("Consumable", (line) => line.Text += "\nSummons Duke Fishron if used as bait in the Ocean\n"); - EditTooltipByName("Consumable", (line) => line.Text += "Enrages outside the Ocean"); - } + EditTooltipByName("Consumable", (line) => line.Text += AddedTooltip("TruffleWorm")); if (item.type == ItemID.WormFood) - { - EditTooltipByNum(0, (line) => line.Text += " when used in the Corruption\n"); - EditTooltipByNum(0, (line) => line.Text += "Enrages outside the Underground Corruption"); - } + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("WormFood")); #endregion // Brain of Confusion, Black Belt and Master Ninja Gear have guaranteed dodges with a fixed cooldown. #region Guaranteed Dodge Tooltips - string beltDodgeLine = "Grants the ability to dodge attacks\n" + - "Attacks that deal less than 5% of your max life in damage will not be dodged\n" + - $"The dodge has a cooldown that ranges between {BalancingConstants.BeltDodgeCooldownMin / 60 } and {BalancingConstants.BeltDodgeCooldownMax / 60} seconds depending on the dodged attack's damage\n" + - "The cooldown is shared with all other dodges and reflects"; if (item.type == ItemID.BlackBelt) - EditTooltipByNum(0, (line) => line.Text = beltDodgeLine); + EditTooltipByNum(0, (line) => line.Text = CalamityUtils.GetText("Vanilla.DodgeInfo").Format(BalancingConstants.BeltDodgeCooldownMin / 60, BalancingConstants.BeltDodgeCooldownMax / 60)); if (item.type == ItemID.MasterNinjaGear) - EditTooltipByNum(1, (line) => line.Text = beltDodgeLine); + EditTooltipByNum(1, (line) => line.Text = CalamityUtils.GetText("Vanilla.DodgeInfo").Format(BalancingConstants.BeltDodgeCooldownMin / 60, BalancingConstants.BeltDodgeCooldownMax / 60)); - string brainDodgeLine = "Grants the ability to dodge attacks\n" + - "Attacks that deal less than 5% of your max life in damage will not be dodged\n" + - $"The dodge has a cooldown that ranges between {BalancingConstants.BrainDodgeCooldownMin / 60} and {BalancingConstants.BrainDodgeCooldownMax / 60} seconds depending on the dodged attack's damage\n" + - "The cooldown is shared with all other dodges and reflects"; if (item.type == ItemID.BrainOfConfusion) - EditTooltipByNum(0, (line) => line.Text = brainDodgeLine); + EditTooltipByNum(0, (line) => line.Text = CalamityUtils.GetText("Vanilla.DodgeInfo").Format(BalancingConstants.BrainDodgeCooldownMin / 60, BalancingConstants.BrainDodgeCooldownMax / 60)); #endregion - // Early Hardmode ore melee weapons have new on-hit effects. - #region Early Hardmode Melee Tooltips - - // Cobalt - if (item.type == ItemID.CobaltSword || item.type == ItemID.CobaltNaginata) - EditTooltipByName("Knockback", (line) => line.Text += "\nDecreases enemy defense by 25% on hit\nThis effect lasts for 10 seconds"); - - // Palladium - if (item.type == ItemID.PalladiumSword || item.type == ItemID.PalladiumPike) - EditTooltipByName("Knockback", (line) => line.Text += "\nIncreases natural life regen on hit"); - - // Mythril - if (item.type == ItemID.MythrilSword || item.type == ItemID.MythrilHalberd) - EditTooltipByName("Knockback", (line) => line.Text += "\nDecreases enemy contact damage by 10% on hit\nThis effect lasts for 10 seconds"); - - // Orichalcum - if (item.type == ItemID.OrichalcumSword || item.type == ItemID.OrichalcumHalberd) - EditTooltipByName("Knockback", (line) => line.Text += "\nIncreases how frequently the Orichalcum set bonus triggers on hit"); - - // Adamantite - if (item.type == ItemID.AdamantiteSword) - EditTooltipByName("Material", (line) => line.Text += "\nSlows enemies on hit"); - - if (item.type == ItemID.AdamantiteGlaive) - EditTooltipByName("Knockback", (line) => line.Text += "\nSlows enemies on hit"); - - // Titanium - if (item.type == ItemID.TitaniumSword) - EditTooltipByName("Material", (line) => line.Text += "\nDeals increased damage to enemies with high knockback resistance"); - - if (item.type == ItemID.TitaniumTrident) - EditTooltipByName("Knockback", (line) => line.Text += "\nDeals increased damage to enemies with high knockback resistance"); - - // Hallowed (and True Excalibur) - if (item.type == ItemID.Excalibur || item.type == ItemID.Gungnir || item.type == ItemID.TrueExcalibur) - EditTooltipByName("Material", (line) => line.Text += "\nDeals double damage to enemies above 75% life"); - #endregion - - // Other melee weapon tooltips - #region Other Melee Tooltips - - if (item.type == ItemID.CandyCaneSword || item.type == ItemID.FruitcakeChakram) - EditTooltipByName("Knockback", (line) => line.Text += "\nHeals you on hit"); - - // Stylish Scissors, all Phaseblades, and all Phasesabers ignore 100% of defense - if (item.type == ItemID.StylistKilLaKillScissorsIWish || (item.type >= ItemID.BluePhasesaber && item.type <= ItemID.YellowPhasesaber) || item.type == ItemID.OrangePhasesaber) - EditTooltipByName("Knockback", (line) => line.Text += "\nIgnores 100% of enemy defense"); - // Phaseblades are done separately to ensure it appears under the Material line - if (item.type >= ItemID.BluePhaseblade && item.type <= ItemID.YellowPhaseblade || item.type == ItemID.OrangePhaseblade) - EditTooltipByName("Material", (line) => line.Text += "\nIgnores 100% of enemy defense"); - - // Bone Sword, Breaker Blade, and Mandible Blade ignore 50% of defense - if (item.type == ItemID.BoneSword || item.type == ItemID.BreakerBlade) - EditTooltipByName("Knockback", (line) => line.Text += "\nIgnores 50% of enemy defense"); - // Mandible Blade is done separately to ensure it appears under the Material line - if (item.type == ItemID.AntlionClaw) - EditTooltipByName("Material", (line) => line.Text += "\nIgnores 50% of enemy defense"); + // Weapon changes + #region Weapon changes + // Aerial Bane is no longer the real bane of aerial enemies (50% dmg bonus removed) + if (item.type == ItemID.DD2BetsyBow) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("DD2BetsyBow")); // Death Sickle inflict Whispering Death if (item.type == ItemID.DeathSickle) - EditTooltipByNum(0, (line) => line.Text += "\nInflicts Whispering Death on hit"); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("DeathSickle")); #endregion // Light pets, accessories, and other items which boost the player's Abyss light stat #region Abyss Light Tooltips - // +1 to Abyss light level - string abyssSmallLightLine = "\nProvides a small amount of light in the abyss"; - if (item.type == ItemID.CrimsonHeart || item.type == ItemID.ShadowOrb || item.type == ItemID.MagicLantern || item.type == ItemID.JellyfishNecklace || item.type == ItemID.MiningHelmet || item.type == ItemID.UltrabrightHelmet) - EditTooltipByNum(0, (line) => line.Text += abyssSmallLightLine); + EditTooltipByNum(0, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel1")); if (item.type == ItemID.JellyfishDivingGear || item.type == ItemID.Magiluminescence) - EditTooltipByNum(1, (line) => line.Text += abyssSmallLightLine); + EditTooltipByNum(1, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel1")); // +2 to Abyss light level - string abyssMediumLightLine = "\nProvides a moderate amount of light in the abyss"; - if (item.type == ItemID.ShinePotion) - EditTooltipByName("BuffTime", (line) => line.Text += abyssMediumLightLine); - + EditTooltipByName("BuffTime", (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel2")); if (item.type == ItemID.FairyBell || item.type == ItemID.DD2PetGhost) - EditTooltipByNum(0, (line) => line.Text += abyssMediumLightLine); + EditTooltipByNum(0, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel2")); // +3 to Abyss light level - string abyssLargeLightLine = "\nProvides a large amount of light in the abyss"; - if (item.type == ItemID.WispinaBottle || item.type == ItemID.PumpkingPetItem || item.type == ItemID.GolemPetItem || item.type == ItemID.FairyQueenPetItem) - EditTooltipByNum(0, (line) => line.Text += abyssLargeLightLine); + EditTooltipByNum(0, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel3")); if (item.type == ItemID.SuspiciousLookingTentacle) - EditTooltipByNum(1, (line) => line.Text += abyssLargeLightLine); + EditTooltipByNum(1, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel3")); #endregion // Accessories and other items which boost the player's ability to breathe in the Abyss #region Abyss Breath Tooltips // Moderate breath boost - string abyssModerateBreathLine = "\nModerately reduces breath loss in the abyss"; - if (item.type == ItemID.DivingHelmet) - EditTooltipByNum(0, (line) => line.Text += abyssModerateBreathLine); + EditTooltipByNum(0, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssBreathLevel2")); if (item.type == ItemID.ArcticDivingGear) - EditTooltipByNum(1, (line) => line.Text += abyssSmallLightLine + abyssModerateBreathLine); + EditTooltipByNum(1, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssLightLevel1") + "\n" + CalamityUtils.GetTextValue("Common.AbyssBreathLevel2")); // Great breath boost - string abyssGreatBreathLine = "\nGreatly reduces breath loss in the abyss"; - if (item.type == ItemID.GillsPotion) - EditTooltipByName("BuffTime", (line) => line.Text += abyssGreatBreathLine); + EditTooltipByName("BuffTime", (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssBreathLevel3")); if (item.type == ItemID.NeptunesShell || item.type == ItemID.MoonShell) - EditTooltipByNum(1, (line) => line.Text += abyssGreatBreathLine); + EditTooltipByNum(1, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssBreathLevel3")); if (item.type == ItemID.CelestialShell) - EditTooltipByNum(4, (line) => line.Text += abyssModerateBreathLine); + EditTooltipByNum(4, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.AbyssBreathLevel3")); #endregion // Flasks apply to Rogue weapons #region Rogue Flask Tooltips if (item.type == ItemID.FlaskofCursedFlames) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace(" and Whip", ", Whip, and Rogue")); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofCursedFlames")); if (item.type == ItemID.FlaskofFire) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace(" and Whip", ", Whip, and Rogue")); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofFire")); if (item.type == ItemID.FlaskofGold) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace(" and Whip", ", Whip, and Rogue")); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofGold")); if (item.type == ItemID.FlaskofIchor) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace(" and Whip", ", Whip, and Rogue")); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofIchor")); if (item.type == ItemID.FlaskofNanites) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace(" and Whip", ", Whip, and Rogue")); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofNanites")); // party flask is unique because it affects ALL projectiles in Calamity, not just "also rogue ones" if (item.type == ItemID.FlaskofParty) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("Melee and Whip", "All")); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofParty")); if (item.type == ItemID.FlaskofPoison) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace(" and Whip", ", Whip, and Rogue")); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofPoison")); if (item.type == ItemID.FlaskofVenom) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace(" and Whip", ", Whip, and Rogue")); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlaskofVenom")); #endregion // Rebalances to vanilla item stats @@ -800,134 +697,132 @@ namespace CalamityMod.Items // Various mining speed nerfs if (item.type == ItemID.MiningPotion) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25", "15")); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "15%")); if (item.type == ItemID.AncientChisel) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25", "15")); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "15%")); if (item.type == ItemID.HandOfCreation) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25", "15")); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "15%")); // Frozen Turtle Shell rebalance. if (item.type == ItemID.FrozenTurtleShell) - EditTooltipByNum(0, (line) => line.Text = "Puts a shell around the owner when below 50% life that reduces damage by 15%"); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "15%")); if (item.type == ItemID.FrozenShield) - EditTooltipByNum(1, (line) => line.Text = "Puts a shell around the owner when below 50% life that reduces damage by 15%"); + EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("25%", "15%")); // Ale and Sake rebalance and Alcohol Poisoning. if (item.type == ItemID.Ale || item.type == ItemID.Sake) - { - EditTooltipByNum(0, (line) => line.Text = "Increases melee damage by 10% and reduces defense by 5%\n" + - "Counts as an alcohol for Alcohol Poisoning\n" + - "Drinking more than 3 different alcohols might not end well with your liver"); - } + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("AleSake")); //Flame Waker Boots buff. if (item.type == ItemID.FlameWakerBoots) - { - EditTooltipByNum(0, (line) => line.Text = "Multiplies all fire-based debuff damage by 1.25x\n" + - "All attacks light enemies on fire\n" + - "'Never get cold feet again'"); - } + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlameWakerBoots")); // Hellfire Treads buff. if (item.type == ItemID.HellfireTreads) - { - EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("fire blocks", "the Burning and On Fire! debuffs")); - EditTooltipByNum(2, (line) => line.Text += "\nMultiplies all fire-based debuff damage by 1.5x, does not stack with downgrades\n" + - "All attacks inflict Hellfire"); - } + EditTooltipByNum(2, (line) => line.Text += AddedTooltip("HellfireTreads")); // Fairy Boots buff. if (item.type == ItemID.FairyBoots) - EditTooltipByNum(2, (line) => line.Text += "\nFairies can spawn at any time on the surface and spawn far more frequently\n" + - "Nearby fairies grant +2 HP/s life regen, 10 defense and 10% movement speed\n" + - "Fairies are immune to damage and will no longer flee"); + EditTooltipByNum(2, (line) => line.Text += AddedTooltip("FairyBoots")); // Reduced Nightwither and Daybroken damage, and melee speed removal. if (item.type == ItemID.MoonStone) { - EditTooltipByNum(2, (line) => line.Text += "\nReduces the damage of the Nightwither debuff"); - EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("melee speed, ", "")); + EditTooltipByNum(2, (line) => line.Text += AddedTooltip("MoonStone")); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("SunMoonStones")); } if (item.type == ItemID.SunStone) { - EditTooltipByNum(2, (line) => line.Text += "\nReduces the damage of the Daybroken debuff"); - EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("melee speed, ", "")); + EditTooltipByNum(2, (line) => line.Text += AddedTooltip("SunStone")); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("SunMoonStones")); } if (item.type == ItemID.CelestialStone) { - EditTooltipByNum(2, (line) => line.Text += "\nReduces the damage of the Nightwither and Daybroken debuffs"); - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace(" melee speed,", "")); + EditTooltipByNum(2, (line) => line.Text += AddedTooltip("CelestialStone")); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("SunMoonStones")); } if (item.type == ItemID.CelestialShell) { - EditTooltipByNum(4, (line) => line.Text += "\nReduces the damage of the Nightwither and Daybroken debuffs"); - EditTooltipByNum(2, (line) => line.Text = line.Text.Replace(" melee speed,", "")); + EditTooltipByNum(4, (line) => line.Text += AddedTooltip("CelestialStone")); + EditTooltipByNum(2, (line) => line.Text = EditedTooltip("SunMoonStones")); } // Mana Flower tinker buffs. if (item.type == ItemID.MagnetFlower) - EditTooltipByNum(0, (line) => line.Text = "10% reduced mana cost"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MagnetFlower")); if (item.type == ItemID.ArcaneFlower || item.type == ItemID.ManaCloak) - EditTooltipByNum(0, (line) => line.Text = "12% reduced mana cost"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("ArcaneFlowerManaCloak")); if (item.type == ItemID.ArcaneFlower) - EditTooltipByNum(2, (line) => line.Text += "\n5% increased magic damage"); + EditTooltipByNum(2, (line) => line.Text += AddedTooltip("ArcaneFlower")); // Magiluminescence nerf and clear explanation of what it actually does. if (item.type == ItemID.Magiluminescence) - EditTooltipByNum(0, (line) => line.Text = "Increases movement acceleration and deceleration by 1.75x\n" + - "Increases movement speed by 1.15x. This bonus applies to running boot accessories"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("Magiluminescence")); + + // Frog Leg and all upgrades get clear explanations of what they actually do. + if (item.type == ItemID.FrogLeg) + EditTooltipByNum(0, (line) => line.Text = GetEditedTooltip("FrogLeg").Format(BalancingConstants.VanillaFrogLegJumpSpeedBoost.ToJumpSpeedPercent())); + + if (item.type == ItemID.FrogFlipper || item.type == ItemID.FrogWebbing) + EditTooltipByNum(1, (line) => line.Text = GetEditedTooltip("FrogLeg").Format(BalancingConstants.VanillaFrogLegJumpSpeedBoost.ToJumpSpeedPercent())); + + if (item.type == ItemID.FrogGear) + EditTooltipByNum(2, (line) => line.Text = GetEditedTooltip("FrogLeg").Format(BalancingConstants.VanillaFrogLegJumpSpeedBoost.ToJumpSpeedPercent())); + + if (item.type == ItemID.AmphibianBoots) + EditTooltipByNum(1, (line) => line.Text = GetEditedTooltip("FrogLeg").Format(BalancingConstants.AmphibianBootsJumpSpeedBoost.ToJumpSpeedPercent())); // Soaring Insignia nerf and clear explanation of what it actually does. if (item.type == ItemID.EmpressFlightBooster) { - EditTooltipByNum(0, (line) => line.Text = "Increases wing flight time by 25%"); - EditTooltipByNum(1, (line) => line.Text = "Increases movement and jump speed by 10% and acceleration by 1.1x"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("EmpressFlightBooster1")); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("EmpressFlightBooster2")); } // Rifle Scope visibility change if (item.type == ItemID.RifleScope) { - EditTooltipByNum(0, (line) => line.Text = "Increase view range for guns (Right click to zoom out)"); - EditTooltipByNum(1, (line) => line.Text = "The scope effect can be toggled with visibility"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("RifleScope1")); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("RifleScope2")); } // Sniper Scope rebalance and visibility change if (item.type == ItemID.SniperScope) { - EditTooltipByNum(1, (line) => line.Text = "7% increased ranged damage and critical strike chance"); - EditTooltipByNum(0, (line) => line.Text += "\nThe scope effect can be toggled with visibility"); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("SniperScope")); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("RifleScope")); } // Recon Scope visibility change if (item.type == ItemID.ReconScope) - EditTooltipByNum(0, (line) => line.Text += "\nThe scope effect can be toggled with visibility"); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("RifleScope")); // Magic Quiver if (item.type == ItemID.MagicQuiver) - EditTooltipByNum(0, (line) => line.Text = "Increases arrow damage by 5% and greatly increases arrow speed"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MagicQuiver")); // Molten Quiver if (item.type == ItemID.MoltenQuiver) { - EditTooltipByNum(0, (line) => line.Text = "Increases arrow damage by 7% and greatly increases arrow speed"); - EditTooltipByNum(2, (line) => line.Text += " and all arrows inflict Hellfire"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MoltenQuiver1")); + EditTooltipByNum(2, (line) => line.Text = EditedTooltip("MoltenQuiver2")); } // Magic Power Potion nerf if (item.type == ItemID.MagicPowerPotion) - EditTooltipByNum(0, (line) => line.Text = "10% increased magic damage"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MagicPowerPotion")); // Featherfall Potion being stupid broken with Aero Stone if (item.type == ItemID.FeatherfallPotion) - EditTooltipByNum(0, (line) => line.Text = "Slows falling speed\n" + "Disables all airborne flight recovery"); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("FeatherfallPotion")); // Magic Hat nerf if (item.type == ItemID.MagicHat) - EditTooltipByNum(0, (line) => line.Text = "6% increased magic critical strike chance"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MagicHat")); // Gem Robe nerfs if (item.type == ItemID.AmethystRobe) @@ -961,116 +856,107 @@ namespace CalamityMod.Items EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("12%", "10%")); if (item.type == ItemID.TitanGlove) - EditTooltipByNum(0, (line) => line.Text += "\n10% increased true melee damage"); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("TitanGloveLine")); if (item.type == ItemID.PowerGlove) { - EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("12% increased melee speed", "10% increased melee speed, does not stack with downgrades")); - EditTooltipByNum(0, (line) => line.Text += "\n10% increased true melee damage"); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("PowerGlove")); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("TitanGloveLine")); } if (item.type == ItemID.BerserkerGlove) - { - EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("12% increased melee speed", "10% increased true melee damage")); - } + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("BerserkerGlove")); if (item.type == ItemID.MechanicalGlove) - { - string extraLine = "\n10% increased true melee damage"; - string extraLine2 = "\n12% increased melee speed, does not stack with downgrades" + extraLine; - EditTooltipByNum(1, (line) => line.Text = "12% increased melee damage" + extraLine2); - } + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("MechanicalGlove") + AddedTooltip("TitanGloveLine")); if (item.type == ItemID.FireGauntlet) { - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("fire damage", "Hellfire")); - string extraLine = "\n10% increased true melee damage"; - string extraLine2 = "\n14% increased melee speed, does not stack with downgrades" + extraLine; - EditTooltipByNum(1, (line) => line.Text = "14% increased melee damage" + extraLine2); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FireGauntlet1")); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("FireGauntlet2") + AddedTooltip("TitanGloveLine")); } // On Fire! debuff immunities - if (item.type == ItemID.ObsidianSkull || item.type == ItemID.AnkhShield || item.type == ItemID.ObsidianSkullRose || item.type == ItemID.MoltenCharm) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("fire blocks", "the Burning and On Fire! debuffs")); + if (item.type == ItemID.ObsidianSkull || item.type == ItemID.ObsidianSkullRose || item.type == ItemID.MoltenCharm) + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("ObsidianSkullLine")); - if (item.type == ItemID.ObsidianHorseshoe || item.type == ItemID.ObsidianShield || item.type == ItemID.ObsidianWaterWalkingBoots || item.type == ItemID.LavaWaders || item.type == ItemID.LavaSkull || item.type == ItemID.MoltenSkullRose) - EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("fire blocks", "the Burning and On Fire! debuffs")); + if (item.type == ItemID.ObsidianHorseshoe || item.type == ItemID.ObsidianShield || item.type == ItemID.ObsidianWaterWalkingBoots || item.type == ItemID.LavaSkull || item.type == ItemID.MoltenSkullRose) + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("ObsidianSkullLine")); + + if (item.type == ItemID.LavaWaders) + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("LavaWaders")); if (item.type == ItemID.TerrasparkBoots) - EditTooltipByNum(3, (line) => line.Text += "\nImmunity to the On Fire! debuff"); + EditTooltipByNum(3, (line) => line.Text = EditedTooltip("LavaWaders")); // Ozzatron 23NOV2023: Removed tooltip edits for Magma Skull and Molten Skull Rose, as they were invalid after vanilla tooltip changes. // Yoyo Glove/Bag apply a 0.5x damage multiplier on the second yoyo if (item.type == ItemID.YoyoBag || item.type == ItemID.YoYoGlove) - EditTooltipByNum(0, (line) => line.Text += "\nSecondary yoyos will do 50% less damage"); - - // Falcon Blade +20% move speed while holding - if (item.type == ItemID.FalconBlade) - EditTooltipByName("Knockback", (line) => line.Text += "\nHolding this item grants +20% increased movement speed"); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("YoyoGlove")); //Gi 10% melee speed into 10% jump speed replacement if (item.type == ItemID.Gi) - EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("melee", "jump")); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("Gi")); #endregion // Pre-Hardmode ore armor tooltip edits #region Pre-Hardmode Ore Armor // Copper if (item.type == ItemID.CopperHelmet) - AddTooltip("5% increased damage"); + AddTooltip("CopperHelmet"); if (item.type == ItemID.CopperChainmail) - AddTooltip("3% increased critical strike chance"); + AddTooltip("CopperChainmail"); if (item.type == ItemID.CopperGreaves) - AddTooltip("5% increased movement speed"); + AddTooltip("CopperGreaves"); // Tin if (item.type == ItemID.TinHelmet) - AddTooltip("3% increased critical strike chance"); + AddTooltip("TinHelmet"); if (item.type == ItemID.TinChainmail) - AddTooltip("+0.5 HP/s life regen"); + AddTooltip("TinChainmail"); if (item.type == ItemID.TinGreaves) - AddTooltip("5% increased movement speed"); + AddTooltip("TinGreaves"); // Iron if (item.type == ItemID.IronHelmet || item.type == ItemID.AncientIronHelmet || item.type == ItemID.IronChainmail || item.type == ItemID.IronGreaves) - AddTooltip("Increases damage reduction by 3%"); + AddTooltip("IronPieces"); // Lead if (item.type == ItemID.LeadHelmet || item.type == ItemID.LeadChainmail || item.type == ItemID.LeadGreaves) - AddTooltip("Increases damage reduction by 2%"); + AddTooltip("LeadPieces"); // Silver if (item.type == ItemID.SilverHelmet) - AddTooltip("5% increased critical strike chance"); + AddTooltip("SilverHelmet"); if (item.type == ItemID.SilverChainmail) - AddTooltip("+1 HP/s life regen"); + AddTooltip("SilverChainmail"); if (item.type == ItemID.SilverGreaves) - AddTooltip("8% increased movement speed"); + AddTooltip("SilverGreaves"); // Tungsten if (item.type == ItemID.TungstenHelmet) - AddTooltip("7% increased damage"); + AddTooltip("TungstenHelmet"); if (item.type == ItemID.TungstenChainmail) - AddTooltip("+0.5 HP/s life regen"); + AddTooltip("TungstenChainmail"); if (item.type == ItemID.TungstenGreaves) - AddTooltip("8% increased movement speed"); + AddTooltip("TungstenGreaves"); // Gold if (item.type == ItemID.GoldHelmet || item.type == ItemID.AncientGoldHelmet) - AddTooltip("6% increased damage"); + AddTooltip("GoldHelmet"); if (item.type == ItemID.GoldChainmail) - AddTooltip("Increases damage reduction by 5%"); + AddTooltip("GoldChainmail"); if (item.type == ItemID.GoldGreaves) - AddTooltip("10% increased movement speed"); + AddTooltip("GoldGreaves"); // Platinum if (item.type == ItemID.PlatinumHelmet) - AddTooltip("6% increased damage"); + AddTooltip("PlatinumHelmet"); if (item.type == ItemID.PlatinumChainmail) - AddTooltip("3% increased critical strike chance"); + AddTooltip("PlatinumChainmail"); if (item.type == ItemID.PlatinumGreaves) - AddTooltip("10% increased movement speed"); + AddTooltip("PlatinumGreaves"); // Jungle if (item.type == ItemID.JungleHat || item.type == ItemID.AncientCobaltHelmet) @@ -1088,7 +974,7 @@ namespace CalamityMod.Items { string newTooltip = line.Text.Replace("3%", "6%"); // Chest piece has 2 regen instead of 1 - newTooltip += item.type == ItemID.CrimsonScalemail ? "\n+1 HP/s life regen" : "\n+0.5 HP/s life regen"; + newTooltip += item.type == ItemID.CrimsonScalemail ? AddedTooltip("CrimsonBreastplate") : AddedTooltip("CrimsonOtherPieces"); line.Text = newTooltip; }); } @@ -1102,35 +988,35 @@ namespace CalamityMod.Items #region Hardmode Ore Armor // Cobalt if (item.type == ItemID.CobaltHat) - EditTooltipByNum(0, (line) => line.Text = $"Increases maximum mana by {CobaltArmorSetChange.MaxManaBoost + 40}"); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("40", $"{CobaltArmorSetChange.MaxManaBoost + 40}")); // Palladium if (item.type == ItemID.PalladiumBreastplate) - EditTooltipByNum(0, (line) => line.Text = $"{PalladiumArmorSetChange.ChestplateDamagePercentageBoost + 3}% increased damage"); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("3%", $"{PalladiumArmorSetChange.ChestplateDamagePercentageBoost + 3}%")); if (item.type == ItemID.PalladiumLeggings) - EditTooltipByNum(0, (line) => line.Text = $"{PalladiumArmorSetChange.LeggingsDamagePercentageBoost + 2}% increased damage"); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("2%", $"{PalladiumArmorSetChange.LeggingsDamagePercentageBoost + 2}%")); // Mythril if (item.type == ItemID.MythrilHood) - EditTooltipByNum(0, (line) => line.Text = $"Increases maximum mana by {MythrilArmorSetChange.MaxManaBoost + 60}"); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("60", $"{MythrilArmorSetChange.MaxManaBoost + 60}")); // Orichalcum if (item.type == ItemID.OrichalcumBreastplate) - EditTooltipByNum(0, (line) => line.Text = $"{OrichalcumArmorSetChange.ChestplateCritChanceBoost + 6}% increased critical strike chance"); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("6%", $"{OrichalcumArmorSetChange.ChestplateCritChanceBoost + 6}%")); // Adamantite if (item.type == ItemID.AdamantiteHeadgear) - EditTooltipByNum(0, (line) => line.Text = $"Increases maximum mana by {AdamantiteArmorSetChange.MaxManaBoost + 80}"); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("80", $"{AdamantiteArmorSetChange.MaxManaBoost + 80}")); // Titanium if (item.type == ItemID.TitaniumMask) - EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("9", "14")); + EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("9%", "14%")); // Solar Flare if (item.type == ItemID.SolarFlareHelmet) EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("26%", "20%")); if (item.type == ItemID.SolarFlareHelmet || item.type == ItemID.SolarFlareBreastplate || item.type == ItemID.SolarFlareLeggings) - EditTooltipByNum(1, (line) => line.Text = "Grants +1 HP/s life regeneration"); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("SolarFlarePieces")); // Vortex if (item.type == ItemID.VortexHelmet) @@ -1145,56 +1031,52 @@ namespace CalamityMod.Items // Reduce DD2 armor piece bonuses because they're overpowered, and clarify life regen boosts // Squire armor if (item.type == ItemID.SquireGreatHelm) - EditTooltipByNum(0, (line) => line.Text = "Increases your max number of sentries by 1 and grants +2 HP/s life regen"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("SquireGreatHelm")); if (item.type == ItemID.SquirePlating) - EditTooltipByNum(0, (line) => line.Text = "10% increased minion damage and 15% increased melee damage"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("SquirePlating")); if (item.type == ItemID.SquireGreaves) - EditTooltipByNum(0, (line) => line.Text = "5% increased minion damage and melee critical strike chance\n" + - "15% increased movement speed"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("SquireGreaves")); // Monk armor if (item.type == ItemID.MonkBrows) - EditTooltipByNum(0, (line) => line.Text = "Increases your max number of sentries by 1 and increases melee attack speed by 10%"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MonkBrows")); if (item.type == ItemID.MonkShirt) - EditTooltipByNum(0, (line) => line.Text = "10% increased minion and melee damage"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MonkShirt")); if (item.type == ItemID.MonkPants) { - EditTooltipByNum(0, (line) => line.Text = "5% increased minion damage and melee critical strike chance"); - EditTooltipByNum(1, (line) => line.Text = "20% increased movement speed"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MonkPants1")); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("MonkPants2")); } // Huntress armor if (item.type == ItemID.HuntressJerkin) - EditTooltipByNum(0, (line) => line.Text = "10% increased minion and ranged damage\n" + - "10% chance to not consume ammo"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("HuntressJerkin")); // Apprentice armor if (item.type == ItemID.ApprenticeTrousers) - EditTooltipByNum(0, (line) => line.Text = "5% increased minion damage and magic critical strike chance\n" + - "20% increased movement speed"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("ApprenticeTrousers")); // Valhalla Knight armor if (item.type == ItemID.SquireAltShirt) - EditTooltipByNum(0, (line) => line.Text = "30% increased minion damage and grants +4 HP/s life regen"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("SquireAltShirt")); if (item.type == ItemID.SquireAltPants) - EditTooltipByNum(0, (line) => line.Text = "10% increased minion damage and melee critical strike chance"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("SquireAltPants")); // Shinobi Infiltrator armor if (item.type == ItemID.MonkAltHead) - EditTooltipByNum(0, (line) => line.Text = "Increases your max number of sentries by 2\n" + - "10% increased melee and minion damage"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MonkAltHead")); if (item.type == ItemID.MonkAltShirt) - EditTooltipByNum(0, (line) => line.Text = "10% increased minion damage and melee speed"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MonkAltShirt")); if (item.type == ItemID.MonkAltPants) - EditTooltipByNum(0, (line) => line.Text = "10% increased minion damage and melee critical strike chance"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MonkAltPants")); // Red Riding armor if (item.type == ItemID.HuntressAltShirt) - EditTooltipByNum(0, (line) => line.Text = "15% increased minion and ranged damage and 20% chance to not consume ammo"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("HuntressAltShirt")); // Dark Artist armor if (item.type == ItemID.ApprenticeAltPants) - EditTooltipByNum(0, (line) => line.Text = "10% increased minion damage and magic critical strike chance"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("ApprenticeAltPants")); #endregion // Non-consumable boss summon items @@ -1203,23 +1085,22 @@ namespace CalamityMod.Items item.type == ItemID.WormFood || item.type == ItemID.BloodySpine || item.type == ItemID.Abeemination || item.type == ItemID.DeerThing || item.type == ItemID.QueenSlimeCrystal || item.type == ItemID.PirateMap || item.type == ItemID.SnowGlobe || item.type == ItemID.MechanicalEye || item.type == ItemID.MechanicalWorm || item.type == ItemID.MechanicalSkull || item.type == ItemID.NaughtyPresent || item.type == ItemID.PumpkinMoonMedallion || item.type == ItemID.SolarTablet || item.type == ItemID.SolarTablet || item.type == ItemID.CelestialSigil) - - EditTooltipByNum(0, (line) => line.Text += "\nNot consumable"); + EditTooltipByNum(0, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.NotConsumable")); #endregion // Add mentions of what Calamity ores vanilla pickaxes can mine #region Pickaxe New Ore Tooltips if (item.type == ItemID.GoldPickaxe || item.type == ItemID.PlatinumPickaxe) - EditTooltipByNum(0, (line) => line.Text = "Can mine Demonite, Crimtane, Meteorite, Sea Prisms and Sea Prism Crystals"); + EditTooltipByNum(0, (line) => line.Text = EditedTooltip("GoldPickaxe")); if (item.type == ItemID.Picksaw) - EditTooltipByNum(0, (line) => line.Text += "\nCan mine Scoria Ore located in the Abyss"); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("Picksaw")); if (item.type == ItemID.SolarFlarePickaxe || item.type == ItemID.VortexPickaxe || item.type == ItemID.NebulaPickaxe || item.type == ItemID.StardustPickaxe) - EditTooltipByName("Material", (line) => line.Text += "\nCan mine Uelibloom Ore"); + EditTooltipByName("Material", (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.CanMineUelibloom")); if (item.type == ItemID.SolarFlareDrill || item.type == ItemID.VortexDrill || item.type == ItemID.NebulaDrill || item.type == ItemID.StardustDrill) - EditTooltipByName("TileBoost", (line) => line.Text += "\nCan mine Uelibloom Ore"); + EditTooltipByName("TileBoost", (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.CanMineUelibloom")); #endregion // Rebalances and information about vanilla set bonuses @@ -1229,16 +1110,16 @@ namespace CalamityMod.Items // Gladiator if (item.type == ItemID.GladiatorHelmet) - EditTooltipByName("Defense", (line) => line.Text += $"\n{GladiatorArmorSetChange.HelmetRogueDamageBoostPercent}% increased rogue damage"); + EditTooltipByName("Defense", (line) => line.Text += "\n" +CalamityUtils.GetText("Common.RogueDamage").Format(GladiatorArmorSetChange.HelmetRogueDamageBoostPercent)); if (item.type == ItemID.GladiatorBreastplate) - EditTooltipByName("Defense", (line) => line.Text += $"\n{GladiatorArmorSetChange.ChestplateRogueCritBoostPercent}% increased rogue critical strike chance"); + EditTooltipByName("Defense", (line) => line.Text += "\n" +CalamityUtils.GetText("Common.RogueCrit").Format(GladiatorArmorSetChange.ChestplateRogueCritBoostPercent)); if (item.type == ItemID.GladiatorLeggings) - EditTooltipByName("Defense", (line) => line.Text += $"\n{GladiatorArmorSetChange.LeggingRogueVelocityBoostPercent}% increased rogue velocity"); + EditTooltipByName("Defense", (line) => line.Text += "\n" +CalamityUtils.GetText("Common.RogueVelocity").Format(GladiatorArmorSetChange.LeggingRogueVelocityBoostPercent)); // Forbidden (UNLESS you are wearing the Circlet, which is Summon/Rogue and does not get this line) if ((item.type == ItemID.AncientBattleArmorHat || item.type == ItemID.AncientBattleArmorShirt || item.type == ItemID.AncientBattleArmorPants) && !Main.LocalPlayer.Calamity().forbiddenCirclet) - EditTooltipByName("SetBonus", (line) => line.Text += "\nMinions no longer deal less damage while wielding magic weapons"); + EditTooltipByName("SetBonus", (line) => line.Text = CalamityUtils.GetText($"Vanilla.Armor.SetBonus.Forbidden").Format(Language.GetTextValue(Main.ReversedUpDownArmorSetBonuses ? "Key.UP" : "Key.DOWN"))); #endregion // Provide the full stats of every vanilla set of wings @@ -1272,45 +1153,41 @@ namespace CalamityMod.Items AddWingStats(3f, 1f, 0, 25); if (item.type == ItemID.AngelWings) - AddWingStats(6.25f, 1f, 1, 100, "+20 max life, +10 defense and +1 HP/s life regen"); + AddWingStats(6.25f, 1f, 1, 100); if (item.type == ItemID.DemonWings) - AddWingStats(6.25f, 1f, 1, 100, "5% increased damage and critical strike chance"); + AddWingStats(6.25f, 1f, 1, 100); if (item.type == ItemID.Jetpack) AddWingStats(6.5f, 1f, 1, 150); if (item.type == ItemID.ButterflyWings) - AddWingStats(7.5f, 1f, 1, 160, "+20 max mana, 5% decreased mana usage,\n" + - "5% increased magic damage and magic critical strike chance"); + AddWingStats(7.5f, 1f, 1, 160, "Increases mana regeneration rate"); if (item.type == ItemID.FairyWings) - AddWingStats(6.75f, 1f, 1, 130, "+60 max life"); + AddWingStats(6.75f, 1f, 1, 130); if (item.type == ItemID.BeeWings) AddWingStats(7.5f, 1f, 1, 160, "Permanently gives the Honey buff"); if (item.type == ItemID.HarpyWings) - AddWingStats(6.75f, 1f, 1, 130, "20% increased movement speed\n" + + AddWingStats(6.75f, 1f, 1, 130, "10% increased movement speed\n" + "With Harpy Ring or Angel Treads equipped, most attacks sometimes launch feathers"); if (item.type == ItemID.BoneWings) AddWingStats(7.5f, 1f, 1, 240, "Halves flight time when taking a hit"); if (item.type == ItemID.FlameWings) - AddWingStats(7.5f, 1f, 1, 160, "5% increased melee damage and critical strike chance"); + AddWingStats(7.5f, 1f, 1, 160, "Multiplies all heat debuff damage by 1.25x"); if (item.type == ItemID.FrozenWings) - AddWingStats(6.75f, 1f, 1, 130, "4% increased melee and ranged damage\n" + - "and multiplies all cold debuff damage by 1.25x while wearing Frost armor"); + AddWingStats(6.75f, 1f, 1, 130, "Multiplies all cold debuff damage by 1.25x"); if (item.type == ItemID.GhostWings) - AddWingStats(7.5f, 1f, 1, 170, "+10 defense and 5% increased damage reduction while wearing the Spectre Hood set\n" + - "5% increased magic damage and critical strike chance while wearing the Spectre Mask set"); + AddWingStats(7.5f, 1f, 1, 170); if (item.type == ItemID.BeetleWings) - AddWingStats(7.5f, 1f, 1, 170, "+10 defense and 5% increased damage reduction while wearing the Beetle Shell set\n" + - "5% increased melee damage and critical strike chance while wearing the Beetle Scale Mail set"); + AddWingStats(7.5f, 1f, 1, 170); if (item.type == ItemID.FinWings) AddWingStats(6.75f, 1f, 1, 130, "Gills effect and you can move freely through liquids\n" + @@ -1320,14 +1197,13 @@ namespace CalamityMod.Items AddWingStats(8f, 2f, 2, 180); if (item.type == ItemID.SteampunkWings) - AddWingStats(7.5f, 1f, 1, 180, "+8 defense, 10% increased movement speed,\n" + "4% increased damage, and 2% increased critical strike chance"); + AddWingStats(7.5f, 1f, 1, 180); if (item.type == ItemID.LeafWings) - AddWingStats(7.5f, 1f, 1, 160, "+5 defense, 5% increased damage reduction,\n" + "and permanent Dryad's Blessing while wearing the Tiki Armor"); + AddWingStats(7.5f, 1f, 1, 160, "+10 defense and permanent Dryad's Blessing"); if (item.type == ItemID.BatWings) - AddWingStats(7.5f, 1f, 1, 160, "At night or during an eclipse, you will gain the following boosts:\n" + - "7% increased damage and 3% increased critical strike chance"); + AddWingStats(7.5f, 1f, 1, 160, "Improves vision"); // All developer wings have identical stats and no special effects if (item.type == ItemID.Yoraiz0rWings || item.type == ItemID.JimsWings || item.type == ItemID.SkiphsWings || @@ -1341,35 +1217,31 @@ namespace CalamityMod.Items } if (item.type == ItemID.TatteredFairyWings) - AddWingStats(7.5f, 1f, 1, 180, "5% increased damage and critical strike chance"); + AddWingStats(7.5f, 1f, 1, 180, "You leave a trail of fairy dust as you fly"); if (item.type == ItemID.SpookyWings) - AddWingStats(7.5f, 1f, 1, 180, "Increased minion knockback and 5% increased minion damage while wearing the Spooky Armor"); + AddWingStats(7.5f, 1f, 1, 180); if (item.type == ItemID.Hoverboard) - AddWingStats(6.5f, 1f, 1, 170, "5% increased weapon-type damage while wearing the Shroomite Armor\n" + - "The weapon type boosted matches which Shroomite helmet is worn"); + AddWingStats(6.5f, 1f, 1, 170); if (item.type == ItemID.FestiveWings) - AddWingStats(7.5f, 1f, 1, 180, "+40 max life\nOrnaments rain down as you fly"); + AddWingStats(7.5f, 1f, 1, 180, "Homing ornaments rain down as you fly"); if (item.type == ItemID.MothronWings) - AddWingStats(7.5f, 1f, 1, 170, "+5 defense and 5% increased damage"); + AddWingStats(7.5f, 1f, 1, 200); if (item.type == ItemID.WingsSolar) - AddWingStats(9f, 2.5f, 3, 180, "7% increased melee damage and 3% increased melee critical strike chance\n" + - "while wearing the Solar Flare Armor"); + AddWingStats(9f, 2.5f, 3, 180, "Increases Solar Flare armor's dash velocity by 30%"); if (item.type == ItemID.WingsStardust) - AddWingStats(9f, 2.5f, 3, 180, "10% increased minion damage while wearing the Stardust Armor"); + AddWingStats(9f, 2.5f, 3, 180, "Greatly increases Stardust armor's stardust guardian damage and attack range"); if (item.type == ItemID.WingsVortex) - AddWingStats(6.5f, 1.5f, 2, 180, "3% increased ranged damage and 7% increased ranged critical strike chance\n" + - "while wearing the Vortex Armor"); + AddWingStats(6.5f, 1.5f, 2, 180, "Prevents dashes from disabling Vortex armor's stealth ability"); if (item.type == ItemID.WingsNebula) - AddWingStats(6.5f, 1.5f, 2, 180, "+20 max mana, 5% increased magic damage and critical strike chance,\n" + - "and 5% decreased mana usage while wearing the Nebula Armor"); + AddWingStats(6.5f, 1.5f, 2, 180, "Increases the pickup range of Nebula armor's nebula boosters"); // Betsy's Wings (and dev wings) are the only wings without "Allows flight and free fall" if (item.type == ItemID.BetsyWings) @@ -1385,20 +1257,8 @@ namespace CalamityMod.Items // Provide the full stats of every vanilla grappling hook #region Grappling Hook Stat Tooltips - // This function produces a "stat sheet" for a grappling hook from the raw stats. - string HookStatsTooltip(float reach, float launch, float reel, float pull) - { - StringBuilder sb = new StringBuilder(128); - sb.Append('\n'); - sb.Append($"Reach: {reach:N3} tiles\n"); - sb.Append($"Launch Velocity: {launch:N2}\n"); - sb.Append($"Reelback Velocity: {reel:N2}\n"); - sb.Append($"Pull Velocity: {pull:N2}"); - return sb.ToString(); - } - // This function is shorthand for appending a stat sheet to a grappling hook. - void AddGrappleStats(float r, float l, float e, float p) => EditTooltipByName("Equipable", (line) => line.Text += HookStatsTooltip(r, l, e, p)); + void AddGrappleStats(float r, float l, float e, float p) => EditTooltipByName("Equipable", (line) => line.Text += "\n" + CalamityUtils.GetText("Common.GrappleStats").Format(r.ToString(), l.ToString(), e.ToString(), p.ToString())); if (item.type == ItemID.GrapplingHook) AddGrappleStats(18.75f, 11.5f, 11f, 11f); @@ -1455,7 +1315,7 @@ namespace CalamityMod.Items #region Herbs and Seeds Tooltips - void AddHerbTooltips(string text) + void AddHerbTooltips(string key) { int materialIndex = 0; for (int i = 0; i < tooltips.Count; ++i) @@ -1464,25 +1324,25 @@ namespace CalamityMod.Items materialIndex = i; break; } - tooltips.Insert(materialIndex + 1, new TooltipLine(CalamityMod.Instance, "Tooltip0", text)); + tooltips.Insert(materialIndex + 1, new TooltipLine(CalamityMod.Instance, "Tooltip0", CalamityUtils.GetTextValue($"Vanilla.HerbTooltips.{key}"))); } if (item.type == ItemID.Daybloom) - AddHerbTooltips(CalamityUtils.GetTextValue("Vanilla.HerbTooltips.Daybloom")); + AddHerbTooltips("Daybloom"); if (item.type == ItemID.Moonglow) - AddHerbTooltips(CalamityUtils.GetTextValue("Vanilla.HerbTooltips.Moonglow")); + AddHerbTooltips("Moonglow"); if (item.type == ItemID.Waterleaf) - AddHerbTooltips(CalamityUtils.GetTextValue("Vanilla.HerbTooltips.Waterleaf")); + AddHerbTooltips("Waterleaf"); if (item.type == ItemID.Blinkroot) - AddHerbTooltips(CalamityUtils.GetTextValue("Vanilla.HerbTooltips.Blinkroot")); + AddHerbTooltips("Blinkroot"); if (item.type == ItemID.Shiverthorn) - AddHerbTooltips(CalamityUtils.GetTextValue("Vanilla.HerbTooltips.Shiverthorn")); + AddHerbTooltips("Shiverthorn"); if (item.type == ItemID.Deathweed) - AddHerbTooltips(CalamityUtils.GetTextValue("Vanilla.HerbTooltips.Deathweed")); + AddHerbTooltips("Deathweed"); if (item.type == ItemID.Fireblossom) - AddHerbTooltips(CalamityUtils.GetTextValue("Vanilla.HerbTooltips.Fireblossom")); + AddHerbTooltips("Fireblossom"); - void AddSeedTooltips(string text) + void AddSeedTooltips(string key) { int materialIndex = 0; for (int i = 0; i < tooltips.Count; ++i) @@ -1491,23 +1351,23 @@ namespace CalamityMod.Items materialIndex = i; break; } - tooltips.Insert(materialIndex + 1, new TooltipLine(CalamityMod.Instance, "Tooltip0", text)); + tooltips.Insert(materialIndex + 1, new TooltipLine(CalamityMod.Instance, "Tooltip0", CalamityUtils.GetTextValue($"Vanilla.SeedTooltips.{key}"))); } if (item.type == ItemID.DaybloomSeeds) - AddSeedTooltips(CalamityUtils.GetTextValue("Vanilla.SeedTooltips.Daybloom")); + AddSeedTooltips("Daybloom"); if (item.type == ItemID.MoonglowSeeds) - AddSeedTooltips(CalamityUtils.GetTextValue("Vanilla.SeedTooltips.Moonglow")); + AddSeedTooltips("Moonglow"); if (item.type == ItemID.WaterleafSeeds) - AddSeedTooltips(CalamityUtils.GetTextValue("Vanilla.SeedTooltips.Waterleaf")); + AddSeedTooltips("Waterleaf"); if (item.type == ItemID.BlinkrootSeeds) - AddSeedTooltips(CalamityUtils.GetTextValue("Vanilla.SeedTooltips.Blinkroot")); + AddSeedTooltips("Blinkroot"); if (item.type == ItemID.ShiverthornSeeds) - AddSeedTooltips(CalamityUtils.GetTextValue("Vanilla.SeedTooltips.Shiverthorn")); + AddSeedTooltips("Shiverthorn"); if (item.type == ItemID.DeathweedSeeds) - AddSeedTooltips(CalamityUtils.GetTextValue("Vanilla.SeedTooltips.Deathweed")); + AddSeedTooltips("Deathweed"); if (item.type == ItemID.FireblossomSeeds) - AddSeedTooltips(CalamityUtils.GetTextValue("Vanilla.SeedTooltips.Fireblossom")); + AddSeedTooltips("Fireblossom"); #endregion @@ -1519,7 +1379,7 @@ namespace CalamityMod.Items #region Accessory Prefix Rebalance Tooltips // Turns a number into a string of increased DR. - string DRString(float percent) => $"\n+{percent:N2}% damage reduction"; + string DRString(float percent) => "\n" + GetAddedTooltip("DefensePrefix").Format(percent.ToString()); switch (item.prefix) { @@ -1540,7 +1400,7 @@ namespace CalamityMod.Items (line) => line.Text = line.Text.Replace("4", CalamityUtils.GetScalingDefense(item.prefix).ToString()) + DRString(1f)); return; case PrefixID.Lucky: - EditTooltipByName("PrefixAccCritChance", (line) => line.Text += "\n+0.05 luck"); + EditTooltipByName("PrefixAccCritChance", (line) => line.Text += AddedTooltip("LuckyPrefix")); return; } #endregion @@ -1634,24 +1494,24 @@ namespace CalamityMod.Items #region Schematic Knowledge Tooltip Utility public static void InsertKnowledgeTooltip(List tooltips, int tier, bool allowOldWorlds = false) { - TooltipLine line = new TooltipLine(CalamityMod.Instance, "SchematicKnowledge1", "You don't have sufficient knowledge to create this yet"); - TooltipLine line2 = new TooltipLine(CalamityMod.Instance, "SchematicKnowledge2", "A specific schematic must be deciphered first"); + TooltipLine line = new TooltipLine(CalamityMod.Instance, "SchematicKnowledge1", CalamityUtils.GetTextValue("Misc.SchematicKnowledgeTooltip")); + TooltipLine line2 = new TooltipLine(CalamityMod.Instance, "SchematicKnowledge2", CalamityUtils.GetTextValue("Misc.SchematicKnowledgeTooltip2")); switch (tier) { case 1: - line2 = new TooltipLine(CalamityMod.Instance, "SchematicKnowledge2", "The Sunken Sea schematic must be deciphered first"); + line2 = new TooltipLine(CalamityMod.Instance, "SchematicKnowledge2", CalamityUtils.GetTextValue("Misc.Tier1KnowledgeTooltip")); break; case 2: - line2 = new TooltipLine(CalamityMod.Instance, "SchematicKnowledge2", "The Planetoid schematic must be deciphered first"); + line2 = new TooltipLine(CalamityMod.Instance, "SchematicKnowledge2", CalamityUtils.GetTextValue("Misc.Tier2KnowledgeTooltip")); break; case 3: - line2 = new TooltipLine(CalamityMod.Instance, "SchematicKnowledge2", "The Jungle schematic must be deciphered first"); + line2 = new TooltipLine(CalamityMod.Instance, "SchematicKnowledge2", CalamityUtils.GetTextValue("Misc.Tier3KnowledgeTooltip")); break; case 4: - line2 = new TooltipLine(CalamityMod.Instance, "SchematicKnowledge2", "The Underworld schematic must be deciphered first"); + line2 = new TooltipLine(CalamityMod.Instance, "SchematicKnowledge2", CalamityUtils.GetTextValue("Misc.Tier4KnowledgeTooltip")); break; case 5: - line2 = new TooltipLine(CalamityMod.Instance, "SchematicKnowledge2", "The Ice biome schematic must be deciphered first"); + line2 = new TooltipLine(CalamityMod.Instance, "SchematicKnowledge2", CalamityUtils.GetTextValue("Misc.Tier5KnowledgeTooltip")); break; } line.OverrideColor = line2.OverrideColor = Color.Cyan; diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 430ca6eaec..fb61d673b4 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -36,13 +36,13 @@ namespace CalamityMod.Items currentTweaks = new SortedDictionary { #region CATEGORY 1: Weapon Balancing - { ItemID.AdamantiteGlaive, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(65), ShootSpeedRatio(1.25f)) }, + { ItemID.AdamantiteGlaive, Do(AutoReuse, TrueMelee, DamageExact(69), UseExact(7), ShootSpeedExact(18f)) }, { ItemID.AdamantiteRepeater, Do(PointBlank, UseExact(14)) }, - { ItemID.AdamantiteSword, Do(UseTurn, DamageExact(77)) }, + { ItemID.AdamantiteSword, Do(UseTurn, DamageExact(75), UseExact(7)) }, { ItemID.AmberStaff, Do(UseTimeExact(15), UseAnimationExact(45), ReuseDelayExact(15)) }, { ItemID.AmethystStaff, Do(ManaExact(2)) }, { ItemID.Anchor, Do(DamageExact(107), UseExact(30)) }, - { ItemID.AntlionClaw, Do(UseExact(14)) }, // Mandible Blade + { ItemID.AntlionClaw, Do(UseExact(10)) }, // Mandible Blade { ItemID.AquaScepter, Do(DamageExact(24)) }, { ItemID.Bananarang, Do(DamageExact(76), UseExact(14)) }, { ItemID.BatScepter, Do(DamageExact(50)) }, @@ -55,26 +55,27 @@ namespace CalamityMod.Items { ItemID.BlizzardStaff, Do(DamageExact(41), ManaExact(7)) }, { ItemID.BloodyMachete, Do(AutoReuse, DamageExact(24)) }, { ItemID.Blowgun, Do(PointBlank, DamageExact(40), ShootSpeedExact(15f)) }, - { ItemID.BluePhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) }, - { ItemID.BluePhasesaber, Do(DamageExact(60)) }, + { ItemID.BluePhaseblade, Do(AutoReuse, UseTurn, DamageExact(48)) }, + { ItemID.BluePhasesaber, Do(DamageExact(132)) }, + { ItemID.BoneSword, Do(AutoReuse, UseTurn, DamageExact(25)) }, { ItemID.BookofSkulls, Do(DamageExact(27), ManaExact(13), ShootSpeedExact(5.5f)) }, { ItemID.BookStaff, Do(ManaExact(14)) }, // Tome of Infinite Wisdom { ItemID.Boomstick, Do(PointBlank, DamageExact(11)) }, - { ItemID.BreakerBlade, Do(AutoReuse, UseTurn, DamageExact(97)) }, + { ItemID.BreakerBlade, Do(AutoReuse, UseTurn, DamageExact(140)) }, { ItemID.CandyCornRifle, Do(PointBlank, DamageExact(66)) }, { ItemID.Cascade, Do(AutoReuse, DamageExact(31)) }, { ItemID.ChainGuillotines, Do(DamageExact(100)) }, { ItemID.ChainGun, Do(PointBlank, DamageExact(35)) }, { ItemID.ChainKnife, Do(AutoReuse, DamageRatio(1.34f)) }, // Uses ratios due to remix seed - { ItemID.ChlorophyteClaymore, Do(UseMeleeSpeed, DamageExact(176), UseExact(35), UseAnimationExact(45), ShootSpeedExact(22f)) }, - { ItemID.ChlorophytePartisan, Do(AutoReuse, UseMeleeSpeed, UseRatio(0.8f), DamageExact(70)) }, - { ItemID.ChlorophyteSaber, Do(UseMeleeSpeed, DamageExact(80), UseExact(10)) }, + { ItemID.ChlorophyteClaymore, Do(UseMeleeSpeed, DamageExact(180), UseExact(45), ShootSpeedExact(22f)) }, + { ItemID.ChlorophytePartisan, Do(AutoReuse, UseMeleeSpeed, DamageExact(98)) }, + { ItemID.ChlorophyteSaber, Do(UseMeleeSpeed, DamageExact(92), UseExact(10)) }, { ItemID.ChristmasTreeSword, Do(AutoReuse, UseTurn, UseMeleeSpeed, DamageExact(80), UseExact(30)) }, { ItemID.ClingerStaff, Do(DamageExact(63)) }, { ItemID.ClockworkAssaultRifle, Do(PointBlank, DamageExact(21)) }, - { ItemID.CobaltNaginata, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(90)) }, + { ItemID.CobaltNaginata, Do(AutoReuse, TrueMelee, DamageExact(55), UseExact(9), ShootSpeedExact(12f)) }, { ItemID.CobaltRepeater, Do(PointBlank, UseExact(18)) }, - { ItemID.CobaltSword, Do(UseTurn, DamageExact(80)) }, + { ItemID.CobaltSword, Do(UseTurn, DamageExact(60), UseExact(9)) }, { ItemID.Code2, Do(AutoReuse, DamageExact(43)) }, { ItemID.CorruptYoyo, Do(AutoReuse, DamageExact(20)) }, // Malaise { ItemID.CrimsonYoyo, Do(AutoReuse, DamageExact(20)) }, // Artery @@ -87,7 +88,7 @@ namespace CalamityMod.Items { ItemID.Cutlass, Do(UseRatio(0.9f), DamageExact(90)) }, { ItemID.DaedalusStormbow, Do(DamageExact(30)) }, { ItemID.DaoofPow, Do(DamageExact(85), ShootSpeedExact(10)) }, - { ItemID.DarkLance, Do(AutoReuse, TrueMelee, DamageExact(41)) }, + { ItemID.DarkLance, Do(AutoReuse, TrueMelee, DamageExact(40)) }, { ItemID.DartRifle, Do(PointBlank, DamageExact(58)) }, { ItemID.DayBreak, Do(DamageExact(125), UseExact(20)) }, { ItemID.DD2BetsyBow, Do(DamageExact(42)) }, // Aerial Bane's ridiculous multiplier is removed, so this compensates for that @@ -103,9 +104,9 @@ namespace CalamityMod.Items { ItemID.EmpressBlade, Do(AutoReuse, DamageExact(60), UseExact(20)) }, // Terraprisma { ItemID.EnchantedBoomerang, Do(DamageExact(24)) }, { ItemID.EnchantedSword, Do(UseMeleeSpeed, DamageExact(30), ShootSpeedExact(15f)) }, - { ItemID.Excalibur, Do(TrueMelee, UseRatio(0.8f), DamageExact(125), UseAnimationExact(45)) }, + { ItemID.Excalibur, Do(TrueMelee, DamageExact(220), UseExact(24)) }, { ItemID.FairyQueenMagicItem, Do(DamageExact(54)) }, // Nightglow - { ItemID.FalconBlade, Do(UseTurn, UseExact(15)) }, + { ItemID.FalconBlade, Do(UseTurn, UseExact(13)) }, { ItemID.FireworksLauncher, Do(DamageExact(50), UseExact(25)) }, // Celebration { ItemID.Flairon, Do(DamageExact(65)) }, { ItemID.Flamarang, Do(DamageExact(40)) }, @@ -117,14 +118,13 @@ namespace CalamityMod.Items { ItemID.Frostbrand, Do(UseMeleeSpeed, DamageExact(88)) }, { ItemID.FrostStaff, Do(DamageExact(160), UseExact(37), ShootSpeedExact(20f)) }, // has 1 extra update { ItemID.Gatligator, Do(PointBlank, UseExact(6)) }, - { ItemID.GoldenShower, Do(DamageExact(39)) }, { ItemID.GoldShortsword, Do(AutoReuse, TrueMelee, DamageExact(17)) }, { ItemID.GolemFist, Do(DamageExact(150)) }, { ItemID.Gradient, Do(AutoReuse, DamageExact(39)) }, - { ItemID.GreenPhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) }, - { ItemID.GreenPhasesaber, Do(DamageExact(60)) }, + { ItemID.GreenPhaseblade, Do(AutoReuse, UseTurn, DamageExact(48)) }, + { ItemID.GreenPhasesaber, Do(DamageExact(132)) }, { ItemID.GrenadeLauncher, Do(DamageExact(112)) }, - { ItemID.Gungnir, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(92), ShootSpeedRatio(1.25f)) }, + { ItemID.Gungnir, Do(AutoReuse, TrueMelee, DamageExact(144), ShootSpeedExact(7f)) }, { ItemID.HallowedRepeater, Do(PointBlank, UseExact(12)) }, { ItemID.Handgun, Do(PointBlank, UseExact(20)) }, { ItemID.HellwingBow, Do(PointBlank, DamageExact(16)) }, @@ -167,26 +167,26 @@ namespace CalamityMod.Items { ItemID.MonkStaffT3, Do(DamageExact(225)) }, // Sky Dragon's Fury { ItemID.MoonlordBullet, Do(DamageExact(19)) }, // Luminite Bullet { ItemID.MoonlordTurretStaff, Do(DamageExact(50), UseExact(15)) }, //Lunar Portal Staff - { ItemID.Muramasa, Do(CritDelta(+20)) }, + { ItemID.Muramasa, Do(CritDelta(+10)) }, { ItemID.MushroomSpear, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(100)) }, { ItemID.Musket, Do(PointBlank, DamageExact(22)) }, - { ItemID.MythrilHalberd, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(95), ShootSpeedRatio(1.25f)) }, + { ItemID.MythrilHalberd, Do(AutoReuse, TrueMelee, DamageExact(65), UseExact(8), ShootSpeedExact(15f)) }, { ItemID.MythrilRepeater, Do(PointBlank, UseExact(16)) }, - { ItemID.MythrilSword, Do(UseTurn, DamageExact(100)) }, + { ItemID.MythrilSword, Do(UseTurn, DamageExact(70), UseExact(8)) }, { ItemID.NettleBurst, Do(ManaExact(10), DamageExact(70)) }, { ItemID.NightsEdge, Do(TrueMelee, DamageExact(45)) }, { ItemID.NorthPole, Do(AutoReuse, UseMeleeSpeed) }, - { ItemID.OrangePhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) }, - { ItemID.OrangePhasesaber, Do(DamageExact(60)) }, - { ItemID.OrichalcumHalberd, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(98), ShootSpeedRatio(1.25f)) }, + { ItemID.OrangePhaseblade, Do(AutoReuse, UseTurn, DamageExact(48)) }, + { ItemID.OrangePhasesaber, Do(DamageExact(132)) }, + { ItemID.OrichalcumHalberd, Do(AutoReuse, TrueMelee, DamageExact(128), ShootSpeedExact(6f)) }, { ItemID.OrichalcumRepeater, Do(PointBlank, DamageExact(48)) }, - { ItemID.OrichalcumSword, Do(UseTurn, DamageExact(82)) }, + { ItemID.OrichalcumSword, Do(UseTurn, DamageExact(175)) }, { ItemID.PainterPaintballGun, Do(PointBlank, DamageExact(8)) }, { ItemID.PaladinsHammer, Do(DamageExact(100), ShootSpeedExact(23)) }, - { ItemID.PalladiumPike, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(96)) }, + { ItemID.PalladiumPike, Do(AutoReuse, TrueMelee, DamageExact(120), ShootSpeedExact(5.4f)) }, { ItemID.PalladiumRepeater, Do(PointBlank, DamageExact(45)) }, - { ItemID.PalladiumSword, Do(UseTurn, DamageExact(100)) }, - { ItemID.PearlwoodBow, Do(AutoReuse, PointBlank, DamageExact(20), UseDelta(+8), ShootSpeedDelta(+3.4f), KnockbackDelta(+1f)) }, + { ItemID.PalladiumSword, Do(UseTurn, DamageExact(150)) }, + { ItemID.PearlwoodBow, Do(AutoReuse, PointBlank, DamageExact(32)) }, { ItemID.PearlwoodSword, Do(UseTurn, DamageExact(45)) }, { ItemID.PewMaticHorn, Do(DamageExact(25), ShootSpeedExact(15)) }, { ItemID.Phantasm, Do(PointBlank, DamageExact(48)) }, @@ -196,20 +196,21 @@ namespace CalamityMod.Items { ItemID.PlatinumShortsword, Do(AutoReuse, TrueMelee, DamageExact(18)) }, { ItemID.PoisonStaff, Do(DamageExact(57)) }, { ItemID.PossessedHatchet, Do(DamageExact(135)) }, - { ItemID.PsychoKnife, Do(UseTurn, UseExact(11), DamageExact(255)) }, + { ItemID.PrincessWeapon, Do(DamageExact(90)) }, // Resonance Scepter + { ItemID.PsychoKnife, Do(UseTurn, UseExact(11), DamageExact(200)) }, { ItemID.PurpleClubberfish, Do(UseTurn, KnockbackExact(10f)) }, - { ItemID.PurplePhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) }, - { ItemID.PurplePhasesaber, Do(DamageExact(60)) }, + { ItemID.PurplePhaseblade, Do(AutoReuse, UseTurn, DamageExact(48)) }, + { ItemID.PurplePhasesaber, Do(DamageExact(132)) }, { ItemID.PygmyStaff, Do(AutoReuse, UseExact(20), DamageExact(70)) }, { ItemID.QuadBarrelShotgun, Do(PointBlank, DamageExact(11)) }, - { ItemID.RainbowRod, Do(DamageExact(35), ManaExact(15)) }, - { ItemID.Rally, Do(AutoReuse, DamageExact(18)) }, { ItemID.RainbowGun, Do(DamageExact(60), ManaExact(40)) }, + { ItemID.RainbowRod, Do(DamageExact(40), ManaExact(13)) }, + { ItemID.Rally, Do(AutoReuse, DamageExact(18)) }, { ItemID.RavenStaff, Do(AutoReuse, UseExact(20), DamageExact(36)) }, { ItemID.RazorbladeTyphoon, Do(DamageExact(103)) }, { ItemID.Razorpine, Do(DamageExact(40)) }, - { ItemID.RedPhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) }, - { ItemID.RedPhasesaber, Do(DamageExact(60)) }, + { ItemID.RedPhaseblade, Do(AutoReuse, UseTurn, DamageExact(48)) }, + { ItemID.RedPhasesaber, Do(DamageExact(132)) }, { ItemID.RedRyder, Do(PointBlank, DamageExact(24)) }, { ItemID.RedsYoyo, Do(AutoReuse, DamageExact(48)) }, // Red's Throw and Valkyrie Yoyo have the same stats { ItemID.RocketLauncher, Do(DamageExact(70)) }, @@ -239,13 +240,14 @@ namespace CalamityMod.Items { ItemID.StarCannon, Do(DamageExact(25)) }, { ItemID.StardustDragonStaff, Do(AutoReuse, DamageExact(20), UseExact(19)) }, { ItemID.StormTigerStaff, Do(AutoReuse, DamageExact(49), UseExact(20)) }, // Desert Tiger Staff - { ItemID.StylistKilLaKillScissorsIWish, Do(AutoReuse, UseTurn, DamageExact(18)) }, // Stylish Scissors + { ItemID.StylistKilLaKillScissorsIWish, Do(AutoReuse, UseTurn, DamageExact(21)) }, // Stylish Scissors { ItemID.Stynger, Do(DamageExact(75)) }, { ItemID.Swordfish, Do(AutoReuse, TrueMelee, DamageExact(24)) }, { ItemID.TacticalShotgun, Do(PointBlank, DamageExact(41)) }, { ItemID.TaxCollectorsStickOfDoom, Do(AutoReuse, UseTurn, UseRatio(0.8f), DamageExact(70)) }, // Classy Cane { ItemID.TendonBow, Do(PointBlank, DamageExact(17), AutoReuse) }, - { ItemID.TerraBlade, Do(DamageExact(122)) }, + { ItemID.TerraBlade, Do(DamageExact(92)) }, + { ItemID.Terragrim, Do(TrueMeleeNoSpeed, DamageExact(13)) }, // Vanilla damage 190. After fixing iframes so yoyo and shots can hit simultaneously, // Terrarian is extremely overpowered and requires a heavy nerf. { ItemID.Terrarian, Do(AutoReuse, DamageExact(90)) }, @@ -255,13 +257,13 @@ namespace CalamityMod.Items { ItemID.ThunderSpear, Do(AutoReuse, UseMeleeSpeed) }, // Storm Spear { ItemID.ThunderStaff, Do(DamageExact(18)) }, //Thunder Zapper { ItemID.TitaniumRepeater, Do(PointBlank, DamageExact(52)) }, - { ItemID.TitaniumSword, Do(UseTurn, DamageExact(77)) }, - { ItemID.TitaniumTrident, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(72), ShootSpeedRatio(1.25f)) }, + { ItemID.TitaniumSword, Do(UseTurn, DamageExact(192)) }, + { ItemID.TitaniumTrident, Do(AutoReuse, TrueMelee, DamageExact(144), ShootSpeedExact(6.5f)) }, { ItemID.TopazStaff, Do(ManaExact(2)) }, { ItemID.Toxikarp, Do(UseExact(9)) }, { ItemID.Trident, Do(AutoReuse, TrueMelee, DamageExact(20)) }, { ItemID.Trimarang, Do(DamageExact(24)) }, - { ItemID.TrueExcalibur, Do(TrueMelee, DamageExact(107)) }, + { ItemID.TrueExcalibur, Do(TrueMelee, DamageExact(112)) }, { ItemID.TrueNightsEdge, Do(DamageExact(105)) }, { ItemID.Tsunami, Do(PointBlank, DamageExact(45)) }, { ItemID.TungstenBullet, Do(DamageExact(8)) }, @@ -274,12 +276,12 @@ namespace CalamityMod.Items { ItemID.VenusMagnum, Do(PointBlank, DamageExact(65)) }, { ItemID.WaspGun, Do(UseExact(11), DamageExact(58)) }, { ItemID.WaterBolt, Do(DamageExact(23)) }, - { ItemID.WhitePhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) }, - { ItemID.WhitePhasesaber, Do(DamageExact(60)) }, + { ItemID.WhitePhaseblade, Do(AutoReuse, UseTurn, DamageExact(48)) }, + { ItemID.WhitePhasesaber, Do(DamageExact(132)) }, { ItemID.WoodenBoomerang, Do(DamageExact(16), Value(Item.sellPrice(copper: 20))) }, { ItemID.Yelets, Do(AutoReuse, DamageExact(53)) }, - { ItemID.YellowPhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) }, - { ItemID.YellowPhasesaber, Do(DamageExact(60)) }, + { ItemID.YellowPhaseblade, Do(AutoReuse, UseTurn, DamageExact(48)) }, + { ItemID.YellowPhasesaber, Do(DamageExact(132)) }, { ItemID.Zenith, Do(DamageExact(210)) }, { ItemID.ZombieArm, Do(AutoReuse, UseTurn, KnockbackExact(12f)) }, #endregion @@ -323,7 +325,7 @@ namespace CalamityMod.Items { ItemID.BloodLustCluster, Do(AxePower(100), UseTimeExact(13), TileBoostExact(+0)) }, { ItemID.BonePickaxe, Do(PickPower(55), UseTimeExact(6)) }, { ItemID.BorealWoodHammer, Do(HammerPower(25), UseTimeExact(11), TileBoostExact(+0)) }, - { ItemID.ButchersChainsaw, Do(TrueMeleeNoSpeed, AxePower(150), UseTimeExact(3), TileBoostExact(+0), DamageExact(126)) }, + { ItemID.ButchersChainsaw, Do(TrueMeleeNoSpeed, AxePower(150), UseTimeExact(3), TileBoostExact(+0)) }, { ItemID.CactusPickaxe, Do(PickPower(34), UseTimeExact(9)) }, { ItemID.CnadyCanePickaxe, Do(PickPower(55), UseTimeExact(9), TileBoostExact(+1)) }, // Candy Cane Pickaxe { ItemID.ChlorophyteChainsaw, Do(TrueMeleeNoSpeed, AxePower(120), UseTimeExact(3), TileBoostExact(+0), DamageExact(112)) }, @@ -431,7 +433,6 @@ namespace CalamityMod.Items { ItemID.ShadowJoustingLance, trueMelee }, { ItemID.SolarFlareChainsaw, trueMeleeNoSpeed }, { ItemID.StardustChainsaw, trueMeleeNoSpeed }, - { ItemID.Terragrim, trueMeleeNoSpeed }, { ItemID.TheHorsemansBlade, trueMelee }, { ItemID.TinShortsword, Do(AutoReuse, TrueMelee) }, { ItemID.VortexChainsaw, trueMeleeNoSpeed }, @@ -516,7 +517,6 @@ namespace CalamityMod.Items { ItemID.BatBat, autoReuse }, { ItemID.BladeofGrass, Do(AutoReuse, UseTurn) }, { ItemID.BloodButcherer, Do(AutoReuse, UseTurn) }, - { ItemID.BoneSword, Do(AutoReuse, UseTurn) }, { ItemID.BorealWoodSword, Do(AutoReuse, UseTurn) }, { ItemID.CactusSword, Do(AutoReuse, UseTurn) }, { ItemID.CandyCaneSword, Do(AutoReuse, UseTurn) }, diff --git a/Items/Critters/BabyCannonballJellyfishItem.png b/Items/Critters/BabyCannonballJellyfishItem.png index 7fc4c1bfe6..49a2bf6f0f 100644 Binary files a/Items/Critters/BabyCannonballJellyfishItem.png and b/Items/Critters/BabyCannonballJellyfishItem.png differ diff --git a/Items/DraedonMisc/AuricQuantumCoolingCell.cs b/Items/DraedonMisc/AuricQuantumCoolingCell.cs index b752b5aa9e..46443d18f2 100644 --- a/Items/DraedonMisc/AuricQuantumCoolingCell.cs +++ b/Items/DraedonMisc/AuricQuantumCoolingCell.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Items.DraedonMisc AddIngredient(8). AddIngredient(8). AddIngredient(40). - AddIngredient(6). + AddIngredient(6). AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(5, out Func condition), condition). AddTile(). Register(); diff --git a/Items/DraedonMisc/CodebreakerBase.cs b/Items/DraedonMisc/CodebreakerBase.cs index ed098bacda..a77fecfcd3 100644 --- a/Items/DraedonMisc/CodebreakerBase.cs +++ b/Items/DraedonMisc/CodebreakerBase.cs @@ -11,17 +11,8 @@ namespace CalamityMod.Items.DraedonMisc public new string LocalizationCategory => "Items.DraedonItems"; public override void SetDefaults() { - Item.width = 42; - Item.height = 32; - Item.useStyle = ItemUseStyleID.Swing; - Item.useTurn = true; - Item.useAnimation = 15; - Item.useTime = 10; - Item.autoReuse = true; - Item.consumable = true; - Item.maxStack = 9999; + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.rare = ItemRarityID.Green; - Item.createTile = ModContent.TileType(); } public override void AddRecipes() diff --git a/Items/DraedonMisc/DraedonPowerCell.cs b/Items/DraedonMisc/DraedonPowerCell.cs index c5719725d6..28f2c4be49 100644 --- a/Items/DraedonMisc/DraedonPowerCell.cs +++ b/Items/DraedonMisc/DraedonPowerCell.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.DraedonMisc public override void SetStaticDefaults() { Item.ResearchUnlockCount = 100; - ItemID.Sets.ExtractinatorMode[Item.type] = Item.type; + ItemID.Sets.ExtractinatorMode[Type] = Item.type; } public override void SetDefaults() diff --git a/Items/Dyes/AstralDye.cs b/Items/Dyes/AstralDye.cs index 0e31897615..05e9285039 100644 --- a/Items/Dyes/AstralDye.cs +++ b/Items/Dyes/AstralDye.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Astral; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; diff --git a/Items/Dyes/BrimflameDye.cs b/Items/Dyes/BrimflameDye.cs index df3e35a9ea..72e2f22529 100644 --- a/Items/Dyes/BrimflameDye.cs +++ b/Items/Dyes/BrimflameDye.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Crags; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; diff --git a/Items/Fishing/AstralCatches/AldebaranAlewife.cs b/Items/Fishing/AstralCatches/AldebaranAlewife.cs index 0f553d2c59..e32e189534 100644 --- a/Items/Fishing/AstralCatches/AldebaranAlewife.cs +++ b/Items/Fishing/AstralCatches/AldebaranAlewife.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Fishing.AstralCatches public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/Fishing/AstralCatches/ArcturusAstroidean.cs b/Items/Fishing/AstralCatches/ArcturusAstroidean.cs index 6149190827..279de4b93b 100644 --- a/Items/Fishing/AstralCatches/ArcturusAstroidean.cs +++ b/Items/Fishing/AstralCatches/ArcturusAstroidean.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Fishing.AstralCatches public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/Fishing/AstralCatches/ProcyonidPrawn.cs b/Items/Fishing/AstralCatches/ProcyonidPrawn.cs index a7e56c4dee..87c5acdf88 100644 --- a/Items/Fishing/AstralCatches/ProcyonidPrawn.cs +++ b/Items/Fishing/AstralCatches/ProcyonidPrawn.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Fishing.AstralCatches public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/Fishing/AstralCatches/TwinklingPollox.cs b/Items/Fishing/AstralCatches/TwinklingPollox.cs index 5f77a94a91..cc2d147ad8 100644 --- a/Items/Fishing/AstralCatches/TwinklingPollox.cs +++ b/Items/Fishing/AstralCatches/TwinklingPollox.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Fishing.AstralCatches public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/Fishing/BaseQuestFish.cs b/Items/Fishing/BaseQuestFish.cs index 7e92e4d06e..c2131da27a 100644 --- a/Items/Fishing/BaseQuestFish.cs +++ b/Items/Fishing/BaseQuestFish.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Fishing public override void SetStaticDefaults() { Item.ResearchUnlockCount = 2; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs index b57a6a2576..fd4d653f7e 100644 --- a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs +++ b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs @@ -2,6 +2,7 @@ using CalamityMod.Rarities; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Fishing.BrimstoneCragCatches @@ -10,34 +11,27 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches { public new string LocalizationCategory => "Items.Fishing"; public static int BuffType = ModContent.BuffType(); - public static int BuffDuration = 600; + public static int BuffDuration = 10; + + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(BuffDuration); public override void SetStaticDefaults() { Item.ResearchUnlockCount = 30; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() { - Item.width = 44; - Item.height = 36; - Item.maxStack = 9999; - Item.useTurn = true; + Item.DefaultToHealingPotion(38, 36, 240); + Item.useStyle = ItemUseStyleID.EatFood; Item.value = Item.sellPrice(gold: 5); Item.rare = ModContent.RarityType(); - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.EatFood; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.healLife = 240; - Item.potion = true; } public override void OnConsumeItem(Player player) { - player.AddBuff(BuffType, BuffDuration); + player.AddBuff(BuffType, CalamityUtils.SecondsToFrames(BuffDuration)); } } } diff --git a/Items/Fishing/BrimstoneCragCatches/CharredLasher.cs b/Items/Fishing/BrimstoneCragCatches/CharredLasher.cs index db8bc64626..def96111da 100644 --- a/Items/Fishing/BrimstoneCragCatches/CharredLasher.cs +++ b/Items/Fishing/BrimstoneCragCatches/CharredLasher.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/Fishing/BrimstoneCragCatches/CoastalDemonfish.cs b/Items/Fishing/BrimstoneCragCatches/CoastalDemonfish.cs index c4ab9435d4..dbebb21373 100644 --- a/Items/Fishing/BrimstoneCragCatches/CoastalDemonfish.cs +++ b/Items/Fishing/BrimstoneCragCatches/CoastalDemonfish.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/Fishing/BrimstoneCragCatches/CragBullhead.cs b/Items/Fishing/BrimstoneCragCatches/CragBullhead.cs index e28a2df93f..d0048e03a7 100644 --- a/Items/Fishing/BrimstoneCragCatches/CragBullhead.cs +++ b/Items/Fishing/BrimstoneCragCatches/CragBullhead.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/Fishing/BrimstoneCragCatches/DragoonDrizzlefish.cs b/Items/Fishing/BrimstoneCragCatches/DragoonDrizzlefish.cs index 892b507f4e..6d0c5df78e 100644 --- a/Items/Fishing/BrimstoneCragCatches/DragoonDrizzlefish.cs +++ b/Items/Fishing/BrimstoneCragCatches/DragoonDrizzlefish.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches public int shotCounter = 0; public override void SetStaticDefaults() { - ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; - Item.staff[Item.type] = true; //so it doesn't look weird af when holding it + ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; + Item.staff[Type] = true; //so it doesn't look weird af when holding it } public override void SetDefaults() diff --git a/Items/Fishing/BrimstoneCragCatches/Havocfish.cs b/Items/Fishing/BrimstoneCragCatches/Havocfish.cs index 59f5b99abf..acf1c58c47 100644 --- a/Items/Fishing/BrimstoneCragCatches/Havocfish.cs +++ b/Items/Fishing/BrimstoneCragCatches/Havocfish.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches public override void SetStaticDefaults() { Item.ResearchUnlockCount = 10; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/Fishing/BrimstoneCragCatches/Shadowfish.cs b/Items/Fishing/BrimstoneCragCatches/Shadowfish.cs index c43d4f93f9..687740ed97 100644 --- a/Items/Fishing/BrimstoneCragCatches/Shadowfish.cs +++ b/Items/Fishing/BrimstoneCragCatches/Shadowfish.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/Fishing/EnchantedStarfish.cs b/Items/Fishing/EnchantedStarfish.cs index cc10c2a309..ceb2c70c0d 100644 --- a/Items/Fishing/EnchantedStarfish.cs +++ b/Items/Fishing/EnchantedStarfish.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Fishing public override void SetStaticDefaults() { Item.ResearchUnlockCount = 10; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; // For some reason Life/Mana boosting items are in this set (along with Magic Mirror+) ItemID.Sets.SortingPriorityBossSpawns[Type] = 21; // Mana Crystal ItemID.Sets.ShimmerTransformToItem[Type] = ItemID.ArcaneCrystal; diff --git a/Items/Fishing/FishingRods/NavyFishingRod.cs b/Items/Fishing/FishingRods/NavyFishingRod.cs index 6b6eb6d7f4..686b065a72 100644 --- a/Items/Fishing/FishingRods/NavyFishingRod.cs +++ b/Items/Fishing/FishingRods/NavyFishingRod.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Fishing/FishingRods/RiftReeler.cs b/Items/Fishing/FishingRods/RiftReeler.cs index 6bbe1e7441..4de6da68e1 100644 --- a/Items/Fishing/FishingRods/RiftReeler.cs +++ b/Items/Fishing/FishingRods/RiftReeler.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Fishing.FishingRods public new string LocalizationCategory => "Items.Fishing"; public override void SetStaticDefaults() { - ItemID.Sets.CanFishInLava[Item.type] = true; + ItemID.Sets.CanFishInLava[Type] = true; } public override void SetDefaults() diff --git a/Items/Fishing/FishingRods/SlurperPole.cs b/Items/Fishing/FishingRods/SlurperPole.cs index b8462e6e00..cac04d7307 100644 --- a/Items/Fishing/FishingRods/SlurperPole.cs +++ b/Items/Fishing/FishingRods/SlurperPole.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Fishing.FishingRods public new string LocalizationCategory => "Items.Fishing"; public override void SetStaticDefaults() { - ItemID.Sets.CanFishInLava[Item.type] = true; + ItemID.Sets.CanFishInLava[Type] = true; } public override void SetDefaults() diff --git a/Items/Fishing/FishingRods/TheDevourerofCods.cs b/Items/Fishing/FishingRods/TheDevourerofCods.cs index 6a4f028556..62d2e6cc12 100644 --- a/Items/Fishing/FishingRods/TheDevourerofCods.cs +++ b/Items/Fishing/FishingRods/TheDevourerofCods.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Fishing.FishingRods public new string LocalizationCategory => "Items.Fishing"; public override void SetStaticDefaults() { - ItemID.Sets.CanFishInLava[Item.type] = true; + ItemID.Sets.CanFishInLava[Type] = true; } public override void SetDefaults() diff --git a/Items/Fishing/FishofEleum.cs b/Items/Fishing/FishofEleum.cs index 47d60bf462..0bb26b1e47 100644 --- a/Items/Fishing/FishofEleum.cs +++ b/Items/Fishing/FishofEleum.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Fishing public override void SetStaticDefaults() { Item.ResearchUnlockCount = 10; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/Fishing/FishofFlight.cs b/Items/Fishing/FishofFlight.cs index 81edecaab0..ef3bb3740d 100644 --- a/Items/Fishing/FishofFlight.cs +++ b/Items/Fishing/FishofFlight.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Fishing public override void SetStaticDefaults() { Item.ResearchUnlockCount = 10; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/Fishing/FishofLight.cs b/Items/Fishing/FishofLight.cs index 010e7fb185..f5067ca293 100644 --- a/Items/Fishing/FishofLight.cs +++ b/Items/Fishing/FishofLight.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Fishing public override void SetStaticDefaults() { Item.ResearchUnlockCount = 10; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/Fishing/FishofNight.cs b/Items/Fishing/FishofNight.cs index ed055e4f83..0a5c27b862 100644 --- a/Items/Fishing/FishofNight.cs +++ b/Items/Fishing/FishofNight.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Fishing public override void SetStaticDefaults() { Item.ResearchUnlockCount = 10; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/Fishing/GlimmeringGemfish.cs b/Items/Fishing/GlimmeringGemfish.cs index 9f0e775bf1..a44cd336b1 100644 --- a/Items/Fishing/GlimmeringGemfish.cs +++ b/Items/Fishing/GlimmeringGemfish.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Fishing public override void SetStaticDefaults() { Item.ResearchUnlockCount = 10; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/Fishing/Gorecodile.cs b/Items/Fishing/Gorecodile.cs index dec49381cc..814fe4c4c2 100644 --- a/Items/Fishing/Gorecodile.cs +++ b/Items/Fishing/Gorecodile.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Fishing public override void SetStaticDefaults() { Item.ResearchUnlockCount = 10; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/Fishing/StuffedFish.cs b/Items/Fishing/StuffedFish.cs index de2ab4cb5e..6ad7ea8f50 100644 --- a/Items/Fishing/StuffedFish.cs +++ b/Items/Fishing/StuffedFish.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Fishing public override void SetStaticDefaults() { Item.ResearchUnlockCount = 10; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/Fishing/SulphurCatches/HydrothermalCrate.cs b/Items/Fishing/SulphurCatches/HydrothermalCrate.cs index 52dad8a28b..fca10d69a5 100644 --- a/Items/Fishing/SulphurCatches/HydrothermalCrate.cs +++ b/Items/Fishing/SulphurCatches/HydrothermalCrate.cs @@ -1,7 +1,7 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Items.Pets; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Items.Placeables.Ores; using CalamityMod.Items.Potions; using CalamityMod.Items.Tools.ClimateChange; @@ -62,16 +62,16 @@ namespace CalamityMod.Items.Fishing.SulphurCatches var tier3AcidRain = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedPolterghast && DownedBossSystem.downedBoomerDuke); // Materials - itemLoot.Add(ModContent.ItemType(), 1, 5, 10); - itemLoot.Add(ModContent.ItemType(), 1, 5, 10); - itemLoot.Add(ModContent.ItemType(), 1, 5, 10); + itemLoot.Add(ModContent.ItemType(), 1, 5, 10); + itemLoot.Add(ModContent.ItemType(), 1, 5, 10); + itemLoot.Add(ModContent.ItemType(), 1, 5, 10); itemLoot.Add(ModContent.ItemType(), 1, 5, 10); tier1AcidRain.Add(ModContent.ItemType(), 10, 1, 3); tier2AcidRain.Add(ModContent.ItemType(), 10, 1, 3); tier2AbyssAvailable.Add(ModContent.ItemType(), 5, 2, 5); tier2AbyssAvailable.Add(ModContent.ItemType(), 5, 2, 5); - tier2AbyssAvailable.Add(ModContent.ItemType(), 5, 2, 5); + tier2AbyssAvailable.Add(ModContent.ItemType(), 5, 2, 5); scoriaAvailable.Add(ModContent.ItemType(), 5, 16, 28); scoriaAvailable.Add(ModContent.ItemType(), new Fraction(15, 100), 4, 7); tier3AcidRain.Add(ModContent.ItemType(), 10, 1, 5); diff --git a/Items/Fishing/SulphurCatches/SulphurousCrate.cs b/Items/Fishing/SulphurCatches/SulphurousCrate.cs index 98d8b825e3..4b7f174bf8 100644 --- a/Items/Fishing/SulphurCatches/SulphurousCrate.cs +++ b/Items/Fishing/SulphurCatches/SulphurousCrate.cs @@ -1,7 +1,7 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Items.Pets; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Items.Potions; using CalamityMod.Items.Tools.ClimateChange; using CalamityMod.Items.Weapons.Magic; diff --git a/Items/Fishing/SunbeamFish.cs b/Items/Fishing/SunbeamFish.cs index dff792e6eb..ae1a6abc8a 100644 --- a/Items/Fishing/SunbeamFish.cs +++ b/Items/Fishing/SunbeamFish.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Fishing public override void SetStaticDefaults() { Item.ResearchUnlockCount = 10; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/Fishing/SunkenSeaCatches/EutrophicCrate.cs b/Items/Fishing/SunkenSeaCatches/EutrophicCrate.cs index 7242d6591c..6a5f8b7677 100644 --- a/Items/Fishing/SunkenSeaCatches/EutrophicCrate.cs +++ b/Items/Fishing/SunkenSeaCatches/EutrophicCrate.cs @@ -1,6 +1,6 @@ using CalamityMod.Items.Critters; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; diff --git a/Items/Fishing/SunkenSeaCatches/GreenwaveLoach.cs b/Items/Fishing/SunkenSeaCatches/GreenwaveLoach.cs index e245ff9a2d..9df013dc4f 100644 --- a/Items/Fishing/SunkenSeaCatches/GreenwaveLoach.cs +++ b/Items/Fishing/SunkenSeaCatches/GreenwaveLoach.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/Fishing/SunkenSeaCatches/PrismCrate.cs b/Items/Fishing/SunkenSeaCatches/PrismCrate.cs index 1c5eeedd9f..b5e9eb4101 100644 --- a/Items/Fishing/SunkenSeaCatches/PrismCrate.cs +++ b/Items/Fishing/SunkenSeaCatches/PrismCrate.cs @@ -1,7 +1,7 @@ using CalamityMod.Items.Critters; using CalamityMod.Items.Fishing.BrimstoneCragCatches; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; diff --git a/Items/Fishing/SunkenSeaCatches/PrismaticGuppy.cs b/Items/Fishing/SunkenSeaCatches/PrismaticGuppy.cs index 66ca1687ad..e1eb2ca685 100644 --- a/Items/Fishing/SunkenSeaCatches/PrismaticGuppy.cs +++ b/Items/Fishing/SunkenSeaCatches/PrismaticGuppy.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/Fishing/SunkenSeaCatches/SerpentsBite.cs b/Items/Fishing/SunkenSeaCatches/SerpentsBite.cs index 51ce7fc457..1b25431204 100644 --- a/Items/Fishing/SunkenSeaCatches/SerpentsBite.cs +++ b/Items/Fishing/SunkenSeaCatches/SerpentsBite.cs @@ -1,5 +1,6 @@ using CalamityMod.Projectiles.Typeless; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; @@ -8,13 +9,20 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches public class SerpentsBite : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Fishing"; + + public static float Reach = 28.125f; + public static float LaunchSpeed = 18f; + public static float ReelbackSpeed = 14f; + public static float PullSpeed = 12f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(Reach.ToString(), LaunchSpeed.ToString(), ReelbackSpeed.ToString(), PullSpeed.ToString()); + public override void SetDefaults() { // Instead of copying these values, we can clone and modify the ones we want to copy Item.CloneDefaults(ItemID.AmethystHook); Item.width = 30; Item.height = 32; - Item.shootSpeed = SerpentsBiteHook.LaunchSpeed; // how quickly the hook is shot. + Item.shootSpeed = LaunchSpeed; // how quickly the hook is shot. Item.shoot = ProjectileType(); Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.rare = ItemRarityID.LightRed; diff --git a/Items/Fishing/SunkenSeaCatches/SparklingEmpress.cs b/Items/Fishing/SunkenSeaCatches/SparklingEmpress.cs index 488478e39d..a9813f17f9 100644 --- a/Items/Fishing/SunkenSeaCatches/SparklingEmpress.cs +++ b/Items/Fishing/SunkenSeaCatches/SparklingEmpress.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches public override void SetStaticDefaults() { - Item.staff[Item.type] = true; //so it doesn't look weird af when holding it + Item.staff[Type] = true; //so it doesn't look weird af when holding it } public override void SetDefaults() diff --git a/Items/Fishing/SunkenSeaCatches/SunkenSailfish.cs b/Items/Fishing/SunkenSeaCatches/SunkenSailfish.cs index d75614f699..ad12d445a2 100644 --- a/Items/Fishing/SunkenSeaCatches/SunkenSailfish.cs +++ b/Items/Fishing/SunkenSeaCatches/SunkenSailfish.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/LoreItem.cs b/Items/LoreItems/LoreItem.cs index 193dde3a8f..2860d62fd6 100644 --- a/Items/LoreItems/LoreItem.cs +++ b/Items/LoreItems/LoreItem.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.LoreItems public override void SetStaticDefaults() { - ItemID.Sets.ItemNoGravity[Item.type] = true; + ItemID.Sets.ItemNoGravity[Type] = true; } public override bool CanUseItem(Player player) => false; diff --git a/Items/Materials/AerialiteBar.cs b/Items/Materials/AerialiteBar.cs index b434352eae..cb0828ae7b 100644 --- a/Items/Materials/AerialiteBar.cs +++ b/Items/Materials/AerialiteBar.cs @@ -17,18 +17,9 @@ namespace CalamityMod.Items.Materials public override void SetDefaults() { - Item.width = 30; - Item.height = 24; - Item.createTile = ModContent.TileType(); - Item.maxStack = 9999; + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(silver: 30); Item.rare = ItemRarityID.Orange; - Item.useStyle = ItemUseStyleID.Swing; - Item.useTurn = true; - Item.useAnimation = 15; - Item.useTime = 10; - Item.autoReuse = true; - Item.consumable = true; } public override void AddRecipes() { diff --git a/Items/Materials/AscendantSpiritEssence.cs b/Items/Materials/AscendantSpiritEssence.cs index 9a506c83ba..3185874d6f 100644 --- a/Items/Materials/AscendantSpiritEssence.cs +++ b/Items/Materials/AscendantSpiritEssence.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Materials Item.ResearchUnlockCount = 25; Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6)); ItemID.Sets.AnimatesAsSoul[Type] = true; - ItemID.Sets.ItemNoGravity[Item.type] = true; + ItemID.Sets.ItemNoGravity[Type] = true; ItemID.Sets.SortingPriorityMaterials[Type] = 118; } @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Materials } public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) { - Texture2D texture = TextureAssets.Item[Item.type].Value; + Texture2D texture = TextureAssets.Item[Type].Value; spriteBatch.Draw(texture, Item.position - Main.screenPosition, Item.GetCurrentFrame(ref frame, ref frameCounter, 6, 6), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); return false; } diff --git a/Items/Materials/AshesofAnnihilation.cs b/Items/Materials/AshesofAnnihilation.cs index 8f3b474deb..36da76f8d1 100644 --- a/Items/Materials/AshesofAnnihilation.cs +++ b/Items/Materials/AshesofAnnihilation.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Materials for (int i = 0; i < 4; i++) { Vector2 drawPosition = baseDrawPosition + (MathHelper.TwoPi * i / 4f).ToRotationVector2() * outwardness - drawPositionOffset; - spriteBatch.Draw(TextureAssets.Item[Item.type].Value, drawPosition, frame, drawColor, velocity, origin, scale, SpriteEffects.None, 0f); + spriteBatch.Draw(TextureAssets.Item[Type].Value, drawPosition, frame, drawColor, velocity, origin, scale, SpriteEffects.None, 0f); } } @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Materials public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) { - Rectangle frame = Main.itemAnimations[Item.type].GetFrame(TextureAssets.Item[Item.type].Value); + Rectangle frame = Main.itemAnimations[Type].GetFrame(TextureAssets.Item[Type].Value); DrawPulsingAfterimage(spriteBatch, Item.position - Main.screenPosition + frame.Size() * 0.5f, frame, scale); return true; } diff --git a/Items/Materials/AuricBar.cs b/Items/Materials/AuricBar.cs index 1d477d4bf0..923f6f09d6 100644 --- a/Items/Materials/AuricBar.cs +++ b/Items/Materials/AuricBar.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Materials Item.ResearchUnlockCount = 25; ItemID.Sets.SortingPriorityMaterials[Type] = 120; ItemID.Sets.AnimatesAsSoul[Type] = true; - ItemID.Sets.ItemNoGravity[Item.type] = true; + ItemID.Sets.ItemNoGravity[Type] = true; Main.RegisterItemAnimation(Type, new DrawAnimationVertical(5, 12)); } diff --git a/Items/Materials/CoreofCalamity.cs b/Items/Materials/CoreofCalamity.cs index 9b57720bf2..a326568454 100644 --- a/Items/Materials/CoreofCalamity.cs +++ b/Items/Materials/CoreofCalamity.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Materials public override void SetStaticDefaults() { Item.ResearchUnlockCount = 25; - ItemID.Sets.ItemNoGravity[Item.type] = true; + ItemID.Sets.ItemNoGravity[Type] = true; ItemID.Sets.SortingPriorityMaterials[Type] = 94; // Spectre Bar } @@ -33,10 +33,11 @@ namespace CalamityMod.Items.Materials public override void AddRecipes() { CreateRecipe(). - AddIngredient(3). - AddIngredient(3). - AddIngredient(3). + AddIngredient(). + AddIngredient(). + AddIngredient(). AddIngredient(). + AddIngredient(ItemID.Ectoplasm, 3). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Materials/CoreofEleum.cs b/Items/Materials/CoreofEleum.cs deleted file mode 100644 index 59bc3a57e6..0000000000 --- a/Items/Materials/CoreofEleum.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Materials -{ - public class CoreofEleum : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Materials"; - public override void SetStaticDefaults() - { - Item.ResearchUnlockCount = 25; - ItemID.Sets.ItemNoGravity[Item.type] = true; - - ItemID.Sets.SortingPriorityMaterials[Type] = 94; // Spectre Bar - } - - public override void SetDefaults() - { - Item.width = 34; - Item.height = 34; - Item.maxStack = 9999; - Item.value = Item.sellPrice(silver: 20); - Item.rare = ItemRarityID.Yellow; - } - public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) - { - Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Materials/CoreofEleumGlow").Value); - } - - public override void Update(ref float gravity, ref float maxFallSpeed) - { - float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f); - Lighting.AddLight(Item.Center, 0.15f * brightness, 0.05f * brightness, 0.5f * brightness); - } - - public override void AddRecipes() - { - CreateRecipe(3). - AddIngredient(). - AddIngredient(ItemID.Ectoplasm). - AddTile(TileID.MythrilAnvil). - Register(); - } - } -} diff --git a/Items/Materials/CoreofEleum.png b/Items/Materials/CoreofEleum.png deleted file mode 100644 index 06c4d1e419..0000000000 Binary files a/Items/Materials/CoreofEleum.png and /dev/null differ diff --git a/Items/Materials/CoreofEleumGlow.png b/Items/Materials/CoreofEleumGlow.png deleted file mode 100644 index 16db58cbfc..0000000000 Binary files a/Items/Materials/CoreofEleumGlow.png and /dev/null differ diff --git a/Items/Materials/CoreofHavoc.cs b/Items/Materials/CoreofHavoc.cs deleted file mode 100644 index 97b5764550..0000000000 --- a/Items/Materials/CoreofHavoc.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Materials -{ - [LegacyName("CoreofChaos")] - public class CoreofHavoc : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Materials"; - public override void SetStaticDefaults() - { - Item.ResearchUnlockCount = 25; - ItemID.Sets.ItemNoGravity[Item.type] = true; - - ItemID.Sets.SortingPriorityMaterials[Type] = 94; // Spectre Bar - } - - public override void SetDefaults() - { - Item.width = 36; - Item.height = 36; - Item.maxStack = 9999; - Item.value = Item.sellPrice(silver: 20); - Item.rare = ItemRarityID.Yellow; - } - public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) - { - Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Materials/CoreofHavocGlow").Value); - } - - public override void Update(ref float gravity, ref float maxFallSpeed) - { - float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f); - Lighting.AddLight(Item.Center, 0.5f * brightness, 0.3f * brightness, 0.05f * brightness); - } - - public override void AddRecipes() - { - CreateRecipe(3). - AddIngredient(). - AddIngredient(ItemID.Ectoplasm). - AddTile(TileID.MythrilAnvil). - Register(); - } - } -} diff --git a/Items/Materials/CoreofHavoc.png b/Items/Materials/CoreofHavoc.png deleted file mode 100644 index 2ff460a354..0000000000 Binary files a/Items/Materials/CoreofHavoc.png and /dev/null differ diff --git a/Items/Materials/CoreofHavocGlow.png b/Items/Materials/CoreofHavocGlow.png deleted file mode 100644 index 14cfc6e016..0000000000 Binary files a/Items/Materials/CoreofHavocGlow.png and /dev/null differ diff --git a/Items/Materials/CoreofSunlight.cs b/Items/Materials/CoreofSunlight.cs deleted file mode 100644 index 92e54600ed..0000000000 --- a/Items/Materials/CoreofSunlight.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Materials -{ - [LegacyName("CoreofCinder")] - public class CoreofSunlight : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Materials"; - public override void SetStaticDefaults() - { - Item.ResearchUnlockCount = 25; - ItemID.Sets.ItemNoGravity[Item.type] = true; - - ItemID.Sets.SortingPriorityMaterials[Type] = 94; // Spectre Bar - } - - public override void SetDefaults() - { - Item.width = 34; - Item.height = 34; - Item.maxStack = 9999; - Item.value = Item.sellPrice(silver: 20); - Item.rare = ItemRarityID.Yellow; - } - public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) - { - Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Materials/CoreofSunlightGlow").Value); - } - - public override void Update(ref float gravity, ref float maxFallSpeed) - { - float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f); - Lighting.AddLight(Item.Center, 0.3f * brightness, 0.3f * brightness, 0.05f * brightness); - } - - public override void AddRecipes() - { - CreateRecipe(3). - AddIngredient(). - AddIngredient(ItemID.Ectoplasm). - AddTile(TileID.MythrilAnvil). - Register(); - } - } -} diff --git a/Items/Materials/CoreofSunlight.png b/Items/Materials/CoreofSunlight.png deleted file mode 100644 index ed7542ef9c..0000000000 Binary files a/Items/Materials/CoreofSunlight.png and /dev/null differ diff --git a/Items/Materials/CoreofSunlightGlow.png b/Items/Materials/CoreofSunlightGlow.png deleted file mode 100644 index ae82d6ac92..0000000000 Binary files a/Items/Materials/CoreofSunlightGlow.png and /dev/null differ diff --git a/Items/Materials/DarkPlasma.cs b/Items/Materials/DarkPlasma.cs index 9cc97cb983..9063ad8cb1 100644 --- a/Items/Materials/DarkPlasma.cs +++ b/Items/Materials/DarkPlasma.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Materials Item.ResearchUnlockCount = 5; Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(7, 4)); ItemID.Sets.AnimatesAsSoul[Type] = true; - ItemID.Sets.ItemNoGravity[Item.type] = true; + ItemID.Sets.ItemNoGravity[Type] = true; ItemID.Sets.SortingPriorityMaterials[Type] = 108; } diff --git a/Items/Materials/DarksunFragment.cs b/Items/Materials/DarksunFragment.cs index 57e5cf78c7..751e706e87 100644 --- a/Items/Materials/DarksunFragment.cs +++ b/Items/Materials/DarksunFragment.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Materials Item.ResearchUnlockCount = 100; Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 8)); ItemID.Sets.AnimatesAsSoul[Type] = true; - ItemID.Sets.ItemNoGravity[Item.type] = true; + ItemID.Sets.ItemNoGravity[Type] = true; ItemID.Sets.SortingPriorityMaterials[Type] = 117; } @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Materials public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) { - Texture2D texture = TextureAssets.Item[Item.type].Value; + Texture2D texture = TextureAssets.Item[Type].Value; spriteBatch.Draw(texture, Item.position - Main.screenPosition, Item.GetCurrentFrame(ref frame, ref frameCounter, 6, 8), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); return false; } diff --git a/Items/Materials/EndothermicEnergy.cs b/Items/Materials/EndothermicEnergy.cs index 4decf4a2fc..bb69407d15 100644 --- a/Items/Materials/EndothermicEnergy.cs +++ b/Items/Materials/EndothermicEnergy.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Materials Item.ResearchUnlockCount = 100; Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6)); ItemID.Sets.AnimatesAsSoul[Type] = true; - ItemID.Sets.ItemNoGravity[Item.type] = true; + ItemID.Sets.ItemNoGravity[Type] = true; ItemID.Sets.SortingPriorityMaterials[Type] = 116; } @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Materials public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) { - Texture2D texture = TextureAssets.Item[Item.type].Value; + Texture2D texture = TextureAssets.Item[Type].Value; spriteBatch.Draw(texture, Item.position - Main.screenPosition, Item.GetCurrentFrame(ref frame, ref frameCounter, 6, 6), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); return false; } diff --git a/Items/Materials/EssenceofEleum.cs b/Items/Materials/EssenceofEleum.cs index 48f3f88496..165eda0d72 100644 --- a/Items/Materials/EssenceofEleum.cs +++ b/Items/Materials/EssenceofEleum.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Materials public override void SetStaticDefaults() { Item.ResearchUnlockCount = 25; - ItemID.Sets.ItemNoGravity[Item.type] = true; + ItemID.Sets.ItemNoGravity[Type] = true; ItemID.Sets.SortingPriorityMaterials[Type] = 71; // Soul of Light } @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Materials } public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, TextureAssets.Item[Item.type].Value); + Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, TextureAssets.Item[Type].Value); } public override void Update(ref float gravity, ref float maxFallSpeed) diff --git a/Items/Materials/EssenceofHavoc.cs b/Items/Materials/EssenceofHavoc.cs index 3b630f600f..5ab267db76 100644 --- a/Items/Materials/EssenceofHavoc.cs +++ b/Items/Materials/EssenceofHavoc.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Materials public override void SetStaticDefaults() { Item.ResearchUnlockCount = 25; - ItemID.Sets.ItemNoGravity[Item.type] = true; + ItemID.Sets.ItemNoGravity[Type] = true; ItemID.Sets.SortingPriorityMaterials[Type] = 71; // Soul of Light } @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Materials } public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, TextureAssets.Item[Item.type].Value); + Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, TextureAssets.Item[Type].Value); } public override void Update(ref float gravity, ref float maxFallSpeed) diff --git a/Items/Materials/EssenceofSunlight.cs b/Items/Materials/EssenceofSunlight.cs index 83e7175758..a86cc1a92a 100644 --- a/Items/Materials/EssenceofSunlight.cs +++ b/Items/Materials/EssenceofSunlight.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Materials public override void SetStaticDefaults() { Item.ResearchUnlockCount = 25; - ItemID.Sets.ItemNoGravity[Item.type] = true; + ItemID.Sets.ItemNoGravity[Type] = true; ItemID.Sets.SortingPriorityMaterials[Type] = 71; // Soul of Light } @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Materials } public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, TextureAssets.Item[Item.type].Value); + Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, TextureAssets.Item[Type].Value); } public override void Update(ref float gravity, ref float maxFallSpeed) diff --git a/Items/Materials/ExoPrism.cs b/Items/Materials/ExoPrism.cs index 0fcf4137ce..47260e143f 100644 --- a/Items/Materials/ExoPrism.cs +++ b/Items/Materials/ExoPrism.cs @@ -37,13 +37,13 @@ namespace CalamityMod.Items.Materials for (int i = 0; i < 4; i++) { Vector2 drawPosition = baseDrawPosition + (MathHelper.TwoPi * i / 4f).ToRotationVector2() * 4f; - spriteBatch.Draw(TextureAssets.Item[Item.type].Value, drawPosition, frame, drawColor, velocity, origin, scale, SpriteEffects.None, 0f); + spriteBatch.Draw(TextureAssets.Item[Type].Value, drawPosition, frame, drawColor, velocity, origin, scale, SpriteEffects.None, 0f); } } public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) { - Rectangle frame = TextureAssets.Item[Item.type].Value.Frame(); + Rectangle frame = TextureAssets.Item[Type].Value.Frame(); DrawBackAfterimage(spriteBatch, Item.position - Main.screenPosition + frame.Size() * 0.5f, frame, scale); return true; } diff --git a/Items/Materials/GalacticaSingularity.cs b/Items/Materials/GalacticaSingularity.cs index 3622917181..bfbdf59bea 100644 --- a/Items/Materials/GalacticaSingularity.cs +++ b/Items/Materials/GalacticaSingularity.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Materials Item.ResearchUnlockCount = 25; Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(4, 24)); ItemID.Sets.AnimatesAsSoul[Type] = true; - ItemID.Sets.ItemNoGravity[Item.type] = true; + ItemID.Sets.ItemNoGravity[Type] = true; ItemID.Sets.SortingPriorityMaterials[Type] = 99; // Luminite } diff --git a/Items/Materials/Lumenyl.cs b/Items/Materials/Lumenyl.cs index 45e404a2cf..0a54de3fb7 100644 --- a/Items/Materials/Lumenyl.cs +++ b/Items/Materials/Lumenyl.cs @@ -16,16 +16,7 @@ namespace CalamityMod.Items.Materials public override void SetDefaults() { - Item.width = 26; - Item.height = 26; - Item.createTile = ModContent.TileType(); - Item.useStyle = ItemUseStyleID.Swing; - Item.useTurn = true; - Item.useAnimation = 15; - Item.useTime = 10; - Item.autoReuse = true; - Item.consumable = true; - Item.maxStack = 9999; + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(silver: 12); Item.rare = ItemRarityID.Lime; } diff --git a/Items/Materials/MeldConstruct.cs b/Items/Materials/MeldConstruct.cs index feded67f84..9fc705f68e 100644 --- a/Items/Materials/MeldConstruct.cs +++ b/Items/Materials/MeldConstruct.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Materials Item.width = 15; Item.height = 12; Item.maxStack = 9999; - Item.value = Item.sellPrice(gold: 1, silver: 20); + Item.value = Item.sellPrice(silver: 42); Item.rare = ItemRarityID.Red; } public override void AddRecipes() diff --git a/Items/Materials/MiracleMatter.cs b/Items/Materials/MiracleMatter.cs index 1da17fb9d9..bef053f488 100644 --- a/Items/Materials/MiracleMatter.cs +++ b/Items/Materials/MiracleMatter.cs @@ -47,14 +47,14 @@ namespace CalamityMod.Items.Materials for (int i = 0; i < 8; i++) { Vector2 drawPosition = baseDrawPosition + (MathHelper.TwoPi * i / 8f).ToRotationVector2() * drawPositionOffset; - spriteBatch.Draw(TextureAssets.Item[Item.type].Value, drawPosition, frame, drawColor, 0f, origin, baseScale, SpriteEffects.None, 0f); + spriteBatch.Draw(TextureAssets.Item[Type].Value, drawPosition, frame, drawColor, 0f, origin, baseScale, SpriteEffects.None, 0f); } } public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) { - Rectangle frame = TextureAssets.Item[Item.type].Value.Frame(); + Rectangle frame = TextureAssets.Item[Type].Value.Frame(); DrawBackAfterimage(spriteBatch, Item.position - Main.screenPosition, frame, Vector2.Zero, scale); return true; } diff --git a/Items/Materials/NightmareFuel.cs b/Items/Materials/NightmareFuel.cs index a3c3ee0a71..2da1dc54a1 100644 --- a/Items/Materials/NightmareFuel.cs +++ b/Items/Materials/NightmareFuel.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Materials Item.ResearchUnlockCount = 100; Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6)); ItemID.Sets.AnimatesAsSoul[Type] = true; - ItemID.Sets.ItemNoGravity[Item.type] = true; + ItemID.Sets.ItemNoGravity[Type] = true; ItemID.Sets.SortingPriorityMaterials[Type] = 115; } @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Materials public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) { - Texture2D texture = TextureAssets.Item[Item.type].Value; + Texture2D texture = TextureAssets.Item[Type].Value; spriteBatch.Draw(texture, Item.position - Main.screenPosition, Item.GetCurrentFrame(ref frame, ref frameCounter, 6, 6), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); return false; } diff --git a/Items/Materials/PerennialBar.cs b/Items/Materials/PerennialBar.cs index b6da5b5fab..50553376a8 100644 --- a/Items/Materials/PerennialBar.cs +++ b/Items/Materials/PerennialBar.cs @@ -18,16 +18,7 @@ namespace CalamityMod.Items.Materials public override void SetDefaults() { - Item.width = 30; - Item.height = 24; - Item.createTile = ModContent.TileType(); - Item.useStyle = ItemUseStyleID.Swing; - Item.useTurn = true; - Item.useAnimation = 15; - Item.useTime = 10; - Item.autoReuse = true; - Item.consumable = true; - Item.maxStack = 9999; + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(gold: 1); Item.rare = ItemRarityID.Lime; } diff --git a/Items/Materials/PlasmaDriveCore.cs b/Items/Materials/PlasmaDriveCore.cs index fc08de716f..822eb869fa 100644 --- a/Items/Materials/PlasmaDriveCore.cs +++ b/Items/Materials/PlasmaDriveCore.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Materials public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) { - Texture2D tex = TextureAssets.Item[Item.type].Value; + Texture2D tex = TextureAssets.Item[Type].Value; //Give it an outline. Make it look really important and shiny. The player must not confuse this for a random material spriteBatch.End(); diff --git a/Items/Materials/SuspiciousScrap.cs b/Items/Materials/SuspiciousScrap.cs index c9d3a2aa77..ea8e02345d 100644 --- a/Items/Materials/SuspiciousScrap.cs +++ b/Items/Materials/SuspiciousScrap.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Materials } public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) { - Texture2D tex = TextureAssets.Item[Item.type].Value; + Texture2D tex = TextureAssets.Item[Type].Value; Vector2 positionDisplace = new Vector2(32, 32) * scale; Rectangle variant = new Rectangle(CalamityWorld.OreTypes[0] == TileID.Tin ? 0 : 32, CalamityWorld.OreTypes[1] == TileID.Lead ? 0 : 32, 30, 30); spriteBatch.Draw(tex, position + positionDisplace, variant, drawColor, 0f, origin, scale * 2f, 0f, 0f); @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Materials public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) { - Texture2D tex = TextureAssets.Item[Item.type].Value; + Texture2D tex = TextureAssets.Item[Type].Value; Rectangle variant = new Rectangle(CalamityWorld.OreTypes[0] == TileID.Tin ? 0 : 32, CalamityWorld.OreTypes[1] == TileID.Lead ? 0 : 32, 30, 30); Vector2 positionDisplace = new Vector2(16, 16) * scale; diff --git a/Items/Materials/TwistingNether.cs b/Items/Materials/TwistingNether.cs index b7a93afdc6..ff72bbc55b 100644 --- a/Items/Materials/TwistingNether.cs +++ b/Items/Materials/TwistingNether.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Materials public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; - ItemID.Sets.ItemNoGravity[Item.type] = true; + ItemID.Sets.ItemNoGravity[Type] = true; ItemID.Sets.SortingPriorityMaterials[Type] = 109; } diff --git a/Items/Materials/UelibloomBar.cs b/Items/Materials/UelibloomBar.cs index 14a98c7914..43dcea8267 100644 --- a/Items/Materials/UelibloomBar.cs +++ b/Items/Materials/UelibloomBar.cs @@ -19,18 +19,9 @@ namespace CalamityMod.Items.Materials public override void SetDefaults() { - Item.width = 15; - Item.height = 12; - Item.createTile = ModContent.TileType(); - Item.maxStack = 9999; + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(gold: 1, silver: 40); Item.rare = ModContent.RarityType(); - Item.useStyle = ItemUseStyleID.Swing; - Item.useTurn = true; - Item.useAnimation = 15; - Item.useTime = 10; - Item.autoReuse = true; - Item.consumable = true; } public override void AddRecipes() { diff --git a/Items/Materials/UnholyEssence.cs b/Items/Materials/UnholyEssence.cs index fcb7a22acf..421e84e9f8 100644 --- a/Items/Materials/UnholyEssence.cs +++ b/Items/Materials/UnholyEssence.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Materials Item.ResearchUnlockCount = 25; Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 7)); ItemID.Sets.AnimatesAsSoul[Type] = true; - ItemID.Sets.ItemNoGravity[Item.type] = true; + ItemID.Sets.ItemNoGravity[Type] = true; ItemID.Sets.SortingPriorityMaterials[Type] = 103; } diff --git a/Items/Materials/YharonSoulFragment.cs b/Items/Materials/YharonSoulFragment.cs index 286e319e14..6a88b2cb35 100644 --- a/Items/Materials/YharonSoulFragment.cs +++ b/Items/Materials/YharonSoulFragment.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Materials public override void SetStaticDefaults() { Item.ResearchUnlockCount = 25; - ItemID.Sets.ItemNoGravity[Item.type] = true; + ItemID.Sets.ItemNoGravity[Type] = true; } diff --git a/Items/MomentumCapacitor.cs b/Items/MomentumCapacitor.cs index 047d0c2f01..b5bf27973e 100644 --- a/Items/MomentumCapacitor.cs +++ b/Items/MomentumCapacitor.cs @@ -1,4 +1,5 @@ -using CalamityMod.CalPlayer; +using System.Collections.Generic; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -40,10 +41,18 @@ namespace CalamityMod.Items CalamityPlayer modPlayer = player.Calamity(); modPlayer.momentumCapacitorTime = TotalFadeTime; modPlayer.momentumCapacitorBoost += Main.rand.NextFloat(0.5f, 3.5f) * MomentumChargePerFrame; - if (modPlayer.momentumCapacitorBoost >= MaxMomentumCharge) + if (modPlayer.momentumCapacitorBoost >= MaxMomentumCharge && !Main.zenithWorld) modPlayer.momentumCapacitorBoost = MaxMomentumCharge; } return null; } + + public override void UpdateInventory(Player player) + { + if (Main.zenithWorld) + Item.SetNameOverride(this.GetLocalizedValue("GFBName")); + } + + public override void ModifyTooltips(List tooltips) => tooltips.FindAndReplace("[GFB]", this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal")); } } diff --git a/Items/PermanentBoosters/Ectoheart.cs b/Items/PermanentBoosters/Ectoheart.cs index b9cea664ba..805e79a9d5 100644 --- a/Items/PermanentBoosters/Ectoheart.cs +++ b/Items/PermanentBoosters/Ectoheart.cs @@ -1,9 +1,11 @@ -using CalamityMod.CalPlayer; +using CalamityMod.Balancing; +using CalamityMod.CalPlayer; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.PermanentBoosters @@ -11,6 +13,8 @@ namespace CalamityMod.Items.PermanentBoosters public class Ectoheart : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Misc"; + public override LocalizedText Tooltip => CalamityUtils.GetText($"{LocalizationCategory}.AdrenalineBoosterTooltip").WithFormatArgs(BalancingConstants.AdrenalineDamagePerBooster.ToPercent(), BalancingConstants.AdrenalineDRPerBooster.ToPercent()); + public int frameCounter = 0; public int frame = 0; public override void SetDefaults() diff --git a/Items/PermanentBoosters/ElectrolyteGelPack.cs b/Items/PermanentBoosters/ElectrolyteGelPack.cs index ce0189d2ba..6cb0062b24 100644 --- a/Items/PermanentBoosters/ElectrolyteGelPack.cs +++ b/Items/PermanentBoosters/ElectrolyteGelPack.cs @@ -1,6 +1,8 @@ -using CalamityMod.CalPlayer; +using CalamityMod.Balancing; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.PermanentBoosters @@ -8,6 +10,8 @@ namespace CalamityMod.Items.PermanentBoosters public class ElectrolyteGelPack : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Misc"; + public override LocalizedText Tooltip => CalamityUtils.GetText($"{LocalizationCategory}.AdrenalineBoosterTooltip").WithFormatArgs(BalancingConstants.AdrenalineDamagePerBooster.ToPercent(), BalancingConstants.AdrenalineDRPerBooster.ToPercent()); + public override void SetDefaults() { Item.width = 20; diff --git a/Items/PermanentBoosters/InfernalBlood.cs b/Items/PermanentBoosters/InfernalBlood.cs index 45f8a3b28e..0cc4bad22c 100644 --- a/Items/PermanentBoosters/InfernalBlood.cs +++ b/Items/PermanentBoosters/InfernalBlood.cs @@ -1,6 +1,8 @@ -using CalamityMod.CalPlayer; +using CalamityMod.Balancing; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.PermanentBoosters @@ -8,6 +10,8 @@ namespace CalamityMod.Items.PermanentBoosters public class InfernalBlood : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Misc"; + public override LocalizedText Tooltip => CalamityUtils.GetText($"{LocalizationCategory}.RageBoosterTooltip").WithFormatArgs(BalancingConstants.RageDurationPerBooster.FramesToSeconds()); + public override void SetDefaults() { Item.width = 20; diff --git a/Items/PermanentBoosters/MushroomPlasmaRoot.cs b/Items/PermanentBoosters/MushroomPlasmaRoot.cs index af910b3844..543543f06e 100644 --- a/Items/PermanentBoosters/MushroomPlasmaRoot.cs +++ b/Items/PermanentBoosters/MushroomPlasmaRoot.cs @@ -1,6 +1,8 @@ -using CalamityMod.CalPlayer; +using CalamityMod.Balancing; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.PermanentBoosters @@ -8,6 +10,8 @@ namespace CalamityMod.Items.PermanentBoosters public class MushroomPlasmaRoot : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Misc"; + public override LocalizedText Tooltip => CalamityUtils.GetText($"{LocalizationCategory}.RageBoosterTooltip").WithFormatArgs(BalancingConstants.RageDurationPerBooster.FramesToSeconds()); + public override void SetDefaults() { Item.width = 20; diff --git a/Items/PermanentBoosters/NimbleBounder.cs b/Items/PermanentBoosters/NimbleBounder.cs index 7b10a9293c..1736a516bb 100644 --- a/Items/PermanentBoosters/NimbleBounder.cs +++ b/Items/PermanentBoosters/NimbleBounder.cs @@ -2,6 +2,7 @@ using CalamityMod.Rarities; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.PermanentBoosters @@ -9,6 +10,12 @@ namespace CalamityMod.Items.PermanentBoosters public class NimbleBounder : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Misc"; + + public static float MoveSpeedBoost = 0.05f; + public static float JumpSpeedBoost = 0.25f; // This also amounts to 5% so the tooltip is shared with movement speed + public static float AccelerationBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedBoost.ToPercent(), AccelerationBoost.ToPercent()); + public override void SetDefaults() { Item.width = 20; diff --git a/Items/PermanentBoosters/RedLightningContainer.cs b/Items/PermanentBoosters/RedLightningContainer.cs index 8b6422f4e7..4690fe9d63 100644 --- a/Items/PermanentBoosters/RedLightningContainer.cs +++ b/Items/PermanentBoosters/RedLightningContainer.cs @@ -1,8 +1,10 @@ -using CalamityMod.CalPlayer; +using CalamityMod.Balancing; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.PermanentBoosters @@ -10,6 +12,8 @@ namespace CalamityMod.Items.PermanentBoosters public class RedLightningContainer : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Misc"; + public override LocalizedText Tooltip => CalamityUtils.GetText($"{LocalizationCategory}.RageBoosterTooltip").WithFormatArgs(BalancingConstants.RageDurationPerBooster.FramesToSeconds()); + public int frameCounter = 0; public int frame = 0; public override void SetDefaults() diff --git a/Items/PermanentBoosters/StarlightFuelCell.cs b/Items/PermanentBoosters/StarlightFuelCell.cs index b4c5b90c02..7b84032f63 100644 --- a/Items/PermanentBoosters/StarlightFuelCell.cs +++ b/Items/PermanentBoosters/StarlightFuelCell.cs @@ -1,6 +1,8 @@ -using CalamityMod.CalPlayer; +using CalamityMod.Balancing; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.PermanentBoosters @@ -8,6 +10,8 @@ namespace CalamityMod.Items.PermanentBoosters public class StarlightFuelCell : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Misc"; + public override LocalizedText Tooltip => CalamityUtils.GetText($"{LocalizationCategory}.AdrenalineBoosterTooltip").WithFormatArgs(BalancingConstants.AdrenalineDamagePerBooster.ToPercent(), BalancingConstants.AdrenalineDRPerBooster.ToPercent()); + public override void SetDefaults() { Item.width = 20; diff --git a/Items/Pets/TheEtomer.cs b/Items/Pets/TheEtomer.cs index 0fafa66ddd..113860ec4f 100644 --- a/Items/Pets/TheEtomer.cs +++ b/Items/Pets/TheEtomer.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.Pets; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Crags; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Projectiles.Pets; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Items/Placeables/AbyssGravel.cs b/Items/Placeables/Abyss/AbyssGravel.cs similarity index 93% rename from Items/Placeables/AbyssGravel.cs rename to Items/Placeables/Abyss/AbyssGravel.cs index 7335c1bacc..5ea6d4de48 100644 --- a/Items/Placeables/AbyssGravel.cs +++ b/Items/Placeables/Abyss/AbyssGravel.cs @@ -2,7 +2,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Abyss { public class AbyssGravel : ModItem, ILocalizedModType { diff --git a/Items/Placeables/AbyssGravel.png b/Items/Placeables/Abyss/AbyssGravel.png similarity index 100% rename from Items/Placeables/AbyssGravel.png rename to Items/Placeables/Abyss/AbyssGravel.png diff --git a/Items/Placeables/Acidwood.cs b/Items/Placeables/Abyss/Acidwood.cs similarity index 96% rename from Items/Placeables/Acidwood.cs rename to Items/Placeables/Abyss/Acidwood.cs index 18ad1a2eab..d7a4d2a64a 100644 --- a/Items/Placeables/Acidwood.cs +++ b/Items/Placeables/Abyss/Acidwood.cs @@ -4,7 +4,7 @@ using CalamityMod.Tiles.Abyss; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Abyss { public class Acidwood : ModItem, ILocalizedModType { diff --git a/Items/Placeables/Acidwood.png b/Items/Placeables/Abyss/Acidwood.png similarity index 100% rename from Items/Placeables/Acidwood.png rename to Items/Placeables/Abyss/Acidwood.png diff --git a/Items/Placeables/HardenedSulphurousSandstone.cs b/Items/Placeables/Abyss/HardenedSulphurousSandstone.cs similarity index 94% rename from Items/Placeables/HardenedSulphurousSandstone.cs rename to Items/Placeables/Abyss/HardenedSulphurousSandstone.cs index 4e97916204..ed907843cd 100644 --- a/Items/Placeables/HardenedSulphurousSandstone.cs +++ b/Items/Placeables/Abyss/HardenedSulphurousSandstone.cs @@ -1,6 +1,6 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Abyss { public class HardenedSulphurousSandstone : ModItem, ILocalizedModType { diff --git a/Items/Placeables/HardenedSulphurousSandstone.png b/Items/Placeables/Abyss/HardenedSulphurousSandstone.png similarity index 100% rename from Items/Placeables/HardenedSulphurousSandstone.png rename to Items/Placeables/Abyss/HardenedSulphurousSandstone.png diff --git a/Items/Placeables/PlantyMush.cs b/Items/Placeables/Abyss/PlantyMush.cs similarity index 93% rename from Items/Placeables/PlantyMush.cs rename to Items/Placeables/Abyss/PlantyMush.cs index e821c49d71..d2c9db45fa 100644 --- a/Items/Placeables/PlantyMush.cs +++ b/Items/Placeables/Abyss/PlantyMush.cs @@ -2,7 +2,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Abyss { public class PlantyMush : ModItem, ILocalizedModType { diff --git a/Items/Placeables/PlantyMush.png b/Items/Placeables/Abyss/PlantyMush.png similarity index 100% rename from Items/Placeables/PlantyMush.png rename to Items/Placeables/Abyss/PlantyMush.png diff --git a/Items/Placeables/PyreMantle.cs b/Items/Placeables/Abyss/PyreMantle.cs similarity index 93% rename from Items/Placeables/PyreMantle.cs rename to Items/Placeables/Abyss/PyreMantle.cs index 935904094b..3be013b867 100644 --- a/Items/Placeables/PyreMantle.cs +++ b/Items/Placeables/Abyss/PyreMantle.cs @@ -2,7 +2,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Abyss { public class PyreMantle : ModItem, ILocalizedModType { diff --git a/Items/Placeables/PyreMantle.png b/Items/Placeables/Abyss/PyreMantle.png similarity index 100% rename from Items/Placeables/PyreMantle.png rename to Items/Placeables/Abyss/PyreMantle.png diff --git a/Items/Placeables/PyreMantleMolten.cs b/Items/Placeables/Abyss/PyreMantleMolten.cs similarity index 94% rename from Items/Placeables/PyreMantleMolten.cs rename to Items/Placeables/Abyss/PyreMantleMolten.cs index 58afb4d031..c33d644406 100644 --- a/Items/Placeables/PyreMantleMolten.cs +++ b/Items/Placeables/Abyss/PyreMantleMolten.cs @@ -2,7 +2,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Abyss { public class PyreMantleMolten : ModItem, ILocalizedModType { diff --git a/Items/Placeables/PyreMantleMolten.png b/Items/Placeables/Abyss/PyreMantleMolten.png similarity index 100% rename from Items/Placeables/PyreMantleMolten.png rename to Items/Placeables/Abyss/PyreMantleMolten.png diff --git a/Items/Placeables/SulphurousSand.cs b/Items/Placeables/Abyss/SulphurousSand.cs similarity index 95% rename from Items/Placeables/SulphurousSand.cs rename to Items/Placeables/Abyss/SulphurousSand.cs index 0dbe2a305f..abeaa96515 100644 --- a/Items/Placeables/SulphurousSand.cs +++ b/Items/Placeables/Abyss/SulphurousSand.cs @@ -2,7 +2,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Abyss { public class SulphurousSand : ModItem, ILocalizedModType { diff --git a/Items/Placeables/SulphurousSand.png b/Items/Placeables/Abyss/SulphurousSand.png similarity index 100% rename from Items/Placeables/SulphurousSand.png rename to Items/Placeables/Abyss/SulphurousSand.png diff --git a/Items/Placeables/SulphurousSandstone.cs b/Items/Placeables/Abyss/SulphurousSandstone.cs similarity index 94% rename from Items/Placeables/SulphurousSandstone.cs rename to Items/Placeables/Abyss/SulphurousSandstone.cs index ba3b24c35a..a3903723f1 100644 --- a/Items/Placeables/SulphurousSandstone.cs +++ b/Items/Placeables/Abyss/SulphurousSandstone.cs @@ -1,6 +1,6 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Abyss { public class SulphurousSandstone : ModItem, ILocalizedModType { diff --git a/Items/Placeables/SulphurousSandstone.png b/Items/Placeables/Abyss/SulphurousSandstone.png similarity index 100% rename from Items/Placeables/SulphurousSandstone.png rename to Items/Placeables/Abyss/SulphurousSandstone.png diff --git a/Items/Placeables/SulphurousShale.cs b/Items/Placeables/Abyss/SulphurousShale.cs similarity index 94% rename from Items/Placeables/SulphurousShale.cs rename to Items/Placeables/Abyss/SulphurousShale.cs index e25c379423..89365df685 100644 --- a/Items/Placeables/SulphurousShale.cs +++ b/Items/Placeables/Abyss/SulphurousShale.cs @@ -1,6 +1,6 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Abyss { public class SulphurousShale : ModItem, ILocalizedModType { diff --git a/Items/Placeables/SulphurousShale.png b/Items/Placeables/Abyss/SulphurousShale.png similarity index 100% rename from Items/Placeables/SulphurousShale.png rename to Items/Placeables/Abyss/SulphurousShale.png diff --git a/Items/Placeables/Voidstone.cs b/Items/Placeables/Abyss/Voidstone.cs similarity index 93% rename from Items/Placeables/Voidstone.cs rename to Items/Placeables/Abyss/Voidstone.cs index 9431705b6f..d0aaf5511b 100644 --- a/Items/Placeables/Voidstone.cs +++ b/Items/Placeables/Abyss/Voidstone.cs @@ -2,7 +2,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Abyss { public class Voidstone : ModItem, ILocalizedModType { diff --git a/Items/Placeables/Voidstone.png b/Items/Placeables/Abyss/Voidstone.png similarity index 100% rename from Items/Placeables/Voidstone.png rename to Items/Placeables/Abyss/Voidstone.png diff --git a/Items/Placeables/AstralBrick.cs b/Items/Placeables/Astral/AstralBrick.cs similarity index 95% rename from Items/Placeables/AstralBrick.cs rename to Items/Placeables/Astral/AstralBrick.cs index 53b2867836..65254e2dcb 100644 --- a/Items/Placeables/AstralBrick.cs +++ b/Items/Placeables/Astral/AstralBrick.cs @@ -3,7 +3,7 @@ using CalamityMod.Items.Placeables.Walls; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Astral { public class AstralBrick : ModItem, ILocalizedModType { diff --git a/Items/Placeables/AstralBrick.png b/Items/Placeables/Astral/AstralBrick.png similarity index 100% rename from Items/Placeables/AstralBrick.png rename to Items/Placeables/Astral/AstralBrick.png diff --git a/Items/Placeables/AstralClay.cs b/Items/Placeables/Astral/AstralClay.cs similarity index 92% rename from Items/Placeables/AstralClay.cs rename to Items/Placeables/Astral/AstralClay.cs index 0f3c7854ce..d8c8e79a72 100644 --- a/Items/Placeables/AstralClay.cs +++ b/Items/Placeables/Astral/AstralClay.cs @@ -2,7 +2,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Astral { public class AstralClay : ModItem, ILocalizedModType { diff --git a/Items/Placeables/AstralClay.png b/Items/Placeables/Astral/AstralClay.png similarity index 100% rename from Items/Placeables/AstralClay.png rename to Items/Placeables/Astral/AstralClay.png diff --git a/Items/Placeables/AstralDirt.cs b/Items/Placeables/Astral/AstralDirt.cs similarity index 94% rename from Items/Placeables/AstralDirt.cs rename to Items/Placeables/Astral/AstralDirt.cs index dd7983486c..700846def6 100644 --- a/Items/Placeables/AstralDirt.cs +++ b/Items/Placeables/Astral/AstralDirt.cs @@ -3,7 +3,7 @@ using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Astral { public class AstralDirt : ModItem, ILocalizedModType { diff --git a/Items/Placeables/AstralDirt.png b/Items/Placeables/Astral/AstralDirt.png similarity index 100% rename from Items/Placeables/AstralDirt.png rename to Items/Placeables/Astral/AstralDirt.png diff --git a/Items/Placeables/AstralGrassSeeds.cs b/Items/Placeables/Astral/AstralGrassSeeds.cs similarity index 91% rename from Items/Placeables/AstralGrassSeeds.cs rename to Items/Placeables/Astral/AstralGrassSeeds.cs index ab8b20fc39..43343bd8e9 100644 --- a/Items/Placeables/AstralGrassSeeds.cs +++ b/Items/Placeables/Astral/AstralGrassSeeds.cs @@ -4,7 +4,7 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Astral { public class AstralGrassSeeds : ModItem, ILocalizedModType { @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Placeables public override bool? UseItem(Player player) { - Tile tile = Framing.GetTileSafely(Player.tileTargetX, Player.tileTargetY); + var tile = Framing.GetTileSafely(Player.tileTargetX, Player.tileTargetY); if (tile.HasTile && tile.TileType == ModContent.TileType() && player.IsInTileInteractionRange(Player.tileTargetX, Player.tileTargetY, TileReachCheckSettings.Simple)) { diff --git a/Items/Placeables/AstralGrassSeeds.png b/Items/Placeables/Astral/AstralGrassSeeds.png similarity index 100% rename from Items/Placeables/AstralGrassSeeds.png rename to Items/Placeables/Astral/AstralGrassSeeds.png diff --git a/Items/Placeables/AstralIce.cs b/Items/Placeables/Astral/AstralIce.cs similarity index 95% rename from Items/Placeables/AstralIce.cs rename to Items/Placeables/Astral/AstralIce.cs index c4e2600255..08c9ea1b26 100644 --- a/Items/Placeables/AstralIce.cs +++ b/Items/Placeables/Astral/AstralIce.cs @@ -3,7 +3,7 @@ using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Astral { public class AstralIce : ModItem, ILocalizedModType { diff --git a/Items/Placeables/AstralIce.png b/Items/Placeables/Astral/AstralIce.png similarity index 100% rename from Items/Placeables/AstralIce.png rename to Items/Placeables/Astral/AstralIce.png diff --git a/Items/Placeables/AstralMonolith.cs b/Items/Placeables/Astral/AstralMonolith.cs similarity index 96% rename from Items/Placeables/AstralMonolith.cs rename to Items/Placeables/Astral/AstralMonolith.cs index 5309ad08c1..e42e72b0dd 100644 --- a/Items/Placeables/AstralMonolith.cs +++ b/Items/Placeables/Astral/AstralMonolith.cs @@ -3,7 +3,7 @@ using CalamityMod.Items.Placeables.Walls; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Astral { public class AstralMonolith : ModItem, ILocalizedModType { diff --git a/Items/Placeables/AstralMonolith.png b/Items/Placeables/Astral/AstralMonolith.png similarity index 100% rename from Items/Placeables/AstralMonolith.png rename to Items/Placeables/Astral/AstralMonolith.png diff --git a/Items/Placeables/AstralSand.cs b/Items/Placeables/Astral/AstralSand.cs similarity index 94% rename from Items/Placeables/AstralSand.cs rename to Items/Placeables/Astral/AstralSand.cs index 2798bc9f2d..1ddc465fb5 100644 --- a/Items/Placeables/AstralSand.cs +++ b/Items/Placeables/Astral/AstralSand.cs @@ -3,7 +3,7 @@ using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Astral { public class AstralSand : ModItem, ILocalizedModType { diff --git a/Items/Placeables/AstralSand.png b/Items/Placeables/Astral/AstralSand.png similarity index 100% rename from Items/Placeables/AstralSand.png rename to Items/Placeables/Astral/AstralSand.png diff --git a/Items/Placeables/AstralSandstone.cs b/Items/Placeables/Astral/AstralSandstone.cs similarity index 95% rename from Items/Placeables/AstralSandstone.cs rename to Items/Placeables/Astral/AstralSandstone.cs index 34d23c4896..6ca432c848 100644 --- a/Items/Placeables/AstralSandstone.cs +++ b/Items/Placeables/Astral/AstralSandstone.cs @@ -3,7 +3,7 @@ using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Astral { public class AstralSandstone : ModItem, ILocalizedModType { diff --git a/Items/Placeables/AstralSandstone.png b/Items/Placeables/Astral/AstralSandstone.png similarity index 100% rename from Items/Placeables/AstralSandstone.png rename to Items/Placeables/Astral/AstralSandstone.png diff --git a/Items/Placeables/AstralSnow.cs b/Items/Placeables/Astral/AstralSnow.cs similarity index 94% rename from Items/Placeables/AstralSnow.cs rename to Items/Placeables/Astral/AstralSnow.cs index 897c56199e..e523debba2 100644 --- a/Items/Placeables/AstralSnow.cs +++ b/Items/Placeables/Astral/AstralSnow.cs @@ -3,7 +3,7 @@ using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Astral { public class AstralSnow : ModItem, ILocalizedModType { diff --git a/Items/Placeables/AstralSnow.png b/Items/Placeables/Astral/AstralSnow.png similarity index 100% rename from Items/Placeables/AstralSnow.png rename to Items/Placeables/Astral/AstralSnow.png diff --git a/Items/Placeables/AstralStone.cs b/Items/Placeables/Astral/AstralStone.cs similarity index 94% rename from Items/Placeables/AstralStone.cs rename to Items/Placeables/Astral/AstralStone.cs index 61813bd8c0..202001661f 100644 --- a/Items/Placeables/AstralStone.cs +++ b/Items/Placeables/Astral/AstralStone.cs @@ -3,7 +3,7 @@ using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Astral { public class AstralStone : ModItem, ILocalizedModType { diff --git a/Items/Placeables/AstralStone.png b/Items/Placeables/Astral/AstralStone.png similarity index 100% rename from Items/Placeables/AstralStone.png rename to Items/Placeables/Astral/AstralStone.png diff --git a/Items/Placeables/CelestialRemains.cs b/Items/Placeables/Astral/CelestialRemains.cs similarity index 83% rename from Items/Placeables/CelestialRemains.cs rename to Items/Placeables/Astral/CelestialRemains.cs index 3bfcfb7532..de3b1252b7 100644 --- a/Items/Placeables/CelestialRemains.cs +++ b/Items/Placeables/Astral/CelestialRemains.cs @@ -4,7 +4,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Astral { [LegacyName("AstralFossil")] public class CelestialRemains : ModItem, ILocalizedModType @@ -26,13 +26,13 @@ namespace CalamityMod.Items.Placeables When Astrum Deus has been defeated, it will give Astral Ore */ - bool twoMechsDowned = - (NPC.downedMechBoss1 && NPC.downedMechBoss2 && !NPC.downedMechBoss3) || - (NPC.downedMechBoss2 && NPC.downedMechBoss3 && !NPC.downedMechBoss1) || - (NPC.downedMechBoss3 && NPC.downedMechBoss1 && !NPC.downedMechBoss2) || - (NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3); + var twoMechsDowned = + NPC.downedMechBoss1 && NPC.downedMechBoss2 && !NPC.downedMechBoss3 || + NPC.downedMechBoss2 && NPC.downedMechBoss3 && !NPC.downedMechBoss1 || + NPC.downedMechBoss3 && NPC.downedMechBoss1 && !NPC.downedMechBoss2 || + NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3; - float val = Main.rand.NextFloat(100); + var val = Main.rand.NextFloat(100); if (val < 20f) { resultType = ItemID.CopperCoin; @@ -120,22 +120,22 @@ namespace CalamityMod.Items.Placeables } else if (val < 85.03f) { - resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.CobaltOre : ItemID.MythrilOre) : ItemID.MythrilOre; + resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.CobaltOre : ItemID.MythrilOre : ItemID.MythrilOre; resultStack = Main.rand.Next(1, 17); } else if (val < 87.03f) { - resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.PalladiumOre : ItemID.OrichalcumOre) : ItemID.OrichalcumOre; + resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.PalladiumOre : ItemID.OrichalcumOre : ItemID.OrichalcumOre; resultStack = Main.rand.Next(1, 17); } else if (val < 88.78f) { - resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.CobaltOre : !twoMechsDowned ? ItemID.MythrilOre : ItemID.AdamantiteOre) : ItemID.AdamantiteOre; + resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.CobaltOre : !twoMechsDowned ? ItemID.MythrilOre : ItemID.AdamantiteOre : ItemID.AdamantiteOre; resultStack = Main.rand.Next(1, 17); } else if (val < 89.53f) { - resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.PalladiumOre : !twoMechsDowned ? ItemID.OrichalcumOre : ItemID.TitaniumOre) : ItemID.TitaniumOre; + resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.PalladiumOre : !twoMechsDowned ? ItemID.OrichalcumOre : ItemID.TitaniumOre : ItemID.TitaniumOre; resultStack = Main.rand.Next(1, 17); } else if (DownedBossSystem.downedAstrumDeus) diff --git a/Items/Placeables/CelestialRemains.png b/Items/Placeables/Astral/CelestialRemains.png similarity index 100% rename from Items/Placeables/CelestialRemains.png rename to Items/Placeables/Astral/CelestialRemains.png diff --git a/Items/Placeables/HardenedAstralSand.cs b/Items/Placeables/Astral/HardenedAstralSand.cs similarity index 95% rename from Items/Placeables/HardenedAstralSand.cs rename to Items/Placeables/Astral/HardenedAstralSand.cs index 6d58430974..db25aa947a 100644 --- a/Items/Placeables/HardenedAstralSand.cs +++ b/Items/Placeables/Astral/HardenedAstralSand.cs @@ -2,7 +2,7 @@ using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Astral { public class HardenedAstralSand : ModItem, ILocalizedModType { diff --git a/Items/Placeables/HardenedAstralSand.png b/Items/Placeables/Astral/HardenedAstralSand.png similarity index 100% rename from Items/Placeables/HardenedAstralSand.png rename to Items/Placeables/Astral/HardenedAstralSand.png diff --git a/Items/Placeables/NovaeSlag.cs b/Items/Placeables/Astral/NovaeSlag.cs similarity index 81% rename from Items/Placeables/NovaeSlag.cs rename to Items/Placeables/Astral/NovaeSlag.cs index 98750c38eb..b78942be81 100644 --- a/Items/Placeables/NovaeSlag.cs +++ b/Items/Placeables/Astral/NovaeSlag.cs @@ -3,7 +3,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Astral { [LegacyName("AstralSilt")] public class NovaeSlag : ModItem, ILocalizedModType @@ -25,13 +25,13 @@ namespace CalamityMod.Items.Placeables When Astrum Deus has been defeated, it will give Astral Ore */ - bool twoMechsDowned = - (NPC.downedMechBoss1 && NPC.downedMechBoss2 && !NPC.downedMechBoss3) || - (NPC.downedMechBoss2 && NPC.downedMechBoss3 && !NPC.downedMechBoss1) || - (NPC.downedMechBoss3 && NPC.downedMechBoss1 && !NPC.downedMechBoss2) || - (NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3); + var twoMechsDowned = + NPC.downedMechBoss1 && NPC.downedMechBoss2 && !NPC.downedMechBoss3 || + NPC.downedMechBoss2 && NPC.downedMechBoss3 && !NPC.downedMechBoss1 || + NPC.downedMechBoss3 && NPC.downedMechBoss1 && !NPC.downedMechBoss2 || + NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3; - float val = Main.rand.NextFloat(100); + var val = Main.rand.NextFloat(100); if (val < 30f) { resultType = ItemID.CopperCoin; @@ -109,22 +109,22 @@ namespace CalamityMod.Items.Placeables } else if (val < 83.03f) { - resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.CobaltOre : ItemID.MythrilOre) : ItemID.MythrilOre; + resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.CobaltOre : ItemID.MythrilOre : ItemID.MythrilOre; resultStack = Main.rand.Next(1, 17); } else if (val < 85.03f) { - resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.PalladiumOre : ItemID.OrichalcumOre) : ItemID.OrichalcumOre; + resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.PalladiumOre : ItemID.OrichalcumOre : ItemID.OrichalcumOre; resultStack = Main.rand.Next(1, 17); } else if (val < 86.78f) { - resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.CobaltOre : !twoMechsDowned ? ItemID.MythrilOre : ItemID.AdamantiteOre) : ItemID.AdamantiteOre; + resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.CobaltOre : !twoMechsDowned ? ItemID.MythrilOre : ItemID.AdamantiteOre : ItemID.AdamantiteOre; resultStack = Main.rand.Next(1, 17); } else if (val < 88.53f) { - resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.PalladiumOre : !twoMechsDowned ? ItemID.OrichalcumOre : ItemID.TitaniumOre) : ItemID.TitaniumOre; + resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.PalladiumOre : !twoMechsDowned ? ItemID.OrichalcumOre : ItemID.TitaniumOre : ItemID.TitaniumOre; resultStack = Main.rand.Next(1, 17); } else if (DownedBossSystem.downedAstrumDeus) diff --git a/Items/Placeables/NovaeSlag.png b/Items/Placeables/Astral/NovaeSlag.png similarity index 100% rename from Items/Placeables/NovaeSlag.png rename to Items/Placeables/Astral/NovaeSlag.png diff --git a/Items/Placeables/Banners/BabyCannonballJellyfishBanner.png b/Items/Placeables/Banners/BabyCannonballJellyfishBanner.png index 6f46d7ec01..99636485b8 100644 Binary files a/Items/Placeables/Banners/BabyCannonballJellyfishBanner.png and b/Items/Placeables/Banners/BabyCannonballJellyfishBanner.png differ diff --git a/Items/Placeables/Banners/CannonballJellyfishBanner.png b/Items/Placeables/Banners/CannonballJellyfishBanner.png index 29f93d3ada..88771811b0 100644 Binary files a/Items/Placeables/Banners/CannonballJellyfishBanner.png and b/Items/Placeables/Banners/CannonballJellyfishBanner.png differ diff --git a/Items/Placeables/BrimstoneSlab.cs b/Items/Placeables/Crags/BrimstoneSlab.cs similarity index 94% rename from Items/Placeables/BrimstoneSlab.cs rename to Items/Placeables/Crags/BrimstoneSlab.cs index 1241738773..b562d8d530 100644 --- a/Items/Placeables/BrimstoneSlab.cs +++ b/Items/Placeables/Crags/BrimstoneSlab.cs @@ -2,7 +2,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Crags { public class BrimstoneSlab : ModItem, ILocalizedModType { diff --git a/Items/Placeables/BrimstoneSlab.png b/Items/Placeables/Crags/BrimstoneSlab.png similarity index 100% rename from Items/Placeables/BrimstoneSlab.png rename to Items/Placeables/Crags/BrimstoneSlab.png diff --git a/Items/Placeables/BrimstoneSlag.cs b/Items/Placeables/Crags/BrimstoneSlag.cs similarity index 93% rename from Items/Placeables/BrimstoneSlag.cs rename to Items/Placeables/Crags/BrimstoneSlag.cs index ee1babd52c..0efddda541 100644 --- a/Items/Placeables/BrimstoneSlag.cs +++ b/Items/Placeables/Crags/BrimstoneSlag.cs @@ -2,7 +2,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Crags { public class BrimstoneSlag : ModItem, ILocalizedModType { diff --git a/Items/Placeables/BrimstoneSlag.png b/Items/Placeables/Crags/BrimstoneSlag.png similarity index 100% rename from Items/Placeables/BrimstoneSlag.png rename to Items/Placeables/Crags/BrimstoneSlag.png diff --git a/Items/Placeables/CinderBlossomSeeds.cs b/Items/Placeables/Crags/CinderBlossomSeeds.cs similarity index 86% rename from Items/Placeables/CinderBlossomSeeds.cs rename to Items/Placeables/Crags/CinderBlossomSeeds.cs index dfc007bada..d948c11304 100644 --- a/Items/Placeables/CinderBlossomSeeds.cs +++ b/Items/Placeables/Crags/CinderBlossomSeeds.cs @@ -4,7 +4,7 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Crags { public class CinderBlossomSeeds : ModItem, ILocalizedModType { @@ -31,8 +31,8 @@ namespace CalamityMod.Items.Placeables public override bool? UseItem(Player player) { - Tile tile = Framing.GetTileSafely(Player.tileTargetX, Player.tileTargetY); - Tile tileAbove = Framing.GetTileSafely(Player.tileTargetX, Player.tileTargetY - 1); + var tile = Framing.GetTileSafely(Player.tileTargetX, Player.tileTargetY); + var tileAbove = Framing.GetTileSafely(Player.tileTargetX, Player.tileTargetY - 1); if (tile.HasTile && !tileAbove.HasTile && tileAbove.LiquidAmount == 0 && tile.TileType == ModContent.TileType() && player.IsInTileInteractionRange(Player.tileTargetX, Player.tileTargetY, TileReachCheckSettings.Simple)) { diff --git a/Items/Placeables/CinderBlossomSeeds.png b/Items/Placeables/Crags/CinderBlossomSeeds.png similarity index 100% rename from Items/Placeables/CinderBlossomSeeds.png rename to Items/Placeables/Crags/CinderBlossomSeeds.png diff --git a/Items/Placeables/ScorchedBone.cs b/Items/Placeables/Crags/ScorchedBone.cs similarity index 87% rename from Items/Placeables/ScorchedBone.cs rename to Items/Placeables/Crags/ScorchedBone.cs index c83c290231..3050aac9c8 100644 --- a/Items/Placeables/ScorchedBone.cs +++ b/Items/Placeables/Crags/ScorchedBone.cs @@ -1,10 +1,9 @@ -using CalamityMod.Items.Placeables; -using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.Walls; using CalamityMod.Tiles.Crags; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Crags { public class ScorchedBone : ModItem, ILocalizedModType { diff --git a/Items/Placeables/ScorchedBone.png b/Items/Placeables/Crags/ScorchedBone.png similarity index 100% rename from Items/Placeables/ScorchedBone.png rename to Items/Placeables/Crags/ScorchedBone.png diff --git a/Items/Placeables/ScorchedRemains.cs b/Items/Placeables/Crags/ScorchedRemains.cs similarity index 91% rename from Items/Placeables/ScorchedRemains.cs rename to Items/Placeables/Crags/ScorchedRemains.cs index 5a5100204d..71d1dcee55 100644 --- a/Items/Placeables/ScorchedRemains.cs +++ b/Items/Placeables/Crags/ScorchedRemains.cs @@ -2,7 +2,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Crags { public class ScorchedRemains : ModItem, ILocalizedModType { diff --git a/Items/Placeables/ScorchedRemains.png b/Items/Placeables/Crags/ScorchedRemains.png similarity index 100% rename from Items/Placeables/ScorchedRemains.png rename to Items/Placeables/Crags/ScorchedRemains.png diff --git a/Items/Placeables/SpineSapling.cs b/Items/Placeables/Crags/SpineSapling.cs similarity index 92% rename from Items/Placeables/SpineSapling.cs rename to Items/Placeables/Crags/SpineSapling.cs index e11bc52c21..f267ec6cc3 100644 --- a/Items/Placeables/SpineSapling.cs +++ b/Items/Placeables/Crags/SpineSapling.cs @@ -2,7 +2,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.Crags { public class SpineSapling : ModItem, ILocalizedModType { diff --git a/Items/Placeables/SpineSapling.png b/Items/Placeables/Crags/SpineSapling.png similarity index 100% rename from Items/Placeables/SpineSapling.png rename to Items/Placeables/Crags/SpineSapling.png diff --git a/Items/Placeables/AlgalSlateItem.cs b/Items/Placeables/FloralParadise/AlgalSlateItem.cs similarity index 89% rename from Items/Placeables/AlgalSlateItem.cs rename to Items/Placeables/FloralParadise/AlgalSlateItem.cs index 4da8964773..e0673c2ca8 100644 --- a/Items/Placeables/AlgalSlateItem.cs +++ b/Items/Placeables/FloralParadise/AlgalSlateItem.cs @@ -2,7 +2,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.FloralParadise { public class AlgalSlateItem : ModItem, ILocalizedModType { diff --git a/Items/Placeables/AlgalSlateItem.png b/Items/Placeables/FloralParadise/AlgalSlateItem.png similarity index 100% rename from Items/Placeables/AlgalSlateItem.png rename to Items/Placeables/FloralParadise/AlgalSlateItem.png diff --git a/Items/Placeables/PeatItem.cs b/Items/Placeables/FloralParadise/PeatItem.cs similarity index 89% rename from Items/Placeables/PeatItem.cs rename to Items/Placeables/FloralParadise/PeatItem.cs index cb772f9efe..ea762c6b88 100644 --- a/Items/Placeables/PeatItem.cs +++ b/Items/Placeables/FloralParadise/PeatItem.cs @@ -2,7 +2,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.FloralParadise { public class PeatItem : ModItem, ILocalizedModType { diff --git a/Items/Placeables/PeatItem.png b/Items/Placeables/FloralParadise/PeatItem.png similarity index 100% rename from Items/Placeables/PeatItem.png rename to Items/Placeables/FloralParadise/PeatItem.png diff --git a/Items/Placeables/PeatMossItem.cs b/Items/Placeables/FloralParadise/PeatMossItem.cs similarity index 89% rename from Items/Placeables/PeatMossItem.cs rename to Items/Placeables/FloralParadise/PeatMossItem.cs index dfc289a1d3..40acf1915c 100644 --- a/Items/Placeables/PeatMossItem.cs +++ b/Items/Placeables/FloralParadise/PeatMossItem.cs @@ -2,7 +2,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.FloralParadise { public class PeatMossItem : ModItem, ILocalizedModType { diff --git a/Items/Placeables/PeatMossItem.png b/Items/Placeables/FloralParadise/PeatMossItem.png similarity index 100% rename from Items/Placeables/PeatMossItem.png rename to Items/Placeables/FloralParadise/PeatMossItem.png diff --git a/Items/Placeables/ScintillatingBloom.cs b/Items/Placeables/FloralParadise/ScintillatingBloom.cs similarity index 89% rename from Items/Placeables/ScintillatingBloom.cs rename to Items/Placeables/FloralParadise/ScintillatingBloom.cs index 6f757e5bc3..51516aaee2 100644 --- a/Items/Placeables/ScintillatingBloom.cs +++ b/Items/Placeables/FloralParadise/ScintillatingBloom.cs @@ -3,7 +3,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.FloralParadise { public class ScintillatingBloom : ModItem, ILocalizedModType { diff --git a/Items/Placeables/ScintillatingBloom.png b/Items/Placeables/FloralParadise/ScintillatingBloom.png similarity index 100% rename from Items/Placeables/ScintillatingBloom.png rename to Items/Placeables/FloralParadise/ScintillatingBloom.png diff --git a/Items/Placeables/Furniture/AlgalPrismTorch.cs b/Items/Placeables/Furniture/AlgalPrismTorch.cs index 30849a75a3..84fd680531 100644 --- a/Items/Placeables/Furniture/AlgalPrismTorch.cs +++ b/Items/Placeables/Furniture/AlgalPrismTorch.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Items.Placeables.SunkenSea; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,9 +12,9 @@ namespace CalamityMod.Items.Placeables.Furniture public override void SetStaticDefaults() { Item.ResearchUnlockCount = 100; - ItemID.Sets.Torches[Item.type] = true; + ItemID.Sets.Torches[Type] = true; ItemID.Sets.SingleUseInGamepad[Type] = true; - ItemID.Sets.WaterTorches[Item.type] = true; + ItemID.Sets.WaterTorches[Type] = true; ItemID.Sets.ShimmerTransformToItem[Type] = ItemID.ShimmerTorch; } diff --git a/Items/Placeables/Furniture/AstralBeaconItem.cs b/Items/Placeables/Furniture/AstralBeaconItem.cs index 62843cb011..97e7a66d44 100644 --- a/Items/Placeables/Furniture/AstralBeaconItem.cs +++ b/Items/Placeables/Furniture/AstralBeaconItem.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Astral; using CalamityMod.Items.Potions; using CalamityMod.Tiles.Astral; using Terraria; @@ -22,7 +23,7 @@ namespace CalamityMod.Items.Placeables.Furniture CreateRecipe(). AddIngredient(5). AddIngredient(20). - AddIngredient(30). + AddIngredient(30). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Placeables/Furniture/AstralTorch.cs b/Items/Placeables/Furniture/AstralTorch.cs index 12cf515c90..cbe81b0ada 100644 --- a/Items/Placeables/Furniture/AstralTorch.cs +++ b/Items/Placeables/Furniture/AstralTorch.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Furniture public override void SetStaticDefaults() { Item.ResearchUnlockCount = 100; - ItemID.Sets.Torches[Item.type] = true; + ItemID.Sets.Torches[Type] = true; ItemID.Sets.SingleUseInGamepad[Type] = true; ItemID.Sets.ShimmerTransformToItem[Type] = ItemID.ShimmerTorch; } diff --git a/Items/Placeables/Furniture/BabyCannonballJellyfishBowl.png b/Items/Placeables/Furniture/BabyCannonballJellyfishBowl.png index 0d0376c841..280a36f556 100644 Binary files a/Items/Placeables/Furniture/BabyCannonballJellyfishBowl.png and b/Items/Placeables/Furniture/BabyCannonballJellyfishBowl.png differ diff --git a/Items/Placeables/Furniture/ChaosCandle.cs b/Items/Placeables/Furniture/ChaosCandle.cs index ca9f5cd087..8cb883395d 100644 --- a/Items/Placeables/Furniture/ChaosCandle.cs +++ b/Items/Placeables/Furniture/ChaosCandle.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Placeables.Furniture CreateRecipe(). AddIngredient(ItemID.WaterCandle). AddIngredient(). - AddIngredient(2). + AddIngredient(2). AddTile(TileID.WorkBenches). Register(); } diff --git a/Items/Placeables/Furniture/CraftingStations/AltarOfTheAccursedItem.cs b/Items/Placeables/Furniture/CraftingStations/AltarOfTheAccursedItem.cs index 3348f7d6c9..2c39b76899 100644 --- a/Items/Placeables/Furniture/CraftingStations/AltarOfTheAccursedItem.cs +++ b/Items/Placeables/Furniture/CraftingStations/AltarOfTheAccursedItem.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Crags; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; diff --git a/Items/Placeables/Furniture/CraftingStations/AncientAltar.cs b/Items/Placeables/Furniture/CraftingStations/AncientAltar.cs index 6a71c67e54..5af066ec73 100644 --- a/Items/Placeables/Furniture/CraftingStations/AncientAltar.cs +++ b/Items/Placeables/Furniture/CraftingStations/AncientAltar.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Crags; using CalamityMod.Items.Placeables.Ores; using Terraria; using Terraria.ID; diff --git a/Items/Placeables/Furniture/CraftingStations/AshenAltar.cs b/Items/Placeables/Furniture/CraftingStations/AshenAltar.cs index 44f9dd793c..f59ea00466 100644 --- a/Items/Placeables/Furniture/CraftingStations/AshenAltar.cs +++ b/Items/Placeables/Furniture/CraftingStations/AshenAltar.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Crags; using CalamityMod.Items.Placeables.FurnitureAshen; using Terraria; using Terraria.ID; diff --git a/Items/Placeables/Furniture/CraftingStations/EutrophicShelf.cs b/Items/Placeables/Furniture/CraftingStations/EutrophicShelf.cs index c7183d1179..b403fe488c 100644 --- a/Items/Placeables/Furniture/CraftingStations/EutrophicShelf.cs +++ b/Items/Placeables/Furniture/CraftingStations/EutrophicShelf.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.SunkenSea; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/Furniture/CraftingStations/MonolithAmalgam.cs b/Items/Placeables/Furniture/CraftingStations/MonolithAmalgam.cs index f5ee1c7f31..1f3116f9b6 100644 --- a/Items/Placeables/Furniture/CraftingStations/MonolithAmalgam.cs +++ b/Items/Placeables/Furniture/CraftingStations/MonolithAmalgam.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.Items.Placeables.Astral; +using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture.CraftingStations diff --git a/Items/Placeables/Furniture/EffigyOfDecay.cs b/Items/Placeables/Furniture/EffigyOfDecay.cs index 7c9cf25e24..a67f4d7bdd 100644 --- a/Items/Placeables/Furniture/EffigyOfDecay.cs +++ b/Items/Placeables/Furniture/EffigyOfDecay.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Tiles.Furniture; using Terraria; using Terraria.ID; diff --git a/Items/Placeables/Furniture/GloomTorch.cs b/Items/Placeables/Furniture/GloomTorch.cs index 3419772747..04c3af2328 100644 --- a/Items/Placeables/Furniture/GloomTorch.cs +++ b/Items/Placeables/Furniture/GloomTorch.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Placeables.Furniture public override void SetStaticDefaults() { Item.ResearchUnlockCount = 100; - ItemID.Sets.Torches[Item.type] = true; + ItemID.Sets.Torches[Type] = true; ItemID.Sets.SingleUseInGamepad[Type] = true; ItemID.Sets.ShimmerTransformToItem[Type] = ItemID.ShimmerTorch; } @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Placeables.Furniture { CreateRecipe(3). AddIngredient(ItemID.Torch, 3). - AddIngredient(). + AddIngredient(). Register(); } } diff --git a/Items/Placeables/Furniture/Monoliths/AstralProjector.cs b/Items/Placeables/Furniture/Monoliths/AstralProjector.cs index fe85e6806c..7029bff471 100644 --- a/Items/Placeables/Furniture/Monoliths/AstralProjector.cs +++ b/Items/Placeables/Furniture/Monoliths/AstralProjector.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.Monoliths; +using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Tiles.Furniture.Monoliths; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/Furniture/NavyPrismTorch.cs b/Items/Placeables/Furniture/NavyPrismTorch.cs index fec0efd329..2a1684fe1d 100644 --- a/Items/Placeables/Furniture/NavyPrismTorch.cs +++ b/Items/Placeables/Furniture/NavyPrismTorch.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Items.Placeables.SunkenSea; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,9 +12,9 @@ namespace CalamityMod.Items.Placeables.Furniture public override void SetStaticDefaults() { Item.ResearchUnlockCount = 100; - ItemID.Sets.Torches[Item.type] = true; + ItemID.Sets.Torches[Type] = true; ItemID.Sets.SingleUseInGamepad[Type] = true; - ItemID.Sets.WaterTorches[Item.type] = true; + ItemID.Sets.WaterTorches[Type] = true; ItemID.Sets.ShimmerTransformToItem[Type] = ItemID.ShimmerTorch; } diff --git a/Items/Placeables/Furniture/RefractivePrismTorch.cs b/Items/Placeables/Furniture/RefractivePrismTorch.cs index 732ddb12a1..d4ec9f02c9 100644 --- a/Items/Placeables/Furniture/RefractivePrismTorch.cs +++ b/Items/Placeables/Furniture/RefractivePrismTorch.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Items.Placeables.SunkenSea; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,9 +12,9 @@ namespace CalamityMod.Items.Placeables.Furniture public override void SetStaticDefaults() { Item.ResearchUnlockCount = 100; - ItemID.Sets.Torches[Item.type] = true; + ItemID.Sets.Torches[Type] = true; ItemID.Sets.SingleUseInGamepad[Type] = true; - ItemID.Sets.WaterTorches[Item.type] = true; + ItemID.Sets.WaterTorches[Type] = true; ItemID.Sets.ShimmerTransformToItem[Type] = ItemID.ShimmerTorch; } diff --git a/Items/Placeables/Furniture/RepairUnitCage.cs b/Items/Placeables/Furniture/RepairUnitCage.cs new file mode 100644 index 0000000000..5a1ae146c8 --- /dev/null +++ b/Items/Placeables/Furniture/RepairUnitCage.cs @@ -0,0 +1,24 @@ +using CalamityMod.Items.Critters; +using CalamityMod.Tiles.Furniture; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Furniture +{ + public class RepairUnitCage : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(ItemID.Terrarium). + AddIngredient(). + Register(); + } + } +} diff --git a/Items/Placeables/Furniture/RepairUnitCage.png b/Items/Placeables/Furniture/RepairUnitCage.png new file mode 100644 index 0000000000..fc78feb204 Binary files /dev/null and b/Items/Placeables/Furniture/RepairUnitCage.png differ diff --git a/Items/Placeables/Furniture/RustyChest.cs b/Items/Placeables/Furniture/RustyChest.cs index ee1489c110..7607d96e02 100644 --- a/Items/Placeables/Furniture/RustyChest.cs +++ b/Items/Placeables/Furniture/RustyChest.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Tiles.Abyss; using Terraria; using Terraria.ID; @@ -16,7 +17,7 @@ namespace CalamityMod.Items.Placeables.Furniture public override void AddRecipes() { CreateRecipe(). - AddIngredient(8). + AddIngredient(8). AddRecipeGroup("IronBar", 2). AddTile(TileID.Anvils). Register(); diff --git a/Items/Placeables/Furniture/SulphurousTorch.cs b/Items/Placeables/Furniture/SulphurousTorch.cs index 2e38cc7bc7..5f72d21b84 100644 --- a/Items/Placeables/Furniture/SulphurousTorch.cs +++ b/Items/Placeables/Furniture/SulphurousTorch.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Items.Placeables.Abyss; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,9 +12,9 @@ namespace CalamityMod.Items.Placeables.Furniture public override void SetStaticDefaults() { Item.ResearchUnlockCount = 100; - ItemID.Sets.Torches[Item.type] = true; + ItemID.Sets.Torches[Type] = true; ItemID.Sets.SingleUseInGamepad[Type] = true; - ItemID.Sets.WaterTorches[Item.type] = true; + ItemID.Sets.WaterTorches[Type] = true; ItemID.Sets.ShimmerTransformToItem[Type] = ItemID.ShimmerTorch; } diff --git a/Items/Placeables/Furniture/TranquilityCandle.cs b/Items/Placeables/Furniture/TranquilityCandle.cs index f5be23faad..9ea3feb14a 100644 --- a/Items/Placeables/Furniture/TranquilityCandle.cs +++ b/Items/Placeables/Furniture/TranquilityCandle.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Placeables.Furniture CreateRecipe(). AddIngredient(ItemID.PeaceCandle). AddIngredient(). - AddIngredient(2). + AddIngredient(2). AddTile(TileID.WorkBenches). Register(); } diff --git a/Items/Placeables/FurnitureAbyss/AbyssTorch.cs b/Items/Placeables/FurnitureAbyss/AbyssTorch.cs index f0eb32c88b..b30c3a0747 100644 --- a/Items/Placeables/FurnitureAbyss/AbyssTorch.cs +++ b/Items/Placeables/FurnitureAbyss/AbyssTorch.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Abyss; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -12,9 +13,9 @@ namespace CalamityMod.Items.Placeables.FurnitureAbyss public override void SetStaticDefaults() { Item.ResearchUnlockCount = 100; - ItemID.Sets.Torches[Item.type] = true; + ItemID.Sets.Torches[Type] = true; ItemID.Sets.SingleUseInGamepad[Type] = true; - ItemID.Sets.WaterTorches[Item.type] = true; + ItemID.Sets.WaterTorches[Type] = true; ItemID.Sets.ShimmerTransformToItem[Type] = ItemID.ShimmerTorch; } diff --git a/Items/Placeables/FurnitureAbyss/SmoothAbyssGravel.cs b/Items/Placeables/FurnitureAbyss/SmoothAbyssGravel.cs index 9a082c329e..caeabf2d43 100644 --- a/Items/Placeables/FurnitureAbyss/SmoothAbyssGravel.cs +++ b/Items/Placeables/FurnitureAbyss/SmoothAbyssGravel.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.Walls; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureAbyss diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodBathtub.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodBathtub.cs index d0ecf79149..f15a5227ee 100644 --- a/Items/Placeables/FurnitureAcidwood/AcidwoodBathtub.cs +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodBathtub.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.FurnitureAcidwood; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Tiles.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodBed.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodBed.cs index 988f10830c..e61ccfb84f 100644 --- a/Items/Placeables/FurnitureAcidwood/AcidwoodBed.cs +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodBed.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.FurnitureAcidwood; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Tiles.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodBench.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodBench.cs index 4071330ab4..919aea0947 100644 --- a/Items/Placeables/FurnitureAcidwood/AcidwoodBench.cs +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodBench.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.FurnitureAcidwood; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Tiles.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodBookcase.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodBookcase.cs index 70eef1c72c..f2a1521ac5 100644 --- a/Items/Placeables/FurnitureAcidwood/AcidwoodBookcase.cs +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodBookcase.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.FurnitureAcidwood; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Tiles.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodCandelabra.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodCandelabra.cs index fe86619244..fe4ed8718e 100644 --- a/Items/Placeables/FurnitureAcidwood/AcidwoodCandelabra.cs +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodCandelabra.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.FurnitureAcidwood; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Tiles.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodCandle.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodCandle.cs index 848ed712dd..300407d9b5 100644 --- a/Items/Placeables/FurnitureAcidwood/AcidwoodCandle.cs +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodCandle.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.FurnitureAcidwood; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Tiles.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodChair.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodChair.cs index b2df677185..11fadfcaf1 100644 --- a/Items/Placeables/FurnitureAcidwood/AcidwoodChair.cs +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodChair.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.FurnitureAcidwood; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Tiles.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodChandelier.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodChandelier.cs index d64e7c81d4..de95cd8330 100644 --- a/Items/Placeables/FurnitureAcidwood/AcidwoodChandelier.cs +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodChandelier.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.FurnitureAcidwood; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Tiles.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodChest.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodChest.cs index 2f8e9fef6d..241a06a06d 100644 --- a/Items/Placeables/FurnitureAcidwood/AcidwoodChest.cs +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodChest.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.FurnitureAcidwood; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Tiles.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodClock.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodClock.cs index 94878b4a12..02cc1bd896 100644 --- a/Items/Placeables/FurnitureAcidwood/AcidwoodClock.cs +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodClock.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.FurnitureAcidwood; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Tiles.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodDoor.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodDoor.cs index a021463101..a9720a578f 100644 --- a/Items/Placeables/FurnitureAcidwood/AcidwoodDoor.cs +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodDoor.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.FurnitureAcidwood; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Tiles.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodDresser.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodDresser.cs index 13ba1a71a7..37c243a570 100644 --- a/Items/Placeables/FurnitureAcidwood/AcidwoodDresser.cs +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodDresser.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.FurnitureAcidwood; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Tiles.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodLamp.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodLamp.cs index a32a15c207..66fee6755c 100644 --- a/Items/Placeables/FurnitureAcidwood/AcidwoodLamp.cs +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodLamp.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.FurnitureAcidwood; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Tiles.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodLantern.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodLantern.cs index c4deb7ec6c..faab32ce88 100644 --- a/Items/Placeables/FurnitureAcidwood/AcidwoodLantern.cs +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodLantern.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.FurnitureAcidwood; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Tiles.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodPiano.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodPiano.cs index e8593a2878..abee7f866a 100644 --- a/Items/Placeables/FurnitureAcidwood/AcidwoodPiano.cs +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodPiano.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.FurnitureAcidwood; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Tiles.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodPlatform.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodPlatform.cs index b332e363db..82847c538d 100644 --- a/Items/Placeables/FurnitureAcidwood/AcidwoodPlatform.cs +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodPlatform.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.FurnitureAcidwood; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Tiles.FurnitureAcidwood; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodSink.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodSink.cs index 3bb4cc7232..b064681ded 100644 --- a/Items/Placeables/FurnitureAcidwood/AcidwoodSink.cs +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodSink.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.FurnitureAcidwood; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Tiles.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodTable.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodTable.cs index ff18d02967..5caef65bd6 100644 --- a/Items/Placeables/FurnitureAcidwood/AcidwoodTable.cs +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodTable.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.FurnitureAcidwood; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Tiles.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodWorkBench.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodWorkBench.cs index bffd66c887..cf82ea1060 100644 --- a/Items/Placeables/FurnitureAcidwood/AcidwoodWorkBench.cs +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodWorkBench.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.FurnitureAcidwood; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Tiles.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAncient/AncientBasin.cs b/Items/Placeables/FurnitureAncient/AncientBasin.cs index 18dd0b628a..13ce692fbb 100644 --- a/Items/Placeables/FurnitureAncient/AncientBasin.cs +++ b/Items/Placeables/FurnitureAncient/AncientBasin.cs @@ -1,5 +1,6 @@  using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Crags; using CalamityMod.Items.Placeables.Ores; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; diff --git a/Items/Placeables/FurnitureAncient/AncientBathtub.cs b/Items/Placeables/FurnitureAncient/AncientBathtub.cs index eb76046a27..6e4f0a4bf1 100644 --- a/Items/Placeables/FurnitureAncient/AncientBathtub.cs +++ b/Items/Placeables/FurnitureAncient/AncientBathtub.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Crags; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAncient/AncientBed.cs b/Items/Placeables/FurnitureAncient/AncientBed.cs index 37d7186484..09a2cc6c59 100644 --- a/Items/Placeables/FurnitureAncient/AncientBed.cs +++ b/Items/Placeables/FurnitureAncient/AncientBed.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Crags; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAncient/AncientBookcase.cs b/Items/Placeables/FurnitureAncient/AncientBookcase.cs index 2ba7ba30c3..ff4c9d256c 100644 --- a/Items/Placeables/FurnitureAncient/AncientBookcase.cs +++ b/Items/Placeables/FurnitureAncient/AncientBookcase.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Crags; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAncient/AncientChair.cs b/Items/Placeables/FurnitureAncient/AncientChair.cs index 49c098b817..2d72d10df0 100644 --- a/Items/Placeables/FurnitureAncient/AncientChair.cs +++ b/Items/Placeables/FurnitureAncient/AncientChair.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Crags; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAncient/AncientChandelier.cs b/Items/Placeables/FurnitureAncient/AncientChandelier.cs index c6ad85cc05..8868fe6ff2 100644 --- a/Items/Placeables/FurnitureAncient/AncientChandelier.cs +++ b/Items/Placeables/FurnitureAncient/AncientChandelier.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Crags; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAncient/AncientDoor.cs b/Items/Placeables/FurnitureAncient/AncientDoor.cs index d8370b00e5..6182a586f9 100644 --- a/Items/Placeables/FurnitureAncient/AncientDoor.cs +++ b/Items/Placeables/FurnitureAncient/AncientDoor.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Crags; +using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.Tiles.FurnitureAncient; using Terraria; using Terraria.ID; diff --git a/Items/Placeables/FurnitureAncient/AncientDresser.cs b/Items/Placeables/FurnitureAncient/AncientDresser.cs index a5adacc370..7724410586 100644 --- a/Items/Placeables/FurnitureAncient/AncientDresser.cs +++ b/Items/Placeables/FurnitureAncient/AncientDresser.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Crags; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAncient/AncientLamp.cs b/Items/Placeables/FurnitureAncient/AncientLamp.cs index eb34741819..ae71b05abc 100644 --- a/Items/Placeables/FurnitureAncient/AncientLamp.cs +++ b/Items/Placeables/FurnitureAncient/AncientLamp.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Crags; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAncient/AncientLantern.cs b/Items/Placeables/FurnitureAncient/AncientLantern.cs index 22cddfee7a..6dc360c7b1 100644 --- a/Items/Placeables/FurnitureAncient/AncientLantern.cs +++ b/Items/Placeables/FurnitureAncient/AncientLantern.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Crags; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAncient/AncientMonolith.cs b/Items/Placeables/FurnitureAncient/AncientMonolith.cs index 9f0b397c7f..afa334c193 100644 --- a/Items/Placeables/FurnitureAncient/AncientMonolith.cs +++ b/Items/Placeables/FurnitureAncient/AncientMonolith.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Crags; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAncient/AncientPipeOrgan.cs b/Items/Placeables/FurnitureAncient/AncientPipeOrgan.cs index 20da2c7a5c..8b31f31ee6 100644 --- a/Items/Placeables/FurnitureAncient/AncientPipeOrgan.cs +++ b/Items/Placeables/FurnitureAncient/AncientPipeOrgan.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Crags; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAncient/AncientSink.cs b/Items/Placeables/FurnitureAncient/AncientSink.cs index 14ad5c97b1..5c80b977c8 100644 --- a/Items/Placeables/FurnitureAncient/AncientSink.cs +++ b/Items/Placeables/FurnitureAncient/AncientSink.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Crags; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAncient/AncientSofa.cs b/Items/Placeables/FurnitureAncient/AncientSofa.cs index 5d34cf153c..3b3465f326 100644 --- a/Items/Placeables/FurnitureAncient/AncientSofa.cs +++ b/Items/Placeables/FurnitureAncient/AncientSofa.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Crags; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAncient/AncientTable.cs b/Items/Placeables/FurnitureAncient/AncientTable.cs index 82b89c0746..84a5e49443 100644 --- a/Items/Placeables/FurnitureAncient/AncientTable.cs +++ b/Items/Placeables/FurnitureAncient/AncientTable.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Crags; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAncient/AncientWorkBench.cs b/Items/Placeables/FurnitureAncient/AncientWorkBench.cs index 4cdcc747f8..feec1ee3dd 100644 --- a/Items/Placeables/FurnitureAncient/AncientWorkBench.cs +++ b/Items/Placeables/FurnitureAncient/AncientWorkBench.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Crags; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureAshen/AshenBasin.cs b/Items/Placeables/FurnitureAshen/AshenBasin.cs index ffc0d93076..a2cb5e7ae9 100644 --- a/Items/Placeables/FurnitureAshen/AshenBasin.cs +++ b/Items/Placeables/FurnitureAshen/AshenBasin.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Crags; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; diff --git a/Items/Placeables/FurnitureAshen/SmoothBrimstoneSlag.cs b/Items/Placeables/FurnitureAshen/SmoothBrimstoneSlag.cs index 8786ea5a9b..c7eecedacf 100644 --- a/Items/Placeables/FurnitureAshen/SmoothBrimstoneSlag.cs +++ b/Items/Placeables/FurnitureAshen/SmoothBrimstoneSlag.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.Crags; +using CalamityMod.Items.Placeables.Walls; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBathtub.cs b/Items/Placeables/FurnitureEutrophic/EutrophicBathtub.cs index 2fa11d7c65..657e022d09 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicBathtub.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicBathtub.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBed.cs b/Items/Placeables/FurnitureEutrophic/EutrophicBed.cs index 999c49ac2d..dd9074f28f 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicBed.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicBed.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBench.cs b/Items/Placeables/FurnitureEutrophic/EutrophicBench.cs index 2fc5d011a8..20f4da4428 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicBench.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicBench.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBookcase.cs b/Items/Placeables/FurnitureEutrophic/EutrophicBookcase.cs index a346394f2e..6ad2fb84a5 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicBookcase.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicBookcase.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicCandelabra.cs b/Items/Placeables/FurnitureEutrophic/EutrophicCandelabra.cs index 4220cbac83..8351687fae 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicCandelabra.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicCandelabra.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicCandle.cs b/Items/Placeables/FurnitureEutrophic/EutrophicCandle.cs index 4998cfcd03..e159fc7cfc 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicCandle.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicCandle.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicChair.cs b/Items/Placeables/FurnitureEutrophic/EutrophicChair.cs index 40b1deb6d2..6d0b102069 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicChair.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicChair.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicChandelier.cs b/Items/Placeables/FurnitureEutrophic/EutrophicChandelier.cs index ab3713754b..ab029ab282 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicChandelier.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicChandelier.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicChest.cs b/Items/Placeables/FurnitureEutrophic/EutrophicChest.cs index c5e34dc731..eb9f034571 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicChest.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicChest.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicClock.cs b/Items/Placeables/FurnitureEutrophic/EutrophicClock.cs index 33b0605cfe..30bc7622c0 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicClock.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicClock.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicDoor.cs b/Items/Placeables/FurnitureEutrophic/EutrophicDoor.cs index 43f15f26a2..12b9a49e24 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicDoor.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicDoor.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.Tiles.FurnitureEutrophic; using Terraria; using Terraria.ID; diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicDresser.cs b/Items/Placeables/FurnitureEutrophic/EutrophicDresser.cs index af643320e9..cc508f17c8 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicDresser.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicDresser.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicLamp.cs b/Items/Placeables/FurnitureEutrophic/EutrophicLamp.cs index 0fb2eadea3..7b366fb21a 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicLamp.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicLamp.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicLantern.cs b/Items/Placeables/FurnitureEutrophic/EutrophicLantern.cs index 03e767e29a..04a0ff5d2c 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicLantern.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicLantern.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicPiano.cs b/Items/Placeables/FurnitureEutrophic/EutrophicPiano.cs index df5b52f025..40ef588135 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicPiano.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicPiano.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicPlatform.cs b/Items/Placeables/FurnitureEutrophic/EutrophicPlatform.cs index bb2d748a25..f1ccad62a8 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicPlatform.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicPlatform.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicSink.cs b/Items/Placeables/FurnitureEutrophic/EutrophicSink.cs index 7c85ab6a1b..9eab014730 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicSink.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicSink.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicTable.cs b/Items/Placeables/FurnitureEutrophic/EutrophicTable.cs index bb493da495..e615b230a4 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicTable.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicTable.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicWorkBench.cs b/Items/Placeables/FurnitureEutrophic/EutrophicWorkBench.cs index 172d20fd13..74c10dc6db 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicWorkBench.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicWorkBench.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureEutrophic/SmoothNavystone.cs b/Items/Placeables/FurnitureEutrophic/SmoothNavystone.cs index 6dad3d2cee..86aa6623b4 100644 --- a/Items/Placeables/FurnitureEutrophic/SmoothNavystone.cs +++ b/Items/Placeables/FurnitureEutrophic/SmoothNavystone.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Items.Placeables.Walls; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureMarnite/MarniteLight.cs b/Items/Placeables/FurnitureMarnite/MarniteLight.cs index 24c42c360d..4785695df4 100644 --- a/Items/Placeables/FurnitureMarnite/MarniteLight.cs +++ b/Items/Placeables/FurnitureMarnite/MarniteLight.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMarnite public override void SetStaticDefaults() { Item.ResearchUnlockCount = 100; - ItemID.Sets.Torches[Item.type] = true; + ItemID.Sets.Torches[Type] = true; ItemID.Sets.SingleUseInGamepad[Type] = true; ItemID.Sets.ShimmerTransformToItem[Type] = ItemID.ShimmerTorch; } diff --git a/Items/Placeables/FurnitureMonolith/MonolithBathtub.cs b/Items/Placeables/FurnitureMonolith/MonolithBathtub.cs index f2c68bf9cb..180e480867 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithBathtub.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithBathtub.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureMonolith/MonolithBed.cs b/Items/Placeables/FurnitureMonolith/MonolithBed.cs index a4f84c493a..1d333de777 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithBed.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithBed.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureMonolith/MonolithBench.cs b/Items/Placeables/FurnitureMonolith/MonolithBench.cs index 94136a826e..8498b4de74 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithBench.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithBench.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureMonolith/MonolithBookcase.cs b/Items/Placeables/FurnitureMonolith/MonolithBookcase.cs index e694f5eed3..c2c7c915d8 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithBookcase.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithBookcase.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureMonolith/MonolithCandelabra.cs b/Items/Placeables/FurnitureMonolith/MonolithCandelabra.cs index 70e2fa3475..70090c243b 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithCandelabra.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithCandelabra.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureMonolith/MonolithCandle.cs b/Items/Placeables/FurnitureMonolith/MonolithCandle.cs index 0c5bb179c4..f76318e634 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithCandle.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithCandle.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureMonolith/MonolithChair.cs b/Items/Placeables/FurnitureMonolith/MonolithChair.cs index bcc27565f1..25bd448184 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithChair.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithChair.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureMonolith/MonolithChandelier.cs b/Items/Placeables/FurnitureMonolith/MonolithChandelier.cs index 8d6e2c89a4..e3a72a15c7 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithChandelier.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithChandelier.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureMonolith/MonolithChest.cs b/Items/Placeables/FurnitureMonolith/MonolithChest.cs index 2405189128..6192e86422 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithChest.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithChest.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureMonolith/MonolithClock.cs b/Items/Placeables/FurnitureMonolith/MonolithClock.cs index 9b1583e16f..8878384da9 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithClock.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithClock.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureMonolith/MonolithDoor.cs b/Items/Placeables/FurnitureMonolith/MonolithDoor.cs index 19c5df50dc..0f01131333 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithDoor.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithDoor.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.Tiles.FurnitureMonolith; using Terraria; using Terraria.ID; diff --git a/Items/Placeables/FurnitureMonolith/MonolithDresser.cs b/Items/Placeables/FurnitureMonolith/MonolithDresser.cs index 7d966c95fb..1c1d788560 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithDresser.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithDresser.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureMonolith/MonolithLamp.cs b/Items/Placeables/FurnitureMonolith/MonolithLamp.cs index b15b2b5a7b..2b9635cdad 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithLamp.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithLamp.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureMonolith/MonolithLantern.cs b/Items/Placeables/FurnitureMonolith/MonolithLantern.cs index c72ddf5bcb..63692653c1 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithLantern.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithLantern.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureMonolith/MonolithPiano.cs b/Items/Placeables/FurnitureMonolith/MonolithPiano.cs index 65115dbf85..2c6238a177 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithPiano.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithPiano.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureMonolith/MonolithPlatform.cs b/Items/Placeables/FurnitureMonolith/MonolithPlatform.cs index f1b2b745c0..8eca34c5db 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithPlatform.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithPlatform.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.Astral; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureMonolith { diff --git a/Items/Placeables/FurnitureMonolith/MonolithSink.cs b/Items/Placeables/FurnitureMonolith/MonolithSink.cs index de933fbd56..65f6164663 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithSink.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithSink.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureMonolith/MonolithTable.cs b/Items/Placeables/FurnitureMonolith/MonolithTable.cs index 30754391e8..af80d2f04d 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithTable.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithTable.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureMonolith/MonolithWorkBench.cs b/Items/Placeables/FurnitureMonolith/MonolithWorkBench.cs index b42f2c7864..7aab4573e8 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithWorkBench.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithWorkBench.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/FurnitureSacrilegious/LargeRitualCandle.cs b/Items/Placeables/FurnitureSacrilegious/LargeRitualCandle.cs index 92aaa77fbc..74b24a6d4a 100644 --- a/Items/Placeables/FurnitureSacrilegious/LargeRitualCandle.cs +++ b/Items/Placeables/FurnitureSacrilegious/LargeRitualCandle.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSacrilegious public new string LocalizationCategory => "Items.Placeables"; public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Placeables/FurnitureSacrilegious/RitualCandle.cs b/Items/Placeables/FurnitureSacrilegious/RitualCandle.cs index f0c443626a..5ce24bbe71 100644 --- a/Items/Placeables/FurnitureSacrilegious/RitualCandle.cs +++ b/Items/Placeables/FurnitureSacrilegious/RitualCandle.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSacrilegious public new string LocalizationCategory => "Items.Placeables"; public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Placeables/FurnitureSilva/SilvaCrystal.cs b/Items/Placeables/FurnitureSilva/SilvaCrystal.cs index bb540da483..79d182d6b8 100644 --- a/Items/Placeables/FurnitureSilva/SilvaCrystal.cs +++ b/Items/Placeables/FurnitureSilva/SilvaCrystal.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Items.Placeables.Walls; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; diff --git a/Items/Placeables/FurnitureVoid/SmoothVoidstone.cs b/Items/Placeables/FurnitureVoid/SmoothVoidstone.cs index 14456b36ce..cb04839b6b 100644 --- a/Items/Placeables/FurnitureVoid/SmoothVoidstone.cs +++ b/Items/Placeables/FurnitureVoid/SmoothVoidstone.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.Walls; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureVoid diff --git a/Items/Placeables/LivingFire/LivingBrimstoneFireBlock.cs b/Items/Placeables/LivingFire/LivingBrimstoneFireBlock.cs index a21b56610a..bbc82b92d6 100644 --- a/Items/Placeables/LivingFire/LivingBrimstoneFireBlock.cs +++ b/Items/Placeables/LivingFire/LivingBrimstoneFireBlock.cs @@ -1,4 +1,5 @@ -using CalamityMod.Tiles.LivingFire; +using CalamityMod.Items.Placeables.Crags; +using CalamityMod.Tiles.LivingFire; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/Ores/AuricOre.cs b/Items/Placeables/Ores/AuricOre.cs index ec5877fe0f..e4d55a7f3f 100644 --- a/Items/Placeables/Ores/AuricOre.cs +++ b/Items/Placeables/Ores/AuricOre.cs @@ -1,4 +1,5 @@ -using CalamityMod.Rarities; +using CalamityMod.Items.Materials; +using CalamityMod.Rarities; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -20,5 +21,13 @@ namespace CalamityMod.Items.Placeables.Ores Item.value = Item.sellPrice(silver: 50); Item.rare = ModContent.RarityType(); } + + public override void AddRecipes() + { + CreateRecipe(30). + AddIngredient(). + AddCondition(Condition.NearShimmer). + Register(); + } } } diff --git a/Items/Placeables/Plates/Navyplate.cs b/Items/Placeables/Plates/Navyplate.cs index 867d49bd91..f8f52996ed 100644 --- a/Items/Placeables/Plates/Navyplate.cs +++ b/Items/Placeables/Plates/Navyplate.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Items.Placeables.Walls; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Placeables/Basalt.cs b/Items/Placeables/SunkenSea/Basalt.cs similarity index 89% rename from Items/Placeables/Basalt.cs rename to Items/Placeables/SunkenSea/Basalt.cs index aae37b80a0..b6445da5bb 100644 --- a/Items/Placeables/Basalt.cs +++ b/Items/Placeables/SunkenSea/Basalt.cs @@ -1,7 +1,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class Basalt : ModItem, ILocalizedModType { diff --git a/Items/Placeables/Basalt.png b/Items/Placeables/SunkenSea/Basalt.png similarity index 100% rename from Items/Placeables/Basalt.png rename to Items/Placeables/SunkenSea/Basalt.png diff --git a/Items/Placeables/BlackPearlPile.cs b/Items/Placeables/SunkenSea/BlackPearlPile.cs similarity index 93% rename from Items/Placeables/BlackPearlPile.cs rename to Items/Placeables/SunkenSea/BlackPearlPile.cs index 5b3a8c1f7a..e7c6b445ab 100644 --- a/Items/Placeables/BlackPearlPile.cs +++ b/Items/Placeables/SunkenSea/BlackPearlPile.cs @@ -1,7 +1,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class BlackPearlPile : ModItem, ILocalizedModType { diff --git a/Items/Placeables/BlackPearlPile.png b/Items/Placeables/SunkenSea/BlackPearlPile.png similarity index 100% rename from Items/Placeables/BlackPearlPile.png rename to Items/Placeables/SunkenSea/BlackPearlPile.png diff --git a/Items/Placeables/CyanCoral.cs b/Items/Placeables/SunkenSea/CyanCoral.cs similarity index 61% rename from Items/Placeables/CyanCoral.cs rename to Items/Placeables/SunkenSea/CyanCoral.cs index 4bfccca3c5..4cb4280873 100644 --- a/Items/Placeables/CyanCoral.cs +++ b/Items/Placeables/SunkenSea/CyanCoral.cs @@ -1,7 +1,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class CyanCoral : ModItem, ILocalizedModType { @@ -9,20 +9,13 @@ namespace CalamityMod.Items.Placeables public override void SetStaticDefaults() { Item.ResearchUnlockCount = 100; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.rare = ItemRarityID.Blue; } - - //public override void AddRecipes() - //{ - // CreateRecipe(4). - // AddIngredient(ItemID.PinkPearl). - // AddTile(TileID.HeavyWorkBench). - // Register(); - //} } } diff --git a/Items/Placeables/CyanCoral.png b/Items/Placeables/SunkenSea/CyanCoral.png similarity index 100% rename from Items/Placeables/CyanCoral.png rename to Items/Placeables/SunkenSea/CyanCoral.png diff --git a/Items/Placeables/Driftwood.cs b/Items/Placeables/SunkenSea/Driftwood.cs similarity index 88% rename from Items/Placeables/Driftwood.cs rename to Items/Placeables/SunkenSea/Driftwood.cs index cf33c1a90a..2d9e38b5ca 100644 --- a/Items/Placeables/Driftwood.cs +++ b/Items/Placeables/SunkenSea/Driftwood.cs @@ -1,7 +1,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class Driftwood : ModItem, ILocalizedModType { @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Placeables public override void AddRecipes() { CreateRecipe(4). - AddIngredient(4). + AddIngredient(4). AddTile(TileID.WorkBenches). Register(); } diff --git a/Items/Placeables/Driftwood.png b/Items/Placeables/SunkenSea/Driftwood.png similarity index 100% rename from Items/Placeables/Driftwood.png rename to Items/Placeables/SunkenSea/Driftwood.png diff --git a/Items/Placeables/EutrophicGlass.cs b/Items/Placeables/SunkenSea/EutrophicGlass.cs similarity index 93% rename from Items/Placeables/EutrophicGlass.cs rename to Items/Placeables/SunkenSea/EutrophicGlass.cs index 3043e3daef..a8e4e52912 100644 --- a/Items/Placeables/EutrophicGlass.cs +++ b/Items/Placeables/SunkenSea/EutrophicGlass.cs @@ -2,7 +2,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class EutrophicGlass : ModItem, ILocalizedModType { diff --git a/Items/Placeables/EutrophicGlass.png b/Items/Placeables/SunkenSea/EutrophicGlass.png similarity index 100% rename from Items/Placeables/EutrophicGlass.png rename to Items/Placeables/SunkenSea/EutrophicGlass.png diff --git a/Items/Placeables/EutrophicSand.cs b/Items/Placeables/SunkenSea/EutrophicSand.cs similarity index 95% rename from Items/Placeables/EutrophicSand.cs rename to Items/Placeables/SunkenSea/EutrophicSand.cs index 202584c1e0..8a5a228304 100644 --- a/Items/Placeables/EutrophicSand.cs +++ b/Items/Placeables/SunkenSea/EutrophicSand.cs @@ -4,7 +4,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class EutrophicSand : ModItem, ILocalizedModType { diff --git a/Items/Placeables/EutrophicSand.png b/Items/Placeables/SunkenSea/EutrophicSand.png similarity index 100% rename from Items/Placeables/EutrophicSand.png rename to Items/Placeables/SunkenSea/EutrophicSand.png diff --git a/Items/Placeables/HardenedEutrophicSand.cs b/Items/Placeables/SunkenSea/HardenedEutrophicSand.cs similarity index 94% rename from Items/Placeables/HardenedEutrophicSand.cs rename to Items/Placeables/SunkenSea/HardenedEutrophicSand.cs index 1d1bb138df..c950d573fc 100644 --- a/Items/Placeables/HardenedEutrophicSand.cs +++ b/Items/Placeables/SunkenSea/HardenedEutrophicSand.cs @@ -2,7 +2,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class HardenedEutrophicSand : ModItem, ILocalizedModType { diff --git a/Items/Placeables/HardenedEutrophicSand.png b/Items/Placeables/SunkenSea/HardenedEutrophicSand.png similarity index 100% rename from Items/Placeables/HardenedEutrophicSand.png rename to Items/Placeables/SunkenSea/HardenedEutrophicSand.png diff --git a/Items/Placeables/LimeCoral.cs b/Items/Placeables/SunkenSea/LimeCoral.cs similarity index 83% rename from Items/Placeables/LimeCoral.cs rename to Items/Placeables/SunkenSea/LimeCoral.cs index e3dff9e260..eb2122adb7 100644 --- a/Items/Placeables/LimeCoral.cs +++ b/Items/Placeables/SunkenSea/LimeCoral.cs @@ -1,7 +1,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class LimeCoral : ModItem, ILocalizedModType { @@ -9,6 +9,7 @@ namespace CalamityMod.Items.Placeables public override void SetStaticDefaults() { Item.ResearchUnlockCount = 100; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Placeables/LimeCoral.png b/Items/Placeables/SunkenSea/LimeCoral.png similarity index 100% rename from Items/Placeables/LimeCoral.png rename to Items/Placeables/SunkenSea/LimeCoral.png diff --git a/Items/Placeables/Limestone.cs b/Items/Placeables/SunkenSea/Limestone.cs similarity index 89% rename from Items/Placeables/Limestone.cs rename to Items/Placeables/SunkenSea/Limestone.cs index 975f895df5..88880824a8 100644 --- a/Items/Placeables/Limestone.cs +++ b/Items/Placeables/SunkenSea/Limestone.cs @@ -1,7 +1,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class Limestone : ModItem, ILocalizedModType { diff --git a/Items/Placeables/Limestone.png b/Items/Placeables/SunkenSea/Limestone.png similarity index 100% rename from Items/Placeables/Limestone.png rename to Items/Placeables/SunkenSea/Limestone.png diff --git a/Items/Placeables/MagentaCoral.cs b/Items/Placeables/SunkenSea/MagentaCoral.cs similarity index 62% rename from Items/Placeables/MagentaCoral.cs rename to Items/Placeables/SunkenSea/MagentaCoral.cs index 0b0a79d290..02553282f3 100644 --- a/Items/Placeables/MagentaCoral.cs +++ b/Items/Placeables/SunkenSea/MagentaCoral.cs @@ -1,7 +1,7 @@ -using Terraria.ID; +using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class MagentaCoral : ModItem, ILocalizedModType { @@ -9,6 +9,7 @@ namespace CalamityMod.Items.Placeables public override void SetStaticDefaults() { Item.ResearchUnlockCount = 100; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() @@ -16,13 +17,5 @@ namespace CalamityMod.Items.Placeables Item.DefaultToPlaceableTile(ModContent.TileType()); Item.rare = ItemRarityID.Blue; } - - //public override void AddRecipes() - //{ - // CreateRecipe(4). - // AddIngredient(ItemID.PinkPearl). - // AddTile(TileID.HeavyWorkBench). - // Register(); - //} } } diff --git a/Items/Placeables/MagentaCoral.png b/Items/Placeables/SunkenSea/MagentaCoral.png similarity index 100% rename from Items/Placeables/MagentaCoral.png rename to Items/Placeables/SunkenSea/MagentaCoral.png diff --git a/Items/Placeables/Navystone.cs b/Items/Placeables/SunkenSea/Navystone.cs similarity index 95% rename from Items/Placeables/Navystone.cs rename to Items/Placeables/SunkenSea/Navystone.cs index f50663aebf..94dd4597c1 100644 --- a/Items/Placeables/Navystone.cs +++ b/Items/Placeables/SunkenSea/Navystone.cs @@ -3,7 +3,7 @@ using CalamityMod.Items.Placeables.Walls; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class Navystone : ModItem, ILocalizedModType { diff --git a/Items/Placeables/Navystone.png b/Items/Placeables/SunkenSea/Navystone.png similarity index 100% rename from Items/Placeables/Navystone.png rename to Items/Placeables/SunkenSea/Navystone.png diff --git a/Items/Placeables/OrangeCoral.cs b/Items/Placeables/SunkenSea/OrangeCoral.cs similarity index 65% rename from Items/Placeables/OrangeCoral.cs rename to Items/Placeables/SunkenSea/OrangeCoral.cs index 0b98cae62e..02ddc9fdfa 100644 --- a/Items/Placeables/OrangeCoral.cs +++ b/Items/Placeables/SunkenSea/OrangeCoral.cs @@ -1,7 +1,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class OrangeCoral : ModItem, ILocalizedModType { @@ -16,13 +16,5 @@ namespace CalamityMod.Items.Placeables Item.DefaultToPlaceableTile(ModContent.TileType()); Item.rare = ItemRarityID.Blue; } - - //public override void AddRecipes() - //{ - // CreateRecipe(4). - // AddIngredient(ItemID.PinkPearl). - // AddTile(TileID.HeavyWorkBench). - // Register(); - //} } } diff --git a/Items/Placeables/OrangeCoral.png b/Items/Placeables/SunkenSea/OrangeCoral.png similarity index 100% rename from Items/Placeables/OrangeCoral.png rename to Items/Placeables/SunkenSea/OrangeCoral.png diff --git a/Items/Placeables/PinkPearlPile.cs b/Items/Placeables/SunkenSea/PinkPearlPile.cs similarity index 93% rename from Items/Placeables/PinkPearlPile.cs rename to Items/Placeables/SunkenSea/PinkPearlPile.cs index 96b6650ffe..2c29d35fd3 100644 --- a/Items/Placeables/PinkPearlPile.cs +++ b/Items/Placeables/SunkenSea/PinkPearlPile.cs @@ -1,7 +1,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class PinkPearlPile : ModItem, ILocalizedModType { diff --git a/Items/Placeables/PinkPearlPile.png b/Items/Placeables/SunkenSea/PinkPearlPile.png similarity index 100% rename from Items/Placeables/PinkPearlPile.png rename to Items/Placeables/SunkenSea/PinkPearlPile.png diff --git a/Items/Placeables/PolishedNavystoneBrick.cs b/Items/Placeables/SunkenSea/PolishedNavystoneBrick.cs similarity index 93% rename from Items/Placeables/PolishedNavystoneBrick.cs rename to Items/Placeables/SunkenSea/PolishedNavystoneBrick.cs index 73b695c1a0..e0aa52e928 100644 --- a/Items/Placeables/PolishedNavystoneBrick.cs +++ b/Items/Placeables/SunkenSea/PolishedNavystoneBrick.cs @@ -1,7 +1,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class PolishedNavystoneBrick : ModItem, ILocalizedModType { diff --git a/Items/Placeables/PolishedNavystoneBrick.png b/Items/Placeables/SunkenSea/PolishedNavystoneBrick.png similarity index 100% rename from Items/Placeables/PolishedNavystoneBrick.png rename to Items/Placeables/SunkenSea/PolishedNavystoneBrick.png diff --git a/Items/Placeables/PolypSand.cs b/Items/Placeables/SunkenSea/PolypSand.cs similarity index 89% rename from Items/Placeables/PolypSand.cs rename to Items/Placeables/SunkenSea/PolypSand.cs index 6d98291d05..50c699626f 100644 --- a/Items/Placeables/PolypSand.cs +++ b/Items/Placeables/SunkenSea/PolypSand.cs @@ -1,7 +1,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class PolypSand : ModItem, ILocalizedModType { diff --git a/Items/Placeables/PolypSand.png b/Items/Placeables/SunkenSea/PolypSand.png similarity index 100% rename from Items/Placeables/PolypSand.png rename to Items/Placeables/SunkenSea/PolypSand.png diff --git a/Items/Placeables/PrismShard.cs b/Items/Placeables/SunkenSea/PrismShard.cs similarity index 92% rename from Items/Placeables/PrismShard.cs rename to Items/Placeables/SunkenSea/PrismShard.cs index ce06091bc3..9a4907a8a1 100644 --- a/Items/Placeables/PrismShard.cs +++ b/Items/Placeables/SunkenSea/PrismShard.cs @@ -2,7 +2,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class PrismShard : ModItem, ILocalizedModType { diff --git a/Items/Placeables/PrismShard.png b/Items/Placeables/SunkenSea/PrismShard.png similarity index 100% rename from Items/Placeables/PrismShard.png rename to Items/Placeables/SunkenSea/PrismShard.png diff --git a/Items/Placeables/RuneSand.cs b/Items/Placeables/SunkenSea/RuneSand.cs similarity index 91% rename from Items/Placeables/RuneSand.cs rename to Items/Placeables/SunkenSea/RuneSand.cs index 60cd37abac..b5c6ead314 100644 --- a/Items/Placeables/RuneSand.cs +++ b/Items/Placeables/SunkenSea/RuneSand.cs @@ -1,7 +1,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class RuneSand : ModItem, ILocalizedModType { diff --git a/Items/Placeables/RuneSand.png b/Items/Placeables/SunkenSea/RuneSand.png similarity index 100% rename from Items/Placeables/RuneSand.png rename to Items/Placeables/SunkenSea/RuneSand.png diff --git a/Items/Placeables/Runestone.cs b/Items/Placeables/SunkenSea/Runestone.cs similarity index 91% rename from Items/Placeables/Runestone.cs rename to Items/Placeables/SunkenSea/Runestone.cs index 33d7491429..56597556c6 100644 --- a/Items/Placeables/Runestone.cs +++ b/Items/Placeables/SunkenSea/Runestone.cs @@ -4,12 +4,12 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class Runestone : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; - + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 200; diff --git a/Items/Placeables/Runestone.png b/Items/Placeables/SunkenSea/Runestone.png similarity index 100% rename from Items/Placeables/Runestone.png rename to Items/Placeables/SunkenSea/Runestone.png diff --git a/Items/Placeables/SeaPrism.cs b/Items/Placeables/SunkenSea/SeaPrism.cs similarity index 94% rename from Items/Placeables/SeaPrism.cs rename to Items/Placeables/SunkenSea/SeaPrism.cs index 654f7cdf04..855ff7fa4a 100644 --- a/Items/Placeables/SeaPrism.cs +++ b/Items/Placeables/SunkenSea/SeaPrism.cs @@ -2,7 +2,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class SeaPrism : ModItem, ILocalizedModType { diff --git a/Items/Placeables/SeaPrism.png b/Items/Placeables/SunkenSea/SeaPrism.png similarity index 100% rename from Items/Placeables/SeaPrism.png rename to Items/Placeables/SunkenSea/SeaPrism.png diff --git a/Items/Placeables/SeaPrismBrick.cs b/Items/Placeables/SunkenSea/SeaPrismBrick.cs similarity index 93% rename from Items/Placeables/SeaPrismBrick.cs rename to Items/Placeables/SunkenSea/SeaPrismBrick.cs index c6420d949e..d247dbfee9 100644 --- a/Items/Placeables/SeaPrismBrick.cs +++ b/Items/Placeables/SunkenSea/SeaPrismBrick.cs @@ -2,7 +2,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class SeaPrismBrick : ModItem, ILocalizedModType { diff --git a/Items/Placeables/SeaPrismBrick.png b/Items/Placeables/SunkenSea/SeaPrismBrick.png similarity index 100% rename from Items/Placeables/SeaPrismBrick.png rename to Items/Placeables/SunkenSea/SeaPrismBrick.png diff --git a/Items/Placeables/Shellstone.cs b/Items/Placeables/SunkenSea/Shellstone.cs similarity index 75% rename from Items/Placeables/Shellstone.cs rename to Items/Placeables/SunkenSea/Shellstone.cs index 0215e93327..b3eb22c5ba 100644 --- a/Items/Placeables/Shellstone.cs +++ b/Items/Placeables/SunkenSea/Shellstone.cs @@ -1,7 +1,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class Shellstone : ModItem, ILocalizedModType { @@ -9,6 +9,7 @@ namespace CalamityMod.Items.Placeables public override void SetStaticDefaults() { Item.ResearchUnlockCount = 100; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); diff --git a/Items/Placeables/Shellstone.png b/Items/Placeables/SunkenSea/Shellstone.png similarity index 100% rename from Items/Placeables/Shellstone.png rename to Items/Placeables/SunkenSea/Shellstone.png diff --git a/Items/Placeables/ShellstoneSlab.cs b/Items/Placeables/SunkenSea/ShellstoneSlab.cs similarity index 94% rename from Items/Placeables/ShellstoneSlab.cs rename to Items/Placeables/SunkenSea/ShellstoneSlab.cs index 9bdceeac32..6bc1638a75 100644 --- a/Items/Placeables/ShellstoneSlab.cs +++ b/Items/Placeables/SunkenSea/ShellstoneSlab.cs @@ -2,7 +2,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class ShellstoneSlab : ModItem, ILocalizedModType { diff --git a/Items/Placeables/ShellstoneSlab.png b/Items/Placeables/SunkenSea/ShellstoneSlab.png similarity index 100% rename from Items/Placeables/ShellstoneSlab.png rename to Items/Placeables/SunkenSea/ShellstoneSlab.png diff --git a/Items/Placeables/VolcanicSand.cs b/Items/Placeables/SunkenSea/VolcanicSand.cs similarity index 89% rename from Items/Placeables/VolcanicSand.cs rename to Items/Placeables/SunkenSea/VolcanicSand.cs index 7314da2a83..277f746966 100644 --- a/Items/Placeables/VolcanicSand.cs +++ b/Items/Placeables/SunkenSea/VolcanicSand.cs @@ -1,7 +1,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class VolcanicSand : ModItem, ILocalizedModType { diff --git a/Items/Placeables/VolcanicSand.png b/Items/Placeables/SunkenSea/VolcanicSand.png similarity index 100% rename from Items/Placeables/VolcanicSand.png rename to Items/Placeables/SunkenSea/VolcanicSand.png diff --git a/Items/Placeables/WhitePearlPile.cs b/Items/Placeables/SunkenSea/WhitePearlPile.cs similarity index 93% rename from Items/Placeables/WhitePearlPile.cs rename to Items/Placeables/SunkenSea/WhitePearlPile.cs index 95b7a0fdcf..4f33aeaa35 100644 --- a/Items/Placeables/WhitePearlPile.cs +++ b/Items/Placeables/SunkenSea/WhitePearlPile.cs @@ -1,7 +1,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class WhitePearlPile : ModItem, ILocalizedModType { diff --git a/Items/Placeables/WhitePearlPile.png b/Items/Placeables/SunkenSea/WhitePearlPile.png similarity index 100% rename from Items/Placeables/WhitePearlPile.png rename to Items/Placeables/SunkenSea/WhitePearlPile.png diff --git a/Items/Placeables/YellowCoral.cs b/Items/Placeables/SunkenSea/YellowCoral.cs similarity index 65% rename from Items/Placeables/YellowCoral.cs rename to Items/Placeables/SunkenSea/YellowCoral.cs index f9519f68ae..ea25a171e5 100644 --- a/Items/Placeables/YellowCoral.cs +++ b/Items/Placeables/SunkenSea/YellowCoral.cs @@ -1,7 +1,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables +namespace CalamityMod.Items.Placeables.SunkenSea { public class YellowCoral : ModItem, ILocalizedModType { @@ -9,6 +9,7 @@ namespace CalamityMod.Items.Placeables public override void SetStaticDefaults() { Item.ResearchUnlockCount = 100; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() @@ -16,13 +17,5 @@ namespace CalamityMod.Items.Placeables Item.DefaultToPlaceableTile(ModContent.TileType()); Item.rare = ItemRarityID.Blue; } - - //public override void AddRecipes() - //{ - // CreateRecipe(4). - // AddIngredient(ItemID.PinkPearl). - // AddTile(TileID.HeavyWorkBench). - // Register(); - //} } } diff --git a/Items/Placeables/YellowCoral.png b/Items/Placeables/SunkenSea/YellowCoral.png similarity index 100% rename from Items/Placeables/YellowCoral.png rename to Items/Placeables/SunkenSea/YellowCoral.png diff --git a/Items/Placeables/Walls/AbyssGravelWallItem.cs b/Items/Placeables/Walls/AbyssGravelWallItem.cs index eaa9d83473..943045e744 100644 --- a/Items/Placeables/Walls/AbyssGravelWallItem.cs +++ b/Items/Placeables/Walls/AbyssGravelWallItem.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.Abyss; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; diff --git a/Items/Placeables/Walls/AcidwoodWallItem.cs b/Items/Placeables/Walls/AcidwoodWallItem.cs index 3a42c2b7a6..51968f9e81 100644 --- a/Items/Placeables/Walls/AcidwoodWallItem.cs +++ b/Items/Placeables/Walls/AcidwoodWallItem.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.Abyss; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; diff --git a/Items/Placeables/Walls/AstralBrickWall.cs b/Items/Placeables/Walls/AstralBrickWall.cs index fcd3205706..a340aa269f 100644 --- a/Items/Placeables/Walls/AstralBrickWall.cs +++ b/Items/Placeables/Walls/AstralBrickWall.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.Astral; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; diff --git a/Items/Placeables/Walls/AstralDirtWall.cs b/Items/Placeables/Walls/AstralDirtWall.cs index b454f6ef4e..92f04ca230 100644 --- a/Items/Placeables/Walls/AstralDirtWall.cs +++ b/Items/Placeables/Walls/AstralDirtWall.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.Astral; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; diff --git a/Items/Placeables/Walls/AstralIceWall.cs b/Items/Placeables/Walls/AstralIceWall.cs index 11991deb4c..c97435081c 100644 --- a/Items/Placeables/Walls/AstralIceWall.cs +++ b/Items/Placeables/Walls/AstralIceWall.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.Astral; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; diff --git a/Items/Placeables/Walls/AstralMonolithWall.cs b/Items/Placeables/Walls/AstralMonolithWall.cs index 4d009a0718..0066082c69 100644 --- a/Items/Placeables/Walls/AstralMonolithWall.cs +++ b/Items/Placeables/Walls/AstralMonolithWall.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.Astral; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; diff --git a/Items/Placeables/Walls/AstralSandstoneWall.cs b/Items/Placeables/Walls/AstralSandstoneWall.cs index 3dfd479ed0..aba828d058 100644 --- a/Items/Placeables/Walls/AstralSandstoneWall.cs +++ b/Items/Placeables/Walls/AstralSandstoneWall.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.Astral; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; diff --git a/Items/Placeables/Walls/AstralSnowWall.cs b/Items/Placeables/Walls/AstralSnowWall.cs index 53917d5ce1..ad137271ff 100644 --- a/Items/Placeables/Walls/AstralSnowWall.cs +++ b/Items/Placeables/Walls/AstralSnowWall.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.Astral; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; diff --git a/Items/Placeables/Walls/AstralStoneWall.cs b/Items/Placeables/Walls/AstralStoneWall.cs index a6db350d0e..25f2ec002e 100644 --- a/Items/Placeables/Walls/AstralStoneWall.cs +++ b/Items/Placeables/Walls/AstralStoneWall.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.Astral; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; diff --git a/Items/Placeables/Walls/BrimstoneSlabWall.cs b/Items/Placeables/Walls/BrimstoneSlabWall.cs index 2359fe0b8a..5b29cdcb07 100644 --- a/Items/Placeables/Walls/BrimstoneSlabWall.cs +++ b/Items/Placeables/Walls/BrimstoneSlabWall.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.Crags; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; diff --git a/Items/Placeables/Walls/BrimstoneSlagWall.cs b/Items/Placeables/Walls/BrimstoneSlagWall.cs index eb0fed9bda..a2febbce97 100644 --- a/Items/Placeables/Walls/BrimstoneSlagWall.cs +++ b/Items/Placeables/Walls/BrimstoneSlagWall.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.Crags; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; diff --git a/Items/Placeables/Walls/CelestialRemainsWall.cs b/Items/Placeables/Walls/CelestialRemainsWall.cs index 4bbf701b21..b3b8f5dfc0 100644 --- a/Items/Placeables/Walls/CelestialRemainsWall.cs +++ b/Items/Placeables/Walls/CelestialRemainsWall.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.Astral; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; diff --git a/Items/Placeables/Walls/DriftwoodWall.cs b/Items/Placeables/Walls/DriftwoodWall.cs index 7e28e383c9..c7b64eb2fa 100644 --- a/Items/Placeables/Walls/DriftwoodWall.cs +++ b/Items/Placeables/Walls/DriftwoodWall.cs @@ -1,6 +1,7 @@ using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; using Terraria.ID; +using CalamityMod.Items.Placeables.SunkenSea; namespace CalamityMod.Items.Placeables.Walls { diff --git a/Items/Placeables/Walls/EutrophicSandWallSafe.cs b/Items/Placeables/Walls/EutrophicSandWallSafe.cs index b55d374e2a..d1558ba3c6 100644 --- a/Items/Placeables/Walls/EutrophicSandWallSafe.cs +++ b/Items/Placeables/Walls/EutrophicSandWallSafe.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; diff --git a/Items/Placeables/Walls/HardenedAstralSandWall.cs b/Items/Placeables/Walls/HardenedAstralSandWall.cs index 5381859cb8..23e5cebc10 100644 --- a/Items/Placeables/Walls/HardenedAstralSandWall.cs +++ b/Items/Placeables/Walls/HardenedAstralSandWall.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.Astral; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls diff --git a/Items/Placeables/Walls/HardenedSulphurousSandstoneWall.cs b/Items/Placeables/Walls/HardenedSulphurousSandstoneWall.cs index 4da2f33768..402bbd66c5 100644 --- a/Items/Placeables/Walls/HardenedSulphurousSandstoneWall.cs +++ b/Items/Placeables/Walls/HardenedSulphurousSandstoneWall.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.Abyss; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls diff --git a/Items/Placeables/Walls/NavystoneWallSafe.cs b/Items/Placeables/Walls/NavystoneWallSafe.cs index 4b92dae4b0..7dd6ce6ca0 100644 --- a/Items/Placeables/Walls/NavystoneWallSafe.cs +++ b/Items/Placeables/Walls/NavystoneWallSafe.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls diff --git a/Items/Placeables/Walls/PyreMantleWall.cs b/Items/Placeables/Walls/PyreMantleWall.cs index 2ca481451a..b160551007 100644 --- a/Items/Placeables/Walls/PyreMantleWall.cs +++ b/Items/Placeables/Walls/PyreMantleWall.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.Abyss; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls diff --git a/Items/Placeables/Walls/ScorchedBoneWall.cs b/Items/Placeables/Walls/ScorchedBoneWall.cs index e6b65b2262..ee369a5202 100644 --- a/Items/Placeables/Walls/ScorchedBoneWall.cs +++ b/Items/Placeables/Walls/ScorchedBoneWall.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.Crags; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; diff --git a/Items/Placeables/Walls/ShellstoneSlabWall.cs b/Items/Placeables/Walls/ShellstoneSlabWall.cs index 4496d587ef..71a1f34779 100644 --- a/Items/Placeables/Walls/ShellstoneSlabWall.cs +++ b/Items/Placeables/Walls/ShellstoneSlabWall.cs @@ -1,6 +1,7 @@ using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; using Terraria.ID; +using CalamityMod.Items.Placeables.SunkenSea; namespace CalamityMod.Items.Placeables.Walls { diff --git a/Items/Placeables/Walls/SulphurousSandWall.cs b/Items/Placeables/Walls/SulphurousSandWall.cs index 1e65c3f430..a975584667 100644 --- a/Items/Placeables/Walls/SulphurousSandWall.cs +++ b/Items/Placeables/Walls/SulphurousSandWall.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.Abyss; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls diff --git a/Items/Placeables/Walls/SulphurousSandstoneWall.cs b/Items/Placeables/Walls/SulphurousSandstoneWall.cs index e9b4612986..994455af66 100644 --- a/Items/Placeables/Walls/SulphurousSandstoneWall.cs +++ b/Items/Placeables/Walls/SulphurousSandstoneWall.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.Abyss; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls diff --git a/Items/Placeables/Walls/SulphurousShaleWall.cs b/Items/Placeables/Walls/SulphurousShaleWall.cs index 0f1c2955a6..2801be9e26 100644 --- a/Items/Placeables/Walls/SulphurousShaleWall.cs +++ b/Items/Placeables/Walls/SulphurousShaleWall.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.Abyss; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls diff --git a/Items/Placeables/Walls/VoidstoneWall.cs b/Items/Placeables/Walls/VoidstoneWall.cs index e6cc1c0875..fcfb0dfb0b 100644 --- a/Items/Placeables/Walls/VoidstoneWall.cs +++ b/Items/Placeables/Walls/VoidstoneWall.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.Abyss; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls diff --git a/Items/Potions/Alcohol/BloodyMary.cs b/Items/Potions/Alcohol/BloodyMary.cs index 964b55b6ed..1da4570be2 100644 --- a/Items/Potions/Alcohol/BloodyMary.cs +++ b/Items/Potions/Alcohol/BloodyMary.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.Alcohol; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -8,27 +10,28 @@ namespace CalamityMod.Items.Potions.Alcohol public class BloodyMary : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float DamageMovementBoost = 0.1f; + public static int RegenLoss = 4; + public static float DefenseLossPercent = 0.04f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageMovementBoost.ToPercent(), RegenLoss.ToRegenPerSecond(), DefenseLossPercent.ToPercent()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(204, 90, 73), + new Color(168, 37, 37), + new Color(120, 28, 28) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.Lime; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(480f); + Item.DefaultToFood(20, 32, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 80); + Item.rare = ItemRarityID.Lime; } } } diff --git a/Items/Potions/Alcohol/CaribbeanRum.cs b/Items/Potions/Alcohol/CaribbeanRum.cs index fb3b0a0705..f2c945f402 100644 --- a/Items/Potions/Alcohol/CaribbeanRum.cs +++ b/Items/Potions/Alcohol/CaribbeanRum.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.Alcohol; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -8,27 +10,29 @@ namespace CalamityMod.Items.Potions.Alcohol public class CaribbeanRum : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static int RegenBoost = 2; + public static float MoveSpeedBoost = 0.1f; + public static float DefenseLossPercent = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), MoveSpeedBoost.ToPercent(), DefenseLossPercent.ToPercent()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + // Based on the drink itself + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(105, 29, 14), + new Color(128, 39, 22), + new Color(138, 28, 7) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.Lime; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(480f); + Item.DefaultToFood(14, 32, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 60); + Item.rare = ItemRarityID.Lime; } } } diff --git a/Items/Potions/Alcohol/CinnamonRoll.cs b/Items/Potions/Alcohol/CinnamonRoll.cs index 1910bad0c8..e8a3d0146e 100644 --- a/Items/Potions/Alcohol/CinnamonRoll.cs +++ b/Items/Potions/Alcohol/CinnamonRoll.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.Alcohol; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -8,27 +10,30 @@ namespace CalamityMod.Items.Potions.Alcohol public class CinnamonRoll : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + // Mana has a stupid formula so it won't go into the tooltip + public static float ManaRegenDelayBonus = 1f; + public static int ManaRegenBonus = 10; + public static float HeatDebuffBoost = 0.5f; + public static float DefenseLossPercent = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((1f + HeatDebuffBoost).ToString(), DefenseLossPercent.ToPercent()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(245, 223, 181), + new Color(222, 186, 147), + new Color(176, 129, 106) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.Yellow; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(480f); + Item.DefaultToFood(18, 32, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(gold: 1); + Item.rare = ItemRarityID.Yellow; } } } diff --git a/Items/Potions/Alcohol/Everclear.cs b/Items/Potions/Alcohol/Everclear.cs index 33e4888e93..fe3fc5721b 100644 --- a/Items/Potions/Alcohol/Everclear.cs +++ b/Items/Potions/Alcohol/Everclear.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.Alcohol; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -8,27 +10,28 @@ namespace CalamityMod.Items.Potions.Alcohol public class Everclear : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float DamageBoost = 0.25f; + public static int RegenLoss = 10; + public static float DefenseLossPercent = 0.30f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), RegenLoss.ToRegenPerSecond(), DefenseLossPercent.ToPercent()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + // Everclear is clear so uhm... yeah? + ItemID.Sets.DrinkParticleColors[Type] = new Color[2] { + new Color(153, 168, 162, 180), + new Color(198, 205, 207, 180) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.Lime; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(60f); + Item.DefaultToFood(14, 42, ModContent.BuffType(), CalamityUtils.MinutesToFrames(1), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 80); + Item.rare = ItemRarityID.Lime; } } } diff --git a/Items/Potions/Alcohol/EvergreenGin.cs b/Items/Potions/Alcohol/EvergreenGin.cs index 0453782cd2..8860ba8c7e 100644 --- a/Items/Potions/Alcohol/EvergreenGin.cs +++ b/Items/Potions/Alcohol/EvergreenGin.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.Alcohol; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -8,27 +10,28 @@ namespace CalamityMod.Items.Potions.Alcohol public class EvergreenGin : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float SicknessWaterDebuffBoost = 0.25f; + public static int RegenLoss = 1; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((1f + SicknessWaterDebuffBoost).ToString(), RegenLoss.ToRegenPerSecond()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + // Pale green-blue + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(201, 248, 248), + new Color(201, 248, 221), + new Color(177, 240, 184) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.Lime; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(480f); + Item.DefaultToFood(18, 32, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 60); + Item.rare = ItemRarityID.Lime; } } } diff --git a/Items/Potions/Alcohol/FabsolsVodka.cs b/Items/Potions/Alcohol/FabsolsVodka.cs index d129b6f23c..258199b35c 100644 --- a/Items/Potions/Alcohol/FabsolsVodka.cs +++ b/Items/Potions/Alcohol/FabsolsVodka.cs @@ -1,8 +1,10 @@ using CalamityMod.Buffs.Alcohol; using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -11,28 +13,27 @@ namespace CalamityMod.Items.Potions.Alcohol { public new string LocalizationCategory => "Items.Potions"; + public static float DamageBoost = 0.08f; + public static float DefenseLossPercent = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), DefenseLossPercent.ToPercent()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(239, 123, 202), + new Color(187, 56, 158), + new Color(165, 47, 255) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.LightRed; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(900f); + Item.DefaultToFood(30, 42, ModContent.BuffType(), CalamityUtils.MinutesToFrames(15), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 30); + Item.rare = ItemRarityID.LightRed; } public override void AddRecipes() diff --git a/Items/Potions/Alcohol/Fireball.cs b/Items/Potions/Alcohol/Fireball.cs index a177520b66..9256f82e69 100644 --- a/Items/Potions/Alcohol/Fireball.cs +++ b/Items/Potions/Alcohol/Fireball.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.Alcohol; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -8,27 +10,27 @@ namespace CalamityMod.Items.Potions.Alcohol public class Fireball : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float HeatDebuffBoost = 0.25f; + public static int RegenLoss = 1; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((1f + HeatDebuffBoost).ToString(), RegenLoss.ToRegenPerSecond()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(245, 171, 22), + new Color(227, 128, 41), + new Color(237, 82, 31) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.LightRed; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(480f); + Item.DefaultToFood(16, 38, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 30); + Item.rare = ItemRarityID.LightRed; } } } diff --git a/Items/Potions/Alcohol/GrapeBeer.cs b/Items/Potions/Alcohol/GrapeBeer.cs index c1462f6d78..8d09cabb05 100644 --- a/Items/Potions/Alcohol/GrapeBeer.cs +++ b/Items/Potions/Alcohol/GrapeBeer.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.Alcohol; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -8,33 +10,32 @@ namespace CalamityMod.Items.Potions.Alcohol public class GrapeBeer : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float DefenseLossPercent = 0.03f; + public static int SecondDuration = 15; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DefenseLossPercent.ToPercent(), SecondDuration); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(36, 2, 41), + new Color(56, 0, 64), + new Color(82, 10, 92) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.LightRed; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.healLife = 100; - Item.healMana = 100; - Item.consumable = true; - Item.potion = true; + Item.DefaultToHealingPotion(12, 28, 100); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 3); + Item.rare = ItemRarityID.LightRed; } public override void OnConsumeItem(Player player) { - player.AddBuff(ModContent.BuffType(), 900); + player.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(SecondDuration)); } } } diff --git a/Items/Potions/Alcohol/Margarita.cs b/Items/Potions/Alcohol/Margarita.cs index 04ebc3f9af..5c1f303342 100644 --- a/Items/Potions/Alcohol/Margarita.cs +++ b/Items/Potions/Alcohol/Margarita.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.Alcohol; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -8,36 +10,34 @@ namespace CalamityMod.Items.Potions.Alcohol public class Margarita : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + public static int BuffType = ModContent.BuffType(); - public static int BuffDuration = 10800; + public static float DefenseLossPercent = 0.06f; + public static int RegenLoss = 1; + public static int MinuteDuration = 3; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DefenseLossPercent.ToPercent(), RegenLoss.ToRegenPerSecond(), MinuteDuration); public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(219, 227, 191), + new Color(186, 189, 147), + new Color(142, 161, 125) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 40; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.Lime; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.potion = true; - Item.healLife = 200; - Item.healMana = 200; + Item.DefaultToHealingPotion(28, 40, 200); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 60); + Item.rare = ItemRarityID.Lime; } public override void OnConsumeItem(Player player) { - player.AddBuff(BuffType, BuffDuration); + player.AddBuff(BuffType, CalamityUtils.MinutesToFrames(MinuteDuration)); } } } diff --git a/Items/Potions/Alcohol/Moonshine.cs b/Items/Potions/Alcohol/Moonshine.cs index 165545297f..dbb903feb1 100644 --- a/Items/Potions/Alcohol/Moonshine.cs +++ b/Items/Potions/Alcohol/Moonshine.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.Alcohol; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -8,27 +10,29 @@ namespace CalamityMod.Items.Potions.Alcohol public class Moonshine : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static int DefenseBoost = 10; + public static float DamageReductionBoost = 0.03f; + public static int RegenLoss = 1; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DefenseBoost, DamageReductionBoost.ToPercent(), RegenLoss.ToRegenPerSecond()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + // Another clear drink + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(237, 237, 218, 128), + new Color(227, 219, 191, 128), + new Color(209, 204, 194, 128) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.Yellow; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(480f); + Item.DefaultToFood(24, 28, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(gold: 1); + Item.rare = ItemRarityID.Yellow; } } } diff --git a/Items/Potions/Alcohol/MoscowMule.cs b/Items/Potions/Alcohol/MoscowMule.cs index 10433f63b9..d679852c11 100644 --- a/Items/Potions/Alcohol/MoscowMule.cs +++ b/Items/Potions/Alcohol/MoscowMule.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.Alcohol; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -8,29 +10,30 @@ namespace CalamityMod.Items.Potions.Alcohol public class MoscowMule : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; - internal static readonly int CritBoost = 3; + + public static float DamageBoost = 0.09f; + public static float KnockbackBoost = 0.5f; + public static int CritBoost = 3; + public static int RegenLoss = 4; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), KnockbackBoost.ToPercent(), CritBoost, RegenLoss.ToRegenPerSecond()); public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + // Pale green with a hint of red + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(194, 252, 192), + new Color(226, 252, 192), + new Color(250, 225, 222) + }; } public override void SetDefaults() { - Item.width = 32; - Item.height = 34; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.Yellow; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(480f); + Item.DefaultToFood(32, 32, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(gold: 1); + Item.rare = ItemRarityID.Yellow; } } } diff --git a/Items/Potions/Alcohol/OddMushroom.cs b/Items/Potions/Alcohol/OddMushroom.cs index f3e1efa5f3..c51fe1cc0f 100644 --- a/Items/Potions/Alcohol/OddMushroom.cs +++ b/Items/Potions/Alcohol/OddMushroom.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.Alcohol; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -8,27 +9,25 @@ namespace CalamityMod.Items.Potions.Alcohol public class OddMushroom : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float DamageBoost = 0.5f; + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + ItemID.Sets.FoodParticleColors[Type] = new Color[3] { + new Color(232, 100, 90), + new Color(230, 215, 117), + new Color(143, 83, 64) + }; } public override void SetDefaults() { - Item.width = 38; - Item.height = 50; - Item.useTurn = true; - Item.maxStack = 9999; - Item.useAnimation = 17; - Item.useTime = 17; - Item.rare = ItemRarityID.LightRed; - Item.useStyle = ItemUseStyleID.EatFood; - Item.UseSound = SoundID.Item2; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(3600f); + Item.DefaultToFood(38, 50, ModContent.BuffType(), CalamityUtils.MinutesToFrames(60)); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(gold: 10); + Item.rare = ItemRarityID.LightRed; } public override void OnConsumeItem(Player player) diff --git a/Items/Potions/Alcohol/OldFashioned.cs b/Items/Potions/Alcohol/OldFashioned.cs index a440396e3d..c6b3f043be 100644 --- a/Items/Potions/Alcohol/OldFashioned.cs +++ b/Items/Potions/Alcohol/OldFashioned.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.Alcohol; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -9,30 +11,26 @@ namespace CalamityMod.Items.Potions.Alcohol { public new string LocalizationCategory => "Items.Potions"; - public static readonly float AccessoryAndSetBonusDamageMultiplier = 1.5f; - public static readonly float DamageStatReduction = 0.25f; + public static readonly float DamageBoostMultiplier = 1.25f; + public static readonly float DamageReductionMultiplier = 0.75f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((DamageBoostMultiplier).ToString("N2"), (DamageReductionMultiplier).ToString("N2")); public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(255, 118, 3), + new Color(255, 200, 82), + new Color(255, 228, 122) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 40; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.Lime; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(360f); + Item.DefaultToFood(30, 38, ModContent.BuffType(), CalamityUtils.MinutesToFrames(6), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 60); + Item.rare = ItemRarityID.Lime; } } } diff --git a/Items/Potions/Alcohol/RedWine.cs b/Items/Potions/Alcohol/RedWine.cs index 06a09a61b2..dda993af15 100644 --- a/Items/Potions/Alcohol/RedWine.cs +++ b/Items/Potions/Alcohol/RedWine.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.Alcohol; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -8,37 +10,38 @@ namespace CalamityMod.Items.Potions.Alcohol public class RedWine : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static int HealValue = 200; + public static int RegenLoss = 1; + public static int SecondDuration = 15; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenLoss.ToRegenPerSecond(), SecondDuration); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(54, 5, 21), + new Color(82, 9, 36), + new Color(105, 4, 29) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.LightRed; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.healLife = 200; - Item.consumable = true; - Item.potion = true; + Item.DefaultToHealingPotion(14, 48, HealValue); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 30); + Item.rare = ItemRarityID.LightRed; } public override void GetHealLife(Player player, bool quickHeal, ref int healValue) { - healValue = player.Calamity().baguette ? 250 : 200; + healValue = player.Calamity().baguette ? Baguette.RedWineBuffedHealValue : HealValue; } public override void OnConsumeItem(Player player) { - player.AddBuff(ModContent.BuffType(), 900); + player.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(SecondDuration)); } } } diff --git a/Items/Potions/Alcohol/Rum.cs b/Items/Potions/Alcohol/Rum.cs index a6ac51a739..242f902bb8 100644 --- a/Items/Potions/Alcohol/Rum.cs +++ b/Items/Potions/Alcohol/Rum.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.Alcohol; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -8,27 +10,28 @@ namespace CalamityMod.Items.Potions.Alcohol public class Rum : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static int RegenBoost = 2; + public static float MoveSpeedBoost = 0.1f; + public static float DefenseLossPercent = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), MoveSpeedBoost.ToPercent(), DefenseLossPercent.ToPercent()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(237, 165, 9), + new Color(247, 219, 54), + new Color(255, 195, 31) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.LightRed; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(480f); + Item.DefaultToFood(24, 26, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 30); + Item.rare = ItemRarityID.LightRed; } } } diff --git a/Items/Potions/Alcohol/Screwdriver.cs b/Items/Potions/Alcohol/Screwdriver.cs index 299d0ff7fb..0efa0d15c7 100644 --- a/Items/Potions/Alcohol/Screwdriver.cs +++ b/Items/Potions/Alcohol/Screwdriver.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.Alcohol; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -8,27 +10,27 @@ namespace CalamityMod.Items.Potions.Alcohol public class Screwdriver : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float PiercingDamageBuff = 0.05f; + public static int RegenLoss = 1; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((1f + PiercingDamageBuff).ToString(), RegenLoss.ToRegenPerSecond()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(225, 84, 33), + new Color(244, 176, 77), + new Color(255, 218, 102) + }; } public override void SetDefaults() { - Item.width = 16; - Item.height = 26; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.LightPurple; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(480f); + Item.DefaultToFood(14, 28, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 40); + Item.rare = ItemRarityID.LightPurple; } } } diff --git a/Items/Potions/Alcohol/StarBeamRye.cs b/Items/Potions/Alcohol/StarBeamRye.cs index f279ce4f8d..4843b084f2 100644 --- a/Items/Potions/Alcohol/StarBeamRye.cs +++ b/Items/Potions/Alcohol/StarBeamRye.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.Alcohol; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -8,27 +10,31 @@ namespace CalamityMod.Items.Potions.Alcohol public class StarBeamRye : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static int MaxManaBoost = 50; + public static float MagicDamageBoost = 0.08f; + public static float ManaCostReduction = 0.1f; + public static float DefenseLossPercent = 0.06f; + public static int RegenLoss = 2; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, MagicDamageBoost.ToPercent(), ManaCostReduction.ToPercent(), DefenseLossPercent.ToPercent(), RegenLoss.ToRegenPerSecond()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + // Dark red-orange + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(89, 18, 10), + new Color(102, 39, 14), + new Color(128, 31, 9) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.Lime; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(480f); + Item.DefaultToFood(20, 34, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 80); + Item.rare = ItemRarityID.Lime; } } } diff --git a/Items/Potions/Alcohol/Tequila.cs b/Items/Potions/Alcohol/Tequila.cs index 3a87ad876d..3f37dbef16 100644 --- a/Items/Potions/Alcohol/Tequila.cs +++ b/Items/Potions/Alcohol/Tequila.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.Alcohol; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -8,29 +10,29 @@ namespace CalamityMod.Items.Potions.Alcohol public class Tequila : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; - internal static readonly int CritBoost = 4; + + public static float KnockbackBoost = 0.1f; + public static int CritBoost = 4; + public static int DefenseBoost = 5; + public static int RegenLoss = 1; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(KnockbackBoost.ToPercent(), CritBoost, DefenseBoost, RegenLoss.ToRegenPerSecond()); public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(163, 110, 10), + new Color(176, 135, 0), + new Color(194, 132, 25) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.LightRed; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(480f); + Item.DefaultToFood(16, 34, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 30); + Item.rare = ItemRarityID.LightRed; } } } diff --git a/Items/Potions/Alcohol/TequilaSunrise.cs b/Items/Potions/Alcohol/TequilaSunrise.cs index c6c181562c..e3447a3ca3 100644 --- a/Items/Potions/Alcohol/TequilaSunrise.cs +++ b/Items/Potions/Alcohol/TequilaSunrise.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.Alcohol; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -8,28 +10,29 @@ namespace CalamityMod.Items.Potions.Alcohol public class TequilaSunrise : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; - internal static readonly int CritBoost = 8; + + public static float KnockbackBoost = 0.2f; + public static int CritBoost = 8; + public static int DefenseBoost = 10; + public static int RegenLoss = 2; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(KnockbackBoost.ToPercent(), CritBoost, DefenseBoost, RegenLoss.ToRegenPerSecond()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(220, 75, 59), + new Color(229, 147, 47), + new Color(255, 190, 76) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.Yellow; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(480f); + Item.DefaultToFood(22, 28, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(gold: 1); + Item.rare = ItemRarityID.Yellow; } } } diff --git a/Items/Potions/Alcohol/Vodka.cs b/Items/Potions/Alcohol/Vodka.cs index 56a28b6ecf..15ceee8de1 100644 --- a/Items/Potions/Alcohol/Vodka.cs +++ b/Items/Potions/Alcohol/Vodka.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.Alcohol; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -8,29 +10,29 @@ namespace CalamityMod.Items.Potions.Alcohol public class Vodka : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; - internal static readonly int CritBoost = 2; + + public static float DamageBoost = 0.06f; + public static int CritBoost = 2; + public static int RegenLoss = 1; + public static float DefenseLossPercent = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost, RegenLoss.ToRegenPerSecond(), DefenseLossPercent.ToPercent()); public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + // Another clear drink + ItemID.Sets.DrinkParticleColors[Type] = new Color[2] { + new Color(219, 219, 208, 180), + new Color(181, 181, 176, 180) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.LightPurple; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(480f); + Item.DefaultToFood(14, 36, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 40); + Item.rare = ItemRarityID.LightPurple; } } } diff --git a/Items/Potions/Alcohol/Whiskey.cs b/Items/Potions/Alcohol/Whiskey.cs index 1b79dd7714..266eb72018 100644 --- a/Items/Potions/Alcohol/Whiskey.cs +++ b/Items/Potions/Alcohol/Whiskey.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.Alcohol; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -8,29 +10,29 @@ namespace CalamityMod.Items.Potions.Alcohol public class Whiskey : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; - internal static readonly int CritBoost = 2; + + public static float DamageBoost = 0.04f; + public static float KnockbackBoost = 0.2f; + public static int CritBoost = 2; + public static float DefenseLossPercent = 5; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), KnockbackBoost.ToPercent(), CritBoost, DefenseLossPercent.ToPercent()); public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(227, 148, 11), + new Color(235, 177, 5), + new Color(250, 190, 12) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.LightRed; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(480f); + Item.DefaultToFood(18, 32, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 30); + Item.rare = ItemRarityID.LightRed; } } } diff --git a/Items/Potions/Alcohol/WhiteWine.cs b/Items/Potions/Alcohol/WhiteWine.cs index be17479df9..6670d64617 100644 --- a/Items/Potions/Alcohol/WhiteWine.cs +++ b/Items/Potions/Alcohol/WhiteWine.cs @@ -1,7 +1,9 @@ using CalamityMod.Buffs.Alcohol; +using Microsoft.Xna.Framework; using Terraria; using Terraria.GameInput; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -9,28 +11,30 @@ namespace CalamityMod.Items.Potions.Alcohol public class WhiteWine : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float MagicDamageBoost = 0.08f; + public static float DefenseLossPercent = 0.06f; + public static int RegenLoss = 2; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MagicDamageBoost.ToPercent(), DefenseLossPercent.ToPercent(), RegenLoss.ToRegenPerSecond()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + // Clear, yellow-green + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(242, 252, 177, 180), + new Color(250, 252, 215, 180), + new Color(228, 245, 181, 180) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.LightPurple; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; + Item.DefaultToFood(14, 44, ModContent.BuffType(), CalamityUtils.MinutesToFrames(5), true); Item.healMana = 300; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(300f); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 40); + Item.rare = ItemRarityID.LightPurple; } public override void OnConsumeItem(Player player) diff --git a/Items/Potions/AnechoicCoating.cs b/Items/Potions/AnechoicCoating.cs index 03b07c7f64..cb8c122a7e 100644 --- a/Items/Potions/AnechoicCoating.cs +++ b/Items/Potions/AnechoicCoating.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -12,22 +13,17 @@ namespace CalamityMod.Items.Potions public override void SetStaticDefaults() { Item.ResearchUnlockCount = 20; + ItemID.Sets.DrinkParticleColors[Type] = new Color[2] { + new Color(118, 182, 199), + new Color(150, 227, 230) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.EatFood; + // How do you even use this? + Item.DefaultToFood(22, 26, ModContent.BuffType(), CalamityUtils.MinutesToFrames(4)); Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(240f); - Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.Blue; } diff --git a/Items/Potions/AstralInjection.cs b/Items/Potions/AstralInjection.cs index 8c308b7d0d..e2bbfbc188 100644 --- a/Items/Potions/AstralInjection.cs +++ b/Items/Potions/AstralInjection.cs @@ -1,8 +1,10 @@ using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions @@ -10,25 +12,23 @@ namespace CalamityMod.Items.Potions public class AstralInjection : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static int ManaPerFrame = 2; + public static int SelfDamage = 5; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ManaPerFrame * 60, SelfDamage); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 30; + ItemID.Sets.DrinkParticleColors[Type] = new Color[2] { + new Color(255, 164, 94), + new Color(109, 242, 196) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(5f); - + Item.DefaultToFood(14, 34, ModContent.BuffType(), CalamityUtils.SecondsToFrames(5), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.Lime; } @@ -36,10 +36,10 @@ namespace CalamityMod.Items.Potions public override void OnConsumeItem(Player player) { player.AddBuff(BuffID.ManaSickness, Player.manaSickTime / 2, true); - player.statLife -= 5; + player.statLife -= SelfDamage; if (Main.myPlayer == player.whoAmI) { - player.HealEffect(-5, true); + player.HealEffect(-SelfDamage, true); } if (player.statLife <= 0) { diff --git a/Items/Potions/AureusCell.cs b/Items/Potions/AureusCell.cs index 14a10bb22e..5878710f40 100644 --- a/Items/Potions/AureusCell.cs +++ b/Items/Potions/AureusCell.cs @@ -1,4 +1,5 @@ -using Terraria; +using Microsoft.Xna.Framework; +using Terraria; using Terraria.GameInput; using Terraria.ID; using Terraria.ModLoader; @@ -12,23 +13,19 @@ namespace CalamityMod.Items.Potions public override void SetStaticDefaults() { Item.ResearchUnlockCount = 20; + ItemID.Sets.FoodParticleColors[Type] = new Color[3] { + new Color(187, 220, 237), + new Color(237, 93, 83), + new Color(123, 99, 130) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.EatFood; + // Eating animation but gulp sound? Sure + Item.DefaultToFood(22, 38, BuffID.MagicPower, CalamityUtils.MinutesToFrames(8)); Item.healMana = 200; Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = BuffID.MagicPower; - Item.buffTime = CalamityUtils.SecondsToFrames(360f); - Item.value = Item.sellPrice(silver: 50); // Based on material cost rather than potion cost Item.rare = ItemRarityID.Lime; } diff --git a/Items/Potions/Baguette.cs b/Items/Potions/Baguette.cs index 406e1e1d26..0009eb0f1c 100644 --- a/Items/Potions/Baguette.cs +++ b/Items/Potions/Baguette.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.Potions; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions @@ -8,29 +10,27 @@ namespace CalamityMod.Items.Potions public class Baguette : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static int RedWineBuffedHealValue = 250; + public static int RedWineBuffedRegenLoss = 4; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RedWineBuffedHealValue, RedWineBuffedRegenLoss.ToRegenPerSecond()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + ItemID.Sets.FoodParticleColors[Type] = new Color[3] { + new Color(231, 137, 159), + new Color(179, 104, 56), + new Color(108, 47, 16) + }; } public override void SetDefaults() { - Item.width = 52; - Item.height = 38; - Item.useTurn = true; - Item.maxStack = 9999; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.EatFood; - Item.UseSound = SoundID.Item2; - Item.consumable = true; - + Item.DefaultToFood(52, 38, BuffID.WellFed, CalamityUtils.MinutesToFrames(5)); Item.value = Item.sellPrice(silver: 1); Item.rare = ItemRarityID.Blue; Item.Calamity().donorItem = true; - - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(300f); } public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) @@ -40,9 +40,9 @@ namespace CalamityMod.Items.Potions public override void OnConsumeItem(Player player) { - //5 minutes for both - player.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(300f)); - player.AddBuff(BuffID.WellFed, CalamityUtils.SecondsToFrames(300f)); + // 5 minutes for both + player.AddBuff(BuffID.WellFed, Item.buffTime); + player.AddBuff(ModContent.BuffType(), Item.buffTime); } public override void AddRecipes() diff --git a/Items/Potions/BlasphemousDonut.cs b/Items/Potions/BlasphemousDonut.cs index 9bf9b9f556..994ceb77fa 100644 --- a/Items/Potions/BlasphemousDonut.cs +++ b/Items/Potions/BlasphemousDonut.cs @@ -1,4 +1,5 @@ -using Terraria; +using Microsoft.Xna.Framework; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,21 +11,15 @@ namespace CalamityMod.Items.Potions public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + ItemID.Sets.FoodParticleColors[Type] = new Color[3] { + new Color(122, 66, 59), + new Color(206, 116, 59), + new Color(198, 153, 113) + }; } public override void SetDefaults() { - Item.width = 40; - Item.height = 26; - Item.maxStack = 9999; - Item.consumable = true; - Item.useAnimation = 17; - Item.useTime = 17; - Item.UseSound = SoundID.Item2; - Item.useStyle = ItemUseStyleID.EatFood; - Item.useTurn = true; - Item.buffType = BuffID.WellFed2; - Item.buffTime = CalamityUtils.SecondsToFrames(3600f); - + Item.DefaultToFood(40, 26, BuffID.WellFed2, CalamityUtils.MinutesToFrames(60)); Item.value = Item.sellPrice(silver: 60); Item.rare = ItemRarityID.Purple; } diff --git a/Items/Potions/BoundingPotion.cs b/Items/Potions/BoundingPotion.cs index 57e6d13131..a5906281fa 100644 --- a/Items/Potions/BoundingPotion.cs +++ b/Items/Potions/BoundingPotion.cs @@ -1,7 +1,9 @@ using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions @@ -9,25 +11,23 @@ namespace CalamityMod.Items.Potions public class BoundingPotion : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float JumpSpeedBoost = 0.25f; + public static float JumpHeightPercentBoost = 0.2f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(JumpSpeedBoost.ToJumpSpeedPercent(), JumpHeightPercentBoost.ToPercent()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 20; + ItemID.Sets.DrinkParticleColors[Type] = new Color[2] { + new Color(213, 255, 226), + new Color(141, 220, 166) + }; } public override void SetDefaults() { - Item.width = 26; - Item.height = 38; - Item.useTurn = true; - Item.maxStack = 9999; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(300f); - + Item.DefaultToFood(26, 38, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.Blue; } diff --git a/Items/Potions/CalciumPotion.cs b/Items/Potions/CalciumPotion.cs index fcd9120b13..407672f6bc 100644 --- a/Items/Potions/CalciumPotion.cs +++ b/Items/Potions/CalciumPotion.cs @@ -1,7 +1,9 @@ using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions @@ -9,33 +11,30 @@ namespace CalamityMod.Items.Potions public class CalciumPotion : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float KnockbackResistance = 0.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(KnockbackResistance.ToPercent()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 20; + ItemID.Sets.DrinkParticleColors[Type] = new Color[2] { + new Color(194, 202, 134), + new Color(149, 144, 86) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(1200f); - + Item.DefaultToFood(18, 30, ModContent.BuffType(), CalamityUtils.MinutesToFrames(20), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.Blue; } public override void AddRecipes() { - CreateRecipe(4). - AddIngredient(ItemID.BottledWater, 4). + CreateRecipe(). + AddIngredient(ItemID.BottledWater). AddIngredient(). AddTile(TileID.Bottles). Register() diff --git a/Items/Potions/CeaselessHungerPotion.cs b/Items/Potions/CeaselessHungerPotion.cs index 897dfa116b..625751c603 100644 --- a/Items/Potions/CeaselessHungerPotion.cs +++ b/Items/Potions/CeaselessHungerPotion.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using CalamityMod.Rarities; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -13,22 +14,16 @@ namespace CalamityMod.Items.Potions public override void SetStaticDefaults() { Item.ResearchUnlockCount = 20; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(12, 18, 28), + new Color(110, 197, 212), + new Color(158, 81, 153) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(10f); - + Item.DefaultToFood(22, 32, ModContent.BuffType(), CalamityUtils.SecondsToFrames(20), true); Item.value = Item.sellPrice(silver: 10); Item.rare = ModContent.RarityType(); } @@ -38,13 +33,12 @@ namespace CalamityMod.Items.Potions CreateRecipe(4). AddIngredient(ItemID.BottledWater, 4). AddIngredient(). - AddIngredient(). AddTile(TileID.AlchemyTable). AddConsumeItemCallback(Recipe.ConsumptionRules.Alchemy). Register(); - CreateRecipe(4). - AddIngredient(ItemID.BottledWater, 4). + CreateRecipe(8). + AddIngredient(ItemID.BottledWater, 8). AddIngredient(10). AddIngredient(). AddTile(TileID.AlchemyTable). diff --git a/Items/Potions/DeliciousMeat.cs b/Items/Potions/DeliciousMeat.cs index ebfb973d48..779c5e8f18 100644 --- a/Items/Potions/DeliciousMeat.cs +++ b/Items/Potions/DeliciousMeat.cs @@ -1,4 +1,5 @@ -using Terraria; +using Microsoft.Xna.Framework; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,21 +11,14 @@ namespace CalamityMod.Items.Potions public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; + ItemID.Sets.FoodParticleColors[Type] = new Color[2] { + new Color(147, 197, 206), + new Color(94, 131, 168), + }; } public override void SetDefaults() { - Item.width = 32; - Item.height = 30; - Item.maxStack = 9999; - Item.consumable = true; - Item.useAnimation = 17; - Item.useTime = 17; - Item.UseSound = SoundID.Item2; - Item.useStyle = ItemUseStyleID.EatFood; - Item.useTurn = true; - Item.buffType = BuffID.WellFed2; - Item.buffTime = CalamityUtils.SecondsToFrames(1800f); - + Item.DefaultToFood(32, 30, BuffID.WellFed2, CalamityUtils.MinutesToFrames(30)); Item.value = Item.buyPrice(silver: 50); // Sold by Archmage Item.rare = ItemRarityID.Pink; } diff --git a/Items/Potions/Fabsoup.cs b/Items/Potions/Fabsoup.cs index e532b991b1..91e98d12c6 100644 --- a/Items/Potions/Fabsoup.cs +++ b/Items/Potions/Fabsoup.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Potions public override void UseItemFrame(Player player) { - int time = CalamityUtils.SecondsToFrames(1980f); // 33 minutes + int time = CalamityUtils.MinutesToFrames(33); if (player.itemAnimation == 180) { player.AddBuff(BuffID.WellFed3, time); diff --git a/Items/Potions/FlaskOfBrimstone.cs b/Items/Potions/FlaskOfBrimstone.cs index 37840d1eec..885fed71c6 100644 --- a/Items/Potions/FlaskOfBrimstone.cs +++ b/Items/Potions/FlaskOfBrimstone.cs @@ -1,6 +1,6 @@ using CalamityMod.Buffs.Potions; -using CalamityMod.Items.Fishing.BrimstoneCragCatches; using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -14,22 +14,16 @@ namespace CalamityMod.Items.Potions public override void SetStaticDefaults() { Item.ResearchUnlockCount = 20; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(240, 95, 64), + new Color(227, 52, 68), + new Color(189, 112, 123) + }; } public override void SetDefaults() { - Item.width = 30; - Item.height = 34; - Item.useTurn = true; - Item.maxStack = 9999; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(1200f); - + Item.DefaultToFood(30, 34, ModContent.BuffType(), CalamityUtils.MinutesToFrames(20), true); Item.value = Item.sellPrice(silver: 5); Item.rare = ItemRarityID.LightRed; } diff --git a/Items/Potions/FlaskOfCrumbling.cs b/Items/Potions/FlaskOfCrumbling.cs index 2f3387bda8..6f358b0230 100644 --- a/Items/Potions/FlaskOfCrumbling.cs +++ b/Items/Potions/FlaskOfCrumbling.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -13,22 +14,16 @@ namespace CalamityMod.Items.Potions public override void SetStaticDefaults() { Item.ResearchUnlockCount = 20; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(243, 205, 45), + new Color(192, 97, 38), + new Color(225, 162, 58) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(1200f); - + Item.DefaultToFood(32, 28, ModContent.BuffType(), CalamityUtils.MinutesToFrames(20), true); Item.value = Item.sellPrice(silver: 5); Item.rare = ItemRarityID.LightRed; } diff --git a/Items/Potions/FlaskOfHolyFlames.cs b/Items/Potions/FlaskOfHolyFlames.cs index 1005371092..bb4f4c46e8 100644 --- a/Items/Potions/FlaskOfHolyFlames.cs +++ b/Items/Potions/FlaskOfHolyFlames.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -13,22 +14,16 @@ namespace CalamityMod.Items.Potions public override void SetStaticDefaults() { Item.ResearchUnlockCount = 20; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(252, 23, 23), + new Color(199, 14, 51), + new Color(143, 36, 72) + }; } public override void SetDefaults() { - Item.width = 44; - Item.height = 36; - Item.useTurn = true; - Item.maxStack = 9999; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(1200f); - + Item.DefaultToFood(44, 36, ModContent.BuffType(), CalamityUtils.MinutesToFrames(20), true); Item.value = Item.sellPrice(silver: 5); Item.rare = ItemRarityID.Purple; } diff --git a/Items/Potions/GravityNormalizerPotion.cs b/Items/Potions/GravityNormalizerPotion.cs index f75c469072..e95b3e3898 100644 --- a/Items/Potions/GravityNormalizerPotion.cs +++ b/Items/Potions/GravityNormalizerPotion.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.Potions; using CalamityMod.Items.Fishing.AstralCatches; using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -13,22 +14,16 @@ namespace CalamityMod.Items.Potions public override void SetStaticDefaults() { Item.ResearchUnlockCount = 20; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(255, 164, 94), + new Color(109, 242, 196), + new Color(255, 255, 191) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(480f); - + Item.DefaultToFood(24, 36, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.Lime; } diff --git a/Items/Potions/HadalStew.cs b/Items/Potions/HadalStew.cs index 7cc4e41010..a724a51365 100644 --- a/Items/Potions/HadalStew.cs +++ b/Items/Potions/HadalStew.cs @@ -1,7 +1,8 @@ using System.Collections.Generic; using System.Linq; using CalamityMod.Items.Fishing.BrimstoneCragCatches; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.Localization; @@ -14,30 +15,26 @@ namespace CalamityMod.Items.Potions { public new string LocalizationCategory => "Items.Potions"; public static int BuffType = BuffID.WellFed2; - public static int BuffDuration = 60 * 3600; - public static int SicknessDuration = 50 * 60; + public static int BuffDuration = CalamityUtils.MinutesToFrames(60); + public static int SicknessDuration = CalamityUtils.SecondsToFrames(50); public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(BuffDuration / 3600); public override void SetStaticDefaults() { Item.ResearchUnlockCount = 30; + // Even though this uses the drinking animation, it does not use DrinkParticleColors + // This is so that dusts fly out (like Bowl of Soup) instead of drip down (like Apple Juice) + ItemID.Sets.FoodParticleColors[Type] = new Color[4] { + new Color(185, 117, 70), + new Color(214, 98, 44), + new Color(235, 156, 117), + new Color(89, 54, 46) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.potion = true; - Item.healLife = 120; - Item.healMana = 150; - + Item.DefaultToHealingPotion(28, 18, 120); Item.value = Item.sellPrice(silver: 40); Item.rare = ItemRarityID.Green; } diff --git a/Items/Potions/OmegaHealingPotion.cs b/Items/Potions/OmegaHealingPotion.cs index edbc269fc0..a4e28baa46 100644 --- a/Items/Potions/OmegaHealingPotion.cs +++ b/Items/Potions/OmegaHealingPotion.cs @@ -1,6 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Rarities; -using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -13,22 +13,16 @@ namespace CalamityMod.Items.Potions public override void SetStaticDefaults() { Item.ResearchUnlockCount = 30; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(255, 31, 25), + new Color(162, 28, 25), + new Color(159, 10, 111) + }; } public override void SetDefaults() { - Item.width = 24; - Item.height = 32; - Item.useTurn = true; - Item.maxStack = 9999; - Item.healLife = 300; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.potion = true; - + Item.DefaultToHealingPotion(24, 32, 300); Item.value = Item.sellPrice(gold: 1); Item.rare = ModContent.RarityType(); } diff --git a/Items/Potions/PhotosynthesisPotion.cs b/Items/Potions/PhotosynthesisPotion.cs index 536a6f4b36..f1dbcd15c1 100644 --- a/Items/Potions/PhotosynthesisPotion.cs +++ b/Items/Potions/PhotosynthesisPotion.cs @@ -1,7 +1,9 @@ using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions @@ -9,25 +11,23 @@ namespace CalamityMod.Items.Potions public class PhotosynthesisPotion : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static int IncreasedHeartHeal = 5; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(IncreasedHeartHeal); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 20; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(246, 235, 143), + new Color(230, 204, 121), + new Color(214, 173, 78) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(480f); - + Item.DefaultToFood(30, 34, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.LightRed; } diff --git a/Items/Potions/PotionofOmniscience.cs b/Items/Potions/PotionofOmniscience.cs index ef6c05b4eb..bc71eddfa1 100644 --- a/Items/Potions/PotionofOmniscience.cs +++ b/Items/Potions/PotionofOmniscience.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -12,22 +13,16 @@ namespace CalamityMod.Items.Potions public override void SetStaticDefaults() { Item.ResearchUnlockCount = 20; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(159, 67, 199), + new Color(176, 147, 243), + new Color(84, 50, 185) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 30; - Item.useTurn = true; - Item.maxStack = 9999; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(900f); - + Item.DefaultToFood(28, 30, ModContent.BuffType(), CalamityUtils.MinutesToFrames(15), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.Orange; } diff --git a/Items/Potions/ShadowPotion.cs b/Items/Potions/ShadowPotion.cs index 711d9e66a9..611ac1c8e6 100644 --- a/Items/Potions/ShadowPotion.cs +++ b/Items/Potions/ShadowPotion.cs @@ -1,8 +1,10 @@ using CalamityMod.Buffs.Potions; using CalamityMod.Items.Fishing.BrimstoneCragCatches; using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions @@ -10,25 +12,23 @@ namespace CalamityMod.Items.Potions public class ShadowPotion : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float StealthRegenBoost = 0.08f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(StealthRegenBoost.ToPercent()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 20; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(45, 45, 45), + new Color(0, 0, 0), + new Color(95, 0, 36) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(480f); - + Item.DefaultToFood(20, 28, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.Orange; } diff --git a/Items/Potions/SoaringPotion.cs b/Items/Potions/SoaringPotion.cs index f83aae8d07..c89f575924 100644 --- a/Items/Potions/SoaringPotion.cs +++ b/Items/Potions/SoaringPotion.cs @@ -1,8 +1,10 @@ using CalamityMod.Buffs.Potions; using CalamityMod.Items.Fishing.SunkenSeaCatches; using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions @@ -10,26 +12,23 @@ namespace CalamityMod.Items.Potions public class SoaringPotion : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float FlightBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(FlightBoost.ToPercent()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 20; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(85, 181, 217), + new Color(190, 237, 232), + new Color(81, 114, 173) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.Orange; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(360f); - + Item.DefaultToFood(30, 30, ModContent.BuffType(), CalamityUtils.MinutesToFrames(6), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.LightRed; } diff --git a/Items/Potions/SulphurskinPotion.cs b/Items/Potions/SulphurskinPotion.cs index 509acbd2a7..82301ec02a 100644 --- a/Items/Potions/SulphurskinPotion.cs +++ b/Items/Potions/SulphurskinPotion.cs @@ -1,7 +1,7 @@ using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Placeables.Abyss; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -14,22 +14,16 @@ namespace CalamityMod.Items.Potions public override void SetStaticDefaults() { Item.ResearchUnlockCount = 20; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(133, 180, 49), + new Color(80, 139, 81), + new Color(117, 95, 133) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(150f); - + Item.DefaultToFood(22, 26, ModContent.BuffType(), CalamityUtils.MinutesToFrames(4), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.Green; } diff --git a/Items/Potions/SupremeHealingPotion.cs b/Items/Potions/SupremeHealingPotion.cs index 83abc7325a..8d2d5d7d74 100644 --- a/Items/Potions/SupremeHealingPotion.cs +++ b/Items/Potions/SupremeHealingPotion.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,22 +12,16 @@ namespace CalamityMod.Items.Potions public override void SetStaticDefaults() { Item.ResearchUnlockCount = 30; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(255, 31, 25), + new Color(217, 19, 15), + new Color(255, 0, 221) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.healLife = 250; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.potion = true; - + Item.DefaultToHealingPotion(26, 38, 250); Item.value = Item.sellPrice(silver: 60); Item.rare = ItemRarityID.Purple; } diff --git a/Items/Potions/SupremeManaPotion.cs b/Items/Potions/SupremeManaPotion.cs index f768e6e58d..d01a3e3283 100644 --- a/Items/Potions/SupremeManaPotion.cs +++ b/Items/Potions/SupremeManaPotion.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,21 +12,17 @@ namespace CalamityMod.Items.Potions public override void SetStaticDefaults() { Item.ResearchUnlockCount = 30; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(0, 255, 250), + new Color(26, 117, 177), + new Color(160, 82, 144) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; + Item.DefaultToFood(34, 38, 0, 0, true); Item.healMana = 400; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.value = Item.sellPrice(silver: 10); Item.rare = ItemRarityID.Purple; } diff --git a/Items/Potions/ZenPotion.cs b/Items/Potions/ZenPotion.cs index 518b710634..905b6f831d 100644 --- a/Items/Potions/ZenPotion.cs +++ b/Items/Potions/ZenPotion.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -12,23 +13,16 @@ namespace CalamityMod.Items.Potions public override void SetStaticDefaults() { Item.ResearchUnlockCount = 20; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(216, 230, 236), + new Color(137, 149, 173), + new Color(102, 85, 128) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.Orange; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(900f); - + Item.DefaultToFood(24, 28, ModContent.BuffType(), CalamityUtils.MinutesToFrames(15), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.LightRed; } diff --git a/Items/Potions/ZergPotion.cs b/Items/Potions/ZergPotion.cs index 02cfad7f8c..0d118409f3 100644 --- a/Items/Potions/ZergPotion.cs +++ b/Items/Potions/ZergPotion.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -12,23 +13,16 @@ namespace CalamityMod.Items.Potions public override void SetStaticDefaults() { Item.ResearchUnlockCount = 20; + ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { + new Color(223, 135, 244), + new Color(94, 74, 213), + new Color(156, 217, 246) + }; } public override void SetDefaults() { - Item.width = 28; - Item.height = 18; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.Orange; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(900f); - + Item.DefaultToFood(24, 34, ModContent.BuffType(), CalamityUtils.MinutesToFrames(15), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.LightRed; } diff --git a/Items/RelicOfConvergence.cs b/Items/RelicOfConvergence.cs index 8d433aca1a..8b202e7772 100644 --- a/Items/RelicOfConvergence.cs +++ b/Items/RelicOfConvergence.cs @@ -1,6 +1,7 @@ using CalamityMod.Projectiles.Typeless; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items @@ -8,9 +9,13 @@ namespace CalamityMod.Items public class RelicOfConvergence : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Misc"; + + public static int HealValue = 70; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(HealValue); + public override void SetStaticDefaults() { - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/SummonItems/SandstormsCore.cs b/Items/SummonItems/SandstormsCore.cs index 99f529b2d9..b66a9e07be 100644 --- a/Items/SummonItems/SandstormsCore.cs +++ b/Items/SummonItems/SandstormsCore.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.SummonItems { CreateRecipe(). AddIngredient(ItemID.AncientBattleArmorMaterial, 3). - AddIngredient(). + AddIngredient(). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/SummonItems/Seafood.cs b/Items/SummonItems/Seafood.cs index e70badaba6..fd8d5e04b5 100644 --- a/Items/SummonItems/Seafood.cs +++ b/Items/SummonItems/Seafood.cs @@ -1,6 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Events; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.NPCs.AquaticScourge; using Terraria; using Terraria.ID; diff --git a/Items/Tools/AcidwoodAxe.cs b/Items/Tools/AcidwoodAxe.cs index 301e67b604..681916df76 100644 --- a/Items/Tools/AcidwoodAxe.cs +++ b/Items/Tools/AcidwoodAxe.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Tools/AcidwoodHammer.cs b/Items/Tools/AcidwoodHammer.cs index 52d10ab949..78f5eeb610 100644 --- a/Items/Tools/AcidwoodHammer.cs +++ b/Items/Tools/AcidwoodHammer.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Tools/AcidwoodPickaxe.cs b/Items/Tools/AcidwoodPickaxe.cs index cbe69cf6e6..95630050c4 100644 --- a/Items/Tools/AcidwoodPickaxe.cs +++ b/Items/Tools/AcidwoodPickaxe.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Tools/AxeofPurity.cs b/Items/Tools/AxeofPurity.cs index abdf5aa8d7..61320c4c85 100644 --- a/Items/Tools/AxeofPurity.cs +++ b/Items/Tools/AxeofPurity.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Tools public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Tools/BobbitHook.cs b/Items/Tools/BobbitHook.cs index 34c55f4352..d4e9e27084 100644 --- a/Items/Tools/BobbitHook.cs +++ b/Items/Tools/BobbitHook.cs @@ -1,9 +1,8 @@ using CalamityMod.Projectiles.Typeless; using CalamityMod.Rarities; -using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; - using static Terraria.ModLoader.ModContent; namespace CalamityMod.Items.Tools @@ -11,13 +10,20 @@ namespace CalamityMod.Items.Tools public class BobbitHook : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Tools"; + + public static float Reach = 40f; + public static float LaunchSpeed = 25f; + public static float ReelbackSpeed = 28f; + public static float PullSpeed = 24f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(Reach.ToString(), LaunchSpeed.ToString(), ReelbackSpeed.ToString(), PullSpeed.ToString()); + public override void SetDefaults() { // Instead of copying these values, we can clone and modify the ones we want to copy Item.CloneDefaults(ItemID.AmethystHook); Item.width = 30; Item.height = 32; - Item.shootSpeed = BobbitHead.LaunchSpeed; // How quickly the hook is shot. + Item.shootSpeed = LaunchSpeed; // How quickly the hook is shot. Item.shoot = ProjectileType(); Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; Item.rare = RarityType(); diff --git a/Items/Tools/CrystylCrusher.cs b/Items/Tools/CrystylCrusher.cs index 43b4d0a156..a4ad4abbf5 100644 --- a/Items/Tools/CrystylCrusher.cs +++ b/Items/Tools/CrystylCrusher.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Tools public override void SetStaticDefaults() { - Item.staff[Item.type] = true; - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + Item.staff[Type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Tools/DriftwoodAxe.cs b/Items/Tools/DriftwoodAxe.cs index fb4ddd9b78..2d06c0f68f 100644 --- a/Items/Tools/DriftwoodAxe.cs +++ b/Items/Tools/DriftwoodAxe.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/Tools/DriftwoodHammer.cs b/Items/Tools/DriftwoodHammer.cs index 54c8abee9f..2a1917c2e2 100644 --- a/Items/Tools/DriftwoodHammer.cs +++ b/Items/Tools/DriftwoodHammer.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/Tools/DriftwoodPickaxe.cs b/Items/Tools/DriftwoodPickaxe.cs index 60be118203..dbec552f83 100644 --- a/Items/Tools/DriftwoodPickaxe.cs +++ b/Items/Tools/DriftwoodPickaxe.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/Tools/Grax.cs b/Items/Tools/Grax.cs index 05a6a1d354..4c7ee6ea98 100644 --- a/Items/Tools/Grax.cs +++ b/Items/Tools/Grax.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Tools public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Tools/MonolithAxe.cs b/Items/Tools/MonolithAxe.cs index 4764f38ed5..a34af5e678 100644 --- a/Items/Tools/MonolithAxe.cs +++ b/Items/Tools/MonolithAxe.cs @@ -1,5 +1,5 @@ using CalamityMod.Dusts; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Astral; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/Tools/MonolithHammer.cs b/Items/Tools/MonolithHammer.cs index 3b3c1d5443..4c30aa8ccb 100644 --- a/Items/Tools/MonolithHammer.cs +++ b/Items/Tools/MonolithHammer.cs @@ -1,5 +1,5 @@ using CalamityMod.Dusts; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Astral; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/Tools/MonolithPickaxe.cs b/Items/Tools/MonolithPickaxe.cs index 46a436d3ea..5281c45aae 100644 --- a/Items/Tools/MonolithPickaxe.cs +++ b/Items/Tools/MonolithPickaxe.cs @@ -1,5 +1,5 @@ using CalamityMod.Dusts; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Astral; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/Tools/SeismicHampick.cs b/Items/Tools/SeismicHampick.cs index 1146ade1fc..bd4f680f0b 100644 --- a/Items/Tools/SeismicHampick.cs +++ b/Items/Tools/SeismicHampick.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Tools public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/TreasureBags/AquaticScourgeBag.cs b/Items/TreasureBags/AquaticScourgeBag.cs index 052a8aaabd..e3da262a9e 100644 --- a/Items/TreasureBags/AquaticScourgeBag.cs +++ b/Items/TreasureBags/AquaticScourgeBag.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; } public override void SetDefaults() diff --git a/Items/TreasureBags/AstrumAureusBag.cs b/Items/TreasureBags/AstrumAureusBag.cs index 0b3d7925d6..2be1986093 100644 --- a/Items/TreasureBags/AstrumAureusBag.cs +++ b/Items/TreasureBags/AstrumAureusBag.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; } public override void SetDefaults() diff --git a/Items/TreasureBags/AstrumDeusBag.cs b/Items/TreasureBags/AstrumDeusBag.cs index 0edb610266..0f587b880f 100644 --- a/Items/TreasureBags/AstrumDeusBag.cs +++ b/Items/TreasureBags/AstrumDeusBag.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; } public override void SetDefaults() diff --git a/Items/TreasureBags/BrimstoneWaifuBag.cs b/Items/TreasureBags/BrimstoneWaifuBag.cs index 124589d49e..ddf95fe025 100644 --- a/Items/TreasureBags/BrimstoneWaifuBag.cs +++ b/Items/TreasureBags/BrimstoneWaifuBag.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; } public override void SetDefaults() @@ -67,9 +67,9 @@ namespace CalamityMod.Items.TreasureBags { ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType() + ModContent.ItemType(), + ModContent.ItemType() })); - itemLoot.Add(ModContent.ItemType(), 10); // Equipment itemLoot.Add(DropHelper.CalamityStyle(DropHelper.BagWeaponDropRateFraction, new int[] diff --git a/Items/TreasureBags/CalamitasCloneBag.cs b/Items/TreasureBags/CalamitasCloneBag.cs index 45454a0eab..7f164abd13 100644 --- a/Items/TreasureBags/CalamitasCloneBag.cs +++ b/Items/TreasureBags/CalamitasCloneBag.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; } public override void SetDefaults() diff --git a/Items/TreasureBags/CalamitasCoffer.cs b/Items/TreasureBags/CalamitasCoffer.cs index 15d59ed0f2..75ec47675e 100644 --- a/Items/TreasureBags/CalamitasCoffer.cs +++ b/Items/TreasureBags/CalamitasCoffer.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; } public override void SetDefaults() diff --git a/Items/TreasureBags/CeaselessVoidBag.cs b/Items/TreasureBags/CeaselessVoidBag.cs index 4b7b168392..cbb29421fd 100644 --- a/Items/TreasureBags/CeaselessVoidBag.cs +++ b/Items/TreasureBags/CeaselessVoidBag.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; } public override void SetDefaults() diff --git a/Items/TreasureBags/CrabulonBag.cs b/Items/TreasureBags/CrabulonBag.cs index 7d913160e9..1f717a1c14 100644 --- a/Items/TreasureBags/CrabulonBag.cs +++ b/Items/TreasureBags/CrabulonBag.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; - ItemID.Sets.PreHardmodeLikeBossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; + ItemID.Sets.PreHardmodeLikeBossBag[Type] = true; } public override void SetDefaults() diff --git a/Items/TreasureBags/CryogenBag.cs b/Items/TreasureBags/CryogenBag.cs index ac76a5f8c3..351bee872a 100644 --- a/Items/TreasureBags/CryogenBag.cs +++ b/Items/TreasureBags/CryogenBag.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; } public override void SetDefaults() diff --git a/Items/TreasureBags/DesertScourgeBag.cs b/Items/TreasureBags/DesertScourgeBag.cs index 4f734a549f..4e757c736e 100644 --- a/Items/TreasureBags/DesertScourgeBag.cs +++ b/Items/TreasureBags/DesertScourgeBag.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; - ItemID.Sets.PreHardmodeLikeBossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; + ItemID.Sets.PreHardmodeLikeBossBag[Type] = true; } public override void SetDefaults() diff --git a/Items/TreasureBags/DevourerofGodsBag.cs b/Items/TreasureBags/DevourerofGodsBag.cs index c4f6fc619f..69241fccc9 100644 --- a/Items/TreasureBags/DevourerofGodsBag.cs +++ b/Items/TreasureBags/DevourerofGodsBag.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; } public override void SetDefaults() diff --git a/Items/TreasureBags/DraedonBag.cs b/Items/TreasureBags/DraedonBag.cs index b8d2456874..d0476dfad3 100644 --- a/Items/TreasureBags/DraedonBag.cs +++ b/Items/TreasureBags/DraedonBag.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; } public override void SetDefaults() diff --git a/Items/TreasureBags/DragonfollyBag.cs b/Items/TreasureBags/DragonfollyBag.cs index 0cccdf84d8..faac94c1ec 100644 --- a/Items/TreasureBags/DragonfollyBag.cs +++ b/Items/TreasureBags/DragonfollyBag.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; } public override void SetDefaults() diff --git a/Items/TreasureBags/HiveMindBag.cs b/Items/TreasureBags/HiveMindBag.cs index 9a8f86fb84..20653b5de2 100644 --- a/Items/TreasureBags/HiveMindBag.cs +++ b/Items/TreasureBags/HiveMindBag.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; - ItemID.Sets.PreHardmodeLikeBossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; + ItemID.Sets.PreHardmodeLikeBossBag[Type] = true; } public override void SetDefaults() diff --git a/Items/TreasureBags/LeviathanBag.cs b/Items/TreasureBags/LeviathanBag.cs index c9b2d66a2f..6b7a0a2073 100644 --- a/Items/TreasureBags/LeviathanBag.cs +++ b/Items/TreasureBags/LeviathanBag.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; } public override void SetDefaults() diff --git a/Items/TreasureBags/MiscGrabBags/FleshyGeode.cs b/Items/TreasureBags/MiscGrabBags/FleshyGeode.cs index 786b8c9f05..061c325af7 100644 --- a/Items/TreasureBags/MiscGrabBags/FleshyGeode.cs +++ b/Items/TreasureBags/MiscGrabBags/FleshyGeode.cs @@ -35,22 +35,22 @@ namespace CalamityMod.Items.TreasureBags.MiscGrabBags { // Different drop rates on Normal and Expert, so define normal first, then expert // 1-3 bars on Normal, 2-3 bars on Expert - // 1-2 cores on Normal, 1-3 cores on Expert + // 1-2 essences on Normal, 1-3 essences on Expert var normalOnly = itemLoot.DefineNormalOnlyDropSet(); normalOnly.Add(ModContent.ItemType(), 1, 1, 3); normalOnly.Add(ModContent.ItemType(), 1, 1, 3); normalOnly.Add(ModContent.ItemType(), 1, 1, 3); - normalOnly.Add(ModContent.ItemType(), 1, 1, 2); - normalOnly.Add(ModContent.ItemType(), 1, 1, 2); - normalOnly.Add(ModContent.ItemType(), 1, 1, 2); + normalOnly.Add(ModContent.ItemType(), 1, 1, 2); + normalOnly.Add(ModContent.ItemType(), 1, 1, 2); + normalOnly.Add(ModContent.ItemType(), 1, 1, 2); var expertPlus = itemLoot.DefineConditionalDropSet(new Conditions.IsExpert()); expertPlus.Add(ModContent.ItemType(), 1, 2, 3); expertPlus.Add(ModContent.ItemType(), 1, 2, 3); expertPlus.Add(ModContent.ItemType(), 1, 2, 3); - expertPlus.Add(ModContent.ItemType(), 1, 1, 3); - expertPlus.Add(ModContent.ItemType(), 1, 1, 3); - expertPlus.Add(ModContent.ItemType(), 1, 1, 3); + expertPlus.Add(ModContent.ItemType(), 1, 1, 3); + expertPlus.Add(ModContent.ItemType(), 1, 1, 3); + expertPlus.Add(ModContent.ItemType(), 1, 1, 3); } } } diff --git a/Items/TreasureBags/MiscGrabBags/NecromanticGeode.cs b/Items/TreasureBags/MiscGrabBags/NecromanticGeode.cs index c1fd5b146b..92fb40a49e 100644 --- a/Items/TreasureBags/MiscGrabBags/NecromanticGeode.cs +++ b/Items/TreasureBags/MiscGrabBags/NecromanticGeode.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.TreasureBags.MiscGrabBags { // Different drop rates on Normal and Expert, so define normal first, then expert // 5-10 bars on Normal, 7-12 bars on Expert - // 1-3 cores on Normal, 2-4 cores on Expert + // 1-3 essences on Normal, 2-4 essences on Expert // 50% chance of life alloy on Normal, 100% on Expert // 33% chance of core of calamity on Normal, 50% on Expert // 100-120 bloodstone on Normal, 120-140 bloodstone on Expert @@ -45,9 +45,9 @@ namespace CalamityMod.Items.TreasureBags.MiscGrabBags normalOnly.Add(ModContent.ItemType(), 1, 5, 10); normalOnly.Add(ModContent.ItemType(), 1, 5, 10); normalOnly.Add(ModContent.ItemType(), 1, 5, 10); - normalOnly.Add(ModContent.ItemType(), 1, 1, 3); - normalOnly.Add(ModContent.ItemType(), 1, 1, 3); - normalOnly.Add(ModContent.ItemType(), 1, 1, 3); + normalOnly.Add(ModContent.ItemType(), 1, 1, 3); + normalOnly.Add(ModContent.ItemType(), 1, 1, 3); + normalOnly.Add(ModContent.ItemType(), 1, 1, 3); normalOnly.Add(ModContent.ItemType(), 2); normalOnly.Add(ModContent.ItemType(), 3); normalOnly.Add(ModContent.ItemType(), 1, 100, 120); @@ -56,9 +56,9 @@ namespace CalamityMod.Items.TreasureBags.MiscGrabBags expertPlus.Add(ModContent.ItemType(), 1, 7, 12); expertPlus.Add(ModContent.ItemType(), 1, 7, 12); expertPlus.Add(ModContent.ItemType(), 1, 7, 12); - expertPlus.Add(ModContent.ItemType(), 1, 2, 4); - expertPlus.Add(ModContent.ItemType(), 1, 2, 4); - expertPlus.Add(ModContent.ItemType(), 1, 2, 4); + expertPlus.Add(ModContent.ItemType(), 1, 2, 4); + expertPlus.Add(ModContent.ItemType(), 1, 2, 4); + expertPlus.Add(ModContent.ItemType(), 1, 2, 4); expertPlus.Add(ModContent.ItemType()); expertPlus.Add(ModContent.ItemType(), 2); expertPlus.Add(ModContent.ItemType(), 1, 120, 140); diff --git a/Items/TreasureBags/OldDukeBag.cs b/Items/TreasureBags/OldDukeBag.cs index 14c7d1e91d..47629b890c 100644 --- a/Items/TreasureBags/OldDukeBag.cs +++ b/Items/TreasureBags/OldDukeBag.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; } public override void SetDefaults() diff --git a/Items/TreasureBags/PerforatorBag.cs b/Items/TreasureBags/PerforatorBag.cs index 230ebe44c3..51fdf84905 100644 --- a/Items/TreasureBags/PerforatorBag.cs +++ b/Items/TreasureBags/PerforatorBag.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; - ItemID.Sets.PreHardmodeLikeBossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; + ItemID.Sets.PreHardmodeLikeBossBag[Type] = true; } public override void SetDefaults() diff --git a/Items/TreasureBags/PlaguebringerGoliathBag.cs b/Items/TreasureBags/PlaguebringerGoliathBag.cs index 3faa3d015b..4e7ebd141e 100644 --- a/Items/TreasureBags/PlaguebringerGoliathBag.cs +++ b/Items/TreasureBags/PlaguebringerGoliathBag.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; } public override void SetDefaults() diff --git a/Items/TreasureBags/PolterghastBag.cs b/Items/TreasureBags/PolterghastBag.cs index f1516c5f3c..ba7e3de128 100644 --- a/Items/TreasureBags/PolterghastBag.cs +++ b/Items/TreasureBags/PolterghastBag.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; } public override void SetDefaults() diff --git a/Items/TreasureBags/ProvidenceBag.cs b/Items/TreasureBags/ProvidenceBag.cs index 4feb1ba07a..745495da94 100644 --- a/Items/TreasureBags/ProvidenceBag.cs +++ b/Items/TreasureBags/ProvidenceBag.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; } public override void SetDefaults() diff --git a/Items/TreasureBags/RavagerBag.cs b/Items/TreasureBags/RavagerBag.cs index 909b7ac934..3c9c773347 100644 --- a/Items/TreasureBags/RavagerBag.cs +++ b/Items/TreasureBags/RavagerBag.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; } public override void SetDefaults() diff --git a/Items/TreasureBags/SignusBag.cs b/Items/TreasureBags/SignusBag.cs index 32d248e425..fa8df58b4c 100644 --- a/Items/TreasureBags/SignusBag.cs +++ b/Items/TreasureBags/SignusBag.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; } public override void SetDefaults() diff --git a/Items/TreasureBags/SlimeGodBag.cs b/Items/TreasureBags/SlimeGodBag.cs index d14f85068d..ec28535af4 100644 --- a/Items/TreasureBags/SlimeGodBag.cs +++ b/Items/TreasureBags/SlimeGodBag.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; - ItemID.Sets.PreHardmodeLikeBossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; + ItemID.Sets.PreHardmodeLikeBossBag[Type] = true; } public override void SetDefaults() diff --git a/Items/TreasureBags/StormWeaverBag.cs b/Items/TreasureBags/StormWeaverBag.cs index ba26529ae2..d3407462e7 100644 --- a/Items/TreasureBags/StormWeaverBag.cs +++ b/Items/TreasureBags/StormWeaverBag.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; } public override void SetDefaults() @@ -61,9 +61,9 @@ namespace CalamityMod.Items.TreasureBags itemLoot.Add(DropHelper.CalamityStyle(DropHelper.BagWeaponDropRateFraction, new int[] { ModContent.ItemType(), - ModContent.ItemType() + ModContent.ItemType(), + ModContent.ItemType() })); - itemLoot.Add(ModContent.ItemType(), 10); // Equipment itemLoot.AddRevBagAccessories(); diff --git a/Items/TreasureBags/YharonBag.cs b/Items/TreasureBags/YharonBag.cs index e56cc657c5..7e20daf682 100644 --- a/Items/TreasureBags/YharonBag.cs +++ b/Items/TreasureBags/YharonBag.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.TreasureBags public override void SetStaticDefaults() { Item.ResearchUnlockCount = 3; - ItemID.Sets.BossBag[Item.type] = true; + ItemID.Sets.BossBag[Type] = true; } public override void SetDefaults() diff --git a/Items/VanillaArmorChanges/MythrilArmorSetChange.cs b/Items/VanillaArmorChanges/MythrilArmorSetChange.cs index 772fad8a35..0d162d6663 100644 --- a/Items/VanillaArmorChanges/MythrilArmorSetChange.cs +++ b/Items/VanillaArmorChanges/MythrilArmorSetChange.cs @@ -52,7 +52,6 @@ namespace CalamityMod.Items.VanillaArmorChanges owner.Calamity().MythrilFlareSpawnCountdown = FlareFrameSpawnDelay; int flareDamage = CalamityUtils.DamageSoftCap(originalDamage * 0.3, FlareDamageSoftcap); - flareDamage = owner.ApplyArmorAccDamageBonusesTo(flareDamage); Vector2 flareSpawnPosition = victim.Center + Main.rand.NextVector2Circular(10f, 10f); Projectile.NewProjectile(owner.GetSource_ItemUse(owner.ActiveItem()), flareSpawnPosition, Vector2.Zero, ModContent.ProjectileType(), flareDamage, 0f, owner.whoAmI); diff --git a/Items/Weapons/DraedonsArsenal/GalvanizingGlaive.cs b/Items/Weapons/DraedonsArsenal/GalvanizingGlaive.cs index 466317924c..7361d5bda7 100644 --- a/Items/Weapons/DraedonsArsenal/GalvanizingGlaive.cs +++ b/Items/Weapons/DraedonsArsenal/GalvanizingGlaive.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; public override void SetStaticDefaults() { - ItemID.Sets.Spears[Item.type] = true; + ItemID.Sets.Spears[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/DraedonsArsenal/GaussDagger.cs b/Items/Weapons/DraedonsArsenal/GaussDagger.cs index 98c8eac524..e8e51a0954 100644 --- a/Items/Weapons/DraedonsArsenal/GaussDagger.cs +++ b/Items/Weapons/DraedonsArsenal/GaussDagger.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs b/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs index 6bcc75a4ce..8fce78b1c8 100644 --- a/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs +++ b/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public const float HoldoutChargeUse = 0.002f; public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs index 04a8bd9965..544c5818aa 100644 --- a/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs +++ b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/DraedonsArsenal/PulsePistol.cs b/Items/Weapons/DraedonsArsenal/PulsePistol.cs index 14f91533ca..53f707848b 100644 --- a/Items/Weapons/DraedonsArsenal/PulsePistol.cs +++ b/Items/Weapons/DraedonsArsenal/PulsePistol.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/DraedonsArsenal/StarSwallowerContainmentUnit.cs b/Items/Weapons/DraedonsArsenal/StarSwallowerContainmentUnit.cs index a38dc3a714..887a265f2a 100644 --- a/Items/Weapons/DraedonsArsenal/StarSwallowerContainmentUnit.cs +++ b/Items/Weapons/DraedonsArsenal/StarSwallowerContainmentUnit.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/DraedonsArsenal/Taser.cs b/Items/Weapons/DraedonsArsenal/Taser.cs index 5f6d56a6e0..af84e0175b 100644 --- a/Items/Weapons/DraedonsArsenal/Taser.cs +++ b/Items/Weapons/DraedonsArsenal/Taser.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Sounds; using Terraria; diff --git a/Items/Weapons/DraedonsArsenal/TrackingDisk.cs b/Items/Weapons/DraedonsArsenal/TrackingDisk.cs index 812c5471b7..8853f072ea 100644 --- a/Items/Weapons/DraedonsArsenal/TrackingDisk.cs +++ b/Items/Weapons/DraedonsArsenal/TrackingDisk.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; diff --git a/Items/Weapons/Magic/AcidGun.cs b/Items/Weapons/Magic/AcidGun.cs index 9594e9d994..1332539641 100644 --- a/Items/Weapons/Magic/AcidGun.cs +++ b/Items/Weapons/Magic/AcidGun.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Magic/AetherfluxCannon.cs b/Items/Weapons/Magic/AetherfluxCannon.cs index 539b76b5c0..0702204071 100644 --- a/Items/Weapons/Magic/AetherfluxCannon.cs +++ b/Items/Weapons/Magic/AetherfluxCannon.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 spawnPosition = player.RotatedRelativePoint(player.MountedCenter, true); - Projectile.NewProjectileDirect(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, ModContent.ProjectileType(), damage, knockback, player.whoAmI); return false; } diff --git a/Items/Weapons/Magic/AlulaAustralis.cs b/Items/Weapons/Magic/AlulaAustralis.cs index 8cb2b562d2..7211108bdf 100644 --- a/Items/Weapons/Magic/AlulaAustralis.cs +++ b/Items/Weapons/Magic/AlulaAustralis.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/AquamarineStaff.cs b/Items/Weapons/Magic/AquamarineStaff.cs index 509e2dbefe..7169e8f7af 100644 --- a/Items/Weapons/Magic/AquamarineStaff.cs +++ b/Items/Weapons/Magic/AquamarineStaff.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/ArchAmaryllis.cs b/Items/Weapons/Magic/ArchAmaryllis.cs index bbb0031196..33419882b8 100644 --- a/Items/Weapons/Magic/ArchAmaryllis.cs +++ b/Items/Weapons/Magic/ArchAmaryllis.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/AsteroidStaff.cs b/Items/Weapons/Magic/AsteroidStaff.cs index 940eac1a88..78a029f901 100644 --- a/Items/Weapons/Magic/AsteroidStaff.cs +++ b/Items/Weapons/Magic/AsteroidStaff.cs @@ -98,7 +98,7 @@ namespace CalamityMod.Items.Weapons.Magic #endregion public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/AstralStaff.cs b/Items/Weapons/Magic/AstralStaff.cs index 6c2ca3d064..91c599ae57 100644 --- a/Items/Weapons/Magic/AstralStaff.cs +++ b/Items/Weapons/Magic/AstralStaff.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/AstralachneaStaff.cs b/Items/Weapons/Magic/AstralachneaStaff.cs index 7317265a11..8ffa9448aa 100644 --- a/Items/Weapons/Magic/AstralachneaStaff.cs +++ b/Items/Weapons/Magic/AstralachneaStaff.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/Atlantis.cs b/Items/Weapons/Magic/Atlantis.cs index 4181b4fa34..ffa9afe85a 100644 --- a/Items/Weapons/Magic/Atlantis.cs +++ b/Items/Weapons/Magic/Atlantis.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/AuguroftheVoid.cs b/Items/Weapons/Magic/AuguroftheVoid.cs index d8d00fdbc0..d2ef2738fe 100644 --- a/Items/Weapons/Magic/AuguroftheVoid.cs +++ b/Items/Weapons/Magic/AuguroftheVoid.cs @@ -36,27 +36,15 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true); - float mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X; - float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y; - Vector2 tentacleVelocity = new Vector2(mouseXDist, mouseYDist); - tentacleVelocity.Normalize(); - Vector2 tentacleRandVelocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - tentacleRandVelocity.Normalize(); - tentacleVelocity = tentacleVelocity * 6f + tentacleRandVelocity; - tentacleVelocity.Normalize(); - tentacleVelocity *= Item.shootSpeed; - float tentacleYDirection = (float)Main.rand.Next(10, 50) * 0.001f; + Vector2 spreadVelocity = velocity.RotatedByRandom(MathHelper.ToRadians(18f)) * Main.rand.NextFloat(0.8f, 1.2f); + float tentacleYDirection = Main.rand.NextFloat(0.01f, 0.05f); if (Main.rand.NextBool()) - { tentacleYDirection *= -1f; - } - float tentacleXDirection = (float)Main.rand.Next(10, 50) * 0.001f; + float tentacleXDirection = Main.rand.NextFloat(0.01f, 0.05f); if (Main.rand.NextBool()) - { tentacleXDirection *= -1f; - } - Projectile.NewProjectile(source, realPlayerPos, tentacleVelocity, type, damage, knockback, player.whoAmI, tentacleXDirection, tentacleYDirection); + + Projectile.NewProjectile(source, position, spreadVelocity, type, damage, knockback, Main.myPlayer, tentacleXDirection, tentacleYDirection); return false; } @@ -67,7 +55,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(). AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). - AddIngredient(5). + AddIngredient(ItemID.FragmentNebula, 5). AddTile(TileID.Bookcases). Register(); } diff --git a/Items/Weapons/Magic/BloodBath.cs b/Items/Weapons/Magic/BloodBath.cs index dd72089081..5bdcb4e06f 100644 --- a/Items/Weapons/Magic/BloodBath.cs +++ b/Items/Weapons/Magic/BloodBath.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/BrimroseStaff.cs b/Items/Weapons/Magic/BrimroseStaff.cs index 1982fc6d2e..3baf578096 100644 --- a/Items/Weapons/Magic/BrimroseStaff.cs +++ b/Items/Weapons/Magic/BrimroseStaff.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/ChronomancersScythe.cs b/Items/Weapons/Magic/ChronomancersScythe.cs index a872675c83..2902fe0d98 100644 --- a/Items/Weapons/Magic/ChronomancersScythe.cs +++ b/Items/Weapons/Magic/ChronomancersScythe.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() @@ -80,7 +80,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(ItemID.IceSickle). AddIngredient(ItemID.FastClock). AddIngredient(ItemID.LunarBar, 10). - AddIngredient(6). + AddIngredient(6). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Magic/ClamorNoctus.cs b/Items/Weapons/Magic/ClamorNoctus.cs index 73f5b92166..a54e500163 100644 --- a/Items/Weapons/Magic/ClamorNoctus.cs +++ b/Items/Weapons/Magic/ClamorNoctus.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/DarkSpark.cs b/Items/Weapons/Magic/DarkSpark.cs index a865c3c00a..bfb28a081d 100644 --- a/Items/Weapons/Magic/DarkSpark.cs +++ b/Items/Weapons/Magic/DarkSpark.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Magic Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 30f; - Item.UseSound = SoundID.Item13; Item.useStyle = ItemUseStyleID.HoldUp; Item.channel = true; Item.noMelee = true; diff --git a/Items/Weapons/Magic/DeathhailStaff.cs b/Items/Weapons/Magic/DeathhailStaff.cs index cbe31237bb..36dd27dd3b 100644 --- a/Items/Weapons/Magic/DeathhailStaff.cs +++ b/Items/Weapons/Magic/DeathhailStaff.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/DivineRetribution.cs b/Items/Weapons/Magic/DivineRetribution.cs index 0eca7c1c80..2ecc083994 100644 --- a/Items/Weapons/Magic/DivineRetribution.cs +++ b/Items/Weapons/Magic/DivineRetribution.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/Downpour.cs b/Items/Weapons/Magic/Downpour.cs index 871d4a0bbe..0bede5d021 100644 --- a/Items/Weapons/Magic/Downpour.cs +++ b/Items/Weapons/Magic/Downpour.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/EidolonStaff.cs b/Items/Weapons/Magic/EidolonStaff.cs index 45fa1b6e53..f3c14ab5b0 100644 --- a/Items/Weapons/Magic/EidolonStaff.cs +++ b/Items/Weapons/Magic/EidolonStaff.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/EldritchTome.cs b/Items/Weapons/Magic/EldritchTome.cs index 912d223f4b..3021f53ee0 100644 --- a/Items/Weapons/Magic/EldritchTome.cs +++ b/Items/Weapons/Magic/EldritchTome.cs @@ -35,31 +35,15 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int i = Main.myPlayer; - float playerKnockback = knockback; - playerKnockback = player.GetWeaponKnockback(Item, playerKnockback); - player.itemTime = Item.useTime; - Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true); - float mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X; - float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y; - Vector2 tentacleVelocity = new Vector2(mouseXDist, mouseYDist); - tentacleVelocity.Normalize(); - Vector2 tentacleRandVelocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - tentacleRandVelocity.Normalize(); - tentacleVelocity = tentacleVelocity * 4f + tentacleRandVelocity; - tentacleVelocity.Normalize(); - tentacleVelocity *= Item.shootSpeed; - float tentacleYDirection = (float)Main.rand.Next(10, 80) * 0.001f; + Vector2 spreadVelocity = velocity.RotatedByRandom(MathHelper.ToRadians(18f)) * Main.rand.NextFloat(0.8f, 1.2f); + float tentacleYDirection = Main.rand.NextFloat(0.01f, 0.05f); if (Main.rand.NextBool()) - { tentacleYDirection *= -1f; - } - float tentacleXDirection = (float)Main.rand.Next(10, 80) * 0.001f; + float tentacleXDirection = Main.rand.NextFloat(0.01f, 0.05f); if (Main.rand.NextBool()) - { tentacleXDirection *= -1f; - } - Projectile.NewProjectile(source, realPlayerPos, tentacleVelocity, ModContent.ProjectileType(), damage, playerKnockback, i, tentacleXDirection, tentacleYDirection); + + Projectile.NewProjectile(source, position, spreadVelocity, type, damage, knockback, Main.myPlayer, tentacleXDirection, tentacleYDirection); return false; } } diff --git a/Items/Weapons/Magic/Fabstaff.cs b/Items/Weapons/Magic/Fabstaff.cs index 9cf328b813..7fa02f113c 100644 --- a/Items/Weapons/Magic/Fabstaff.cs +++ b/Items/Weapons/Magic/Fabstaff.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/FatesReveal.cs b/Items/Weapons/Magic/FatesReveal.cs index bb490b7a17..26f28c4056 100644 --- a/Items/Weapons/Magic/FatesReveal.cs +++ b/Items/Weapons/Magic/FatesReveal.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/GleamingMagnolia.cs b/Items/Weapons/Magic/GleamingMagnolia.cs index 6ca12ba596..8cc2defd86 100644 --- a/Items/Weapons/Magic/GleamingMagnolia.cs +++ b/Items/Weapons/Magic/GleamingMagnolia.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/HadalUrn.cs b/Items/Weapons/Magic/HadalUrn.cs index 6cda044913..1a30b38322 100644 --- a/Items/Weapons/Magic/HadalUrn.cs +++ b/Items/Weapons/Magic/HadalUrn.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Magic/HeliumFlash.cs b/Items/Weapons/Magic/HeliumFlash.cs index 450f4c08bb..27b31f4a79 100644 --- a/Items/Weapons/Magic/HeliumFlash.cs +++ b/Items/Weapons/Magic/HeliumFlash.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 spawnPosition = player.RotatedRelativePoint(player.MountedCenter, true); - Projectile.NewProjectileDirect(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, ModContent.ProjectileType(), damage, knockback, player.whoAmI); return false; } public override void AddRecipes() diff --git a/Items/Weapons/Magic/HellwingStaff.cs b/Items/Weapons/Magic/HellwingStaff.cs index 8615031997..4e98d6301c 100644 --- a/Items/Weapons/Magic/HellwingStaff.cs +++ b/Items/Weapons/Magic/HellwingStaff.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/Hematemesis.cs b/Items/Weapons/Magic/Hematemesis.cs index 48b331b19b..bd132f898d 100644 --- a/Items/Weapons/Magic/Hematemesis.cs +++ b/Items/Weapons/Magic/Hematemesis.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/HyphaeRod.cs b/Items/Weapons/Magic/HyphaeRod.cs index 30bc37b713..dc7b12a637 100644 --- a/Items/Weapons/Magic/HyphaeRod.cs +++ b/Items/Weapons/Magic/HyphaeRod.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/IcicleStaff.cs b/Items/Weapons/Magic/IcicleStaff.cs index 6e5c822dab..fd481cb380 100644 --- a/Items/Weapons/Magic/IcicleStaff.cs +++ b/Items/Weapons/Magic/IcicleStaff.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/IcicleTrident.cs b/Items/Weapons/Magic/IcicleTrident.cs index 206d0b3632..36fdb84c17 100644 --- a/Items/Weapons/Magic/IcicleTrident.cs +++ b/Items/Weapons/Magic/IcicleTrident.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() { diff --git a/Items/Weapons/Magic/InfernalRift.cs b/Items/Weapons/Magic/InfernalRift.cs index 8938becc5b..98779d3215 100644 --- a/Items/Weapons/Magic/InfernalRift.cs +++ b/Items/Weapons/Magic/InfernalRift.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/MadAlchemistsCocktailGlove.cs b/Items/Weapons/Magic/MadAlchemistsCocktailGlove.cs index 6715bf4deb..c43b45a6c8 100644 --- a/Items/Weapons/Magic/MadAlchemistsCocktailGlove.cs +++ b/Items/Weapons/Magic/MadAlchemistsCocktailGlove.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; flaskIDs = new int[] { ModContent.ProjectileType(), diff --git a/Items/Weapons/Magic/MagneticMeltdown.cs b/Items/Weapons/Magic/MagneticMeltdown.cs index 8d8c3687e5..0e5266cef6 100644 --- a/Items/Weapons/Magic/MagneticMeltdown.cs +++ b/Items/Weapons/Magic/MagneticMeltdown.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/ManaRose.cs b/Items/Weapons/Magic/ManaRose.cs index 898c4af8d1..be441ecf19 100644 --- a/Items/Weapons/Magic/ManaRose.cs +++ b/Items/Weapons/Magic/ManaRose.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/Miasma.cs b/Items/Weapons/Magic/Miasma.cs index dc7200d341..e2d1fb0d40 100644 --- a/Items/Weapons/Magic/Miasma.cs +++ b/Items/Weapons/Magic/Miasma.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/Mistlestorm.cs b/Items/Weapons/Magic/Mistlestorm.cs index 2b5daf1362..17811fcf7d 100644 --- a/Items/Weapons/Magic/Mistlestorm.cs +++ b/Items/Weapons/Magic/Mistlestorm.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/NanoPurge.cs b/Items/Weapons/Magic/NanoPurge.cs index f8b8229c06..f09ce91f00 100644 --- a/Items/Weapons/Magic/NanoPurge.cs +++ b/Items/Weapons/Magic/NanoPurge.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 spawnPosition = player.RotatedRelativePoint(player.MountedCenter, true); - Projectile.NewProjectileDirect(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, ModContent.ProjectileType(), damage, knockback, player.whoAmI); return false; } diff --git a/Items/Weapons/Magic/NightsRay.cs b/Items/Weapons/Magic/NightsRay.cs index 3b767eaa97..d7d5cbaf02 100644 --- a/Items/Weapons/Magic/NightsRay.cs +++ b/Items/Weapons/Magic/NightsRay.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/Nucleosynthesis.cs b/Items/Weapons/Magic/Nucleosynthesis.cs index 4716ae5ff8..e718608ca1 100644 --- a/Items/Weapons/Magic/Nucleosynthesis.cs +++ b/Items/Weapons/Magic/Nucleosynthesis.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() @@ -85,7 +85,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(). AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). - AddIngredient(5). + AddIngredient(ItemID.FragmentNebula, 5). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Magic/ParasiticSceptor.cs b/Items/Weapons/Magic/ParasiticSceptor.cs index 58da009461..3713f53c6e 100644 --- a/Items/Weapons/Magic/ParasiticSceptor.cs +++ b/Items/Weapons/Magic/ParasiticSceptor.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/PhantasmalFury.cs b/Items/Weapons/Magic/PhantasmalFury.cs index 75feb60590..a3d4564a54 100644 --- a/Items/Weapons/Magic/PhantasmalFury.cs +++ b/Items/Weapons/Magic/PhantasmalFury.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() @@ -41,10 +41,10 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectileDirect(source, position + velocity * 13, velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.8f, 1.1f), ModContent.ProjectileType(), damage, 0, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(source, position + velocity * 13, velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.8f, 1.1f), ModContent.ProjectileType(), damage, 0, player.whoAmI); for (int i = 0; i < 2; i++) { - Projectile.NewProjectileDirect(source, position + velocity * 13, velocity.RotatedByRandom(0.4f), ModContent.ProjectileType(), damage / 2, 0, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(source, position + velocity * 13, velocity.RotatedByRandom(0.4f), ModContent.ProjectileType(), damage / 2, 0, player.whoAmI); } for (int i = 0; i < 2; i++) { diff --git a/Items/Weapons/Magic/PhoenixFlameBarrage.cs b/Items/Weapons/Magic/PhoenixFlameBarrage.cs index 5f47966448..1921f78eeb 100644 --- a/Items/Weapons/Magic/PhoenixFlameBarrage.cs +++ b/Items/Weapons/Magic/PhoenixFlameBarrage.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/Photosynthesis.cs b/Items/Weapons/Magic/Photosynthesis.cs index d3bb5f9161..dc4e32d222 100644 --- a/Items/Weapons/Magic/Photosynthesis.cs +++ b/Items/Weapons/Magic/Photosynthesis.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/PlagueStaff.cs b/Items/Weapons/Magic/PlagueStaff.cs index 61462b4e87..c9cd97def5 100644 --- a/Items/Weapons/Magic/PlagueStaff.cs +++ b/Items/Weapons/Magic/PlagueStaff.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/PlasmaRifle.cs b/Items/Weapons/Magic/PlasmaRifle.cs index 82e8ee1d84..a7bb31498f 100644 --- a/Items/Weapons/Magic/PlasmaRifle.cs +++ b/Items/Weapons/Magic/PlasmaRifle.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/PlasmaRod.cs b/Items/Weapons/Magic/PlasmaRod.cs index 11b443fc00..904896c5ae 100644 --- a/Items/Weapons/Magic/PlasmaRod.cs +++ b/Items/Weapons/Magic/PlasmaRod.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/PrimordialEarth.cs b/Items/Weapons/Magic/PrimordialEarth.cs index 16383ffa6f..5b179566c2 100644 --- a/Items/Weapons/Magic/PrimordialEarth.cs +++ b/Items/Weapons/Magic/PrimordialEarth.cs @@ -1,9 +1,8 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Magic; +using CalamityMod.Projectiles.Magic; +using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.DataStructures; -using Microsoft.Xna.Framework; using Terraria.ID; using Terraria.ModLoader; @@ -45,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Magic CreateRecipe(). AddIngredient(). AddIngredient(ItemID.Amber, 5). - AddIngredient(6). + AddIngredient(ItemID.Ectoplasm, 5). AddTile(TileID.Bookcases). Register(); } diff --git a/Items/Weapons/Magic/RecitationoftheBeast.cs b/Items/Weapons/Magic/RecitationoftheBeast.cs index a29dab0d1d..13596c833d 100644 --- a/Items/Weapons/Magic/RecitationoftheBeast.cs +++ b/Items/Weapons/Magic/RecitationoftheBeast.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Weapons.Magic CreateRecipe(). AddIngredient(ItemID.DemonScythe). AddIngredient(6). - AddIngredient(6). + AddIngredient(6). AddTile(TileID.Bookcases). Register(); } diff --git a/Items/Weapons/Magic/SHPC.cs b/Items/Weapons/Magic/SHPC.cs index 05cc5a813e..827f9848e5 100644 --- a/Items/Weapons/Magic/SHPC.cs +++ b/Items/Weapons/Magic/SHPC.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Magic public const float SightHomingRange = 288f; // Range of homing for Sight bombs, in pixels public const int FrightFlatDamage = 20; - public override void SetStaticDefaults() => ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + public override void SetStaticDefaults() => ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; public override void SetDefaults() { diff --git a/Items/Weapons/Magic/SandstreamScepter.cs b/Items/Weapons/Magic/SandstreamScepter.cs index 9f1680230f..2478aed15c 100644 --- a/Items/Weapons/Magic/SandstreamScepter.cs +++ b/Items/Weapons/Magic/SandstreamScepter.cs @@ -13,13 +13,13 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() { - Item.width = 46; - Item.height = 40; + Item.width = 50; + Item.height = 56; Item.damage = 16; Item.DamageType = DamageClass.Magic; Item.mana = 4; diff --git a/Items/Weapons/Magic/SandstreamScepter.png b/Items/Weapons/Magic/SandstreamScepter.png index c85eec12d1..64e58ebf01 100644 Binary files a/Items/Weapons/Magic/SandstreamScepter.png and b/Items/Weapons/Magic/SandstreamScepter.png differ diff --git a/Items/Weapons/Magic/SanguineFlare.cs b/Items/Weapons/Magic/SanguineFlare.cs index 23cb3d0aea..bc7827c338 100644 --- a/Items/Weapons/Magic/SanguineFlare.cs +++ b/Items/Weapons/Magic/SanguineFlare.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/ShaderainStaff.cs b/Items/Weapons/Magic/ShaderainStaff.cs index 7fac680a1f..cb4d8ccff9 100644 --- a/Items/Weapons/Magic/ShaderainStaff.cs +++ b/Items/Weapons/Magic/ShaderainStaff.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/ShadowboltStaff.cs b/Items/Weapons/Magic/ShadowboltStaff.cs index 970fa21d21..d438f5e097 100644 --- a/Items/Weapons/Magic/ShadowboltStaff.cs +++ b/Items/Weapons/Magic/ShadowboltStaff.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/SkyGlaze.cs b/Items/Weapons/Magic/SkyGlaze.cs index 07705ba1b5..a9bc168915 100644 --- a/Items/Weapons/Magic/SkyGlaze.cs +++ b/Items/Weapons/Magic/SkyGlaze.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/SoulPiercer.cs b/Items/Weapons/Magic/SoulPiercer.cs index 6fcc104cb2..c7c48d362a 100644 --- a/Items/Weapons/Magic/SoulPiercer.cs +++ b/Items/Weapons/Magic/SoulPiercer.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/SubsumingVortex.cs b/Items/Weapons/Magic/SubsumingVortex.cs index 59d732f8ad..84db87a52f 100644 --- a/Items/Weapons/Magic/SubsumingVortex.cs +++ b/Items/Weapons/Magic/SubsumingVortex.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/TearsofHeaven.cs b/Items/Weapons/Magic/TearsofHeaven.cs index 142e3a62f1..6e31eef359 100644 --- a/Items/Weapons/Magic/TearsofHeaven.cs +++ b/Items/Weapons/Magic/TearsofHeaven.cs @@ -1,5 +1,4 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; @@ -52,7 +51,7 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(). AddIngredient(ItemID.WaterBolt). AddIngredient(15). - AddIngredient(5). + AddIngredient(ItemID.Ectoplasm, 5). AddTile(TileID.Bookcases). Register(); } diff --git a/Items/Weapons/Magic/Teslastaff.cs b/Items/Weapons/Magic/Teslastaff.cs index 20e732842e..ac23efa9d6 100644 --- a/Items/Weapons/Magic/Teslastaff.cs +++ b/Items/Weapons/Magic/Teslastaff.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Magic CreateRecipe(). AddIngredient(ItemID.ThunderStaff). AddRecipeGroup("AnyCopperBar", 20). - AddIngredient(6). + AddIngredient(6). AddIngredient(3). AddTile(TileID.LunarCraftingStation). Register(); diff --git a/Items/Weapons/Magic/ThePrince.cs b/Items/Weapons/Magic/ThePrince.cs index 5adda2791c..2cf5bc192a 100644 --- a/Items/Weapons/Magic/ThePrince.cs +++ b/Items/Weapons/Magic/ThePrince.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic public const int FlameSplitCount = 6; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/TheWand.cs b/Items/Weapons/Magic/TheWand.cs index 38f0e17b33..cb2dcf2656 100644 --- a/Items/Weapons/Magic/TheWand.cs +++ b/Items/Weapons/Magic/TheWand.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/ThornBlossom.cs b/Items/Weapons/Magic/ThornBlossom.cs index 0fe8425e06..005e22edf6 100644 --- a/Items/Weapons/Magic/ThornBlossom.cs +++ b/Items/Weapons/Magic/ThornBlossom.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/Thunderbolt.cs b/Items/Weapons/Magic/Thunderbolt.cs index 8c3cb34a02..b3dc51c976 100644 --- a/Items/Weapons/Magic/Thunderbolt.cs +++ b/Items/Weapons/Magic/Thunderbolt.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 spawnPosition = player.RotatedRelativePoint(player.MountedCenter, true); - Projectile.NewProjectileDirect(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, type, damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, type, damage, knockback, player.whoAmI); return false; } } diff --git a/Items/Weapons/Magic/UltraLiquidator.cs b/Items/Weapons/Magic/UltraLiquidator.cs index 2eb4625f80..e1c2bd8c05 100644 --- a/Items/Weapons/Magic/UltraLiquidator.cs +++ b/Items/Weapons/Magic/UltraLiquidator.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/UndinesRetribution.cs b/Items/Weapons/Magic/UndinesRetribution.cs index 85490b1564..1ffeebf364 100644 --- a/Items/Weapons/Magic/UndinesRetribution.cs +++ b/Items/Weapons/Magic/UndinesRetribution.cs @@ -1,6 +1,6 @@ using System; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/ValkyrieRay.cs b/Items/Weapons/Magic/ValkyrieRay.cs index 7658454429..9c8c4765fe 100644 --- a/Items/Weapons/Magic/ValkyrieRay.cs +++ b/Items/Weapons/Magic/ValkyrieRay.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/VeeringWind.cs b/Items/Weapons/Magic/VeeringWind.cs index 0e4705aa56..fae81737a1 100644 --- a/Items/Weapons/Magic/VeeringWind.cs +++ b/Items/Weapons/Magic/VeeringWind.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/Vehemence.cs b/Items/Weapons/Magic/Vehemence.cs index f32aa8b0bf..00f8970db7 100644 --- a/Items/Weapons/Magic/Vehemence.cs +++ b/Items/Weapons/Magic/Vehemence.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/VenusianTrident.cs b/Items/Weapons/Magic/VenusianTrident.cs index f4c89dbcc5..407eaf612a 100644 --- a/Items/Weapons/Magic/VenusianTrident.cs +++ b/Items/Weapons/Magic/VenusianTrident.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/Vesuvius.cs b/Items/Weapons/Magic/Vesuvius.cs index 3ed6924f0d..c5095b7d93 100644 --- a/Items/Weapons/Magic/Vesuvius.cs +++ b/Items/Weapons/Magic/Vesuvius.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + Item.staff[Type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/Viscera.cs b/Items/Weapons/Magic/Viscera.cs index f7c221a071..ec75d92d53 100644 --- a/Items/Weapons/Magic/Viscera.cs +++ b/Items/Weapons/Magic/Viscera.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public const int BoomLifetime = 40; diff --git a/Items/Weapons/Magic/VitriolicViper.cs b/Items/Weapons/Magic/VitriolicViper.cs index c576b94de2..d621aee206 100644 --- a/Items/Weapons/Magic/VitriolicViper.cs +++ b/Items/Weapons/Magic/VitriolicViper.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 spawnPosition = player.RotatedRelativePoint(player.MountedCenter, true); - Projectile.NewProjectileDirect(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, type, damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, type, damage, knockback, player.whoAmI); return false; } } diff --git a/Items/Weapons/Magic/VividClarity.cs b/Items/Weapons/Magic/VividClarity.cs index d5f00474c2..19585a3893 100644 --- a/Items/Weapons/Magic/VividClarity.cs +++ b/Items/Weapons/Magic/VividClarity.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic public static readonly SoundStyle BeamSound = new("CalamityMod/Sounds/Item/VividClarityBeamAppear"); public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/VoidVortex.cs b/Items/Weapons/Magic/VoidVortex.cs index 05b97f47e8..a671c7c4c1 100644 --- a/Items/Weapons/Magic/VoidVortex.cs +++ b/Items/Weapons/Magic/VoidVortex.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/VoltaicClimax.cs b/Items/Weapons/Magic/VoltaicClimax.cs index 168a0c0d61..56ab2c6926 100644 --- a/Items/Weapons/Magic/VoltaicClimax.cs +++ b/Items/Weapons/Magic/VoltaicClimax.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/WyvernsCall.cs b/Items/Weapons/Magic/WyvernsCall.cs index 36a2897fd8..67b618de61 100644 --- a/Items/Weapons/Magic/WyvernsCall.cs +++ b/Items/Weapons/Magic/WyvernsCall.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Magic/YharimsCrystal.cs b/Items/Weapons/Magic/YharimsCrystal.cs index a7cee17813..79f6ee338e 100644 --- a/Items/Weapons/Magic/YharimsCrystal.cs +++ b/Items/Weapons/Magic/YharimsCrystal.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Items.Weapons.Magic Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 30f; - Item.UseSound = SoundID.Item13; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/AbyssBlade.cs b/Items/Weapons/Melee/AbyssBlade.cs index 199a341c1a..71525139dd 100644 --- a/Items/Weapons/Melee/AbyssBlade.cs +++ b/Items/Weapons/Melee/AbyssBlade.cs @@ -1,6 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Melee/AcidwoodSword.cs b/Items/Weapons/Melee/AcidwoodSword.cs index 3d8eaf9876..e66fd94976 100644 --- a/Items/Weapons/Melee/AcidwoodSword.cs +++ b/Items/Weapons/Melee/AcidwoodSword.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Weapons/Melee/AegisBlade.cs b/Items/Weapons/Melee/AegisBlade.cs index 9b76ece0bb..6607f71156 100644 --- a/Items/Weapons/Melee/AegisBlade.cs +++ b/Items/Weapons/Melee/AegisBlade.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/AirSpinner.cs b/Items/Weapons/Melee/AirSpinner.cs index 1ab080f85e..8d6208edc0 100644 --- a/Items/Weapons/Melee/AirSpinner.cs +++ b/Items/Weapons/Melee/AirSpinner.cs @@ -11,9 +11,9 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Yoyo[Item.type] = true; - ItemID.Sets.GamepadExtraRange[Item.type] = 15; - ItemID.Sets.GamepadSmartQuickReach[Item.type] = true; + ItemID.Sets.Yoyo[Type] = true; + ItemID.Sets.GamepadExtraRange[Type] = 15; + ItemID.Sets.GamepadSmartQuickReach[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/AmidiasTrident.cs b/Items/Weapons/Melee/AmidiasTrident.cs index 9624cbde95..36530c0bdb 100644 --- a/Items/Weapons/Melee/AmidiasTrident.cs +++ b/Items/Weapons/Melee/AmidiasTrident.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Spears[Item.type] = true; + ItemID.Sets.Spears[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/AnarchyBlade.cs b/Items/Weapons/Melee/AnarchyBlade.cs index be42a6d88f..deda0bf7d1 100644 --- a/Items/Weapons/Melee/AnarchyBlade.cs +++ b/Items/Weapons/Melee/AnarchyBlade.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Items.Weapons.Melee CreateRecipe(). AddIngredient(ItemID.BreakerBlade). AddIngredient(5). - AddIngredient(3). + AddIngredient(). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Melee/Aorta.cs b/Items/Weapons/Melee/Aorta.cs index 62b40b8710..4ccd7795d0 100644 --- a/Items/Weapons/Melee/Aorta.cs +++ b/Items/Weapons/Melee/Aorta.cs @@ -11,9 +11,9 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Yoyo[Item.type] = true; - ItemID.Sets.GamepadExtraRange[Item.type] = 15; - ItemID.Sets.GamepadSmartQuickReach[Item.type] = true; + ItemID.Sets.Yoyo[Type] = true; + ItemID.Sets.GamepadExtraRange[Type] = 15; + ItemID.Sets.GamepadSmartQuickReach[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/ArkoftheElements.cs b/Items/Weapons/Melee/ArkoftheElements.cs index 7a8887ffae..0fdfb3d968 100644 --- a/Items/Weapons/Melee/ArkoftheElements.cs +++ b/Items/Weapons/Melee/ArkoftheElements.cs @@ -164,6 +164,9 @@ namespace CalamityMod.Items.Weapons.Melee float tweakedScale = scale * (1 + extraScale); //Make the scale bigger to avoid crunching of the item Vector2 offset = (frontTexture.Size() * extraScale / 2f) * scale; + // The base offset is not perfect, so we need to move it down a little + offset -= Vector2.UnitY * 16f * scale; + float backLayerOpacity = (Charge > 0) ? 1f : (float)Math.Sin(Main.GlobalTimeWrappedHourly * 0.9f) * 0.2f + 0.3f; spriteBatch.Draw(backTexture, position - offset, null, drawColor * backLayerOpacity, 0f, origin, tweakedScale, SpriteEffects.None, 0f); //Make the back scissor slightly transparent if the ark isnt charged @@ -207,7 +210,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(). AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). - AddIngredient(5). + AddIngredient(ItemID.FragmentSolar, 5). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Melee/AstralPike.cs b/Items/Weapons/Melee/AstralPike.cs index d9d5da2e0a..688ef97985 100644 --- a/Items/Weapons/Melee/AstralPike.cs +++ b/Items/Weapons/Melee/AstralPike.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Spears[Item.type] = true; + ItemID.Sets.Spears[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/Azathoth.cs b/Items/Weapons/Melee/Azathoth.cs index 00083eb51a..335fbc8c4a 100644 --- a/Items/Weapons/Melee/Azathoth.cs +++ b/Items/Weapons/Melee/Azathoth.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Yoyo[Item.type] = true; - ItemID.Sets.GamepadExtraRange[Item.type] = 15; - ItemID.Sets.GamepadSmartQuickReach[Item.type] = true; + ItemID.Sets.Yoyo[Type] = true; + ItemID.Sets.GamepadExtraRange[Type] = 15; + ItemID.Sets.GamepadSmartQuickReach[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/BansheeHook.cs b/Items/Weapons/Melee/BansheeHook.cs index 458b6276f9..0c788bd3ff 100644 --- a/Items/Weapons/Melee/BansheeHook.cs +++ b/Items/Weapons/Melee/BansheeHook.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Spears[Item.type] = true; + ItemID.Sets.Spears[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/BotanicPiercer.cs b/Items/Weapons/Melee/BotanicPiercer.cs index 5e75b4790b..25f5f5eb42 100644 --- a/Items/Weapons/Melee/BotanicPiercer.cs +++ b/Items/Weapons/Melee/BotanicPiercer.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Spears[Item.type] = true; + ItemID.Sets.Spears[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/Brimlance.cs b/Items/Weapons/Melee/Brimlance.cs index 1666ed6820..891c17c57e 100644 --- a/Items/Weapons/Melee/Brimlance.cs +++ b/Items/Weapons/Melee/Brimlance.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Spears[Item.type] = true; + ItemID.Sets.Spears[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/BrimstoneSword.cs b/Items/Weapons/Melee/BrimstoneSword.cs index 8407cb5eb2..78ccce24fd 100644 --- a/Items/Weapons/Melee/BrimstoneSword.cs +++ b/Items/Weapons/Melee/BrimstoneSword.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/BrinyBaron.cs b/Items/Weapons/Melee/BrinyBaron.cs index 108c8f20de..0720ced625 100644 --- a/Items/Weapons/Melee/BrinyBaron.cs +++ b/Items/Weapons/Melee/BrinyBaron.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/BrokenBiomeBlade.cs b/Items/Weapons/Melee/BrokenBiomeBlade.cs index 895d685c87..98952024f8 100644 --- a/Items/Weapons/Melee/BrokenBiomeBlade.cs +++ b/Items/Weapons/Melee/BrokenBiomeBlade.cs @@ -289,8 +289,8 @@ namespace CalamityMod.Items.Weapons.Melee public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) { - Texture2D itemTexture = TextureAssets.Item[Item.type].Value; - Rectangle itemFrame = (Main.itemAnimations[Item.type] == null) ? itemTexture.Frame() : Main.itemAnimations[Item.type].GetFrame(itemTexture); + Texture2D itemTexture = TextureAssets.Item[Type].Value; + Rectangle itemFrame = (Main.itemAnimations[Type] == null) ? itemTexture.Frame() : Main.itemAnimations[Type].GetFrame(itemTexture); if (mainAttunement == null) return true; diff --git a/Items/Weapons/Melee/BurningRevelation.cs b/Items/Weapons/Melee/BurningRevelation.cs index 85c2b4d6e8..f3adc1195e 100644 --- a/Items/Weapons/Melee/BurningRevelation.cs +++ b/Items/Weapons/Melee/BurningRevelation.cs @@ -11,9 +11,9 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Yoyo[Item.type] = true; - ItemID.Sets.GamepadExtraRange[Item.type] = 15; - ItemID.Sets.GamepadSmartQuickReach[Item.type] = true; + ItemID.Sets.Yoyo[Type] = true; + ItemID.Sets.GamepadExtraRange[Type] = 15; + ItemID.Sets.GamepadSmartQuickReach[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/DeathsAscension.cs b/Items/Weapons/Melee/DeathsAscension.cs index 819a5ab932..a71bc50700 100644 --- a/Items/Weapons/Melee/DeathsAscension.cs +++ b/Items/Weapons/Melee/DeathsAscension.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/DevilsDevastation.cs b/Items/Weapons/Melee/DevilsDevastation.cs index f92adf52cc..dee66c75a0 100644 --- a/Items/Weapons/Melee/DevilsDevastation.cs +++ b/Items/Weapons/Melee/DevilsDevastation.cs @@ -2,6 +2,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Typeless; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; @@ -113,7 +114,9 @@ namespace CalamityMod.Items.Weapons.Melee { target.AddBuff(BuffID.ShadowFlame, 450); target.AddBuff(ModContent.BuffType(), 900); - player.ApplyDamageToNPC(target, Item.damage * 4, 0f, 0, false); + int onHitDamage = player.CalcIntDamage(4 * Item.damage); + Projectile blast = Projectile.NewProjectileDirect(Item.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), onHitDamage, 0f, player.whoAmI, target.whoAmI); + blast.DamageType = Item.DamageType; float firstDustScale = 1.7f; float secondDustScale = 0.8f; float thirdDustScale = 2f; diff --git a/Items/Weapons/Melee/DevilsSunrise.cs b/Items/Weapons/Melee/DevilsSunrise.cs index 776977cb07..12d765d4a1 100644 --- a/Items/Weapons/Melee/DevilsSunrise.cs +++ b/Items/Weapons/Melee/DevilsSunrise.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Crags; using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using Microsoft.Xna.Framework; diff --git a/Items/Weapons/Melee/DraconicDestruction.cs b/Items/Weapons/Melee/DraconicDestruction.cs index 7794866eb5..7a99bb4606 100644 --- a/Items/Weapons/Melee/DraconicDestruction.cs +++ b/Items/Weapons/Melee/DraconicDestruction.cs @@ -50,9 +50,9 @@ namespace CalamityMod.Items.Weapons.Melee { CreateRecipe(). AddIngredient(5). - AddIngredient(3). - AddIngredient(3). AddIngredient(ItemID.FragmentSolar, 10). + AddIngredient(3). + AddIngredient(3). AddTile(). Register(); } diff --git a/Items/Weapons/Melee/DriftwoodSword.cs b/Items/Weapons/Melee/DriftwoodSword.cs index 57f1ca8924..ab010d3c41 100644 --- a/Items/Weapons/Melee/DriftwoodSword.cs +++ b/Items/Weapons/Melee/DriftwoodSword.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/Weapons/Melee/EarthenPike.cs b/Items/Weapons/Melee/EarthenPike.cs index d5cabc2e95..7db0bd93f5 100644 --- a/Items/Weapons/Melee/EarthenPike.cs +++ b/Items/Weapons/Melee/EarthenPike.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Spears[Item.type] = true; + ItemID.Sets.Spears[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/EntropicClaymore.cs b/Items/Weapons/Melee/EntropicClaymore.cs index 1ad3f55947..6f8573c102 100644 --- a/Items/Weapons/Melee/EntropicClaymore.cs +++ b/Items/Weapons/Melee/EntropicClaymore.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Melee { for (int i = 0; i < 6; i++) { - Projectile.NewProjectileDirect(source, position, velocity.RotatedByRandom(0.6f) * Main.rand.NextFloat(0.7f, 1.1f), type, damage / 2, knockback * 0.5f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(source, position, velocity.RotatedByRandom(0.6f) * Main.rand.NextFloat(0.7f, 1.1f), type, damage / 2, knockback * 0.5f, player.whoAmI); } return false; } diff --git a/Items/Weapons/Melee/ExaltedOathblade.cs b/Items/Weapons/Melee/ExaltedOathblade.cs index be2759f775..5b15a72276 100644 --- a/Items/Weapons/Melee/ExaltedOathblade.cs +++ b/Items/Weapons/Melee/ExaltedOathblade.cs @@ -2,6 +2,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -62,7 +63,9 @@ namespace CalamityMod.Items.Weapons.Melee { target.AddBuff(BuffID.ShadowFlame, 450); target.AddBuff(ModContent.BuffType(), 900); - player.ApplyDamageToNPC(target, player.GetWeaponDamage(player.ActiveItem()) * 2, 0f, 0, false); + int onHitDamage = player.CalcIntDamage(2 * Item.damage); + Projectile blast = Projectile.NewProjectileDirect(Item.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), onHitDamage, 0f, player.whoAmI, target.whoAmI); + blast.DamageType = Item.DamageType; float firstDustScale = 1.7f; float secondDustScale = 0.8f; float thirdDustScale = 2f; diff --git a/Items/Weapons/Melee/FaultLine.cs b/Items/Weapons/Melee/FaultLine.cs index fb99d311a7..6872b878f5 100644 --- a/Items/Weapons/Melee/FaultLine.cs +++ b/Items/Weapons/Melee/FaultLine.cs @@ -12,9 +12,9 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Yoyo[Item.type] = true; - ItemID.Sets.GamepadExtraRange[Item.type] = 15; - ItemID.Sets.GamepadSmartQuickReach[Item.type] = true; + ItemID.Sets.Yoyo[Type] = true; + ItemID.Sets.GamepadExtraRange[Type] = 15; + ItemID.Sets.GamepadSmartQuickReach[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/ForbiddenOathblade.cs b/Items/Weapons/Melee/ForbiddenOathblade.cs index 63d3236843..32f9386daa 100644 --- a/Items/Weapons/Melee/ForbiddenOathblade.cs +++ b/Items/Weapons/Melee/ForbiddenOathblade.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -44,7 +45,8 @@ namespace CalamityMod.Items.Weapons.Melee target.AddBuff(BuffID.ShadowFlame, 360); target.AddBuff(ModContent.BuffType(), 720); int onHitDamage = player.CalcIntDamage(2 * Item.damage); - player.ApplyDamageToNPC(target, onHitDamage, 0f, 0, false); + Projectile blast = Projectile.NewProjectileDirect(Item.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), onHitDamage, 0f, player.whoAmI, target.whoAmI); + blast.DamageType = Item.DamageType; float firstDustScale = 1.7f; float secondDustScale = 0.8f; float thirdDustScale = 2f; diff --git a/Items/Weapons/Melee/GalactusBlade.cs b/Items/Weapons/Melee/GalactusBlade.cs index 7d90459230..6a56e3f9c5 100644 --- a/Items/Weapons/Melee/GalactusBlade.cs +++ b/Items/Weapons/Melee/GalactusBlade.cs @@ -1,6 +1,9 @@ using System; +using System.Collections.Generic; +using System.Security.Cryptography.X509Certificates; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; +using CalamityMod.Particles; using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -8,6 +11,8 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using Microsoft.Xna.Framework.Graphics; +using static Terraria.ModLoader.ModContent; namespace CalamityMod.Items.Weapons.Melee { @@ -15,92 +20,114 @@ namespace CalamityMod.Items.Weapons.Melee public class GalactusBlade : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + private int swordDirection; + public int time = 0; + private float swingRotation = 0; + public Color useColor = Color.White; + public bool spawnProj = true; public override void SetDefaults() { - Item.width = 60; - Item.height = 58; - Item.damage = 84; + Item.width = 144; + Item.height = 146; + Item.damage = 828; Item.DamageType = DamageClass.Melee; - Item.useAnimation = 17; + Item.useAnimation = 27; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 17; + Item.useTime = 27; Item.useTurn = true; - Item.knockBack = 6f; + Item.knockBack = 17f; Item.UseSound = SoundID.Item105; Item.autoReuse = true; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 23f; + Item.shootSpeed = 13f; + Item.scale = 0.75f; + } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, Request(Texture + "Glow").Value); } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - float cometSpeed = Item.shootSpeed; - Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true); - float mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X; - float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y; - if (player.gravDir == -1f) - { - mouseYDist = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - realPlayerPos.Y; - } - float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist)); - if ((float.IsNaN(mouseXDist) && float.IsNaN(mouseYDist)) || (mouseXDist == 0f && mouseYDist == 0f)) - { - mouseXDist = (float)player.direction; - mouseYDist = 0f; - mouseDistance = cometSpeed; - } - else - { - mouseDistance = cometSpeed / mouseDistance; - } - - for (int i = 0; i < 5; i++) - { - realPlayerPos = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); - realPlayerPos.X = (realPlayerPos.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); - realPlayerPos.Y -= (float)(100 * i); - mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X; - mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y; - if (mouseYDist < 0f) - { - mouseYDist *= -1f; - } - if (mouseYDist < 20f) - { - mouseYDist = 20f; - } - mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist)); - mouseDistance = cometSpeed / mouseDistance; - mouseXDist *= mouseDistance; - mouseYDist *= mouseDistance; - float speedX4 = mouseXDist + (float)Main.rand.Next(-100, 101) * 0.02f; - float speedY5 = mouseYDist + (float)Main.rand.Next(-100, 101) * 0.02f; - int projectile = Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, speedX4, speedY5, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, (float)Main.rand.Next(10)); - } return false; } - + public override void UseAnimation(Player player) + { + swordDirection = (player.Center - player.Calamity().mouseWorld).X > 1 ? -1 : 1; + time = 0; + swingRotation = 0; + spawnProj = true; + } public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.NextBool(4)) + int swordSize = (int)(33 * Item.scale); + + float rate = Main.GlobalTimeWrappedHourly * 18; + List eColors = new List() { - Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, Main.rand.NextBool() ? 164 : 229); + Color.Gold, + Color.HotPink, + Color.Cyan + }; + int colorIndex = (int)(rate / 2 % eColors.Count); + Color currentColor = eColors[colorIndex]; + Color nextColor = eColors[(colorIndex + 1) % eColors.Count]; + useColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f); + + player.itemRotation = swingRotation - 1.7f * swordDirection; + player.itemLocation = player.Center; + player.direction = swordDirection; + + float val = MathF.Abs(time - player.itemAnimationMax * 0.75f) / player.itemAnimationMax; + + float goalRot = Utils.Remap(time, 0, player.itemAnimationMax, -0.5f, 5.2f) * swordDirection; + float swingEasing = Utils.GetLerpValue(0, player.itemAnimationMax * 0.4f, time, true) * (0.35f - val); + if (time < player.itemAnimationMax) + { + swingRotation = MathHelper.Lerp(swingRotation, goalRot, swingEasing); } - } - public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 300); - } + player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, swingRotation + MathHelper.ToRadians(120f * swordDirection)); - public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) - { - target.AddBuff(ModContent.BuffType(), 300); - } + if (val < 0.4f) + { + if (spawnProj) + { + for (int i = 0; i < 7; i++) + { + Vector2 spawnSpot = new Vector2(player.Calamity().mouseWorld.X, player.Center.Y) + new Vector2(Main.rand.NextFloat(-850, 850), Main.rand.NextFloat(-750, -1250)); + Projectile comet = Projectile.NewProjectileDirect(Item.GetSource_FromThis(), spawnSpot, Utils.DirectionTo(spawnSpot, player.Calamity().mouseWorld + Main.rand.NextVector2Circular(50, 50)) * Item.shootSpeed, Item.shoot, Item.damage / 3, Item.knockBack, player.whoAmI); + comet.extraUpdates = Main.rand.Next(2, 3 + 1); + } + spawnProj = false; + } + for (int i = 0; i < 3; i++) + { + Vector2 dustVel = new Vector2(5 * swordDirection, -5).RotatedBy(swingRotation - 1.7f * swordDirection); + float partScale = Main.rand.NextFloat(0.6f, 0.9f); + Vector2 partVel = (dustVel * Main.rand.NextFloat(0.2f, 0.3f)).RotatedBy(MathHelper.ToRadians(90f * swordDirection)).RotatedByRandom(-0.2) * -3; + Vector2 partPos = player.Center + dustVel.RotatedByRandom(0.4f) * swordSize; + + Particle spark2 = new SparkParticle(partPos, partVel, false, 14, partScale * 0.6f, useColor); + GeneralParticleHandler.SpawnParticle(spark2); + } + } + + Vector2 dustVel2 = new Vector2(5 * swordDirection, -5).RotatedBy(swingRotation - 1.7f * swordDirection); + + float partScale2 = Main.rand.NextFloat(0.3f, 0.7f); + Vector2 partVel2 = dustVel2 * Main.rand.NextFloat(0.2f, 0.3f); + for (int i = 0; i < 5; i++) + { + Particle smoke2 = new CustomSpark(player.Center + dustVel2 * Main.rand.Next(1, swordSize + 1) + Main.rand.NextVector2Circular(12, 12), partVel2.RotatedBy(MathHelper.ToRadians(90f * swordDirection)).RotatedBy(-0.3 * swordDirection) * Main.rand.NextFloat(-1, -10), "CalamityMod/Particles/SmallBloom", false, 12, partScale2 * 0.5f, useColor * 0.4f, Vector2.One, true, false, 3, false, false); + GeneralParticleHandler.SpawnParticle(smoke2); + } + Lighting.AddLight(player.Center + dustVel2, Color.White.ToVector3() * 1.2f); + time++; + } public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Melee/GalactusBlade.png b/Items/Weapons/Melee/GalactusBlade.png index dfc96e92b1..3e0e245e39 100644 Binary files a/Items/Weapons/Melee/GalactusBlade.png and b/Items/Weapons/Melee/GalactusBlade.png differ diff --git a/Items/Weapons/Melee/GalactusBladeGlow.png b/Items/Weapons/Melee/GalactusBladeGlow.png new file mode 100644 index 0000000000..83d8b7a329 Binary files /dev/null and b/Items/Weapons/Melee/GalactusBladeGlow.png differ diff --git a/Items/Weapons/Melee/GildedProboscis.cs b/Items/Weapons/Melee/GildedProboscis.cs index 45b27e9071..e278081d7e 100644 --- a/Items/Weapons/Melee/GildedProboscis.cs +++ b/Items/Weapons/Melee/GildedProboscis.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Spears[Item.type] = true; + ItemID.Sets.Spears[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/GoldplumeSpear.cs b/Items/Weapons/Melee/GoldplumeSpear.cs index 4c86273d79..b870ed806a 100644 --- a/Items/Weapons/Melee/GoldplumeSpear.cs +++ b/Items/Weapons/Melee/GoldplumeSpear.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Spears[Item.type] = true; + ItemID.Sets.Spears[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/GrandDad.cs b/Items/Weapons/Melee/GrandDad.cs index fbd699748c..ac5bfb214c 100644 --- a/Items/Weapons/Melee/GrandDad.cs +++ b/Items/Weapons/Melee/GrandDad.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 124; Item.height = 124; - Item.damage = 1977; // Feel free to change these 7s as balance requires. The other 7s should stay - Update: no more 2777... :( + Item.damage = 2407; // Feel free to change these 7s as balance requires. The other 7s should stay - Update: no more 2777... :( Item.DamageType = TrueMeleeDamageClass.Instance; Item.useAnimation = 77; Item.useTime = 77; diff --git a/Items/Weapons/Melee/HellionFlowerSpear.cs b/Items/Weapons/Melee/HellionFlowerSpear.cs index 0ea8d94c6d..d89110439a 100644 --- a/Items/Weapons/Melee/HellionFlowerSpear.cs +++ b/Items/Weapons/Melee/HellionFlowerSpear.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Spears[Item.type] = true; + ItemID.Sets.Spears[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/Hellkite.cs b/Items/Weapons/Melee/Hellkite.cs index 4cb0bcfa15..63fb2fe1a4 100644 --- a/Items/Weapons/Melee/Hellkite.cs +++ b/Items/Weapons/Melee/Hellkite.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee public static readonly SoundStyle HitSoundBig = new("CalamityMod/Sounds/Item/HellkiteBigHit", 2); public static readonly SoundStyle ChargeSound = new("CalamityMod/Sounds/Item/HellkiteCharge"); public static readonly SoundStyle FullChargeSound = new("CalamityMod/Sounds/Item/HellkiteFullCharge"); - public override void SetStaticDefaults() => ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + public override void SetStaticDefaults() => ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; public override void SetDefaults() { Item.width = 124; @@ -53,10 +53,10 @@ namespace CalamityMod.Items.Weapons.Melee { if (player.altFunctionUse == 2) { - Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, 5); + Projectile.NewProjectile(source, player.MountedCenter, Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, 5); } else - Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, 0); + Projectile.NewProjectile(source, player.MountedCenter, Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, 0); return false; } public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) diff --git a/Items/Weapons/Melee/IridescentExcalibur.cs b/Items/Weapons/Melee/IridescentExcalibur.cs index 457c2521e4..76c749add9 100644 --- a/Items/Weapons/Melee/IridescentExcalibur.cs +++ b/Items/Weapons/Melee/IridescentExcalibur.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/Lacerator.cs b/Items/Weapons/Melee/Lacerator.cs index 50d74118be..22b6a8c839 100644 --- a/Items/Weapons/Melee/Lacerator.cs +++ b/Items/Weapons/Melee/Lacerator.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Yoyo[Item.type] = true; - ItemID.Sets.GamepadExtraRange[Item.type] = 15; - ItemID.Sets.GamepadSmartQuickReach[Item.type] = true; + ItemID.Sets.Yoyo[Type] = true; + ItemID.Sets.GamepadExtraRange[Type] = 15; + ItemID.Sets.GamepadSmartQuickReach[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/MonolithSword.cs b/Items/Weapons/Melee/MonolithSword.cs index 3af19b0da7..408bf75dc3 100644 --- a/Items/Weapons/Melee/MonolithSword.cs +++ b/Items/Weapons/Melee/MonolithSword.cs @@ -1,5 +1,5 @@ using CalamityMod.Dusts; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Astral; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Melee/Mourningstar.cs b/Items/Weapons/Melee/Mourningstar.cs index 6e282fc6a9..c04ecb3315 100644 --- a/Items/Weapons/Melee/Mourningstar.cs +++ b/Items/Weapons/Melee/Mourningstar.cs @@ -46,9 +46,9 @@ namespace CalamityMod.Items.Weapons.Melee { CreateRecipe(). AddIngredient(ItemID.SolarEruption). - AddIngredient(6). - AddIngredient(6). AddIngredient(6). + AddIngredient(6). + AddIngredient(6). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Melee/Nadir.cs b/Items/Weapons/Melee/Nadir.cs index 84d1d622fd..4ba4e5d206 100644 --- a/Items/Weapons/Melee/Nadir.cs +++ b/Items/Weapons/Melee/Nadir.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { - ItemID.Sets.Spears[Item.type] = true; + ItemID.Sets.Spears[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/Oblivion.cs b/Items/Weapons/Melee/Oblivion.cs index 14b23912fb..2dc1ec0103 100644 --- a/Items/Weapons/Melee/Oblivion.cs +++ b/Items/Weapons/Melee/Oblivion.cs @@ -11,9 +11,9 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Yoyo[Item.type] = true; - ItemID.Sets.GamepadExtraRange[Item.type] = 15; - ItemID.Sets.GamepadSmartQuickReach[Item.type] = true; + ItemID.Sets.Yoyo[Type] = true; + ItemID.Sets.GamepadExtraRange[Type] = 15; + ItemID.Sets.GamepadSmartQuickReach[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/OmegaBiomeBlade.cs b/Items/Weapons/Melee/OmegaBiomeBlade.cs index f38bbd37bf..d975e283d6 100644 --- a/Items/Weapons/Melee/OmegaBiomeBlade.cs +++ b/Items/Weapons/Melee/OmegaBiomeBlade.cs @@ -372,7 +372,7 @@ namespace CalamityMod.Items.Weapons.Melee position.Y -= 6f * scale; Texture2D itemTexture = Request("CalamityMod/Items/Weapons/Melee/OmegaBiomeBladeExtra").Value; - Rectangle itemFrame = (Main.itemAnimations[Item.type] == null) ? itemTexture.Frame() : Main.itemAnimations[Item.type].GetFrame(itemTexture); + Rectangle itemFrame = (Main.itemAnimations[Type] == null) ? itemTexture.Frame() : Main.itemAnimations[Type].GetFrame(itemTexture); // Draw all particles. diff --git a/Items/Weapons/Melee/Pandemic.cs b/Items/Weapons/Melee/Pandemic.cs index d8f968505e..8ca2d50e90 100644 --- a/Items/Weapons/Melee/Pandemic.cs +++ b/Items/Weapons/Melee/Pandemic.cs @@ -12,9 +12,9 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Yoyo[Item.type] = true; - ItemID.Sets.GamepadExtraRange[Item.type] = 15; - ItemID.Sets.GamepadSmartQuickReach[Item.type] = true; + ItemID.Sets.Yoyo[Type] = true; + ItemID.Sets.GamepadExtraRange[Type] = 15; + ItemID.Sets.GamepadSmartQuickReach[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/PhotonRipper.cs b/Items/Weapons/Melee/PhotonRipper.cs index 5986c13bc3..067ee83e3b 100644 --- a/Items/Weapons/Melee/PhotonRipper.cs +++ b/Items/Weapons/Melee/PhotonRipper.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/PrismaticBreaker.cs b/Items/Weapons/Melee/PrismaticBreaker.cs index 39ce83d7dc..20941fbed8 100644 --- a/Items/Weapons/Melee/PrismaticBreaker.cs +++ b/Items/Weapons/Melee/PrismaticBreaker.cs @@ -35,16 +35,16 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() { Item.width = 50; Item.height = 50; - Item.damage = 500; + Item.damage = 300; Item.useStyle = ItemUseStyleID.Shoot; Item.useAnimation = Item.useTime = 13; Item.reuseDelay = 30; diff --git a/Items/Weapons/Melee/Quagmire.cs b/Items/Weapons/Melee/Quagmire.cs index 8105ff2d7e..21072bdeda 100644 --- a/Items/Weapons/Melee/Quagmire.cs +++ b/Items/Weapons/Melee/Quagmire.cs @@ -11,9 +11,9 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Yoyo[Item.type] = true; - ItemID.Sets.GamepadExtraRange[Item.type] = 15; - ItemID.Sets.GamepadSmartQuickReach[Item.type] = true; + ItemID.Sets.Yoyo[Type] = true; + ItemID.Sets.GamepadExtraRange[Type] = 15; + ItemID.Sets.GamepadSmartQuickReach[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/RedSun.cs b/Items/Weapons/Melee/RedSun.cs index 3c99e3ed1c..71c7e89b04 100644 --- a/Items/Weapons/Melee/RedSun.cs +++ b/Items/Weapons/Melee/RedSun.cs @@ -108,7 +108,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(ItemID.AntlionClaw). AddIngredient(). AddIngredient(5). - AddIngredient(5). + AddIngredient(5). AddTile(). Register(); } diff --git a/Items/Weapons/Melee/RedtideSpear.cs b/Items/Weapons/Melee/RedtideSpear.cs index 3ea296e0e3..78d1e82068 100644 --- a/Items/Weapons/Melee/RedtideSpear.cs +++ b/Items/Weapons/Melee/RedtideSpear.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Spears[Item.type] = true; + ItemID.Sets.Spears[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/Riptide.cs b/Items/Weapons/Melee/Riptide.cs index 3676f8d2e5..f16c70b942 100644 --- a/Items/Weapons/Melee/Riptide.cs +++ b/Items/Weapons/Melee/Riptide.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Projectiles.Melee.Yoyos; using Terraria; using Terraria.ID; @@ -13,9 +13,9 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Yoyo[Item.type] = true; - ItemID.Sets.GamepadExtraRange[Item.type] = 15; - ItemID.Sets.GamepadSmartQuickReach[Item.type] = true; + ItemID.Sets.Yoyo[Type] = true; + ItemID.Sets.GamepadExtraRange[Type] = 15; + ItemID.Sets.GamepadSmartQuickReach[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/SaharaSlicers.cs b/Items/Weapons/Melee/SaharaSlicers.cs index 4ffc6f96f5..40549fec04 100644 --- a/Items/Weapons/Melee/SaharaSlicers.cs +++ b/Items/Weapons/Melee/SaharaSlicers.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee public bool AltProjectile = true; public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() { diff --git a/Items/Weapons/Melee/SaharaSlicers.png b/Items/Weapons/Melee/SaharaSlicers.png index aecbe93345..d3667f574b 100644 Binary files a/Items/Weapons/Melee/SaharaSlicers.png and b/Items/Weapons/Melee/SaharaSlicers.png differ diff --git a/Items/Weapons/Melee/SausageMaker.cs b/Items/Weapons/Melee/SausageMaker.cs index fd0f87b89b..d43d86bd7f 100644 --- a/Items/Weapons/Melee/SausageMaker.cs +++ b/Items/Weapons/Melee/SausageMaker.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Spears[Item.type] = true; + ItemID.Sets.Spears[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/SeashineSword.cs b/Items/Weapons/Melee/SeashineSword.cs index 465fa48b07..c28720bdff 100644 --- a/Items/Weapons/Melee/SeashineSword.cs +++ b/Items/Weapons/Melee/SeashineSword.cs @@ -1,5 +1,6 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; @@ -27,7 +28,14 @@ namespace CalamityMod.Items.Weapons.Melee Item.UseSound = SoundID.Item1; Item.shoot = ModContent.ProjectileType(); } - + public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 120); + } + public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) + { + target.AddBuff(ModContent.BuffType(), 120); + } public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Melee/Shimmerspark.cs b/Items/Weapons/Melee/Shimmerspark.cs index 45f7958674..7dd42299f9 100644 --- a/Items/Weapons/Melee/Shimmerspark.cs +++ b/Items/Weapons/Melee/Shimmerspark.cs @@ -11,9 +11,9 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Yoyo[Item.type] = true; - ItemID.Sets.GamepadExtraRange[Item.type] = 15; - ItemID.Sets.GamepadSmartQuickReach[Item.type] = true; + ItemID.Sets.Yoyo[Type] = true; + ItemID.Sets.GamepadExtraRange[Type] = 15; + ItemID.Sets.GamepadSmartQuickReach[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/SmokingComet.cs b/Items/Weapons/Melee/SmokingComet.cs index ff8fe8633e..b40665dc9d 100644 --- a/Items/Weapons/Melee/SmokingComet.cs +++ b/Items/Weapons/Melee/SmokingComet.cs @@ -10,9 +10,9 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Yoyo[Item.type] = true; - ItemID.Sets.GamepadExtraRange[Item.type] = 15; - ItemID.Sets.GamepadSmartQuickReach[Item.type] = true; + ItemID.Sets.Yoyo[Type] = true; + ItemID.Sets.GamepadExtraRange[Type] = 15; + ItemID.Sets.GamepadSmartQuickReach[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/SoulHarvester.cs b/Items/Weapons/Melee/SoulHarvester.cs index 6ad35bb47f..5e96d09f84 100644 --- a/Items/Weapons/Melee/SoulHarvester.cs +++ b/Items/Weapons/Melee/SoulHarvester.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -46,7 +47,8 @@ namespace CalamityMod.Items.Weapons.Melee { SoundEngine.PlaySound(SoundID.Item14, target.Center); int onHitDamage = player.CalcIntDamage(Item.damage); - player.ApplyDamageToNPC(target, onHitDamage, 0f, 0, false); + Projectile blast = Projectile.NewProjectileDirect(Item.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), onHitDamage, 0f, player.whoAmI, target.whoAmI); + blast.DamageType = Item.DamageType; for (int i = 0; i < 10; i++) { int plagueDust = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, DustID.GemEmerald, 0f, 0f, 100, default, 2f); diff --git a/Items/Weapons/Melee/StarburstShiv.cs b/Items/Weapons/Melee/StarburstShiv.cs index 333f89fb7d..5fdd6a0f4f 100644 --- a/Items/Weapons/Melee/StarburstShiv.cs +++ b/Items/Weapons/Melee/StarburstShiv.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(ItemID.PiercingStarlight). AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). - AddIngredient(5). + AddIngredient(ItemID.FragmentSolar, 5). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Melee/StarnightLance.cs b/Items/Weapons/Melee/StarnightLance.cs index 8e6afe25b2..8dc323f208 100644 --- a/Items/Weapons/Melee/StarnightLance.cs +++ b/Items/Weapons/Melee/StarnightLance.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Spears[Item.type] = true; + ItemID.Sets.Spears[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/StygianShield.cs b/Items/Weapons/Melee/StygianShield.cs index 3b6b75e84f..a2c212cbd7 100644 --- a/Items/Weapons/Melee/StygianShield.cs +++ b/Items/Weapons/Melee/StygianShield.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Melee public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(HeldDefense, (DisableDashDuration / 60D).ToString("N1")); - public override void SetStaticDefaults() => ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + public override void SetStaticDefaults() => ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; public override void SetDefaults() { diff --git a/Items/Weapons/Melee/SulphurousGrabber.cs b/Items/Weapons/Melee/SulphurousGrabber.cs index d7179f663d..6480c443fd 100644 --- a/Items/Weapons/Melee/SulphurousGrabber.cs +++ b/Items/Weapons/Melee/SulphurousGrabber.cs @@ -10,9 +10,9 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Yoyo[Item.type] = true; - ItemID.Sets.GamepadExtraRange[Item.type] = 15; - ItemID.Sets.GamepadSmartQuickReach[Item.type] = true; + ItemID.Sets.Yoyo[Type] = true; + ItemID.Sets.GamepadExtraRange[Type] = 15; + ItemID.Sets.GamepadSmartQuickReach[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/TaintedBlade.cs b/Items/Weapons/Melee/TaintedBlade.cs index 4bd49059d5..eb0e887f73 100644 --- a/Items/Weapons/Melee/TaintedBlade.cs +++ b/Items/Weapons/Melee/TaintedBlade.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/Weapons/Melee/TenebreusTides.cs b/Items/Weapons/Melee/TenebreusTides.cs index 951e07525a..f92d002223 100644 --- a/Items/Weapons/Melee/TenebreusTides.cs +++ b/Items/Weapons/Melee/TenebreusTides.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Spears[Item.type] = true; + ItemID.Sets.Spears[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/TheBurningSky.cs b/Items/Weapons/Melee/TheBurningSky.cs index abb9f7b438..1e8fa16cdf 100644 --- a/Items/Weapons/Melee/TheBurningSky.cs +++ b/Items/Weapons/Melee/TheBurningSky.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee { // Visually a sword, but with no true melee capability. The Burning Sky is held out like a staff. - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/TheDarkMaster.cs b/Items/Weapons/Melee/TheDarkMaster.cs index fa651fd0a3..75bfd17d1c 100644 --- a/Items/Weapons/Melee/TheDarkMaster.cs +++ b/Items/Weapons/Melee/TheDarkMaster.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { - Item.staff[Item.type] = true; - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + Item.staff[Type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/TheGodsGambit.cs b/Items/Weapons/Melee/TheGodsGambit.cs index d786bdcc23..a863c7e54e 100644 --- a/Items/Weapons/Melee/TheGodsGambit.cs +++ b/Items/Weapons/Melee/TheGodsGambit.cs @@ -12,9 +12,9 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Yoyo[Item.type] = true; - ItemID.Sets.GamepadExtraRange[Item.type] = 15; - ItemID.Sets.GamepadSmartQuickReach[Item.type] = true; + ItemID.Sets.Yoyo[Type] = true; + ItemID.Sets.GamepadExtraRange[Type] = 15; + ItemID.Sets.GamepadSmartQuickReach[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/TheMicrowave.cs b/Items/Weapons/Melee/TheMicrowave.cs index c485fbbe46..eefec91cfb 100644 --- a/Items/Weapons/Melee/TheMicrowave.cs +++ b/Items/Weapons/Melee/TheMicrowave.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { - ItemID.Sets.Yoyo[Item.type] = true; - ItemID.Sets.GamepadExtraRange[Item.type] = 15; - ItemID.Sets.GamepadSmartQuickReach[Item.type] = true; + ItemID.Sets.Yoyo[Type] = true; + ItemID.Sets.GamepadExtraRange[Type] = 15; + ItemID.Sets.GamepadSmartQuickReach[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/TheObliterator.cs b/Items/Weapons/Melee/TheObliterator.cs index a02d38ce6a..21c73a3331 100644 --- a/Items/Weapons/Melee/TheObliterator.cs +++ b/Items/Weapons/Melee/TheObliterator.cs @@ -12,9 +12,9 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Yoyo[Item.type] = true; - ItemID.Sets.GamepadExtraRange[Item.type] = 15; - ItemID.Sets.GamepadSmartQuickReach[Item.type] = true; + ItemID.Sets.Yoyo[Type] = true; + ItemID.Sets.GamepadExtraRange[Type] = 15; + ItemID.Sets.GamepadSmartQuickReach[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/TheOracle.cs b/Items/Weapons/Melee/TheOracle.cs index 49a98cf8dc..3eb1520ffb 100644 --- a/Items/Weapons/Melee/TheOracle.cs +++ b/Items/Weapons/Melee/TheOracle.cs @@ -19,9 +19,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { - ItemID.Sets.Yoyo[Item.type] = true; - ItemID.Sets.GamepadExtraRange[Item.type] = 15; - ItemID.Sets.GamepadSmartQuickReach[Item.type] = true; + ItemID.Sets.Yoyo[Type] = true; + ItemID.Sets.GamepadExtraRange[Type] = 15; + ItemID.Sets.GamepadSmartQuickReach[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/TyphonsGreed.cs b/Items/Weapons/Melee/TyphonsGreed.cs index e101efa146..e2d8e61327 100644 --- a/Items/Weapons/Melee/TyphonsGreed.cs +++ b/Items/Weapons/Melee/TyphonsGreed.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Projectiles.Melee; using Terraria; using Terraria.ID; diff --git a/Items/Weapons/Melee/UltimusCleaver.cs b/Items/Weapons/Melee/UltimusCleaver.cs index 54f1848c70..f9128f195b 100644 --- a/Items/Weapons/Melee/UltimusCleaver.cs +++ b/Items/Weapons/Melee/UltimusCleaver.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -36,7 +37,8 @@ namespace CalamityMod.Items.Weapons.Melee { target.AddBuff(BuffID.OnFire3, 360); int onHitDamage = player.CalcIntDamage(Item.damage); - player.ApplyDamageToNPC(target, onHitDamage, 0f, 0, false); + Projectile blast = Projectile.NewProjectileDirect(Item.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), onHitDamage, 0f, player.whoAmI, target.whoAmI); + blast.DamageType = Item.DamageType; float firstDustScale = 1.7f; float secondDustScale = 0.8f; float thirdDustScale = 2f; diff --git a/Items/Weapons/Melee/VanishingPoint.cs b/Items/Weapons/Melee/VanishingPoint.cs index 52bd80efe6..5aee60aefa 100644 --- a/Items/Weapons/Melee/VanishingPoint.cs +++ b/Items/Weapons/Melee/VanishingPoint.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Spears[Item.type] = true; + ItemID.Sets.Spears[Type] = true; } public override void SetDefaults() @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(). AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). - AddIngredient(5). + AddIngredient(ItemID.FragmentSolar, 5). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Melee/VulcaniteLance.cs b/Items/Weapons/Melee/VulcaniteLance.cs index 98e810e120..b61b432b67 100644 --- a/Items/Weapons/Melee/VulcaniteLance.cs +++ b/Items/Weapons/Melee/VulcaniteLance.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Spears[Item.type] = true; + ItemID.Sets.Spears[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Melee/YateveoBloom.cs b/Items/Weapons/Melee/YateveoBloom.cs index 4254bd8158..0cb321f18f 100644 --- a/Items/Weapons/Melee/YateveoBloom.cs +++ b/Items/Weapons/Melee/YateveoBloom.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; // Flail already does half damage. No tooltip mutliplier required. } diff --git a/Items/Weapons/Melee/YinYo.cs b/Items/Weapons/Melee/YinYo.cs index dcf2dc5e30..6ab6275747 100644 --- a/Items/Weapons/Melee/YinYo.cs +++ b/Items/Weapons/Melee/YinYo.cs @@ -9,9 +9,9 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.Yoyo[Item.type] = true; - ItemID.Sets.GamepadExtraRange[Item.type] = 15; - ItemID.Sets.GamepadSmartQuickReach[Item.type] = true; + ItemID.Sets.Yoyo[Type] = true; + ItemID.Sets.GamepadExtraRange[Type] = 15; + ItemID.Sets.GamepadSmartQuickReach[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Ranged/AcidwoodBow.cs b/Items/Weapons/Ranged/AcidwoodBow.cs index 9d09a4d608..37af5aa1ea 100644 --- a/Items/Weapons/Ranged/AcidwoodBow.cs +++ b/Items/Weapons/Ranged/AcidwoodBow.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Weapons/Ranged/AdamantiteParticleAccelerator.cs b/Items/Weapons/Ranged/AdamantiteParticleAccelerator.cs index 62bfe59a96..a7b9d1d5e3 100644 --- a/Items/Weapons/Ranged/AdamantiteParticleAccelerator.cs +++ b/Items/Weapons/Ranged/AdamantiteParticleAccelerator.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { - ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; + ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; } public override void SetDefaults() { diff --git a/Items/Weapons/Ranged/AngelicShotgun.cs b/Items/Weapons/Ranged/AngelicShotgun.cs index 7ee215362d..c5c3189ac6 100644 --- a/Items/Weapons/Ranged/AngelicShotgun.cs +++ b/Items/Weapons/Ranged/AngelicShotgun.cs @@ -123,7 +123,7 @@ namespace CalamityMod.Items.Weapons.Ranged CreateRecipe(). AddIngredient(ItemID.SunplateBlock, 75). AddIngredient(15). - AddIngredient(7). + AddIngredient(7). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Ranged/Animosity.cs b/Items/Weapons/Ranged/Animosity.cs index 18e17a6d39..12c48f1fc6 100644 --- a/Items/Weapons/Ranged/Animosity.cs +++ b/Items/Weapons/Ranged/Animosity.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged public float SniperVelocityMult = 2f; public new string LocalizationCategory => "Items.Weapons.Ranged"; - public override void SetStaticDefaults() => ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + public override void SetStaticDefaults() => ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; public override void SetDefaults() { diff --git a/Items/Weapons/Ranged/AquashardShotgun.cs b/Items/Weapons/Ranged/AquashardShotgun.cs index 642af025bf..c388ec1d2e 100644 --- a/Items/Weapons/Ranged/AquashardShotgun.cs +++ b/Items/Weapons/Ranged/AquashardShotgun.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Ranged/Arietes41.cs b/Items/Weapons/Ranged/Arietes41.cs index c429993437..d1de224282 100644 --- a/Items/Weapons/Ranged/Arietes41.cs +++ b/Items/Weapons/Ranged/Arietes41.cs @@ -1,8 +1,6 @@ using System; -using CalamityMod.Items.Materials; using CalamityMod.Particles; using CalamityMod.Projectiles; -using Microsoft.CodeAnalysis; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -104,7 +102,6 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(). AddIngredient(ItemID.ShroomiteBar, 3). AddIngredient(ItemID.FallenStar, 3). // 41 Arietis is a triple star system - AddIngredient(). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Ranged/Barinade.cs b/Items/Weapons/Ranged/Barinade.cs index d58ef12011..aae8b9e920 100644 --- a/Items/Weapons/Ranged/Barinade.cs +++ b/Items/Weapons/Ranged/Barinade.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetDefaults() { - Item.width = 30; - Item.height = 44; + Item.width = 52; + Item.height = 80; Item.damage = 5; Item.DamageType = DamageClass.Ranged; Item.useTime = 24; @@ -33,8 +33,8 @@ namespace CalamityMod.Items.Weapons.Ranged public override Vector2? HoldoutOffset() => new Vector2(0, 4); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, position + velocity.RotatedBy(-0.55f), velocity.RotatedBy(0.025f), ModContent.ProjectileType(), damage, knockback, player.whoAmI); - Projectile.NewProjectile(source, position + velocity.RotatedBy(0.55f), velocity.RotatedBy(-0.025f), ModContent.ProjectileType(), damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, position + velocity.RotatedBy(-0.95f), velocity.RotatedBy(0.025f), ModContent.ProjectileType(), damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, position + velocity.RotatedBy(0.95f), velocity.RotatedBy(-0.025f), ModContent.ProjectileType(), damage, knockback, player.whoAmI); return false; } } diff --git a/Items/Weapons/Ranged/Barinade.png b/Items/Weapons/Ranged/Barinade.png index 0d4a6b1bf8..5ab49d1c58 100644 Binary files a/Items/Weapons/Ranged/Barinade.png and b/Items/Weapons/Ranged/Barinade.png differ diff --git a/Items/Weapons/Ranged/BarracudaGun.cs b/Items/Weapons/Ranged/BarracudaGun.cs index 5e3de62293..87895c9b14 100644 --- a/Items/Weapons/Ranged/BarracudaGun.cs +++ b/Items/Weapons/Ranged/BarracudaGun.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetStaticDefaults() { - ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; + ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; } public override void SetDefaults() { diff --git a/Items/Weapons/Ranged/BloodBoiler.cs b/Items/Weapons/Ranged/BloodBoiler.cs index 29e9f63f78..4a0f30013d 100644 --- a/Items/Weapons/Ranged/BloodBoiler.cs +++ b/Items/Weapons/Ranged/BloodBoiler.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { - ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; + ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; } public override void SetDefaults() { diff --git a/Items/Weapons/Ranged/BlossomFlux.cs b/Items/Weapons/Ranged/BlossomFlux.cs index c01ff0e243..009dab6e38 100644 --- a/Items/Weapons/Ranged/BlossomFlux.cs +++ b/Items/Weapons/Ranged/BlossomFlux.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Ranged/Buzzkill.cs b/Items/Weapons/Ranged/Buzzkill.cs index 63c52faec8..b5a9e54ea7 100644 --- a/Items/Weapons/Ranged/Buzzkill.cs +++ b/Items/Weapons/Ranged/Buzzkill.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { - ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; + ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Ranged/ChromaticEruption.cs b/Items/Weapons/Ranged/ChromaticEruption.cs index 0e25bea27c..4577cc58f0 100644 --- a/Items/Weapons/Ranged/ChromaticEruption.cs +++ b/Items/Weapons/Ranged/ChromaticEruption.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(). AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). - AddIngredient(5). + AddIngredient(ItemID.FragmentVortex, 5). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Ranged/Condemnation.cs b/Items/Weapons/Ranged/Condemnation.cs index e9397aeaca..96d14370c5 100644 --- a/Items/Weapons/Ranged/Condemnation.cs +++ b/Items/Weapons/Ranged/Condemnation.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Ranged/CorinthPrime.cs b/Items/Weapons/Ranged/CorinthPrime.cs index c080382c89..2bcfaa60db 100644 --- a/Items/Weapons/Ranged/CorinthPrime.cs +++ b/Items/Weapons/Ranged/CorinthPrime.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Ranged/Drataliornus.cs b/Items/Weapons/Ranged/Drataliornus.cs index a9ee5b51e5..36ca91f8d5 100644 --- a/Items/Weapons/Ranged/Drataliornus.cs +++ b/Items/Weapons/Ranged/Drataliornus.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Ranged/DriftwoodBow.cs b/Items/Weapons/Ranged/DriftwoodBow.cs index f79dfada00..b1fad53dbf 100644 --- a/Items/Weapons/Ranged/DriftwoodBow.cs +++ b/Items/Weapons/Ranged/DriftwoodBow.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Items/Weapons/Ranged/FirestormCannon.cs b/Items/Weapons/Ranged/FirestormCannon.cs index 573af9b6a4..51ecdc5739 100644 --- a/Items/Weapons/Ranged/FirestormCannon.cs +++ b/Items/Weapons/Ranged/FirestormCannon.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Ranged/FlakKraken.cs b/Items/Weapons/Ranged/FlakKraken.cs index 8f81cd8cff..91a8ff73a5 100644 --- a/Items/Weapons/Ranged/FlakKraken.cs +++ b/Items/Weapons/Ranged/FlakKraken.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Ranged/Hellborn.cs b/Items/Weapons/Ranged/Hellborn.cs index 0a7735e92a..bada6debe5 100644 --- a/Items/Weapons/Ranged/Hellborn.cs +++ b/Items/Weapons/Ranged/Hellborn.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Ranged/Hydra.cs b/Items/Weapons/Ranged/Hydra.cs index d4a5d9ffa6..521f677b7a 100644 --- a/Items/Weapons/Ranged/Hydra.cs +++ b/Items/Weapons/Ranged/Hydra.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Ranged/Infinity.cs b/Items/Weapons/Ranged/Infinity.cs index a3d6b48b2a..7800bd11e1 100644 --- a/Items/Weapons/Ranged/Infinity.cs +++ b/Items/Weapons/Ranged/Infinity.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public int SineCounter = 0; public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Ranged/Leviatitan.cs b/Items/Weapons/Ranged/Leviatitan.cs index a640da1b1d..61010b9c37 100644 --- a/Items/Weapons/Ranged/Leviatitan.cs +++ b/Items/Weapons/Ranged/Leviatitan.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged private int shotCounter = 1; public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Ranged/MagnaCannon.cs b/Items/Weapons/Ranged/MagnaCannon.cs index 11c969a986..92811a79ee 100644 --- a/Items/Weapons/Ranged/MagnaCannon.cs +++ b/Items/Weapons/Ranged/MagnaCannon.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; - public override void SetStaticDefaults() => ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; + public override void SetStaticDefaults() => ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; public override void SetDefaults() { @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 spawnPosition = player.RotatedRelativePoint(player.MountedCenter); - Projectile.NewProjectileDirect(source, spawnPosition, player.Calamity().mouseWorld - player.RotatedRelativePoint(player.MountedCenter), ModContent.ProjectileType(), damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, spawnPosition, player.Calamity().mouseWorld - player.RotatedRelativePoint(player.MountedCenter), ModContent.ProjectileType(), damage, knockback, player.whoAmI); return false; } diff --git a/Items/Weapons/Ranged/Megalodon.cs b/Items/Weapons/Ranged/Megalodon.cs index 1f8d937a45..5f22951eac 100644 --- a/Items/Weapons/Ranged/Megalodon.cs +++ b/Items/Weapons/Ranged/Megalodon.cs @@ -1,6 +1,6 @@ using System; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Ranged/MineralMortar.cs b/Items/Weapons/Ranged/MineralMortar.cs index 65cb759423..eac32ef156 100644 --- a/Items/Weapons/Ranged/MineralMortar.cs +++ b/Items/Weapons/Ranged/MineralMortar.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 spawnPosition = player.RotatedRelativePoint(player.MountedCenter, true); - Projectile.NewProjectileDirect(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, ModContent.ProjectileType(), 0, 0f, player.whoAmI); + Projectile.NewProjectile(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, ModContent.ProjectileType(), 0, 0f, player.whoAmI); return false; } diff --git a/Items/Weapons/Ranged/MonolithBow.cs b/Items/Weapons/Ranged/MonolithBow.cs index e467e12c49..fa8b2ea872 100644 --- a/Items/Weapons/Ranged/MonolithBow.cs +++ b/Items/Weapons/Ranged/MonolithBow.cs @@ -1,5 +1,5 @@ using CalamityMod.Dusts; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Astral; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Items/Weapons/Ranged/Norfleet.cs b/Items/Weapons/Ranged/Norfleet.cs index 16dc0a289d..f2be5f037c 100644 --- a/Items/Weapons/Ranged/Norfleet.cs +++ b/Items/Weapons/Ranged/Norfleet.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { - ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; + ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; } public override void SetDefaults() { diff --git a/Items/Weapons/Ranged/NullificationPistol.cs b/Items/Weapons/Ranged/NullificationPistol.cs index f0445990a4..ece748a510 100644 --- a/Items/Weapons/Ranged/NullificationPistol.cs +++ b/Items/Weapons/Ranged/NullificationPistol.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { - ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() { diff --git a/Items/Weapons/Ranged/OpalStriker.cs b/Items/Weapons/Ranged/OpalStriker.cs index 44645c6aa9..18eddc2d04 100644 --- a/Items/Weapons/Ranged/OpalStriker.cs +++ b/Items/Weapons/Ranged/OpalStriker.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 spawnPosition = player.RotatedRelativePoint(player.MountedCenter, true); - Projectile.NewProjectileDirect(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, ModContent.ProjectileType(), damage, knockback, player.whoAmI); return false; } diff --git a/Items/Weapons/Ranged/Photoviscerator.cs b/Items/Weapons/Ranged/Photoviscerator.cs index 60b4d83186..1b25904346 100644 --- a/Items/Weapons/Ranged/Photoviscerator.cs +++ b/Items/Weapons/Ranged/Photoviscerator.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Ranged public static int RightClickCooldown = 25; public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Ranged/PlagueTaintedSMG.cs b/Items/Weapons/Ranged/PlagueTaintedSMG.cs index 2f42728351..c5c81448e0 100644 --- a/Items/Weapons/Ranged/PlagueTaintedSMG.cs +++ b/Items/Weapons/Ranged/PlagueTaintedSMG.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Ranged/PlanetaryAnnihilation.cs b/Items/Weapons/Ranged/PlanetaryAnnihilation.cs index d06d34e907..6838dd2b28 100644 --- a/Items/Weapons/Ranged/PlanetaryAnnihilation.cs +++ b/Items/Weapons/Ranged/PlanetaryAnnihilation.cs @@ -105,7 +105,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(ItemID.DaedalusStormbow). AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). - AddIngredient(5). + AddIngredient(ItemID.FragmentVortex, 5). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Ranged/PolarisParrotfish.cs b/Items/Weapons/Ranged/PolarisParrotfish.cs index be98bffc27..af88025aeb 100644 --- a/Items/Weapons/Ranged/PolarisParrotfish.cs +++ b/Items/Weapons/Ranged/PolarisParrotfish.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Weapons.Ranged public static readonly SoundStyle Squeak = new("CalamityMod/Sounds/Custom/CuteSqueak") { Volume = 0.75f }; public override void SetStaticDefaults() { - ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; - Item.staff[Item.type] = true; //so it doesn't look weird af when holding it + ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; + Item.staff[Type] = true; //so it doesn't look weird af when holding it } public override void SetDefaults() diff --git a/Items/Weapons/Ranged/PristineFury.cs b/Items/Weapons/Ranged/PristineFury.cs index 056f567798..2c4c89a136 100644 --- a/Items/Weapons/Ranged/PristineFury.cs +++ b/Items/Weapons/Ranged/PristineFury.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Ranged/Pumpler.cs b/Items/Weapons/Ranged/Pumpler.cs index bf87eb6146..36aeaafe38 100644 --- a/Items/Weapons/Ranged/Pumpler.cs +++ b/Items/Weapons/Ranged/Pumpler.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { - ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; + ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; } public override void SetDefaults() { diff --git a/Items/Weapons/Ranged/ReedBlowgun.cs b/Items/Weapons/Ranged/ReedBlowgun.cs index fa3902328f..12c7774d84 100644 --- a/Items/Weapons/Ranged/ReedBlowgun.cs +++ b/Items/Weapons/Ranged/ReedBlowgun.cs @@ -12,21 +12,19 @@ namespace CalamityMod.Items.Weapons.Ranged public class ReedBlowgun : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; - public static readonly SoundStyle BubbleBurstSound = new("CalamityMod/Sounds/Custom/PistolShrimpBubbleBurst") { PitchVariance = 0.15f, Volume = 0.2f }; - public override void SetStaticDefaults() { - ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; + ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; } public override void SetDefaults() { Item.width = 22; Item.height = 46; - Item.damage = 21; + Item.damage = 25; Item.DamageType = DamageClass.Ranged; - Item.useTime = 25; - Item.useAnimation = 25; + Item.useTime = 32; + Item.useAnimation = 32; Item.useStyle = ItemUseStyleID.Shoot; Item.holdStyle = 16; Item.noMelee = true; diff --git a/Items/Weapons/Ranged/Seadragon.cs b/Items/Weapons/Ranged/Seadragon.cs index 1e47e455af..6e4b33c8a2 100644 --- a/Items/Weapons/Ranged/Seadragon.cs +++ b/Items/Weapons/Ranged/Seadragon.cs @@ -1,6 +1,6 @@ using System; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.rare = ModContent.RarityType(); Item.UseSound = SoundID.Item11; Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); + Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 16f; Item.useAmmo = AmmoID.Bullet; Item.Calamity().canFirePointBlankShots = true; diff --git a/Items/Weapons/Ranged/SeasSearing.cs b/Items/Weapons/Ranged/SeasSearing.cs index 37e48e4060..11d8e3fa93 100644 --- a/Items/Weapons/Ranged/SeasSearing.cs +++ b/Items/Weapons/Ranged/SeasSearing.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { - ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Ranged/SepticSkewer.cs b/Items/Weapons/Ranged/SepticSkewer.cs index 4edc4b370d..ab572d256f 100644 --- a/Items/Weapons/Ranged/SepticSkewer.cs +++ b/Items/Weapons/Ranged/SepticSkewer.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Items.Weapons.Ranged public bool pulled = false; public override void SetStaticDefaults() { - ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() { diff --git a/Items/Weapons/Ranged/Shredder.cs b/Items/Weapons/Ranged/Shredder.cs index 4996c2f66a..5137773712 100644 --- a/Items/Weapons/Ranged/Shredder.cs +++ b/Items/Weapons/Ranged/Shredder.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Ranged/SpeedBlaster.cs b/Items/Weapons/Ranged/SpeedBlaster.cs index aca243757d..91eb648f97 100644 --- a/Items/Weapons/Ranged/SpeedBlaster.cs +++ b/Items/Weapons/Ranged/SpeedBlaster.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { - ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; + ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; } public override void SetDefaults() { diff --git a/Items/Weapons/Ranged/Starmageddon.cs b/Items/Weapons/Ranged/Starmageddon.cs index f7e422decd..a2c2cd6707 100644 --- a/Items/Weapons/Ranged/Starmageddon.cs +++ b/Items/Weapons/Ranged/Starmageddon.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { - ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; + ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Ranged/StellarCannon.cs b/Items/Weapons/Ranged/StellarCannon.cs index c35aae9dab..376629dbca 100644 --- a/Items/Weapons/Ranged/StellarCannon.cs +++ b/Items/Weapons/Ranged/StellarCannon.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { - ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; + ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; } public override void SetDefaults() { diff --git a/Items/Weapons/Ranged/StormSurge.cs b/Items/Weapons/Ranged/StormSurge.cs index a55535b3a7..a9c9ae609c 100644 --- a/Items/Weapons/Ranged/StormSurge.cs +++ b/Items/Weapons/Ranged/StormSurge.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { - ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; + ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; } public override void SetDefaults() { diff --git a/Items/Weapons/Ranged/SulphuricAcidCannon.cs b/Items/Weapons/Ranged/SulphuricAcidCannon.cs index 36c41d54c0..27ac2a1351 100644 --- a/Items/Weapons/Ranged/SulphuricAcidCannon.cs +++ b/Items/Weapons/Ranged/SulphuricAcidCannon.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { - ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; + ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; } public override void SetDefaults() { diff --git a/Items/Weapons/Ranged/SuperradiantSlaughterer.cs b/Items/Weapons/Ranged/SuperradiantSlaughterer.cs index e48e8b1315..e0d0977f1c 100644 --- a/Items/Weapons/Ranged/SuperradiantSlaughterer.cs +++ b/Items/Weapons/Ranged/SuperradiantSlaughterer.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { - ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; + ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; } public override void SetDefaults() { @@ -122,7 +122,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(). AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). - AddIngredient(5). + AddIngredient(ItemID.FragmentVortex, 5). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Ranged/SurgeDriver.cs b/Items/Weapons/Ranged/SurgeDriver.cs index 2f824d95de..a344d60962 100644 --- a/Items/Weapons/Ranged/SurgeDriver.cs +++ b/Items/Weapons/Ranged/SurgeDriver.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Ranged/Svantechnical.cs b/Items/Weapons/Ranged/Svantechnical.cs index e304c42a43..234dd933ce 100644 --- a/Items/Weapons/Ranged/Svantechnical.cs +++ b/Items/Weapons/Ranged/Svantechnical.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public int SineCounter = 0; public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() { diff --git a/Items/Weapons/Ranged/TauCannon.cs b/Items/Weapons/Ranged/TauCannon.cs index 035feca70c..5708e8e09b 100644 --- a/Items/Weapons/Ranged/TauCannon.cs +++ b/Items/Weapons/Ranged/TauCannon.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectileDirect(source, position, velocity, type, damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); return false; } diff --git a/Items/Weapons/Ranged/TheMaelstrom.cs b/Items/Weapons/Ranged/TheMaelstrom.cs index f00ed388bd..81342eb7a0 100644 --- a/Items/Weapons/Ranged/TheMaelstrom.cs +++ b/Items/Weapons/Ranged/TheMaelstrom.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; diff --git a/Items/Weapons/Ranged/TheSevensStriker.cs b/Items/Weapons/Ranged/TheSevensStriker.cs index 724da47d7b..347ed65b3a 100644 --- a/Items/Weapons/Ranged/TheSevensStriker.cs +++ b/Items/Weapons/Ranged/TheSevensStriker.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Ranged/TitaniumRailgun.cs b/Items/Weapons/Ranged/TitaniumRailgun.cs index 02fd415f1e..34ad55a974 100644 --- a/Items/Weapons/Ranged/TitaniumRailgun.cs +++ b/Items/Weapons/Ranged/TitaniumRailgun.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { - ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; + ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; } public override void SetDefaults() { diff --git a/Items/Weapons/Rogue/Apoctolith.cs b/Items/Weapons/Rogue/Apoctolith.cs index ca48244c5f..86ead7d4ea 100644 --- a/Items/Weapons/Rogue/Apoctolith.cs +++ b/Items/Weapons/Rogue/Apoctolith.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Projectiles.Rogue; using CalamityMod.Utilities; using Microsoft.Xna.Framework; diff --git a/Items/Weapons/Rogue/AuroradicalThrow.cs b/Items/Weapons/Rogue/AuroradicalThrow.cs index 3bc3e7e79c..04409f3752 100644 --- a/Items/Weapons/Rogue/AuroradicalThrow.cs +++ b/Items/Weapons/Rogue/AuroradicalThrow.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, TextureAssets.Item[Item.type].Value); + Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, TextureAssets.Item[Type].Value); } } } diff --git a/Items/Weapons/Rogue/BallisticPoisonBomb.cs b/Items/Weapons/Rogue/BallisticPoisonBomb.cs index 8e0c21d98a..a5adb023be 100644 --- a/Items/Weapons/Rogue/BallisticPoisonBomb.cs +++ b/Items/Weapons/Rogue/BallisticPoisonBomb.cs @@ -1,6 +1,6 @@ using System; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Rogue/EclipsesFall.cs b/Items/Weapons/Rogue/EclipsesFall.cs index df2d406bf0..2c33ac188c 100644 --- a/Items/Weapons/Rogue/EclipsesFall.cs +++ b/Items/Weapons/Rogue/EclipsesFall.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Rogue AddIngredient(). AddIngredient(8). AddIngredient(8). - AddIngredient(12). + AddIngredient(12). AddTile(). Register(); } diff --git a/Items/Weapons/Rogue/FrostcrushValari.cs b/Items/Weapons/Rogue/FrostcrushValari.cs index 4b41108386..12e11f5bcc 100644 --- a/Items/Weapons/Rogue/FrostcrushValari.cs +++ b/Items/Weapons/Rogue/FrostcrushValari.cs @@ -1,6 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; @@ -74,7 +74,7 @@ namespace CalamityMod.Items.Weapons.Rogue AddIngredient(). AddIngredient(6). AddIngredient(40). - AddIngredient(5). + AddIngredient(ItemID.Ectoplasm, 5). AddTile(TileID.IceMachine). Register(); } diff --git a/Items/Weapons/Rogue/LeonidProgenitor.cs b/Items/Weapons/Rogue/LeonidProgenitor.cs index 16a3c08fb4..7918e2eded 100644 --- a/Items/Weapons/Rogue/LeonidProgenitor.cs +++ b/Items/Weapons/Rogue/LeonidProgenitor.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Rogue/Malachite.cs b/Items/Weapons/Rogue/Malachite.cs index 9c6d8c5165..63e63fc0cd 100644 --- a/Items/Weapons/Rogue/Malachite.cs +++ b/Items/Weapons/Rogue/Malachite.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Rogue { public override void SetStaticDefaults() { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Rogue/Prismalline.cs b/Items/Weapons/Rogue/Prismalline.cs index 140007da3d..8977ed8739 100644 --- a/Items/Weapons/Rogue/Prismalline.cs +++ b/Items/Weapons/Rogue/Prismalline.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Rogue/ReboundingRainbow.cs b/Items/Weapons/Rogue/ReboundingRainbow.cs index a2d3549eef..a874f6347d 100644 --- a/Items/Weapons/Rogue/ReboundingRainbow.cs +++ b/Items/Weapons/Rogue/ReboundingRainbow.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Items.Weapons.Rogue AddIngredient(). AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). - AddIngredient(5). + AddIngredient(5). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Rogue/ScourgeoftheDesert.cs b/Items/Weapons/Rogue/ScourgeoftheDesert.cs index ff44eeb6a7..3686253aea 100644 --- a/Items/Weapons/Rogue/ScourgeoftheDesert.cs +++ b/Items/Weapons/Rogue/ScourgeoftheDesert.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Items.Weapons.Rogue { public override void SetDefaults() { - Item.width = 82; - Item.height = 82; + Item.width = 112; + Item.height = 116; Item.damage = 12; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Rogue/ScourgeoftheDesert.png b/Items/Weapons/Rogue/ScourgeoftheDesert.png index 8e86310af5..625d9bb541 100644 Binary files a/Items/Weapons/Rogue/ScourgeoftheDesert.png and b/Items/Weapons/Rogue/ScourgeoftheDesert.png differ diff --git a/Items/Weapons/Rogue/SeafoamBomb.cs b/Items/Weapons/Rogue/SeafoamBomb.cs index 63f19c3669..0ffa9e5219 100644 --- a/Items/Weapons/Rogue/SeafoamBomb.cs +++ b/Items/Weapons/Rogue/SeafoamBomb.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Rogue/StormfrontRazor.cs b/Items/Weapons/Rogue/StormfrontRazor.cs index cbfac2a18a..3d98b335f5 100644 --- a/Items/Weapons/Rogue/StormfrontRazor.cs +++ b/Items/Weapons/Rogue/StormfrontRazor.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Rogue/TwistingThunder.cs b/Items/Weapons/Rogue/TwistingThunder.cs index 26a45e9bdf..55cfb38d91 100644 --- a/Items/Weapons/Rogue/TwistingThunder.cs +++ b/Items/Weapons/Rogue/TwistingThunder.cs @@ -58,7 +58,6 @@ namespace CalamityMod.Items.Weapons.Rogue CreateRecipe(). AddIngredient(). AddIngredient(15). - AddIngredient(5). AddIngredient(3). AddTile(TileID.LunarCraftingStation). Register(); diff --git a/Items/Weapons/Rogue/WaveSkipper.cs b/Items/Weapons/Rogue/WaveSkipper.cs index 7abed0d80a..84d53b3f01 100644 --- a/Items/Weapons/Rogue/WaveSkipper.cs +++ b/Items/Weapons/Rogue/WaveSkipper.cs @@ -1,6 +1,6 @@ using System; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Summon/AncientIceChunk.cs b/Items/Weapons/Summon/AncientIceChunk.cs index 70b3cac8c0..88dcabbeb0 100644 --- a/Items/Weapons/Summon/AncientIceChunk.cs +++ b/Items/Weapons/Summon/AncientIceChunk.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectileDirect(source, Main.MouseWorld, Main.rand.NextVector2Circular(1f, 1f), type, damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, Main.MouseWorld, Main.rand.NextVector2Circular(1f, 1f), type, damage, knockback, player.whoAmI); return false; } } diff --git a/Items/Weapons/Summon/AquasScepter.cs b/Items/Weapons/Summon/AquasScepter.cs index 40ac018f06..748b39fe52 100644 --- a/Items/Weapons/Summon/AquasScepter.cs +++ b/Items/Weapons/Summon/AquasScepter.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; public override void SetStaticDefaults() { - ItemID.Sets.GamepadWholeScreenUseRange[Item.type] = true; - ItemID.Sets.LockOnIgnoresCollision[Item.type] = true; + ItemID.Sets.GamepadWholeScreenUseRange[Type] = true; + ItemID.Sets.LockOnIgnoresCollision[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Summon/BorealisBomber.cs b/Items/Weapons/Summon/BorealisBomber.cs index d91e61997f..7acf178e45 100644 --- a/Items/Weapons/Summon/BorealisBomber.cs +++ b/Items/Weapons/Summon/BorealisBomber.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Summon/BrittleStarStaff.cs b/Items/Weapons/Summon/BrittleStarStaff.cs index fc1033d1ca..70ba82739b 100644 --- a/Items/Weapons/Summon/BrittleStarStaff.cs +++ b/Items/Weapons/Summon/BrittleStarStaff.cs @@ -16,7 +16,8 @@ namespace CalamityMod.Items.Weapons.Summon public float Knockback = 2f; public override void SetDefaults() { - Item.width = Item.height = 44; + Item.width = 44; + Item.height = 64; Item.damage = 10; Item.mana = 10; Item.useAnimation = Item.useTime = 32; @@ -33,8 +34,8 @@ namespace CalamityMod.Items.Weapons.Summon } public override void SetStaticDefaults() { - Item.staff[Item.type] = true; - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + Item.staff[Type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Summon/BrittleStarStaff.png b/Items/Weapons/Summon/BrittleStarStaff.png index 782d3eb149..5bcb654ee5 100644 Binary files a/Items/Weapons/Summon/BrittleStarStaff.png and b/Items/Weapons/Summon/BrittleStarStaff.png differ diff --git a/Items/Weapons/Summon/CosmicImmaterializer.cs b/Items/Weapons/Summon/CosmicImmaterializer.cs index 8a687bbb46..953e77d1b9 100644 --- a/Items/Weapons/Summon/CosmicImmaterializer.cs +++ b/Items/Weapons/Summon/CosmicImmaterializer.cs @@ -15,6 +15,9 @@ namespace CalamityMod.Items.Weapons.Summon public class CosmicImmaterializer : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + + public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 10f; + public override void SetDefaults() { Item.width = 170; diff --git a/Items/Weapons/Summon/Cosmilamp.cs b/Items/Weapons/Summon/Cosmilamp.cs index 39955f8966..761729f98c 100644 --- a/Items/Weapons/Summon/Cosmilamp.cs +++ b/Items/Weapons/Summon/Cosmilamp.cs @@ -19,6 +19,8 @@ namespace CalamityMod.Items.Weapons.Summon public const float LanternSummonCost = 2f; + public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 2f; + public override void SetDefaults() { Item.width = 42; diff --git a/Items/Weapons/Summon/DragonbloodDisgorger.cs b/Items/Weapons/Summon/DragonbloodDisgorger.cs index 77b6556268..1233abad32 100644 --- a/Items/Weapons/Summon/DragonbloodDisgorger.cs +++ b/Items/Weapons/Summon/DragonbloodDisgorger.cs @@ -12,6 +12,9 @@ namespace CalamityMod.Items.Weapons.Summon public class DragonbloodDisgorger : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + + public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 6f; + public override void SetDefaults() { Item.width = 64; diff --git a/Items/Weapons/Summon/DreadmineStaff.cs b/Items/Weapons/Summon/DreadmineStaff.cs index a60e17693d..0c2cf657dd 100644 --- a/Items/Weapons/Summon/DreadmineStaff.cs +++ b/Items/Weapons/Summon/DreadmineStaff.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Summon/EnchantedConch.cs b/Items/Weapons/Summon/EnchantedConch.cs index 0136a8d714..6671787689 100644 --- a/Items/Weapons/Summon/EnchantedConch.cs +++ b/Items/Weapons/Summon/EnchantedConch.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectileDirect(source, Main.MouseWorld, Main.rand.NextVector2CircularEdge(5f, 5f), type, damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, Main.MouseWorld, Main.rand.NextVector2CircularEdge(5f, 5f), type, damage, knockback, player.whoAmI); return false; } } diff --git a/Items/Weapons/Summon/Endogenesis.cs b/Items/Weapons/Summon/Endogenesis.cs index 93473aebb8..f112fa3ef7 100644 --- a/Items/Weapons/Summon/Endogenesis.cs +++ b/Items/Weapons/Summon/Endogenesis.cs @@ -16,10 +16,8 @@ namespace CalamityMod.Items.Weapons.Summon //Cooper be like cool public static int AttackMode = 0; - public override void SetStaticDefaults() - { - //Icy no problems with that - } + + public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 10f; public override void SetDefaults() { @@ -94,7 +92,7 @@ namespace CalamityMod.Items.Weapons.Summon AddIngredient(ItemID.BlizzardStaff). AddIngredient(5). AddIngredient(100). - AddIngredient(15). + AddIngredient(15). AddTile(). Register(); } diff --git a/Items/Weapons/Summon/EntropysVigil.cs b/Items/Weapons/Summon/EntropysVigil.cs index b71b6ba3ff..942276dd18 100644 --- a/Items/Weapons/Summon/EntropysVigil.cs +++ b/Items/Weapons/Summon/EntropysVigil.cs @@ -12,7 +12,11 @@ namespace CalamityMod.Items.Weapons.Summon { public new string LocalizationCategory => "Items.Weapons.Summon"; - public override void SetStaticDefaults() => Item.staff[Type] = true; + public override void SetStaticDefaults() + { + Item.staff[Type] = true; + ItemID.Sets.StaffMinionSlotsRequired[Type] = 2f; + } public override void SetDefaults() { @@ -47,13 +51,13 @@ namespace CalamityMod.Items.Weapons.Summon switch (i) { case 0: - Projectile.NewProjectileDirect(source, Main.MouseWorld, spawnVelocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, Main.MouseWorld, spawnVelocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); break; case 1: - Projectile.NewProjectileDirect(source, Main.MouseWorld, spawnVelocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, Main.MouseWorld, spawnVelocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); break; case 2: - Projectile.NewProjectileDirect(source, Main.MouseWorld, spawnVelocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, Main.MouseWorld, spawnVelocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); break; } } diff --git a/Items/Weapons/Summon/EtherealSubjugator.cs b/Items/Weapons/Summon/EtherealSubjugator.cs index c5a5c460db..f4eb67404a 100644 --- a/Items/Weapons/Summon/EtherealSubjugator.cs +++ b/Items/Weapons/Summon/EtherealSubjugator.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectileDirect(source, Main.MouseWorld, Main.rand.NextVector2CircularEdge(5f, 5f), type, damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, Main.MouseWorld, Main.rand.NextVector2CircularEdge(5f, 5f), type, damage, knockback, player.whoAmI); return false; } } diff --git a/Items/Weapons/Summon/FlarebatStaff.cs b/Items/Weapons/Summon/FlarebatStaff.cs index b748065541..0fc4cbeea0 100644 --- a/Items/Weapons/Summon/FlarebatStaff.cs +++ b/Items/Weapons/Summon/FlarebatStaff.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectileDirect(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI); return false; } } diff --git a/Items/Weapons/Summon/FlowersOfMortality.cs b/Items/Weapons/Summon/FlowersOfMortality.cs index 2eeb08887d..2778b1c5a0 100644 --- a/Items/Weapons/Summon/FlowersOfMortality.cs +++ b/Items/Weapons/Summon/FlowersOfMortality.cs @@ -11,6 +11,9 @@ namespace CalamityMod.Items.Weapons.Summon public class FlowersOfMortality : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + + public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 3f; + public override void SetDefaults() { Item.width = 36; @@ -49,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Summon AddIngredient(). AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). - AddIngredient(5). + AddIngredient(ItemID.FragmentStardust, 5). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Summon/FrostbatStaff.cs b/Items/Weapons/Summon/FrostbatStaff.cs index abde4ca575..651972b837 100644 --- a/Items/Weapons/Summon/FrostbatStaff.cs +++ b/Items/Weapons/Summon/FrostbatStaff.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectileDirect(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI); return false; } } diff --git a/Items/Weapons/Summon/HarvestStaff.cs b/Items/Weapons/Summon/HarvestStaff.cs index fad959fad4..4d26fbbfbc 100644 --- a/Items/Weapons/Summon/HarvestStaff.cs +++ b/Items/Weapons/Summon/HarvestStaff.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Summon player.FindSentryRestingSpot(type, out int XPosition, out int YPosition, out int YOffset); YOffset -= 10; position = new Vector2((float)XPosition, (float)(YPosition - YOffset)); - Projectile.NewProjectileDirect(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); player.UpdateMaxTurrets(); return false; } diff --git a/Items/Weapons/Summon/IgneousExaltation.cs b/Items/Weapons/Summon/IgneousExaltation.cs index 12ca3a20af..7db24c614d 100644 --- a/Items/Weapons/Summon/IgneousExaltation.cs +++ b/Items/Weapons/Summon/IgneousExaltation.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Summon/InfectedRemote.cs b/Items/Weapons/Summon/InfectedRemote.cs index e4b8c63b6c..9449e7ffbc 100644 --- a/Items/Weapons/Summon/InfectedRemote.cs +++ b/Items/Weapons/Summon/InfectedRemote.cs @@ -32,6 +32,8 @@ namespace CalamityMod.Items.Weapons.Summon public const float EnemyTargetingRange = 1300f; + public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 3f; + public override void SetDefaults() { Item.width = 46; diff --git a/Items/Weapons/Summon/KingofConstellationsTenryu.cs b/Items/Weapons/Summon/KingofConstellationsTenryu.cs index c76b172edb..292cbfdc3d 100644 --- a/Items/Weapons/Summon/KingofConstellationsTenryu.cs +++ b/Items/Weapons/Summon/KingofConstellationsTenryu.cs @@ -14,6 +14,8 @@ namespace CalamityMod.Items.Weapons.Summon { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 4f; + public override void SetDefaults() { Item.width = 44; diff --git a/Items/Weapons/Summon/LegionofCelestia.cs b/Items/Weapons/Summon/LegionofCelestia.cs index d0a6ef0c1e..fa94cdf36a 100644 --- a/Items/Weapons/Summon/LegionofCelestia.cs +++ b/Items/Weapons/Summon/LegionofCelestia.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Summon AddIngredient(). AddIngredient(ItemID.LunarBar, 5). AddIngredient(5). - AddIngredient(5). + AddIngredient(ItemID.FragmentStardust, 5). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Summon/LiliesOfFinality.cs b/Items/Weapons/Summon/LiliesOfFinality.cs index e33c5b02e3..42f475d32d 100644 --- a/Items/Weapons/Summon/LiliesOfFinality.cs +++ b/Items/Weapons/Summon/LiliesOfFinality.cs @@ -37,6 +37,8 @@ namespace CalamityMod.Items.Weapons.Summon #endregion + public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 2f; + public override void SetDefaults() { Item.damage = TheNumber; @@ -59,8 +61,8 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectileDirect(source, player.Calamity().mouseWorld, new Vector2(-1f, -1f) * 3f, type, damage, knockback, player.whoAmI); - Projectile.NewProjectileDirect(source, player.Calamity().mouseWorld, new Vector2(1f, -1f) * 3f, ProjectileType(), damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, player.Calamity().mouseWorld, new Vector2(-1f, -1f) * 3f, type, damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, player.Calamity().mouseWorld, new Vector2(1f, -1f) * 3f, ProjectileType(), damage, knockback, player.whoAmI); if (Main.dedServ) return false; diff --git a/Items/Weapons/Summon/Metastasis.cs b/Items/Weapons/Summon/Metastasis.cs index 4d9e90ff7a..b1939d2cff 100644 --- a/Items/Weapons/Summon/Metastasis.cs +++ b/Items/Weapons/Summon/Metastasis.cs @@ -11,6 +11,13 @@ namespace CalamityMod.Items.Weapons.Summon public class Metastasis : ExhumedItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + ItemID.Sets.StaffMinionSlotsRequired[Type] = 4f; + } + public override void SetDefaults() { Item.width = 66; @@ -29,11 +36,6 @@ namespace CalamityMod.Items.Weapons.Summon Item.DamageType = DamageClass.Summon; } - public override void SetStaticDefaults() - { - ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); - } - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Summon/MutatedTruffle.cs b/Items/Weapons/Summon/MutatedTruffle.cs index c66a5e0099..d0d6f9e215 100644 --- a/Items/Weapons/Summon/MutatedTruffle.cs +++ b/Items/Weapons/Summon/MutatedTruffle.cs @@ -29,6 +29,8 @@ namespace CalamityMod.Items.Weapons.Summon #endregion + public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 3f; + public override void SetDefaults() { Item.width = 24; diff --git a/Items/Weapons/Summon/Perdition.cs b/Items/Weapons/Summon/Perdition.cs index a25798a78f..d4dd12553a 100644 --- a/Items/Weapons/Summon/Perdition.cs +++ b/Items/Weapons/Summon/Perdition.cs @@ -13,6 +13,8 @@ namespace CalamityMod.Items.Weapons.Summon { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 5f; + public override void SetDefaults() { Item.width = Item.height = 56; diff --git a/Items/Weapons/Summon/PlantationStaff.cs b/Items/Weapons/Summon/PlantationStaff.cs index b7a85aadd4..e94140c11a 100644 --- a/Items/Weapons/Summon/PlantationStaff.cs +++ b/Items/Weapons/Summon/PlantationStaff.cs @@ -33,6 +33,8 @@ namespace CalamityMod.Items.Weapons.Summon public static float TentacleSpeed = 25f; + public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 3f; + public override void SetDefaults() { Item.width = 50; diff --git a/Items/Weapons/Summon/SanctifiedSpark.cs b/Items/Weapons/Summon/SanctifiedSpark.cs index b7c19db16a..70f63705a3 100644 --- a/Items/Weapons/Summon/SanctifiedSpark.cs +++ b/Items/Weapons/Summon/SanctifiedSpark.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Summon/SarosPossession.cs b/Items/Weapons/Summon/SarosPossession.cs index 4f42ccce99..cb7411cbcc 100644 --- a/Items/Weapons/Summon/SarosPossession.cs +++ b/Items/Weapons/Summon/SarosPossession.cs @@ -13,6 +13,9 @@ namespace CalamityMod.Items.Weapons.Summon public class SarosPossession : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + + public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 8f; + public override void SetDefaults() { Item.width = Item.height = 56; diff --git a/Items/Weapons/Summon/ShellfishStaff.cs b/Items/Weapons/Summon/ShellfishStaff.cs index 1abaa418da..af2726a2cb 100644 --- a/Items/Weapons/Summon/ShellfishStaff.cs +++ b/Items/Weapons/Summon/ShellfishStaff.cs @@ -10,6 +10,9 @@ namespace CalamityMod.Items.Weapons.Summon public class ShellfishStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + + public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 2f; + public override void SetDefaults() { Item.width = 50; diff --git a/Items/Weapons/Summon/Sirius.cs b/Items/Weapons/Summon/Sirius.cs index 1ce98ef7c5..deee425550 100644 --- a/Items/Weapons/Summon/Sirius.cs +++ b/Items/Weapons/Summon/Sirius.cs @@ -13,6 +13,9 @@ namespace CalamityMod.Items.Weapons.Summon public class Sirius : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + + public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 6f; + public override void SetDefaults() { Item.width = Item.height = 62; diff --git a/Items/Weapons/Summon/SquirrelSquireStaff.cs b/Items/Weapons/Summon/SquirrelSquireStaff.cs index 1db1b3dde0..d32e315797 100644 --- a/Items/Weapons/Summon/SquirrelSquireStaff.cs +++ b/Items/Weapons/Summon/SquirrelSquireStaff.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { player.FindSentryRestingSpot(type, out int XPosition, out int YPosition, out int YOffset); - Projectile.NewProjectileDirect(source, new(XPosition, YPosition - YOffset), Vector2.Zero, type, damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, new(XPosition, YPosition - YOffset), Vector2.Zero, type, damage, knockback, player.whoAmI); player.UpdateMaxTurrets(); return false; } diff --git a/Items/Weapons/Summon/TemporalUmbrella.cs b/Items/Weapons/Summon/TemporalUmbrella.cs index 78f850a6cf..592dea16b1 100644 --- a/Items/Weapons/Summon/TemporalUmbrella.cs +++ b/Items/Weapons/Summon/TemporalUmbrella.cs @@ -14,6 +14,9 @@ namespace CalamityMod.Items.Weapons.Summon public class TemporalUmbrella : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + + public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 5f; + public override void SetDefaults() { Item.width = 74; diff --git a/Items/Weapons/Summon/VileFeeder.cs b/Items/Weapons/Summon/VileFeeder.cs index d3e5445a27..b114e35850 100644 --- a/Items/Weapons/Summon/VileFeeder.cs +++ b/Items/Weapons/Summon/VileFeeder.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectileDirect(source, Main.MouseWorld, Main.rand.NextVector2CircularEdge(5f, 5f), type, damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, Main.MouseWorld, Main.rand.NextVector2CircularEdge(5f, 5f), type, damage, knockback, player.whoAmI); return false; } diff --git a/Items/Weapons/Summon/ViridVanguard.cs b/Items/Weapons/Summon/ViridVanguard.cs index 70a121b995..0da9bba37e 100644 --- a/Items/Weapons/Summon/ViridVanguard.cs +++ b/Items/Weapons/Summon/ViridVanguard.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetStaticDefaults() { - Item.staff[Item.type] = true; + Item.staff[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Summon/VoidConcentrationStaff.cs b/Items/Weapons/Summon/VoidConcentrationStaff.cs index 07c45ad056..332e3bc54d 100644 --- a/Items/Weapons/Summon/VoidConcentrationStaff.cs +++ b/Items/Weapons/Summon/VoidConcentrationStaff.cs @@ -12,6 +12,9 @@ namespace CalamityMod.Items.Weapons.Summon public class VoidConcentrationStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + + public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 3f; + public override void SetDefaults() { Item.width = 52; diff --git a/Items/Weapons/Summon/WarloksMoonFist.cs b/Items/Weapons/Summon/WarloksMoonFist.cs index acf57bc377..90bfeb9063 100644 --- a/Items/Weapons/Summon/WarloksMoonFist.cs +++ b/Items/Weapons/Summon/WarloksMoonFist.cs @@ -17,6 +17,8 @@ namespace CalamityMod.Items.Weapons.Summon public const int PunchCooldownTime = 36; + public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 4f; + public override void SetDefaults() { Item.width = 50; diff --git a/Items/Weapons/Summon/WitherBlossomsStaff.cs b/Items/Weapons/Summon/WitherBlossomsStaff.cs index 94ec6fab88..e4ff0d39fd 100644 --- a/Items/Weapons/Summon/WitherBlossomsStaff.cs +++ b/Items/Weapons/Summon/WitherBlossomsStaff.cs @@ -11,6 +11,9 @@ namespace CalamityMod.Items.Weapons.Summon public class WitherBlossomsStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + + public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 2f; + public override void SetDefaults() { Item.width = 52; diff --git a/Items/Weapons/Summon/YharonsKindleStaff.cs b/Items/Weapons/Summon/YharonsKindleStaff.cs index 35ddfb45f2..95a5fe66d0 100644 --- a/Items/Weapons/Summon/YharonsKindleStaff.cs +++ b/Items/Weapons/Summon/YharonsKindleStaff.cs @@ -14,6 +14,9 @@ namespace CalamityMod.Items.Weapons.Summon { public new string LocalizationCategory => "Items.Weapons.Summon"; public const float ReboundRamDamageFactor = 2f; + + public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 5f; + public override void SetDefaults() { Item.width = 80; diff --git a/Items/Weapons/Typeless/Aestheticus.cs b/Items/Weapons/Typeless/Aestheticus.cs index 9bd743083b..a7fa7ed44c 100644 --- a/Items/Weapons/Typeless/Aestheticus.cs +++ b/Items/Weapons/Typeless/Aestheticus.cs @@ -1,6 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Projectiles.Typeless; using Terraria; using Terraria.ID; diff --git a/Items/Weapons/Typeless/RelicOfResilience.cs b/Items/Weapons/Typeless/RelicOfResilience.cs index 0e975a0ab3..3ac122a0b0 100644 --- a/Items/Weapons/Typeless/RelicOfResilience.cs +++ b/Items/Weapons/Typeless/RelicOfResilience.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Typeless public const float WeaknessDR = 0.45f; public override void SetStaticDefaults() { - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Typeless/Skynamite.cs b/Items/Weapons/Typeless/Skynamite.cs index 289b56d692..7b1727b9b0 100644 --- a/Items/Weapons/Typeless/Skynamite.cs +++ b/Items/Weapons/Typeless/Skynamite.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Items.Weapons.Typeless public override void SetStaticDefaults() { Item.ResearchUnlockCount = 99; - ItemID.Sets.ItemsThatCountAsBombsForDemolitionistToSpawn[Item.type] = true; - ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; + ItemID.Sets.ItemsThatCountAsBombsForDemolitionistToSpawn[Type] = true; + ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true; } public override void SetDefaults() diff --git a/Items/Weapons/Typeless/StarStruckWater.cs b/Items/Weapons/Typeless/StarStruckWater.cs index 110edb02eb..e15a08f245 100644 --- a/Items/Weapons/Typeless/StarStruckWater.cs +++ b/Items/Weapons/Typeless/StarStruckWater.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Astral; using CalamityMod.Projectiles.Typeless; using Terraria.ID; using Terraria.ModLoader; @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Typeless public override void SetStaticDefaults() { Item.ResearchUnlockCount = 99; - ItemID.Sets.SortingPriorityTerraforming[Type] = 92; // Blood Water + ItemID.Sets.SortingPriorityTerraforming[Type] = 88; // Blood Water } public override void SetDefaults() diff --git a/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson index a5ac545e8a..3252f4d929 100644 --- a/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson @@ -53,7 +53,7 @@ NPCName: { RaggedCaster: "{$CommonEntries.RaggedCaster}" RaggedCasterOpenCoat: "{$CommonEntries.RaggedCaster}" DungeonGuardian: The Old Man is cursed to never leave nor enter the Dungeon, much less die. Whoever crosses paths with him and dares to descend into those halls shall not pass! - BoneSerpentHead: Mighty serpentine offshoots ruled hell since before history, later led by the exiled Flame Dragon. For such alliance, their obsidian scales were turned to Ash shortly after his demise. Reduced to skeletal husks, they were easily subdued by Demons with stolen Azafurian spells and forced to protect the demonic territory. + BoneSerpentHead: Mighty serpentine beasts ruled hell since before history, later led by the exiled Flame Dragon. For such alliance, their obsidian scales were turned to Ash shortly after his demise. Reduced to skeletal husks, they were easily subdued by Demons with stolen Azafurian spells and forced to protect the demonic territory. Demon: Despite being a primitive civilization, demons populate most of the underworld. Unlike their lesser brothers, they cast shadow magic rather than hell magic. VoodooDemon: Demons have several religious practices, specially sacrifices. They worship the Wall of Flesh ever since it started roaming the underworld, using offerings to draw it closer. RedDevil: Conjuring potent spears of dark magic, these elite demons look after the adventurer that destroyed their perceived deity. diff --git a/Localization/en-US/Mods.CalamityMod.Biomes.hjson b/Localization/en-US/Mods.CalamityMod.Biomes.hjson index aa99aff816..b3057f8810 100644 --- a/Localization/en-US/Mods.CalamityMod.Biomes.hjson +++ b/Localization/en-US/Mods.CalamityMod.Biomes.hjson @@ -76,26 +76,6 @@ AstralUnderground: { TownNPCDialogueName: Underground Astral Infection } -SunkenSeaBurrowsBiome: { - DisplayName: Sunken Sea Burrows Biome - TownNPCDialogueName: the Sunken Sea Burrows Biome -} - -SunkenSeaPolypBiome: { - DisplayName: Sunken Sea Polyp Biome - TownNPCDialogueName: the Sunken Sea Polyp Biome -} - -SunkenSeaReefsBiome: { - DisplayName: Sunken Sea Reefs Biome - TownNPCDialogueName: the Sunken Sea Reefs Biome -} - -SunkenSeaShoresBiome: { - DisplayName: Sunken Sea Shores Biome - TownNPCDialogueName: the Sunken Sea Shores Biome -} - AstralCaveDesert: { DisplayName: Astral Cave Desert TownNPCDialogueName: the Astral Cave Desert @@ -105,3 +85,28 @@ FloralParadiseBiome: { DisplayName: Floral Paradise TownNPCDialogueName: the Floral Paradise } + +BasaltGullyBiome: { + DisplayName: Basalt Gully Biome + TownNPCDialogueName: the Basalt Gully Biome +} + +GleamingBurrowsBiome: { + DisplayName: Gleaming Burrows Biome + TownNPCDialogueName: the Gleaming Burrows Biome +} + +PolypForestBiome: { + DisplayName: Polyp Forest Biome + TownNPCDialogueName: the Polyp Forest Biome +} + +RadiantReefsBiome: { + DisplayName: Radiant Reefs Biome + TownNPCDialogueName: the Radiant Reefs Biome +} + +TimelessShoresBiome: { + DisplayName: Timeless Shores Biome + TownNPCDialogueName: the Timeless Shores Biome +} diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index 99fb0a30ba..be692ba91c 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -10,7 +10,7 @@ BloodyMaryBuff: { CaribbeanRumBuff: { DisplayName: Caribbean Rum - Description: Life regen, movement speed, and wing flight time increased, you are floaty and defense is reduced + Description: Life regen and movement speed increased, you are floaty and defense is reduced } CinnamonRollBuff: { @@ -60,7 +60,7 @@ MoscowMuleBuff: { OldFashionedBuff: { DisplayName: Old Fashioned - Description: Accessory and set bonus damage multiplied, damage reduced + Description: Non-weapon damage increased, weapon damage reduced } RedWineBuff: { @@ -95,7 +95,7 @@ TequilaSunriseBuff: { Trippy: { DisplayName: Trippy - Description: You see the world for what it truly is... and you also have a 50% increase to all damage + Description: You see the world for what it truly is... and you also have a {0}% increase to all damage } VodkaBuff: { @@ -550,12 +550,12 @@ BloodfinBoost: { BoundingBuff: { DisplayName: Bounding - Description: Increased jump height, jump speed, and fall damage resistance + Description: Increased jump speed and height } CalciumBuff: { DisplayName: Calcium - Description: You are immune to fall damage + Description: You take {0}% less knockback } CeaselessHunger: { @@ -565,7 +565,7 @@ CeaselessHunger: { GravityNormalizerBuff: { DisplayName: Gravity Normalizer - Description: Gravity is now normal in space, immunity to distorted + Description: Gravity is now normal in space, immunity to {$BuffName.VortexDebuff} } Omniscience: { @@ -575,7 +575,7 @@ Omniscience: { PhotosynthesisBuff: { DisplayName: Photosynthesis - Description: Life regen boosted, more during daytime, and hearts heal more HP + Description: Hearts heal {0} more HP } ShadowBuff: { @@ -583,18 +583,13 @@ ShadowBuff: { Description: ''' You are a shadow - Rogue weapons spawn projectiles on hit - 8% boosted stealth generation + {0}% increased stealth generation ''' } Soaring: { DisplayName: Soaring - Description: - ''' - 10% increased wing flight time and speed - True melee hits restore some wing flight time - ''' + Description: "{0}% increased wing flight time and speed" } SulphurskinBuff: { diff --git a/Localization/en-US/Mods.CalamityMod.Common.hjson b/Localization/en-US/Mods.CalamityMod.Common.hjson new file mode 100644 index 0000000000..2033fa3d59 --- /dev/null +++ b/Localization/en-US/Mods.CalamityMod.Common.hjson @@ -0,0 +1,19 @@ +AbyssLightLevel1: Provides a small amount of light in the abyss +AbyssLightLevel2: Provides a moderate amount of light in the abyss +AbyssLightLevel3: Provides a large amount of light in the abyss +AbyssBreathLevel1: Slightly reduces breath loss in the abyss +AbyssBreathLevel2: Moderately reduces breath loss in the abyss +AbyssBreathLevel3: Greatly reduces breath loss in the abyss +AlcoholWarning: Drinking more than 3 different alcohols might not end well with your liver +CanMineUelibloom: Can mine Uelibloom Ore +NotConsumable: Not consumable +RogueDamage: "{0}% increased rogue damage" +RogueCrit: "{0}% increased rogue critical strike chance" +RogueVelocity: "{0}% increased rogue velocity" +GrappleStats: + ''' + Reach: {0} tiles + Launch Velocity: {1} + Reelback Velocity: {2} + Pull Velocity: {3} + ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson index 9c5d7534b1..c4bc5e8be1 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson @@ -43,7 +43,7 @@ ExodusWings: { Acceleration multiplier: 2.5 Great vertical speed Flight time: 180 - 5% increased rogue damage and critical strike chance while wearing the Empyrean Armor + Grants permanent Empyrean Wrath and Empyrean Rage while wearing the Empyrean armor Pulsing with an alien heartbeat ''' } @@ -56,7 +56,6 @@ HadalMantle: { Acceleration multiplier: 1.5 Average vertical speed Flight time: 180 - 5% increased damage while wearing the Hydrothermic Armor Fueled by the fury of the depths ''' } @@ -122,7 +121,6 @@ SoulofCryogen: { Acceleration multiplier: 1.0 Average vertical speed Flight time: 120 - 7% increase to all damage Icicles rain down as you fly ''' } @@ -132,10 +130,9 @@ StarlightWings: { Tooltip: ''' Horizontal speed: 7.50 - Acceleration multiplier: 1.0 + Acceleration multiplier: 1.5 Average vertical speed - Flight time: 150 - 5% increased damage and critical strike chance while wearing the Daedalus Armor + Flight time: 160 Wings of the Nightingale ''' } @@ -148,7 +145,7 @@ TarragonWings: { Acceleration multiplier: 2.5 Great vertical speed Flight time: 250 - +15 defense and +1 HP/s life regen while wearing the Tarragon Armor + +15 defense and +1 HP/s life regen 'Born of the jungle' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index a39b718568..6312122e3e 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -303,7 +303,7 @@ BlazingCore: { Upon shattering, holy stars spiral outwards and you only take 1 damage After shattering, this damage reduction effect goes on cooldown Damage parried whilst on cooldown summons additional healing stars, and will not be reduced - Provides a moderate amount of light in the Abyss + {$Common.AbyssLightLevel2} ''' } @@ -826,7 +826,7 @@ GiantPearl: { You have a light aura around you Enemies within the aura are slowed down You release homing prism shards while an enemy is slowed - Provides a small amount of light in the abyss + {$Common.AbyssLightLevel1} ''' } @@ -1046,7 +1046,7 @@ LumenousAmulet: { ''' Attacks inflict Crush Depth and you are immune to it and Riptide While in the abyss you gain 25% increased max life - Provides a moderate amount of light in the abyss + {$Common.AbyssLightLevel2} ''' } @@ -1814,7 +1814,7 @@ TheCamper: { You deal 90% less damage unless stationary Standing still grants buffs depending on held item, and creates a damaging aura around you While moving, you regenerate health as if standing still - Provides a small amount of light in the Abyss + {$Common.AbyssLightLevel1} 'In rest may we find victory' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson index d3c1dfc482..cf8aa9a644 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson @@ -57,7 +57,7 @@ Bloodfin: { ''' Grants a buff that grants +2.5 HP/s life regen This buff directly restores HP if below 75% health - 10 second duration + {$CommonItemTooltip.SecondDuration} 'The wonders of angiogenesis' ''' } @@ -163,13 +163,7 @@ RustedJingleBell: { SerpentsBite: { DisplayName: Serpent's Bite - Tooltip: - ''' - Reach: 28.125 - Launch Velocity: 18 - Reelback Velocity: 14 - Pull Velocity: 12 - ''' + Tooltip: "{$Common.GrappleStats}" } Serpentuna: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson b/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson index 0415dd9a88..e6c83d21fe 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson @@ -73,21 +73,6 @@ CoreofCalamity: { Tooltip: "" } -CoreofEleum: { - DisplayName: Core of Eleum - Tooltip: "" -} - -CoreofHavoc: { - DisplayName: Core of Havoc - Tooltip: "" -} - -CoreofSunlight: { - DisplayName: Core of Sunlight - Tooltip: "" -} - CorrodedFossil: { DisplayName: Corroded Fossil Tooltip: It's very sturdy diff --git a/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson index b5b842c7a5..c3949d7f1d 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson @@ -10,7 +10,7 @@ AlphaSeaMinnowGoldItem: { } AndroombaItem: { - DisplayName: "{$Mods.CalamityMod.NPCs.Androomba.DisplayName}" + DisplayName: "{$NPCs.Androomba.DisplayName}" Tooltip: ''' Press on the roomba with a solution to insert it @@ -19,12 +19,12 @@ AndroombaItem: { } BabyCannonballJellyfishItem: { - DisplayName: "{$Mods.CalamityMod.NPCs.BabyCannonballJellyfish.DisplayName}" + DisplayName: "{$NPCs.BabyCannonballJellyfish.DisplayName}" Tooltip: "" } BabyFlakCrabItem: { - DisplayName: "{$Mods.CalamityMod.NPCs.BabyFlakCrab.DisplayName}" + DisplayName: "{$NPCs.BabyFlakCrab.DisplayName}" Tooltip: "" } @@ -59,7 +59,7 @@ NanodroidDysfunctionalItem: { } NanodroidItem: { - DisplayName: "{$Mods.CalamityMod.NPCs.Nanodroid.DisplayName}" + DisplayName: "{$NPCs.Nanodroid.DisplayName}" Tooltip: "" } @@ -124,17 +124,17 @@ PolypPanaseaTurquoiseItem: { } PiggyItem: { - DisplayName: "{$Mods.CalamityMod.NPCs.Piggy.DisplayName}" + DisplayName: "{$NPCs.Piggy.DisplayName}" Tooltip: "" } RepairUnitItem: { - DisplayName: "{$Mods.CalamityMod.NPCs.RepairUnitCritter.DisplayName}" + DisplayName: "{$NPCs.RepairUnitCritter.DisplayName}" Tooltip: "" } SeaMinnowItem: { - DisplayName: "{$Mods.CalamityMod.NPCs.SeaMinnow.DisplayName}" + DisplayName: "{$NPCs.SeaMinnow.DisplayName}" Tooltip: "" } @@ -144,16 +144,19 @@ SeaMinnowGoldItem: { } ShroombleItem: { - DisplayName: "{$Mods.CalamityMod.NPCs.Shroomble.DisplayName}" + DisplayName: "{$NPCs.Shroomble.DisplayName}" Tooltip: "" } TwinklerItem: { - DisplayName: "{$Mods.CalamityMod.NPCs.Twinkler.DisplayName}" + DisplayName: "{$NPCs.Twinkler.DisplayName}" Tooltip: "" } // Permanent Boosters +AdrenalineBoosterTooltip: Permanently increases {$Buffs.AdrenalineMode.DisplayName} damage by {0}% and damage reduction by {1}% +RageBoosterTooltip: Permanently increases the duration of {$Buffs.RageMode.DisplayName} by {0} second + CelestialOnion: { DisplayName: Celestial Onion Tooltip: @@ -173,15 +176,8 @@ CometShard: { ''' } -Ectoheart: { - DisplayName: Ectoheart - Tooltip: Permanently increases Adrenaline Mode damage by 20% and damage reduction by 5% -} - -ElectrolyteGelPack: { - DisplayName: Electrolyte Gel Pack - Tooltip: Permanently increases Adrenaline Mode damage by 20% and damage reduction by 5% -} +Ectoheart.DisplayName: Ectoheart +ElectrolyteGelPack.DisplayName: Electrolyte Gel Pack EtherealCore: { DisplayName: Ethereal Core @@ -192,10 +188,7 @@ EtherealCore: { ''' } -InfernalBlood: { - DisplayName: Infernal Blood - Tooltip: Permanently increases the duration of Rage Mode by 1 second -} +InfernalBlood.DisplayName: Infernal Blood MiracleFruit: { DisplayName: Miracle Fruit @@ -207,9 +200,16 @@ MiracleFruit: { ''' } -MushroomPlasmaRoot: { - DisplayName: Mushroom Plasma Root - Tooltip: Permanently increases the duration of Rage Mode by 1 second +MushroomPlasmaRoot.DisplayName: Mushroom Plasma Root + +NimbleBounder: { + DisplayName: Nimble Bounder + Tooltip: + ''' + Permanently increases movement and jump speed by {0}% + Permanently increases acceleration by {1}% + [c/842593:'Might be useful for speedrunning'] + ''' } PhantomHeart: { @@ -221,10 +221,7 @@ PhantomHeart: { ''' } -RedLightningContainer: { - DisplayName: Red Lightning Container - Tooltip: Permanently increases the duration of Rage Mode by 1 second -} +RedLightningContainer.DisplayName: Red Lightning Container SacredStrawberry: { DisplayName: Sacred Strawberry @@ -246,10 +243,7 @@ SanguineTangerine: { ''' } -StarlightFuelCell: { - DisplayName: Starlight Fuel Cell - Tooltip: Permanently increases Adrenaline Mode damage by 20% and damage reduction by 5% -} +StarlightFuelCell.DisplayName: Starlight Fuel Cell TaintedCloudberry: { DisplayName: Tainted Cloudberry @@ -363,12 +357,21 @@ BrimstoneLocus: { MomentumCapacitor: { DisplayName: Momentum Capacitor - Tooltip: + GFBName: Burden Breaker + Tooltip: "[GFB]" + TooltipNormal: ''' While using the Momentum Capacitor, your top speed will continuously and uncontrollably increase This effect only works if there are no bosses alive ''' + TooltipGFB: + ''' + The good time + Go fast + WARNING: May have disastrous results + Only works if there are no bosses alive + ''' } NormalityRelocator: { @@ -376,7 +379,7 @@ NormalityRelocator: { Tooltip: ''' Press [KEY] to teleport to the position of the mouse - Fall speed is doubled for 30 frames after teleporting + Fall speed is doubled for 0.5 seconds after teleporting Teleportation is disabled while Chaos State is active Works while in the inventory 'I'll be there in the blink of an eye' @@ -389,7 +392,7 @@ RelicOfConvergence: { ''' Creates a profaned crystal that charges power Holding out the crystal slows the player down - At the end of its life, the crystal heals the player for 70 HP + At the end of its life, the crystal heals the player for {0} HP ''' } @@ -424,13 +427,3 @@ SuperDummy: { Right click to kill all super dummies ''' } - -NimbleBounder: { - DisplayName: Nimble Bounder - Tooltip: - ''' - Permanently increases movement and jump speed by 5% - Permanently increases acceleration by 10% - [c/842593:'Might be useful for speedrunning'] - ''' -} diff --git a/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson b/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson index ba0af93915..06dae2e293 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson @@ -36,7 +36,7 @@ ChromaticOrb: { Tooltip: ''' Summons an ancient dragon light pet that highlights nearby enemies and danger sources - Provides a small amount of light in the abyss + {$Common.AbyssLightLevel1} 'It glows warmly in your hand' ''' } @@ -56,7 +56,7 @@ EnchantedButterfly: { Tooltip: ''' Summons a mysterious dragonfly light pet - Provides a small amount of light in the abyss + {$Common.AbyssLightLevel1} 'Feed him butterflies to keep him strong!' ''' } @@ -106,7 +106,7 @@ LittleLight: { Tooltip: ''' Summons a small construct that follows you and provides a great amount of light - Provides a large amount of light in the abyss + {$Common.AbyssLightLevel3} 'It's been looking for you for a long time' ''' } @@ -136,7 +136,7 @@ RadiatingCrystal: { Tooltip: ''' Summons a radiator light pet - Provides a small amount of light in the abyss + {$Common.AbyssLightLevel1} 'The crystal contains traces of holothurin' ''' } @@ -184,7 +184,7 @@ ThiefsDime: { Tooltip: ''' Summons Goldie the rogue coin to collect nearby coins and light your way - Provides a small amount of light in the abyss + {$Common.AbyssLightLevel1} 'Once worthless treasure, now a relic of a thief's companionship' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index 0792c83768..c986fbeaf8 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -116,6 +116,8 @@ CryonicBrick: { Tooltip: "" } +// Draedon Structures + AgedLaboratoryConsoleItem: { DisplayName: Aged Laboratory Console Tooltip: "" @@ -279,6 +281,8 @@ SecurityChest: { Tooltip: "" } +// End of Draedon Structures + EutrophicGlass: { DisplayName: Eutrophic Glass Tooltip: "" @@ -294,6 +298,30 @@ HardenedEutrophicSand: { Tooltip: "" } +// Floral Paradise + +AlgalSlateItem: { + DisplayName: Algal Slate + Tooltip: "" +} + +PeatItem: { + DisplayName: Peat + Tooltip: "" +} + +PeatMossItem: { + DisplayName: Peat Moss + Tooltip: "" +} + +ScintillatingBloom: { + DisplayName: Scintillating Bloom + Tooltip: "" +} + +// End of Floral Paradise + AbyssTreasureChest: { DisplayName: Ancient Treasure Chest Tooltip: "" @@ -742,6 +770,11 @@ RefractivePrismTorch: { Tooltip: Can be placed in water } +RepairUnitCage: { + DisplayName: Repair Unit Cage + Tooltip: "" +} + ResilientCandle: { DisplayName: Resilient Candle Tooltip: @@ -3127,6 +3160,8 @@ LivingPlagueFireBlock: { Tooltip: "" } +// Music Boxes + DraedonExoSelectMusicBox: { DisplayName: Music Box (Exo Mech Selection) Tooltip: Plays 'Signal Received' by CDMusic @@ -3137,51 +3172,6 @@ DraedonTalkMusicBox: { Tooltip: Plays a variant of 'Signal Received' by CDMusic } -Basalt: { - DisplayName: Basalt - Tooltip: "" -} - -Driftwood: { - DisplayName: Driftwood - Tooltip: "" -} - -Navystone: { - DisplayName: Navystone - Tooltip: "" -} - -Shellstone: { - DisplayName: Shellstone - Tooltip: "" -} - -PolishedNavystoneBrick: { - DisplayName: Polished Navystone Brick - Tooltip: "" -} - -ShellstoneSlab: { - DisplayName: Shellstone Slab - Tooltip: "" -} - -BlackPearlPile: { - DisplayName: Black Pearl Pile - Tooltip: "" -} - -PinkPearlPile: { - DisplayName: Pink Pearl Pile - Tooltip: "" -} - -WhitePearlPile: { - DisplayName: White Pearl Pile - Tooltip: "" -} - NovaeSlag: { DisplayName: Novae Slag Tooltip: "" @@ -3347,6 +3337,105 @@ SulphurousShale: { Tooltip: "" } +// Sunken Sea + +Basalt: { + DisplayName: Basalt + Tooltip: "" +} + +Driftwood: { + DisplayName: Driftwood + Tooltip: "" +} + +Navystone: { + DisplayName: Navystone + Tooltip: "" +} + +Shellstone: { + DisplayName: Shellstone + Tooltip: "" +} + +PolishedNavystoneBrick: { + DisplayName: Polished Navystone Brick + Tooltip: "" +} + +ShellstoneSlab: { + DisplayName: Shellstone Slab + Tooltip: "" +} + +BlackPearlPile: { + DisplayName: Black Pearl Pile + Tooltip: "" +} + +PinkPearlPile: { + DisplayName: Pink Pearl Pile + Tooltip: "" +} + +WhitePearlPile: { + DisplayName: White Pearl Pile + Tooltip: "" +} + +CyanCoral: { + DisplayName: Cyan Coral + Tooltip: "" +} + +MagentaCoral: { + DisplayName: Magenta Coral + Tooltip: "" +} + +OrangeCoral: { + DisplayName: Orange Coral + Tooltip: "" +} + +LimeCoral: { + DisplayName: Lime Coral + Tooltip: "" +} + +YellowCoral: { + DisplayName: Yellow Coral + Tooltip: "" +} + +Runestone: { + DisplayName: Runestone + Tooltip: "" +} + +RuneSand: { + DisplayName: Runesand + Tooltip: "" +} + +Limestone: { + DisplayName: Limestone + Tooltip: "" +} + +PolypSand: { + DisplayName: Polyp Sand + Tooltip: "" +} + +VolcanicSand: { + DisplayName: Volcanic Sand + Tooltip: "" +} + +// End of Sunken Sea + UelibloomBrick: { DisplayName: Uelibloom Brick Tooltip: "" @@ -3452,6 +3541,8 @@ CryonicBrickWall: { Tooltip: "" } +// Draedon + HazardChevronWall: { DisplayName: Hazard Chevron Wall Tooltip: "" @@ -3492,6 +3583,13 @@ RustedPlatingWall: { Tooltip: "" } +// End of Draedon + +DriftwoodWall: { + DisplayName: Driftwood Wall + Tooltip: "" +} + ElumplateWall: { DisplayName: Elumplate Wall Tooltip: "" @@ -3597,6 +3695,11 @@ ProfanedSlabWall: { Tooltip: "" } +PyreMantleWall: { + DisplayName: Pyre Mantle Wall + Tooltip: "" +} + RunicProfanedBrickWall: { DisplayName: Runic Profaned Brick Wall Tooltip: "" @@ -3789,83 +3892,3 @@ WaterTurret: { Cannot attack while a boss is alive ''' } - -CyanCoral: { - DisplayName: Cyan Coral - Tooltip: "" -} - -MagentaCoral: { - DisplayName: Magenta Coral - Tooltip: "" -} - -OrangeCoral: { - DisplayName: Orange Coral - Tooltip: "" -} - -LimeCoral: { - DisplayName: Lime Coral - Tooltip: "" -} - -YellowCoral: { - DisplayName: Yellow Coral - Tooltip: "" -} - -Runestone: { - DisplayName: Runestone - Tooltip: "" -} - -RuneSand: { - DisplayName: Runesand - Tooltip: "" -} - -Limestone: { - DisplayName: Limestone - Tooltip: "" -} - -PolypSand: { - DisplayName: Polyp Sand - Tooltip: "" -} - -VolcanicSand: { - DisplayName: Volcanic Sand - Tooltip: "" -} - -DriftwoodWall: { - DisplayName: Driftwood Wall - Tooltip: "" -} - -AlgalSlateItem: { - DisplayName: Algal Slate - Tooltip: "" -} - -PeatItem: { - DisplayName: Peat - Tooltip: "" -} - -PeatMossItem: { - DisplayName: Peat Moss - Tooltip: "" -} - -ScintillatingBloom: { - DisplayName: Scintillating Bloom - Tooltip: "" -} - -PyreMantleWall: { - DisplayName: Pyre Mantle Wall - Tooltip: "" -} diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index bcbcf33076..d74b52a29a 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -5,12 +5,16 @@ AnechoicCoating: { AstralInjection: { DisplayName: Astral Injection - Tooltip: Gives mana sickness and hurts you when used, but you regenerate mana extremely quickly even while moving or casting spells + Tooltip: + ''' + Restores {0} mana per second + Lower your health by {1} and inflicts {$BuffName.ManaSickness} when used + ''' } AureusCell: { DisplayName: Aureus Cell - Tooltip: Grants increased mana regeneration and magic power + Tooltip: Grants the {$BuffName.MagicPower} and {$BuffName.ManaRegeneration} buffs } Baguette: { @@ -18,7 +22,7 @@ Baguette: { Tooltip: ''' {$CommonItemTooltip.MinorStats} - Red Wine heals 250 HP, but reduces life regen by 2 HP/s + {$Potions.RedWine.DisplayName} heals {0} HP, but reduces life regen by {1} HP/s [c/FCE391:'je suis Monte'] ''' } @@ -34,12 +38,12 @@ BlasphemousDonut: { BoundingPotion: { DisplayName: Bounding Potion - Tooltip: 5% increased jump speed, 25 extra blocks of fall damage resistance, and increased jump height + Tooltip: "{0}% increased jump speed and {1}% increased jump height" } CalciumPotion: { DisplayName: Calcium Potion - Tooltip: Grants immunity to fall damage + Tooltip: Grants {0}% knockback resistance } CeaselessHungerPotion: { @@ -67,29 +71,29 @@ Fabsoup: { FlaskOfBrimstone: { DisplayName: Flask of Brimstone - Tooltip: Melee, Whip, and Rogue attacks inflict Brimstone Flames + Tooltip: Melee, Whip, and Rogue attacks inflict {$Buffs.BrimstoneFlames.DisplayName} } FlaskOfCrumbling: { DisplayName: Flask of Crumbling - Tooltip: Melee, Whip, and Rogue attacks inflict Crumbling on enemies + Tooltip: Melee, Whip, and Rogue attacks inflict {$Buffs.Crumbling.DisplayName} } FlaskOfHolyFlames: { DisplayName: Flask of Holy Flames - Tooltip: Melee, Whip, and Rogue attacks inflict Holy Flames + Tooltip: Melee, Whip, and Rogue attacks inflict {$Buffs.HolyFlames.DisplayName} } GravityNormalizerPotion: { DisplayName: Gravity Normalizer Potion - Tooltip: Disables the low gravity of space and grants immunity to the distorted debuff + Tooltip: Disables the low gravity of space and grants immunity to the {$BuffName.VortexDebuff} debuff } HadalStew: { DisplayName: Hadal Stew Tooltip: ''' - Only gives [S] seconds of Potion Sickness + Only gives [S] seconds of {$BuffName.PotionSickness} {$CommonItemTooltip.MediumStats} {$CommonItemTooltip.MinuteDuration} ''' @@ -102,12 +106,7 @@ OmegaHealingPotion: { PhotosynthesisPotion: { DisplayName: Photosynthesis Potion - Tooltip: - ''' - Grants +0.5 HP/s life regen and accelerates natural life regen while not moving - This natural life regen effect is five times as strong during daytime - Dropped hearts heal more HP - ''' + Tooltip: Dropped hearts heal {0} more HP } PotionofOmniscience: { @@ -123,21 +122,15 @@ ShadowPotion: { DisplayName: Shadow Potion Tooltip: ''' + {0}% increased stealth generation Turns the player into a shadow with glowing eyes - Rogue weapons spawn projectiles on hit - 8% increased stealth generation Visual effects can be disabled with the Stealth Invisibility config ''' } SoaringPotion: { DisplayName: Soaring Potion - Tooltip: - ''' - 10% increased flight time and horizontal flight speed - Restores a fraction of your wing flight time after a true melee strike - The amount of flight time restored scales with your melee stats and weapon swing speed - ''' + Tooltip: "{0}% increased flight time and horizontal flight speed" } SulphurskinPotion: { @@ -170,9 +163,9 @@ BloodyMary: { DisplayName: Bloody Mary Tooltip: ''' - 10% increased damage and movement speed during a Blood Moon - Reduces life regen by 2 HP/s and defense by 4% - Drinking more than 3 different alcohols might not end well with your liver + {0}% increased damage and movement speed during a Blood Moon + Reduces life regen by {1} HP/s and defense by {2} + {$Common.AlcoholWarning} [c/B00BA5:'Extra spicy... and bloody!'] ''' } @@ -181,9 +174,9 @@ CaribbeanRum: { DisplayName: Caribbean Rum Tooltip: ''' - Increases life regen by 1 HP/s, movement speed by 10% and wing flight time by 20% - Makes you floaty and reduces defense by 10% - Drinking more than 3 different alcohols might not end well with your liver + Increases life regen by {0} HP/s, movement speed by {1}% + Makes you floaty and reduces defense by {2}% + {$Common.AlcoholWarning} [c/B00BA5:'Why is the rum gone?'] ''' } @@ -192,9 +185,9 @@ CinnamonRoll: { DisplayName: Cinnamon Roll Tooltip: ''' - Increases mana regeneration rate and multiplies all fire-based debuff damage by 1.5x - Reduces defense by 10% - Drinking more than 3 different alcohols might not end well with your liver + Multiplies all fire-based debuff damage by {0}x and increases mana regeneration + Reduces defense by {1}% + {$Common.AlcoholWarning} [c/B00BA5:'A great-tasting cinnamon whiskey with a touch of cream soda.'] ''' } @@ -203,10 +196,10 @@ Everclear: { DisplayName: Everclear Tooltip: ''' - 25% increased damage - Reduces life regen by 5 HP/s and defense by 30% - Counts as 2 alcohols for Alcohol Poisoning - Drinking more than 3 different alcohols might not end well with your liver + {0}% increased damage + Reduces life regen by {1} HP/s and defense by {2}% + Counts as 2 alcohols for {$Buffs.AlcoholPoisoning.DisplayName} + {$Common.AlcoholWarning} [c/B00BA5:'This is the most potent booze I have, be careful with it.'] ''' } @@ -215,9 +208,9 @@ EvergreenGin: { DisplayName: Evergreen Gin Tooltip: ''' - Multiplies all sickness and water-related debuff damage by 1.25x - Reduces life regen by 0.5 HP/s - Drinking more than 3 different alcohols might not end well with your liver + Multiplies all sickness and water-related debuff damage by {0}x + Reduces life regen by {1} HP/s + {$Common.AlcoholWarning} [c/B00BA5:'It tastes like a Christmas tree, if you can imagine that.'] ''' } @@ -226,9 +219,9 @@ FabsolsVodka: { DisplayName: Fabsol's Vodka Tooltip: ''' - 8% increased damage, but lowers defense by 5% + {0}% increased damage, but lowers defense by {1}% Increases immune time after being struck - Drinking more than 3 different alcohols might not end well with your liver + {$Common.AlcoholWarning} This magical liquor is highly sought by those with a refined palate ''' } @@ -237,9 +230,9 @@ Fireball: { DisplayName: Fireball Tooltip: ''' - Multiplies all fire-based debuff damage by 1.25x - Reduces life regen by 0.5 HP/s - Drinking more than 3 different alcohols might not end well with your liver + Multiplies all fire-based debuff damage by {0}x + Reduces life regen by {1} HP/s + {$Common.AlcoholWarning} [c/B00BA5:'A great-tasting cinnamon whiskey.'] ''' } @@ -248,8 +241,8 @@ GrapeBeer: { DisplayName: Grape Beer Tooltip: ''' - Reduces defense by 3% for 15 seconds - Drinking more than 3 different alcohols might not end well with your liver + Reduces defense by {0}% for {1} seconds + {$Common.AlcoholWarning} [c/B00BA5:'This crap is abhorrent, but you might like it.'] ''' } @@ -259,10 +252,10 @@ Margarita: { Tooltip: ''' Halves the duration of most harmful debuffs - Reduces defense by 6% and life regen by 0.5 HP/s - Drinking more than 3 different alcohols might not end well with your liver - 3 minute duration + Reduces defense by {0}% and life regen by {1} HP/s + {$Common.AlcoholWarning} [c/B00BA5:'One of the best drinks ever created, enjoy it while it lasts.'] + {$CommonItemTooltip.MinuteDuration@2} ''' } @@ -270,9 +263,9 @@ Moonshine: { DisplayName: Moonshine Tooltip: ''' - Increases defense by 10 and damage reduction by 3% - Reduces life regen by 0.5 HP/s - Drinking more than 3 different alcohols might not end well with your liver + Increases defense by {0} and damage reduction by {1}% + Reduces life regen by {2} HP/s + {$Common.AlcoholWarning} [c/B00BA5:'This stuff is pretty strong, but I'm sure you can handle it.'] ''' } @@ -281,9 +274,9 @@ MoscowMule: { DisplayName: Moscow Mule Tooltip: ''' - Increases damage by 9%, knockback by 50% and critical strike chance by 3% - Reduces life regen by 2 HP/s - Drinking more than 3 different alcohols might not end well with your liver + Increases damage by {0}%, knockback by {1}% and critical strike chance by {2}% + Reduces life regen by {3} HP/s + {$Common.AlcoholWarning} [c/B00BA5:'I once heard the copper mug can be toxic and I told 'em, 'listen, dummy, I'm already poisoning myself!''] ''' } @@ -303,9 +296,9 @@ OldFashioned: { DisplayName: Old Fashioned Tooltip: ''' - Multiplies all accessory and set bonus damage by 1.5x - Decreases all damage by 25% - Drinking more than 3 different alcohols might not end well with your liver + Multiplies most non-weapon, non-debuff damage by {0}x + Multiplies all weapon damage by {1}x + {$Common.AlcoholWarning} [c/B00BA5:'An old favorite of mine.'] ''' } @@ -314,8 +307,8 @@ RedWine: { DisplayName: Red Wine Tooltip: ''' - Reduces life regen by 0.5 HP/s for 15 seconds - Drinking more than 3 different alcohols might not end well with your liver + Reduces life regen by {0} HP/s for {1} seconds + {$Common.AlcoholWarning} [c/B00BA5:'Too dry for my taste.'] ''' } @@ -324,9 +317,9 @@ Rum: { DisplayName: Rum Tooltip: ''' - Increases life regen by 1 HP/s and movement speed by 10% - Reduces defense by 5% - Drinking more than 3 different alcohols might not end well with your liver + Increases life regen by {0} HP/s and movement speed by {1}% + Reduces defense by {2}% + {$Common.AlcoholWarning} [c/B00BA5:'Sweet and potent, just how I like it.'] ''' } @@ -335,9 +328,9 @@ Screwdriver: { DisplayName: Screwdriver Tooltip: ''' - Multiplies piercing projectile damage by 1.05x - Reduces life regen by 0.5 HP/s - Drinking more than 3 different alcohols might not end well with your liver + Multiplies piercing projectile damage by {0}x + Reduces life regen by {1} HP/s + {$Common.AlcoholWarning} [c/B00BA5:'Do you have a screw loose?'] ''' } @@ -346,10 +339,10 @@ StarBeamRye: { DisplayName: Star Beam Rye Tooltip: ''' - Increases max mana by 50, magic damage by 8%, - and reduces mana usage by 10% - Reduces defense by 6% and life regen by 1 HP/s - Drinking more than 3 different alcohols might not end well with your liver + Increases max mana by {0}, magic damage by {1}%, + and reduces mana usage by {2}% + Reduces defense by {3}% and life regen by {4} HP/s + {$Common.AlcoholWarning} [c/B00BA5:'Made from some stuff I found near the Astral Meteor crash site. Don't worry, it's safe, trust me...'] ''' } @@ -358,9 +351,9 @@ Tequila: { DisplayName: Tequila Tooltip: ''' - Increases knockback by 10%, crit chance by 4% and defense by 5 during daytime - Reduces life regen by 0.5 HP/s - Drinking more than 3 different alcohols might not end well with your liver + Increases knockback by {0}%, crit chance by {1}% and defense by {2} during daytime + Reduces life regen by {3} HP/s + {$Common.AlcoholWarning} [c/B00BA5:'Great for mixing up daytime drinks.'] ''' } @@ -369,9 +362,9 @@ TequilaSunrise: { DisplayName: Tequila Sunrise Tooltip: ''' - Increases knockback by 20%, crit chance by 8% and defense by 10 during daytime - Reduces life regen by 1 HP/s - Drinking more than 3 different alcohols might not end well with your liver + Increases knockback by {0}%, crit chance by {1}% and defense by {2} during daytime + Reduces life regen by {3} HP/s + {$Common.AlcoholWarning} [c/B00BA5:'The greatest daytime drink I've ever had.'] ''' } @@ -380,9 +373,9 @@ Vodka: { DisplayName: Vodka Tooltip: ''' - Increases damage by 6% and critical strike chance by 2% - Reduces life regen by 0.5 HP/s and defense by 5% - Drinking more than 3 different alcohols might not end well with your liver + Increases damage by {0}% and critical strike chance by {1}% + Reduces life regen by {2} HP/s and defense by {3}% + {$Common.AlcoholWarning} [c/B00BA5:'The number one alcohol for creating great mixed drinks.'] ''' } @@ -391,9 +384,9 @@ Whiskey: { DisplayName: Whiskey Tooltip: ''' - Increases damage by 4%, knockback by 20% and critical strike chance by 2% - Reduces defense by 5% - Drinking more than 3 different alcohols might not end well with your liver + Increases damage by {0}%, knockback by {1}% and critical strike chance by {2}% + Reduces defense by {3}% + {$Common.AlcoholWarning} [c/B00BA5:'The burning sensation makes it tastier.'] ''' } @@ -402,9 +395,9 @@ WhiteWine: { DisplayName: White Wine Tooltip: ''' - Increases magic damage by 8% - Reduces defense by 6% and life regen by 0.5 HP/s - Drinking more than 3 different alcohols might not end well with your liver + Increases magic damage by {0}% + Reduces defense by {1}% and life regen by {2} HP/s + {$Common.AlcoholWarning} [c/B00BA5:'I drank a full barrel of this stuff once in one night, I couldn't remember who I was the next day.'] ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson index 01cfba0221..6363622e50 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson @@ -4,7 +4,7 @@ Abombination: { ''' Summons the Plaguebringer Goliath when used in the Jungle Enrages outside the Jungle - Not consumable + {$Common.NotConsumable} 'Radio capable of emitting a frequency recognized by the Plague nanovirus.' ''' } @@ -15,13 +15,13 @@ AstralChunk: { ''' Summons Astrum Aureus when used in the Astral Infection Enrages during the day while outside the Astral Infection - Not consumable + {$Common.NotConsumable} 'The Infection's fortress has found another target.' ''' } BloodwormItem: { - DisplayName: Bloodworm + DisplayName: "{$NPCs.BloodwormNormal.DisplayName}" Tooltip: ''' Summons The Old Duke if used as bait in the Sulphurous Sea @@ -35,7 +35,7 @@ BloodyWormFood: { ''' Summons the Perforator Hive when used in the Crimson Enrages outside the Underground Crimson - Not consumable + {$Common.NotConsumable} 'Do not play with your food, they won't play with theirs.' ''' } @@ -45,7 +45,7 @@ CausticTear: { Tooltip: ''' Causes an acidic downpour in the Sulphurous Sea - Not consumable + {$Common.NotConsumable} ''' } @@ -54,7 +54,7 @@ CeremonialUrn: { Tooltip: ''' Use at the Altar of the Accursed to summon the Supreme Witch, Calamitas - Not consumable + {$Common.NotConsumable} 'The Witch will not allow it to happen once again.' ''' } @@ -65,7 +65,7 @@ CharredIdol: { ''' Summons the Brimstone Elemental when used in the Brimstone Crags Enrages outside the Brimstone Crags - Not consumable + {$Common.NotConsumable} 'Anything under her gaze shall be scorched beyond recognition.' ''' } @@ -75,7 +75,7 @@ CosmicWorm: { Tooltip: ''' Summons the Devourer of Gods - Not consumable + {$Common.NotConsumable} 'The Nameless Serpent has set out for you.' ''' } @@ -87,7 +87,7 @@ CryoKey: { ''' [SPAWN] Enrages outside the tundra - Not consumable + {$Common.NotConsumable} 'A key for a glacial prison.' ''' SpawnNormal: Summons Cryogen when used in the tundra @@ -99,7 +99,7 @@ DeathWhistle: { Tooltip: ''' Summons the Ravager - Not consumable + {$Common.NotConsumable} 'One of the few sounds the flesh golem still recognizes.' ''' } @@ -110,7 +110,7 @@ DecapoditaSprout: { ''' Summons Crabulon when used in the Mushroom biome Enrages outside the Underground Mushroom biome - Not consumable + {$Common.NotConsumable} 'Bristling with the spores of a unique, parasitic strain.' ''' } @@ -121,7 +121,7 @@ DesertMedallion: { ''' Summons the Desert Scourge when used in the Desert Enrages outside the Desert - Not consumable + {$Common.NotConsumable} 'The Scourge seeks for another meal.' ''' } @@ -131,7 +131,7 @@ EidolonTablet: { Tooltip: ''' Summons the Lunatic Cultist - Not consumable + {$Common.NotConsumable} 'An aged artifact venerated by the Dragon Cult.' ''' } @@ -142,7 +142,7 @@ ExoticPheromones: { ''' Summons Dragonfolly when used in the Jungle Enrages outside the Jungle - Not consumable + {$Common.NotConsumable} 'Pheromones used for hunting Draconic Offshoots.' ''' } @@ -154,7 +154,7 @@ EyeofDesolation: { ''' Summons the Calamitas Clone when used during nighttime[GFB] Enrages during the day - Not consumable + {$Common.NotConsumable} 'She is here.' ''' GFBInfo: Creates a square arena of blocks, with you at its center @@ -167,7 +167,7 @@ MarkofProvidence: { An ornate sigil of the Profaned Flame Hatred yet burns upon its brow [SPAWN] - Not consumable + {$Common.NotConsumable} ''' SpawnInfo: Such power attracts otherworldly beings SpawnVoid: @@ -184,7 +184,7 @@ MartianDistressRemote: { Tooltip: ''' Summons the Martian Madness - Not consumable + {$Common.NotConsumable} ''' } @@ -193,7 +193,7 @@ NecroplasmicBeacon: { Tooltip: ''' Summons Polterghast when used in the Dungeon - Not consumable + {$Common.NotConsumable} 'The wails of the spirits disturbed something far more terrifying.' ''' } @@ -208,7 +208,7 @@ OverloadedSludge: { Tooltip: ''' Summons the Slime God - Not consumable + {$Common.NotConsumable} 'Writhing and bloated with the pus of Gods long dead.' ''' } @@ -219,7 +219,7 @@ Portabulb: { ''' Summons Plantera when used in the Jungle Enrages outside the Underground Jungle - Not consumable + {$Common.NotConsumable} ''' } @@ -230,7 +230,7 @@ ProfanedCore: { Summons Providence when used in the Hallow or Underworld Unique drop changes depending on the biome fought in Enrages when fought during nighttime - Not consumable + {$Common.NotConsumable} 'The heart of Her Guardians, Her wicked wrath shall burn upon whoever now wields it.' ''' } @@ -240,7 +240,7 @@ ProfanedShard: { Tooltip: ''' [SPAWN] - Not consumable + {$Common.NotConsumable} 'Her Guardians seek the holder of such vast stolen power.' ''' SpawnNormal: @@ -256,7 +256,7 @@ SandstormsCore: { Tooltip: ''' Summons the Great Sand Shark when used in the [BIOME] - Not consumable + {$Common.NotConsumable} ''' } @@ -266,7 +266,7 @@ Seafood: { ''' Summons the Aquatic Scourge when used in the Sulphurous Sea Enrages outside the Sulphurous Sea - Not consumable + {$Common.NotConsumable} 'Large bait for a large catch. Beware the monsters of the seas.' ''' } @@ -287,7 +287,7 @@ Teratoma: { ''' Summons the Hive Mind when used in the Corruption Enrages outside the Underground Corruption - Not consumable + {$Common.NotConsumable} 'An exquisitely hideous tumor for those diseased in the head.' ''' } @@ -304,7 +304,7 @@ YharonEgg: { ''' Summons Yharon, Dragon of Rebirth Enrages outside the fire walls - Not consumable + {$Common.NotConsumable} 'A symbol of the Dragon watching over and waiting for you.' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson index a0f7a6e3ff..d3dc035ccd 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson @@ -72,10 +72,7 @@ BobbitHook: { Tooltip: ''' Retracts upon attaching to a tile with extreme speeds - Reach: 40 - Launch Velocity: 25 - Reelback Velocity: 28 - Pull Velocity: 24 + {$Common.GrappleStats} ''' } @@ -124,7 +121,7 @@ Gelpick: { GenesisPickaxe: { DisplayName: Genesis Pickaxe - Tooltip: Can mine Uelibloom Ore + Tooltip: "{$Common.CanMineUelibloom}" } Grax: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 74798b1f01..c4034eb974 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -1094,8 +1094,8 @@ SlickCane: { Tooltip: ''' Swipes a cane that steals money from enemies - Stealth strikes gives a 1 in 20 chance for enemies to drop 1-3 gold coins when hit - Stealth strikes' damage increases in proportion to money in the inventory (up to 2 platinum) + Stealth strikes give a 1 in 20 chance for enemies to drop 1-2 gold coins when hit + Stealth strikes' damage increases in proportion to money in the inventory (up to 5 platinum, gamble wisely) 'Economy at its finest' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Misc.hjson index c760c5c7dc..11e02904a6 100644 --- a/Localization/en-US/Mods.CalamityMod.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Misc.hjson @@ -33,6 +33,14 @@ PlanetoidSchematicRecipeCondition: Place a schematic from the lab in the large p JungleSchematicRecipeCondition: Place a schematic from the lab deep within the jungle in your inventory at least once UnderworldSchematicRecipeCondition: Place a schematic from the lab near the edges of the underworld in your inventory at least once IceSchematicRecipeCondition: Place a schematic from the lab within the frozen caverns in your inventory at least once +// Schematic Knowledge tooltips +SchematicKnowledgeTooltip: You don't have sufficient knowledge to create this yet +SchematicKnowledgeTooltip2: A specific schematic must be deciphered first +Tier1KnowledgeTooltip: The Sunken Sea schematic must be deciphered first +Tier2KnowledgeTooltip: The Planetoid schematic must be deciphered first +Tier3KnowledgeTooltip: The Jungle schematic must be deciphered first +Tier4KnowledgeTooltip: The Underworld schematic must be deciphered first +Tier5KnowledgeTooltip: The Ice biome schematic must be deciphered first // Other CombatText uses and Item Messages ShiftToExpand: Hold SHIFT to see an expanded description LearnedSchematic: You learned how to create new things! @@ -67,3 +75,5 @@ Polaris4: You let Polaris cuddle your arm Polaris5: You pet Polaris // Point Blank PointBlank: Does extra damage to enemies shot at point-blank range +// Charge +Charge: Current Charge: {0}% diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson index f0d5855965..886ebbdb7c 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -121,6 +121,7 @@ SulphuricAcidBubbleFriendly.DisplayName: Acid Bubble SulphurousSandBallGun.DisplayName: Sulphurous Sand TarraEnergy.DisplayName: Tarra Energy TarragonAura.DisplayName: Tarragon Aura +TatteredFairyDust.DisplayName: Tattered Fairy Dust TeslaAura.DisplayName: Tesla's Electricity TitanHeartBoom.DisplayName: Titan Heart Boom UrsaSlash.DisplayName: Ursa Slash diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson index da33d395bd..4f7221a84d 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson @@ -41,6 +41,11 @@ SetBonus: { Cold enemies will deal reduced contact damage to the player Provides immunity to the Chilled, Frozen, Frostburn and Glacial State debuffs ''' + Forbidden: + ''' + {$LegacyTooltip.48} {$ArmorSetBonus.Forbidden} + Minions no longer deal less damage while wielding magic weapons + ''' Frost: ''' Melee and ranged attacks inflict Frostbite @@ -101,8 +106,7 @@ SetBonus: { ''' Obsidian: ''' - Increases whip range by 50% and speed by 35% - Increases minion damage by 15% + {$ArmorSetBonus.ObsidianOutlaw} Grants immunity to fire blocks and temporary immunity to lava ''' Palladium: diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index 72448ef62f..00bc5775fe 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -1,3 +1,272 @@ +DodgeInfo: + ''' + Grants the ability to dodge attacks + Attacks that deal less than 5% of your max life in damage will not be dodged + The dodge has a cooldown that ranges between {0} and {1} seconds depending on the dodged attack's damage + The cooldown is shared with all other dodges and reflects + ''' + +AddedTooltip: { + TruffleWorm: + ''' + Summons Duke Fishron if used as bait in the Ocean + Enrages outside the Ocean + ''' + SlimeGun: Slimed enemies take more damage from fire-based debuffs + FleshKnucklesLine: Max life increased by 45 + RodofDiscord: Teleportation is disabled while Chaos State is active + Pwnhammer: + ''' + Demon Altars now drop Souls of Night instead of generating ores when destroyed + Hardmode ores now generate after defeating Mechanical Bosses for the first time + ''' + // Life Drain + SoulDrain: + ''' + This grants +1.5 HP/s life regen and accelerates natural life regen + Life drain stacks based on the number of enemies being hit + ''' + WarmthPotion: Greatly reduces the duration of Chilled, Frozen, and Glacial State + HandWarmer: Provides a regeneration boost while wearing the Snow armor + GoldenFishingRod: Its fishing line will never break + Tombstones: + ''' + 13 of any tombstone turns the surrounding area into a graveyard + Graveyards have various new item sales and recipes + ''' + DeathSickle: Inflicts Whispering Death on hit + HellfireTreads: + ''' + Multiplies all fire-based debuff damage by 1.5x, does not stack with downgrades + All attacks inflict Hellfire + ''' + FairyBoots: + ''' + Fairies can spawn at any time on the surface and spawn far more frequently + Nearby fairies grant +2 HP/s life regen, 10 defense and 10% movement speed + Fairies are immune to damage and will no longer flee + ''' + MoonStone: Reduces the damage of the Nightwither debuff + SunStone: Reduces the damage of the Daybroken debuff + CelestialStone: Reduces the damage of the Nightwither and Daybroken debuffs + ArcaneFlower: 5% increased magic damage + RifleScope: The scope effect can be toggled with visibility + FeatherfallPotion: Disables all airborne flight recovery + TitanGloveLine: 10% increased true melee damage + YoyoGlove: Secondary yoyos will do 50% less damage + DefensePrefix: +{0}% damage reduction + LuckyPrefix: +0.05 luck + /* + Armor + */ + CopperHelmet: 5% increased damage + CopperChainmail: 3% increased critical strike chance + CopperGreaves: 5% increased movement speed + TinHelmet: 3% increased critical strike chance + TinChainmail: +0.5 HP/s life regen + TinGreaves: 5% increased movement speed + IronPieces: Increases damage reduction by 3% + LeadPieces: Increases damage reduction by 2% + SilverHelmet: 5% increased critical strike chance + SilverChainmail: +1 HP/s life regen + SilverGreaves: 8% increased movement speed + TungstenHelmet: 7% increased damage + TungstenChainmail: +0.5 HP/s life regen + TungstenGreaves: 8% increased movement speed + GoldHelmet: 6% increased damage + GoldChainmail: Increases damage reduction by 5% + GoldGreaves: 10% increased movement speed + PlatinumHelmet: 6% increased damage + PlatinumChainmail: 3% increased critical strike chance + PlatinumGreaves: 10% increased movement speed + CrimsonBreastplate: +1 HP/s life regen + CrimsonOtherPieces: +0.5 HP/s life regen + SolarFlarePieces: Grants +1 HP/s life regeneration + Picksaw: Can mine Scoria Ore located in the Abyss +} + +EditedTooltip: { + /* + Boss Summons + */ + Abeemination: + ''' + Summons the Queen Bee when used in the Jungle + Enrages outside the Underground Jungle + ''' + BloodySpine: + ''' + Summons the Brain of Cthulhu when used in the Crimson + Enrages outside the Underground Crimson + ''' + ClothierVoodooDoll: + ''' + While equipped, summons Skeletron when the Clothier is killed during nighttime + Enrages during the day + 'You are a terrible person' + ''' + DeerThing: Summons Deerclops when used in the Snow or Ice biome + GuideVoodooDoll: + ''' + Summons the Wall of Flesh if thrown into lava in the underworld while the Guide is alive + 'You are a terrible person' + ''' + LihzahrdPowerCell: + ''' + Summons the Golem when used at the Lihzahrd Altar + Enrages outside the Jungle Temple + ''' + MechanicalEye: + ''' + Summons The Twins when used during nighttime + Enrages during the day + ''' + MechanicalSkull: + ''' + Summons Skeletron Prime when used during nighttime + Enrages during the day + ''' + MechanicalWorm: + ''' + Summons The Destroyer when used during nighttime + Enrages during the day + ''' + QueenSlimeCrystal: Summons Queen Slime when used in the Hallow + SuspiciousLookingEye: + ''' + Summons the Eye of Cthulhu when used during nighttime + Enrages during the day + ''' + WormFood: + ''' + Summons the Eater of Worlds when used in the Corruption + Enrages outside the Underground Corruption + ''' + MasterExclusive: Master or Revengeance + // Sparkle Slime Balloon + GelBalloon: + ''' + Throws a mixture of slime and sparkling crystals + Slimed enemies take more damage from fire-based debuffs + ''' + AnkhShield1: Grants immunity to knockback + AnkhShield2: Grants immunity to most debuffs, including Mighty Wind + Campfires: Life regen is increased by 0.5 HP/s when near a campfire + HeartLantern: Grants +1 HP/s life regeneration when placed nearby + BottledHoney: + ''' + Grants +1 HP/s life regen for a short time + Grants an additional +1 HP/s life regen while inflicted with a damaging debuff + ''' + ShinyStone: Grants +2 HP/s life regen and accelerates natural life regen when not moving + BandofRegeneration: Grants +1 HP/s life regeneration + CharmofMyths: Grants +1 HP/s life regeneration and reduces the cooldown of healing potions by 25% + RegenerationPotion: Provides +2 HP/s life regeneration + HamBat: Defeating enemies temporarily grants +3 HP/s life regen + // Arcane Crystal + AegisCrystal: Permanently boosts natural life regeneration + ArcheryPotion: 20% increased arrow speed and 5% increased arrow damage + IronskinPotion: Increase defense by {0} + // Aerial Bane + DD2BetsyBow: Shoots a tight spread of 6 splitting arrows + AleSake: + ''' + Increases melee damage by 10% and reduces defense by 5% + Counts as an alcohol for Alcohol Poisoning + {$Common.AlcoholWarning} + ''' + FlameWakerBoots: + ''' + Multiplies all fire-based debuff damage by 1.25x + All attacks light enemies on fire + 'Never get cold feet again' + ''' + SunMoonStones: critical strike chance, life regeneration, + MagnetFlower: 10% reduced mana cost + ArcaneFlowerManaCloak: 12% reduced mana cost + Magiluminescence: + ''' + Increases movement acceleration and deceleration by 1.75x + Increases movement speed by 1.15x. This bonus applies to running boot accessories + ''' + FrogLeg: Increases jump speed by {0}% and allows auto-jump + // Soaring Insignia + EmpressFlightBooster1: Increases wing flight time by 25% + EmpressFlightBooster2: Increases movement and jump speed by 10% and acceleration by 1.1x + RifleScope1: Increase view range for guns (Right click to zoom out) + RifleScope2: The scope effect can be toggled with visibility + SniperScope: 7% increased ranged damage and critical strike chance + MagicQuiver: Increases arrow damage by 5% and greatly increases arrow speed + MoltenQuiver1: Increases arrow damage by 7% and greatly increases arrow speed + MoltenQuiver2: Lights wooden arrows ablaze and all arrows inflict Hellfire + MagicPowerPotion: 10% increased magic damage + MagicHat: 6% increased magic critical strike chance + PowerGlove: 10% increased melee speed, does not stack with downgrades + BerserkerGlove: 10% increased true melee damage + MechanicalGlove: + ''' + 12% increased melee damage + 12% increased melee speed, does not stack with downgrades + ''' + FireGauntlet1: Increases melee knockback and melee attacks inflict Hellfire + FireGauntlet2: + ''' + 14% increased melee damage + 14% increased melee speed, does not stack with downgrades + ''' + ObsidianSkullLine: Grants immunity to the Burning and On Fire! debuffs + LavaWaders: Grants immunity to the Burning and On Fire! debuffs, and 7 seconds of immunity to lava + Gi: 10% increased movement and jump speed + GoldPickaxe: Can mine Demonite, Crimtane, Meteorite, Sea Prisms, and Sea Prism Crystals + FlaskofCursedFlames: Melee, Whip, and Rogue attacks inflict enemies with cursed flames + FlaskofFire: Melee, Whip, and Rogue attacks set enemies on fire + FlaskofGold: Melee, Whip, and Rogue attacks make enemies drop more gold + FlaskofIchor: Melee, Whip, and Rogue attacks decrease enemies defense + FlaskofNanites: Melee, Whip, and Rogue attacks confuse enemies + FlaskofParty: All attacks cause confetti to appear + FlaskofPoison: Melee, Whip, and Rogue attacks poison enemies + FlaskofVenom: Melee, Whip, and Rogue attacks inflict Acid Venom on enemies + /* + OOA sets + */ + SquireGreatHelm: Increases your max number of sentries by 1 and grants +2 HP/s life regen + SquirePlating: 10% increased summon damage and 15% increased melee damage + SquireGreaves: + ''' + 5% increased summon damage and melee critical strike chance + 15% increased movement speed + ''' + MonkBrows: Increases your max number of sentries by 1 and increases melee attack speed by 10% + MonkShirt: 10% increased summon and melee damage + MonkPants1: 5% increased summon damage and melee critical strike chance + MonkPants2: 20% increased movement speed + // Valhalla Knight + SquireAltShirt: 30% increased summon damage and grants +4 HP/s life regen + SquireAltPants: 10% increased summon damage and melee critical strike chance + HuntressJerkin: + ''' + 10% increased summon and ranged damage + 10% chance to not consume ammo + ''' + ApprenticeTrousers: + ''' + 5% increased summon damage and magic critical strike chance + 20% increased movement speed + ''' + // Shinobi Infiltrator + MonkAltHead: + ''' + Increases your max number of sentries by 2 + 10% increased melee and summon damage + ''' + MonkAltShirt: 10% increased summon damage and melee speed + MonkAltPants: 10% increased summon damage and melee critical strike chance + // Red Riding + HuntressAltShirt: 15% increased summon and ranged damage and 20% chance to not consume ammo + // Dark Artist + ApprenticeAltPants: 10% increased summon damage and magic critical strike chance +} + // Buff Descriptions BuffDescription: { Banner: You have increased damage and defense against the following: diff --git a/NPCs/Abyss/BabyCannonballJellyfish.cs b/NPCs/Abyss/BabyCannonballJellyfish.cs index b9dad300de..43e00656d4 100644 --- a/NPCs/Abyss/BabyCannonballJellyfish.cs +++ b/NPCs/Abyss/BabyCannonballJellyfish.cs @@ -23,9 +23,9 @@ namespace CalamityMod.NPCs.Abyss public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 7; - Main.npcCatchable[NPC.type] = true; - NPCID.Sets.CountsAsCritter[NPC.type] = true; + Main.npcFrameCount[Type] = 4; + Main.npcCatchable[Type] = true; + NPCID.Sets.CountsAsCritter[Type] = true; } public override void SetDefaults() @@ -118,7 +118,7 @@ namespace CalamityMod.NPCs.Abyss public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -140,12 +140,12 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); Vector2 vector = center - screenPos; - vector -= new Vector2((float)TextureAssets.Npc[NPC.type].Value.Width, (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; + vector -= new Vector2((float)TextureAssets.Npc[Type].Value.Width, (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type])) * 1f / 2f; vector += halfSizeTexture * 1f + new Vector2(0f, 4f + NPC.gfxOffY); Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(new Color(67, 218, 166)); - Main.spriteBatch.Draw(TextureAssets.Npc[NPC.type].Value, vector, + Main.spriteBatch.Draw(TextureAssets.Npc[Type].Value, vector, new Microsoft.Xna.Framework.Rectangle?(NPC.frame), color, NPC.rotation, halfSizeTexture, 1f, spriteEffects, 0f); } diff --git a/NPCs/Abyss/BabyCannonballJellyfish.png b/NPCs/Abyss/BabyCannonballJellyfish.png index dc393d1f84..484293dd38 100644 Binary files a/NPCs/Abyss/BabyCannonballJellyfish.png and b/NPCs/Abyss/BabyCannonballJellyfish.png differ diff --git a/NPCs/Abyss/Bloatfish.cs b/NPCs/Abyss/Bloatfish.cs index 443f800147..7b49fa7201 100644 --- a/NPCs/Abyss/Bloatfish.cs +++ b/NPCs/Abyss/Bloatfish.cs @@ -2,7 +2,7 @@ using CalamityMod.BiomeManagers; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Terraria; @@ -17,7 +17,7 @@ namespace CalamityMod.NPCs.Abyss { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; } public override void SetDefaults() @@ -179,7 +179,7 @@ namespace CalamityMod.NPCs.Abyss return; } NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/Abyss/BobbitWormHead.cs b/NPCs/Abyss/BobbitWormHead.cs index 17fbd96707..7d28b94911 100644 --- a/NPCs/Abyss/BobbitWormHead.cs +++ b/NPCs/Abyss/BobbitWormHead.cs @@ -18,7 +18,7 @@ namespace CalamityMod.NPCs.Abyss { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { //Preferably would have its head animated, but this will do for now @@ -215,7 +215,7 @@ namespace CalamityMod.NPCs.Abyss public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.1f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/Abyss/BoxJellyfish.cs b/NPCs/Abyss/BoxJellyfish.cs index 7dad04530e..3852e1e332 100644 --- a/NPCs/Abyss/BoxJellyfish.cs +++ b/NPCs/Abyss/BoxJellyfish.cs @@ -17,7 +17,7 @@ namespace CalamityMod.NPCs.Abyss { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers(); value.Position.Y += 10; NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; @@ -183,7 +183,7 @@ namespace CalamityMod.NPCs.Abyss public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/Abyss/CannonballJellyfish.cs b/NPCs/Abyss/CannonballJellyfish.cs index 0cf3d9f2ca..4658c23195 100644 --- a/NPCs/Abyss/CannonballJellyfish.cs +++ b/NPCs/Abyss/CannonballJellyfish.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.Abyss public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 8; + Main.npcFrameCount[Type] = 4; } public override void SetDefaults() @@ -212,8 +212,8 @@ namespace CalamityMod.NPCs.Abyss } } NPC.velocity.Y += 0.1f; - if (currentFrame == 5 && NPC.frameCounter == 0.0) - NPC.velocity.Y = -2.748f; // manually picked value :desolate: + if (currentFrame == 3 && NPC.frameCounter == 0.0) + NPC.velocity.Y = -1.35f; // manually picked value :desolate: // yeah this is desolate indeed _ YuH } else { @@ -224,12 +224,12 @@ namespace CalamityMod.NPCs.Abyss } } - public override void FindFrame(int frameHeight) //8 frames, 78 height + public override void FindFrame(int frameHeight) //4 frames, 78 height { NPC.frameCounter += 1.0; if (NPC.frameCounter >= 7) { - currentFrame = currentFrame == 7 ? 0 : currentFrame + 1; + currentFrame = currentFrame == 3 ? 0 : currentFrame + 1; NPC.netUpdate = true; //update current frame variable NPC.frameCounter = 0; } @@ -254,14 +254,14 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - var texture = TextureAssets.Npc[NPC.type]; - Vector2 halfSizeTexture = new Vector2((float)(texture.Value.Width / 2), (float)(texture.Value.Height / Main.npcFrameCount[NPC.type] / 2)); + var texture = TextureAssets.Npc[Type]; + Vector2 halfSizeTexture = new Vector2((float)(texture.Value.Width / 2), (float)(texture.Value.Height / Main.npcFrameCount[Type] / 2)); Vector2 vector = center - screenPos; - var glowTexture = TextureAssets.Npc[NPC.type]; - vector -= new Vector2((float)glowTexture.Value.Width, (float)(glowTexture.Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; + var glowTexture = TextureAssets.Npc[Type]; + vector -= new Vector2((float)glowTexture.Value.Width, (float)(glowTexture.Value.Height / Main.npcFrameCount[Type])) * 1f / 2f; vector += halfSizeTexture * 1f + new Vector2(0f, 4f + NPC.gfxOffY); Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(new Color(67, 218, 166)); - Main.spriteBatch.Draw(TextureAssets.Npc[NPC.type].Value, vector, + Main.spriteBatch.Draw(TextureAssets.Npc[Type].Value, vector, new Microsoft.Xna.Framework.Rectangle?(NPC.frame), color, NPC.rotation, halfSizeTexture, 1f, spriteEffects, 0f); } diff --git a/NPCs/Abyss/CannonballJellyfish.png b/NPCs/Abyss/CannonballJellyfish.png index 4c0fd135b7..bb2f3a683c 100644 Binary files a/NPCs/Abyss/CannonballJellyfish.png and b/NPCs/Abyss/CannonballJellyfish.png differ diff --git a/NPCs/Abyss/ChaoticPuffer.cs b/NPCs/Abyss/ChaoticPuffer.cs index 30908f86b4..db902d9ae9 100644 --- a/NPCs/Abyss/ChaoticPuffer.cs +++ b/NPCs/Abyss/ChaoticPuffer.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.Abyss public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 11; + Main.npcFrameCount[Type] = 11; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); diff --git a/NPCs/Abyss/ColossalSquid.cs b/NPCs/Abyss/ColossalSquid.cs index e44d689057..569955cea9 100644 --- a/NPCs/Abyss/ColossalSquid.cs +++ b/NPCs/Abyss/ColossalSquid.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.Abyss public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 11; + Main.npcFrameCount[Type] = 11; } public override void SetDefaults() @@ -590,7 +590,7 @@ namespace CalamityMod.NPCs.Abyss { spriteEffects |= SpriteEffects.FlipVertically; } - Main.spriteBatch.Draw(TextureAssets.Npc[NPC.type].Value, + Main.spriteBatch.Draw(TextureAssets.Npc[Type].Value, new Vector2((float)(player.direction * 4), player.gfxOffY) + ((player.gravDir == 1f) ? player.Top : player.Bottom) - screenPos, new Microsoft.Xna.Framework.Rectangle?(NPC.frame), NPC.GetAlpha(color), NPC.rotation, NPC.frame.Size() / 2f, NPC.scale, spriteEffects, 0f); } @@ -608,7 +608,7 @@ namespace CalamityMod.NPCs.Abyss public override void FindFrame(int frameHeight) { NPC.frameCounter += hasBeenHit ? 0.15f : 0.075f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/Abyss/Cuttlefish.cs b/NPCs/Abyss/Cuttlefish.cs index 8aea6c09e2..62edc486a5 100644 --- a/NPCs/Abyss/Cuttlefish.cs +++ b/NPCs/Abyss/Cuttlefish.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.Abyss public static Asset GlowTexture; public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); @@ -345,7 +345,7 @@ namespace CalamityMod.NPCs.Abyss return; } NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/Abyss/DevilFish.cs b/NPCs/Abyss/DevilFish.cs index 9801471135..dd11f84852 100644 --- a/NPCs/Abyss/DevilFish.cs +++ b/NPCs/Abyss/DevilFish.cs @@ -3,7 +3,7 @@ using System.IO; using CalamityMod.BiomeManagers; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Placeables.Ores; using CalamityMod.World; @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.Abyss public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 16; + Main.npcFrameCount[Type] = 16; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { PortraitPositionXOverride = 5f diff --git a/NPCs/Abyss/DevilFishAlt.cs b/NPCs/Abyss/DevilFishAlt.cs index 1bd0141029..4c3a37908c 100644 --- a/NPCs/Abyss/DevilFishAlt.cs +++ b/NPCs/Abyss/DevilFishAlt.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.Abyss public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 16; + Main.npcFrameCount[Type] = 16; this.HideFromBestiary(); if (!Main.dedServ) { diff --git a/NPCs/Abyss/EidolonWyrmBody.cs b/NPCs/Abyss/EidolonWyrmBody.cs index 3e9c9058ea..748681ebdf 100644 --- a/NPCs/Abyss/EidolonWyrmBody.cs +++ b/NPCs/Abyss/EidolonWyrmBody.cs @@ -139,9 +139,9 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); Vector2 vector = center - screenPos; - vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; + vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[Type])) * 1f / 2f; vector += halfSizeTexture * 1f + new Vector2(0f, 4f + NPC.gfxOffY); Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightYellow); Main.spriteBatch.Draw(GlowTexture.Value, vector, diff --git a/NPCs/Abyss/EidolonWyrmBodyAlt.cs b/NPCs/Abyss/EidolonWyrmBodyAlt.cs index b2ce430dea..bbbceef33f 100644 --- a/NPCs/Abyss/EidolonWyrmBodyAlt.cs +++ b/NPCs/Abyss/EidolonWyrmBodyAlt.cs @@ -139,9 +139,9 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); Vector2 vector = center - screenPos; - vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; + vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[Type])) * 1f / 2f; vector += halfSizeTexture * 1f + new Vector2(0f, NPC.gfxOffY); Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(Color.White); Main.spriteBatch.Draw(GlowTexture.Value, vector, diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index 2f16beb288..7058346888 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -4,7 +4,7 @@ using CalamityMod.BiomeManagers; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Pets; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; @@ -437,9 +437,9 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); Vector2 vector = center - screenPos; - vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; + vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[Type])) * 1f / 2f; vector += halfSizeTexture * 1f + new Vector2(0f, NPC.gfxOffY); Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(Color.White); Main.spriteBatch.Draw(GlowTexture.Value, vector, diff --git a/NPCs/Abyss/EidolonWyrmTail.cs b/NPCs/Abyss/EidolonWyrmTail.cs index 6cc97cb4ce..817986fec7 100644 --- a/NPCs/Abyss/EidolonWyrmTail.cs +++ b/NPCs/Abyss/EidolonWyrmTail.cs @@ -139,9 +139,9 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); Vector2 vector = center - screenPos; - vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; + vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[Type])) * 1f / 2f; vector += halfSizeTexture * 1f + new Vector2(0f, 4f + NPC.gfxOffY); Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightYellow); Main.spriteBatch.Draw(GlowTexture.Value, vector, diff --git a/NPCs/Abyss/GiantSquid.cs b/NPCs/Abyss/GiantSquid.cs index 5d2b56da3e..837864953c 100644 --- a/NPCs/Abyss/GiantSquid.cs +++ b/NPCs/Abyss/GiantSquid.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.Abyss public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); @@ -219,7 +219,7 @@ namespace CalamityMod.NPCs.Abyss public override void FindFrame(int frameHeight) { NPC.frameCounter += hasBeenHit ? 0.15f : 0.075f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/Abyss/GulperEelBody.cs b/NPCs/Abyss/GulperEelBody.cs index f5b5530c64..eacba128be 100644 --- a/NPCs/Abyss/GulperEelBody.cs +++ b/NPCs/Abyss/GulperEelBody.cs @@ -147,9 +147,9 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); Vector2 vector = center - screenPos; - vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; + vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[Type])) * 1f / 2f; vector += halfSizeTexture * 1f + new Vector2(0f, NPC.gfxOffY); Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(Color.White); Main.spriteBatch.Draw(GlowTexture.Value, vector, diff --git a/NPCs/Abyss/GulperEelBodyAlt.cs b/NPCs/Abyss/GulperEelBodyAlt.cs index 83b1c8f2ea..6a2b05e6f8 100644 --- a/NPCs/Abyss/GulperEelBodyAlt.cs +++ b/NPCs/Abyss/GulperEelBodyAlt.cs @@ -147,9 +147,9 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); Vector2 vector = center - screenPos; - vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; + vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[Type])) * 1f / 2f; vector += halfSizeTexture * 1f + new Vector2(0f, 4f + NPC.gfxOffY); Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightYellow); Main.spriteBatch.Draw(GlowTexture.Value, vector, diff --git a/NPCs/Abyss/GulperEelHead.cs b/NPCs/Abyss/GulperEelHead.cs index 0187373ba6..113d4a54f1 100644 --- a/NPCs/Abyss/GulperEelHead.cs +++ b/NPCs/Abyss/GulperEelHead.cs @@ -358,9 +358,9 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); Vector2 vector = center - screenPos; - vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; + vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[Type])) * 1f / 2f; vector += halfSizeTexture * 1f + new Vector2(0f, 4f + NPC.gfxOffY); Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightYellow); Main.spriteBatch.Draw(GlowTexture.Value, vector, diff --git a/NPCs/Abyss/GulperEelTail.cs b/NPCs/Abyss/GulperEelTail.cs index b19d2c37e4..b2104ecf9f 100644 --- a/NPCs/Abyss/GulperEelTail.cs +++ b/NPCs/Abyss/GulperEelTail.cs @@ -147,9 +147,9 @@ namespace CalamityMod.NPCs.Abyss spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); Vector2 vector = center - screenPos; - vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; + vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[Type])) * 1f / 2f; vector += halfSizeTexture * 1f + new Vector2(0f, 4f + NPC.gfxOffY); Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightYellow); Main.spriteBatch.Draw(GlowTexture.Value, vector, diff --git a/NPCs/Abyss/Laserfish.cs b/NPCs/Abyss/Laserfish.cs index 9e492a9e95..c5d30564ce 100644 --- a/NPCs/Abyss/Laserfish.cs +++ b/NPCs/Abyss/Laserfish.cs @@ -20,8 +20,8 @@ namespace CalamityMod.NPCs.Abyss public static Asset GlowTexture; public override void SetStaticDefaults() { - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; - Main.npcFrameCount[NPC.type] = 6; + NPCID.Sets.NeedsExpertScaling[Type] = true; + Main.npcFrameCount[Type] = 6; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); @@ -96,7 +96,7 @@ namespace CalamityMod.NPCs.Abyss return; } NPC.frameCounter += NPC.chaseable ? 0.15f : 0.075f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/Abyss/LuminousCorvina.cs b/NPCs/Abyss/LuminousCorvina.cs index 84cb4701f0..1ab39f808a 100644 --- a/NPCs/Abyss/LuminousCorvina.cs +++ b/NPCs/Abyss/LuminousCorvina.cs @@ -4,7 +4,7 @@ using CalamityMod.BiomeManagers; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.Abyss public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 8; + Main.npcFrameCount[Type] = 8; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); diff --git a/NPCs/Abyss/MirageJelly.cs b/NPCs/Abyss/MirageJelly.cs index c6f9f4720e..5147891755 100644 --- a/NPCs/Abyss/MirageJelly.cs +++ b/NPCs/Abyss/MirageJelly.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.Abyss public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 7; + Main.npcFrameCount[Type] = 7; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { PortraitPositionYOverride = 20 @@ -209,7 +209,7 @@ Block: public override void FindFrame(int frameHeight) { NPC.frameCounter += hasBeenHit ? 0.15f : 0.1f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/Abyss/MorayEel.cs b/NPCs/Abyss/MorayEel.cs index da176e194b..43324d7bdc 100644 --- a/NPCs/Abyss/MorayEel.cs +++ b/NPCs/Abyss/MorayEel.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.Abyss { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { Scale = 0.75f, @@ -91,7 +91,7 @@ namespace CalamityMod.NPCs.Abyss public override void FindFrame(int frameHeight) { NPC.frameCounter += NPC.chaseable || NPC.IsABestiaryIconDummy ? 0.15f : 0.075f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/Abyss/ReaperShark.cs b/NPCs/Abyss/ReaperShark.cs index e7ef0e456f..688511587b 100644 --- a/NPCs/Abyss/ReaperShark.cs +++ b/NPCs/Abyss/ReaperShark.cs @@ -3,7 +3,7 @@ using System.IO; using CalamityMod.BiomeManagers; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Potions; using CalamityMod.Items.Weapons.Rogue; @@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.Abyss public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; if (!Main.dedServ) { ManTexture = ModContent.Request(Texture + "Man", AssetRequestMode.ImmediateLoad); @@ -681,7 +681,7 @@ namespace CalamityMod.NPCs.Abyss value.Position.Y -= 50f; NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; NPC.frameCounter += hasBeenHit || NPC.IsABestiaryIconDummy ? 0.15f : 0.075f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * newFrameHeight; } @@ -694,11 +694,11 @@ namespace CalamityMod.NPCs.Abyss SpriteEffects spriteEffects = SpriteEffects.None; if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Asset npcTexture = Main.zenithWorld ? ManTexture : TextureAssets.Npc[NPC.type]; + Asset npcTexture = Main.zenithWorld ? ManTexture : TextureAssets.Npc[Type]; Rectangle nframe = npcTexture.Frame(1, 4, 0, (int)NPC.frameCounter); - Vector2 origin = new Vector2((float)(npcTexture.Value.Width / 2), (float)(npcTexture.Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 origin = new Vector2((float)(npcTexture.Value.Width / 2), (float)(npcTexture.Value.Height / Main.npcFrameCount[Type] / 2)); Vector2 npcOffset = NPC.Center - screenPos; - npcOffset -= new Vector2((float)npcTexture.Value.Width, (float)(npcTexture.Value.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + npcOffset -= new Vector2((float)npcTexture.Value.Width, (float)(npcTexture.Value.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; npcOffset += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(npcTexture.Value, npcOffset, nframe, NPC.GetAlpha(drawColor), NPC.rotation, origin, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/Abyss/SlabCrab.cs b/NPCs/Abyss/SlabCrab.cs index 6d932379ea..0dd0003fcd 100644 --- a/NPCs/Abyss/SlabCrab.cs +++ b/NPCs/Abyss/SlabCrab.cs @@ -2,9 +2,10 @@ using System.IO; using CalamityMod.BiomeManagers; using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Packets; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -41,7 +42,7 @@ namespace CalamityMod.NPCs.Abyss public static Asset GlowTexture; public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 23; + Main.npcFrameCount[Type] = 23; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); @@ -405,7 +406,10 @@ namespace CalamityMod.NPCs.Abyss if (player.ItemAnimationActive) { // ouch! - player.ApplyDamageToNPC(NPC, (int)player.GetDamage(DamageClass.MeleeNoSpeed).ApplyTo(player.HeldItem.damage), 0, player.direction); + Item pick = player.HeldItem; + int pickDamage = (int)player.GetDamage(pick.DamageType).ApplyTo(pick.damage); + Projectile hit = Projectile.NewProjectileDirect(pick.GetSource_FromThis(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), pickDamage, 0f, player.whoAmI, NPC.whoAmI); + hit.DamageType = pick.DamageType; SoundEngine.PlaySound(SoundID.Dig, NPC.Center); // this is the dig sound that shale piles use if (CurrentPhase < (int)AIState.Enraged) { diff --git a/NPCs/Abyss/ToxicMinnow.cs b/NPCs/Abyss/ToxicMinnow.cs index a597cdd249..c1aa1563e4 100644 --- a/NPCs/Abyss/ToxicMinnow.cs +++ b/NPCs/Abyss/ToxicMinnow.cs @@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.Abyss public static Asset GlowTexture; public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { Scale = 0.8f, @@ -164,7 +164,7 @@ namespace CalamityMod.NPCs.Abyss else { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/Abyss/Viperfish.cs b/NPCs/Abyss/Viperfish.cs index bd2e0017c9..d6a26f7d9d 100644 --- a/NPCs/Abyss/Viperfish.cs +++ b/NPCs/Abyss/Viperfish.cs @@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.Abyss public static Asset GlowTexture; public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { PortraitPositionXOverride = 0 @@ -119,7 +119,7 @@ namespace CalamityMod.NPCs.Abyss else { NPC.frameCounter += NPC.chaseable ? 0.15f : 0.075f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/AcidRain/AcidEel.cs b/NPCs/AcidRain/AcidEel.cs index e1744f92d8..195f3ad3d0 100644 --- a/NPCs/AcidRain/AcidEel.cs +++ b/NPCs/AcidRain/AcidEel.cs @@ -30,9 +30,9 @@ namespace CalamityMod.NPCs.AcidRain public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; - NPCID.Sets.TrailingMode[NPC.type] = 1; - NPCID.Sets.TrailCacheLength[NPC.type] = 12; + Main.npcFrameCount[Type] = 6; + NPCID.Sets.TrailingMode[Type] = 1; + NPCID.Sets.TrailCacheLength[Type] = 12; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { PortraitPositionXOverride = 0 @@ -183,7 +183,7 @@ namespace CalamityMod.NPCs.AcidRain { NPC.frameCounter = 0; NPC.frame.Y += frameHeight; - if (NPC.frame.Y >= Main.npcFrameCount[NPC.type] * frameHeight) + if (NPC.frame.Y >= Main.npcFrameCount[Type] * frameHeight) NPC.frame.Y = 0; } } @@ -201,7 +201,7 @@ namespace CalamityMod.NPCs.AcidRain return false; } - Texture2D headTexture = TextureAssets.Npc[NPC.type].Value; + Texture2D headTexture = TextureAssets.Npc[Type].Value; Texture2D tailTexture = TailTexture.Value; Vector2[] segmentPositions = (Vector2[])NPC.oldPos.Clone(); diff --git a/NPCs/AcidRain/BabyFlakCrab.cs b/NPCs/AcidRain/BabyFlakCrab.cs index b712830a88..7c5ee432ec 100644 --- a/NPCs/AcidRain/BabyFlakCrab.cs +++ b/NPCs/AcidRain/BabyFlakCrab.cs @@ -15,9 +15,9 @@ namespace CalamityMod.NPCs.AcidRain { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; - Main.npcCatchable[NPC.type] = true; - NPCID.Sets.CountsAsCritter[NPC.type] = true; + Main.npcFrameCount[Type] = 6; + Main.npcCatchable[Type] = true; + NPCID.Sets.CountsAsCritter[Type] = true; } public override void SetDefaults() @@ -110,7 +110,7 @@ namespace CalamityMod.NPCs.AcidRain { NPC.frame.Y += frameHeight; } - if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[NPC.type]) + if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[Type]) { NPC.frame.Y = frameHeight * 2; } diff --git a/NPCs/AcidRain/BloodwormFleeing.cs b/NPCs/AcidRain/BloodwormFleeing.cs index 95483b5893..8670ed3870 100644 --- a/NPCs/AcidRain/BloodwormFleeing.cs +++ b/NPCs/AcidRain/BloodwormFleeing.cs @@ -11,7 +11,7 @@ namespace CalamityMod.NPCs.AcidRain public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.BloodwormNormal.DisplayName"); public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; this.HideFromBestiary(); } @@ -53,7 +53,7 @@ namespace CalamityMod.NPCs.AcidRain { NPC.frameCounter = 0; NPC.frame.Y += frameHeight; - if (NPC.frame.Y >= Main.npcFrameCount[NPC.type] * frameHeight) + if (NPC.frame.Y >= Main.npcFrameCount[Type] * frameHeight) NPC.frame.Y = 0; } } diff --git a/NPCs/AcidRain/BloodwormNormal.cs b/NPCs/AcidRain/BloodwormNormal.cs index b95a54e1eb..3d61fbbac8 100644 --- a/NPCs/AcidRain/BloodwormNormal.cs +++ b/NPCs/AcidRain/BloodwormNormal.cs @@ -14,9 +14,9 @@ namespace CalamityMod.NPCs.AcidRain { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 7; - Main.npcCatchable[NPC.type] = true; - NPCID.Sets.CountsAsCritter[NPC.type] = true; + Main.npcFrameCount[Type] = 7; + Main.npcCatchable[Type] = true; + NPCID.Sets.CountsAsCritter[Type] = true; } public override void SetDefaults() @@ -93,7 +93,7 @@ namespace CalamityMod.NPCs.AcidRain { NPC.frameCounter = 0; NPC.frame.Y += frameHeight; - if (NPC.frame.Y >= Main.npcFrameCount[NPC.type] * frameHeight) + if (NPC.frame.Y >= Main.npcFrameCount[Type] * frameHeight) { NPC.frame.Y = 0; } @@ -117,6 +117,13 @@ namespace CalamityMod.NPCs.AcidRain int bloodwormAmt = NPC.CountNPCS(NPC.type); float spawnMult = bloodwormAmt > 5 ? 1f : (float)(0.16 * Math.Pow(5 - bloodwormAmt, 2)) + 1f; float baseSpawnRate = DownedBossSystem.downedBoomerDuke ? 0.1f : AcidRainEvent.OldDukeHasBeenEncountered ? 0.4f : 0.2f; + + float luck = spawnInfo.Player.luck; + if (luck > 0f && Main.rand.NextFloat() < luck) + spawnMult *= Main.rand.NextFloat(1f, 2f); + if (luck < 0f && Main.rand.NextFloat() < -luck) + spawnMult *= Main.rand.NextFloat(0.5f, 1f); + float spawnRate = baseSpawnRate * spawnMult; return spawnRate; diff --git a/NPCs/AcidRain/CragmawMire.cs b/NPCs/AcidRain/CragmawMire.cs index e3bfeb7bab..1271b5a888 100644 --- a/NPCs/AcidRain/CragmawMire.cs +++ b/NPCs/AcidRain/CragmawMire.cs @@ -57,7 +57,7 @@ namespace CalamityMod.NPCs.AcidRain public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 2; + Main.npcFrameCount[Type] = 2; NPCID.Sets.BossBestiaryPriority.Add(Type); if (!Main.dedServ) { diff --git a/NPCs/AcidRain/FlakCrab.cs b/NPCs/AcidRain/FlakCrab.cs index b7980242e2..873132f844 100644 --- a/NPCs/AcidRain/FlakCrab.cs +++ b/NPCs/AcidRain/FlakCrab.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.AcidRain public const int TotalHitsNeededToDoDamage = 10; public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 7; + Main.npcFrameCount[Type] = 7; } public override void SetDefaults() @@ -203,7 +203,7 @@ namespace CalamityMod.NPCs.AcidRain { NPC.frame.Y += frameHeight; } - if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[NPC.type]) + if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[Type]) { NPC.frame.Y = frameHeight * 3; // Frames 1 and 2 are for transitioning. Frame 0 is sitting still, and the rest are walking frames } diff --git a/NPCs/AcidRain/GammaSlime.cs b/NPCs/AcidRain/GammaSlime.cs index 1bff89c624..9d06ba61bc 100644 --- a/NPCs/AcidRain/GammaSlime.cs +++ b/NPCs/AcidRain/GammaSlime.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.AcidRain public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 2; + Main.npcFrameCount[Type] = 2; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); @@ -87,7 +87,7 @@ namespace CalamityMod.NPCs.AcidRain NPC.TargetClosest(false); - if (NPC.velocity.Y == 0f && LaserShootCountdown <= 0f && !Target.npcTypeNoAggro[NPC.type]) + if (NPC.velocity.Y == 0f && LaserShootCountdown <= 0f && !Target.npcTypeNoAggro[Type]) { NPC.velocity.X *= 0.8f; @@ -182,7 +182,7 @@ namespace CalamityMod.NPCs.AcidRain // Randomly prepare to shoot a laser. if (Main.netMode != NetmodeID.MultiplayerClient && Math.Abs(Target.Center.X - NPC.Center.X) < 250f && Target.Center.X < NPC.Center.X && - LaserShootCountdown == 0f && Main.rand.NextBool(110) && !Target.npcTypeNoAggro[NPC.type]) + LaserShootCountdown == 0f && Main.rand.NextBool(110) && !Target.npcTypeNoAggro[Type]) { LaserShootCountdown = 600f; NPC.netUpdate = true; diff --git a/NPCs/AcidRain/IrradiatedSlime.cs b/NPCs/AcidRain/IrradiatedSlime.cs index f87cbec471..dfb1a632f8 100644 --- a/NPCs/AcidRain/IrradiatedSlime.cs +++ b/NPCs/AcidRain/IrradiatedSlime.cs @@ -19,7 +19,7 @@ namespace CalamityMod.NPCs.AcidRain public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 2; + Main.npcFrameCount[Type] = 2; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); diff --git a/NPCs/AcidRain/Mauler.cs b/NPCs/AcidRain/Mauler.cs index 0f071d3313..1f9307fc45 100644 --- a/NPCs/AcidRain/Mauler.cs +++ b/NPCs/AcidRain/Mauler.cs @@ -51,7 +51,7 @@ namespace CalamityMod.NPCs.AcidRain public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 8; + Main.npcFrameCount[Type] = 8; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -163,7 +163,7 @@ namespace CalamityMod.NPCs.AcidRain NPC.frameCounter++; if (NPC.frameCounter >= 5) { - CurrentFrame = (CurrentFrame + 1) % Main.npcFrameCount[NPC.type]; + CurrentFrame = (CurrentFrame + 1) % Main.npcFrameCount[Type]; NPC.frameCounter = 0; } @@ -228,7 +228,7 @@ namespace CalamityMod.NPCs.AcidRain NPC.frameCounter++; if (NPC.frameCounter >= 5) { - CurrentFrame = (CurrentFrame + 1) % Main.npcFrameCount[NPC.type]; + CurrentFrame = (CurrentFrame + 1) % Main.npcFrameCount[Type]; NPC.frameCounter = 0; } @@ -331,7 +331,7 @@ namespace CalamityMod.NPCs.AcidRain NPC.frameCounter++; if (NPC.frameCounter >= (hasCharged ? 4 : 7)) { - CurrentFrame = (CurrentFrame + 1) % Main.npcFrameCount[NPC.type]; + CurrentFrame = (CurrentFrame + 1) % Main.npcFrameCount[Type]; NPC.frameCounter = 0; } @@ -423,7 +423,7 @@ namespace CalamityMod.NPCs.AcidRain public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; Texture2D glowmask = GlowTexture.Value; Vector2 drawPosition = NPC.Center - screenPos + Vector2.UnitY * NPC.gfxOffY; Vector2 origin = NPC.frame.Size() * 0.5f; @@ -447,7 +447,7 @@ namespace CalamityMod.NPCs.AcidRain NPC.frameCounter++; if (NPC.frameCounter >= 5) { - CurrentFrame = (CurrentFrame + 1) % Main.npcFrameCount[NPC.type]; + CurrentFrame = (CurrentFrame + 1) % Main.npcFrameCount[Type]; NPC.frameCounter = 0; } } diff --git a/NPCs/AcidRain/NuclearTerror.cs b/NPCs/AcidRain/NuclearTerror.cs index 40ebfeb51d..fb0e57b70f 100644 --- a/NPCs/AcidRain/NuclearTerror.cs +++ b/NPCs/AcidRain/NuclearTerror.cs @@ -87,9 +87,9 @@ namespace CalamityMod.NPCs.AcidRain public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 14; - NPCID.Sets.TrailCacheLength[NPC.type] = 6; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 14; + NPCID.Sets.TrailCacheLength[Type] = 6; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -606,7 +606,7 @@ Continue: NPC.frame.Y = frameHeight * 8; } - if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[NPC.type] && Main.netMode != NetmodeID.MultiplayerClient) + if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[Type] && Main.netMode != NetmodeID.MultiplayerClient) NPC.StrikeInstantKill(); } else if (NPC.frame.Y >= (Walking ? 8 : 4) * frameHeight) diff --git a/NPCs/AcidRain/NuclearToad.cs b/NPCs/AcidRain/NuclearToad.cs index a6bb31d97e..89a6358da2 100644 --- a/NPCs/AcidRain/NuclearToad.cs +++ b/NPCs/AcidRain/NuclearToad.cs @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.AcidRain public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers(); value.Position.Y += 8; value.PortraitPositionYOverride = 28f; @@ -175,7 +175,7 @@ namespace CalamityMod.NPCs.AcidRain { NPC.frameCounter = 0; NPC.frame.Y += frameHeight; - if (NPC.frame.Y >= Main.npcFrameCount[NPC.type] * frameHeight) + if (NPC.frame.Y >= Main.npcFrameCount[Type] * frameHeight) NPC.frame.Y = 0; } } diff --git a/NPCs/AcidRain/Orthocera.cs b/NPCs/AcidRain/Orthocera.cs index 0e8b645054..56bd5315f8 100644 --- a/NPCs/AcidRain/Orthocera.cs +++ b/NPCs/AcidRain/Orthocera.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.AcidRain } public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; } public override void SetDefaults() @@ -244,7 +244,7 @@ namespace CalamityMod.NPCs.AcidRain { NPC.frameCounter = 0; NPC.frame.Y += frameHeight; - if (NPC.frame.Y >= Main.npcFrameCount[NPC.type] * frameHeight) + if (NPC.frame.Y >= Main.npcFrameCount[Type] * frameHeight) NPC.frame.Y = 0; } } diff --git a/NPCs/AcidRain/Radiator.cs b/NPCs/AcidRain/Radiator.cs index fe08379888..5fa6b6b717 100644 --- a/NPCs/AcidRain/Radiator.cs +++ b/NPCs/AcidRain/Radiator.cs @@ -15,7 +15,7 @@ namespace CalamityMod.NPCs.AcidRain { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; } public override void SetDefaults() diff --git a/NPCs/AcidRain/Skyfin.cs b/NPCs/AcidRain/Skyfin.cs index a4b07f269c..8066f0a2cc 100644 --- a/NPCs/AcidRain/Skyfin.cs +++ b/NPCs/AcidRain/Skyfin.cs @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.AcidRain public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { Rotation = MathHelper.Pi @@ -173,7 +173,7 @@ namespace CalamityMod.NPCs.AcidRain { NPC.frameCounter = 0; NPC.frame.Y += frameHeight; - if (NPC.frame.Y >= Main.npcFrameCount[NPC.type] * frameHeight) + if (NPC.frame.Y >= Main.npcFrameCount[Type] * frameHeight) NPC.frame.Y = 0; } } diff --git a/NPCs/AcidRain/SulphurousSkater.cs b/NPCs/AcidRain/SulphurousSkater.cs index 83466a2efc..333d378eec 100644 --- a/NPCs/AcidRain/SulphurousSkater.cs +++ b/NPCs/AcidRain/SulphurousSkater.cs @@ -32,9 +32,9 @@ namespace CalamityMod.NPCs.AcidRain public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; - NPCID.Sets.TrailingMode[NPC.type] = 1; - NPCID.Sets.TrailCacheLength[NPC.type] = 6; + Main.npcFrameCount[Type] = 5; + NPCID.Sets.TrailingMode[Type] = 1; + NPCID.Sets.TrailCacheLength[Type] = 6; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); @@ -225,7 +225,7 @@ namespace CalamityMod.NPCs.AcidRain { NPC.frameCounter = 0; NPC.frame.Y += frameHeight; - if (NPC.frame.Y >= Main.npcFrameCount[NPC.type] * frameHeight) + if (NPC.frame.Y >= Main.npcFrameCount[Type] * frameHeight) NPC.frame.Y = frameHeight; } } diff --git a/NPCs/AcidRain/Trilobite.cs b/NPCs/AcidRain/Trilobite.cs index bea6a87290..f6a51dac40 100644 --- a/NPCs/AcidRain/Trilobite.cs +++ b/NPCs/AcidRain/Trilobite.cs @@ -25,9 +25,9 @@ namespace CalamityMod.NPCs.AcidRain public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 8; - NPCID.Sets.TrailingMode[NPC.type] = 1; - NPCID.Sets.TrailCacheLength[NPC.type] = 5; + Main.npcFrameCount[Type] = 8; + NPCID.Sets.TrailingMode[Type] = 1; + NPCID.Sets.TrailCacheLength[Type] = 5; } public override void SetDefaults() @@ -189,7 +189,7 @@ namespace CalamityMod.NPCs.AcidRain { NPC.frameCounter = 0; NPC.frame.Y += frameHeight; - if (NPC.frame.Y >= Main.npcFrameCount[NPC.type] * frameHeight) + if (NPC.frame.Y >= Main.npcFrameCount[Type] * frameHeight) NPC.frame.Y = 0; } } diff --git a/NPCs/AquaticScourge/AquaticScourgeBody.cs b/NPCs/AquaticScourge/AquaticScourgeBody.cs index 493e6e225d..87686af096 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBody.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBody.cs @@ -100,8 +100,8 @@ namespace CalamityMod.NPCs.AquaticScourge if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 scaledDraw = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 scaledDraw = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / 2); Vector2 drawLocation = NPC.Center - screenPos; drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f; diff --git a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs index 1aa346b1e3..d1bf9bc88f 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs @@ -99,8 +99,8 @@ namespace CalamityMod.NPCs.AquaticScourge if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 scaledDraw = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 scaledDraw = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / 2); Vector2 drawLocation = NPC.Center - screenPos; drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f; diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index b2f01f0710..40cc144e26 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -5,7 +5,7 @@ using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Items.Placeables.Furniture.BossRelics; using CalamityMod.Items.Placeables.Furniture.DevPaintings; using CalamityMod.Items.Placeables.Furniture.Trophies; @@ -144,8 +144,8 @@ namespace CalamityMod.NPCs.AquaticScourge if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 scaledDraw = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 scaledDraw = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / 2); Vector2 drawLocation = NPC.Center - screenPos; drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f; @@ -279,8 +279,6 @@ namespace CalamityMod.NPCs.AquaticScourge CalamityGlobalNPC.SetNewBossJustDowned(NPC); - CalamityGlobalNPC.SetNewShopVariable(new int[] { ModContent.NPCType() }, DownedBossSystem.downedAquaticScourge); - // If Aquatic Scourge has not yet been killed, notify players of buffed Acid Rain if (!DownedBossSystem.downedAquaticScourge) { diff --git a/NPCs/AquaticScourge/AquaticScourgeTail.cs b/NPCs/AquaticScourge/AquaticScourgeTail.cs index 51b0581331..7d9a757ca1 100644 --- a/NPCs/AquaticScourge/AquaticScourgeTail.cs +++ b/NPCs/AquaticScourge/AquaticScourgeTail.cs @@ -99,8 +99,8 @@ namespace CalamityMod.NPCs.AquaticScourge if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 scaledDraw = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 scaledDraw = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / 2); Vector2 drawLocation = NPC.Center - screenPos; drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f; diff --git a/NPCs/Astral/Aries.cs b/NPCs/Astral/Aries.cs index aa9dcdefac..55856d0640 100644 --- a/NPCs/Astral/Aries.cs +++ b/NPCs/Astral/Aries.cs @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.Astral public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 8; + Main.npcFrameCount[Type] = 8; if (!Main.dedServ) glowmask = ModContent.Request("CalamityMod/NPCs/Astral/AriesGlow", AssetRequestMode.AsyncLoad); } diff --git a/NPCs/Astral/Astraglomerate.cs b/NPCs/Astral/Astraglomerate.cs index c96dd91f18..0d611c3384 100644 --- a/NPCs/Astral/Astraglomerate.cs +++ b/NPCs/Astral/Astraglomerate.cs @@ -25,10 +25,10 @@ namespace CalamityMod.NPCs.Astral public override void SetStaticDefaults() { - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; + NPCID.Sets.NeedsExpertScaling[Type] = true; if (!Main.dedServ) glowmask = ModContent.Request("CalamityMod/NPCs/Astral/AstraglomerateGlow", AssetRequestMode.AsyncLoad); - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; } public override void SetDefaults() diff --git a/NPCs/Astral/AstralProbe.cs b/NPCs/Astral/AstralProbe.cs index d2225dbf57..36b0aa784c 100644 --- a/NPCs/Astral/AstralProbe.cs +++ b/NPCs/Astral/AstralProbe.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.Astral public override void SetStaticDefaults() { - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; + NPCID.Sets.NeedsExpertScaling[Type] = true; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); @@ -241,8 +241,8 @@ namespace CalamityMod.NPCs.Astral if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / 2)); Vector2 drawPosition = NPC.Center - screenPos; drawPosition -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * NPC.scale / 2f; drawPosition += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); diff --git a/NPCs/Astral/AstralSlime.cs b/NPCs/Astral/AstralSlime.cs index 4ca16953c3..573a6b45a8 100644 --- a/NPCs/Astral/AstralSlime.cs +++ b/NPCs/Astral/AstralSlime.cs @@ -17,7 +17,7 @@ namespace CalamityMod.NPCs.Astral { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 2; + Main.npcFrameCount[Type] = 2; } public override void SetDefaults() diff --git a/NPCs/Astral/AstralachneaGround.cs b/NPCs/Astral/AstralachneaGround.cs index c73ded94b1..1fb2da6802 100644 --- a/NPCs/Astral/AstralachneaGround.cs +++ b/NPCs/Astral/AstralachneaGround.cs @@ -19,7 +19,7 @@ namespace CalamityMod.NPCs.Astral public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; if (!Main.dedServ) glowmask = ModContent.Request("CalamityMod/NPCs/Astral/AstralachneaGroundGlow", AssetRequestMode.AsyncLoad); diff --git a/NPCs/Astral/AstralachneaWall.cs b/NPCs/Astral/AstralachneaWall.cs index 3cd1da8ea0..5d7d5d3d00 100644 --- a/NPCs/Astral/AstralachneaWall.cs +++ b/NPCs/Astral/AstralachneaWall.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.Astral public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.AstralachneaGround.DisplayName"); public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; if (!Main.dedServ) glowmask = ModContent.Request("CalamityMod/NPCs/Astral/AstralachneaWallGlow", AssetRequestMode.AsyncLoad); @@ -84,7 +84,7 @@ namespace CalamityMod.NPCs.Astral if (NPC.IsABestiaryIconDummy) { NPC.frameCounter += 0.1f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; NPC.frame.Y = (int)NPC.frameCounter * frameHeight; return; } diff --git a/NPCs/Astral/Atlas.cs b/NPCs/Astral/Atlas.cs index 6b3506c7f9..5036e8b734 100644 --- a/NPCs/Astral/Atlas.cs +++ b/NPCs/Astral/Atlas.cs @@ -103,7 +103,7 @@ namespace CalamityMod.NPCs.Astral public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; //not really important seeing as custom drawing, but for heights sake, 6 //also it's visuals are messed up on npc spawners etc. because the sheet is 3 wide. //not much we can do. looks fine in-game so /shrug @@ -584,7 +584,7 @@ namespace CalamityMod.NPCs.Astral SpriteEffects effect = NPC.direction == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; //draw actual sprite - spriteBatch.Draw(TextureAssets.Npc[NPC.type].Value, position, NPC.frame, + spriteBatch.Draw(TextureAssets.Npc[Type].Value, position, NPC.frame, drawColor, 0f, default, 1f, //color, rotation, origin, scale effect, 0f); //effect, drawlayer diff --git a/NPCs/Astral/FusionFeeder.cs b/NPCs/Astral/FusionFeeder.cs index da14fee88e..27def2f9a5 100644 --- a/NPCs/Astral/FusionFeeder.cs +++ b/NPCs/Astral/FusionFeeder.cs @@ -46,7 +46,7 @@ namespace CalamityMod.NPCs.Astral value.Position.X += 40f; value.Position.Y -= 6f; NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; } public override void SetDefaults() @@ -128,9 +128,6 @@ namespace CalamityMod.NPCs.Astral // Move towards the target and lunge at them, releasing meteors. if (attemptingToAttackTarget) { - // Set damage - NPC.damage = NPC.defDamage; - NPC.TargetClosest(true); NPC.velocity += new Vector2(NPC.direction, NPC.directionY) * 0.15f; NPC.velocity.X = MathHelper.Clamp(NPC.velocity.X, -6f, 6f); @@ -170,9 +167,6 @@ namespace CalamityMod.NPCs.Astral } else { - // Avoid cheap bullshit - NPC.damage = 0; - // Rebound on collision. if (NPC.collideX) { @@ -218,9 +212,6 @@ namespace CalamityMod.NPCs.Astral } else { - // Avoid cheap bullshit - NPC.damage = 0; - if (NPC.velocity.Y == 0f) { // Search for any potential closer targets if attempting to attack. @@ -293,7 +284,7 @@ namespace CalamityMod.NPCs.Astral drawColor = Color.White; //draw shark - spriteBatch.Draw(TextureAssets.Npc[NPC.type].Value, NPC.Center - screenPos + offset, NPC.frame, drawColor, NPC.rotation, origin, 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); + spriteBatch.Draw(TextureAssets.Npc[Type].Value, NPC.Center - screenPos + offset, NPC.frame, drawColor, NPC.rotation, origin, 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); //draw glowmask spriteBatch.Draw(glowmask.Value, NPC.Center - screenPos + offset, NPC.frame, Color.White * 0.6f, NPC.rotation, origin, 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); diff --git a/NPCs/Astral/Glomerling.cs b/NPCs/Astral/Glomerling.cs index f8e2103c9d..282113e9cd 100644 --- a/NPCs/Astral/Glomerling.cs +++ b/NPCs/Astral/Glomerling.cs @@ -24,10 +24,11 @@ namespace CalamityMod.NPCs.Astral { if (!Main.dedServ) glowmask = ModContent.Request("CalamityMod/NPCs/Astral/GlomerlingGlow", AssetRequestMode.AsyncLoad); - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers(); value.Position.Y -= 8; NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; + NPCID.Sets.PositiveNPCTypesExcludedFromDeathTally[Type] = true; } public override void SetDefaults() @@ -42,6 +43,7 @@ namespace CalamityMod.NPCs.Astral NPC.knockBackResist = 0.5f; NPC.noGravity = true; NPC.value = Item.buyPrice(0, 0, 1, 0); + Banner = ModContent.NPCType(); if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 50; diff --git a/NPCs/Astral/Hadarian.cs b/NPCs/Astral/Hadarian.cs index 4285e7dcbf..1d50003cf1 100644 --- a/NPCs/Astral/Hadarian.cs +++ b/NPCs/Astral/Hadarian.cs @@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.Astral value.Position.X += 10f; value.Position.Y += 10f; NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; - Main.npcFrameCount[NPC.type] = 7; + Main.npcFrameCount[Type] = 7; } public override void SetDefaults() @@ -158,7 +158,7 @@ namespace CalamityMod.NPCs.Astral Vector2 position = NPC.Bottom - new Vector2(19f, 42f); //20 34 38 42 Rectangle src = new Rectangle(20, 34, 38, 42); - spriteBatch.Draw(TextureAssets.Npc[NPC.type].Value, position - screenPos, src, drawColor, NPC.rotation, default, 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); + spriteBatch.Draw(TextureAssets.Npc[Type].Value, position - screenPos, src, drawColor, NPC.rotation, default, 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); //draw glowmask spriteBatch.Draw(glowmask.Value, position - screenPos, src, Color.White * 0.6f, NPC.rotation, default, 1f, NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); return false; diff --git a/NPCs/Astral/Mantis.cs b/NPCs/Astral/Mantis.cs index 19c0124778..de94ff79cf 100644 --- a/NPCs/Astral/Mantis.cs +++ b/NPCs/Astral/Mantis.cs @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.Astral public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 14; + Main.npcFrameCount[Type] = 14; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { PortraitPositionYOverride = 0 diff --git a/NPCs/Astral/Nova.cs b/NPCs/Astral/Nova.cs index f95173b076..0f8ba1f673 100644 --- a/NPCs/Astral/Nova.cs +++ b/NPCs/Astral/Nova.cs @@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.Astral public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 8; + Main.npcFrameCount[Type] = 8; if (!Main.dedServ) glowmask = ModContent.Request("CalamityMod/NPCs/Astral/NovaGlow", AssetRequestMode.AsyncLoad); diff --git a/NPCs/Astral/SightseerCollider.cs b/NPCs/Astral/SightseerCollider.cs index 6bb7b11bb1..aa5b562749 100644 --- a/NPCs/Astral/SightseerCollider.cs +++ b/NPCs/Astral/SightseerCollider.cs @@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.Astral public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; if (!Main.dedServ) glowmask = ModContent.Request("CalamityMod/NPCs/Astral/SightseerColliderGlow", AssetRequestMode.AsyncLoad); diff --git a/NPCs/Astral/SightseerSpitter.cs b/NPCs/Astral/SightseerSpitter.cs index 48e7e95ff2..44d62a6bdf 100644 --- a/NPCs/Astral/SightseerSpitter.cs +++ b/NPCs/Astral/SightseerSpitter.cs @@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.Astral public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; if (!Main.dedServ) glowmask = ModContent.Request("CalamityMod/NPCs/Astral/SightseerSpitterGlow", AssetRequestMode.AsyncLoad); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() @@ -195,7 +195,6 @@ namespace CalamityMod.NPCs.Astral public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 1; NPCID.Sets.ProjectileNPC[Type] = true; } @@ -251,12 +250,11 @@ namespace CalamityMod.NPCs.Astral { if (modifiers.GetDamage(NPC.damage, 0f, 0f) > 0) { - if (target.HasNPCBannerBuff(ModContent.NPCType())) + int parent = ModContent.NPCType(); + if (target.HasNPCBannerBuff(parent)) { - if (Main.expertMode) - modifiers.IncomingDamageMultiplier *= 0.5f; - else - modifiers.IncomingDamageMultiplier *= 0.75f; + ItemID.BannerEffect effect = ItemID.Sets.BannerStrength[Item.BannerToItem(parent)]; + modifiers.IncomingDamageMultiplier *= (Main.expertMode ? effect.ExpertDamageReceived : effect.NormalDamageReceived); } if (Main.netMode != NetmodeID.MultiplayerClient) diff --git a/NPCs/Astral/StellarCulex.cs b/NPCs/Astral/StellarCulex.cs index 1080554504..ccfc0dcac6 100644 --- a/NPCs/Astral/StellarCulex.cs +++ b/NPCs/Astral/StellarCulex.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.Astral { if (!Main.dedServ) glowmask = ModContent.Request("CalamityMod/NPCs/Astral/StellarCulexGlow", AssetRequestMode.AsyncLoad); - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { PortraitPositionXOverride = 10f diff --git a/NPCs/Astral/Twinkler.cs b/NPCs/Astral/Twinkler.cs index 236659fd72..c7ae6c354e 100644 --- a/NPCs/Astral/Twinkler.cs +++ b/NPCs/Astral/Twinkler.cs @@ -13,9 +13,9 @@ namespace CalamityMod.NPCs.Astral { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 8; - Main.npcCatchable[NPC.type] = true; - NPCID.Sets.CountsAsCritter[NPC.type] = true; + Main.npcFrameCount[Type] = 8; + Main.npcCatchable[Type] = true; + NPCID.Sets.CountsAsCritter[Type] = true; } public override void SetDefaults() diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index 52f6a659f9..3a039663e9 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -60,8 +60,8 @@ namespace CalamityMod.NPCs.AstrumAureus public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 6; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -251,15 +251,15 @@ namespace CalamityMod.NPCs.AstrumAureus float lifeRatio = NPC.life / (float)NPC.lifeMax; bool slimePhaseHP = lifeRatio <= 0.1f || (lifeRatio > 0.6f && lifeRatio <= 0.7f); - Texture2D NPCTexture = TextureAssets.Npc[NPC.type].Value; - Texture2D GlowMaskTexture = TextureAssets.Npc[NPC.type].Value; + Texture2D NPCTexture = TextureAssets.Npc[Type].Value; + Texture2D GlowMaskTexture = TextureAssets.Npc[Type].Value; SpriteEffects spriteEffects = SpriteEffects.None; if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; if (NPC.ai[0] == 0f || (slimePhaseHP && Main.zenithWorld)) { - NPCTexture = TextureAssets.Npc[NPC.type].Value; + NPCTexture = TextureAssets.Npc[Type].Value; GlowMaskTexture = Texture_Glow.Value; } else if (NPC.ai[0] == 1f) //nothing special done here @@ -275,7 +275,7 @@ namespace CalamityMod.NPCs.AstrumAureus { if (NPC.velocity.Y == 0f && NPC.ai[1] >= 0f && NPC.ai[0] == 3f) //idle before jump { - NPCTexture = TextureAssets.Npc[NPC.type].Value; //idle frames + NPCTexture = TextureAssets.Npc[Type].Value; //idle frames GlowMaskTexture = Texture_Glow.Value; } else if (NPC.velocity.Y <= 0f || NPC.ai[1] < 0f) //jump frames if flying upward or if about to jump @@ -293,7 +293,7 @@ namespace CalamityMod.NPCs.AstrumAureus { if (NPC.velocity.Y == 0f) //idle before teleport { - NPCTexture = TextureAssets.Npc[NPC.type].Value; //idle frames + NPCTexture = TextureAssets.Npc[Type].Value; //idle frames GlowMaskTexture = Texture_Glow.Value; } else //in-air frames @@ -303,8 +303,8 @@ namespace CalamityMod.NPCs.AstrumAureus } } - int frameCount = Main.npcFrameCount[NPC.type]; - Vector2 originalDrawSize = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / frameCount / 2); + int frameCount = Main.npcFrameCount[Type]; + Vector2 originalDrawSize = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / frameCount / 2); Rectangle frame = NPC.frame; float scale = NPC.scale; float rotation = NPC.rotation; @@ -431,7 +431,7 @@ namespace CalamityMod.NPCs.AstrumAureus CalamityGlobalNPC.SetNewBossJustDowned(NPC); - CalamityGlobalNPC.SetNewShopVariable(new int[] { NPCID.Wizard, ModContent.NPCType() }, DownedBossSystem.downedAstrumAureus); + CalamityGlobalNPC.SetNewShopVariable(new int[] { ModContent.NPCType() }, DownedBossSystem.downedAstrumAureus); // If Astrum Aureus has not yet been killed, notify players of new Astral enemy drops if (!DownedBossSystem.downedAstrumAureus) diff --git a/NPCs/AstrumAureus/AureusSpawn.cs b/NPCs/AstrumAureus/AureusSpawn.cs index eaecff22bf..cb5ac7cbd0 100644 --- a/NPCs/AstrumAureus/AureusSpawn.cs +++ b/NPCs/AstrumAureus/AureusSpawn.cs @@ -24,8 +24,8 @@ namespace CalamityMod.NPCs.AstrumAureus public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 4; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 4; + NPCID.Sets.TrailingMode[Type] = 1; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); @@ -239,8 +239,8 @@ namespace CalamityMod.NPCs.AstrumAureus if (NPC.ai[0] >= 60f) NPC.DrawBackglow(Color.Lerp(Color.Cyan, Color.Orange, (float)Math.Sin(Main.GlobalTimeWrappedHourly) / 2f + 0.5f) with { A = 0 }, 2f + 8f * ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.TwoPi) + 1f), spriteEffects, NPC.frame, screenPos); - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 originalDrawSize = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 originalDrawSize = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); Color whiteColor = Color.White; int afterimageAmt = 10; @@ -253,14 +253,14 @@ namespace CalamityMod.NPCs.AstrumAureus afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (afterimageAmt - i) / 15f; Vector2 afterimagePos = NPC.oldPos[i] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + afterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; afterimagePos += originalDrawSize * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, originalDrawSize, NPC.scale, spriteEffects, 0f); } } Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; drawLocation += originalDrawSize * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, originalDrawSize, NPC.scale, spriteEffects, 0f); @@ -275,7 +275,7 @@ namespace CalamityMod.NPCs.AstrumAureus secondAfterimageColor = Color.Lerp(secondAfterimageColor, whiteColor, 0.5f); secondAfterimageColor *= (afterimageAmt - j) / 15f; Vector2 secondAfterimagePos = NPC.oldPos[j] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - secondAfterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + secondAfterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; secondAfterimagePos += originalDrawSize * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, secondAfterimagePos, NPC.frame, secondAfterimageColor, NPC.rotation, originalDrawSize, NPC.scale, spriteEffects, 0f); } @@ -292,7 +292,7 @@ namespace CalamityMod.NPCs.AstrumAureus NPC.Opacity = 1f; NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -331,7 +331,7 @@ namespace CalamityMod.NPCs.AstrumAureus // Damage Aureus for a percentage of its HP if the spawn explodes on or near it if (Main.netMode != NetmodeID.MultiplayerClient && (Main.npc[CalamityGlobalNPC.astrumAureus].Center - NPC.Center).Length() < (200f + 30f * (NPC.scale - 1f)) && !Main.IsItDay()) - Projectile.NewProjectileDirect(NPC.GetSource_FromAI(), Main.npc[CalamityGlobalNPC.astrumAureus].Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Main.npc[CalamityGlobalNPC.astrumAureus].lifeMax / 200 * NPC.scale), 0f, Main.myPlayer, Main.npc[CalamityGlobalNPC.astrumAureus].whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), Main.npc[CalamityGlobalNPC.astrumAureus].Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Main.npc[CalamityGlobalNPC.astrumAureus].lifeMax / 200 * NPC.scale), 0f, Main.myPlayer, Main.npc[CalamityGlobalNPC.astrumAureus].whoAmI); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/AstrumDeus/AstrumDeusBody.cs b/NPCs/AstrumDeus/AstrumDeusBody.cs index 834c4561b7..c90499907a 100644 --- a/NPCs/AstrumDeus/AstrumDeusBody.cs +++ b/NPCs/AstrumDeus/AstrumDeusBody.cs @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.AstrumDeus public override void SetStaticDefaults() { this.HideFromBestiary(); - NPCID.Sets.TrailingMode[NPC.type] = 1; + NPCID.Sets.TrailingMode[Type] = 1; if (!Main.dedServ) { AltTexture = ModContent.Request(Texture + "AltSpectral", AssetRequestMode.AsyncLoad); @@ -122,9 +122,9 @@ namespace CalamityMod.NPCs.AstrumDeus bool deathModeEnragePhase = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] == 3f; bool doubleWormPhase = NPC.Calamity().newAI[0] != 0f && !deathModeEnragePhase; - Texture2D mainWormTex = altBodyTextures ? AltTexture.Value : TextureAssets.Npc[NPC.type].Value; + Texture2D mainWormTex = altBodyTextures ? AltTexture.Value : TextureAssets.Npc[Type].Value; Texture2D secondWormTex = TextureGlow2.Value; - Vector2 halfSizeTex = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2); + Vector2 halfSizeTex = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / 2); Vector2 drawLocation = NPC.Center - screenPos; drawLocation -= new Vector2(mainWormTex.Width, mainWormTex.Height) * NPC.scale / 2f; diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index 7c22798e6f..d15f166851 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -53,7 +53,7 @@ namespace CalamityMod.NPCs.AstrumDeus public override void SetStaticDefaults() { - NPCID.Sets.TrailingMode[NPC.type] = 1; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -170,9 +170,9 @@ namespace CalamityMod.NPCs.AstrumDeus bool deathModeEnragePhase = NPC.Calamity().newAI[0] == 3f; bool doubleWormPhase = NPC.Calamity().newAI[0] != 0f && !deathModeEnragePhase; - Texture2D mainWormTex = TextureAssets.Npc[NPC.type].Value; + Texture2D mainWormTex = TextureAssets.Npc[Type].Value; Texture2D secondWormTex = TextureGlow2.Value; - Vector2 halfSizeTex = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2); + Vector2 halfSizeTex = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / 2); Vector2 drawLocation = NPC.Center - screenPos; drawLocation -= new Vector2(mainWormTex.Width, mainWormTex.Height) * NPC.scale / 2f; diff --git a/NPCs/AstrumDeus/AstrumDeusTail.cs b/NPCs/AstrumDeus/AstrumDeusTail.cs index 5456d6e375..1cbb9ac13d 100644 --- a/NPCs/AstrumDeus/AstrumDeusTail.cs +++ b/NPCs/AstrumDeus/AstrumDeusTail.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.AstrumDeus public override void SetStaticDefaults() { this.HideFromBestiary(); - NPCID.Sets.TrailingMode[NPC.type] = 1; + NPCID.Sets.TrailingMode[Type] = 1; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); @@ -109,8 +109,8 @@ namespace CalamityMod.NPCs.AstrumDeus bool deathModeEnragePhase = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] == 3f; bool doubleWormPhase = NPC.Calamity().newAI[0] != 0f && !deathModeEnragePhase; - Texture2D wormTexture = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTex = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2); + Texture2D wormTexture = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTex = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / 2); Vector2 drawLocation = NPC.Center - screenPos; drawLocation -= new Vector2(wormTexture.Width, wormTexture.Height) * NPC.scale / 2f; diff --git a/NPCs/BrimstoneElemental/Brimling.cs b/NPCs/BrimstoneElemental/Brimling.cs index 853b2a0c18..478a14704b 100644 --- a/NPCs/BrimstoneElemental/Brimling.cs +++ b/NPCs/BrimstoneElemental/Brimling.cs @@ -22,8 +22,8 @@ namespace CalamityMod.NPCs.BrimstoneElemental public override void SetStaticDefaults() { - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; - Main.npcFrameCount[NPC.type] = 8; + NPCID.Sets.NeedsExpertScaling[Type] = true; + Main.npcFrameCount[Type] = 8; NPCID.Sets.BossBestiaryPriority.Add(Type); } diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index e96067ad2b..93fc575c92 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -51,7 +51,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 12; + Main.npcFrameCount[Type] = 12; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -203,10 +203,10 @@ namespace CalamityMod.NPCs.BrimstoneElemental { ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType() + ModContent.ItemType(), + ModContent.ItemType() }; normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, weapons)); - normalOnly.Add(ModContent.ItemType(), 10); // Materials normalOnly.Add(ModContent.ItemType(), 1, 8, 10); @@ -247,8 +247,6 @@ namespace CalamityMod.NPCs.BrimstoneElemental CalamityGlobalNPC.SetNewBossJustDowned(NPC); - CalamityGlobalNPC.SetNewShopVariable(new int[] { NPCID.Wizard }, DownedBossSystem.downedBrimstoneElemental); - // Mark brimmy as dead DownedBossSystem.downedBrimstoneElemental = true; CalamityNetcode.SyncWorld(); @@ -311,10 +309,10 @@ namespace CalamityMod.NPCs.BrimstoneElemental SpriteEffects spriteEffects = SpriteEffects.None; if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D npcTexture = TextureAssets.Npc[NPC.type].Value; - Vector2 frameLocation = new Vector2((float)(npcTexture.Width / 2), (float)(npcTexture.Height / Main.npcFrameCount[NPC.type] / 2)); + Texture2D npcTexture = TextureAssets.Npc[Type].Value; + Vector2 frameLocation = new Vector2((float)(npcTexture.Width / 2), (float)(npcTexture.Height / Main.npcFrameCount[Type] / 2)); Vector2 npcOffset = NPC.Center - screenPos; - npcOffset -= new Vector2((float)npcTexture.Width, (float)(npcTexture.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + npcOffset -= new Vector2((float)npcTexture.Width, (float)(npcTexture.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; npcOffset += frameLocation * NPC.scale + new Vector2(0f, NPC.gfxOffY); // Give brimmy an outline based on current elemental mode diff --git a/NPCs/Bumblebirb/Bumblefuck.cs b/NPCs/Bumblebirb/Bumblefuck.cs index c91bb8cd8a..3f0f8faf89 100644 --- a/NPCs/Bumblebirb/Bumblefuck.cs +++ b/NPCs/Bumblebirb/Bumblefuck.cs @@ -38,8 +38,8 @@ namespace CalamityMod.NPCs.Bumblebirb public static Asset GlowTexture; public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 6; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -236,8 +236,8 @@ namespace CalamityMod.NPCs.Bumblebirb if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); Color color = drawColor; Color altColor = Color.White; @@ -289,7 +289,7 @@ namespace CalamityMod.NPCs.Bumblebirb afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (float)(afterimageAmt - i) / 15f; Vector2 afterimageDrawPos = NPC.oldPos[i] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - afterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + afterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; afterimageDrawPos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, afterimageDrawPos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } @@ -342,7 +342,7 @@ namespace CalamityMod.NPCs.Bumblebirb extraAfterimageColor = NPC.GetAlpha(extraAfterimageColor); extraAfterimageColor *= 1f - extraAfterimageDampener; Vector2 extraAfterimageDrawPos = NPC.Center + ((float)j / (float)extraAfterimageAmt * MathHelper.TwoPi + NPC.rotation).ToRotationVector2() * afterimageScaler * extraAfterimageDampener - screenPos; - extraAfterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + extraAfterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; extraAfterimageDrawPos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, extraAfterimageDrawPos, NPC.frame, extraAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } @@ -352,7 +352,7 @@ namespace CalamityMod.NPCs.Bumblebirb mainDrawingColor = Color.Lerp(mainDrawingColor, altColor, lerpDrawTransition); mainDrawingColor = NPC.GetAlpha(mainDrawingColor); Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, (phase3 && calamityGlobalNPC.newAI[3] == 1f ? mainDrawingColor : NPC.GetAlpha(altColor)), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); @@ -383,7 +383,7 @@ namespace CalamityMod.NPCs.Bumblebirb glowmaskAfterimageColor = Color.Lerp(glowmaskAfterimageColor, altColor, lerpDrawTransition); glowmaskAfterimageColor *= (float)(afterimageAmt - k) / 15f; Vector2 glowmaskAfterimageDrawPos = NPC.oldPos[k] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - glowmaskAfterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + glowmaskAfterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; glowmaskAfterimageDrawPos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, glowmaskAfterimageDrawPos, NPC.frame, glowmaskAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } @@ -395,7 +395,7 @@ namespace CalamityMod.NPCs.Bumblebirb extraGlowmaskAfterimageColor = NPC.GetAlpha(extraGlowmaskAfterimageColor); extraGlowmaskAfterimageColor *= 1f - extraAfterimageDampener; Vector2 extraGlowmaskAfterimageDrawPos = NPC.Center + ((float)l / (float)extraAfterimageAmt * MathHelper.TwoPi + NPC.rotation).ToRotationVector2() * afterimageScaler * extraAfterimageDampener - screenPos; - extraGlowmaskAfterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + extraGlowmaskAfterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; extraGlowmaskAfterimageDrawPos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, extraGlowmaskAfterimageDrawPos, NPC.frame, extraGlowmaskAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } diff --git a/NPCs/Bumblebirb/Bumblefuck2.cs b/NPCs/Bumblebirb/Bumblefuck2.cs index b3db2d2a5e..ef8f02eaf5 100644 --- a/NPCs/Bumblebirb/Bumblefuck2.cs +++ b/NPCs/Bumblebirb/Bumblefuck2.cs @@ -16,8 +16,8 @@ namespace CalamityMod.NPCs.Bumblebirb { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 5; + NPCID.Sets.TrailingMode[Type] = 1; this.HideFromBestiary(); } @@ -100,8 +100,8 @@ namespace CalamityMod.NPCs.Bumblebirb if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); int afterimageAmt = NPC.ai[0] == 2.1f ? 7 : 0; if (CalamityClientConfig.Instance.Afterimages) @@ -113,14 +113,14 @@ namespace CalamityMod.NPCs.Bumblebirb afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (afterimageAmt - i) / 15f; Vector2 afterimageDrawPos = NPC.oldPos[i] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - afterimageDrawPos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + afterimageDrawPos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; afterimageDrawPos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, afterimageDrawPos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } } Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/CalClone/CalamitasClone.cs b/NPCs/CalClone/CalamitasClone.cs index 5a495cc59f..1ae8a7732a 100644 --- a/NPCs/CalClone/CalamitasClone.cs +++ b/NPCs/CalClone/CalamitasClone.cs @@ -44,8 +44,8 @@ namespace CalamityMod.NPCs.CalClone public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 6; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -127,7 +127,7 @@ namespace CalamityMod.NPCs.CalClone public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -143,8 +143,8 @@ namespace CalamityMod.NPCs.CalClone if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; - Vector2 origin = new Vector2((float)(texture.Width / 2), (float)(texture.Height / Main.npcFrameCount[NPC.type] / 2)); + Texture2D texture = TextureAssets.Npc[Type].Value; + Vector2 origin = new Vector2((float)(texture.Width / 2), (float)(texture.Height / Main.npcFrameCount[Type] / 2)); Color white = Color.White; float colorLerpAmt = 0.5f; int afterimageAmt = 7; @@ -158,14 +158,14 @@ namespace CalamityMod.NPCs.CalClone afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (float)(afterimageAmt - i) / 15f; Vector2 offset = NPC.oldPos[i] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - offset -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + offset -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; offset += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, offset, NPC.frame, afterimageColor, NPC.rotation, origin, NPC.scale, spriteEffects, 0f); } } Vector2 npcOffset = NPC.Center - screenPos; - npcOffset -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + npcOffset -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; npcOffset += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, npcOffset, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, origin, NPC.scale, spriteEffects, 0f); @@ -184,7 +184,7 @@ namespace CalamityMod.NPCs.CalClone extraAfterimageColor = Color.Lerp(extraAfterimageColor, white, colorLerpAmt); extraAfterimageColor *= (float)(afterimageAmt - i) / 15f; Vector2 offset = NPC.oldPos[i] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - offset -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + offset -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; offset += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, offset, NPC.frame, extraAfterimageColor, NPC.rotation, origin, NPC.scale, spriteEffects, 0f); } diff --git a/NPCs/CalClone/Cataclysm.cs b/NPCs/CalClone/Cataclysm.cs index b9b30e4821..405b07e95f 100644 --- a/NPCs/CalClone/Cataclysm.cs +++ b/NPCs/CalClone/Cataclysm.cs @@ -31,8 +31,8 @@ namespace CalamityMod.NPCs.CalClone public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 6; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -102,7 +102,7 @@ namespace CalamityMod.NPCs.CalClone public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -118,8 +118,8 @@ namespace CalamityMod.NPCs.CalClone if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); int afterimageAmt = 7; if (CalamityClientConfig.Instance.Afterimages) @@ -131,14 +131,14 @@ namespace CalamityMod.NPCs.CalClone afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (float)(afterimageAmt - i) / 15f; Vector2 afterimageDrawPos = NPC.oldPos[i] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - afterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + afterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; afterimageDrawPos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, afterimageDrawPos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } } Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); @@ -153,7 +153,7 @@ namespace CalamityMod.NPCs.CalClone extraAfterimageColor = Color.Lerp(extraAfterimageColor, Color.White, 0.5f); extraAfterimageColor *= (float)(afterimageAmt - j) / 15f; Vector2 extraAfterimageDrawPos = NPC.oldPos[j] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - extraAfterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + extraAfterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; extraAfterimageDrawPos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, extraAfterimageDrawPos, NPC.frame, extraAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } diff --git a/NPCs/CalClone/Catastrophe.cs b/NPCs/CalClone/Catastrophe.cs index 6c37e6c00b..9f2ad19fd1 100644 --- a/NPCs/CalClone/Catastrophe.cs +++ b/NPCs/CalClone/Catastrophe.cs @@ -25,8 +25,8 @@ namespace CalamityMod.NPCs.CalClone public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 6; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -96,7 +96,7 @@ namespace CalamityMod.NPCs.CalClone public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -112,8 +112,8 @@ namespace CalamityMod.NPCs.CalClone if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); int afterimageAmt = 7; if (CalamityClientConfig.Instance.Afterimages) @@ -125,14 +125,14 @@ namespace CalamityMod.NPCs.CalClone afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (float)(afterimageAmt - i) / 15f; Vector2 afterimageDrawPos = NPC.oldPos[i] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - afterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + afterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; afterimageDrawPos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, afterimageDrawPos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } } Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); @@ -147,7 +147,7 @@ namespace CalamityMod.NPCs.CalClone extraAfterimageColor = Color.Lerp(extraAfterimageColor, Color.White, 0.5f); extraAfterimageColor *= (float)(afterimageAmt - j) / 15f; Vector2 extraAfterimageDrawPos = NPC.oldPos[j] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - extraAfterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + extraAfterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; extraAfterimageDrawPos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, extraAfterimageDrawPos, NPC.frame, extraAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } diff --git a/NPCs/CalClone/SoulSeeker.cs b/NPCs/CalClone/SoulSeeker.cs index 42fc4b91c2..6915fac89a 100644 --- a/NPCs/CalClone/SoulSeeker.cs +++ b/NPCs/CalClone/SoulSeeker.cs @@ -22,9 +22,9 @@ namespace CalamityMod.NPCs.CalClone public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 5; + NPCID.Sets.NeedsExpertScaling[Type] = true; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); if (!Main.dedServ) { @@ -75,7 +75,7 @@ namespace CalamityMod.NPCs.CalClone public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -188,8 +188,8 @@ namespace CalamityMod.NPCs.CalClone if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; - Vector2 origin = new Vector2(texture.Width / 2f, texture.Height / Main.npcFrameCount[NPC.type] / 2f); + Texture2D texture = TextureAssets.Npc[Type].Value; + Vector2 origin = new Vector2(texture.Width / 2f, texture.Height / Main.npcFrameCount[Type] / 2f); Color white = Color.White; float colorLerpAmt = 0.5f; int afterImageAmt = 5; @@ -203,14 +203,14 @@ namespace CalamityMod.NPCs.CalClone afterImageColor = NPC.GetAlpha(afterImageColor); afterImageColor *= (afterImageAmt - a) / 15f; Vector2 afterimagePos = NPC.oldPos[a] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + afterimagePos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; afterimagePos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, afterimagePos, NPC.frame, afterImageColor, NPC.rotation, origin, NPC.scale, spriteEffects, 0f); } } Vector2 drawPos = NPC.Center - screenPos; - drawPos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawPos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; drawPos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, drawPos, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, origin, NPC.scale, spriteEffects, 0f); @@ -225,7 +225,7 @@ namespace CalamityMod.NPCs.CalClone glowColor = Color.Lerp(glowColor, white, colorLerpAmt); glowColor *= (afterImageAmt - a) / 15f; Vector2 afterimagePos = NPC.oldPos[a] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + afterimagePos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; afterimagePos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, afterimagePos, NPC.frame, glowColor, NPC.rotation, origin, NPC.scale, spriteEffects, 0f); } diff --git a/NPCs/CalamityAIs/CalamityBossAIs/BrimstoneElementalAI.cs b/NPCs/CalamityAIs/CalamityBossAIs/BrimstoneElementalAI.cs index 8a8807a89e..77c7f47925 100644 --- a/NPCs/CalamityAIs/CalamityBossAIs/BrimstoneElementalAI.cs +++ b/NPCs/CalamityAIs/CalamityBossAIs/BrimstoneElementalAI.cs @@ -114,7 +114,7 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs enrageScale += 1f; } - npc.Calamity().DR = npc.ai[0] == 4f ? 0.6f : 0.15f; + npc.Calamity().DR = npc.ai[0] == 4f ? 0.6f : 0.2f; // Emit dust int dustAmt = (npc.ai[0] == 2f) ? 2 : 1; diff --git a/NPCs/CalamityDrawParameterNPC.cs b/NPCs/CalamityDrawParameterNPC.cs new file mode 100644 index 0000000000..ca630f4f02 --- /dev/null +++ b/NPCs/CalamityDrawParameterNPC.cs @@ -0,0 +1,134 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.NPCs.ExoMechs.Ares; +using Steamworks; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.NPCs +{ + // Why this class is exist? + // It because we want to avoid Threading Issues while We using NPC's properties on Draw Thread + public sealed class CalamityDrawParameterNPC : GlobalNPC + { + public override bool InstancePerEntity => false; + + #region Draw Parameters + public static bool[] DrawingMiracleBlight { get; private set; } + public static bool[] DrawingPolarity { get; private set; } + #endregion + + #region Filtering Fields + public static List MiracleBlightExcludedNPCs => new() + { + // List the reason why the NPC(s) are excluded :) + + // The particle sets break with the visuals and this is the easiest way to fix this that isn't stupidly complex. + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + + // Breaks with being behind tiles, and causes a funny interaction where his head goes behind his neck. + NPCID.MoonLordCore, + NPCID.MoonLordHand, + NPCID.MoonLordHead + }; + #endregion + + #region Load / Unload + public override void Load() + { + DrawingMiracleBlight = new bool[Main.maxNPCs]; + DrawingPolarity = new bool[Main.maxNPCs]; + } + + public override void Unload() + { + DrawingMiracleBlight = null; + DrawingPolarity = null; + } + #endregion + + public override void SetDefaults(NPC entity) => ResetParameters(entity); + public override bool PreAI(NPC npc) + { + if (npc is null) + return true; + + var whoAmI = npc.whoAmI; + DrawingMiracleBlight[whoAmI] = ShouldDrawMiracleBlight(npc); + DrawingPolarity[whoAmI] = ShouldDrawPolarity(npc); + + return true; + } + + public static void ResetParameters(NPC npc) + { + if (npc is null) + return; + + var whoAmI = npc.whoAmI; + DrawingMiracleBlight[whoAmI] = false; + DrawingPolarity[whoAmI] = false; + } + + public static bool ShouldDrawMiracleBlight(NPC npc) + { + if (npc is null || !npc.active) + return false; + + // Do not draw weird MP types less than or equal to 0. + if (npc.type <= NPCID.None) + return false; + + // Do not draw other mod's bosses. + if (npc.ModNPC != null && npc.ModNPC.Mod != CalamityMod.Instance && npc.boss) + return false; + + // Don't draw excluded NPCs, or if the npc is a bestiary dummy. + if (MiracleBlightExcludedNPCs.Contains(npc.type) || npc.IsABestiaryIconDummy) + return false; + + // Safety check for weird MP bug when getting global npcs. + if (!npc.TryGetGlobalNPCSafer(out var calNPC) || !npc.TryGetGlobalNPCSafer(out var polNPC)) + return false; + + // Do not draw if the npc does not have miracle blight, or has the polarity effect. + if (calNPC.miracleBlight <= 0 || polNPC.CurPolarity > 0f) + return false; + + // Do not draw if the current player has the trippy effect. + if (Main.LocalPlayer.Calamity().trippy) + return false; + + return true; + } + + public static bool ShouldDrawPolarity(NPC npc) + { + if (npc is null || !npc.active) + return false; + + // Safety check for weird MP bug when getting global npcs. + if (!npc.TryGetGlobalNPCSafer(out var calNPC) || !npc.TryGetGlobalNPCSafer(out var polNPC)) + return false; + + // I don't know who would be using this while also inflicting miracle blight, but in that rare case, do not draw these. + if (calNPC.miracleBlight > 0) + return false; + + // Do not draw if the npc doesn't have the polarity effect. + if (polNPC.CurPolarity <= 0f) + return false; + + return true; + } + } +} diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index a6c3377fe9..90b7838760 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -14,6 +14,7 @@ using CalamityMod.Events; using CalamityMod.Graphics.Metaballs; using CalamityMod.Graphics.Renderers.CalamityRenderers; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.Tools; using CalamityMod.Items.Weapons.Melee; using CalamityMod.NPCs.Abyss; @@ -36,6 +37,7 @@ using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.NPCs.HiveMind; using CalamityMod.NPCs.Leviathan; using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.NPCs.OldDuke; using CalamityMod.NPCs.Perforator; using CalamityMod.NPCs.PlagueEnemies; using CalamityMod.NPCs.Polterghast; @@ -152,6 +154,7 @@ namespace CalamityMod.NPCs public bool IncreasedHeatEffects_CinnamonRoll = false; public bool IncreasedHeatEffects_FlameWakerBoots = false; public bool IncreasedHeatEffects_HellfireTreads = false; + public bool IncreasedHeatEffects_FlameWings = false; // Toxic Heart effect public bool IncreasedSicknessEffects_ToxicHeart = false; @@ -255,10 +258,6 @@ namespace CalamityMod.NPCs public const int knockbackResistanceMin = 180; public int knockbackResistanceTimer = 0; - // Used for NPCs affected by vanilla Cobalt/Mythril weapons - public const int cobaltAndMythrilNerfTime = 600; - public int cobaltNerfTimer = 0; - public int mythrilNerfTimer = 0; // Debuffs public int vaporfied = 0; @@ -457,6 +456,7 @@ namespace CalamityMod.NPCs myClone.IncreasedHeatEffects_CinnamonRoll = IncreasedHeatEffects_CinnamonRoll; myClone.IncreasedHeatEffects_FlameWakerBoots = IncreasedHeatEffects_FlameWakerBoots; myClone.IncreasedHeatEffects_HellfireTreads = IncreasedHeatEffects_HellfireTreads; + myClone.IncreasedHeatEffects_FlameWings = IncreasedHeatEffects_FlameWings; myClone.IncreasedSicknessEffects_ToxicHeart = IncreasedSicknessEffects_ToxicHeart; myClone.IncreasedSicknessAndWaterEffects_EvergreenGin = IncreasedSicknessAndWaterEffects_EvergreenGin; @@ -495,9 +495,6 @@ namespace CalamityMod.NPCs myClone.bossCanBeKnockedBack = bossCanBeKnockedBack; myClone.knockbackResistanceTimer = knockbackResistanceTimer; - myClone.cobaltNerfTimer = cobaltNerfTimer; - myClone.mythrilNerfTimer = mythrilNerfTimer; - myClone.vaporfied = vaporfied; myClone.timeSlow = timeSlow; myClone.gState = gState; @@ -866,21 +863,23 @@ namespace CalamityMod.NPCs electricityDamageMult += 0.5; if (IncreasedHeatEffects_Fireball) - heatDamageMult += 0.25; + heatDamageMult += Fireball.HeatDebuffBoost; if (IncreasedHeatEffects_FlameWakerBoots) heatDamageMult += 0.25; if (IncreasedHeatEffects_CinnamonRoll) - heatDamageMult += 0.5; + heatDamageMult += CinnamonRoll.HeatDebuffBoost; if (IncreasedHeatEffects_HellfireTreads) heatDamageMult += 0.5; + if (IncreasedHeatEffects_FlameWings) + heatDamageMult += 0.25; if (IncreasedSicknessEffects_ToxicHeart) sicknessDamageMult += 0.5; if (IncreasedSicknessAndWaterEffects_EvergreenGin) { - sicknessDamageMult += 0.25; - waterDamageMult += 0.25; + sicknessDamageMult += EvergreenGin.SicknessWaterDebuffBoost; + waterDamageMult += EvergreenGin.SicknessWaterDebuffBoost; } // Subtract 1 for the vanilla damage multiplier because it's already dealing DoT in the vanilla regen code. @@ -5590,10 +5589,6 @@ namespace CalamityMod.NPCs if (ashesOnDeath > 0) ashesOnDeath--; - if (cobaltNerfTimer > 0) - cobaltNerfTimer--; - if (mythrilNerfTimer > 0) - mythrilNerfTimer--; if (cursorFocus > 0 && cursorFocus < cursorFocusMax) cursorFocus--; if (veriumDoomTimer > 0) @@ -5625,7 +5620,6 @@ namespace CalamityMod.NPCs if (player.miscCounter % frequency == 0) { int sDamage = strongerShock ? 50 : 10; - sDamage = player.ApplyArmorAccDamageBonusesTo(sDamage); Vector2 velocity = Vector2.UnitX.RotatedByRandom(MathHelper.Pi) * 5f; Projectile spark = Projectile.NewProjectileDirect(npc.GetSource_FromThis(), npc.Center, velocity, ProjectileType(), sDamage, 0f, player.whoAmI, 0f, 1f); spark.timeLeft = 120; @@ -5645,7 +5639,7 @@ namespace CalamityMod.NPCs { SoundEngine.PlaySound(SoundID.Item49, Main.LocalPlayer.Center); Vector2 shardVel = Vector2.UnitX.RotatedByRandom(MathHelper.Pi) * 7.5f; - int damage = Main.LocalPlayer.ApplyArmorAccDamageBonusesTo(20); + int damage = 20; Projectile.NewProjectile(npc.GetSource_FromThis(), Main.LocalPlayer.Center, shardVel, ProjectileType(), damage, 5f, Main.myPlayer); } @@ -6015,8 +6009,27 @@ namespace CalamityMod.NPCs #region Modify Hit public override void ModifyHitPlayer(NPC npc, Player target, ref Player.HurtModifiers modifiers) { + List SharkIDs = + [ + NPCID.Shark, + NPCID.DukeFishron, + NPCID.Sharkron, + NPCID.Sharkron2, + NPCID.SandShark, + NPCID.SandsharkCorrupt, + NPCID.SandsharkCrimson, + NPCID.SandsharkHallow, + NPCID.GoblinShark, + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType() + ]; + // Kaguya hair boom GIF - if (npc.type == NPCID.Shark && target.name == "Rebecca" && Main.zenithWorld) + if (SharkIDs.Contains(npc.type) && target.name == "Rebecca" && Main.zenithWorld) { SoundEngine.PlaySound(AresGaussNuke.NukeExplosionSound, target.Center); if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < 12f) @@ -6044,11 +6057,10 @@ namespace CalamityMod.NPCs if (CalamityLists.DesertScourgeIDs.Contains(npc.type) || CalamityLists.EaterofWorldsIDs.Contains(npc.type) || npc.type == NPCID.Creeper || CalamityLists.PerforatorIDs.Contains(npc.type) || CalamityLists.AquaticScourgeIDs.Contains(npc.type) || CalamityLists.DestroyerIDs.Contains(npc.type) || CalamityLists.AstrumDeusIDs.Contains(npc.type) || CalamityLists.StormWeaverIDs.Contains(npc.type) || CalamityLists.ThanatosIDs.Contains(npc.type) || - npc.type == NPCType() || npc.type == NPCType() || CalamityLists.AresIDs.Contains(npc.type) || npc.type == NPCType() || - npc.type == NPCType()) + npc.type == NPCType() || npc.type == NPCType() || npc.type == NPCType() || npc.type == NPCType()) { - float damageMult = CalamityLists.ThanatosIDs.Contains(npc.type) ? 0.35f : 0.5f; - if (item.CountsAsClass() && item.type != ItemType() && item.type != ItemType()) + float damageMult = CalamityLists.ThanatosIDs.Contains(npc.type) ? 0.35f : (CalamityLists.DesertScourgeIDs.Contains(npc.type) || npc.type == NPCType()) ? 0.75f : 0.5f; + if (item.CountsAsClass() && item.type != ItemType()) modifiers.SourceDamage *= damageMult; } } @@ -6354,9 +6366,10 @@ namespace CalamityMod.NPCs NPC.downedMoonlord && Main.player[npc.target].ZoneDungeon) { - int maxValue = Main.expertMode ? 4 : 6; + // This value can change by (on average) 0.75x or 1.25x depending on your having positive or negative luck + int baseValue = Main.expertMode ? 4 : 6; - if (Main.rand.NextBool(maxValue) && Main.wallDungeon[Main.tile[(int)npc.Center.X / 16, (int)npc.Center.Y / 16].WallType]) + if (Main.player[npc.target].RollLuck(baseValue) == 0 && Main.wallDungeon[Main.tile[(int)npc.Center.X / 16, (int)npc.Center.Y / 16].WallType]) { int randomType = Utils.SelectRandom(Main.rand, new int[] { @@ -6615,11 +6628,6 @@ namespace CalamityMod.NPCs spawnRate = (int)(spawnRate * 1.1); maxSpawns = (int)(maxSpawns * 0.9f); } - if (player.calmed) - { - spawnRate = (int)(spawnRate * 1.2); - maxSpawns = (int)(maxSpawns * 0.8f); - } if (player.Calamity().tranquilityCandle) { spawnRate = (int)(spawnRate * 1.4); @@ -7103,42 +7111,6 @@ namespace CalamityMod.NPCs } } - // Cobalt weapons reduce NPC defense - if (cobaltNerfTimer > 0) - { - miscDefenseLoss = (int)(npc.defense * 0.25); - - // Particle effects - if (Main.rand.NextBool(5)) - { - Vector2 spawnLocation = new Vector2(Main.rand.NextFloat(npc.position.X, npc.position.X + npc.width), Main.rand.NextFloat(npc.position.Y, npc.position.Y + npc.height)); - Vector2 velocity = new Vector2(0f, MathHelper.Max(Main.rand.NextFloat(4f, 6f) * ((npc.height - (spawnLocation.Y - npc.position.Y)) / 65), 0.6f)); - - Particle cobaltArrow = new StatDownArrow(spawnLocation, velocity, new Color(27, 141, 235), new Color(0, 94, 181), 0.75f, 15); - GeneralParticleHandler.SpawnParticle(cobaltArrow); - } - } - - // Mythril weapons reduce NPC contact damage - if (mythrilNerfTimer > 0) - { - // Ensure that it isn't trying to set a non-zero damage value if the NPC's damage is currently 0 - if (npc.damage == 0) - npc.damage = 0; - else - npc.damage = (int)(npc.defDamage * 0.9); - - // Particle effects - if (Main.rand.NextBool(5)) - { - Vector2 spawnLocation = new Vector2(Main.rand.NextFloat(npc.position.X, npc.position.X + npc.width), Main.rand.NextFloat(npc.position.Y, npc.position.Y + npc.height)); - Vector2 velocity = new Vector2(0f, MathHelper.Max(Main.rand.NextFloat(4f, 6f) * ((npc.height - (spawnLocation.Y - npc.position.Y)) / 65), 0.6f)); - - Particle mythrilArrow = new StatDownArrow(spawnLocation, velocity, new Color(35, 217, 144), new Color(23, 145, 97), 0.75f, 15); - GeneralParticleHandler.SpawnParticle(mythrilArrow); - } - } - // Some extraneous and probably undocumented visual effect caused by the heart lad pet thing if (ladHearts > 0 && !npc.loveStruck && Main.netMode != NetmodeID.Server) { diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 3b00631486..ef42c20f8c 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -166,19 +166,42 @@ namespace CalamityMod.NPCs return false; }); - int[] mimicItems = new int[] - { + // Yes, Mimics have three separate loot tables which we must reintegrate + int[] normalMimicItems = + [ ItemID.MagicDagger, ItemID.CrossNecklace, ItemID.PhilosophersStone, ItemID.StarCloak, ItemID.TitanGlove, ItemID.DualHook - }; + ]; + int[] remixPreHardMimicItems = + [ + ItemID.BandofRegeneration, + ItemID.MagicMirror, + ItemID.CloudinaBottle, + ItemID.HermesBoots, + ItemID.ShoeSpikes, + ItemID.Mace + ]; + int[] remixHardmodeMimicItems = + [ + ItemID.WandofSparking, + ItemID.CrossNecklace, + ItemID.PhilosophersStone, + ItemID.StarCloak, + ItemID.TitanGlove, + ItemID.DualHook + ]; // Mimics will not drop any items if spawned from statues. - var notStatue = npcLoot.DefineConditionalDropSet(new Conditions.NotFromStatue()); - notStatue.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, mimicItems)); + var notRemix = npcLoot.DefineConditionalDropSet(DropHelper.If(() => !(npc.SpawnedFromStatue || Main.remixWorld))); + var remixPreHM = npcLoot.DefineConditionalDropSet(DropHelper.If(() => !npc.SpawnedFromStatue && Main.remixWorld && !Main.hardMode)); + var remixHardmode = npcLoot.DefineConditionalDropSet(DropHelper.If(() => !npc.SpawnedFromStatue && Main.remixWorld && Main.hardMode)); + notRemix.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, normalMimicItems)); + remixPreHM.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, remixPreHardMimicItems)); + remixHardmode.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, remixHardmodeMimicItems)); } catch (ArgumentNullException) { } break; @@ -236,17 +259,39 @@ namespace CalamityMod.NPCs return false; }); - int[] iceMimicItems = new int[] - { + // Yes, Ice Mimics have three separate loot tables which me must reintegrate + int[] normalIceMimicItems = + [ ItemID.Frostbrand, ItemID.IceBow, ItemID.FlowerofFrost - }; + ]; + int[] remixPreHardIceMimicItems = + [ + ItemID.IceBoomerang, + ItemID.IceBlade, + ItemID.IceBow, + ItemID.IceSkates, + ItemID.BlizzardinaBottle, + ItemID.FlurryBoots + ]; + int[] remixHardmodeIceMimicItems = + [ + ItemID.Frostbrand, + ItemID.SnowballCannon, + ItemID.FlowerofFrost + ]; // Ice Mimics will not drop any items if spawned from statues. - var notStatue = npcLoot.DefineConditionalDropSet(new Conditions.NotFromStatue()); - notStatue.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, iceMimicItems)); - notStatue.Add(ItemID.ToySled, 20, 1, 1); + var notRemix = npcLoot.DefineConditionalDropSet(DropHelper.If(() => !(npc.SpawnedFromStatue || Main.remixWorld))); + var remixPreHM = npcLoot.DefineConditionalDropSet(DropHelper.If(() => !npc.SpawnedFromStatue && Main.remixWorld && !Main.hardMode)); + var remixHardmode = npcLoot.DefineConditionalDropSet(DropHelper.If(() => !npc.SpawnedFromStatue && Main.remixWorld && Main.hardMode)); + notRemix.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, normalIceMimicItems)); + remixPreHM.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, remixPreHardIceMimicItems)); + remixHardmode.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, remixHardmodeIceMimicItems)); + + // Independent from all of the Remix madness, Ice Mimics have a 5% chance to drop Toy Sled. + npcLoot.DefineConditionalDropSet(new Conditions.NotFromStatue()).Add(ItemID.ToySled, 20); } catch (ArgumentNullException) { } break; @@ -468,9 +513,9 @@ namespace CalamityMod.NPCs npcLoot.Add(ModContent.ItemType(), 10); break; - // Ghost Bracelet @ 10% (Dandy requests this drops at a "high chance" but inventory clutter is real so) + // Ghost Bracelet @ 5% (Dandy requests this drops at a "high chance" but inventory clutter is real so) case NPCID.Ghost: - npcLoot.Add(ModContent.ItemType(), 10); + npcLoot.Add(ModContent.ItemType(), 20); break; #endregion @@ -1777,7 +1822,7 @@ DukeEditFailed: // On-kill NON-LOOT behavior for Eater of Worlds if ((npc.boss && (npc.type == NPCID.EaterofWorldsHead || npc.type == NPCID.EaterofWorldsBody || npc.type == NPCID.EaterofWorldsTail)) || npc.type == NPCID.BrainofCthulhu) { - SetNewShopVariable(new int[] { NPCID.Merchant, NPCID.ArmsDealer, NPCID.Dryad, NPCID.Demolitionist }, NPC.downedBoss2); + SetNewShopVariable(new int[] { NPCID.Merchant, NPCID.ArmsDealer, NPCID.Dryad }, NPC.downedBoss2); SetNewBossJustDowned(npc); } @@ -1790,7 +1835,7 @@ DukeEditFailed: break; case NPCID.EyeofCthulhu: - SetNewShopVariable(new int[] { NPCID.Merchant, NPCID.Dryad, NPCID.Demolitionist }, NPC.downedBoss1); + SetNewShopVariable(new int[] { NPCID.Merchant, NPCID.Dryad }, NPC.downedBoss1); SetNewBossJustDowned(npc); break; @@ -1804,7 +1849,7 @@ DukeEditFailed: break; case NPCID.SkeletronHead: - SetNewShopVariable(new int[] { NPCID.Merchant, NPCID.Dryad, NPCID.Demolitionist }, NPC.downedBoss3); + SetNewShopVariable(new int[] { NPCID.Merchant, NPCID.Dryad }, NPC.downedBoss3); SetNewBossJustDowned(npc); // First kill: Notify of Abyss chests being unlocked. @@ -1820,7 +1865,7 @@ DukeEditFailed: break; case NPCID.WallofFlesh: - SetNewShopVariable(new int[] { NPCID.Merchant, NPCID.ArmsDealer, NPCID.Dryad, NPCID.Painter, NPCID.WitchDoctor, NPCID.Stylist, NPCID.DyeTrader, NPCID.Demolitionist, NPCID.PartyGirl, NPCID.Clothier, NPCID.SkeletonMerchant, NPCID.BestiaryGirl, ModContent.NPCType() }, Main.hardMode); + SetNewShopVariable(new int[] { NPCID.Merchant, NPCID.ArmsDealer, NPCID.Dryad, NPCID.Painter, NPCID.WitchDoctor, NPCID.Stylist, NPCID.DyeTrader, NPCID.Demolitionist, NPCID.PartyGirl, NPCID.Clothier, NPCID.SkeletonMerchant, NPCID.BestiaryGirl }, Main.hardMode); SetNewBossJustDowned(npc); if (!Main.hardMode && !BossRushEvent.BossRushActive) @@ -1846,7 +1891,7 @@ DukeEditFailed: break; case NPCID.TheDestroyer: - SetNewShopVariable(new int[] { NPCID.DD2Bartender, NPCID.Stylist, NPCID.Truffle }, NPC.downedMechBossAny); + SetNewShopVariable(new int[] { NPCID.Demolitionist, NPCID.DD2Bartender, NPCID.Stylist, NPCID.Truffle }, NPC.downedMechBossAny); SetNewShopVariable(new int[] { NPCID.Stylist, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }, NPC.downedMechBoss1 || !NPC.downedMechBoss2 || !NPC.downedMechBoss3); SetNewBossJustDowned(npc); @@ -1858,7 +1903,7 @@ DukeEditFailed: case NPCID.Retinazer: if (lastTwinStanding) { - SetNewShopVariable(new int[] { NPCID.DD2Bartender, NPCID.Stylist, NPCID.Truffle }, NPC.downedMechBossAny); + SetNewShopVariable(new int[] { NPCID.Demolitionist, NPCID.DD2Bartender, NPCID.Stylist, NPCID.Truffle }, NPC.downedMechBossAny); SetNewShopVariable(new int[] { NPCID.Stylist, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }, !NPC.downedMechBoss1 || NPC.downedMechBoss2 || !NPC.downedMechBoss3); SetNewBossJustDowned(npc); @@ -1868,7 +1913,7 @@ DukeEditFailed: break; case NPCID.SkeletronPrime: - SetNewShopVariable(new int[] { NPCID.DD2Bartender, NPCID.Stylist, NPCID.Truffle }, NPC.downedMechBossAny); + SetNewShopVariable(new int[] { NPCID.Demolitionist, NPCID.DD2Bartender, NPCID.Stylist, NPCID.Truffle }, NPC.downedMechBossAny); SetNewShopVariable(new int[] { NPCID.Stylist, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }, !NPC.downedMechBoss1 || !NPC.downedMechBoss2 || NPC.downedMechBoss3); SetNewBossJustDowned(npc); diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 543e6db989..99a1624096 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -1107,16 +1107,16 @@ namespace CalamityMod.NPCs if (type == NPCID.Merchant) { - shop.AddWithCustomValue(ItemID.Bottle, Item.buyPrice(copper: 20), potionSells, Condition.HappyEnough) - .AddWithCustomValue(ItemID.WormholePotion, Item.buyPrice(silver: 5), potionSells, Condition.HappyEnough); - shop.Add(ItemID.HealingPotion, potionSells, Condition.HappyEnough, Condition.DownedEowOrBoc) - .Add(ItemID.ManaPotion, potionSells, Condition.HappyEnough, Condition.DownedEowOrBoc) + shop.AddWithCustomValue(ItemID.Bottle, Item.buyPrice(copper: 20), potionSells, Condition.HappyEnoughToSellPylons) + .AddWithCustomValue(ItemID.WormholePotion, Item.buyPrice(silver: 5), potionSells, Condition.HappyEnoughToSellPylons); + shop.Add(ItemID.HealingPotion, potionSells, Condition.HappyEnoughToSellPylons, Condition.DownedEowOrBoc) + .Add(ItemID.ManaPotion, potionSells, Condition.HappyEnoughToSellPylons, Condition.DownedEowOrBoc) .Add(ItemID.Flare, hasFlareGunUpgrade) .Add(ItemID.BlueFlare, hasFlareGunUpgrade) .AddWithCustomValue(ItemID.AngelStatue, Item.buyPrice(gold: 5), Condition.NpcIsPresent(NPCType())) - .AddWithCustomValue(ItemID.Burger, Item.buyPrice(gold: 5), Condition.HappyEnough, Condition.DownedSkeletron) - .AddWithCustomValue(ItemID.Hotdog, Item.buyPrice(gold: 5), Condition.HappyEnough, Condition.DownedSkeletron) - .AddWithCustomValue(ItemID.CoffeeCup, Item.buyPrice(gold: 2), Condition.HappyEnough); + .AddWithCustomValue(ItemID.Burger, Item.buyPrice(gold: 5), Condition.HappyEnoughToSellPylons, Condition.DownedSkeletron) + .AddWithCustomValue(ItemID.Hotdog, Item.buyPrice(gold: 5), Condition.HappyEnoughToSellPylons, Condition.DownedSkeletron) + .AddWithCustomValue(ItemID.CoffeeCup, Item.buyPrice(gold: 2), Condition.HappyEnoughToSellPylons); } if (type == NPCID.DyeTrader) @@ -1149,7 +1149,7 @@ namespace CalamityMod.NPCs .Add(ItemType(), revengeance) .AddWithCustomValue(ItemID.StylistKilLaKillScissorsIWish, Item.buyPrice(gold: 15)) .Add(ItemType(), Condition.NpcIsPresent(NPCType()), drunk) - .AddWithCustomValue(ItemID.ChocolateChipCookie, Item.buyPrice(gold: 3), Condition.HappyEnough, Condition.NpcIsPresent(NPCType())); + .AddWithCustomValue(ItemID.ChocolateChipCookie, Item.buyPrice(gold: 3), Condition.HappyEnoughToSellPylons, Condition.NpcIsPresent(NPCType())); } if (type == NPCID.Cyborg) @@ -1164,21 +1164,21 @@ namespace CalamityMod.NPCs shop.AddWithCustomValue(ItemID.JungleRose, Item.buyPrice(gold: 2)) .AddWithCustomValue(ItemID.NaturesGift, Item.buyPrice(gold: 10)) .Add(ItemType()) - .AddWithCustomValue(ItemID.Grapes, Item.buyPrice(gold: 2, silver: 50), Condition.HappyEnough, Condition.DownedSkeletron) + .AddWithCustomValue(ItemID.Grapes, Item.buyPrice(gold: 2, silver: 50), Condition.HappyEnoughToSellPylons, Condition.DownedSkeletron) .Add(ItemID.CorruptSeeds, Condition.CrimsonWorld, Condition.InGraveyard, Condition.PreHardmode) .Add(ItemID.CrimsonSeeds, Condition.CorruptWorld, Condition.InGraveyard, Condition.PreHardmode); // Vanilla sells these in Hardmode, we just make them available at all times } if (type == NPCID.GoblinTinkerer) { - shop.AddWithCustomValue(ItemID.StinkPotion, Item.buyPrice(silver: 25), potionSells, Condition.HappyEnough) + shop.AddWithCustomValue(ItemID.StinkPotion, Item.buyPrice(silver: 25), potionSells, Condition.HappyEnoughToSellPylons) .Add(ItemType()) - .AddWithCustomValue(ItemID.Spaghetti, Item.buyPrice(gold: 5), Condition.HappyEnough, Condition.DownedSkeletron); + .AddWithCustomValue(ItemID.Spaghetti, Item.buyPrice(gold: 5), Condition.HappyEnoughToSellPylons, Condition.DownedSkeletron); } if (type == NPCID.Mechanic) { - shop.AddWithCustomValue(ItemID.BuilderPotion, Item.buyPrice(gold: 4), potionSells, Condition.HappyEnough) + shop.AddWithCustomValue(ItemID.BuilderPotion, Item.buyPrice(gold: 4), potionSells, Condition.HappyEnoughToSellPylons) .AddWithCustomValue(ItemID.CombatWrench, Item.buyPrice(gold: 10)); } @@ -1224,14 +1224,14 @@ namespace CalamityMod.NPCs .Add(ItemType()) .Add(ItemType()) .AddWithCustomValue(ItemID.ButterflyDust, Item.buyPrice(gold: 10), Condition.DownedGolem) - .AddWithCustomValue(ItemID.FriedEgg, Item.buyPrice(gold: 2, silver: 50), Condition.HappyEnough); + .AddWithCustomValue(ItemID.FriedEgg, Item.buyPrice(gold: 2, silver: 50), Condition.HappyEnoughToSellPylons); } if (type == NPCID.PartyGirl) { - shop.AddWithCustomValue(ItemID.GenderChangePotion, Item.buyPrice(silver: 25), potionSells, Condition.HappyEnough) - .AddWithCustomValue(ItemID.Pizza, Item.buyPrice(gold: 5), Condition.HappyEnough, Condition.DownedSkeletron) - .AddWithCustomValue(ItemID.CreamSoda, Item.buyPrice(gold: 2, silver: 50), Condition.HappyEnough); + shop.AddWithCustomValue(ItemID.GenderChangePotion, Item.buyPrice(silver: 25), potionSells, Condition.HappyEnoughToSellPylons) + .AddWithCustomValue(ItemID.Pizza, Item.buyPrice(gold: 5), Condition.HappyEnoughToSellPylons, Condition.DownedSkeletron) + .AddWithCustomValue(ItemID.CreamSoda, Item.buyPrice(gold: 2, silver: 50), Condition.HappyEnoughToSellPylons); } if (type == NPCID.Princess) @@ -1257,12 +1257,12 @@ namespace CalamityMod.NPCs if (type == NPCID.Golfer) { - shop.AddWithCustomValue(ItemID.PotatoChips, Item.buyPrice(gold: 1), Condition.HappyEnough); + shop.AddWithCustomValue(ItemID.PotatoChips, Item.buyPrice(gold: 1), Condition.HappyEnoughToSellPylons); } if (type == NPCID.BestiaryGirl) { - shop.AddWithCustomValue(ItemID.Steak, Item.buyPrice(gold: 5), Condition.HappyEnough, Condition.Hardmode); + shop.AddWithCustomValue(ItemID.Steak, Item.buyPrice(gold: 5), Condition.HappyEnoughToSellPylons, Condition.Hardmode); } } #endregion diff --git a/NPCs/CalamityPolarityNPC.cs b/NPCs/CalamityPolarityNPC.cs index b414c40154..62389ac49f 100644 --- a/NPCs/CalamityPolarityNPC.cs +++ b/NPCs/CalamityPolarityNPC.cs @@ -96,7 +96,7 @@ namespace CalamityMod.NPCs public override void PostDraw(NPC npc, SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { // I don't know who would be using this while also inflicting miracle blight, but in that rare case, do not draw these. - if (npc.Calamity().miracleBlight > 0) + if (CalamityDrawParameterNPC.DrawingMiracleBlight[npc.whoAmI]) return; Main.spriteBatch.End(); diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs index 7e5300e4cd..6fb3d01529 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -41,8 +41,8 @@ namespace CalamityMod.NPCs.CeaselessVoid public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 6; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -118,7 +118,7 @@ namespace CalamityMod.NPCs.CeaselessVoid public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -160,8 +160,8 @@ namespace CalamityMod.NPCs.CeaselessVoid if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); int afterimageAmt = 7; if (CalamityClientConfig.Instance.Afterimages) @@ -173,14 +173,14 @@ namespace CalamityMod.NPCs.CeaselessVoid afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (float)(afterimageAmt - i) / 15f; Vector2 afterimageDrawPos = NPC.oldPos[i] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - afterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + afterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; afterimageDrawPos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, afterimageDrawPos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } } Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); @@ -195,7 +195,7 @@ namespace CalamityMod.NPCs.CeaselessVoid extraAfterimageColor = Color.Lerp(extraAfterimageColor, Color.White, 0.5f); extraAfterimageColor *= (float)(afterimageAmt - j) / 15f; Vector2 extraAfterimageDrawPos = NPC.oldPos[j] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - extraAfterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + extraAfterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; extraAfterimageDrawPos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, extraAfterimageDrawPos, NPC.frame, extraAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } diff --git a/NPCs/CeaselessVoid/DarkEnergy.cs b/NPCs/CeaselessVoid/DarkEnergy.cs index 0d9e18a7a9..52c4728c43 100644 --- a/NPCs/CeaselessVoid/DarkEnergy.cs +++ b/NPCs/CeaselessVoid/DarkEnergy.cs @@ -32,8 +32,8 @@ namespace CalamityMod.NPCs.CeaselessVoid public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = FrameCount; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = FrameCount; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); if (!Main.dedServ) { @@ -99,7 +99,7 @@ namespace CalamityMod.NPCs.CeaselessVoid public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -207,10 +207,10 @@ namespace CalamityMod.NPCs.CeaselessVoid public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - Texture2D mainTexture = TextureAssets.Npc[NPC.type].Value; + Texture2D mainTexture = TextureAssets.Npc[Type].Value; Vector2 drawPos = NPC.Center - screenPos; SpriteEffects spriteEffects = SpriteEffects.None; - Vector2 drawOrigin = new Vector2(mainTexture.Width / 2, mainTexture.Height / Main.npcFrameCount[NPC.type] / 2); + Vector2 drawOrigin = new Vector2(mainTexture.Width / 2, mainTexture.Height / Main.npcFrameCount[Type] / 2); if (NPC.IsABestiaryIconDummy) { @@ -225,7 +225,7 @@ namespace CalamityMod.NPCs.CeaselessVoid Color white = Color.White * NPC.Opacity; int trailCount = 5; - drawPos -= new Vector2(mainTexture.Width, mainTexture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawPos -= new Vector2(mainTexture.Width, mainTexture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; drawPos += drawOrigin * NPC.scale + new Vector2(0f, NPC.gfxOffY); if (CalamityClientConfig.Instance.Afterimages) @@ -237,7 +237,7 @@ namespace CalamityMod.NPCs.CeaselessVoid trailColor = NPC.GetAlpha(trailColor); trailColor *= (trailCount - i) / 15f; Vector2 trailPos = NPC.oldPos[i] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - trailPos -= new Vector2(mainTexture.Width, mainTexture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + trailPos -= new Vector2(mainTexture.Width, mainTexture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; trailPos += drawOrigin * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(mainTexture, trailPos, NPC.frame, trailColor, NPC.rotation, drawOrigin, NPC.scale, spriteEffects, 0f); } @@ -260,7 +260,7 @@ namespace CalamityMod.NPCs.CeaselessVoid trailColor2 = NPC.GetAlpha(trailColor2); trailColor2 *= (trailCount - i) / 15f; Vector2 trailPos2 = NPC.oldPos[i] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - trailPos2 -= new Vector2(glowTexture.Width, glowTexture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + trailPos2 -= new Vector2(glowTexture.Width, glowTexture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; trailPos2 += drawOrigin * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(glowTexture, trailPos2, NPC.frame, trailColor2, NPC.rotation, drawOrigin, NPC.scale, spriteEffects, 0f); } diff --git a/NPCs/Crabulon/CrabShroom.cs b/NPCs/Crabulon/CrabShroom.cs index d97ac27fe5..2e5c6b89cb 100644 --- a/NPCs/Crabulon/CrabShroom.cs +++ b/NPCs/Crabulon/CrabShroom.cs @@ -17,7 +17,7 @@ namespace CalamityMod.NPCs.Crabulon public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; NPCID.Sets.BossBestiaryPriority.Add(Type); if (!Main.dedServ) { @@ -57,7 +57,7 @@ namespace CalamityMod.NPCs.Crabulon public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -135,7 +135,7 @@ namespace CalamityMod.NPCs.Crabulon if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; Texture2D glow = GlowTexture.Value; Color colorToShift = Main.zenithWorld ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB) : Color.Cyan; Color glowColor = Color.Lerp(Color.White, colorToShift, 0.5f); @@ -143,9 +143,9 @@ namespace CalamityMod.NPCs.Crabulon int ClonesAroundShroom = Main.zenithWorld ? 4 : 0; for (int c = 0; c < 1 + ClonesAroundShroom; c++) { - Vector2 drawOrigin = new Vector2(texture.Width / 2, texture.Height / Main.npcFrameCount[NPC.type] / 2); + Vector2 drawOrigin = new Vector2(texture.Width / 2, texture.Height / Main.npcFrameCount[Type] / 2); Vector2 drawPos = NPC.Center - screenPos + (Vector2.UnitX * texture.Width * c).RotatedByRandom(c); - drawPos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawPos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; drawPos += drawOrigin * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, drawPos, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, drawOrigin, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/Crabulon/Crabulon.cs b/NPCs/Crabulon/Crabulon.cs index 15b69796dc..b5d537b98a 100644 --- a/NPCs/Crabulon/Crabulon.cs +++ b/NPCs/Crabulon/Crabulon.cs @@ -50,7 +50,7 @@ namespace CalamityMod.NPCs.Crabulon public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -739,7 +739,7 @@ namespace CalamityMod.NPCs.Crabulon stomping = false; NPC.frameCounter += 0.15; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -778,7 +778,7 @@ namespace CalamityMod.NPCs.Crabulon stomping = false; NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -792,7 +792,7 @@ namespace CalamityMod.NPCs.Crabulon if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D textureIdle = TextureAssets.Npc[NPC.type].Value; + Texture2D textureIdle = TextureAssets.Npc[Type].Value; Texture2D glowIdle = Texture_Glow.Value; Texture2D textureWalk = AltTexture.Value; Texture2D glowWalk = AltTexture_Glow.Value; @@ -804,13 +804,13 @@ namespace CalamityMod.NPCs.Crabulon int ClonesOnEachSide = Main.zenithWorld ? 2 : 0; for (int c = 0 - ClonesOnEachSide; c < 1 + ClonesOnEachSide; c++) { - Vector2 drawOrigin = new Vector2(textureIdle.Width / 2, textureIdle.Height / Main.npcFrameCount[NPC.type] / 2); + Vector2 drawOrigin = new Vector2(textureIdle.Width / 2, textureIdle.Height / Main.npcFrameCount[Type] / 2); Vector2 drawPos = NPC.Center - screenPos + (Vector2.UnitX * textureIdle.Width * c * 1.6f); // Jumping if (NPC.ai[0] > 2f && NPC.velocity.Y != 0f) { drawOrigin = new Vector2(textureAttack.Width / 2, textureAttack.Height / 2); - drawPos -= new Vector2(textureAttack.Width, textureAttack.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawPos -= new Vector2(textureAttack.Width, textureAttack.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; drawPos += drawOrigin * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(textureAttack, drawPos, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, drawOrigin, NPC.scale, spriteEffects, 0f); @@ -820,7 +820,7 @@ namespace CalamityMod.NPCs.Crabulon else if (NPC.ai[0] == 1f) { drawOrigin = new Vector2(textureWalk.Width / 2, textureWalk.Height / 2); - drawPos -= new Vector2(textureWalk.Width, textureWalk.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawPos -= new Vector2(textureWalk.Width, textureWalk.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; drawPos += drawOrigin * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(textureWalk, drawPos, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, drawOrigin, NPC.scale, spriteEffects, 0f); @@ -829,7 +829,7 @@ namespace CalamityMod.NPCs.Crabulon // Standing still else { - drawPos -= new Vector2(textureIdle.Width, textureIdle.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawPos -= new Vector2(textureIdle.Width, textureIdle.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; drawPos += drawOrigin * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(textureIdle, drawPos, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, drawOrigin, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/Crags/CalamityEye.cs b/NPCs/Crags/CalamityEye.cs index ae45a2ad6d..3a5430ba14 100644 --- a/NPCs/Crags/CalamityEye.cs +++ b/NPCs/Crags/CalamityEye.cs @@ -14,7 +14,7 @@ namespace CalamityMod.NPCs.Crags { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers(); value.Position.Y -= 10f; value.PortraitPositionYOverride = -36f; diff --git a/NPCs/Crags/DespairStone.cs b/NPCs/Crags/DespairStone.cs index 5b5a0367bd..5170db261a 100644 --- a/NPCs/Crags/DespairStone.cs +++ b/NPCs/Crags/DespairStone.cs @@ -3,8 +3,8 @@ using CalamityMod.BiomeManagers; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Crags; using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; using CalamityMod.Particles; using CalamityMod.World; diff --git a/NPCs/Crags/HeatSpirit.cs b/NPCs/Crags/HeatSpirit.cs index f2837be0e0..92d7ff59fb 100644 --- a/NPCs/Crags/HeatSpirit.cs +++ b/NPCs/Crags/HeatSpirit.cs @@ -15,7 +15,7 @@ namespace CalamityMod.NPCs.Crags { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { SpriteDirection = -1, @@ -86,7 +86,7 @@ namespace CalamityMod.NPCs.Crags NPC.rotation = (float)Math.Atan2((double)(NPC.velocity.Y * (float)NPC.direction), (double)(NPC.velocity.X * (float)NPC.direction)); } NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/Crags/InfernalCongealment.cs b/NPCs/Crags/InfernalCongealment.cs index a3a5de90d7..99a577e956 100644 --- a/NPCs/Crags/InfernalCongealment.cs +++ b/NPCs/Crags/InfernalCongealment.cs @@ -15,7 +15,7 @@ namespace CalamityMod.NPCs.Crags { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 2; + Main.npcFrameCount[Type] = 2; } public override void SetDefaults() diff --git a/NPCs/Crags/RenegadeWarlock.cs b/NPCs/Crags/RenegadeWarlock.cs index 0a10f3ec50..034ca0b0ae 100644 --- a/NPCs/Crags/RenegadeWarlock.cs +++ b/NPCs/Crags/RenegadeWarlock.cs @@ -15,7 +15,7 @@ namespace CalamityMod.NPCs.Crags { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; } public override void SetDefaults() diff --git a/NPCs/Crags/Scryllar.cs b/NPCs/Crags/Scryllar.cs index 65acb40774..05d844cff5 100644 --- a/NPCs/Crags/Scryllar.cs +++ b/NPCs/Crags/Scryllar.cs @@ -134,7 +134,7 @@ namespace CalamityMod.NPCs.Crags break; } } - if (Main.player[NPC.target].npcTypeNoAggro[NPC.type]) + if (Main.player[NPC.target].npcTypeNoAggro[Type]) { bool inTileNoAggro = false; for (int loopInc2 = npcTileY; loopInc2 < npcTileY + tileCheckLoopAmt - 2; loopInc2++) diff --git a/NPCs/Crags/ScryllarRage.cs b/NPCs/Crags/ScryllarRage.cs index 99d700fe1a..e73be83f5c 100644 --- a/NPCs/Crags/ScryllarRage.cs +++ b/NPCs/Crags/ScryllarRage.cs @@ -116,7 +116,7 @@ namespace CalamityMod.NPCs.Crags break; } } - if (Main.player[NPC.target].npcTypeNoAggro[NPC.type]) + if (Main.player[NPC.target].npcTypeNoAggro[Type]) { bool inTileNoAggro = false; for (int loopInc2 = npcTileY; loopInc2 < npcTileY + tileCheckLoopAmt - 2; loopInc2++) diff --git a/NPCs/Crags/SoulSlurper.cs b/NPCs/Crags/SoulSlurper.cs index 3497368010..de9995a56b 100644 --- a/NPCs/Crags/SoulSlurper.cs +++ b/NPCs/Crags/SoulSlurper.cs @@ -23,8 +23,8 @@ namespace CalamityMod.NPCs.Crags public override void SetStaticDefaults() { - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; - NPCID.Sets.TrailingMode[NPC.type] = 1; + NPCID.Sets.NeedsExpertScaling[Type] = true; + NPCID.Sets.TrailingMode[Type] = 1; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); @@ -248,7 +248,7 @@ namespace CalamityMod.NPCs.Crags if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; Vector2 halfSizeTexture = new Vector2((float)(texture.Width / 2), (float)(texture.Height / 2)); int afterimageAmt = 5; diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index 0163d84fff..c887e6d6c4 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -1298,7 +1298,7 @@ namespace CalamityMod.NPCs.Cryogen FireDrawer = null; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; switch (currentPhase) { case 2: @@ -1317,7 +1317,7 @@ namespace CalamityMod.NPCs.Cryogen texture = Phase6Texture.Value; break; default: - texture = TextureAssets.Npc[NPC.type].Value; + texture = TextureAssets.Npc[Type].Value; break; } @@ -1327,9 +1327,9 @@ namespace CalamityMod.NPCs.Cryogen NPC.DrawBackglow(Main.zenithWorld ? Color.Red : BackglowColor, 4f, spriteEffects, NPC.frame, screenPos); - Vector2 origin = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Vector2 origin = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); Vector2 drawPos = NPC.Center - screenPos; - drawPos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawPos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; drawPos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); Color overlay = Main.zenithWorld ? Color.Red : drawColor; spriteBatch.Draw(texture, drawPos, NPC.frame, NPC.GetAlpha(overlay), NPC.rotation, origin, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/Cryogen/CryogenShield.cs b/NPCs/Cryogen/CryogenShield.cs index 9b1e75d0c2..532154de8c 100644 --- a/NPCs/Cryogen/CryogenShield.cs +++ b/NPCs/Cryogen/CryogenShield.cs @@ -133,9 +133,9 @@ namespace CalamityMod.NPCs.Cryogen NPC.DrawBackglow(Main.zenithWorld ? Color.Red : Cryogen.BackglowColor, 4f, SpriteEffects.None, NPC.frame, screenPos); - Vector2 origin = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Vector2 origin = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); Vector2 drawPos = NPC.Center - screenPos; - drawPos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawPos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; drawPos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); Color overlay = Main.zenithWorld ? Color.Red : drawColor; spriteBatch.Draw(texture, drawPos, NPC.frame, NPC.GetAlpha(overlay), NPC.rotation, origin, NPC.scale, SpriteEffects.None, 0f); diff --git a/NPCs/DesertScourge/DesertNuisanceBody.cs b/NPCs/DesertScourge/DesertNuisanceBody.cs index 174272a1d0..ca4fb0570f 100644 --- a/NPCs/DesertScourge/DesertNuisanceBody.cs +++ b/NPCs/DesertScourge/DesertNuisanceBody.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 7; + Main.npcFrameCount[Type] = 7; this.HideFromBestiary(); @@ -281,7 +281,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.frame.Y += frameHeight; NPC.frameCounter = 0D; } - if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[NPC.type]) + if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[Type]) NPC.frame.Y = 0; } } diff --git a/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs b/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs index 383854dca3..5a24a228c4 100644 --- a/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 7; + Main.npcFrameCount[Type] = 7; this.HideFromBestiary(); @@ -289,7 +289,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.frame.Y += frameHeight; NPC.frameCounter = 0D; } - if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[NPC.type]) + if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[Type]) NPC.frame.Y = 0; } } diff --git a/NPCs/DesertScourge/DesertNuisanceHead.cs b/NPCs/DesertScourge/DesertNuisanceHead.cs index d2d203833e..b72b17ecaf 100644 --- a/NPCs/DesertScourge/DesertNuisanceHead.cs +++ b/NPCs/DesertScourge/DesertNuisanceHead.cs @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 7; + Main.npcFrameCount[Type] = 7; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() @@ -550,7 +550,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.frame.Y += frameHeight; NPC.frameCounter = 0D; } - if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[NPC.type]) + if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[Type]) { NPC.ai[3] = 2f; NPC.netUpdate = true; @@ -575,7 +575,7 @@ namespace CalamityMod.NPCs.DesertScourge { if (NPC.frame.Y > 0) { - if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[NPC.type]) + if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[Type]) { NPC.frame.Y = 0; NPC.ai[3] = 0f; diff --git a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs index 8c14010ac6..deb6591e6b 100644 --- a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 7; + Main.npcFrameCount[Type] = 7; this.HideFromBestiary(); NPCID.Sets.MPAllowedEnemies[Type] = true; NPCID.Sets.CantTakeLunchMoney[Type] = true; @@ -593,7 +593,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.frame.Y += frameHeight; NPC.frameCounter = 0D; } - if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[NPC.type]) + if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[Type]) { NPC.ai[3] = 2f; NPC.netUpdate = true; @@ -618,7 +618,7 @@ namespace CalamityMod.NPCs.DesertScourge { if (NPC.frame.Y > 0) { - if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[NPC.type]) + if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[Type]) { NPC.frame.Y = 0; NPC.ai[3] = 0f; diff --git a/NPCs/DesertScourge/DesertScourgeBody.cs b/NPCs/DesertScourge/DesertScourgeBody.cs index 8f0e37ccec..55f6cd07e7 100644 --- a/NPCs/DesertScourge/DesertScourgeBody.cs +++ b/NPCs/DesertScourge/DesertScourgeBody.cs @@ -28,7 +28,7 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 7; + Main.npcFrameCount[Type] = 7; this.HideFromBestiary(); @@ -323,7 +323,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.frame.Y += frameHeight; NPC.frameCounter = 0D; } - if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[NPC.type]) + if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[Type]) NPC.frame.Y = 0; } } diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index 9d000c8cf8..fc57caf6b7 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -67,7 +67,7 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 7; + Main.npcFrameCount[Type] = 7; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() @@ -867,7 +867,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.frame.Y += frameHeight; NPC.frameCounter = 0D; } - if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[NPC.type]) + if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[Type]) { NPC.ai[3] = 2f; NPC.netUpdate = true; @@ -892,7 +892,7 @@ namespace CalamityMod.NPCs.DesertScourge { if (NPC.frame.Y > 0) { - if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[NPC.type]) + if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[Type]) { NPC.frame.Y = 0; NPC.ai[3] = 0f; diff --git a/NPCs/DevourerofGods/CosmicGuardianBody.cs b/NPCs/DevourerofGods/CosmicGuardianBody.cs index bace8225f8..43c9f062f9 100644 --- a/NPCs/DevourerofGods/CosmicGuardianBody.cs +++ b/NPCs/DevourerofGods/CosmicGuardianBody.cs @@ -164,8 +164,8 @@ namespace CalamityMod.NPCs.DevourerofGods if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / 2)); Vector2 drawLocation = NPC.Center - screenPos; drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * NPC.scale / 2f; diff --git a/NPCs/DevourerofGods/CosmicGuardianHead.cs b/NPCs/DevourerofGods/CosmicGuardianHead.cs index bc2501a11f..6f9825e6d1 100644 --- a/NPCs/DevourerofGods/CosmicGuardianHead.cs +++ b/NPCs/DevourerofGods/CosmicGuardianHead.cs @@ -361,8 +361,8 @@ namespace CalamityMod.NPCs.DevourerofGods if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / 2)); if (NPC.IsABestiaryIconDummy) diff --git a/NPCs/DevourerofGods/CosmicGuardianTail.cs b/NPCs/DevourerofGods/CosmicGuardianTail.cs index 089734c575..24469b1616 100644 --- a/NPCs/DevourerofGods/CosmicGuardianTail.cs +++ b/NPCs/DevourerofGods/CosmicGuardianTail.cs @@ -161,8 +161,8 @@ namespace CalamityMod.NPCs.DevourerofGods if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / 2)); Vector2 drawLocation = NPC.Center - screenPos; drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * NPC.scale / 2f; diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index b78344a2d5..3523335b13 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -398,7 +398,7 @@ namespace CalamityMod.NPCs.DevourerofGods spriteEffects = SpriteEffects.FlipHorizontally; bool useOtherTextures = phase2Started && Main.npc[(int)NPC.ai[2]].localAI[2] <= 60f; - Texture2D texture2D15 = useOtherTextures ? Phase2Texture.Value : TextureAssets.Npc[NPC.type].Value; + Texture2D texture2D15 = useOtherTextures ? Phase2Texture.Value : TextureAssets.Npc[Type].Value; Vector2 halfSizeTexture = new Vector2(texture2D15.Width / 2, texture2D15.Height / 2); Vector2 drawLocation = NPC.Center - screenPos; diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index dd77980711..8e5da0d276 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -135,6 +135,7 @@ namespace CalamityMod.NPCs.DevourerofGods // Phase variables private const int idleCounterMax = 300; private int idleCounter = idleCounterMax; + private const float LaserWallCooldown = 1200f; private int postTeleportTimer = 0; private int teleportTimer = -1; private const int TimeBeforeTeleport_Death = 120; @@ -693,8 +694,9 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.Opacity = 1f - (MathHelper.Clamp((calamityGlobalNPC.newAI[3] - alphaGateValue) * 5f, 0f, 255f) / 255f); } - // Fire laser walls every 12 seconds after a laser wall phase ends - if (calamityGlobalNPC.newAI[3] >= 720f) + // Fire laser walls every X seconds after a laser wall phase ends + float laserWallGateValue = LaserWallCooldown - (bossRush ? 360f : death ? 180f : 0f); + if (calamityGlobalNPC.newAI[3] >= LaserWallCooldown) { NPC.Opacity = 0f; @@ -707,7 +709,7 @@ namespace CalamityMod.NPCs.DevourerofGods } else if (laserWallPhase == (int)LaserWallPhase.FireLaserWalls) { - // Remain in laser wall firing phase for 4 seconds + // Remain in laser wall firing phase for X seconds idleCounter--; if (idleCounter <= 0) { @@ -1030,9 +1032,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (Main.netMode != NetmodeID.Server) { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles) - { Main.player[Main.myPlayer].Calamity().infiniteFlight = true; - } } } @@ -1083,11 +1083,7 @@ namespace CalamityMod.NPCs.DevourerofGods { if (laserWallPhase == (int)LaserWallPhase.SetUp && calamityGlobalNPC.newAI[3] <= alphaGateValue) SpawnTeleportLocation(player); - else - calamityGlobalNPC.newAI[2] += 10f; } - else - calamityGlobalNPC.newAI[2] += 2f; float speedCopy = speed; float turnSpeedCopy = turnSpeed; @@ -1641,7 +1637,7 @@ namespace CalamityMod.NPCs.DevourerofGods } // Laser barrage attack variables - float laserBarrageGateValue = bossRush ? 780f : death ? 900f : 960f; + float laserBarrageGateValue = bossRush ? 1080f : death ? 1320f : 1440f; float laserBarrageShootGateValue = bossRush ? 160f : 240f; float laserBarragePhaseGateValue = laserBarrageGateValue - laserBarrageShootGateValue; @@ -1879,12 +1875,6 @@ namespace CalamityMod.NPCs.DevourerofGods calamityGlobalNPC.newAI[2] += 1f; - // Go to ground phase sooner - if (increaseSpeedMore) - calamityGlobalNPC.newAI[2] += 10f; - else if (increaseSpeed) - calamityGlobalNPC.newAI[2] += 2f; - float speedCopy = speed; float turnSpeedCopy = turnSpeed; Vector2 npcCenter = NPC.Center; @@ -2626,7 +2616,7 @@ namespace CalamityMod.NPCs.DevourerofGods spriteEffects = SpriteEffects.FlipHorizontally; bool useOtherTextures = (Phase2Started && NPC.localAI[2] <= 60f) || NPC.IsABestiaryIconDummy; - Texture2D texture2D15 = useOtherTextures ? Phase2Texture.Value : TextureAssets.Npc[NPC.type].Value; + Texture2D texture2D15 = useOtherTextures ? Phase2Texture.Value : TextureAssets.Npc[Type].Value; Vector2 halfSizeTexture = new Vector2(texture2D15.Width / 2, texture2D15.Height / 2); if (NPC.IsABestiaryIconDummy) { diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index fe52904f8a..2dcd798415 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -361,7 +361,7 @@ namespace CalamityMod.NPCs.DevourerofGods spriteEffects = SpriteEffects.FlipHorizontally; bool useOtherTextures = phase2Started && Main.npc[(int)NPC.ai[2]].localAI[2] <= 60f; - Texture2D texture2D15 = useOtherTextures ? Phase2Texture.Value : TextureAssets.Npc[NPC.type].Value; + Texture2D texture2D15 = useOtherTextures ? Phase2Texture.Value : TextureAssets.Npc[Type].Value; Vector2 halfSizeTexture = new Vector2(texture2D15.Width / 2, texture2D15.Height / 2); Vector2 drawPosition = NPC.Center - screenPos; diff --git a/NPCs/DraedonLabThings/Androomba.cs b/NPCs/DraedonLabThings/Androomba.cs index 012e36788c..0685a9f629 100644 --- a/NPCs/DraedonLabThings/Androomba.cs +++ b/NPCs/DraedonLabThings/Androomba.cs @@ -22,9 +22,9 @@ namespace CalamityMod.NPCs.DraedonLabThings public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 22; - NPCID.Sets.CountsAsCritter[NPC.type] = true; - Main.npcCatchable[NPC.type] = true; + Main.npcFrameCount[Type] = 22; + NPCID.Sets.CountsAsCritter[Type] = true; + Main.npcCatchable[Type] = true; NPCID.Sets.NormalGoldCritterBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers(); value.Position.Y += 18; @@ -256,7 +256,7 @@ namespace CalamityMod.NPCs.DraedonLabThings public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - Texture2D critterTexture = TextureAssets.Npc[NPC.type].Value; + Texture2D critterTexture = TextureAssets.Npc[Type].Value; Texture2D glowmask = GlowTexture.Value; Vector2 drawPosition = NPC.Center - screenPos + Vector2.UnitY * NPC.gfxOffY; drawPosition.Y += DrawOffsetY; diff --git a/NPCs/DraedonLabThings/Nanodroid.cs b/NPCs/DraedonLabThings/Nanodroid.cs index 5730109ccb..bc9a1f74ee 100644 --- a/NPCs/DraedonLabThings/Nanodroid.cs +++ b/NPCs/DraedonLabThings/Nanodroid.cs @@ -17,9 +17,9 @@ namespace CalamityMod.NPCs.DraedonLabThings public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 8; - NPCID.Sets.CountsAsCritter[NPC.type] = true; - Main.npcCatchable[NPC.type] = true; + Main.npcFrameCount[Type] = 8; + NPCID.Sets.CountsAsCritter[Type] = true; + Main.npcCatchable[Type] = true; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "_Glow", AssetRequestMode.AsyncLoad); @@ -58,7 +58,7 @@ namespace CalamityMod.NPCs.DraedonLabThings { NPC.spriteDirection = NPC.direction; NPC.frameCounter += 0.3f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -71,7 +71,7 @@ namespace CalamityMod.NPCs.DraedonLabThings public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - Texture2D critterTexture = TextureAssets.Npc[NPC.type].Value; + Texture2D critterTexture = TextureAssets.Npc[Type].Value; Texture2D glowmask = GlowTexture.Value; Vector2 drawPosition = NPC.Center - screenPos + Vector2.UnitY * NPC.gfxOffY; SpriteEffects direction = NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; diff --git a/NPCs/DraedonLabThings/NanodroidDysfunctional.cs b/NPCs/DraedonLabThings/NanodroidDysfunctional.cs index c2ffabf81f..c8fda4b19b 100644 --- a/NPCs/DraedonLabThings/NanodroidDysfunctional.cs +++ b/NPCs/DraedonLabThings/NanodroidDysfunctional.cs @@ -17,9 +17,9 @@ namespace CalamityMod.NPCs.DraedonLabThings public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 8; - NPCID.Sets.CountsAsCritter[NPC.type] = true; - Main.npcCatchable[NPC.type] = true; + Main.npcFrameCount[Type] = 8; + NPCID.Sets.CountsAsCritter[Type] = true; + Main.npcCatchable[Type] = true; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "_Glow", AssetRequestMode.AsyncLoad); @@ -62,7 +62,7 @@ namespace CalamityMod.NPCs.DraedonLabThings { NPC.spriteDirection = NPC.direction; NPC.frameCounter += 0.3f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -75,7 +75,7 @@ namespace CalamityMod.NPCs.DraedonLabThings public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - Texture2D critterTexture = TextureAssets.Npc[NPC.type].Value; + Texture2D critterTexture = TextureAssets.Npc[Type].Value; Texture2D glowmask = GlowTexture.Value; Vector2 drawPosition = NPC.Center - screenPos + Vector2.UnitY * NPC.gfxOffY; SpriteEffects direction = NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; diff --git a/NPCs/DraedonLabThings/NanodroidPlagueGreen.cs b/NPCs/DraedonLabThings/NanodroidPlagueGreen.cs index 5ff3367eba..2a009ae63f 100644 --- a/NPCs/DraedonLabThings/NanodroidPlagueGreen.cs +++ b/NPCs/DraedonLabThings/NanodroidPlagueGreen.cs @@ -17,9 +17,9 @@ namespace CalamityMod.NPCs.DraedonLabThings public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 8; - NPCID.Sets.CountsAsCritter[NPC.type] = true; - Main.npcCatchable[NPC.type] = true; + Main.npcFrameCount[Type] = 8; + NPCID.Sets.CountsAsCritter[Type] = true; + Main.npcCatchable[Type] = true; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "_Glow", AssetRequestMode.AsyncLoad); @@ -65,7 +65,7 @@ namespace CalamityMod.NPCs.DraedonLabThings { NPC.spriteDirection = NPC.direction; NPC.frameCounter += 0.3f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -78,7 +78,7 @@ namespace CalamityMod.NPCs.DraedonLabThings public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - Texture2D critterTexture = TextureAssets.Npc[NPC.type].Value; + Texture2D critterTexture = TextureAssets.Npc[Type].Value; Texture2D glowmask = GlowTexture.Value; Vector2 drawPosition = NPC.Center - screenPos + Vector2.UnitY * NPC.gfxOffY; SpriteEffects direction = NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; diff --git a/NPCs/DraedonLabThings/NanodroidPlagueRed.cs b/NPCs/DraedonLabThings/NanodroidPlagueRed.cs index 59c47a71f4..094e9cc3f4 100644 --- a/NPCs/DraedonLabThings/NanodroidPlagueRed.cs +++ b/NPCs/DraedonLabThings/NanodroidPlagueRed.cs @@ -17,9 +17,9 @@ namespace CalamityMod.NPCs.DraedonLabThings public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 8; - NPCID.Sets.CountsAsCritter[NPC.type] = true; - Main.npcCatchable[NPC.type] = true; + Main.npcFrameCount[Type] = 8; + NPCID.Sets.CountsAsCritter[Type] = true; + Main.npcCatchable[Type] = true; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "_Glow", AssetRequestMode.AsyncLoad); @@ -65,7 +65,7 @@ namespace CalamityMod.NPCs.DraedonLabThings { NPC.spriteDirection = NPC.direction; NPC.frameCounter += 0.3f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -78,7 +78,7 @@ namespace CalamityMod.NPCs.DraedonLabThings public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - Texture2D critterTexture = TextureAssets.Npc[NPC.type].Value; + Texture2D critterTexture = TextureAssets.Npc[Type].Value; Texture2D glowmask = GlowTexture.Value; Vector2 drawPosition = NPC.Center - screenPos + Vector2.UnitY * NPC.gfxOffY; SpriteEffects direction = NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; diff --git a/NPCs/DraedonLabThings/RepairUnitCritter.cs b/NPCs/DraedonLabThings/RepairUnitCritter.cs index 0edf8ef94a..8c425427dd 100644 --- a/NPCs/DraedonLabThings/RepairUnitCritter.cs +++ b/NPCs/DraedonLabThings/RepairUnitCritter.cs @@ -55,9 +55,9 @@ namespace CalamityMod.NPCs.DraedonLabThings public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 17; - Main.npcCatchable[NPC.type] = true; - NPCID.Sets.CountsAsCritter[NPC.type] = true; + Main.npcFrameCount[Type] = 17; + Main.npcCatchable[Type] = true; + NPCID.Sets.CountsAsCritter[Type] = true; NPCID.Sets.CantTakeLunchMoney[Type] = true; NPCID.Sets.NormalGoldCritterBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers(); @@ -316,7 +316,7 @@ namespace CalamityMod.NPCs.DraedonLabThings if (CurrentFrame < 9) CurrentFrame = 9f; CurrentFrame++; - if (CurrentFrame >= Main.npcFrameCount[NPC.type]) + if (CurrentFrame >= Main.npcFrameCount[Type]) CurrentFrame = 9f; NPC.frameCounter = 0; } @@ -369,7 +369,7 @@ namespace CalamityMod.NPCs.DraedonLabThings public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - Texture2D critterTexture = TextureAssets.Npc[NPC.type].Value; + Texture2D critterTexture = TextureAssets.Npc[Type].Value; Texture2D glowmask = GlowTexture.Value; Vector2 drawPosition = NPC.Center - screenPos + Vector2.UnitY * NPC.gfxOffY; SpriteEffects direction = NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index 5398646667..3b0399f151 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -123,8 +123,8 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo public override void SetStaticDefaults() { - NPCID.Sets.TrailingMode[NPC.type] = 3; - NPCID.Sets.TrailCacheLength[NPC.type] = 15; + NPCID.Sets.TrailingMode[Type] = 3; + NPCID.Sets.TrailCacheLength[Type] = 15; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -1516,7 +1516,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); int numAfterimages = ChargeComboFlash > 0f ? 0 : 5; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; Rectangle frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); Vector2 origin = NPC.Size * 0.5f; Vector2 center = NPC.Center - screenPos; diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index 3b36ec5768..865d154ccf 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -182,8 +182,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public override void SetStaticDefaults() { - NPCID.Sets.TrailingMode[NPC.type] = 3; - NPCID.Sets.TrailCacheLength[NPC.type] = NPC.oldPos.Length; + NPCID.Sets.TrailingMode[Type] = 3; + NPCID.Sets.TrailCacheLength[Type] = NPC.oldPos.Length; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -1237,7 +1237,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares DrawArm(spriteBatch, NPC.Center + NPC.scale * new Vector2(400f, 300f), screenPos, armGlowmaskColor, 1, false); } - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; Rectangle frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); Vector2 vector = new Vector2(NPC.width / 2, NPC.height / 2); int numAfterimages = 5; diff --git a/NPCs/ExoMechs/Ares/AresGaussNuke.cs b/NPCs/ExoMechs/Ares/AresGaussNuke.cs index e6290d2bf7..2590e97a5a 100644 --- a/NPCs/ExoMechs/Ares/AresGaussNuke.cs +++ b/NPCs/ExoMechs/Ares/AresGaussNuke.cs @@ -76,8 +76,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public override void SetStaticDefaults() { this.HideFromBestiary(); - NPCID.Sets.TrailingMode[NPC.type] = 3; - NPCID.Sets.TrailCacheLength[NPC.type] = NPC.oldPos.Length; + NPCID.Sets.TrailingMode[Type] = 3; + NPCID.Sets.TrailCacheLength[Type] = NPC.oldPos.Length; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); @@ -546,7 +546,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; Rectangle frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); Vector2 vector = new Vector2(NPC.width / 2, NPC.height / 2); Color afterimageBaseColor = Main.npc[(int)NPC.ai[2]].localAI[1] == (float)AresBody.Enraged.Yes ? Color.Red : Color.White; diff --git a/NPCs/ExoMechs/Ares/AresLaserCannon.cs b/NPCs/ExoMechs/Ares/AresLaserCannon.cs index 50e90dd8ee..71b77c28f0 100644 --- a/NPCs/ExoMechs/Ares/AresLaserCannon.cs +++ b/NPCs/ExoMechs/Ares/AresLaserCannon.cs @@ -79,8 +79,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public override void SetStaticDefaults() { this.HideFromBestiary(); - NPCID.Sets.TrailingMode[NPC.type] = 3; - NPCID.Sets.TrailCacheLength[NPC.type] = NPC.oldPos.Length; + NPCID.Sets.TrailingMode[Type] = 3; + NPCID.Sets.TrailCacheLength[Type] = NPC.oldPos.Length; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); @@ -594,7 +594,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; Rectangle frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); Vector2 vector = new Vector2(NPC.width / 2, NPC.height / 2); Color afterimageBaseColor = Main.npc[(int)NPC.ai[2]].localAI[1] == (float)AresBody.Enraged.Yes ? Color.Red : Color.White; diff --git a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs index 3cd116c063..27af6cc19e 100644 --- a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs +++ b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs @@ -73,8 +73,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public override void SetStaticDefaults() { this.HideFromBestiary(); - NPCID.Sets.TrailingMode[NPC.type] = 3; - NPCID.Sets.TrailCacheLength[NPC.type] = NPC.oldPos.Length; + NPCID.Sets.TrailingMode[Type] = 3; + NPCID.Sets.TrailCacheLength[Type] = NPC.oldPos.Length; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); @@ -545,7 +545,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; Rectangle frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); Vector2 vector = new Vector2(NPC.width / 2, NPC.height / 2); Color afterimageBaseColor = Main.npc[(int)NPC.ai[2]].localAI[1] == (float)AresBody.Enraged.Yes ? Color.Red : Color.White; diff --git a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs index f98d292391..9934fbdb21 100644 --- a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs +++ b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs @@ -74,8 +74,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public override void SetStaticDefaults() { this.HideFromBestiary(); - NPCID.Sets.TrailingMode[NPC.type] = 3; - NPCID.Sets.TrailCacheLength[NPC.type] = NPC.oldPos.Length; + NPCID.Sets.TrailingMode[Type] = 3; + NPCID.Sets.TrailCacheLength[Type] = NPC.oldPos.Length; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); @@ -540,7 +540,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; Rectangle frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); Vector2 vector = new Vector2(NPC.width / 2, NPC.height / 2); Color afterimageBaseColor = Main.npc[(int)NPC.ai[2]].localAI[1] == (float)AresBody.Enraged.Yes ? Color.Red : Color.White; diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index cbd0ba8e18..c24b5dfb85 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -156,8 +156,8 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis public override void SetStaticDefaults() { - NPCID.Sets.TrailingMode[NPC.type] = 3; - NPCID.Sets.TrailCacheLength[NPC.type] = 15; + NPCID.Sets.TrailingMode[Type] = 3; + NPCID.Sets.TrailCacheLength[Type] = 15; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -1411,7 +1411,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); int numAfterimages = ChargeFlash > 0f ? 0 : 5; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; Rectangle frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); Vector2 origin = NPC.Size * 0.5f; Vector2 center = NPC.Center - screenPos; diff --git a/NPCs/ExoMechs/Draedon.cs b/NPCs/ExoMechs/Draedon.cs index 5754b9db54..3bfd6b266f 100644 --- a/NPCs/ExoMechs/Draedon.cs +++ b/NPCs/ExoMechs/Draedon.cs @@ -91,7 +91,7 @@ namespace CalamityMod.NPCs.ExoMechs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 12; + Main.npcFrameCount[Type] = 12; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { PortraitPositionYOverride = 40f, @@ -101,8 +101,8 @@ namespace CalamityMod.NPCs.ExoMechs }; value.Position.Y += 45f; NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; - NPCID.Sets.ShouldBeCountedAsBoss[NPC.type] = true; - NPCID.Sets.MustAlwaysDraw[NPC.type] = true; + NPCID.Sets.ShouldBeCountedAsBoss[Type] = true; + NPCID.Sets.MustAlwaysDraw[Type] = true; if (!Main.dedServ) { Texture_Glow = ModContent.Request(Texture + "Glowmask", AssetRequestMode.AsyncLoad); @@ -741,7 +741,7 @@ namespace CalamityMod.NPCs.ExoMechs int xFrame = NPC.frame.X / NPC.frame.Width; int yFrame = NPC.frame.Y / frameHeight; - int frame = xFrame * Main.npcFrameCount[NPC.type] + yFrame; + int frame = xFrame * Main.npcFrameCount[Type] + yFrame; // Prepare to stand up if called for and not already doing so. if (ShouldStartStandingUp && frame > 23) @@ -771,8 +771,8 @@ namespace CalamityMod.NPCs.ExoMechs NPC.frameCounter = 0; } - NPC.frame.X = frame / Main.npcFrameCount[NPC.type] * NPC.frame.Width; - NPC.frame.Y = frame % Main.npcFrameCount[NPC.type] * frameHeight; + NPC.frame.X = frame / Main.npcFrameCount[Type] * NPC.frame.Width; + NPC.frame.Y = frame % Main.npcFrameCount[Type] * frameHeight; // Handle framing for the projector ProjFrameChangeCounter++; @@ -841,7 +841,7 @@ namespace CalamityMod.NPCs.ExoMechs spriteBatch.EnterShaderRegion(); bool holo = HasBeenKilled && KillReappearDelay <= 0; bool leaving = HasBeenKilled && DefeatTimer > DelayBeforeDefeatStandup + TalkDelay * 8f + 200f; - Texture2D texture = HasBeenKilled && KillReappearDelay <= 0f ? HoloTexture.Value : TextureAssets.Npc[NPC.type].Value; + Texture2D texture = HasBeenKilled && KillReappearDelay <= 0f ? HoloTexture.Value : TextureAssets.Npc[Type].Value; Texture2D glowmask = Texture_Glow.Value; Texture2D projector = ProjectorTexture.Value; Texture2D projectorglow = ProjectorTexture_Glow.Value; @@ -871,7 +871,7 @@ namespace CalamityMod.NPCs.ExoMechs GameShaders.Misc["CalamityMod:TeleportDisplacement"].UseOpacity(MathHelper.Clamp(1f - HologramEffectTimer / HologramFadeinTime, 0f, 1f) * 0.38f); GameShaders.Misc["CalamityMod:TeleportDisplacement"].UseSecondaryColor(color); GameShaders.Misc["CalamityMod:TeleportDisplacement"].UseSaturation(color.A / 255f); - GameShaders.Misc["CalamityMod:TeleportDisplacement"].Shader.Parameters["frameCount"].SetValue(new Vector2(16f, Main.npcFrameCount[NPC.type])); + GameShaders.Misc["CalamityMod:TeleportDisplacement"].Shader.Parameters["frameCount"].SetValue(new Vector2(16f, Main.npcFrameCount[Type])); GameShaders.Misc["CalamityMod:TeleportDisplacement"].Apply(); } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index acf7edb991..414df945d7 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -54,7 +54,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); @@ -593,7 +593,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.frame.Y += frameHeight; NPC.frameCounter = 0D; } - int finalFrame = Main.npcFrameCount[NPC.type] - 1; + int finalFrame = Main.npcFrameCount[Type] - 1; if (NPC.frame.Y > frameHeight * finalFrame) NPC.frame.Y = frameHeight * finalFrame; } @@ -615,11 +615,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; - Vector2 vector = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Texture2D texture = TextureAssets.Npc[Type].Value; + Vector2 vector = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); Vector2 center = NPC.Center - screenPos; - center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; center += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, center, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index 60dfba869b..63def90f4a 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -53,7 +53,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); @@ -596,7 +596,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.frame.Y += frameHeight; NPC.frameCounter = 0D; } - int finalFrame = Main.npcFrameCount[NPC.type] - 1; + int finalFrame = Main.npcFrameCount[Type] - 1; if (NPC.frame.Y > frameHeight * finalFrame) NPC.frame.Y = frameHeight * finalFrame; } @@ -618,11 +618,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; - Vector2 vector = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Texture2D texture = TextureAssets.Npc[Type].Value; + Vector2 vector = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); Vector2 center = NPC.Center - screenPos; - center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; center += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, center, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index 546ab85673..c857c2b0ae 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -132,10 +132,10 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; // Ensure that the reticle is not culled due to the player being very far from Thanatos. - NPCID.Sets.MustAlwaysDraw[NPC.type] = true; + NPCID.Sets.MustAlwaysDraw[Type] = true; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -1094,7 +1094,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.frame.Y += frameHeight; NPC.frameCounter = 0D; } - int finalFrame = Main.npcFrameCount[NPC.type] - 1; + int finalFrame = Main.npcFrameCount[Type] - 1; if (NPC.frame.Y >= frameHeight * finalFrame) NPC.frame.Y = frameHeight * finalFrame; } @@ -1109,8 +1109,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; - Vector2 vector = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Texture2D texture = TextureAssets.Npc[Type].Value; + Vector2 vector = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); // Reimplementation of CalamityUtils.DrawAnimatedBestiaryWorm but tweaked due to Thanatos' animations if (NPC.IsABestiaryIconDummy) @@ -1139,7 +1139,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } Vector2 center = NPC.Center - screenPos; - center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; center += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, center, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index 05054f02de..a1dcf46bdf 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -53,7 +53,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); @@ -594,7 +594,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.frame.Y += frameHeight; NPC.frameCounter = 0D; } - int finalFrame = Main.npcFrameCount[NPC.type] - 1; + int finalFrame = Main.npcFrameCount[Type] - 1; if (NPC.frame.Y > frameHeight * finalFrame) NPC.frame.Y = frameHeight * finalFrame; } @@ -616,11 +616,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; - Vector2 vector = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Texture2D texture = TextureAssets.Npc[Type].Value; + Vector2 vector = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); Vector2 center = NPC.Center - screenPos; - center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; center += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, center, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs index 05e4e6f881..afcdb80d2f 100644 --- a/NPCs/GreatSandShark/GreatSandShark.cs +++ b/NPCs/GreatSandShark/GreatSandShark.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.GreatSandShark public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 8; + Main.npcFrameCount[Type] = 8; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -57,8 +57,8 @@ namespace CalamityMod.NPCs.GreatSandShark AIType = -1; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(0, 5, 0, 0); - NPCID.Sets.TrailCacheLength[NPC.type] = 8; - NPCID.Sets.TrailingMode[NPC.type] = 1; + NPCID.Sets.TrailCacheLength[Type] = 8; + NPCID.Sets.TrailingMode[Type] = 1; NPC.behindTiles = true; NPC.netAlways = true; NPC.DeathSound = DeathSound; @@ -582,7 +582,7 @@ namespace CalamityMod.NPCs.GreatSandShark NPC.spriteDirection = -NPC.direction; } NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -601,8 +601,8 @@ namespace CalamityMod.NPCs.GreatSandShark mainAfterimageColor = Color.Silver; extraAfterimageColor = Color.Orange; } - Texture2D texture2D3 = TextureAssets.Npc[NPC.type].Value; - int currentFrame = TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type]; + Texture2D texture2D3 = TextureAssets.Npc[Type].Value; + int currentFrame = TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type]; int y3 = currentFrame * (int)NPC.frameCounter; Rectangle rectangle = new Rectangle(0, y3, texture2D3.Width, currentFrame); Vector2 halfRectSize = rectangle.Size() / 2f; @@ -624,7 +624,7 @@ IL_6899: { afterimagesRemaining = (float)(1 - afterimageCounter); } - alphaAfterimageColor *= afterimagesRemaining / ((float)NPCID.Sets.TrailCacheLength[NPC.type] * 1.5f); + alphaAfterimageColor *= afterimagesRemaining / ((float)NPCID.Sets.TrailCacheLength[Type] * 1.5f); Vector2 afterimagePos = NPC.oldPos[afterimageCounter]; float afterimageRotation = NPC.rotation; Main.spriteBatch.Draw(texture2D3, afterimagePos + NPC.Size / 2f - screenPos + new Vector2(0, NPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), alphaAfterimageColor, afterimageRotation + NPC.rotation * 0f * (float)(afterimageCounter - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), halfRectSize, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/HiveMind/DarkHeart.cs b/NPCs/HiveMind/DarkHeart.cs index 9e86ce677f..9d4e8db3e6 100644 --- a/NPCs/HiveMind/DarkHeart.cs +++ b/NPCs/HiveMind/DarkHeart.cs @@ -14,8 +14,8 @@ namespace CalamityMod.NPCs.HiveMind { public override void SetStaticDefaults() { - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; - Main.npcFrameCount[NPC.type] = 4; + NPCID.Sets.NeedsExpertScaling[Type] = true; + Main.npcFrameCount[Type] = 4; NPCID.Sets.BossBestiaryPriority.Add(Type); } @@ -56,7 +56,7 @@ namespace CalamityMod.NPCs.HiveMind public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -94,25 +94,18 @@ namespace CalamityMod.NPCs.HiveMind if (NPC.velocity.Y > 0f) NPC.velocity.Y *= deceleration; - NPC.velocity.Y -= acceleration; - - if (NPC.velocity.Y > velocity) - NPC.velocity.Y = velocity; + NPC.velocity.Y = MathHelper.Clamp(NPC.velocity.Y - acceleration, -velocity * 1.5f, velocity); } else if (NPC.position.Y < Main.player[NPC.target].position.Y - 450f) { if (NPC.velocity.Y < 0f) NPC.velocity.Y *= deceleration; - NPC.velocity.Y += acceleration; - - if (NPC.velocity.Y < -velocity) - NPC.velocity.Y = -velocity; + NPC.velocity.Y = MathHelper.Clamp(NPC.velocity.Y + acceleration, -velocity, velocity * 1.5f); } bool dropRain = NPC.Bottom.Y < Main.player[NPC.target].position.Y - 300f && Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[NPC.target].position, Main.player[NPC.target].width, Main.player[NPC.target].height); float distanceX = masterMode ? 200f : 400f; - float velocityX = velocity * 1.5f; if (NPC.Center.X > Main.player[NPC.target].Center.X + distanceX) { dropRain = false; @@ -120,10 +113,7 @@ namespace CalamityMod.NPCs.HiveMind if (NPC.velocity.X > 0f) NPC.velocity.X *= deceleration; - NPC.velocity.X -= acceleration; - - if (NPC.velocity.X > velocityX) - NPC.velocity.X = velocityX; + NPC.velocity.X = MathHelper.Clamp(NPC.velocity.X - acceleration, -velocity * 1.5f, velocity); } if (NPC.Center.X < Main.player[NPC.target].Center.X - distanceX) { @@ -132,16 +122,13 @@ namespace CalamityMod.NPCs.HiveMind if (NPC.velocity.X < 0f) NPC.velocity.X *= deceleration; - NPC.velocity.X += acceleration; - - if (NPC.velocity.X < -velocityX) - NPC.velocity.X = -velocityX; + NPC.velocity.X = MathHelper.Clamp(NPC.velocity.X + acceleration, -velocity, velocity * 1.5f); } if (dropRain && Main.netMode != NetmodeID.MultiplayerClient) { NPC.ai[0] += 1f; - float rainDropRate = Main.getGoodWorld ? 8f : death ? 16f : revenge ? 20f : 24f; + float rainDropRate = Main.getGoodWorld ? 10f : death ? 20f : revenge ? 25f : 30f; if (NPC.ai[0] >= rainDropRate) { NPC.ai[0] = 0f; diff --git a/NPCs/HiveMind/HiveBlob.cs b/NPCs/HiveMind/HiveBlob.cs index c3f3c4bf4a..195befe9ea 100644 --- a/NPCs/HiveMind/HiveBlob.cs +++ b/NPCs/HiveMind/HiveBlob.cs @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.HiveMind public override void SetStaticDefaults() { - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; + NPCID.Sets.NeedsExpertScaling[Type] = true; } public override void SetDefaults() @@ -219,8 +219,8 @@ namespace CalamityMod.NPCs.HiveMind if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; - Vector2 vector = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2); + Texture2D texture = TextureAssets.Npc[Type].Value; + Vector2 vector = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / 2); Vector2 vector2 = NPC.Center - screenPos; vector2 -= new Vector2(texture.Width, texture.Height) * NPC.scale / 2f; diff --git a/NPCs/HiveMind/HiveBlob2.cs b/NPCs/HiveMind/HiveBlob2.cs index dd63f62274..0587b8edb2 100644 --- a/NPCs/HiveMind/HiveBlob2.cs +++ b/NPCs/HiveMind/HiveBlob2.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.HiveMind public override void SetStaticDefaults() { this.HideFromBestiary(); - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; + NPCID.Sets.NeedsExpertScaling[Type] = true; } public override void SetDefaults() @@ -213,8 +213,8 @@ namespace CalamityMod.NPCs.HiveMind if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; - Vector2 vector = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2); + Texture2D texture = TextureAssets.Npc[Type].Value; + Vector2 vector = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / 2); Vector2 vector2 = NPC.Center - screenPos; vector2 -= new Vector2(texture.Width, texture.Height) * NPC.scale / 2f; diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index 0e851ee1b4..600a0916c2 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -113,8 +113,8 @@ namespace CalamityMod.NPCs.HiveMind public override void SetStaticDefaults() { - NPCID.Sets.TrailingMode[NPC.type] = 1; - NPCID.Sets.TrailCacheLength[NPC.type] = NPC.oldPos.Length; + NPCID.Sets.TrailingMode[Type] = 1; + NPCID.Sets.TrailCacheLength[Type] = NPC.oldPos.Length; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -322,7 +322,7 @@ namespace CalamityMod.NPCs.HiveMind if (Main.dedServ) return true; - Texture2D texture = IsPhaseTwo ? Phase2Texture.Value : TextureAssets.Npc[NPC.type].Value; + Texture2D texture = IsPhaseTwo ? Phase2Texture.Value : TextureAssets.Npc[Type].Value; SpriteEffects spriteEffects = NPC.direction == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; Vector2 origin = new Vector2(NPC.width / 2, NPC.height); Vector2 center = NPC.position - screenPos + origin; @@ -411,7 +411,10 @@ namespace CalamityMod.NPCs.HiveMind else { if (Main.netMode != NetmodeID.MultiplayerClient) - SpawnStuff(); + { + if (NPC.Distance(Main.player[NPC.target].Center) > 80f) + SpawnStuff(); + } state = nextState; nextState = 0; @@ -1083,14 +1086,17 @@ namespace CalamityMod.NPCs.HiveMind if (expertMode && NPC.CountNPCS(ModContent.NPCType()) < maxHearts) NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType()); } - else if (!NPC.AnyNPCs(NPCID.EaterofSouls)) + else if (!NPC.AnyNPCs(NPCID.EaterofSouls) && NPC.Distance(Main.player[NPC.target].Center) > 80f) NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, NPCID.EaterofSouls); } if (NPC.ai[0] == 6f) { NPC.velocity = NPC.velocity.RotatedBy(MathHelper.Pi / arcTime * -rotationDirection); - SpawnStuff(); + + if (NPC.Distance(Main.player[NPC.target].Center) > 80f) + SpawnStuff(); + state = 6; NPC.ai[0] = 0f; deceleration = NPC.velocity / decelerationTime; @@ -1241,7 +1247,7 @@ namespace CalamityMod.NPCs.HiveMind for (int k = 0; k < hit.Damage / NPC.lifeMax * 100.0; k++) Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Demonite, hit.HitDirection, -1f, 0, default, 1f); - if (!IsPhaseTwo) + if (!IsPhaseTwo && NPC.Distance(Main.player[NPC.target].Center) > 80f) { if (Main.netMode != NetmodeID.MultiplayerClient) { diff --git a/NPCs/HiveMind/HiveTumor.cs b/NPCs/HiveMind/HiveTumor.cs index 0aec6bbfe8..8a3269a23c 100644 --- a/NPCs/HiveMind/HiveTumor.cs +++ b/NPCs/HiveMind/HiveTumor.cs @@ -11,7 +11,7 @@ namespace CalamityMod.NPCs.HiveMind { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; NPCID.Sets.CantTakeLunchMoney[Type] = true; NPCID.Sets.BossBestiaryPriority.Add(Type); } @@ -49,7 +49,7 @@ namespace CalamityMod.NPCs.HiveMind public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/Leviathan/Anahita.cs b/NPCs/Leviathan/Anahita.cs index efefcb1d32..6fd7dc0568 100644 --- a/NPCs/Leviathan/Anahita.cs +++ b/NPCs/Leviathan/Anahita.cs @@ -44,7 +44,7 @@ namespace CalamityMod.NPCs.Leviathan public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -889,11 +889,11 @@ namespace CalamityMod.NPCs.Leviathan public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; switch (frameUsed) { case 0: - texture = TextureAssets.Npc[NPC.type].Value; + texture = TextureAssets.Npc[Type].Value; break; case 1: texture = ChargeTexture.Value; @@ -901,7 +901,7 @@ namespace CalamityMod.NPCs.Leviathan } bool charging = NPC.ai[0] > 2f || forceChargeFrames; - int height = texture.Height / Main.npcFrameCount[NPC.type]; + int height = texture.Height / Main.npcFrameCount[Type]; int width = texture.Width; SpriteEffects spriteEffects = charging ? SpriteEffects.None : SpriteEffects.FlipHorizontally; if (NPC.spriteDirection == -1) @@ -919,11 +919,11 @@ namespace CalamityMod.NPCs.Leviathan int timeBetweenFrames = 8; NPC.frameCounter++; - if (NPC.frameCounter > timeBetweenFrames * Main.npcFrameCount[NPC.type]) + if (NPC.frameCounter > timeBetweenFrames * Main.npcFrameCount[Type]) NPC.frameCounter = 0; NPC.frame.Y = frameHeight * (int)(NPC.frameCounter / timeBetweenFrames); - if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[NPC.type]) + if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[Type]) NPC.frame.Y = 0; //100x1140 diff --git a/NPCs/Leviathan/AquaticAberration.cs b/NPCs/Leviathan/AquaticAberration.cs index e469609631..8a7e1f5543 100644 --- a/NPCs/Leviathan/AquaticAberration.cs +++ b/NPCs/Leviathan/AquaticAberration.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.Leviathan public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 7; + Main.npcFrameCount[Type] = 7; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers(); value.Position.X += 25; @@ -77,7 +77,7 @@ namespace CalamityMod.NPCs.Leviathan public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 856db1d813..4daf1c4db5 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -50,7 +50,7 @@ namespace CalamityMod.NPCs.Leviathan public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 3; + Main.npcFrameCount[Type] = 3; NPCID.Sets.BossBestiaryPriority.Add(Type); if (!Main.dedServ) AttackTexture = ModContent.Request("CalamityMod/NPCs/Leviathan/LeviathanAttack", AssetRequestMode.AsyncLoad); @@ -929,7 +929,7 @@ namespace CalamityMod.NPCs.Leviathan Texture2D texture = AttackTexture.Value; if (NPC.ai[0] == 1f || NPC.Calamity().newAI[3] < 180f) { - texture = TextureAssets.Npc[NPC.type].Value; + texture = TextureAssets.Npc[Type].Value; } SpriteEffects spriteEffects = SpriteEffects.FlipHorizontally; float xOffset = -50f; diff --git a/NPCs/Leviathan/LeviathanStart.cs b/NPCs/Leviathan/LeviathanStart.cs index f53a972388..19205bd748 100644 --- a/NPCs/Leviathan/LeviathanStart.cs +++ b/NPCs/Leviathan/LeviathanStart.cs @@ -19,7 +19,7 @@ namespace CalamityMod.NPCs.Leviathan public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; NPCID.Sets.CantTakeLunchMoney[Type] = true; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() @@ -87,7 +87,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.Opacity = 1f; NPC.frameCounter += 0.1f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -124,7 +124,7 @@ namespace CalamityMod.NPCs.Leviathan if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D drawTex = Main.zenithWorld ? TextureAssets.Npc[ModContent.NPCType()].Value : TextureAssets.Npc[NPC.type].Value; + Texture2D drawTex = Main.zenithWorld ? TextureAssets.Npc[ModContent.NPCType()].Value : TextureAssets.Npc[Type].Value; Rectangle frame = Main.zenithWorld ? drawTex.Frame(2, 3, 0, 0) : NPC.frame; Vector2 origin = new Vector2(drawTex.Width / 2, drawTex.Height / 2); @@ -135,7 +135,7 @@ namespace CalamityMod.NPCs.Leviathan } else { - drawPos -= new Vector2(drawTex.Width, drawTex.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawPos -= new Vector2(drawTex.Width, drawTex.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; drawPos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); } Color color = Main.zenithWorld ? Color.Purple : drawColor; diff --git a/NPCs/NormalNPCs/AeroSlime.cs b/NPCs/NormalNPCs/AeroSlime.cs index 9658663e8e..a72b4648a6 100644 --- a/NPCs/NormalNPCs/AeroSlime.cs +++ b/NPCs/NormalNPCs/AeroSlime.cs @@ -13,7 +13,7 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers(); value.Position.Y -= 6; value.PortraitPositionYOverride = -36f; diff --git a/NPCs/NormalNPCs/AuroraSpirit.cs b/NPCs/NormalNPCs/AuroraSpirit.cs index 46a0ab6dcc..0e177cee4c 100644 --- a/NPCs/NormalNPCs/AuroraSpirit.cs +++ b/NPCs/NormalNPCs/AuroraSpirit.cs @@ -13,7 +13,7 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { SpriteDirection = -1, @@ -63,9 +63,9 @@ namespace CalamityMod.NPCs.NormalNPCs int currentFrame = 1; if (!Main.dedServ) { - if (TextureAssets.Npc[NPC.type].Value == null) + if (TextureAssets.Npc[Type].Value == null) return; - currentFrame = TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type]; + currentFrame = TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type]; } if (!NPC.IsABestiaryIconDummy) @@ -87,7 +87,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.frame.Y += currentFrame; NPC.frameCounter = 0; } - if (NPC.frame.Y / currentFrame >= Main.npcFrameCount[NPC.type]) + if (NPC.frame.Y / currentFrame >= Main.npcFrameCount[Type]) NPC.frame.Y = 0; } diff --git a/NPCs/NormalNPCs/BloodlettingServant.cs b/NPCs/NormalNPCs/BloodlettingServant.cs index 65b90c9359..3e052a1098 100644 --- a/NPCs/NormalNPCs/BloodlettingServant.cs +++ b/NPCs/NormalNPCs/BloodlettingServant.cs @@ -251,7 +251,7 @@ namespace CalamityMod.NPCs.NormalNPCs { if (NPC.ai[0] >= ChargeTelegraphGateValue) { - Texture2D npcTexture = TextureAssets.Npc[NPC.type].Value; + Texture2D npcTexture = TextureAssets.Npc[Type].Value; Color originalColor = NPC.GetAlpha(drawColor); Color newColor = new Color(192, 0, 0, 255 - NPC.alpha); Vector2 drawPosition = NPC.Center - screenPos + new Vector2(0, NPC.gfxOffY); @@ -275,7 +275,7 @@ namespace CalamityMod.NPCs.NormalNPCs afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (afterimageAmount - j) / 15f; Vector2 afterimagePos = NPC.oldPos[j] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2(npcTexture.Width, npcTexture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + afterimagePos -= new Vector2(npcTexture.Width, npcTexture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; afterimagePos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(npcTexture, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, origin, NPC.scale, spriteEffects, 0f); } diff --git a/NPCs/NormalNPCs/BloomSlime.cs b/NPCs/NormalNPCs/BloomSlime.cs index 12357273e6..bc4f8c9849 100644 --- a/NPCs/NormalNPCs/BloomSlime.cs +++ b/NPCs/NormalNPCs/BloomSlime.cs @@ -13,7 +13,7 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 2; + Main.npcFrameCount[Type] = 2; } public override void SetDefaults() diff --git a/NPCs/NormalNPCs/BucketZombie.cs b/NPCs/NormalNPCs/BucketZombie.cs index 783ac033c7..17873f340f 100644 --- a/NPCs/NormalNPCs/BucketZombie.cs +++ b/NPCs/NormalNPCs/BucketZombie.cs @@ -15,7 +15,7 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 3; + Main.npcFrameCount[Type] = 3; NPCID.Sets.Zombies[Type] = true; } diff --git a/NPCs/NormalNPCs/CladCrab.cs b/NPCs/NormalNPCs/CladCrab.cs index 9a644b624a..51e14ce53b 100644 --- a/NPCs/NormalNPCs/CladCrab.cs +++ b/NPCs/NormalNPCs/CladCrab.cs @@ -17,7 +17,7 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 8; + Main.npcFrameCount[Type] = 8; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { SpriteDirection = 1 @@ -226,7 +226,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.Player.Calamity().ZoneSulphur || spawnInfo.Player.Calamity().ZoneSunkenSea) + if (spawnInfo.Player.Calamity().ZoneSulphur || spawnInfo.Player.Calamity().ZoneSunkenSea || !spawnInfo.Player.InZonePurity()) { return 0f; } @@ -262,7 +262,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.frame.Y = NPC.frame.Y + frameHeight; NPC.frameCounter = 0.0; } - if (NPC.frame.Y / frameHeight >= Main.npcFrameCount[NPC.type] - 1) + if (NPC.frame.Y / frameHeight >= Main.npcFrameCount[Type] - 1) { NPC.frame.Y = frameHeight; } @@ -270,7 +270,7 @@ namespace CalamityMod.NPCs.NormalNPCs else { NPC.frameCounter = 0.0; - NPC.frame.Y = frameHeight * (Main.npcFrameCount[NPC.type] - 1); + NPC.frame.Y = frameHeight * (Main.npcFrameCount[Type] - 1); } } diff --git a/NPCs/NormalNPCs/Cnidrion.cs b/NPCs/NormalNPCs/Cnidrion.cs index 94d8317100..f2bd31073a 100644 --- a/NPCs/NormalNPCs/Cnidrion.cs +++ b/NPCs/NormalNPCs/Cnidrion.cs @@ -15,8 +15,8 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; - Main.npcFrameCount[NPC.type] = 10; + NPCID.Sets.NeedsExpertScaling[Type] = true; + Main.npcFrameCount[Type] = 10; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { Scale = 0.8f, @@ -90,7 +90,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.1f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/NormalNPCs/CrawlerAmber.cs b/NPCs/NormalNPCs/CrawlerAmber.cs index cad696b1e9..17192a95df 100644 --- a/NPCs/NormalNPCs/CrawlerAmber.cs +++ b/NPCs/NormalNPCs/CrawlerAmber.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; } public override void SetDefaults() diff --git a/NPCs/NormalNPCs/CrawlerAmethyst.cs b/NPCs/NormalNPCs/CrawlerAmethyst.cs index 27fdd41d35..402b5e213f 100644 --- a/NPCs/NormalNPCs/CrawlerAmethyst.cs +++ b/NPCs/NormalNPCs/CrawlerAmethyst.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; } public override void SetDefaults() diff --git a/NPCs/NormalNPCs/CrawlerCrystal.cs b/NPCs/NormalNPCs/CrawlerCrystal.cs index b7e5c9677b..528a2c090b 100644 --- a/NPCs/NormalNPCs/CrawlerCrystal.cs +++ b/NPCs/NormalNPCs/CrawlerCrystal.cs @@ -17,7 +17,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; } public override void SetDefaults() diff --git a/NPCs/NormalNPCs/CrawlerDiamond.cs b/NPCs/NormalNPCs/CrawlerDiamond.cs index 798baa08b1..cd13945757 100644 --- a/NPCs/NormalNPCs/CrawlerDiamond.cs +++ b/NPCs/NormalNPCs/CrawlerDiamond.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; } public override void SetDefaults() diff --git a/NPCs/NormalNPCs/CrawlerEmerald.cs b/NPCs/NormalNPCs/CrawlerEmerald.cs index 9674c5aae5..9cda2fb1aa 100644 --- a/NPCs/NormalNPCs/CrawlerEmerald.cs +++ b/NPCs/NormalNPCs/CrawlerEmerald.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; } public override void SetDefaults() diff --git a/NPCs/NormalNPCs/CrawlerRuby.cs b/NPCs/NormalNPCs/CrawlerRuby.cs index f436933247..09f52c7060 100644 --- a/NPCs/NormalNPCs/CrawlerRuby.cs +++ b/NPCs/NormalNPCs/CrawlerRuby.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; } public override void SetDefaults() diff --git a/NPCs/NormalNPCs/CrawlerSapphire.cs b/NPCs/NormalNPCs/CrawlerSapphire.cs index 5de70493ae..a75e5b20fd 100644 --- a/NPCs/NormalNPCs/CrawlerSapphire.cs +++ b/NPCs/NormalNPCs/CrawlerSapphire.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; } public override void SetDefaults() diff --git a/NPCs/NormalNPCs/CrawlerTopaz.cs b/NPCs/NormalNPCs/CrawlerTopaz.cs index 3fbabfb2c8..347d6d546c 100644 --- a/NPCs/NormalNPCs/CrawlerTopaz.cs +++ b/NPCs/NormalNPCs/CrawlerTopaz.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; } public override void SetDefaults() diff --git a/NPCs/NormalNPCs/CrimulanBlightSlime.cs b/NPCs/NormalNPCs/CrimulanBlightSlime.cs index c1ab53b4b6..18f99bbfbf 100644 --- a/NPCs/NormalNPCs/CrimulanBlightSlime.cs +++ b/NPCs/NormalNPCs/CrimulanBlightSlime.cs @@ -11,7 +11,7 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; } public override void SetDefaults() diff --git a/NPCs/NormalNPCs/CryoSlime.cs b/NPCs/NormalNPCs/CryoSlime.cs index d22b2c070c..677e543ea6 100644 --- a/NPCs/NormalNPCs/CryoSlime.cs +++ b/NPCs/NormalNPCs/CryoSlime.cs @@ -12,7 +12,7 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 2; + Main.npcFrameCount[Type] = 2; } public override void SetDefaults() diff --git a/NPCs/NormalNPCs/Cryon.cs b/NPCs/NormalNPCs/Cryon.cs index fffd6ff45b..1467b1f3b6 100644 --- a/NPCs/NormalNPCs/Cryon.cs +++ b/NPCs/NormalNPCs/Cryon.cs @@ -13,7 +13,7 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; } public override void SetDefaults() diff --git a/NPCs/NormalNPCs/EbonianBlightSlime.cs b/NPCs/NormalNPCs/EbonianBlightSlime.cs index 4b4400f72f..0511fb85cf 100644 --- a/NPCs/NormalNPCs/EbonianBlightSlime.cs +++ b/NPCs/NormalNPCs/EbonianBlightSlime.cs @@ -11,7 +11,7 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; } public override void SetDefaults() diff --git a/NPCs/NormalNPCs/Eidolist.cs b/NPCs/NormalNPCs/Eidolist.cs index 9e6fb65fd4..9a4cab62f1 100644 --- a/NPCs/NormalNPCs/Eidolist.cs +++ b/NPCs/NormalNPCs/Eidolist.cs @@ -23,8 +23,8 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; - Main.npcFrameCount[NPC.type] = 6; + NPCID.Sets.NeedsExpertScaling[Type] = true; + Main.npcFrameCount[Type] = 6; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { Scale = 0.75f, @@ -309,7 +309,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Opacity = 1f; NPC.frameCounter += hasBeenHit ? 0.15f : 0.075f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs b/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs index 65cf22f33e..e5eca4bb8e 100644 --- a/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs +++ b/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 10; + Main.npcFrameCount[Type] = 10; } public override void SetDefaults() diff --git a/NPCs/NormalNPCs/Foveanator.cs b/NPCs/NormalNPCs/Foveanator.cs index 367f7445bd..8a94dd7c66 100644 --- a/NPCs/NormalNPCs/Foveanator.cs +++ b/NPCs/NormalNPCs/Foveanator.cs @@ -40,7 +40,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; NPCID.Sets.NPCBestiaryDrawModifiers bestiaryData = new NPCID.Sets.NPCBestiaryDrawModifiers() { Hide = true }; NPCID.Sets.NPCBestiaryDrawOffset.Add(Type, bestiaryData); @@ -906,7 +906,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - spriteBatch.Draw(TextureAssets.Npc[NPC.type].Value, NPC.Center - screenPos + new Vector2(0f, NPC.gfxOffY), NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, NPC.frame.Size() / 2, NPC.scale, spriteEffects, 0f); + spriteBatch.Draw(TextureAssets.Npc[Type].Value, NPC.Center - screenPos + new Vector2(0f, NPC.gfxOffY), NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, NPC.frame.Size() / 2, NPC.scale, spriteEffects, 0f); Texture2D glowTexture = GlowTexture.Value; spriteBatch.Draw(glowTexture, NPC.Center - screenPos + new Vector2(0f, NPC.gfxOffY), NPC.frame, Color.White, NPC.rotation, NPC.frame.Size() / 2, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/NormalNPCs/Frogfish.cs b/NPCs/NormalNPCs/Frogfish.cs index 1af02ef5ec..616cabe023 100644 --- a/NPCs/NormalNPCs/Frogfish.cs +++ b/NPCs/NormalNPCs/Frogfish.cs @@ -13,7 +13,7 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; } public override void SetDefaults() @@ -111,7 +111,7 @@ namespace CalamityMod.NPCs.NormalNPCs return; } NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/NormalNPCs/Horse.cs b/NPCs/NormalNPCs/Horse.cs index 45b580ff0a..6d7b54958e 100644 --- a/NPCs/NormalNPCs/Horse.cs +++ b/NPCs/NormalNPCs/Horse.cs @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { Scale = 0.4f, @@ -100,7 +100,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.frameCounter++; if (NPC.frameCounter >= 8) { - NPC.frame.Y = (NPC.frame.Y + frameHeight) % (Main.npcFrameCount[NPC.type] * frameHeight); + NPC.frame.Y = (NPC.frame.Y + frameHeight) % (Main.npcFrameCount[Type] * frameHeight); NPC.frameCounter = 0; } } diff --git a/NPCs/NormalNPCs/IceClasper.cs b/NPCs/NormalNPCs/IceClasper.cs index 0780d19d8c..bf70ac2606 100644 --- a/NPCs/NormalNPCs/IceClasper.cs +++ b/NPCs/NormalNPCs/IceClasper.cs @@ -65,12 +65,12 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers(); value.Rotation = MathHelper.ToRadians(135); NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; - NPCID.Sets.TrailingMode[NPC.type] = 0; - NPCID.Sets.TrailCacheLength[NPC.type] = 6; + NPCID.Sets.TrailingMode[Type] = 0; + NPCID.Sets.TrailCacheLength[Type] = 6; } public override void SetDefaults() @@ -275,7 +275,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void FindFrame(int frameHeight) { NPC.frameCounter += (isDashing) ? 0.4f : 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -330,10 +330,10 @@ namespace CalamityMod.NPCs.NormalNPCs public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; Vector2 position = NPC.Center - screenPos; - Vector2 origin = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); - position -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + Vector2 origin = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); + position -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; position += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); // If the enemy is preparing to dash, it'll fade in afterimages. diff --git a/NPCs/NormalNPCs/ImpiousImmolator.cs b/NPCs/NormalNPCs/ImpiousImmolator.cs index f7bbddab06..4d87a1dcc2 100644 --- a/NPCs/NormalNPCs/ImpiousImmolator.cs +++ b/NPCs/NormalNPCs/ImpiousImmolator.cs @@ -21,8 +21,8 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; + Main.npcFrameCount[Type] = 4; + NPCID.Sets.NeedsExpertScaling[Type] = true; } public override void SetDefaults() @@ -248,7 +248,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void FindFrame(int frameHeight) { NPC.frameCounter += hasBeenHit ? 0.25f : 0.125f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/NormalNPCs/KingSlimeJewelRuby.cs b/NPCs/NormalNPCs/KingSlimeJewelRuby.cs index e652a93458..9a644aa5ae 100644 --- a/NPCs/NormalNPCs/KingSlimeJewelRuby.cs +++ b/NPCs/NormalNPCs/KingSlimeJewelRuby.cs @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; + NPCID.Sets.NeedsExpertScaling[Type] = true; NPCID.Sets.NPCBestiaryDrawModifiers bestiaryData = new NPCID.Sets.NPCBestiaryDrawModifiers() { Hide = true }; NPCID.Sets.NPCBestiaryDrawOffset.Add(Type, bestiaryData); } diff --git a/NPCs/NormalNPCs/KingSlimeJewelSapphire.cs b/NPCs/NormalNPCs/KingSlimeJewelSapphire.cs index 3b34725efb..fc02f5133c 100644 --- a/NPCs/NormalNPCs/KingSlimeJewelSapphire.cs +++ b/NPCs/NormalNPCs/KingSlimeJewelSapphire.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; + NPCID.Sets.NeedsExpertScaling[Type] = true; NPCID.Sets.NPCBestiaryDrawModifiers bestiaryData = new NPCID.Sets.NPCBestiaryDrawModifiers() { Hide = true }; NPCID.Sets.NPCBestiaryDrawOffset.Add(Type, bestiaryData); } diff --git a/NPCs/NormalNPCs/LavaSlimeNoLavaDrop.cs b/NPCs/NormalNPCs/LavaSlimeNoLavaDrop.cs index ca5764da80..38cd0a6c25 100644 --- a/NPCs/NormalNPCs/LavaSlimeNoLavaDrop.cs +++ b/NPCs/NormalNPCs/LavaSlimeNoLavaDrop.cs @@ -10,7 +10,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 2; + Main.npcFrameCount[Type] = 2; this.HideFromBestiary(); } diff --git a/NPCs/NormalNPCs/MantisShrimp.cs b/NPCs/NormalNPCs/MantisShrimp.cs index befc565936..721b6b923f 100644 --- a/NPCs/NormalNPCs/MantisShrimp.cs +++ b/NPCs/NormalNPCs/MantisShrimp.cs @@ -14,7 +14,7 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { SpriteDirection = 1 @@ -109,7 +109,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/NormalNPCs/OverloadedSoldier.cs b/NPCs/NormalNPCs/OverloadedSoldier.cs index bb1ec40ec3..f9a42d6e5e 100644 --- a/NPCs/NormalNPCs/OverloadedSoldier.cs +++ b/NPCs/NormalNPCs/OverloadedSoldier.cs @@ -18,7 +18,7 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 14; + Main.npcFrameCount[Type] = 14; } public override void SetDefaults() diff --git a/NPCs/NormalNPCs/PerennialSlime.cs b/NPCs/NormalNPCs/PerennialSlime.cs index a11bb7bedb..eb62be6480 100644 --- a/NPCs/NormalNPCs/PerennialSlime.cs +++ b/NPCs/NormalNPCs/PerennialSlime.cs @@ -12,7 +12,7 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 2; + Main.npcFrameCount[Type] = 2; } public override void SetDefaults() diff --git a/NPCs/NormalNPCs/PhantomSpirit.cs b/NPCs/NormalNPCs/PhantomSpirit.cs index 8572ab6c32..1f94654c10 100644 --- a/NPCs/NormalNPCs/PhantomSpirit.cs +++ b/NPCs/NormalNPCs/PhantomSpirit.cs @@ -14,7 +14,7 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 3; + Main.npcFrameCount[Type] = 3; } public override void SetDefaults() diff --git a/NPCs/NormalNPCs/PhantomSpiritL.cs b/NPCs/NormalNPCs/PhantomSpiritL.cs index b9680816b4..2f7849b747 100644 --- a/NPCs/NormalNPCs/PhantomSpiritL.cs +++ b/NPCs/NormalNPCs/PhantomSpiritL.cs @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.PhantomSpirit.DisplayName"); public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; } public override void SetDefaults() @@ -60,7 +60,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/NormalNPCs/PhantomSpiritM.cs b/NPCs/NormalNPCs/PhantomSpiritM.cs index d0f6151698..5d35236eba 100644 --- a/NPCs/NormalNPCs/PhantomSpiritM.cs +++ b/NPCs/NormalNPCs/PhantomSpiritM.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.PhantomSpirit.DisplayName"); public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; } public override void SetDefaults() @@ -56,7 +56,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/NormalNPCs/PhantomSpiritS.cs b/NPCs/NormalNPCs/PhantomSpiritS.cs index 997044d162..9608b72321 100644 --- a/NPCs/NormalNPCs/PhantomSpiritS.cs +++ b/NPCs/NormalNPCs/PhantomSpiritS.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.PhantomSpirit.DisplayName"); public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; } public override void SetDefaults() @@ -55,7 +55,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/NormalNPCs/Piggy.cs b/NPCs/NormalNPCs/Piggy.cs index c92aebd1e2..4b2106e519 100644 --- a/NPCs/NormalNPCs/Piggy.cs +++ b/NPCs/NormalNPCs/Piggy.cs @@ -12,9 +12,9 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; - Main.npcCatchable[NPC.type] = true; - NPCID.Sets.CountsAsCritter[NPC.type] = true; + Main.npcFrameCount[Type] = 5; + Main.npcCatchable[Type] = true; + NPCID.Sets.CountsAsCritter[Type] = true; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { SpriteDirection = 1 @@ -111,7 +111,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.frame.Y = NPC.frame.Y + frameHeight; NPC.frameCounter = 0.0; } - if (NPC.frame.Y / frameHeight >= Main.npcFrameCount[NPC.type] - 1) + if (NPC.frame.Y / frameHeight >= Main.npcFrameCount[Type] - 1) { NPC.frame.Y = frameHeight; } diff --git a/NPCs/NormalNPCs/PlanterasFreeTentacle.cs b/NPCs/NormalNPCs/PlanterasFreeTentacle.cs index 8da9b99ebb..8640f341e9 100644 --- a/NPCs/NormalNPCs/PlanterasFreeTentacle.cs +++ b/NPCs/NormalNPCs/PlanterasFreeTentacle.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; NPCID.Sets.NPCBestiaryDrawModifiers bestiaryData = new NPCID.Sets.NPCBestiaryDrawModifiers() { Hide = true }; NPCID.Sets.NPCBestiaryDrawOffset.Add(Type, bestiaryData); } @@ -59,7 +59,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.frame.Y += frameHeight; NPC.frameCounter = 0.0; } - if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[NPC.type]) + if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[Type]) NPC.frame.Y = 0; } diff --git a/NPCs/NormalNPCs/ProfanedEnergyBody.cs b/NPCs/NormalNPCs/ProfanedEnergyBody.cs index d5f9bc16ec..d5f8bfb1e1 100644 --- a/NPCs/NormalNPCs/ProfanedEnergyBody.cs +++ b/NPCs/NormalNPCs/ProfanedEnergyBody.cs @@ -12,7 +12,7 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; + NPCID.Sets.NeedsExpertScaling[Type] = true; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { //Preferably would have two animated lanterns, but this static one-headded wiki image will do for now diff --git a/NPCs/NormalNPCs/ProfanedEnergyLantern.cs b/NPCs/NormalNPCs/ProfanedEnergyLantern.cs index 96f0ffcbf5..e0754ab0c7 100644 --- a/NPCs/NormalNPCs/ProfanedEnergyLantern.cs +++ b/NPCs/NormalNPCs/ProfanedEnergyLantern.cs @@ -20,11 +20,12 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; if (!Main.dedServ) { ChainTexture = ModContent.Request("CalamityMod/NPCs/NormalNPCs/ProfanedEnergySegment", AssetRequestMode.AsyncLoad); } + NPCID.Sets.PositiveNPCTypesExcludedFromDeathTally[Type] = true; // You can't kill this thing but just in case anyway } public override void SetDefaults() @@ -42,6 +43,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.dontTakeDamage = true; NPC.HitSound = SoundID.NPCHit52; NPC.DeathSound = SoundID.NPCDeath55; + Banner = ModContent.NPCType(); } public override void AI() @@ -193,7 +195,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/NormalNPCs/Rimehound.cs b/NPCs/NormalNPCs/Rimehound.cs index bfe02b311f..b997458456 100644 --- a/NPCs/NormalNPCs/Rimehound.cs +++ b/NPCs/NormalNPCs/Rimehound.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 9; + Main.npcFrameCount[Type] = 9; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { Scale = 0.7f, diff --git a/NPCs/NormalNPCs/Rotdog.cs b/NPCs/NormalNPCs/Rotdog.cs index b1087fa587..bb0141847c 100644 --- a/NPCs/NormalNPCs/Rotdog.cs +++ b/NPCs/NormalNPCs/Rotdog.cs @@ -12,7 +12,7 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 10; + Main.npcFrameCount[Type] = 10; } public override void SetDefaults() diff --git a/NPCs/NormalNPCs/ScornEater.cs b/NPCs/NormalNPCs/ScornEater.cs index 81771de67c..0e7eb4dfae 100644 --- a/NPCs/NormalNPCs/ScornEater.cs +++ b/NPCs/NormalNPCs/ScornEater.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 7; + Main.npcFrameCount[Type] = 7; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { Scale = 0.4f, diff --git a/NPCs/NormalNPCs/ShockstormShuttle.cs b/NPCs/NormalNPCs/ShockstormShuttle.cs index bd28e4214c..161238d44f 100644 --- a/NPCs/NormalNPCs/ShockstormShuttle.cs +++ b/NPCs/NormalNPCs/ShockstormShuttle.cs @@ -17,8 +17,8 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; + Main.npcFrameCount[Type] = 4; + NPCID.Sets.NeedsExpertScaling[Type] = true; } public override void SetDefaults() @@ -376,7 +376,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/NormalNPCs/Shroomble.cs b/NPCs/NormalNPCs/Shroomble.cs index 6b5e14dc13..ce2e765f3d 100644 --- a/NPCs/NormalNPCs/Shroomble.cs +++ b/NPCs/NormalNPCs/Shroomble.cs @@ -16,9 +16,9 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 8; - Main.npcCatchable[NPC.type] = true; - NPCID.Sets.CountsAsCritter[NPC.type] = true; + Main.npcFrameCount[Type] = 8; + Main.npcCatchable[Type] = true; + NPCID.Sets.CountsAsCritter[Type] = true; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { SpriteDirection = 1 @@ -141,7 +141,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.frame.Y = NPC.frame.Y + frameHeight; NPC.frameCounter = 0.0; } - if (NPC.frame.Y / frameHeight >= Main.npcFrameCount[NPC.type] - 1) + if (NPC.frame.Y / frameHeight >= Main.npcFrameCount[Type] - 1) { NPC.frame.Y = frameHeight; } @@ -149,7 +149,7 @@ namespace CalamityMod.NPCs.NormalNPCs else { NPC.frameCounter = 0.0; - NPC.frame.Y = frameHeight * (Main.npcFrameCount[NPC.type] - 1); + NPC.frame.Y = frameHeight * (Main.npcFrameCount[Type] - 1); } } diff --git a/NPCs/NormalNPCs/SkeletronPrime2.cs b/NPCs/NormalNPCs/SkeletronPrime2.cs index a972525f2a..508c8a2260 100644 --- a/NPCs/NormalNPCs/SkeletronPrime2.cs +++ b/NPCs/NormalNPCs/SkeletronPrime2.cs @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; NPCID.Sets.NPCBestiaryDrawModifiers bestiaryData = new NPCID.Sets.NPCBestiaryDrawModifiers() { Hide = true }; NPCID.Sets.NPCBestiaryDrawOffset.Add(Type, bestiaryData); if (!Main.dedServ) diff --git a/NPCs/NormalNPCs/Stormlion.cs b/NPCs/NormalNPCs/Stormlion.cs index d66dede29c..dd3131cb42 100644 --- a/NPCs/NormalNPCs/Stormlion.cs +++ b/NPCs/NormalNPCs/Stormlion.cs @@ -17,7 +17,7 @@ namespace CalamityMod.NPCs.NormalNPCs public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/StormlionDeath"); public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; } public override void SetDefaults() diff --git a/NPCs/NormalNPCs/Sunskater.cs b/NPCs/NormalNPCs/Sunskater.cs index 7bf84fb89b..f4776d4331 100644 --- a/NPCs/NormalNPCs/Sunskater.cs +++ b/NPCs/NormalNPCs/Sunskater.cs @@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; } public override void SetDefaults() @@ -211,7 +211,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void FindFrame(int frameHeight) { NPC.frameCounter += hasBeenHit ? 0.15f : 0.075f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/NormalNPCs/SuperDummyNPC.cs b/NPCs/NormalNPCs/SuperDummyNPC.cs index d263335bc5..f5a06984a4 100644 --- a/NPCs/NormalNPCs/SuperDummyNPC.cs +++ b/NPCs/NormalNPCs/SuperDummyNPC.cs @@ -1,8 +1,8 @@ using System.IO; using CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies; -using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -11,10 +11,11 @@ namespace CalamityMod.NPCs.NormalNPCs public class SuperDummyNPC : ModNPC { public int deathCounter = 0; + public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 11; + Main.npcFrameCount[Type] = 11; NPCID.Sets.CantTakeLunchMoney[Type] = true; } @@ -25,7 +26,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.damage = 0; NPC.defense = 0; NPC.lifeMax = 9999999; - NPC.HitSound = SoundID.NPCHit15; + NPC.HitSound = null; NPC.DeathSound = SoundID.NPCDeath2; NPC.value = 0f; NPC.knockBackResist = 0f; @@ -71,51 +72,64 @@ namespace CalamityMod.NPCs.NormalNPCs public override void HitEffect(NPC.HitInfo hit) { // Dummy AI, no way - NPC.ai[0] = hit.HitDirection * -NPC.direction; + NPC.localAI[0] = (int)hit.Damage; + if (NPC.localAI[0] < 20f) + { + NPC.localAI[0] = 20f; + } + if (NPC.localAI[0] > 120f) + { + NPC.localAI[0] = 120f; + } + NPC.localAI[1] = hit.HitDirection; // Reset hit timer if it isn't enraged if (deathCounter > 0 && deathCounter < 6000) { deathCounter = 0; } + SoundStyle toPlay = Main.rand.Next(3) switch + { + 0 => SoundID.NPCHit15, + 1 => SoundID.NPCHit16, + 2 => SoundID.NPCHit17, + _ => SoundID.NPCHit15 + }; + if (NPC.soundDelay <= 0) + { + SoundEngine.PlaySound(toPlay, NPC.Center); + } } public override void FindFrame(int frameHeight) { - // Start animating when hit. Continue animating as long as the animation isn't finished - if (NPC.justHit || NPC.frameCounter > 0 || (NPC.frame.Y != 0 && NPC.frame.Y != frameHeight * 4)) + int hitDirection = (int)NPC.localAI[1]; + if (NPC.direction == 1) { - NPC.frameCounter += 1.0; + hitDirection *= -1; } - if (NPC.frameCounter > 6.0) + if (NPC.localAI[0] > 24f) { - NPC.frameCounter = 0.0; - NPC.frame.Y += frameHeight; + NPC.localAI[0] = 24f; } - - // Hit from behind - if (NPC.ai[0] == -1 || deathCounter > 6000) + if (NPC.localAI[0] > 0f) { - if ((NPC.justHit || deathCounter > 6000) && NPC.frame.Y > frameHeight * 2) - { - NPC.frame.Y = frameHeight; - } - else if (NPC.frame.Y > frameHeight * 3) - { - NPC.frame.Y = 0; - } + NPC.localAI[0] -= 1f; } - // Hit from in front - else + if (NPC.localAI[0] < 0f) { - if (NPC.justHit && NPC.frame.Y > frameHeight * 7) - { - NPC.frame.Y = frameHeight * 5; - } - else if (NPC.frame.Y > frameHeight * 10 || NPC.frame.Y < frameHeight * 4) - { - NPC.frame.Y = frameHeight * 4; - } + NPC.localAI[0] = 0f; } + int animationSpeed = ((hitDirection == -1) ? 4 : 6); + int currentFrame = (int)NPC.localAI[0] / animationSpeed; + if (NPC.localAI[0] % (float)animationSpeed != 0f) + { + currentFrame++; + } + if (currentFrame != 0 && hitDirection == 1) + { + currentFrame += 5; + } + NPC.frame.Y = currentFrame * frameHeight; } public override bool CheckDead() diff --git a/NPCs/NormalNPCs/ThiccWaifu.cs b/NPCs/NormalNPCs/ThiccWaifu.cs index 7350d5cef0..42e7e11033 100644 --- a/NPCs/NormalNPCs/ThiccWaifu.cs +++ b/NPCs/NormalNPCs/ThiccWaifu.cs @@ -52,7 +52,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 8; + Main.npcFrameCount[Type] = 8; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { Position = new Vector2(28f, 20f), @@ -288,9 +288,9 @@ namespace CalamityMod.NPCs.NormalNPCs float cloudSpawnOutwardness = (AttackTimer - cloudSummonDelay) / cloudSummonRate * 50f; Vector2 spawnPosition = NPC.Top + new Vector2(cloudSpawnOutwardness, -36); - Projectile.NewProjectileDirect(NPC.GetSource_FromAI(), spawnPosition, Vector2.Zero, projectileType, lightningDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnPosition, Vector2.Zero, projectileType, lightningDamage, 0f, Main.myPlayer); spawnPosition = NPC.Top + new Vector2(-cloudSpawnOutwardness, -36); - Projectile.NewProjectileDirect(NPC.GetSource_FromAI(), spawnPosition, Vector2.Zero, projectileType, lightningDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnPosition, Vector2.Zero, projectileType, lightningDamage, 0f, Main.myPlayer); } } @@ -422,7 +422,7 @@ namespace CalamityMod.NPCs.NormalNPCs Main.EntitySpriteDraw(texture, NPC.Center - screenPos, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, NPC.frame.Size() * 0.5f, NPC.scale, direction, 0); else { - texture = TextureAssets.Npc[NPC.type].Value; + texture = TextureAssets.Npc[Type].Value; Main.EntitySpriteDraw(texture, NPC.Center - screenPos, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, NPC.frame.Size() * 0.5f, NPC.scale, direction, 0); } if (Main.zenithWorld) @@ -452,7 +452,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.PlayerSafe || !Main.hardMode || !Main.raining || !spawnInfo.Player.ZoneSkyHeight) + if (spawnInfo.PlayerSafe || !Main.hardMode || (!Main.raining && !Main.remixWorld) || !spawnInfo.Player.ZoneSkyHeight) return 0f; // Keep this as a separate if check, because it's a loop and we don't want to be checking it constantly. diff --git a/NPCs/NormalNPCs/WildBumblefuck.cs b/NPCs/NormalNPCs/WildBumblefuck.cs index 67a58e66d8..b0be162495 100644 --- a/NPCs/NormalNPCs/WildBumblefuck.cs +++ b/NPCs/NormalNPCs/WildBumblefuck.cs @@ -20,8 +20,8 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 5; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { Position = Vector2.UnitX * 36f @@ -128,8 +128,8 @@ namespace CalamityMod.NPCs.NormalNPCs if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); int afterimageAmt = NPC.ai[0] == 2.1f ? 7 : 0; if (CalamityClientConfig.Instance.Afterimages) @@ -141,14 +141,14 @@ namespace CalamityMod.NPCs.NormalNPCs afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (afterimageAmt - i) / 15f; Vector2 afterimagePos = NPC.oldPos[i] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + afterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } } Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/NormalNPCs/WulfrumAmplifier.cs b/NPCs/NormalNPCs/WulfrumAmplifier.cs index 8aecccb50c..135d2d0b9c 100644 --- a/NPCs/NormalNPCs/WulfrumAmplifier.cs +++ b/NPCs/NormalNPCs/WulfrumAmplifier.cs @@ -32,8 +32,8 @@ namespace CalamityMod.NPCs.NormalNPCs public int laserDelay = 150; public override void SetStaticDefaults() { - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; - Main.npcFrameCount[NPC.type] = 6; + NPCID.Sets.NeedsExpertScaling[Type] = true; + Main.npcFrameCount[Type] = 6; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { SpriteDirection = 1 @@ -205,7 +205,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void FindFrame(int frameHeight) { NPC.frameCounter++; - int frame = (int)(NPC.frameCounter / 8) % Main.npcFrameCount[NPC.type]; + int frame = (int)(NPC.frameCounter / 8) % Main.npcFrameCount[Type]; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/NormalNPCs/WulfrumDrone.cs b/NPCs/NormalNPCs/WulfrumDrone.cs index 2e18e0251a..69e1abcaa6 100644 --- a/NPCs/NormalNPCs/WulfrumDrone.cs +++ b/NPCs/NormalNPCs/WulfrumDrone.cs @@ -54,7 +54,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { SpriteDirection = 1 @@ -222,9 +222,9 @@ namespace CalamityMod.NPCs.NormalNPCs public override void FindFrame(int frameHeight) { NPC.frameCounter++; - int frame = (int)(NPC.frameCounter / 5) % (Main.npcFrameCount[NPC.type] / 2); + int frame = (int)(NPC.frameCounter / 5) % (Main.npcFrameCount[Type] / 2); if (Supercharged) - frame += Main.npcFrameCount[NPC.type] / 2; + frame += Main.npcFrameCount[Type] / 2; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/NormalNPCs/WulfrumGyrator.cs b/NPCs/NormalNPCs/WulfrumGyrator.cs index 0b8e1f15ca..5ac2e3eceb 100644 --- a/NPCs/NormalNPCs/WulfrumGyrator.cs +++ b/NPCs/NormalNPCs/WulfrumGyrator.cs @@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 10; + Main.npcFrameCount[Type] = 10; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { SpriteDirection = 1 @@ -87,9 +87,9 @@ namespace CalamityMod.NPCs.NormalNPCs { NPC.frameCounter += 1; } - int frame = (int)(NPC.frameCounter / 5) % (Main.npcFrameCount[NPC.type] / 2); + int frame = (int)(NPC.frameCounter / 5) % (Main.npcFrameCount[Type] / 2); if (Supercharged) - frame += Main.npcFrameCount[NPC.type] / 2; + frame += Main.npcFrameCount[Type] / 2; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/NormalNPCs/WulfrumHovercraft.cs b/NPCs/NormalNPCs/WulfrumHovercraft.cs index e863963a87..222778641e 100644 --- a/NPCs/NormalNPCs/WulfrumHovercraft.cs +++ b/NPCs/NormalNPCs/WulfrumHovercraft.cs @@ -62,7 +62,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 12; + Main.npcFrameCount[Type] = 12; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { SpriteDirection = 1 @@ -119,9 +119,9 @@ namespace CalamityMod.NPCs.NormalNPCs public override void FindFrame(int frameHeight) { NPC.frameCounter++; - int frame = (int)(NPC.frameCounter / 5) % (Main.npcFrameCount[NPC.type] / 2); + int frame = (int)(NPC.frameCounter / 5) % (Main.npcFrameCount[Type] / 2); if (Supercharged) - frame += Main.npcFrameCount[NPC.type] / 2; + frame += Main.npcFrameCount[Type] / 2; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/NormalNPCs/WulfrumRover.cs b/NPCs/NormalNPCs/WulfrumRover.cs index 41f3110dfb..b8605d39e1 100644 --- a/NPCs/NormalNPCs/WulfrumRover.cs +++ b/NPCs/NormalNPCs/WulfrumRover.cs @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 16; + Main.npcFrameCount[Type] = 16; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { SpriteDirection = 1 @@ -87,9 +87,9 @@ namespace CalamityMod.NPCs.NormalNPCs public override void FindFrame(int frameHeight) { NPC.frameCounter++; - int frame = (int)(NPC.frameCounter / 5) % (Main.npcFrameCount[NPC.type] / 2); + int frame = (int)(NPC.frameCounter / 5) % (Main.npcFrameCount[Type] / 2); if (Supercharged) - frame += Main.npcFrameCount[NPC.type] / 2; + frame += Main.npcFrameCount[Type] / 2; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/OldDuke/OldDuke.cs b/NPCs/OldDuke/OldDuke.cs index 9a80f8a56c..bc34705496 100644 --- a/NPCs/OldDuke/OldDuke.cs +++ b/NPCs/OldDuke/OldDuke.cs @@ -47,8 +47,8 @@ namespace CalamityMod.NPCs.OldDuke public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 7; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 7; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -215,8 +215,8 @@ namespace CalamityMod.NPCs.OldDuke { spriteEffects = SpriteEffects.FlipHorizontally; } - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2(texture2D15.Width / 2, texture2D15.Height / Main.npcFrameCount[NPC.type] / 2); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2(texture2D15.Width / 2, texture2D15.Height / Main.npcFrameCount[Type] / 2); Color color = drawColor; Color drawLerpColor = Color.White; float drawLerpValue = 0f; @@ -268,7 +268,7 @@ namespace CalamityMod.NPCs.OldDuke afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (afterimageAmt - i) / 15f; Vector2 afterimagePos = NPC.oldPos[i] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + afterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } @@ -319,7 +319,7 @@ namespace CalamityMod.NPCs.OldDuke secondAfterimageColor = NPC.GetAlpha(secondAfterimageColor); secondAfterimageColor *= 1f - afterimageOpacity; Vector2 secondAfterimagePos = NPC.Center + (j / (float)secondAfterimageAmt * MathHelper.TwoPi + NPC.rotation).ToRotationVector2() * afterimageScale * afterimageOpacity - screenPos; - secondAfterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + secondAfterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; secondAfterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, secondAfterimagePos, NPC.frame, secondAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } @@ -329,7 +329,7 @@ namespace CalamityMod.NPCs.OldDuke finalDrawColor = Color.Lerp(finalDrawColor, drawLerpColor, drawLerpValue); finalDrawColor = NPC.GetAlpha(finalDrawColor); Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, (NPC.ai[0] > 9f ? finalDrawColor : NPC.GetAlpha(drawColor)), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); @@ -374,7 +374,7 @@ namespace CalamityMod.NPCs.OldDuke yellowAfterimageColor = Color.Lerp(yellowAfterimageColor, drawLerpColor, drawLerpValue); yellowAfterimageColor *= (afterimageAmt - k) / 15f; Vector2 yellowAfterimagePos = NPC.oldPos[k] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - yellowAfterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + yellowAfterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; yellowAfterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, yellowAfterimagePos, NPC.frame, yellowAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } @@ -386,7 +386,7 @@ namespace CalamityMod.NPCs.OldDuke secondYellowAfterimageColor = NPC.GetAlpha(secondYellowAfterimageColor); secondYellowAfterimageColor *= 1f - afterimageOpacity; Vector2 secondYellowAfterimagePos = NPC.Center + (l / (float)secondAfterimageAmt * MathHelper.TwoPi + NPC.rotation).ToRotationVector2() * afterimageScale * afterimageOpacity - screenPos; - secondYellowAfterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + secondYellowAfterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; secondYellowAfterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, secondYellowAfterimagePos, NPC.frame, secondYellowAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } diff --git a/NPCs/OldDuke/SulphurousSharkron.cs b/NPCs/OldDuke/SulphurousSharkron.cs index 8058d64f08..85ec66d493 100644 --- a/NPCs/OldDuke/SulphurousSharkron.cs +++ b/NPCs/OldDuke/SulphurousSharkron.cs @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.OldDuke public override void SetStaticDefaults() { this.HideFromBestiary(); - NPCID.Sets.TrailingMode[NPC.type] = 1; + NPCID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -239,8 +239,8 @@ namespace CalamityMod.NPCs.OldDuke if (NPC.spriteDirection == -1) spriteEffects = SpriteEffects.None; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); int afterimageAmt = 10; if (CalamityClientConfig.Instance.Afterimages) @@ -252,14 +252,14 @@ namespace CalamityMod.NPCs.OldDuke afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (afterimageAmt - i) / 15f; Vector2 afterimagePos = NPC.oldPos[i] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + afterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } } Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/Other/CalamitasEnchantDemon.cs b/NPCs/Other/CalamitasEnchantDemon.cs index 1096142fb6..831470fdd5 100644 --- a/NPCs/Other/CalamitasEnchantDemon.cs +++ b/NPCs/Other/CalamitasEnchantDemon.cs @@ -14,7 +14,7 @@ namespace CalamityMod.NPCs.Other public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; } public override void SetDefaults() @@ -142,7 +142,7 @@ namespace CalamityMod.NPCs.Other if (NPC.frameCounter % 5f == 4f) NPC.frame.Y += frameHeight; - if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[NPC.type]) + if (NPC.frame.Y >= frameHeight * Main.npcFrameCount[Type]) NPC.frame.Y = 0; } diff --git a/NPCs/Other/DemonPortal.cs b/NPCs/Other/DemonPortal.cs index 630cd48ca1..4c870617d8 100644 --- a/NPCs/Other/DemonPortal.cs +++ b/NPCs/Other/DemonPortal.cs @@ -110,7 +110,7 @@ namespace CalamityMod.NPCs.Other { spriteBatch.SetBlendState(BlendState.AlphaBlend); - Texture2D portalTexture = TextureAssets.Npc[NPC.type].Value; + Texture2D portalTexture = TextureAssets.Npc[Type].Value; Vector2 drawPosition = NPC.Center - screenPos; Vector2 origin = portalTexture.Size() * 0.5f; Color baseColor = Color.White; diff --git a/NPCs/Other/ExhumedHeart.cs b/NPCs/Other/ExhumedHeart.cs index d92df384c7..dd0a285bbe 100644 --- a/NPCs/Other/ExhumedHeart.cs +++ b/NPCs/Other/ExhumedHeart.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.Other public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; } public override void SetDefaults() @@ -66,7 +66,7 @@ namespace CalamityMod.NPCs.Other public override void FindFrame(int frameHeight) { NPC.frameCounter++; - NPC.frame.Y = (int)(NPC.frameCounter / 5) % Main.npcFrameCount[NPC.type] * frameHeight; + NPC.frame.Y = (int)(NPC.frameCounter / 5) % Main.npcFrameCount[Type] * frameHeight; } public override Color? GetAlpha(Color drawColor) diff --git a/NPCs/Other/LecherousOrb.cs b/NPCs/Other/LecherousOrb.cs index e1d2d20113..09396c24f6 100644 --- a/NPCs/Other/LecherousOrb.cs +++ b/NPCs/Other/LecherousOrb.cs @@ -159,7 +159,7 @@ namespace CalamityMod.NPCs.Other public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; Vector2 drawPosition = NPC.Center - screenPos; SpriteEffects direction = NPC.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; diff --git a/NPCs/Other/THELORDE.cs b/NPCs/Other/THELORDE.cs index dc4b4ad615..c197d7f2b7 100644 --- a/NPCs/Other/THELORDE.cs +++ b/NPCs/Other/THELORDE.cs @@ -47,7 +47,7 @@ namespace CalamityMod.NPCs.Other NPCID.Sets.ImmuneToRegularBuffs[Type] = true; NPCID.Sets.ShouldBeCountedAsBoss[Type] = true; this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 7; + Main.npcFrameCount[Type] = 7; if (!Main.dedServ) { DeathAnimationTexture = ModContent.Request(Texture + "DEATH", AssetRequestMode.AsyncLoad); @@ -130,6 +130,8 @@ namespace CalamityMod.NPCs.Other aiSwitchCounter++; if (ajitPaiDidNothingWrong && invincibleCounter < 6000) { + // On a technical level, the defense/DR stat is not being increased, but for player purposes he may as well be + NPC.Calamity().CurrentlyIncreasingDefenseOrDR = true; invincibleCounter++; } NPC.alpha -= 100; @@ -155,6 +157,7 @@ namespace CalamityMod.NPCs.Other // Trigger the death animation else if (NPC.life <= 1 && invincibleCounter >= 6000) { + NPC.Calamity().CurrentlyIncreasingDefenseOrDR = false; NPC.life = 1; if (!Dying) { @@ -419,7 +422,7 @@ namespace CalamityMod.NPCs.Other SpriteEffects spriteEffects = SpriteEffects.None; if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; Rectangle frameUsed = texture.Frame(2, 7, 0, 1); // the idle frame by default Rectangle squintFrame = texture.Frame(2, 7, 0, 0); diff --git a/NPCs/Perforator/PerforatorBodyLarge.cs b/NPCs/Perforator/PerforatorBodyLarge.cs index 70e2aee6eb..31a00fe8ff 100644 --- a/NPCs/Perforator/PerforatorBodyLarge.cs +++ b/NPCs/Perforator/PerforatorBodyLarge.cs @@ -175,8 +175,8 @@ namespace CalamityMod.NPCs.Perforator if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = NPC.localAI[3] == 1f ? AltTexture.Value : TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / 2)); + Texture2D texture2D15 = NPC.localAI[3] == 1f ? AltTexture.Value : TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / 2)); Vector2 drawLocation = NPC.Center - screenPos; drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * NPC.scale / 2f; diff --git a/NPCs/Perforator/PerforatorBodyMedium.cs b/NPCs/Perforator/PerforatorBodyMedium.cs index 21d7c36c67..7cf12cca7c 100644 --- a/NPCs/Perforator/PerforatorBodyMedium.cs +++ b/NPCs/Perforator/PerforatorBodyMedium.cs @@ -207,8 +207,8 @@ namespace CalamityMod.NPCs.Perforator if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / 2)); Vector2 drawLocation = NPC.Center - screenPos; drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * NPC.scale / 2f; diff --git a/NPCs/Perforator/PerforatorBodySmall.cs b/NPCs/Perforator/PerforatorBodySmall.cs index d3e4ebb0a0..af7efbb936 100644 --- a/NPCs/Perforator/PerforatorBodySmall.cs +++ b/NPCs/Perforator/PerforatorBodySmall.cs @@ -171,8 +171,8 @@ namespace CalamityMod.NPCs.Perforator if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / 2)); Vector2 drawLocation = NPC.Center - screenPos; drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * NPC.scale / 2f; diff --git a/NPCs/Perforator/PerforatorCyst.cs b/NPCs/Perforator/PerforatorCyst.cs index eaf3858d0e..4121184f96 100644 --- a/NPCs/Perforator/PerforatorCyst.cs +++ b/NPCs/Perforator/PerforatorCyst.cs @@ -18,7 +18,7 @@ namespace CalamityMod.NPCs.Perforator public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; NPCID.Sets.CantTakeLunchMoney[Type] = true; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers(); @@ -62,7 +62,7 @@ namespace CalamityMod.NPCs.Perforator public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -73,11 +73,11 @@ namespace CalamityMod.NPCs.Perforator if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 vector11 = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); Vector2 vector43 = NPC.Center - screenPos; - vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, vector43, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index 44935f2b57..6896dab446 100644 --- a/NPCs/Perforator/PerforatorHeadLarge.cs +++ b/NPCs/Perforator/PerforatorHeadLarge.cs @@ -541,8 +541,8 @@ namespace CalamityMod.NPCs.Perforator if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / 2)); Vector2 drawLocation = NPC.Center - screenPos; drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * NPC.scale / 2f; diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index 4f5ffd2b01..abe6f138cd 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -466,8 +466,8 @@ namespace CalamityMod.NPCs.Perforator if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / 2)); Vector2 drawLocation = NPC.Center - screenPos; drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * NPC.scale / 2f; diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index ceda2e5f25..be6d04386d 100644 --- a/NPCs/Perforator/PerforatorHeadSmall.cs +++ b/NPCs/Perforator/PerforatorHeadSmall.cs @@ -500,8 +500,8 @@ namespace CalamityMod.NPCs.Perforator if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / 2)); Vector2 glowmaskDrawLocation = NPC.Center - screenPos; glowmaskDrawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * NPC.scale / 2f; diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index 62d60329dd..cdc9b9f97e 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -52,7 +52,7 @@ namespace CalamityMod.NPCs.Perforator public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 10; + Main.npcFrameCount[Type] = 10; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers(); NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; @@ -102,7 +102,7 @@ namespace CalamityMod.NPCs.Perforator public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -517,11 +517,11 @@ namespace CalamityMod.NPCs.Perforator if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); @@ -552,8 +552,6 @@ namespace CalamityMod.NPCs.Perforator CalamityGlobalNPC.SetNewBossJustDowned(NPC); - CalamityGlobalNPC.SetNewShopVariable(new int[] { NPCID.Dryad }, DownedBossSystem.downedPerforator); - // If neither The Hive Mind nor The Perforator Hive have been killed yet, notify players of Aerialite Ore if (!DownedBossSystem.downedHiveMind && !DownedBossSystem.downedPerforator) { diff --git a/NPCs/Perforator/PerforatorTailLarge.cs b/NPCs/Perforator/PerforatorTailLarge.cs index 38fbe5d285..99ea4c7dbd 100644 --- a/NPCs/Perforator/PerforatorTailLarge.cs +++ b/NPCs/Perforator/PerforatorTailLarge.cs @@ -171,8 +171,8 @@ namespace CalamityMod.NPCs.Perforator if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / 2)); Vector2 drawLocation = NPC.Center - screenPos; drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * NPC.scale / 2f; diff --git a/NPCs/Perforator/PerforatorTailMedium.cs b/NPCs/Perforator/PerforatorTailMedium.cs index 631c740b7d..ddc46d0d16 100644 --- a/NPCs/Perforator/PerforatorTailMedium.cs +++ b/NPCs/Perforator/PerforatorTailMedium.cs @@ -178,8 +178,8 @@ namespace CalamityMod.NPCs.Perforator if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / 2)); Vector2 drawLocation = NPC.Center - screenPos; drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * NPC.scale / 2f; diff --git a/NPCs/Perforator/PerforatorTailSmall.cs b/NPCs/Perforator/PerforatorTailSmall.cs index d27f3e875c..43453de572 100644 --- a/NPCs/Perforator/PerforatorTailSmall.cs +++ b/NPCs/Perforator/PerforatorTailSmall.cs @@ -172,8 +172,8 @@ namespace CalamityMod.NPCs.Perforator if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / 2)); Vector2 drawLocation = NPC.Center - screenPos; drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * NPC.scale / 2f; diff --git a/NPCs/PlagueEnemies/Melter.cs b/NPCs/PlagueEnemies/Melter.cs index 8539add457..1c30016023 100644 --- a/NPCs/PlagueEnemies/Melter.cs +++ b/NPCs/PlagueEnemies/Melter.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.PlagueEnemies { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers(); value.PortraitPositionYOverride = -32f; NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; diff --git a/NPCs/PlagueEnemies/PestilentSlime.cs b/NPCs/PlagueEnemies/PestilentSlime.cs index 7d3bb8889e..8e662822ae 100644 --- a/NPCs/PlagueEnemies/PestilentSlime.cs +++ b/NPCs/PlagueEnemies/PestilentSlime.cs @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.PlagueEnemies public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 2; + Main.npcFrameCount[Type] = 2; } public override void SetDefaults() @@ -67,7 +67,7 @@ namespace CalamityMod.NPCs.PlagueEnemies { spikeTimer -= 1f; } - if (!NPC.wet && !Main.player[NPC.target].npcTypeNoAggro[NPC.type]) + if (!NPC.wet && !Main.player[NPC.target].npcTypeNoAggro[Type]) { Vector2 slimePosition = new Vector2(NPC.position.X + (float)NPC.width * 0.5f, NPC.position.Y + (float)NPC.height * 0.5f); float targetXDist = Main.player[NPC.target].position.X + (float)Main.player[NPC.target].width * 0.5f - slimePosition.X; diff --git a/NPCs/PlagueEnemies/PlagueCharger.cs b/NPCs/PlagueEnemies/PlagueCharger.cs index 052ba40201..0b5fe1a1b1 100644 --- a/NPCs/PlagueEnemies/PlagueCharger.cs +++ b/NPCs/PlagueEnemies/PlagueCharger.cs @@ -23,8 +23,8 @@ namespace CalamityMod.NPCs.PlagueEnemies public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 4; + NPCID.Sets.TrailingMode[Type] = 1; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); @@ -73,8 +73,8 @@ namespace CalamityMod.NPCs.PlagueEnemies if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); int afterimageAmt = 5; if (CalamityClientConfig.Instance.Afterimages) @@ -86,14 +86,14 @@ namespace CalamityMod.NPCs.PlagueEnemies afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (float)(afterimageAmt - i) / 15f; Vector2 afterimagePos = NPC.oldPos[i] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + afterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } } Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); @@ -108,7 +108,7 @@ namespace CalamityMod.NPCs.PlagueEnemies redEyeAfterimageColor = Color.Lerp(redEyeAfterimageColor, Color.White, 0.5f); redEyeAfterimageColor *= (float)(afterimageAmt - j) / 15f; Vector2 redEyeAfterimagePos = NPC.oldPos[j] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - redEyeAfterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + redEyeAfterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; redEyeAfterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, redEyeAfterimagePos, NPC.frame, redEyeAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } diff --git a/NPCs/PlagueEnemies/PlagueChargerLarge.cs b/NPCs/PlagueEnemies/PlagueChargerLarge.cs index 20c01a8a90..3511ff8ffc 100644 --- a/NPCs/PlagueEnemies/PlagueChargerLarge.cs +++ b/NPCs/PlagueEnemies/PlagueChargerLarge.cs @@ -22,8 +22,8 @@ namespace CalamityMod.NPCs.PlagueEnemies public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.PlagueCharger.DisplayName"); public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 4; + NPCID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -68,8 +68,8 @@ namespace CalamityMod.NPCs.PlagueEnemies if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); int afterimageAmt = 5; if (CalamityClientConfig.Instance.Afterimages) @@ -81,14 +81,14 @@ namespace CalamityMod.NPCs.PlagueEnemies afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (float)(afterimageAmt - i) / 15f; Vector2 afterimagePos = NPC.oldPos[i] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + afterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } } Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); @@ -103,7 +103,7 @@ namespace CalamityMod.NPCs.PlagueEnemies redEyeAfterimageColor = Color.Lerp(redEyeAfterimageColor, Color.White, 0.5f); redEyeAfterimageColor *= (float)(afterimageAmt - j) / 15f; Vector2 redEyeAfterimagePos = NPC.oldPos[j] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - redEyeAfterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + redEyeAfterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; redEyeAfterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, redEyeAfterimagePos, NPC.frame, redEyeAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } diff --git a/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs b/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs index 959a9b51c0..42aaffb6f7 100644 --- a/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs +++ b/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs @@ -23,8 +23,8 @@ namespace CalamityMod.NPCs.PlagueEnemies { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 12; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 12; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { Scale = 0.7f, @@ -380,8 +380,8 @@ namespace CalamityMod.NPCs.PlagueEnemies if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); if (CalamityClientConfig.Instance.Afterimages) { @@ -395,7 +395,7 @@ namespace CalamityMod.NPCs.PlagueEnemies afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (float)(chargeAfterimageAmount - i) / 15f; Vector2 afterimagePos = NPC.oldPos[i] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + afterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } @@ -403,7 +403,7 @@ namespace CalamityMod.NPCs.PlagueEnemies } Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/PlagueEnemies/Plagueshell.cs b/NPCs/PlagueEnemies/Plagueshell.cs index b718bdcb14..c13bcb2203 100644 --- a/NPCs/PlagueEnemies/Plagueshell.cs +++ b/NPCs/PlagueEnemies/Plagueshell.cs @@ -17,7 +17,7 @@ namespace CalamityMod.NPCs.PlagueEnemies { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 8; + Main.npcFrameCount[Type] = 8; } public override void SetDefaults() diff --git a/NPCs/PlagueEnemies/Viruling.cs b/NPCs/PlagueEnemies/Viruling.cs index 2047db9df4..c3ea3971ac 100644 --- a/NPCs/PlagueEnemies/Viruling.cs +++ b/NPCs/PlagueEnemies/Viruling.cs @@ -19,7 +19,7 @@ namespace CalamityMod.NPCs.PlagueEnemies { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; } public override void SetDefaults() @@ -59,7 +59,7 @@ namespace CalamityMod.NPCs.PlagueEnemies public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs index a229e8f164..a65955b46d 100644 --- a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs +++ b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs @@ -21,8 +21,8 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 4; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 4; + NPCID.Sets.TrailingMode[Type] = 1; if (!Main.dedServ) { GlowTexture = ModContent.Request("CalamityMod/NPCs/PlaguebringerGoliath/PlagueHomingMissileGlow", AssetRequestMode.AsyncLoad); @@ -164,8 +164,8 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Texture2D texture = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); int afterimageAmt = 5; Vector2 drawLocation = NPC.Center - screenPos; @@ -185,13 +185,13 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (float)(afterimageAmt - i) / 15f; Vector2 afterimagePos = NPC.oldPos[i] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + afterimagePos -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } } - drawLocation -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + drawLocation -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); @@ -206,7 +206,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath secondAfterimageColor = Color.Lerp(secondAfterimageColor, Color.White, 0.5f); secondAfterimageColor *= (float)(afterimageAmt - j) / 15f; Vector2 secondAfterimagePos = NPC.oldPos[j] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - secondAfterimagePos -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + secondAfterimagePos -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; secondAfterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, secondAfterimagePos, NPC.frame, secondAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } @@ -220,7 +220,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/PlaguebringerGoliath/PlagueMine.cs b/NPCs/PlaguebringerGoliath/PlagueMine.cs index 6d3571c909..e95079f7ee 100644 --- a/NPCs/PlaguebringerGoliath/PlagueMine.cs +++ b/NPCs/PlaguebringerGoliath/PlagueMine.cs @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; if (!Main.dedServ) { GlowTexture = ModContent.Request("CalamityMod/NPCs/PlaguebringerGoliath/PlagueMineGlow", AssetRequestMode.AsyncLoad); @@ -113,7 +113,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (NPC.frameCounter % 6 == 5) NPC.frame.Y += frameHeight; - if (NPC.frame.Y / frameHeight >= Main.npcFrameCount[NPC.type]) + if (NPC.frame.Y / frameHeight >= Main.npcFrameCount[Type]) NPC.frame.Y = 0; } @@ -123,10 +123,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2); + Texture2D texture = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / 2); Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawLocation -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); Color backAfterimageColor = PlaguebringerGoliath.BackglowColor * NPC.Opacity; diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index be03794148..f30c1fad8d 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -62,8 +62,8 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 6; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -1241,7 +1241,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; Texture2D glowTexture = Texture_Glow.Value; if (curTex != (charging ? 2 : 1)) { diff --git a/NPCs/Polterghast/PhantomFuckYou.cs b/NPCs/Polterghast/PhantomFuckYou.cs index 7f7cc5a745..5e0b097a77 100644 --- a/NPCs/Polterghast/PhantomFuckYou.cs +++ b/NPCs/Polterghast/PhantomFuckYou.cs @@ -19,8 +19,8 @@ namespace CalamityMod.NPCs.Polterghast public override void SetStaticDefaults() { this.HideFromBestiary(); - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; - NPCID.Sets.TrailingMode[NPC.type] = 1; + NPCID.Sets.NeedsExpertScaling[Type] = true; + NPCID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -33,6 +33,7 @@ namespace CalamityMod.NPCs.Polterghast NPC.DR_NERD(0.1f); NPC.noGravity = true; NPC.noTileCollide = true; + NPC.chaseable = false; NPC.damage = 0; // 0 contact damage, projectile damage is pulled from NPCStats NPC.lifeMax = 20000; NPC.HitSound = SoundID.NPCHit36; @@ -145,8 +146,8 @@ namespace CalamityMod.NPCs.Polterghast if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / 2); int afterimageAmt = 5; if (CalamityClientConfig.Instance.Afterimages) diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs index d8246eedc2..5364fb0369 100644 --- a/NPCs/Polterghast/PolterPhantom.cs +++ b/NPCs/Polterghast/PolterPhantom.cs @@ -24,8 +24,8 @@ namespace CalamityMod.NPCs.Polterghast public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 4; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.NPCBestiaryDrawModifiers bestiaryData = new NPCID.Sets.NPCBestiaryDrawModifiers() { Hide = true }; NPCID.Sets.NPCBestiaryDrawOffset.Add(Type, bestiaryData); if (!Main.dedServ) @@ -450,8 +450,8 @@ namespace CalamityMod.NPCs.Polterghast float colorChangeTime = 180f; float changeColorGateValue = chargePhaseGateValue - colorChangeTime; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); Color lightRed = new Color(255, 100, 100, 255) * NPC.Opacity; int afterimageAmt = 7; @@ -468,7 +468,7 @@ namespace CalamityMod.NPCs.Polterghast afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (afterimageAmt - i) / 15f; Vector2 afterimagePos = NPC.oldPos[i] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + afterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } @@ -480,7 +480,7 @@ namespace CalamityMod.NPCs.Polterghast color = Color.Lerp(color, lightRed, MathHelper.Clamp((Main.npc[CalamityGlobalNPC.ghostBoss].Calamity().newAI[0] - changeColorGateValue) / timeToReachFullColor, 0f, 1f)); Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, color, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); @@ -495,7 +495,7 @@ namespace CalamityMod.NPCs.Polterghast for (int j = 1; j < afterimageAmt; j++) { Vector2 otherAfterimagePos = NPC.oldPos[j] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - otherAfterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + otherAfterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; otherAfterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); Color otherAfterimageColor = blackWhiteLerp; otherAfterimageColor = Color.Lerp(otherAfterimageColor, Color.White, 0.5f); diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 6b81a6a10f..28b62e6587 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -92,8 +92,8 @@ namespace CalamityMod.NPCs.Polterghast public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 12; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 12; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.MPAllowedEnemies[Type] = true; if (!Main.dedServ) @@ -1161,9 +1161,9 @@ namespace CalamityMod.NPCs.Polterghast if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; Texture2D texture2D16 = Texture_Glow2.Value; - Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); int afterimageAmt = 7; if (CalamityClientConfig.Instance.Afterimages) @@ -1175,14 +1175,14 @@ namespace CalamityMod.NPCs.Polterghast afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (afterimageAmt - i) / 15f; Vector2 afterimagePos = NPC.oldPos[i] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + afterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } } Vector2 vector43 = NPC.Center - screenPos; - vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; vector43 += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); Color c = NPC.IsABestiaryIconDummy ? Color.White : NPC.GetAlpha(drawColor); spriteBatch.Draw(texture2D15, vector43, NPC.frame, c, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); @@ -1219,7 +1219,7 @@ namespace CalamityMod.NPCs.Polterghast otherAfterimageColor = NPC.GetAlpha(otherAfterimageColor); otherAfterimageColor *= (afterimageAmt - j) / 15f; Vector2 otherAfterimagePos = NPC.oldPos[j] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - otherAfterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + otherAfterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; otherAfterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, otherAfterimagePos, NPC.frame, otherAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/Polterghast/PolterghastHook.cs b/NPCs/Polterghast/PolterghastHook.cs index be8e568245..f83679ac0b 100644 --- a/NPCs/Polterghast/PolterghastHook.cs +++ b/NPCs/Polterghast/PolterghastHook.cs @@ -23,8 +23,8 @@ namespace CalamityMod.NPCs.Polterghast public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 2; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 2; + NPCID.Sets.TrailingMode[Type] = 1; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); @@ -371,8 +371,8 @@ namespace CalamityMod.NPCs.Polterghast if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); int afterimageAmt = 5; if (CalamityClientConfig.Instance.Afterimages) @@ -384,14 +384,14 @@ namespace CalamityMod.NPCs.Polterghast afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (afterimageAmt - i) / 15f; Vector2 afterimagePos = NPC.oldPos[i] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + afterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } } Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); @@ -410,7 +410,7 @@ namespace CalamityMod.NPCs.Polterghast otherAfterimageColor = NPC.GetAlpha(otherAfterimageColor); otherAfterimageColor *= (afterimageAmt - j) / 15f; Vector2 otherAfterimagePos = NPC.oldPos[j] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - otherAfterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + otherAfterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; otherAfterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, otherAfterimagePos, NPC.frame, otherAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmBody.cs b/NPCs/PrimordialWyrm/PrimordialWyrmBody.cs index 7d2661965f..eaf87ad7e4 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmBody.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmBody.cs @@ -168,11 +168,11 @@ namespace CalamityMod.NPCs.PrimordialWyrm if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; - Vector2 vector = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Texture2D texture = TextureAssets.Npc[Type].Value; + Vector2 vector = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); Vector2 center = NPC.Center - screenPos; - center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; center += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, center, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmBodyAlt.cs b/NPCs/PrimordialWyrm/PrimordialWyrmBodyAlt.cs index eca355a095..c6b9ee2bd8 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmBodyAlt.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmBodyAlt.cs @@ -167,11 +167,11 @@ namespace CalamityMod.NPCs.PrimordialWyrm if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; - Vector2 vector = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Texture2D texture = TextureAssets.Npc[Type].Value; + Vector2 vector = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); Vector2 center = NPC.Center - screenPos; - center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; center += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, center, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs index adf88847c4..46a69cacc6 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs @@ -5,7 +5,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Events; using CalamityMod.Items.Materials; using CalamityMod.Items.Pets; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Items.Placeables.Furniture.DevPaintings; using CalamityMod.Items.Potions; using CalamityMod.Items.Weapons.Magic; @@ -1435,11 +1435,11 @@ namespace CalamityMod.NPCs.PrimordialWyrm if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; - Vector2 vector = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Texture2D texture = TextureAssets.Npc[Type].Value; + Vector2 vector = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); Vector2 center = NPC.Center - screenPos; - center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; center += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, center, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmTail.cs b/NPCs/PrimordialWyrm/PrimordialWyrmTail.cs index 5568ef9a0b..b77c37a7da 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmTail.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmTail.cs @@ -129,11 +129,11 @@ namespace CalamityMod.NPCs.PrimordialWyrm if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; - Vector2 vector = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Texture2D texture = TextureAssets.Npc[Type].Value; + Vector2 vector = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); Vector2 center = NPC.Center - screenPos; - center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; center += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, center, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index 449a83a0c7..4a1010d253 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -45,8 +45,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 10; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 10; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -133,7 +133,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.12f + NPC.velocity.Length() / 120f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -1025,9 +1025,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; Vector2 drawPos = NPC.Center - screenPos; - Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); int afterimageAmt = 5; if (NPC.ai[0] == 2f) afterimageAmt = 10; @@ -1044,14 +1044,14 @@ namespace CalamityMod.NPCs.ProfanedGuardians afterimageColor = colorOverride.Value; Vector2 afterimagePos = NPC.oldPos[i] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + afterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY) + drawOffset; spriteBatch.Draw(texture2D15, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } } Vector2 drawLocation = drawPos; - drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY) + drawOffset; spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, colorOverride ?? NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); @@ -1082,7 +1082,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians timeBasedAfterimageColor = colorOverride.Value; Vector2 timeBasedAfterimagePos = NPC.oldPos[j] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - timeBasedAfterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + timeBasedAfterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; timeBasedAfterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY) + drawOffset; spriteBatch.Draw(texture2D15, timeBasedAfterimagePos, NPC.frame, timeBasedAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs index a6e03f68e7..8639908070 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs @@ -35,8 +35,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 10; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 10; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -118,7 +118,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.12f + NPC.velocity.Length() / 120f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -745,9 +745,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; Vector2 drawPos = NPC.Center - screenPos; - Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); int afterimageAmt = 5; if (NPC.ai[0] == 2f) afterimageAmt = 10; @@ -764,14 +764,14 @@ namespace CalamityMod.NPCs.ProfanedGuardians afterimageColor = colorOverride.Value; Vector2 afterimagePos = NPC.oldPos[i] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + afterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY) + drawOffset; spriteBatch.Draw(texture2D15, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } } Vector2 drawLocation = drawPos; - drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY) + drawOffset; spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, colorOverride ?? NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); @@ -802,7 +802,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians timeBasedAfterimageColor = colorOverride.Value; Vector2 timeBasedAfterimagePos = NPC.oldPos[j] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - timeBasedAfterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + timeBasedAfterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; timeBasedAfterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY) + drawOffset; spriteBatch.Draw(texture2D15, timeBasedAfterimagePos, NPC.frame, timeBasedAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs index 2688f01f1c..090bc5367e 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs @@ -47,8 +47,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 10; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 10; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -125,7 +125,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.12f + NPC.velocity.Length() / 120f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -437,9 +437,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; Texture2D texture2D16 = Texture_Glow2.Value; - Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); int afterimageAmt = 5; if (CalamityClientConfig.Instance.Afterimages) @@ -454,14 +454,14 @@ namespace CalamityMod.NPCs.ProfanedGuardians afterimageColor = colorOverride.Value; Vector2 afterimagePos = NPC.oldPos[i] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + afterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY) + drawOffset; spriteBatch.Draw(texture2D15, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } } Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY) + drawOffset; spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, colorOverride ?? NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); @@ -496,7 +496,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians timeBasedAfterimageColor = colorOverride.Value; Vector2 timeBasedAfterimagePos = NPC.oldPos[j] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - timeBasedAfterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + timeBasedAfterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; timeBasedAfterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY) + drawOffset; spriteBatch.Draw(texture2D15, timeBasedAfterimagePos, NPC.frame, timeBasedAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/ProfanedGuardians/ProfanedRocks.cs b/NPCs/ProfanedGuardians/ProfanedRocks.cs index 6a8c0f70ef..a2a6edb15e 100644 --- a/NPCs/ProfanedGuardians/ProfanedRocks.cs +++ b/NPCs/ProfanedGuardians/ProfanedRocks.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void SetStaticDefaults() { this.HideFromBestiary(); - NPCID.Sets.TrailingMode[NPC.type] = 1; + NPCID.Sets.TrailingMode[Type] = 1; if (!Main.dedServ) { for (int i = 0; i < 6; i++) diff --git a/NPCs/Providence/ProvSpawnDefense.cs b/NPCs/Providence/ProvSpawnDefense.cs index 15f6e2eae4..a5e8989db5 100644 --- a/NPCs/Providence/ProvSpawnDefense.cs +++ b/NPCs/Providence/ProvSpawnDefense.cs @@ -21,9 +21,9 @@ namespace CalamityMod.NPCs.Providence public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 10; - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 10; + NPCID.Sets.NeedsExpertScaling[Type] = true; + NPCID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -65,7 +65,7 @@ namespace CalamityMod.NPCs.Providence else NPC.frameCounter += 0.12f + Main.npc[CalamityGlobalNPC.holyBoss].velocity.Length() / 120f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -114,8 +114,8 @@ namespace CalamityMod.NPCs.Providence if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); int afterimageAmt = 5; if (CalamityClientConfig.Instance.Afterimages) @@ -127,14 +127,14 @@ namespace CalamityMod.NPCs.Providence afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (float)(afterimageAmt - i) / 15f; Vector2 afterimagePos = NPC.oldPos[i] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + afterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } } Vector2 vector43 = NPC.Center - screenPos; - vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; vector43 += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, vector43, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); @@ -150,7 +150,7 @@ namespace CalamityMod.NPCs.Providence yellowAfterimageColor = NPC.GetAlpha(yellowAfterimageColor); yellowAfterimageColor *= (float)(afterimageAmt - j) / 15f; Vector2 yellowAfterimagePos = NPC.oldPos[j] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - yellowAfterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + yellowAfterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; yellowAfterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, yellowAfterimagePos, NPC.frame, yellowAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } diff --git a/NPCs/Providence/ProvSpawnHealer.cs b/NPCs/Providence/ProvSpawnHealer.cs index 1cc6651765..bf8a0db736 100644 --- a/NPCs/Providence/ProvSpawnHealer.cs +++ b/NPCs/Providence/ProvSpawnHealer.cs @@ -21,9 +21,9 @@ namespace CalamityMod.NPCs.Providence public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 10; - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 10; + NPCID.Sets.NeedsExpertScaling[Type] = true; + NPCID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -64,7 +64,7 @@ namespace CalamityMod.NPCs.Providence else NPC.frameCounter += 0.12f + Main.npc[CalamityGlobalNPC.holyBoss].velocity.Length() / 120f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -113,9 +113,9 @@ namespace CalamityMod.NPCs.Providence if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; Texture2D texture2D16 = ProfanedGuardianHealer.Texture_Glow2.Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); int afterimageAmt = 5; if (CalamityClientConfig.Instance.Afterimages) @@ -127,14 +127,14 @@ namespace CalamityMod.NPCs.Providence afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (float)(afterimageAmt - i) / 15f; Vector2 afterimagePos = NPC.oldPos[i] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + afterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } } Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); @@ -151,7 +151,7 @@ namespace CalamityMod.NPCs.Providence yellowAfterimageColor = NPC.GetAlpha(yellowAfterimageColor); yellowAfterimageColor *= (float)(afterimageAmt - j) / 15f; Vector2 yellowAfterimagePos = NPC.oldPos[j] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - yellowAfterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + yellowAfterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; yellowAfterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, yellowAfterimagePos, NPC.frame, yellowAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/Providence/ProvSpawnOffense.cs b/NPCs/Providence/ProvSpawnOffense.cs index e430b70422..9e8ea1d4b1 100644 --- a/NPCs/Providence/ProvSpawnOffense.cs +++ b/NPCs/Providence/ProvSpawnOffense.cs @@ -21,9 +21,9 @@ namespace CalamityMod.NPCs.Providence public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 10; - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 10; + NPCID.Sets.NeedsExpertScaling[Type] = true; + NPCID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -65,7 +65,7 @@ namespace CalamityMod.NPCs.Providence else NPC.frameCounter += 0.12f + Main.npc[CalamityGlobalNPC.holyBoss].velocity.Length() / 120f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -114,8 +114,8 @@ namespace CalamityMod.NPCs.Providence if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); int afterimageAmt = 5; if (NPC.ai[0] == 2f) afterimageAmt = 10; @@ -129,14 +129,14 @@ namespace CalamityMod.NPCs.Providence afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (float)(afterimageAmt - i) / 15f; Vector2 afterimagePos = NPC.oldPos[i] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + afterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } } Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); @@ -152,7 +152,7 @@ namespace CalamityMod.NPCs.Providence yellowAfterimageColor = NPC.GetAlpha(yellowAfterimageColor); yellowAfterimageColor *= (float)(afterimageAmt - j) / 15f; Vector2 yellowAfterimagePos = NPC.oldPos[j] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - yellowAfterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + yellowAfterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; yellowAfterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, yellowAfterimagePos, NPC.frame, yellowAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index da6fd80bba..5b1460b0bf 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -168,8 +168,8 @@ namespace CalamityMod.NPCs.Providence public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 3; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 3; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -2216,7 +2216,7 @@ namespace CalamityMod.NPCs.Providence spriteEffects = SpriteEffects.FlipHorizontally; // Draw the main boss texture + its afterimages - Vector2 RotationCenter = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Vector2 RotationCenter = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); Color BaseColor = Color.White; float Brightness = 0.5f; // Ranges from 0 (full vibrance) to 1 (pure white) int maxAfterimages = 5; @@ -2233,14 +2233,14 @@ namespace CalamityMod.NPCs.Providence AfterimageColor = colorOverride.Value; Vector2 AfterimageBodyPosition = NPC.oldPos[i] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - AfterimageBodyPosition -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + AfterimageBodyPosition -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; AfterimageBodyPosition += RotationCenter * NPC.scale + new Vector2(0f, NPC.gfxOffY) + drawOffset; spriteBatch.Draw(texture, AfterimageBodyPosition, NPC.frame, AfterimageColor.MultiplyRGBA(Lighting.GetColor((int)NPC.Center.X / 16, (int)NPC.Center.Y / 16)), NPC.rotation, RotationCenter, NPC.scale, spriteEffects, 0f); } } Vector2 BasePosition = NPC.Center - screenPos; - BasePosition -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + BasePosition -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; BasePosition += RotationCenter * NPC.scale + new Vector2(0f, NPC.gfxOffY) + drawOffset; Color finalDrawColor = NPC.IsABestiaryIconDummy ? Color.White : (colorOverride ?? Lighting.GetColor((int)NPC.Center.X / 16, (int)NPC.Center.Y / 16)) * NPC.Opacity; spriteBatch.Draw(texture, BasePosition, NPC.frame, finalDrawColor, NPC.rotation, RotationCenter, NPC.scale, spriteEffects, 0f); @@ -2309,7 +2309,7 @@ namespace CalamityMod.NPCs.Providence AfterimageWingColor = colorOverride.Value; Vector2 AfterimageGlowPosition = NPC.oldPos[j] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - AfterimageGlowPosition -= new Vector2(textureGlow.Width, textureGlow.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + AfterimageGlowPosition -= new Vector2(textureGlow.Width, textureGlow.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; AfterimageGlowPosition += RotationCenter * NPC.scale + new Vector2(0f, NPC.gfxOffY) + drawOffset; spriteBatch.Draw(textureGlow, AfterimageGlowPosition, NPC.frame, AfterimageWingColor, NPC.rotation, RotationCenter, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/Ravager/FlamePillar.cs b/NPCs/Ravager/FlamePillar.cs index 1da01e7aa9..748b5f8f15 100644 --- a/NPCs/Ravager/FlamePillar.cs +++ b/NPCs/Ravager/FlamePillar.cs @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.Ravager public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); @@ -53,7 +53,7 @@ namespace CalamityMod.NPCs.Ravager public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -150,10 +150,10 @@ namespace CalamityMod.NPCs.Ravager if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / 2); Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index b488418a3e..55c78cf3b1 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -51,7 +51,7 @@ namespace CalamityMod.NPCs.Ravager public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 7; + Main.npcFrameCount[Type] = 7; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -140,7 +140,7 @@ namespace CalamityMod.NPCs.Ravager NPC.Opacity = 1f; NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -878,9 +878,9 @@ namespace CalamityMod.NPCs.Ravager spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); Vector2 glowmaskPosition = center - screenPos; - glowmaskPosition -= new Vector2(GlowTexture.Value.Width, GlowTexture.Value.Height / Main.npcFrameCount[NPC.type]) * 1f / 2f; + glowmaskPosition -= new Vector2(GlowTexture.Value.Width, GlowTexture.Value.Height / Main.npcFrameCount[Type]) * 1f / 2f; glowmaskPosition += halfSizeTexture * 1f + new Vector2(0f, 4f + NPC.gfxOffY); Color glowmaskColor = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(Color.Blue); spriteBatch.Draw(GlowTexture.Value, glowmaskPosition, diff --git a/NPCs/Ravager/RavagerHead.cs b/NPCs/Ravager/RavagerHead.cs index e88c1a501d..e181a9e65d 100644 --- a/NPCs/Ravager/RavagerHead.cs +++ b/NPCs/Ravager/RavagerHead.cs @@ -17,7 +17,7 @@ namespace CalamityMod.NPCs.Ravager public override void SetStaticDefaults() { this.HideFromBestiary(); - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; + NPCID.Sets.NeedsExpertScaling[Type] = true; } public override void SetDefaults() diff --git a/NPCs/Ravager/RavagerHead2.cs b/NPCs/Ravager/RavagerHead2.cs index 2d13521641..376ffdb2d5 100644 --- a/NPCs/Ravager/RavagerHead2.cs +++ b/NPCs/Ravager/RavagerHead2.cs @@ -17,7 +17,7 @@ namespace CalamityMod.NPCs.Ravager public override void SetStaticDefaults() { this.HideFromBestiary(); - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; + NPCID.Sets.NeedsExpertScaling[Type] = true; } public override void SetDefaults() diff --git a/NPCs/Ravager/RavagerLegLeft.cs b/NPCs/Ravager/RavagerLegLeft.cs index 44183292d9..f344ab45ce 100644 --- a/NPCs/Ravager/RavagerLegLeft.cs +++ b/NPCs/Ravager/RavagerLegLeft.cs @@ -13,7 +13,7 @@ namespace CalamityMod.NPCs.Ravager public override void SetStaticDefaults() { this.HideFromBestiary(); - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; + NPCID.Sets.NeedsExpertScaling[Type] = true; } public override void SetDefaults() diff --git a/NPCs/Ravager/RavagerLegRight.cs b/NPCs/Ravager/RavagerLegRight.cs index 58c8cf5991..31aed5da5b 100644 --- a/NPCs/Ravager/RavagerLegRight.cs +++ b/NPCs/Ravager/RavagerLegRight.cs @@ -13,7 +13,7 @@ namespace CalamityMod.NPCs.Ravager public override void SetStaticDefaults() { this.HideFromBestiary(); - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; + NPCID.Sets.NeedsExpertScaling[Type] = true; } public override void SetDefaults() diff --git a/NPCs/Signus/CosmicLantern.cs b/NPCs/Signus/CosmicLantern.cs index 1fe444ffe1..2e21538a8d 100644 --- a/NPCs/Signus/CosmicLantern.cs +++ b/NPCs/Signus/CosmicLantern.cs @@ -18,8 +18,8 @@ namespace CalamityMod.NPCs.Signus public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 4; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); if (!Main.dedServ) { @@ -79,7 +79,7 @@ namespace CalamityMod.NPCs.Signus NPC.Opacity = 1f; NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -127,8 +127,8 @@ namespace CalamityMod.NPCs.Signus if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); int afterimageAmt = 5; if (CalamityClientConfig.Instance.Afterimages) @@ -140,14 +140,14 @@ namespace CalamityMod.NPCs.Signus afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (float)(afterimageAmt - i) / 15f; Vector2 afterimagePos = NPC.oldPos[i] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + afterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } } Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); @@ -163,7 +163,7 @@ namespace CalamityMod.NPCs.Signus flameAfterimageColor = NPC.GetAlpha(flameAfterimageColor); flameAfterimageColor *= (float)(afterimageAmt - j) / 15f; Vector2 flameAfterimagePos = NPC.oldPos[j] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - flameAfterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + flameAfterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; flameAfterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, flameAfterimagePos, NPC.frame, flameAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } diff --git a/NPCs/Signus/CosmicMine.cs b/NPCs/Signus/CosmicMine.cs index ee24a26581..69af4f8c13 100644 --- a/NPCs/Signus/CosmicMine.cs +++ b/NPCs/Signus/CosmicMine.cs @@ -18,7 +18,7 @@ namespace CalamityMod.NPCs.Signus { public override void SetStaticDefaults() { - NPCID.Sets.TrailingMode[NPC.type] = 1; + NPCID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -182,8 +182,8 @@ namespace CalamityMod.NPCs.Signus if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / 2); int afterimageAmt = 5; if (CalamityClientConfig.Instance.Afterimages) diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index 0403c5cdd5..764e71dba2 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -46,8 +46,8 @@ namespace CalamityMod.NPCs.Signus public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 6; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -809,7 +809,7 @@ namespace CalamityMod.NPCs.Signus public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - Texture2D NPCTexture = TextureAssets.Npc[NPC.type].Value; + Texture2D NPCTexture = TextureAssets.Npc[Type].Value; Texture2D glowMaskTexture = Texture_Glow.Value; SpriteEffects spriteEffects = SpriteEffects.None; @@ -818,7 +818,7 @@ namespace CalamityMod.NPCs.Signus int afterimageAmt = 5; Rectangle frame = NPC.frame; - int frameCount = Main.npcFrameCount[NPC.type]; + int frameCount = Main.npcFrameCount[Type]; if (NPC.ai[0] == 4f) { @@ -838,7 +838,7 @@ namespace CalamityMod.NPCs.Signus } else { - NPCTexture = TextureAssets.Npc[NPC.type].Value; + NPCTexture = TextureAssets.Npc[Type].Value; glowMaskTexture = Texture_Glow.Value; } diff --git a/NPCs/SlimeGod/CorruptSlimeSpawn.cs b/NPCs/SlimeGod/CorruptSlimeSpawn.cs index 0ad84b5084..bb36b36aca 100644 --- a/NPCs/SlimeGod/CorruptSlimeSpawn.cs +++ b/NPCs/SlimeGod/CorruptSlimeSpawn.cs @@ -13,7 +13,7 @@ namespace CalamityMod.NPCs.SlimeGod { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers(); value.PortraitPositionYOverride = -32f; diff --git a/NPCs/SlimeGod/CorruptSlimeSpawn2.cs b/NPCs/SlimeGod/CorruptSlimeSpawn2.cs index 104f91d53a..535de4f3b2 100644 --- a/NPCs/SlimeGod/CorruptSlimeSpawn2.cs +++ b/NPCs/SlimeGod/CorruptSlimeSpawn2.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 2; + Main.npcFrameCount[Type] = 2; } public override void SetDefaults() diff --git a/NPCs/SlimeGod/CrimsonSlimeSpawn.cs b/NPCs/SlimeGod/CrimsonSlimeSpawn.cs index 71a15d5a27..d080f997f1 100644 --- a/NPCs/SlimeGod/CrimsonSlimeSpawn.cs +++ b/NPCs/SlimeGod/CrimsonSlimeSpawn.cs @@ -14,7 +14,7 @@ namespace CalamityMod.NPCs.SlimeGod { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 2; + Main.npcFrameCount[Type] = 2; NPCID.Sets.BossBestiaryPriority.Add(Type); } diff --git a/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs b/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs index 9ceec3977c..2f75e80e5b 100644 --- a/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs +++ b/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs @@ -19,7 +19,7 @@ namespace CalamityMod.NPCs.SlimeGod public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.CrimsonSlimeSpawn.DisplayName"); public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; NPCID.Sets.BossBestiaryPriority.Add(Type); } @@ -63,9 +63,9 @@ namespace CalamityMod.NPCs.SlimeGod int frameY = 1; if (!Main.dedServ) { - if (TextureAssets.Npc[NPC.type].Value is null) + if (TextureAssets.Npc[Type].Value is null) return; - frameY = TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type]; + frameY = TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type]; } int aiState = 0; if (NPC.aiAction == 0) @@ -83,7 +83,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.frame.Y += frameY; NPC.frameCounter = 0f; } - if (NPC.frame.Y >= frameY * Main.npcFrameCount[NPC.type]) + if (NPC.frame.Y >= frameY * Main.npcFrameCount[Type]) NPC.frame.Y = 0; } diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index 7ecd43f60f..a25fc02f8b 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -90,8 +90,8 @@ namespace CalamityMod.NPCs.SlimeGod NPC.defense = 6; NPC.LifeMaxNERB(420); - NPCID.Sets.TrailCacheLength[NPC.type] = 8; - NPCID.Sets.TrailingMode[NPC.type] = 1; + NPCID.Sets.TrailCacheLength[Type] = 8; + NPCID.Sets.TrailingMode[Type] = 1; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; @@ -666,7 +666,7 @@ namespace CalamityMod.NPCs.SlimeGod Vector2 origin = NPC.frame.Size() * 0.5f; Vector2 halfSize = NPC.Size * 0.5f; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; Texture2D eyeTexture = EyeTexture.Value; Texture2D overlayTexture = OverlayTexture.Value; Texture2D pog = ZenithSeedEyeTexture.Value; @@ -698,7 +698,7 @@ namespace CalamityMod.NPCs.SlimeGod if (!Main.zenithWorld) { Vector2 drawPositionAdjustment = halfSize - screenPos + new Vector2(0f, NPC.gfxOffY); - float colorAlphaDivisor = NPCID.Sets.TrailCacheLength[NPC.type] * 1.5f; + float colorAlphaDivisor = NPCID.Sets.TrailCacheLength[Type] * 1.5f; int twoConst = 2; int coreID = 1; @@ -776,8 +776,6 @@ namespace CalamityMod.NPCs.SlimeGod CalamityGlobalNPC.SetNewBossJustDowned(NPC); - CalamityGlobalNPC.SetNewShopVariable(new int[] { ModContent.NPCType() }, DownedBossSystem.downedSlimeGod); - // Mark the Slime God as dead DownedBossSystem.downedSlimeGod = true; CalamityNetcode.SyncWorld(); diff --git a/NPCs/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index 5a7063bc11..409b7a4294 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.StormWeaver public override void SetStaticDefaults() { this.HideFromBestiary(); - NPCID.Sets.TrailingMode[NPC.type] = 1; + NPCID.Sets.TrailingMode[Type] = 1; if (!Main.dedServ) { Phase2Texture = ModContent.Request(Texture + "Naked", AssetRequestMode.AsyncLoad); @@ -276,7 +276,7 @@ namespace CalamityMod.NPCs.StormWeaver if (!phase3) chargePhaseGateValue *= 0.5f; - Texture2D texture = phase2 ? Phase2Texture.Value : TextureAssets.Npc[NPC.type].Value; + Texture2D texture = phase2 ? Phase2Texture.Value : TextureAssets.Npc[Type].Value; Vector2 halfSizeTexture = new Vector2(texture.Width / 2, texture.Height / 2); float chargeTelegraphTime = 120f; float chargeTelegraphGateValue = chargePhaseGateValue - chargeTelegraphTime; diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index c42521c275..505cc3219a 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -62,7 +62,7 @@ namespace CalamityMod.NPCs.StormWeaver public override void SetStaticDefaults() { - NPCID.Sets.TrailingMode[NPC.type] = 1; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -848,7 +848,7 @@ namespace CalamityMod.NPCs.StormWeaver if (!phase3) chargePhaseGateValue *= 0.5f; - Texture2D texture = phase2 ? Phase2Texture.Value : TextureAssets.Npc[NPC.type].Value; + Texture2D texture = phase2 ? Phase2Texture.Value : TextureAssets.Npc[Type].Value; Vector2 halfSizeTexture = new Vector2(texture.Width / 2, texture.Height / 2); float chargeTelegraphTime = 120f; float chargeTelegraphGateValue = chargePhaseGateValue - chargeTelegraphTime; @@ -988,9 +988,9 @@ namespace CalamityMod.NPCs.StormWeaver { ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType(), }; normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, weapons)); - normalOnly.Add(ModContent.ItemType(), 10); // Materials normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), 1, 5, 7)); diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index 41496ffbd5..d2bb8f811a 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.StormWeaver public override void SetStaticDefaults() { this.HideFromBestiary(); - NPCID.Sets.TrailingMode[NPC.type] = 1; + NPCID.Sets.TrailingMode[Type] = 1; if (!Main.dedServ) { Phase2Texture = ModContent.Request(Texture + "Naked", AssetRequestMode.AsyncLoad); @@ -272,7 +272,7 @@ namespace CalamityMod.NPCs.StormWeaver if (!phase3) chargePhaseGateValue *= 0.5f; - Texture2D texture = phase2 ? Phase2Texture.Value : TextureAssets.Npc[NPC.type].Value; + Texture2D texture = phase2 ? Phase2Texture.Value : TextureAssets.Npc[Type].Value; Vector2 halfSizeTexture = new Vector2(texture.Width / 2, texture.Height / 2); float chargeTelegraphTime = 120f; float chargeTelegraphGateValue = chargePhaseGateValue - chargeTelegraphTime; diff --git a/NPCs/SulphurousSea/AnthozoanCrab.cs b/NPCs/SulphurousSea/AnthozoanCrab.cs index 80ae0d2363..bcbe51c764 100644 --- a/NPCs/SulphurousSea/AnthozoanCrab.cs +++ b/NPCs/SulphurousSea/AnthozoanCrab.cs @@ -20,8 +20,8 @@ namespace CalamityMod.NPCs.SulphurousSea public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 16; - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; + Main.npcFrameCount[Type] = 16; + NPCID.Sets.NeedsExpertScaling[Type] = true; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { SpriteDirection = 1 diff --git a/NPCs/SulphurousSea/BelchingCoral.cs b/NPCs/SulphurousSea/BelchingCoral.cs index 4f806404e4..8a8a865748 100644 --- a/NPCs/SulphurousSea/BelchingCoral.cs +++ b/NPCs/SulphurousSea/BelchingCoral.cs @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.SulphurousSea public const float CheckDistance = 480f; public override void SetStaticDefaults() { - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; + NPCID.Sets.NeedsExpertScaling[Type] = true; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers(); value.Position.Y += 4; value.PortraitPositionYOverride = 24f; diff --git a/NPCs/SulphurousSea/Gnasher.cs b/NPCs/SulphurousSea/Gnasher.cs index 9ebd137f18..d5b8fa1c15 100644 --- a/NPCs/SulphurousSea/Gnasher.cs +++ b/NPCs/SulphurousSea/Gnasher.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.SulphurousSea { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { SpriteDirection = 1 @@ -149,7 +149,7 @@ namespace CalamityMod.NPCs.SulphurousSea } NPC.frameCounter += NPC.chaseable ? 0.15f : 0.075f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/SulphurousSea/Sulflounder.cs b/NPCs/SulphurousSea/Sulflounder.cs index ab9a4ac6da..8caf72e232 100644 --- a/NPCs/SulphurousSea/Sulflounder.cs +++ b/NPCs/SulphurousSea/Sulflounder.cs @@ -15,8 +15,8 @@ namespace CalamityMod.NPCs.SulphurousSea { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; + Main.npcFrameCount[Type] = 4; + NPCID.Sets.NeedsExpertScaling[Type] = true; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers(); value.Position.Y -= 10f; value.PortraitPositionYOverride = -36f; @@ -133,7 +133,7 @@ namespace CalamityMod.NPCs.SulphurousSea else { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/SulphurousSea/Toxicatfish.cs b/NPCs/SulphurousSea/Toxicatfish.cs index 93de02fe43..10f1f085e9 100644 --- a/NPCs/SulphurousSea/Toxicatfish.cs +++ b/NPCs/SulphurousSea/Toxicatfish.cs @@ -15,7 +15,7 @@ namespace CalamityMod.NPCs.SulphurousSea { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 4; + Main.npcFrameCount[Type] = 4; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers(); value.Position.X += 10f; NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; @@ -89,7 +89,7 @@ namespace CalamityMod.NPCs.SulphurousSea return; } NPC.frameCounter += NPC.chaseable ? 0.15f : 0.075f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/SulphurousSea/Trasher.cs b/NPCs/SulphurousSea/Trasher.cs index fb4afc37b8..d289e3d104 100644 --- a/NPCs/SulphurousSea/Trasher.cs +++ b/NPCs/SulphurousSea/Trasher.cs @@ -19,7 +19,7 @@ namespace CalamityMod.NPCs.SulphurousSea public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 8; + Main.npcFrameCount[Type] = 8; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { SpriteDirection = 1, diff --git a/NPCs/SunkenSea/AlphaSeaMinnow.cs b/NPCs/SunkenSea/AlphaSeaMinnow.cs index dd4fca62ae..58d3a2aeff 100644 --- a/NPCs/SunkenSea/AlphaSeaMinnow.cs +++ b/NPCs/SunkenSea/AlphaSeaMinnow.cs @@ -16,9 +16,9 @@ namespace CalamityMod.NPCs.SunkenSea { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 8; - Main.npcCatchable[NPC.type] = true; - NPCID.Sets.CountsAsCritter[NPC.type] = true; + Main.npcFrameCount[Type] = 8; + Main.npcCatchable[Type] = true; + NPCID.Sets.CountsAsCritter[Type] = true; } public override void SetDefaults() @@ -168,7 +168,7 @@ namespace CalamityMod.NPCs.SunkenSea return; } NPC.frameCounter += 0.1f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -194,9 +194,9 @@ namespace CalamityMod.NPCs.SunkenSea { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 8; - Main.npcCatchable[NPC.type] = true; - NPCID.Sets.CountsAsCritter[NPC.type] = true; + Main.npcFrameCount[Type] = 8; + Main.npcCatchable[Type] = true; + NPCID.Sets.CountsAsCritter[Type] = true; this.HideFromBestiary(); } public override void SetDefaults() diff --git a/NPCs/SunkenSea/BabyGhostBell.cs b/NPCs/SunkenSea/BabyGhostBell.cs index 4e4e07ada1..bfa05e9ab3 100644 --- a/NPCs/SunkenSea/BabyGhostBell.cs +++ b/NPCs/SunkenSea/BabyGhostBell.cs @@ -51,9 +51,9 @@ namespace CalamityMod.NPCs.SunkenSea RedTexture = ModContent.Request("CalamityMod/NPCs/SunkenSea/BabyGhostBellRed", AssetRequestMode.ImmediateLoad).Value; GoldTexture = ModContent.Request("CalamityMod/NPCs/SunkenSea/BabyGhostBellGold", AssetRequestMode.ImmediateLoad).Value; } - Main.npcFrameCount[NPC.type] = 6; - Main.npcCatchable[NPC.type] = true; - NPCID.Sets.CountsAsCritter[NPC.type] = true; + Main.npcFrameCount[Type] = 6; + Main.npcCatchable[Type] = true; + NPCID.Sets.CountsAsCritter[Type] = true; } public override void SetDefaults() @@ -245,7 +245,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -292,7 +292,7 @@ namespace CalamityMod.NPCs.SunkenSea if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; switch (Variant) { case (int)JellyColor.Red: @@ -311,9 +311,9 @@ namespace CalamityMod.NPCs.SunkenSea texture = GoldTexture; break; } - Vector2 origin = new Vector2(texture.Width / 2, texture.Height / Main.npcFrameCount[NPC.type] / 2); + Vector2 origin = new Vector2(texture.Width / 2, texture.Height / Main.npcFrameCount[Type] / 2); Vector2 npcOffset = NPC.Center - screenPos; - npcOffset -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + npcOffset -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; npcOffset += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, npcOffset, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, origin, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/SunkenSea/BlindedAngler.cs b/NPCs/SunkenSea/BlindedAngler.cs index 9c25ad171b..3bf3fb1d27 100644 --- a/NPCs/SunkenSea/BlindedAngler.cs +++ b/NPCs/SunkenSea/BlindedAngler.cs @@ -1,7 +1,7 @@ using System.IO; using CalamityMod.BiomeManagers; -using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Items.Weapons.Melee; using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; using Microsoft.Xna.Framework; @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); @@ -84,7 +84,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void FindFrame(int frameHeight) { NPC.frameCounter += (NPC.wet || NPC.IsABestiaryIconDummy) ? 0.15f : 0f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -97,9 +97,9 @@ namespace CalamityMod.NPCs.SunkenSea spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); Vector2 vector = center - screenPos; - vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; + vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[Type])) * 1f / 2f; vector += halfSizeTexture * 1f + new Vector2(0f, 4f + NPC.gfxOffY); Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightBlue); Main.spriteBatch.Draw(GlowTexture.Value, vector, diff --git a/NPCs/SunkenSea/Clam.cs b/NPCs/SunkenSea/Clam.cs index 8dab8e3ca5..f1215cedbe 100644 --- a/NPCs/SunkenSea/Clam.cs +++ b/NPCs/SunkenSea/Clam.cs @@ -1,8 +1,8 @@ using System.IO; using CalamityMod.BiomeManagers; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.SunkenSea; using Terraria; using Terraria.GameContent.Bestiary; using Terraria.ID; @@ -18,7 +18,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { SpriteDirection = 1 diff --git a/NPCs/SunkenSea/EutrophicRay.cs b/NPCs/SunkenSea/EutrophicRay.cs index 334bda0bf2..d220440e7f 100644 --- a/NPCs/SunkenSea/EutrophicRay.cs +++ b/NPCs/SunkenSea/EutrophicRay.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers(); value.Position.X += 24f; NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; @@ -176,7 +176,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void FindFrame(int frameHeight) { NPC.frameCounter += (hasBeenHit || NPC.IsABestiaryIconDummy) ? 0.15f : 0f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -189,9 +189,9 @@ namespace CalamityMod.NPCs.SunkenSea spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); Vector2 vector = center - screenPos; - vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; + vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[Type])) * 1f / 2f; vector += halfSizeTexture * 1f + new Vector2(0f, 4f + NPC.gfxOffY); Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightBlue); Main.spriteBatch.Draw(GlowTexture.Value, vector, diff --git a/NPCs/SunkenSea/FesteringRemains.cs b/NPCs/SunkenSea/FesteringRemains.cs index 79ed3911fb..72137b1c30 100644 --- a/NPCs/SunkenSea/FesteringRemains.cs +++ b/NPCs/SunkenSea/FesteringRemains.cs @@ -140,7 +140,7 @@ namespace CalamityMod.NPCs.SunkenSea public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.Player.Calamity().ZoneSunkenSeaShores && !spawnInfo.Water && !spawnInfo.Player.Calamity().clamity) + if (spawnInfo.Player.Calamity().ZoneTimelessShores && !spawnInfo.Water && !spawnInfo.Player.Calamity().clamity) { return SpawnCondition.Cavern.Chance * 0.6f; } diff --git a/NPCs/SunkenSea/GhostBell.cs b/NPCs/SunkenSea/GhostBell.cs index 576696982a..156617ae6c 100644 --- a/NPCs/SunkenSea/GhostBell.cs +++ b/NPCs/SunkenSea/GhostBell.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; if (!Main.dedServ) { GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); @@ -129,7 +129,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.1f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -151,9 +151,9 @@ namespace CalamityMod.NPCs.SunkenSea spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); Vector2 vector = center - screenPos; - vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; + vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[Type])) * 1f / 2f; vector += halfSizeTexture * 1f + new Vector2(0f, 4f + NPC.gfxOffY); Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightBlue); Main.spriteBatch.Draw(GlowTexture.Value, vector, diff --git a/NPCs/SunkenSea/GiantClam.cs b/NPCs/SunkenSea/GiantClam.cs index 081310a693..0275eb3ed0 100644 --- a/NPCs/SunkenSea/GiantClam.cs +++ b/NPCs/SunkenSea/GiantClam.cs @@ -4,9 +4,9 @@ using CalamityMod.BiomeManagers; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Furniture.BossRelics; using CalamityMod.Items.Placeables.Furniture.Trophies; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; @@ -42,7 +42,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 12; + Main.npcFrameCount[Type] = 12; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -516,20 +516,20 @@ namespace CalamityMod.NPCs.SunkenSea public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; Main.EntitySpriteDraw(texture, NPC.Center - screenPos, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, NPC.frame.Size() * 0.5f, NPC.scale, 0, 0); return false; } public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; Texture2D glowmask = GlowTexture.Value; SpriteEffects spriteEffects = SpriteEffects.None; Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 halfSizeTexture = new Vector2((float)(texture.Width / 2), (float)(texture.Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 halfSizeTexture = new Vector2((float)(texture.Width / 2), (float)(texture.Height / Main.npcFrameCount[Type] / 2)); Vector2 vector = center - screenPos; - vector -= new Vector2((float)glowmask.Width, (float)(glowmask.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; + vector -= new Vector2((float)glowmask.Width, (float)(glowmask.Height / Main.npcFrameCount[Type])) * 1f / 2f; vector += halfSizeTexture * 1f + new Vector2(0f, 4f + NPC.gfxOffY); Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightBlue); Main.EntitySpriteDraw(glowmask, vector, NPC.frame, color, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0); diff --git a/NPCs/SunkenSea/HauntedChum.cs b/NPCs/SunkenSea/HauntedChum.cs index 68ee6f28cc..57434671d4 100644 --- a/NPCs/SunkenSea/HauntedChum.cs +++ b/NPCs/SunkenSea/HauntedChum.cs @@ -300,7 +300,7 @@ namespace CalamityMod.NPCs.SunkenSea } // Draw the chum itself and its jaw, rotated by localai[0] - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; Vector2 origin = new Vector2(texture.Width / 2, texture.Height / 2); Vector2 jawOrigin = new Vector2(NPC.spriteDirection == 1 ? jawTexture.Width - 22 : 22, 4); Vector2 npcOffset = NPC.Center - screenPos; diff --git a/NPCs/SunkenSea/Jellyghoul.cs b/NPCs/SunkenSea/Jellyghoul.cs index 278b088890..881e89594a 100644 --- a/NPCs/SunkenSea/Jellyghoul.cs +++ b/NPCs/SunkenSea/Jellyghoul.cs @@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 1; + Main.npcFrameCount[Type] = 1; } public override void SetDefaults() @@ -141,7 +141,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -225,14 +225,14 @@ namespace CalamityMod.NPCs.SunkenSea spriteBatch.End(); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - Texture2D texture = TextureAssets.Npc[NPC.type].Value; - Vector2 origin = new Vector2((float)(texture.Width / 2), (float)(texture.Height / Main.npcFrameCount[NPC.type] / 2)); + Texture2D texture = TextureAssets.Npc[Type].Value; + Vector2 origin = new Vector2((float)(texture.Width / 2), (float)(texture.Height / Main.npcFrameCount[Type] / 2)); // Rotate back and forth like a bell float rotation = NPC.rotation + MathF.Sin(Main.GlobalTimeWrappedHourly + NPC.localAI[1]) * rotationMultiplier; Vector2 npcOffset = NPC.Center - screenPos; - npcOffset -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + npcOffset -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; npcOffset += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); // Draws transparent clones around itself to look woozy diff --git a/NPCs/SunkenSea/KelpieSeadragon.cs b/NPCs/SunkenSea/KelpieSeadragon.cs index 10b9e74b71..7b5bcf3b6c 100644 --- a/NPCs/SunkenSea/KelpieSeadragon.cs +++ b/NPCs/SunkenSea/KelpieSeadragon.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.SunkenSea public ref float SquishY => ref NPC.localAI[1]; public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 13; + Main.npcFrameCount[Type] = 13; } public override void SetDefaults() diff --git a/NPCs/SunkenSea/LostShoal.cs b/NPCs/SunkenSea/LostShoal.cs index 45b1f2a6e6..637c73092e 100644 --- a/NPCs/SunkenSea/LostShoal.cs +++ b/NPCs/SunkenSea/LostShoal.cs @@ -37,15 +37,15 @@ namespace CalamityMod.NPCs.SunkenSea public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 8; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 8; + NPCID.Sets.TrailingMode[Type] = 1; if (!Main.dedServ) { RedTexture = ModContent.Request("CalamityMod/NPCs/SunkenSea/LostShoalRed", AssetRequestMode.ImmediateLoad).Value; BlueTexture = ModContent.Request("CalamityMod/NPCs/SunkenSea/LostShoalBlue", AssetRequestMode.ImmediateLoad).Value; GoldTexture = ModContent.Request("CalamityMod/NPCs/SunkenSea/LostShoalGold", AssetRequestMode.ImmediateLoad).Value; } - NPCID.Sets.CountsAsCritter[NPC.type] = true; + NPCID.Sets.CountsAsCritter[Type] = true; } public override void SetDefaults() { @@ -328,14 +328,14 @@ namespace CalamityMod.NPCs.SunkenSea public override void FindFrame(int frameHeight) { NPC.frameCounter += 0.2f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.Player.Calamity().ZoneSunkenSeaShores && !spawnInfo.Player.Calamity().clamity && !NPC.AnyNPCs(Type)) + if (spawnInfo.Player.Calamity().ZoneTimelessShores && !spawnInfo.Player.Calamity().clamity && !NPC.AnyNPCs(Type)) { return 0.125f; } @@ -396,7 +396,7 @@ namespace CalamityMod.NPCs.SunkenSea spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); // Regular stuff for drawing the actual fish and its afterimages - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; switch (Variant) { case (int)ShoalColor.Blue: @@ -409,7 +409,7 @@ namespace CalamityMod.NPCs.SunkenSea texture = GoldTexture; break; } - Vector2 origin = new Vector2((float)(texture.Width / 2), (float)(texture.Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 origin = new Vector2((float)(texture.Width / 2), (float)(texture.Height / Main.npcFrameCount[Type] / 2)); Color white = Color.White; float colorLerpAmt = 0.5f; int afterimageAmt = 7; @@ -423,7 +423,7 @@ namespace CalamityMod.NPCs.SunkenSea afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (float)(afterimageAmt - i) / 15f; Vector2 offset = NPC.oldPos[i] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - offset -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + offset -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; offset += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, offset, NPC.frame, afterimageColor, NPC.rotation, origin, NPC.scale, spriteEffects, 0f); } @@ -432,7 +432,7 @@ namespace CalamityMod.NPCs.SunkenSea float sine = MathF.Sin(Main.GlobalTimeWrappedHourly * 3f + RandomOpacityOffset) / 2f + 0.5f; Vector2 npcOffset = NPC.Center - screenPos; - npcOffset -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + npcOffset -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; npcOffset += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, npcOffset, NPC.frame, drawColor * MathHelper.Lerp(0.4f, 0.8f, sine), NPC.rotation, origin, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/SunkenSea/Pearlpod.cs b/NPCs/SunkenSea/Pearlpod.cs index 21ee8886d4..e69ffade75 100644 --- a/NPCs/SunkenSea/Pearlpod.cs +++ b/NPCs/SunkenSea/Pearlpod.cs @@ -125,7 +125,7 @@ namespace CalamityMod.NPCs.SunkenSea public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.Player.Calamity().ZoneSunkenBurrows && spawnInfo.Water && !spawnInfo.Player.Calamity().clamity) + if (spawnInfo.Player.Calamity().ZoneGleamingBurrows && spawnInfo.Water && !spawnInfo.Player.Calamity().clamity) { return SpawnCondition.CaveJellyfish.Chance * SpawnRate; } @@ -150,7 +150,7 @@ namespace CalamityMod.NPCs.SunkenSea { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; } public override int PearlType => ItemID.WhitePearl; public override float SpawnRate => 0.6f; @@ -161,7 +161,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; } public override int PearlType => ItemID.PinkPearl; @@ -173,7 +173,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; } public override int PearlType => ItemID.BlackPearl; public override float SpawnRate => 0.05f; @@ -184,7 +184,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; } public override void SetDefaults() { diff --git a/NPCs/SunkenSea/PolypPanasea.cs b/NPCs/SunkenSea/PolypPanasea.cs index d1c14b8688..fb5c240400 100644 --- a/NPCs/SunkenSea/PolypPanasea.cs +++ b/NPCs/SunkenSea/PolypPanasea.cs @@ -43,7 +43,7 @@ namespace CalamityMod.NPCs.SunkenSea } public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; if (!Main.dedServ) { RadiantTexture = ModContent.Request("CalamityMod/NPCs/SunkenSea/PolypPanaseaRadiant", AssetRequestMode.ImmediateLoad).Value; @@ -58,8 +58,8 @@ namespace CalamityMod.NPCs.SunkenSea PurpleTextureCoated = ModContent.Request("CalamityMod/NPCs/SunkenSea/PolypPanaseaPurpleCoated", AssetRequestMode.ImmediateLoad).Value; TurquoiseTextureCoated = ModContent.Request("CalamityMod/NPCs/SunkenSea/PolypPanaseaTurquoiseCoated", AssetRequestMode.ImmediateLoad).Value; } - Main.npcCatchable[NPC.type] = true; - NPCID.Sets.CountsAsCritter[NPC.type] = true; + Main.npcCatchable[Type] = true; + NPCID.Sets.CountsAsCritter[Type] = true; } public override void SetDefaults() @@ -162,7 +162,7 @@ namespace CalamityMod.NPCs.SunkenSea return; } NPC.frameCounter += 0.1f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; NPC.ai[3] = frame; @@ -170,7 +170,7 @@ namespace CalamityMod.NPCs.SunkenSea public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.Player.Calamity().ZoneSunkenSeaPolyp && spawnInfo.Water && !spawnInfo.Player.Calamity().clamity) + if (spawnInfo.Player.Calamity().ZonePolypForest && spawnInfo.Water && !spawnInfo.Player.Calamity().clamity) { return SpawnCondition.CaveJellyfish.Chance * 0.6f; } @@ -190,7 +190,7 @@ namespace CalamityMod.NPCs.SunkenSea if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; switch (Variant) { case (int)FishColor.Radiant: @@ -209,12 +209,12 @@ namespace CalamityMod.NPCs.SunkenSea texture = NPC.ai[2] >= 61 ? TurquoiseTextureCoated : TurquoiseTexture; break; case (int)FishColor.Red: - texture = NPC.ai[2] >= 61 ? TextureCoated : TextureAssets.Npc[NPC.type].Value; + texture = NPC.ai[2] >= 61 ? TextureCoated : TextureAssets.Npc[Type].Value; break; } - Vector2 origin = new Vector2((float)(texture.Width / 2), (float)(texture.Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 origin = new Vector2((float)(texture.Width / 2), (float)(texture.Height / Main.npcFrameCount[Type] / 2)); Vector2 npcOffset = NPC.Center - screenPos; - npcOffset -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + npcOffset -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; npcOffset += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); Rectangle frame = texture.Frame(1, 6, 0, (int)NPC.ai[3]); spriteBatch.Draw(texture, npcOffset, frame, NPC.GetAlpha(drawColor), NPC.rotation, origin, NPC.scale, spriteEffects, 0f); diff --git a/NPCs/SunkenSea/PrismBack.cs b/NPCs/SunkenSea/PrismBack.cs index c83b9bfeee..1e643cb782 100644 --- a/NPCs/SunkenSea/PrismBack.cs +++ b/NPCs/SunkenSea/PrismBack.cs @@ -1,6 +1,5 @@ using System.IO; using CalamityMod.BiomeManagers; -using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Banners; using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; using CalamityMod.World; @@ -15,6 +14,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; using ReLogic.Content; +using CalamityMod.Items.Placeables.SunkenSea; namespace CalamityMod.NPCs.SunkenSea { @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { PortraitPositionXOverride = 0 @@ -131,7 +131,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void FindFrame(int frameHeight) { NPC.frameCounter += (NPC.wet || NPC.IsABestiaryIconDummy) ? 0.1f : 0f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -144,9 +144,9 @@ namespace CalamityMod.NPCs.SunkenSea spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 center = new Vector2(NPC.Center.X, NPC.Center.Y); - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); Vector2 vector = center - screenPos; - vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[NPC.type])) * 1f / 2f; + vector -= new Vector2((float)GlowTexture.Value.Width, (float)(GlowTexture.Value.Height / Main.npcFrameCount[Type])) * 1f / 2f; vector += halfSizeTexture * 1f + new Vector2(0f, 4f + NPC.gfxOffY); Color color = new Color(127 - NPC.alpha, 127 - NPC.alpha, 127 - NPC.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.Blue); Main.spriteBatch.Draw(GlowTexture.Value, vector, diff --git a/NPCs/SunkenSea/Probesnout.cs b/NPCs/SunkenSea/Probesnout.cs index 02b604a301..6d5dfd22aa 100644 --- a/NPCs/SunkenSea/Probesnout.cs +++ b/NPCs/SunkenSea/Probesnout.cs @@ -1,14 +1,13 @@ using System; using System.Collections.Generic; using System.IO; -using CalamityMod.BiomeManagers; +using CalamityMod.Enums; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.GameContent; using Terraria.ID; -using Terraria.ModLoader; using Terraria.Utilities; using static Terraria.ModLoader.ModContent; @@ -76,6 +75,10 @@ namespace CalamityMod.NPCs.SunkenSea } } + protected override SunkenSeaBiomeFlags BiomeDesignation => SunkenSeaBiomeFlags.RadiantReefs; + + protected override float SpawningChance => 0f; + private int AnimationFrames = 8; private int TimePerAnimationFrame = 5; @@ -88,7 +91,7 @@ namespace CalamityMod.NPCs.SunkenSea #region AI - protected override void CreatureOnSpawn() + protected override void BehaviorOnSpawn() { CurrentBehavior = IdleBehavior; @@ -279,8 +282,9 @@ namespace CalamityMod.NPCs.SunkenSea #region Other ModNPC Overrides - protected override void ExtraSetStaticDefaults() + public override void SetStaticDefaults() { + base.SetStaticDefaults(); Main.npcFrameCount[Type] = 15; Main.npcCatchable[Type] = true; NPCID.Sets.CountsAsCritter[Type] = true; @@ -288,6 +292,8 @@ namespace CalamityMod.NPCs.SunkenSea public override void SetDefaults() { + base.SetDefaults(); + NPC.lifeMax = 5; NPC.aiStyle = -1; @@ -298,22 +304,22 @@ namespace CalamityMod.NPCs.SunkenSea NPC.width = 44; NPC.height = 55; - - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; } #endregion #region Syncing - protected override void SendMoreExtraAI(BinaryWriter writer) + public override void SendExtraAI(BinaryWriter writer) { + base.SendExtraAI(writer); writer.Write7BitEncodedInt(AnimationFrames); writer.Write7BitEncodedInt(TimePerAnimationFrame); } - protected override void ReceiveMoreExtraAI(BinaryReader reader) + public override void ReceiveExtraAI(BinaryReader reader) { + base.ReceiveExtraAI(reader); AnimationFrames = reader.Read7BitEncodedInt(); TimePerAnimationFrame = reader.Read7BitEncodedInt(); } @@ -323,9 +329,9 @@ namespace CalamityMod.NPCs.SunkenSea public class ProbesnoutGold : Probesnout { - protected override void ExtraSetStaticDefaults() + public override void SetStaticDefaults() { - base.ExtraSetStaticDefaults(); + base.SetStaticDefaults(); this.HideFromBestiary(); } diff --git a/NPCs/SunkenSea/SandProwlerNested.cs b/NPCs/SunkenSea/SandProwlerNested.cs index 12ae5ed946..bcee5bc704 100644 --- a/NPCs/SunkenSea/SandProwlerNested.cs +++ b/NPCs/SunkenSea/SandProwlerNested.cs @@ -56,9 +56,9 @@ namespace CalamityMod.NPCs.SunkenSea public override void SetStaticDefaults() { this.HideFromBestiary(); - NPCID.Sets.TrailingMode[NPC.type] = 0; - NPCID.Sets.TrailCacheLength[NPC.type] = 60; - NPCID.Sets.UsesNewTargetting[NPC.type] = true; + NPCID.Sets.TrailingMode[Type] = 0; + NPCID.Sets.TrailCacheLength[Type] = 60; + NPCID.Sets.UsesNewTargetting[Type] = true; NPCID.Sets.CantTakeLunchMoney[Type] = true; Main.npcFrameCount[Type] = 11; } @@ -447,7 +447,7 @@ namespace CalamityMod.NPCs.SunkenSea public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.Player.Calamity().ZoneSunkenSeaPolyp && spawnInfo.Water && !spawnInfo.Player.Calamity().clamity && !spawnInfo.PlayerSafe) + if (spawnInfo.Player.Calamity().ZonePolypForest && spawnInfo.Water && !spawnInfo.Player.Calamity().clamity && !spawnInfo.PlayerSafe) return SpawnCondition.CaveJellyfish.Chance * 0.3f; return 0f; diff --git a/NPCs/SunkenSea/SeaFloaty.cs b/NPCs/SunkenSea/SeaFloaty.cs index 5d1d30a8af..5446f78115 100644 --- a/NPCs/SunkenSea/SeaFloaty.cs +++ b/NPCs/SunkenSea/SeaFloaty.cs @@ -14,7 +14,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; + Main.npcFrameCount[Type] = 6; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { SpriteDirection = 1 @@ -133,7 +133,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void FindFrame(int frameHeight) { NPC.frameCounter += hasBeenHit ? 0.3f : 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/SunkenSea/SeaMinnow.cs b/NPCs/SunkenSea/SeaMinnow.cs index e18cf5ffc4..c753fb8f07 100644 --- a/NPCs/SunkenSea/SeaMinnow.cs +++ b/NPCs/SunkenSea/SeaMinnow.cs @@ -17,9 +17,9 @@ namespace CalamityMod.NPCs.SunkenSea { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 8; - Main.npcCatchable[NPC.type] = true; - NPCID.Sets.CountsAsCritter[NPC.type] = true; + Main.npcFrameCount[Type] = 8; + Main.npcCatchable[Type] = true; + NPCID.Sets.CountsAsCritter[Type] = true; } public override void SetDefaults() @@ -327,7 +327,7 @@ namespace CalamityMod.NPCs.SunkenSea return; } NPC.frameCounter += 0.15f; - NPC.frameCounter %= Main.npcFrameCount[NPC.type]; + NPC.frameCounter %= Main.npcFrameCount[Type]; int frame = (int)NPC.frameCounter; NPC.frame.Y = frame * frameHeight; } @@ -344,9 +344,9 @@ namespace CalamityMod.NPCs.SunkenSea { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 8; - Main.npcCatchable[NPC.type] = true; - NPCID.Sets.CountsAsCritter[NPC.type] = true; + Main.npcFrameCount[Type] = 8; + Main.npcCatchable[Type] = true; + NPCID.Sets.CountsAsCritter[Type] = true; this.HideFromBestiary(); } public override void SetDefaults() diff --git a/NPCs/SunkenSea/Sharkoon.cs b/NPCs/SunkenSea/Sharkoon.cs index 7aa20278c8..674a9733ec 100644 --- a/NPCs/SunkenSea/Sharkoon.cs +++ b/NPCs/SunkenSea/Sharkoon.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.IO; -using CalamityMod.BiomeManagers; +using CalamityMod.Enums; using CalamityMod.Particles; using CalamityMod.Projectiles.Enemy; using Microsoft.Xna.Framework; @@ -10,7 +10,6 @@ using Terraria; using Terraria.Audio; using Terraria.GameContent; using Terraria.ID; -using Terraria.ModLoader; using Terraria.ModLoader.Utilities; using Terraria.Utilities; using static Terraria.ModLoader.ModContent; @@ -152,6 +151,10 @@ namespace CalamityMod.NPCs.SunkenSea /// private bool IsExploding => CurrentBehavior == ExplodingBehavior; + protected override SunkenSeaBiomeFlags BiomeDesignation => SunkenSeaBiomeFlags.RadiantReefs; + + protected override float SpawningChance => SpawnCondition.CaveJellyfish.Chance * 0.9f; + /// /// The squish of this NPC while drawing. /// @@ -161,10 +164,16 @@ namespace CalamityMod.NPCs.SunkenSea #region Other Overridden Methods - protected override void ExtraSetStaticDefaults() => Main.npcFrameCount[Type] = 16; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + Main.npcFrameCount[Type] = 16; + } public override void SetDefaults() { + base.SetDefaults(); + NPC.damage = 20; NPC.lifeMax = 350; NPC.defense = 5; @@ -183,23 +192,12 @@ namespace CalamityMod.NPCs.SunkenSea // Banner = NPC.type; // BannerItem = ModContent.ItemType(); - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - if (spawnInfo.Player.Calamity().ZoneSunkenSea && spawnInfo.Water && !spawnInfo.Player.Calamity().clamity) - { - return SpawnCondition.CaveJellyfish.Chance * 0.9f; - } - return 0f; - } - public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 5; k++) @@ -245,7 +243,7 @@ namespace CalamityMod.NPCs.SunkenSea #region AI - protected override void CreatureOnSpawn() + protected override void BehaviorOnSpawn() { CurrentBehavior = IdlingBehavior; @@ -329,7 +327,7 @@ namespace CalamityMod.NPCs.SunkenSea Animation = AnimationState.Explosion; // Resets the timer when it needs to use it again. - if (newBehavior == RecoveringBehavior || PreviousBehavior == RecoveringBehavior) + if (newBehavior == RecoveringBehavior || CurrentBehavior == RecoveringBehavior) RecoverTimer = 0f; // When it gets outside of water, it'll try to gravitate downards towards the water. @@ -531,7 +529,7 @@ namespace CalamityMod.NPCs.SunkenSea { if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectileDirect( + Projectile.NewProjectile( NPC.GetSource_FromThis(), NPC.Center, Vector2.Zero, @@ -617,8 +615,9 @@ namespace CalamityMod.NPCs.SunkenSea #region Syncing - protected override void SendMoreExtraAI(BinaryWriter writer) + public override void SendExtraAI(BinaryWriter writer) { + base.SendExtraAI(writer); writer.Write7BitEncodedInt(AnimationFrames); writer.Write7BitEncodedInt(TimePerAnimationFrame); writer.Write(AnimationLoop); @@ -626,8 +625,9 @@ namespace CalamityMod.NPCs.SunkenSea writer.Write7BitEncodedInt(RandomIdleMovementUnlikeliness); } - protected override void ReceiveMoreExtraAI(BinaryReader reader) + public override void ReceiveExtraAI(BinaryReader reader) { + base.ReceiveExtraAI(reader); AnimationFrames = reader.Read7BitEncodedInt(); TimePerAnimationFrame = reader.Read7BitEncodedInt(); AnimationLoop = reader.ReadBoolean(); diff --git a/NPCs/SunkenSea/SunkenSeaNPC.cs b/NPCs/SunkenSea/SunkenSeaNPC.cs index 7d230ff9c8..e72a35eaf9 100644 --- a/NPCs/SunkenSea/SunkenSeaNPC.cs +++ b/NPCs/SunkenSea/SunkenSeaNPC.cs @@ -1,14 +1,16 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; +using CalamityMod.Enums; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; -using Terraria.DataStructures; using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; +using static CalamityMod.CalamityLists; using static Terraria.Utilities.NPCUtils; namespace CalamityMod.NPCs.SunkenSea @@ -21,16 +23,6 @@ namespace CalamityMod.NPCs.SunkenSea { #region Fields & Properties - /// - /// A list which stores the NPC's IDs that this creature hunts. - /// - protected abstract List HuntNPCs { get; } - - /// - /// A list which stores the NPC's IDs that this creature avoids. - /// - protected abstract List AvoidNPCs { get; } - /// /// Since a lot of these NPCs change behaviors a lot, this abstract class provides an property to store and trigger behaviors.
/// Automatically resets and to not cause errors. @@ -40,11 +32,14 @@ namespace CalamityMod.NPCs.SunkenSea get => _currentBehavior; set { - PreviousBehavior = _currentBehavior; + OnBehaviorChange(value); + PathfindingPoints = null; PathPointIndex = 0; - OnBehaviorChange(value); + + PreviousBehavior = _currentBehavior; _currentBehavior = value; + NetUpdate(); } } @@ -55,6 +50,34 @@ namespace CalamityMod.NPCs.SunkenSea ///
protected Action PreviousBehavior { get; private set; } + /// + /// A lot of these Sunken Sea creatures use the pathfinding algorithm,
+ /// so this abstract class provides a so you can store the paths.
+ /// Defaults to . + ///
+ protected List PathfindingPoints { get; set; } + + /// + /// The probablity that this Sunken Sea NPC spawns given the conditions. + /// + protected abstract float SpawningChance { get; } + + protected int PathPointIndex { get; set; } + + private bool _hasSpawned; + + #region Targetting + + /// + /// A list which stores the NPC's IDs that this creature hunts. + /// + protected abstract List HuntNPCs { get; } + + /// + /// A list which stores the NPC's IDs that this creature avoids. + /// + protected abstract List AvoidNPCs { get; } + /// /// The current NPC that this creature has detected as prey. /// @@ -108,11 +131,6 @@ namespace CalamityMod.NPCs.SunkenSea /// protected Entity NearestEntity { get; private set; } - /// - /// Whether or not the creature has detected anything at all. - /// - protected bool HasAnyTargets => CurrentPrey != null || CurrentPredator != null || CurrentPlayer != null; - /// /// The distance detection radius.
/// Defaults to 300 pixels. @@ -148,48 +166,69 @@ namespace CalamityMod.NPCs.SunkenSea /// Defaults to 3 seconds. ///
protected virtual float PermanenceSenseTime => CalamityUtils.SecondsToFrames(3f); - private int _permanenceSenseTimer; /// - /// A lot of these Sunken Sea creatures use the pathfinding algorithm,
- /// so this abstract class provides a so you can store the paths.
- /// Defaults to . + /// Whether or not the creature has detected anything at all. ///
- protected List PathfindingPoints { get; set; } + protected bool HasAnyTargets => CurrentPrey != null || CurrentPredator != null || CurrentPlayer != null; - - protected int PathPointIndex { get; set; } + #endregion - private bool _hasSpawned; + #region Biome Designation + + /// + /// The biomes that this Sunken Sea NPC belongs to. + /// + protected abstract SunkenSeaBiomeFlags BiomeDesignation { get; } + + /// + /// The spawn conditions for each biome that this Sunken Sea NPC belongs to. + /// + protected List> BiomeSpawnConditions { get; private set; } = []; + + #endregion #endregion #region ModNPC Overrides - public sealed override void SetStaticDefaults() + public override void SetStaticDefaults() { NPCID.Sets.UsesNewTargetting[Type] = true; NPCID.Sets.TakesDamageFromHostilesWithoutBeingFriendly[Type] = true; - ExtraSetStaticDefaults(); } - public sealed override void OnSpawn(IEntitySource source) { } - - public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) + public override void SetDefaults() { - bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] + List biomeTypes = []; + foreach (var flag in Enum.GetValues()) { - new FlavorTextBestiaryInfoElement($"Mods.CalamityMod.Bestiary.{Name}") - }); + if (flag == SunkenSeaBiomeFlags.None || !BiomeDesignation.HasFlag(flag)) + continue; + BiomeSpawnConditions.Add(SunkenSeaBiomeCorrespondentValues[flag].SpawnCondition); + if (flag == SunkenSeaBiomeFlags.UndergroundDesert) + continue; + biomeTypes.Add(SunkenSeaBiomeCorrespondentValues[flag].BiomeType); + } + SpawnModBiomes = [.. biomeTypes]; + } + + public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) => bestiaryEntry.Info.AddRange([new FlavorTextBestiaryInfoElement($"Mods.CalamityMod.Bestiary.{Name}")]); + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (BiomeSpawnConditions.Any(f => f.Invoke(spawnInfo)) && spawnInfo.Water && !spawnInfo.Player.Calamity().clamity) + return SpawningChance; + return 0f; } public sealed override void AI() { if (!_hasSpawned) { - CreatureOnSpawn(); _coneDetectionDirection = Vector2.UnitX * NPC.direction; + BehaviorOnSpawn(); _hasSpawned = true; NetUpdate(); } @@ -204,15 +243,9 @@ namespace CalamityMod.NPCs.SunkenSea #region Methods /// - /// Same function as , and since that one's for safety purposes,
- /// this method serves the same. + /// Same function as OnSpawn, but this one actually syncs to the server. ///
- protected virtual void ExtraSetStaticDefaults() { } - - /// - /// Same function as , but this one actually syncs to the server. - /// - protected virtual void CreatureOnSpawn() { } + protected virtual void BehaviorOnSpawn() { } /// /// A method that is called on every frame, to put your actual enemy AI. @@ -392,7 +425,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.netSpam = netSpam; } - public sealed override void SendExtraAI(BinaryWriter writer) + public override void SendExtraAI(BinaryWriter writer) { writer.Write7BitEncodedInt(CurrentPrey.whoAmI); writer.Write7BitEncodedInt(CurrentPredator.whoAmI); @@ -410,11 +443,9 @@ namespace CalamityMod.NPCs.SunkenSea writer.Write7BitEncodedInt(PathPointIndex); writer.Write(_hasSpawned); - - SendMoreExtraAI(writer); } - public sealed override void ReceiveExtraAI(BinaryReader reader) + public override void ReceiveExtraAI(BinaryReader reader) { CurrentPrey.whoAmI = reader.Read7BitEncodedInt(); CurrentPredator.whoAmI = reader.Read7BitEncodedInt(); @@ -432,22 +463,8 @@ namespace CalamityMod.NPCs.SunkenSea PathPointIndex = reader.Read7BitEncodedInt(); _hasSpawned = reader.ReadBoolean(); - - ReceiveMoreExtraAI(reader); } - /// - /// Same function as , but since that one already sends information and to avoid accidents,
- /// is and instead this is available. - ///
- protected virtual void SendMoreExtraAI(BinaryWriter writer) { } - - /// - /// Same function as , but since that one already sends information and to avoid accidents,
- /// is and instead this is available. - ///
- protected virtual void ReceiveMoreExtraAI(BinaryReader reader) { } - #endregion } } diff --git a/NPCs/SupremeCalamitas/BrimstoneHeart.cs b/NPCs/SupremeCalamitas/BrimstoneHeart.cs index 7ed262a922..bae53cbcbc 100644 --- a/NPCs/SupremeCalamitas/BrimstoneHeart.cs +++ b/NPCs/SupremeCalamitas/BrimstoneHeart.cs @@ -19,8 +19,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override void SetStaticDefaults() { this.HideFromBestiary(); - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; - Main.npcFrameCount[NPC.type] = 6; + NPCID.Sets.NeedsExpertScaling[Type] = true; + Main.npcFrameCount[Type] = 6; } public override void SetDefaults() @@ -100,9 +100,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (NPC.IsABestiaryIconDummy) NPC.Opacity = 1f; - int frame = (int)Math.Round((float)Math.Pow(Math.Sin(Main.GlobalTimeWrappedHourly * 2.6f + NPC.whoAmI * 1.3f), 6D) * Main.npcFrameCount[NPC.type]); - if (frame >= Main.npcFrameCount[NPC.type]) - frame = Main.npcFrameCount[NPC.type] - 1; + int frame = (int)Math.Round((float)Math.Pow(Math.Sin(Main.GlobalTimeWrappedHourly * 2.6f + NPC.whoAmI * 1.3f), 6D) * Main.npcFrameCount[Type]); + if (frame >= Main.npcFrameCount[Type]) + frame = Main.npcFrameCount[Type] - 1; NPC.frame.Y = frame * frameHeight; } diff --git a/NPCs/SupremeCalamitas/SepulcherArm.cs b/NPCs/SupremeCalamitas/SepulcherArm.cs index 4c7d0be1fa..e68ca7c25f 100644 --- a/NPCs/SupremeCalamitas/SepulcherArm.cs +++ b/NPCs/SupremeCalamitas/SepulcherArm.cs @@ -184,7 +184,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor_Unused) { - Texture2D armTexture = TextureAssets.Npc[NPC.type].Value; + Texture2D armTexture = TextureAssets.Npc[Type].Value; Texture2D foreArmTexture = ForearmTexture.Value; Texture2D handTexture = HandTexture.Value; diff --git a/NPCs/SupremeCalamitas/SepulcherBody.cs b/NPCs/SupremeCalamitas/SepulcherBody.cs index e42d75f428..6778daf3d9 100644 --- a/NPCs/SupremeCalamitas/SepulcherBody.cs +++ b/NPCs/SupremeCalamitas/SepulcherBody.cs @@ -128,8 +128,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = NPC.localAI[3] / 2f % 2f == 0f ? AltTexture.Value : TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / 2)); + Texture2D texture2D15 = NPC.localAI[3] / 2f % 2f == 0f ? AltTexture.Value : TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / 2)); Vector2 drawLocation = NPC.Center - screenPos; drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * NPC.scale / 2f; diff --git a/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs b/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs index 86b4d8ba2b..32fd48411e 100644 --- a/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs +++ b/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs @@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override void SetStaticDefaults() { this.HideFromBestiary(); - Main.npcFrameCount[NPC.type] = 5; + Main.npcFrameCount[Type] = 5; } public override void SetDefaults() @@ -142,7 +142,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override void FindFrame(int frameHeight) { NPC.frameCounter++; - NPC.frame.Y = ((int)(NPC.frameCounter / 5) + NPC.whoAmI) % Main.npcFrameCount[NPC.type] * frameHeight; + NPC.frame.Y = ((int)(NPC.frameCounter / 5) + NPC.whoAmI) % Main.npcFrameCount[Type] * frameHeight; } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/SupremeCalamitas/SepulcherHead.cs b/NPCs/SupremeCalamitas/SepulcherHead.cs index 691de2e505..4be779a2fb 100644 --- a/NPCs/SupremeCalamitas/SepulcherHead.cs +++ b/NPCs/SupremeCalamitas/SepulcherHead.cs @@ -371,8 +371,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / 2)); Vector2 drawLocation = NPC.Center - screenPos; drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * NPC.scale / 2f; diff --git a/NPCs/SupremeCalamitas/SepulcherTail.cs b/NPCs/SupremeCalamitas/SepulcherTail.cs index 53cc0fd247..ea920d025f 100644 --- a/NPCs/SupremeCalamitas/SepulcherTail.cs +++ b/NPCs/SupremeCalamitas/SepulcherTail.cs @@ -162,8 +162,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / 2)); Vector2 drawLocation = NPC.Center - screenPos; drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * NPC.scale / 2f; diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index f5a4aad638..2bf50c9b9c 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -36,9 +36,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 6; - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 6; + NPCID.Sets.NeedsExpertScaling[Type] = true; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -105,7 +105,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.frameCounter++; if (NPC.frameCounter % 5 == 4) NPC.frame.Y += frameHeight; - if (NPC.frame.Y / frameHeight >= Main.npcFrameCount[NPC.type]) + if (NPC.frame.Y / frameHeight >= Main.npcFrameCount[Type]) NPC.frame.Y = 0; } @@ -268,8 +268,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); int afterimageAmt = 2; if (CalamityClientConfig.Instance.Afterimages) @@ -281,14 +281,14 @@ namespace CalamityMod.NPCs.SupremeCalamitas afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (float)(afterimageAmt - i) / 15f; Vector2 afterimagePos = NPC.oldPos[i] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + afterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } } Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); @@ -303,7 +303,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas redAfterimageColor = Color.Lerp(redAfterimageColor, Color.White, 0.5f); redAfterimageColor *= (float)(afterimageAmt - j) / 15f; Vector2 redAfterimagePos = NPC.oldPos[j] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - redAfterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + redAfterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; redAfterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, redAfterimagePos, NPC.frame, redAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index cf1ea60778..c7a2c4ffe1 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -241,8 +241,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 21; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 21; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -3609,18 +3609,18 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = DownedBossSystem.downedCalamitas && !BossRushEvent.BossRushActive ? TextureAssets.Npc[NPC.type].Value : HoodedTexture.Value; + Texture2D texture2D15 = DownedBossSystem.downedCalamitas && !BossRushEvent.BossRushActive ? TextureAssets.Npc[Type].Value : HoodedTexture.Value; Texture2D pony = ModContent.Request("CalamityMod/Items/Mounts/AlicornMount_Front").Value; bool inPhase2 = NPC.ai[0] >= 3f && (NPC.life > NPC.lifeMax * 0.01 || cirrus); if (cirrus) texture2D15 = inPhase2 ? CirrusTexture2.Value : CirrusTexture.Value; - Vector2 halfSizeTexture = new Vector2(texture2D15.Width / 2f, texture2D15.Height / Main.npcFrameCount[NPC.type] / 2f); + Vector2 halfSizeTexture = new Vector2(texture2D15.Width / 2f, texture2D15.Height / Main.npcFrameCount[Type] / 2f); Vector2 ponyOrigin = new Vector2(pony.Width / 2f, pony.Height / 30f); int afterimageAmt = 7; - Rectangle frame = texture2D15.Frame(2, Main.npcFrameCount[NPC.type], NPC.frame.Y / Main.npcFrameCount[NPC.type], NPC.frame.Y % Main.npcFrameCount[NPC.type]); + Rectangle frame = texture2D15.Frame(2, Main.npcFrameCount[Type], NPC.frame.Y / Main.npcFrameCount[Type], NPC.frame.Y % Main.npcFrameCount[Type]); Rectangle ponyFrame = pony.Frame(1, 15, 0, alicornFrame); Vector2 ponyPos = NPC.Center - screenPos; ponyPos -= new Vector2(pony.Width / 2f, pony.Height / 15) * NPC.scale / 2f; @@ -3635,14 +3635,14 @@ namespace CalamityMod.NPCs.SupremeCalamitas afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (afterimageAmt - i) / 15f; Vector2 afterimagePos = NPC.oldPos[i] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2(texture2D15.Width / 2f, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + afterimagePos -= new Vector2(texture2D15.Width / 2f, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, afterimagePos, frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } } Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2(texture2D15.Width / 2f, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawLocation -= new Vector2(texture2D15.Width / 2f, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); if (!(cirrus && NPC.ai[1] == 2f)) diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index a414b15acd..bf96e5dac6 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -58,9 +58,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 9; - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 9; + NPCID.Sets.NeedsExpertScaling[Type] = true; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -138,8 +138,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas CurrentFrame = (int)Math.Round(MathHelper.Lerp(12f, 21f, punchInterpolant)); } - int xFrame = CurrentFrame / Main.npcFrameCount[NPC.type]; - int yFrame = CurrentFrame % Main.npcFrameCount[NPC.type]; + int xFrame = CurrentFrame / Main.npcFrameCount[Type]; + int yFrame = CurrentFrame % Main.npcFrameCount[Type]; NPC.frame.Width = 212; NPC.frame.Height = 208; @@ -471,7 +471,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; Vector2 origin = NPC.frame.Size() * 0.5f; int afterimageCount = 4; diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index 57e9701d1f..34f058b979 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -51,9 +51,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 8; - NPCID.Sets.NeedsExpertScaling[NPC.type] = true; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 8; + NPCID.Sets.NeedsExpertScaling[Type] = true; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -132,8 +132,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas CurrentFrame = (int)Math.Round(MathHelper.Lerp(6f, 15f, slashInterpolant)); } - int xFrame = CurrentFrame / Main.npcFrameCount[NPC.type]; - int yFrame = CurrentFrame % Main.npcFrameCount[NPC.type]; + int xFrame = CurrentFrame / Main.npcFrameCount[Type]; + int yFrame = CurrentFrame % Main.npcFrameCount[Type]; NPC.frame.Width = 400; NPC.frame.Height = 230; @@ -508,7 +508,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[Type].Value; Vector2 origin = NPC.frame.Size() * 0.5f; int afterimageCount = 4; diff --git a/NPCs/TownNPCs/AndroombaFriendly.cs b/NPCs/TownNPCs/AndroombaFriendly.cs index 30516e97c9..f8837a9a2a 100644 --- a/NPCs/TownNPCs/AndroombaFriendly.cs +++ b/NPCs/TownNPCs/AndroombaFriendly.cs @@ -24,8 +24,8 @@ namespace CalamityMod.NPCs.TownNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 9; - Main.npcCatchable[NPC.type] = true; + Main.npcFrameCount[Type] = 9; + Main.npcCatchable[Type] = true; NPCID.Sets.NoTownNPCHappiness[Type] = true; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers(); value.Position.Y += 16; @@ -256,7 +256,7 @@ namespace CalamityMod.NPCs.TownNPCs public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - Texture2D critterTexture = TextureAssets.Npc[NPC.type].Value; + Texture2D critterTexture = TextureAssets.Npc[Type].Value; Texture2D glowmask = FaceTextures[0].Value; // If the solution is from Calamity or vanilla, set the glowmask to grab the appropriate texture from the texture array if (NPC.ai[3] <= 8) diff --git a/NPCs/TownNPCs/DILF.cs b/NPCs/TownNPCs/DILF.cs index d7c510d70a..2452b37cea 100644 --- a/NPCs/TownNPCs/DILF.cs +++ b/NPCs/TownNPCs/DILF.cs @@ -11,6 +11,8 @@ using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Typeless; using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.GameContent.Bestiary; using Terraria.GameContent.Events; @@ -27,13 +29,13 @@ namespace CalamityMod.NPCs.TownNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 25; - NPCID.Sets.ExtraFramesCount[NPC.type] = 9; - NPCID.Sets.AttackFrameCount[NPC.type] = 4; - NPCID.Sets.DangerDetectRange[NPC.type] = 700; - NPCID.Sets.AttackType[NPC.type] = 0; - NPCID.Sets.AttackTime[NPC.type] = 90; - NPCID.Sets.AttackAverageChance[NPC.type] = 30; + Main.npcFrameCount[Type] = 25; + NPCID.Sets.ExtraFramesCount[Type] = 9; + NPCID.Sets.AttackFrameCount[Type] = 4; + NPCID.Sets.DangerDetectRange[Type] = 700; + NPCID.Sets.AttackType[Type] = 0; + NPCID.Sets.AttackTime[Type] = 90; + NPCID.Sets.AttackAverageChance[Type] = 30; NPCID.Sets.ShimmerTownTransform[Type] = false; NPC.Happiness .SetBiomeAffection(AffectionLevel.Like) @@ -125,6 +127,8 @@ namespace CalamityMod.NPCs.TownNPCs return dialogue; } + public override void PartyHatPosition(ref Vector2 position, ref SpriteEffects spriteEffects) => position.X -= 5f * NPC.direction; + public override void SetChatButtons(ref string button, ref string button2) { button = Language.GetTextValue("LegacyInterface.28"); @@ -160,7 +164,7 @@ namespace CalamityMod.NPCs.TownNPCs .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(5)) .Add(ModContent.ItemType()) .Add(ModContent.ItemType(), Condition.PlayerCarriesItem(ModContent.ItemType())) - .Add(ItemID.IceCream, Condition.HappyEnough, Condition.InSnow) + .Add(ItemID.IceCream, Condition.HappyEnoughToSellPylons, Condition.InSnow) .Register(); } diff --git a/NPCs/TownNPCs/FAP.cs b/NPCs/TownNPCs/FAP.cs index de0920664a..8b615ae941 100644 --- a/NPCs/TownNPCs/FAP.cs +++ b/NPCs/TownNPCs/FAP.cs @@ -33,13 +33,13 @@ namespace CalamityMod.NPCs.TownNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 27; - NPCID.Sets.ExtraFramesCount[NPC.type] = 9; - NPCID.Sets.AttackFrameCount[NPC.type] = 4; - NPCID.Sets.DangerDetectRange[NPC.type] = 400; - NPCID.Sets.AttackType[NPC.type] = 0; - NPCID.Sets.AttackTime[NPC.type] = 60; - NPCID.Sets.AttackAverageChance[NPC.type] = 15; + Main.npcFrameCount[Type] = 27; + NPCID.Sets.ExtraFramesCount[Type] = 9; + NPCID.Sets.AttackFrameCount[Type] = 4; + NPCID.Sets.DangerDetectRange[Type] = 400; + NPCID.Sets.AttackType[Type] = 0; + NPCID.Sets.AttackTime[Type] = 60; + NPCID.Sets.AttackAverageChance[Type] = 15; NPCID.Sets.ShimmerTownTransform[Type] = false; NPC.Happiness .SetBiomeAffection(AffectionLevel.Love) @@ -92,7 +92,7 @@ namespace CalamityMod.NPCs.TownNPCs public override void FindFrame(int frameHeight) { - int extraFrameAmt = (NPC.isLikeATownNPC ? NPCID.Sets.ExtraFramesCount[NPC.type] : 0); + int extraFrameAmt = (NPC.isLikeATownNPC ? NPCID.Sets.ExtraFramesCount[Type] : 0); if (NPC.velocity.Y == 0f) { if (NPC.direction == 1) @@ -101,7 +101,7 @@ namespace CalamityMod.NPCs.TownNPCs if (NPC.direction == -1) NPC.spriteDirection = -1; - int nonAttackFrames = Main.npcFrameCount[NPC.type] - NPCID.Sets.AttackFrameCount[NPC.type]; + int nonAttackFrames = Main.npcFrameCount[Type] - NPCID.Sets.AttackFrameCount[Type]; if (NPC.ai[0] == 23f) { NPC.frameCounter += 1D; @@ -287,7 +287,7 @@ namespace CalamityMod.NPCs.TownNPCs if (NPC.ai[1] < 10f) num254 = 0; - num254 = Main.npcFrameCount[NPC.type] - 2; + num254 = Main.npcFrameCount[Type] - 2; NPC.frame.Y = frameHeight * num254; } else if (NPC.ai[0] == 10f || NPC.ai[0] == 13f) // Attacking @@ -323,7 +323,7 @@ namespace CalamityMod.NPCs.TownNPCs NPC.frameCounter = 0D; } - float num260 = NPC.ai[1] / (float)NPCID.Sets.AttackTime[NPC.type]; + float num260 = NPC.ai[1] / (float)NPCID.Sets.AttackTime[Type]; int num261 = 0; num261 = ((num260 > 0.65f) ? nonAttackFrames : ((num260 > 0.5f) ? @@ -632,7 +632,7 @@ namespace CalamityMod.NPCs.TownNPCs NPC.frameCounter = 0D; } - if (NPC.frame.Y / frameHeight >= Main.npcFrameCount[NPC.type] - extraFrameAmt) + if (NPC.frame.Y / frameHeight >= Main.npcFrameCount[Type] - extraFrameAmt) NPC.frame.Y = walkFrameHeightLimit; } @@ -814,7 +814,7 @@ namespace CalamityMod.NPCs.TownNPCs return false; var something = NPC.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(BirthdayParty.PartyIsUp ? AltTexture.Value : TextureAssets.Npc[NPC.type].Value, NPC.Center - screenPos + new Vector2(0, NPC.gfxOffY) - new Vector2(0f, 6f), NPC.frame, drawColor, NPC.rotation, NPC.frame.Size() / 2, NPC.scale, something, 0); + spriteBatch.Draw(BirthdayParty.PartyIsUp ? AltTexture.Value : TextureAssets.Npc[Type].Value, NPC.Center - screenPos + new Vector2(0, NPC.gfxOffY) - new Vector2(0f, 6f), NPC.frame, drawColor, NPC.rotation, NPC.frame.Size() / 2, NPC.scale, something, 0); return false; } @@ -880,7 +880,7 @@ namespace CalamityMod.NPCs.TownNPCs musicMod.TryFind("DevourerofGodsEulogyMusicBox", out ModItem eulogyBox); NPCShop shop = new(Type); - shop.AddWithCustomValue(ItemID.LovePotion, Item.buyPrice(silver: 25), CalamityConditions.PotionSellingConfig, Condition.HappyEnough) + shop.AddWithCustomValue(ItemID.LovePotion, Item.buyPrice(silver: 25), CalamityConditions.PotionSellingConfig, Condition.HappyEnoughToSellPylons) .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(silver: 30)) .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 3)) .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 3)) @@ -916,9 +916,9 @@ namespace CalamityMod.NPCs.TownNPCs .AddWithCustomValue(interlude2Box.Type, Item.buyPrice(gold: 10), Condition.DownedMoonLord) .AddWithCustomValue(interlude3Box.Type, Item.buyPrice(gold: 10), CalamityConditions.DownedYharon) .AddWithCustomValue(eulogyBox.Type, Item.buyPrice(gold: 10), CalamityConditions.DownedDevourerOfGods) - .AddWithCustomValue(ItemID.UnicornHorn, Item.buyPrice(0, 2, 50), Condition.HappyEnough, Condition.InHallow) - .AddWithCustomValue(ItemID.Milkshake, Item.buyPrice(gold: 5), Condition.HappyEnough, Condition.InHallow, Condition.NpcIsPresent(NPCID.Stylist)) - .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 25), Condition.HappyEnough, Condition.NpcIsPresent(NPCID.Stylist), Condition.NpcIsPresent(NPCID.BestiaryGirl)) + .AddWithCustomValue(ItemID.UnicornHorn, Item.buyPrice(0, 2, 50), Condition.HappyEnoughToSellPylons, Condition.InHallow) + .AddWithCustomValue(ItemID.Milkshake, Item.buyPrice(gold: 5), Condition.HappyEnoughToSellPylons, Condition.InHallow, Condition.NpcIsPresent(NPCID.Stylist)) + .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 25), Condition.HappyEnoughToSellPylons, Condition.NpcIsPresent(NPCID.Stylist), Condition.NpcIsPresent(NPCID.BestiaryGirl)) .Register(); } diff --git a/NPCs/TownNPCs/SEAHOE.cs b/NPCs/TownNPCs/SEAHOE.cs index 19faadf007..7ad7960bd0 100644 --- a/NPCs/TownNPCs/SEAHOE.cs +++ b/NPCs/TownNPCs/SEAHOE.cs @@ -24,14 +24,14 @@ namespace CalamityMod.NPCs.TownNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 25; - NPCID.Sets.ExtraFramesCount[NPC.type] = 5; - NPCID.Sets.AttackFrameCount[NPC.type] = 4; - NPCID.Sets.DangerDetectRange[NPC.type] = 700; - NPCID.Sets.AttackType[NPC.type] = 0; - NPCID.Sets.AttackTime[NPC.type] = 90; - NPCID.Sets.AttackAverageChance[NPC.type] = 30; - NPCID.Sets.HatOffsetY[NPC.type] = 16; + Main.npcFrameCount[Type] = 25; + NPCID.Sets.ExtraFramesCount[Type] = 5; + NPCID.Sets.AttackFrameCount[Type] = 4; + NPCID.Sets.DangerDetectRange[Type] = 700; + NPCID.Sets.AttackType[Type] = 0; + NPCID.Sets.AttackTime[Type] = 90; + NPCID.Sets.AttackAverageChance[Type] = 30; + NPCID.Sets.HatOffsetY[Type] = 16; NPCID.Sets.ShimmerTownTransform[Type] = false; NPC.Happiness .SetBiomeAffection(AffectionLevel.Like) @@ -210,8 +210,8 @@ namespace CalamityMod.NPCs.TownNPCs .Add(ModContent.ItemType()) .AddWithCustomValue(ItemID.TruffleWorm, Item.buyPrice(gold: 20), Condition.Hardmode) .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 40), downedOldDuke) - .AddWithCustomValue(ItemID.ShrimpPoBoy, Item.buyPrice(gold: 2, silver: 50), Condition.HappyEnough, Condition.InBeach) - .AddWithCustomValue(ItemID.Fries, Item.buyPrice(gold: 2), Condition.HappyEnough, Condition.InBeach, Condition.DownedEyeOfCthulhu) + .AddWithCustomValue(ItemID.ShrimpPoBoy, Item.buyPrice(gold: 2, silver: 50), Condition.HappyEnoughToSellPylons, Condition.InBeach) + .AddWithCustomValue(ItemID.Fries, Item.buyPrice(gold: 2), Condition.HappyEnoughToSellPylons, Condition.InBeach, Condition.DownedEyeOfCthulhu) .Register(); } diff --git a/NPCs/TownNPCs/THIEF.cs b/NPCs/TownNPCs/THIEF.cs index 1f46f4fe14..5285782aa9 100644 --- a/NPCs/TownNPCs/THIEF.cs +++ b/NPCs/TownNPCs/THIEF.cs @@ -30,13 +30,13 @@ namespace CalamityMod.NPCs.TownNPCs public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 23; - NPCID.Sets.ExtraFramesCount[NPC.type] = 9; - NPCID.Sets.AttackFrameCount[NPC.type] = 4; - NPCID.Sets.DangerDetectRange[NPC.type] = 500; - NPCID.Sets.AttackType[NPC.type] = 0; - NPCID.Sets.AttackTime[NPC.type] = 60; - NPCID.Sets.AttackAverageChance[NPC.type] = 10; + Main.npcFrameCount[Type] = 23; + NPCID.Sets.ExtraFramesCount[Type] = 9; + NPCID.Sets.AttackFrameCount[Type] = 4; + NPCID.Sets.DangerDetectRange[Type] = 500; + NPCID.Sets.AttackType[Type] = 0; + NPCID.Sets.AttackTime[Type] = 60; + NPCID.Sets.AttackAverageChance[Type] = 10; NPCID.Sets.ShimmerTownTransform[Type] = false; NPC.Happiness .SetBiomeAffection(AffectionLevel.Like) @@ -276,7 +276,7 @@ namespace CalamityMod.NPCs.TownNPCs return false; var something = NPC.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(BirthdayParty.PartyIsUp ? AltTexture.Value : TextureAssets.Npc[NPC.type].Value, NPC.Center - screenPos + new Vector2(0, NPC.gfxOffY) - new Vector2(0f, 6f), NPC.frame, drawColor, NPC.rotation, NPC.frame.Size() / 2, NPC.scale, something, 0); + spriteBatch.Draw(BirthdayParty.PartyIsUp ? AltTexture.Value : TextureAssets.Npc[Type].Value, NPC.Center - screenPos + new Vector2(0, NPC.gfxOffY) - new Vector2(0f, 6f), NPC.frame, drawColor, NPC.rotation, NPC.frame.Size() / 2, NPC.scale, something, 0); return false; } @@ -310,8 +310,8 @@ namespace CalamityMod.NPCs.TownNPCs .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 25)) .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 40)) .Add(ItemID.TigerClimbingGear) - .AddWithCustomValue(ItemID.InvisibilityPotion, Item.buyPrice(silver: 25), potionSells, Condition.HappyEnough) - .AddWithCustomValue(ItemID.NightOwlPotion, Item.buyPrice(silver: 25), potionSells, Condition.HappyEnough) + .AddWithCustomValue(ItemID.InvisibilityPotion, Item.buyPrice(silver: 25), potionSells, Condition.HappyEnoughToSellPylons) + .AddWithCustomValue(ItemID.NightOwlPotion, Item.buyPrice(silver: 25), potionSells, Condition.HappyEnoughToSellPylons) .Add(ModContent.ItemType(), Condition.DownedPirates) .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 60), Condition.DownedMechBossAll) .Add(ModContent.ItemType(), downedCalclone) diff --git a/NPCs/TownNPCs/WITCH.cs b/NPCs/TownNPCs/WITCH.cs index 13c9dec43a..bf23526d8f 100644 --- a/NPCs/TownNPCs/WITCH.cs +++ b/NPCs/TownNPCs/WITCH.cs @@ -26,13 +26,13 @@ namespace CalamityMod.NPCs.TownNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 27; - NPCID.Sets.ExtraFramesCount[NPC.type] = 11; - NPCID.Sets.AttackFrameCount[NPC.type] = 6; - NPCID.Sets.DangerDetectRange[NPC.type] = 700; - NPCID.Sets.AttackType[NPC.type] = 1; - NPCID.Sets.AttackTime[NPC.type] = 30; - NPCID.Sets.AttackAverageChance[NPC.type] = 5; + Main.npcFrameCount[Type] = 27; + NPCID.Sets.ExtraFramesCount[Type] = 11; + NPCID.Sets.AttackFrameCount[Type] = 6; + NPCID.Sets.DangerDetectRange[Type] = 700; + NPCID.Sets.AttackType[Type] = 1; + NPCID.Sets.AttackTime[Type] = 30; + NPCID.Sets.AttackAverageChance[Type] = 5; NPCID.Sets.ShimmerTownTransform[Type] = false; NPC.Happiness .SetBiomeAffection(AffectionLevel.Like) @@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.TownNPCs public override void FindFrame(int frameHeight) { - int extraFrameAmt = (NPC.isLikeATownNPC ? NPCID.Sets.ExtraFramesCount[NPC.type] : 0); + int extraFrameAmt = (NPC.isLikeATownNPC ? NPCID.Sets.ExtraFramesCount[Type] : 0); if (NPC.velocity.Y == 0f) { if (NPC.direction == 1) @@ -90,7 +90,7 @@ namespace CalamityMod.NPCs.TownNPCs if (NPC.direction == -1) NPC.spriteDirection = -1; - int nonAttackFrames = Main.npcFrameCount[NPC.type] - NPCID.Sets.AttackFrameCount[NPC.type]; + int nonAttackFrames = Main.npcFrameCount[Type] - NPCID.Sets.AttackFrameCount[Type]; if (NPC.ai[0] == 23f) { NPC.frameCounter += 1D; @@ -276,7 +276,7 @@ namespace CalamityMod.NPCs.TownNPCs if (NPC.ai[1] < 10f) num254 = 0; - num254 = Main.npcFrameCount[NPC.type] - 2; + num254 = Main.npcFrameCount[Type] - 2; NPC.frame.Y = frameHeight * num254; } else if (NPC.ai[0] == 10f || NPC.ai[0] == 13f) // Attacking @@ -312,7 +312,7 @@ namespace CalamityMod.NPCs.TownNPCs NPC.frameCounter = 0D; } - float num260 = NPC.ai[1] / (float)NPCID.Sets.AttackTime[NPC.type]; + float num260 = NPC.ai[1] / (float)NPCID.Sets.AttackTime[Type]; int num261 = 0; num261 = ((num260 > 0.65f) ? nonAttackFrames : ((num260 > 0.5f) ? @@ -621,7 +621,7 @@ namespace CalamityMod.NPCs.TownNPCs NPC.frameCounter = 0D; } - if (NPC.frame.Y / frameHeight >= Main.npcFrameCount[NPC.type] - extraFrameAmt) + if (NPC.frame.Y / frameHeight >= Main.npcFrameCount[Type] - extraFrameAmt) NPC.frame.Y = walkFrameHeightLimit; } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs index e4c312fd4c..17ce7b35d6 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs @@ -1569,10 +1569,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.getGoodWorld) enrageScale += 2f; - if ((!Main.player[npc.target].ZoneLihzhardTemple && !Main.player[npc.target].ZoneJungle) || (double)Main.player[npc.target].Center.Y < Main.worldSurface * 16.0) + if ((!Main.player[npc.target].ZoneLihzhardTemple && !Main.player[npc.target].ZoneJungle) || (double)Main.player[npc.target].Center.Y < Main.worldSurface * 16D) + { enrageScale *= 2f; - - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && enrageScale > 1f; + npc.Calamity().CurrentlyEnraged = true; + } if (npc.localAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs index 364c80c77e..dca7c85d7d 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs @@ -221,12 +221,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Despawn - int despawnDistance = 500; - if (Main.player[npc.target].dead || Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) / 16f > despawnDistance) + int despawnDistance = 60; + int forceDespawnDistance = 300; + if ((Main.player[npc.target].dead && Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) / 16f > despawnDistance) || Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) / 16f > forceDespawnDistance) { CalamityUtils.CalamityTargeting(npc, default); - if (Main.player[npc.target].dead || Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) / 16f > despawnDistance) + if ((Main.player[npc.target].dead && Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) / 16f > despawnDistance) || Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) / 16f > forceDespawnDistance) { if (npc.timeLeft > 10) npc.timeLeft = 10; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs index af3fa65be7..1bdc9d817e 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs @@ -99,6 +99,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.SyncExtraAI(); } + bool foveanatorAlive = NPC.AnyNPCs(ModContent.NPCType()); + // Phase HP ratios float phase2LifeRatio = oblivionAlive ? 0.5f : masterMode ? 0.85f : 0.7f; float finalPhaseLifeRatio = masterMode ? 0.4f : 0.25f; @@ -198,7 +200,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.SimpleFlyMovement(idealVelocity * maxVelocity, acceleration); float phaseGateValue = (masterMode ? 300f : 450f) - (death ? phase1MaxLaserPhaseDurationDecrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); - float laserGateValue = oblivionAlive ? 60f : 30f; + float laserGateValue = oblivionAlive ? 60f : foveanatorAlive ? 45f : 30f; if (NPC.IsMechQueenUp) { phaseGateValue = 900f; @@ -307,6 +309,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = hoverRotation; float totalCharges = death ? 6f : 5f; + if (foveanatorAlive) + totalCharges -= 1f; + if (npc.ai[3] >= totalCharges) { npc.ai[1] = 0f; @@ -512,7 +517,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f + (death ? (phase2LifeRatio - lifeRatio) / phase2LifeRatio : 0f); - if (npc.localAI[1] >= (spazAlive ? (oblivionAlive ? 76f : 52f) : 26f)) + if (npc.localAI[1] >= (spazAlive ? (oblivionAlive ? 76f : foveanatorAlive ? 64f : 52f) : foveanatorAlive ? 39f : 26f)) { if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { @@ -569,7 +574,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f + (death ? (phase2LifeRatio - lifeRatio) / phase2LifeRatio : 0f); - if (npc.localAI[1] > (spazAlive ? (oblivionAlive ? 30f : 20f) : 10f)) + if (npc.localAI[1] > (spazAlive ? (oblivionAlive ? 30f : foveanatorAlive ? 25f : 20f) : foveanatorAlive ? 15f : 10f)) { if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { @@ -666,7 +671,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[3] % 3f == 0f) { - float fireRate = spazAlive ? 13f : 9f; + float fireRate = spazAlive ? 13f : foveanatorAlive ? 11f : 9f; if (npc.ai[2] % fireRate == 0f) { SoundEngine.PlaySound(SoundID.Item33, npc.Center); @@ -854,6 +859,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } + bool foveanatorAlive = NPC.AnyNPCs(ModContent.NPCType()); + // Phase HP ratios float phase2LifeRatio = oblivionAlive ? 0.5f : masterMode ? 0.85f : 0.7f; float finalPhaseLifeRatio = masterMode ? 0.3f : 0.15f; @@ -978,7 +985,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[3] += 0.4f; } - if (npc.ai[3] >= (oblivionAlive ? 60f : 30f)) + if (npc.ai[3] >= (oblivionAlive ? 60f : foveanatorAlive ? 45f : 30f)) { npc.ai[3] = 0f; @@ -1061,7 +1068,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = hoverRotation; - float totalCharges = 8f; + float totalCharges = foveanatorAlive ? 6f : 8f; if (death) totalCharges -= (float)Math.Round(phase1MaxChargesDecrease * ((1f - lifeRatio) / (1f - phase2LifeRatio))); @@ -1270,7 +1277,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[3] += 1f; npc.localAI[1] = 0f; - float flamethrowerSpeed = 6f; + float flamethrowerSpeed = foveanatorAlive ? 5f : 6f; flamethrowerSpeed += 3f * enrageScale; float timeForFlamethrowerToReachMaxVelocity = 60f; float flamethrowerSpeedScalar = MathHelper.Clamp(npc.ai[2] / timeForFlamethrowerToReachMaxVelocity, 0f, 1f); @@ -1382,7 +1389,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = hoverRotation; - if (npc.ai[3] >= 5f) + float totalCharges = foveanatorAlive ? 4f : 5f; + if (npc.ai[3] >= totalCharges) { npc.ai[1] = 0f; npc.ai[3] = 0f; @@ -1567,7 +1575,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[2] += 1f; // Fire shadowflames and cursed fireballs - float fireRate = retAlive ? 30f : 20f; + float fireRate = retAlive ? 30f : foveanatorAlive ? 25f : 20f; if (npc.ai[2] % fireRate == 0f) { npc.ai[3] += 1f; diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index c5a60530b0..b23d3bc8cd 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -77,8 +77,8 @@ namespace CalamityMod.NPCs.Yharon public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 7; - NPCID.Sets.TrailingMode[NPC.type] = 1; + Main.npcFrameCount[Type] = 7; + NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { @@ -2729,8 +2729,8 @@ namespace CalamityMod.NPCs.Yharon if (NPC.spriteDirection == 1) spriteEffects = ai2 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - Texture2D texture = TextureAssets.Npc[NPC.type].Value; - Vector2 halfSizeTexture = new Vector2(texture.Width / 2, texture.Height / Main.npcFrameCount[NPC.type] / 2); + Texture2D texture = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2(texture.Width / 2, texture.Height / Main.npcFrameCount[Type] / 2); Color color = drawColor; Color invincibleColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, 0); Color lerpEndColor = Color.White; @@ -2782,7 +2782,7 @@ namespace CalamityMod.NPCs.Yharon afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (afterimageAmt - i) / 15f; Vector2 afterimagePos = NPC.oldPos[i] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + afterimagePos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } @@ -2831,14 +2831,14 @@ namespace CalamityMod.NPCs.Yharon additionalAfterimageColor = NPC.GetAlpha(additionalAfterimageColor); additionalAfterimageColor *= 1f - additionalAfterimageOpacity; Vector2 additionalAfterimagePos = NPC.Center + (k / (float)additionalAfterimageAmt * MathHelper.TwoPi + NPC.rotation).ToRotationVector2() * afterimageScale * additionalAfterimageOpacity - screenPos; - additionalAfterimagePos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + additionalAfterimagePos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; additionalAfterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, additionalAfterimagePos, NPC.frame, additionalAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } } Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawLocation -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, drawLocation, NPC.frame, invincible ? invincibleColor : NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); @@ -2907,7 +2907,7 @@ namespace CalamityMod.NPCs.Yharon orangeAfterimageColor = Color.Lerp(orangeAfterimageColor, lerpEndColor, lerpInterpolateValue); orangeAfterimageColor *= (afterimageAmt - l) / 15f; Vector2 glowmaskAfterimagePos = NPC.oldPos[l] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - glowmaskAfterimagePos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + glowmaskAfterimagePos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; glowmaskAfterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, glowmaskAfterimagePos, NPC.frame, orangeAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); @@ -2935,7 +2935,7 @@ namespace CalamityMod.NPCs.Yharon additionalOrangeColor = NPC.GetAlpha(additionalOrangeColor); additionalOrangeColor *= 1f - additionalAfterimageOpacity; Vector2 additionalGlowmaskPos = NPC.Center + (m / (float)additionalAfterimageAmt * MathHelper.TwoPi + NPC.rotation).ToRotationVector2() * afterimageScale * additionalAfterimageOpacity - screenPos; - additionalGlowmaskPos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + additionalGlowmaskPos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; additionalGlowmaskPos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture, additionalGlowmaskPos, NPC.frame, additionalOrangeColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); diff --git a/Projectiles/BaseProjectiles/BaseLaserbeamProjectile.cs b/Projectiles/BaseProjectiles/BaseLaserbeamProjectile.cs index 2a9b9923a2..d9834046f1 100644 --- a/Projectiles/BaseProjectiles/BaseLaserbeamProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseLaserbeamProjectile.cs @@ -120,9 +120,9 @@ namespace CalamityMod.Projectiles.BaseProjectiles protected internal void DrawBeamWithColor(Color beamColor, float scale, int startFrame = 0, int middleFrame = 0, int endFrame = 0) { - Rectangle startFrameArea = LaserBeginTexture.Frame(1, Main.projFrames[Projectile.type], 0, startFrame); - Rectangle middleFrameArea = LaserMiddleTexture.Frame(1, Main.projFrames[Projectile.type], 0, middleFrame); - Rectangle endFrameArea = LaserEndTexture.Frame(1, Main.projFrames[Projectile.type], 0, endFrame); + Rectangle startFrameArea = LaserBeginTexture.Frame(1, Main.projFrames[Type], 0, startFrame); + Rectangle middleFrameArea = LaserMiddleTexture.Frame(1, Main.projFrames[Type], 0, middleFrame); + Rectangle endFrameArea = LaserEndTexture.Frame(1, Main.projFrames[Type], 0, endFrame); // Start texture drawing. Main.EntitySpriteDraw(LaserBeginTexture, @@ -182,7 +182,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles #region Hook Overrides public override void AI() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; Behavior(); ExtraBehavior(); diff --git a/Projectiles/BaseProjectiles/BaseMinionProjectile.cs b/Projectiles/BaseProjectiles/BaseMinionProjectile.cs index 39dfaebd12..5d6e660d58 100644 --- a/Projectiles/BaseProjectiles/BaseMinionProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseMinionProjectile.cs @@ -140,6 +140,8 @@ namespace CalamityMod.Projectiles.BaseProjectiles public override void SetStaticDefaults() { Main.projFrames[Type] = AnimationFrames; + Main.projPet[Type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; ProjectileID.Sets.TrailingMode[Type] = TrailingMode; ProjectileID.Sets.TrailCacheLength[Type] = TrailCacheLength; diff --git a/Projectiles/BaseProjectiles/BaseSpearProjectile.cs b/Projectiles/BaseProjectiles/BaseSpearProjectile.cs index 46700c42b6..99815b550c 100644 --- a/Projectiles/BaseProjectiles/BaseSpearProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseSpearProjectile.cs @@ -162,7 +162,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles { if (SpearAiType == SpearType.TypicalSpear) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Vector2 origin = Vector2.Zero; Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, 0, 0); diff --git a/Projectiles/BaseProjectiles/BaseWhipProjectile.cs b/Projectiles/BaseProjectiles/BaseWhipProjectile.cs index a35e02a794..d237f39f70 100644 --- a/Projectiles/BaseProjectiles/BaseWhipProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseWhipProjectile.cs @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles Behavior(); ExtraBehavior(); } - public Texture2D FlailTexture => Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + public Texture2D FlailTexture => Terraria.GameContent.TextureAssets.Projectile[Type].Value; #region Virtual Values public virtual Color SpecialDrawColor => new Color(255, 200, 0); diff --git a/Projectiles/Boss/ApolloChargeTelegraph.cs b/Projectiles/Boss/ApolloChargeTelegraph.cs index 143df6a6d3..b038018e4c 100644 --- a/Projectiles/Boss/ApolloChargeTelegraph.cs +++ b/Projectiles/Boss/ApolloChargeTelegraph.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() diff --git a/Projectiles/Boss/ApolloFireball.cs b/Projectiles/Boss/ApolloFireball.cs index d86f5eec5a..f89f8ea341 100644 --- a/Projectiles/Boss/ApolloFireball.cs +++ b/Projectiles/Boss/ApolloFireball.cs @@ -19,9 +19,9 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 6; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -141,7 +141,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/ApolloRocket.cs b/Projectiles/Boss/ApolloRocket.cs index 01673d9b36..252450cd0d 100644 --- a/Projectiles/Boss/ApolloRocket.cs +++ b/Projectiles/Boss/ApolloRocket.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 5; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -190,14 +190,14 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } public override void PostDraw(Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int height = texture.Height / Main.projFrames[Type]; int drawStart = height * Projectile.frame; Vector2 origin = Projectile.Size / 2; Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Projectiles/Boss/ApolloRocketGlow").Value, Projectile.Center - Main.screenPosition, new Rectangle(0, drawStart, texture.Width, height), Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Boss/AresDeathBeamStart.cs b/Projectiles/Boss/AresDeathBeamStart.cs index b08a03cdca..e548b9246c 100644 --- a/Projectiles/Boss/AresDeathBeamStart.cs +++ b/Projectiles/Boss/AresDeathBeamStart.cs @@ -38,8 +38,8 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { // Ares' eight-pointed-star (more on higher difficulties) laser beams - Main.projFrames[Projectile.type] = 5; - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + Main.projFrames[Type] = 5; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; // This is its serious name } @@ -163,7 +163,7 @@ namespace CalamityMod.Projectiles.Boss // Determine frames. Projectile.frameCounter++; if (Projectile.frameCounter % 5f == 0f) - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; } public override bool PreDraw(ref Color lightColor) @@ -178,9 +178,9 @@ namespace CalamityMod.Projectiles.Boss return false; Color beamColor = LaserOverlayColor; - Rectangle startFrameArea = LaserBeginTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); - Rectangle middleFrameArea = LaserMiddleTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); - Rectangle endFrameArea = LaserEndTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Rectangle startFrameArea = LaserBeginTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Rectangle middleFrameArea = LaserMiddleTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Rectangle endFrameArea = LaserEndTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); // Start texture drawing. Main.EntitySpriteDraw(LaserBeginTexture, @@ -215,7 +215,7 @@ namespace CalamityMod.Projectiles.Boss 0); incrementalBodyLength += laserOffset; centerOnLaser += Projectile.velocity * laserOffset; - middleFrameArea.Y += LaserMiddleTexture.Height / Main.projFrames[Projectile.type]; + middleFrameArea.Y += LaserMiddleTexture.Height / Main.projFrames[Type]; if (middleFrameArea.Y + middleFrameArea.Height > LaserMiddleTexture.Height) middleFrameArea.Y = 0; } diff --git a/Projectiles/Boss/AresDeathBeamTelegraph.cs b/Projectiles/Boss/AresDeathBeamTelegraph.cs index d447922d4a..52458b6833 100644 --- a/Projectiles/Boss/AresDeathBeamTelegraph.cs +++ b/Projectiles/Boss/AresDeathBeamTelegraph.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { // Telegraph for Ares' eight-pointed-star laser beams - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() diff --git a/Projectiles/Boss/AresGaussNukeProjectile.cs b/Projectiles/Boss/AresGaussNukeProjectile.cs index 89aa0ed04a..32f0663f36 100644 --- a/Projectiles/Boss/AresGaussNukeProjectile.cs +++ b/Projectiles/Boss/AresGaussNukeProjectile.cs @@ -22,9 +22,9 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 12; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 12; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -162,15 +162,15 @@ namespace CalamityMod.Projectiles.Boss Main.EntitySpriteDraw(telegraphBase, drawPosition, null, lightColor, 0, telegraphBase.Size() / 2f, 1480f, 0, 0); Main.spriteBatch.ExitShaderRegion(); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } public override void PostDraw(Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int height = texture.Height / Main.projFrames[Type]; int drawStart = height * Projectile.frame; Vector2 origin = Projectile.Size / 2; Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Projectiles/Boss/AresGaussNukeProjectileGlow").Value, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, drawStart, texture.Width, height)), Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Boss/AresGaussNukeProjectileBoom.cs b/Projectiles/Boss/AresGaussNukeProjectileBoom.cs index a8c411f3be..fabc0a19b7 100644 --- a/Projectiles/Boss/AresGaussNukeProjectileBoom.cs +++ b/Projectiles/Boss/AresGaussNukeProjectileBoom.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() diff --git a/Projectiles/Boss/AresGaussNukeProjectileSpark.cs b/Projectiles/Boss/AresGaussNukeProjectileSpark.cs index 2cebb4d08e..dc29973504 100644 --- a/Projectiles/Boss/AresGaussNukeProjectileSpark.cs +++ b/Projectiles/Boss/AresGaussNukeProjectileSpark.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Boss/AresLaserBeamStart.cs b/Projectiles/Boss/AresLaserBeamStart.cs index 79dae329f9..fd96c14180 100644 --- a/Projectiles/Boss/AresLaserBeamStart.cs +++ b/Projectiles/Boss/AresLaserBeamStart.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() @@ -150,7 +150,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.velocity == Vector2.Zero) return false; - Texture2D beamStart = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D beamStart = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D beamMiddle = ModContent.Request("CalamityMod/ExtraTextures/Lasers/AresLaserBeamMiddle", AssetRequestMode.ImmediateLoad).Value; Texture2D beamEnd = ModContent.Request("CalamityMod/ExtraTextures/Lasers/AresLaserBeamEnd", AssetRequestMode.ImmediateLoad).Value; diff --git a/Projectiles/Boss/AresPlasmaBolt.cs b/Projectiles/Boss/AresPlasmaBolt.cs index d291c6718e..adba705b56 100644 --- a/Projectiles/Boss/AresPlasmaBolt.cs +++ b/Projectiles/Boss/AresPlasmaBolt.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Boss/AresPlasmaFireball.cs b/Projectiles/Boss/AresPlasmaFireball.cs index 15676d5635..c214b13881 100644 --- a/Projectiles/Boss/AresPlasmaFireball.cs +++ b/Projectiles/Boss/AresPlasmaFireball.cs @@ -19,9 +19,9 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 6; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -140,7 +140,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/AresTeslaOrb.cs b/Projectiles/Boss/AresTeslaOrb.cs index 3ccee65e4c..4878f29a10 100644 --- a/Projectiles/Boss/AresTeslaOrb.cs +++ b/Projectiles/Boss/AresTeslaOrb.cs @@ -21,10 +21,10 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() @@ -236,7 +236,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/ArtemisChargeTelegraph.cs b/Projectiles/Boss/ArtemisChargeTelegraph.cs index 6b3648880b..0ec7ee0a8d 100644 --- a/Projectiles/Boss/ArtemisChargeTelegraph.cs +++ b/Projectiles/Boss/ArtemisChargeTelegraph.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() diff --git a/Projectiles/Boss/ArtemisDeathrayTelegraph.cs b/Projectiles/Boss/ArtemisDeathrayTelegraph.cs index 132f4c959f..8baf69fb39 100644 --- a/Projectiles/Boss/ArtemisDeathrayTelegraph.cs +++ b/Projectiles/Boss/ArtemisDeathrayTelegraph.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() diff --git a/Projectiles/Boss/ArtemisLaser.cs b/Projectiles/Boss/ArtemisLaser.cs index 8232a47fdc..454670d01a 100644 --- a/Projectiles/Boss/ArtemisLaser.cs +++ b/Projectiles/Boss/ArtemisLaser.cs @@ -32,8 +32,8 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + Main.projFrames[Type] = 4; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() @@ -217,7 +217,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.B = (byte)(255 * Projectile.Opacity); Vector2 drawOffset = Projectile.velocity.SafeNormalize(Vector2.Zero) * -30f; Projectile.Center += drawOffset; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); Projectile.Center -= drawOffset; return false; } diff --git a/Projectiles/Boss/ArtemisSpinLaserbeam.cs b/Projectiles/Boss/ArtemisSpinLaserbeam.cs index 45d346d659..08b27e1575 100644 --- a/Projectiles/Boss/ArtemisSpinLaserbeam.cs +++ b/Projectiles/Boss/ArtemisSpinLaserbeam.cs @@ -30,15 +30,15 @@ namespace CalamityMod.Projectiles.Boss public override float Lifetime => 600; public override Color LaserOverlayColor => new Color(250, 180, 100, 100); public override Color LightCastColor => Color.White; - public override Texture2D LaserBeginTexture => Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + public override Texture2D LaserBeginTexture => Terraria.GameContent.TextureAssets.Projectile[Type].Value; public override Texture2D LaserMiddleTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/AresLaserBeamMiddle", AssetRequestMode.ImmediateLoad).Value; public override Texture2D LaserEndTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/AresLaserBeamEnd", AssetRequestMode.ImmediateLoad).Value; public override string Texture => "CalamityMod/Projectiles/Boss/AresLaserBeamStart"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + Main.projFrames[Type] = 5; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; // This is its serious name } @@ -116,7 +116,7 @@ namespace CalamityMod.Projectiles.Boss // Determine frames. Projectile.frameCounter++; if (Projectile.frameCounter % 5f == 0f) - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; } public float LaserWidthFunction(float _) => Projectile.scale * Projectile.width; diff --git a/Projectiles/Boss/AstralFlame.cs b/Projectiles/Boss/AstralFlame.cs index 3738d2946f..99629bc81a 100644 --- a/Projectiles/Boss/AstralFlame.cs +++ b/Projectiles/Boss/AstralFlame.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -136,7 +136,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/AstralGodRay.cs b/Projectiles/Boss/AstralGodRay.cs index d84d7ad212..bca3fb8b44 100644 --- a/Projectiles/Boss/AstralGodRay.cs +++ b/Projectiles/Boss/AstralGodRay.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() diff --git a/Projectiles/Boss/AstralLaser.cs b/Projectiles/Boss/AstralLaser.cs index fbc21c0d28..f81ffeeeac 100644 --- a/Projectiles/Boss/AstralLaser.cs +++ b/Projectiles/Boss/AstralLaser.cs @@ -12,9 +12,9 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 3; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/AstralShot2.cs b/Projectiles/Boss/AstralShot2.cs index a07a287af0..82f15bd2a2 100644 --- a/Projectiles/Boss/AstralShot2.cs +++ b/Projectiles/Boss/AstralShot2.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Boss/BigFlare.cs b/Projectiles/Boss/BigFlare.cs index 48ca50b2c9..af1f3b5f90 100644 --- a/Projectiles/Boss/BigFlare.cs +++ b/Projectiles/Boss/BigFlare.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Boss public static readonly SoundStyle FlareSound = new("CalamityMod/Sounds/Custom/Yharon/YharonInfernado"); public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/BigFlare2.cs b/Projectiles/Boss/BigFlare2.cs index 32cd12277f..85a99f9a3f 100644 --- a/Projectiles/Boss/BigFlare2.cs +++ b/Projectiles/Boss/BigFlare2.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Boss public static readonly SoundStyle FlareSound = new("CalamityMod/Sounds/Custom/Yharon/YharonInfernado"); public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/BirbAura.cs b/Projectiles/Boss/BirbAura.cs index 5f6e1b731e..bf325251d8 100644 --- a/Projectiles/Boss/BirbAura.cs +++ b/Projectiles/Boss/BirbAura.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() @@ -133,7 +133,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.velocity == Vector2.Zero) return false; - Texture2D middleTex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D middleTex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D endpointTex = ModContent.Request("CalamityMod/ExtraTextures/Lasers/BirbAuraEndpoints", AssetRequestMode.ImmediateLoad).Value; // Used to track the animation of the segments diff --git a/Projectiles/Boss/BloodGeyser.cs b/Projectiles/Boss/BloodGeyser.cs index c6d458821e..a821b4b885 100644 --- a/Projectiles/Boss/BloodGeyser.cs +++ b/Projectiles/Boss/BloodGeyser.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Boss/BrimstoneBarrage.cs b/Projectiles/Boss/BrimstoneBarrage.cs index 344dee7f5e..b69a56ddd3 100644 --- a/Projectiles/Boss/BrimstoneBarrage.cs +++ b/Projectiles/Boss/BrimstoneBarrage.cs @@ -19,9 +19,9 @@ namespace CalamityMod.Projectiles.Boss public int time = 0; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -158,7 +158,7 @@ namespace CalamityMod.Projectiles.Boss } } - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 10 * Projectile.scale, targetHitbox); diff --git a/Projectiles/Boss/BrimstoneFire.cs b/Projectiles/Boss/BrimstoneFire.cs index 42b6e2b860..2fb7384d2e 100644 --- a/Projectiles/Boss/BrimstoneFire.cs +++ b/Projectiles/Boss/BrimstoneFire.cs @@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D fire = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D fire = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D mist = ModContent.Request("CalamityMod/Particles/MediumMist").Value; // The conga line of colors to sift through diff --git a/Projectiles/Boss/BrimstoneHellblast.cs b/Projectiles/Boss/BrimstoneHellblast.cs index c30a023c2f..a0abed02ee 100644 --- a/Projectiles/Boss/BrimstoneHellblast.cs +++ b/Projectiles/Boss/BrimstoneHellblast.cs @@ -18,9 +18,9 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles.Boss } } - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/BrimstoneHellblast2.cs b/Projectiles/Boss/BrimstoneHellblast2.cs index 2056239802..81d2d736db 100644 --- a/Projectiles/Boss/BrimstoneHellblast2.cs +++ b/Projectiles/Boss/BrimstoneHellblast2.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -75,8 +75,8 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int frameHeight = texture.Height / Main.projFrames[Type]; int drawStart = frameHeight * Projectile.frame; lightColor.R = (byte)(255 * Projectile.Opacity); diff --git a/Projectiles/Boss/BrimstoneHellfireball.cs b/Projectiles/Boss/BrimstoneHellfireball.cs index 28eb48be39..c35f3e1f66 100644 --- a/Projectiles/Boss/BrimstoneHellfireball.cs +++ b/Projectiles/Boss/BrimstoneHellfireball.cs @@ -12,9 +12,9 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 6; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Boss/BrimstoneMonster.cs b/Projectiles/Boss/BrimstoneMonster.cs index 661c9fd3d7..bf47477ee5 100644 --- a/Projectiles/Boss/BrimstoneMonster.cs +++ b/Projectiles/Boss/BrimstoneMonster.cs @@ -371,7 +371,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; lightColor.R = (byte)(255 * Projectile.Opacity); Main.spriteBatch.End(); Effect shieldEffect = Filters.Scene["CalamityMod:HellBall"].GetShader().Shader; diff --git a/Projectiles/Boss/BrimstoneRay.cs b/Projectiles/Boss/BrimstoneRay.cs index 7e18a2f859..860895fc39 100644 --- a/Projectiles/Boss/BrimstoneRay.cs +++ b/Projectiles/Boss/BrimstoneRay.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() @@ -172,7 +172,7 @@ namespace CalamityMod.Projectiles.Boss { return false; } - Texture2D texture2D19 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture2D19 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D texture2D20 = ModContent.Request("CalamityMod/ExtraTextures/Lasers/BrimstoneRayMid", AssetRequestMode.ImmediateLoad).Value; Texture2D texture2D21 = ModContent.Request("CalamityMod/ExtraTextures/Lasers/BrimstoneRayEnd", AssetRequestMode.ImmediateLoad).Value; float rayDrawLength = Projectile.localAI[1]; //length of laser diff --git a/Projectiles/Boss/BrimstoneTargetRay.cs b/Projectiles/Boss/BrimstoneTargetRay.cs index 8d402eab10..02cfc656a3 100644 --- a/Projectiles/Boss/BrimstoneTargetRay.cs +++ b/Projectiles/Boss/BrimstoneTargetRay.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() @@ -117,7 +117,7 @@ namespace CalamityMod.Projectiles.Boss { return false; } - Texture2D texture2D19 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture2D19 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D texture2D20 = ModContent.Request("CalamityMod/ExtraTextures/Lasers/BrimstoneRayMid", AssetRequestMode.ImmediateLoad).Value; Texture2D texture2D21 = ModContent.Request("CalamityMod/ExtraTextures/Lasers/BrimstoneRayEnd", AssetRequestMode.ImmediateLoad).Value; float rayDrawLength = Projectile.localAI[1]; //length of laser diff --git a/Projectiles/Boss/BrimstoneWave.cs b/Projectiles/Boss/BrimstoneWave.cs index abb32499e3..b55aad687d 100644 --- a/Projectiles/Boss/BrimstoneWave.cs +++ b/Projectiles/Boss/BrimstoneWave.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -78,8 +78,8 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = texture.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; lightColor.R = (byte)(255 * Projectile.Opacity); diff --git a/Projectiles/Boss/CirrusBlast.cs b/Projectiles/Boss/CirrusBlast.cs index 3f0496de0d..37c926aaa8 100644 --- a/Projectiles/Boss/CirrusBlast.cs +++ b/Projectiles/Boss/CirrusBlast.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 10; + Main.projFrames[Type] = 10; } public override void SetDefaults() @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Boss // Determine frames. Projectile.frameCounter++; if (Projectile.frameCounter % 5f == 4f) - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; } public override bool CanHitPlayer(Player target) => Projectile.scale >= 0.5f; @@ -105,9 +105,9 @@ namespace CalamityMod.Projectiles.Boss return false; Color beamColor = LaserOverlayColor; - Rectangle startFrameArea = LaserBeginTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); - Rectangle middleFrameArea = LaserMiddleTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); - Rectangle endFrameArea = LaserEndTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Rectangle startFrameArea = LaserBeginTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Rectangle middleFrameArea = LaserMiddleTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Rectangle endFrameArea = LaserEndTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); // Start texture drawing. Vector2 centerOnLaser = Projectile.Center + Projectile.velocity * Projectile.scale * 116f; diff --git a/Projectiles/Boss/CirrusPhotonRipperPrismTooth.cs b/Projectiles/Boss/CirrusPhotonRipperPrismTooth.cs index 7465dfea8a..9a06af2a88 100644 --- a/Projectiles/Boss/CirrusPhotonRipperPrismTooth.cs +++ b/Projectiles/Boss/CirrusPhotonRipperPrismTooth.cs @@ -28,8 +28,8 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 36; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 36; } public override void SetDefaults() @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Boss Time++; } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox.TopLeft(), targetHitbox.Size()); + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox); public void AbsolutelyFuckingAnnihilateTrees(int x, int y) { diff --git a/Projectiles/Boss/CirrusPhotonRipperProjectile.cs b/Projectiles/Boss/CirrusPhotonRipperProjectile.cs index 8e5c509e28..c7363796be 100644 --- a/Projectiles/Boss/CirrusPhotonRipperProjectile.cs +++ b/Projectiles/Boss/CirrusPhotonRipperProjectile.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D glowmaskTexture = ModContent.Request("CalamityMod/Projectiles/Melee/PhotonRipperGlowmask").Value; Rectangle glowmaskRectangle = glowmaskTexture.Frame(1, 6, 0, Projectile.frame); Vector2 origin = texture.Size() * 0.5f; diff --git a/Projectiles/Boss/CirrusVolatileVodkaBottle.cs b/Projectiles/Boss/CirrusVolatileVodkaBottle.cs index b4efe39513..e4dc7f5c1c 100644 --- a/Projectiles/Boss/CirrusVolatileVodkaBottle.cs +++ b/Projectiles/Boss/CirrusVolatileVodkaBottle.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Boss/CursedFire.cs b/Projectiles/Boss/CursedFire.cs index cf3185f8ab..cf1555fc68 100644 --- a/Projectiles/Boss/CursedFire.cs +++ b/Projectiles/Boss/CursedFire.cs @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D fire = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D fire = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D mist = ModContent.Request("CalamityMod/Particles/MediumMist").Value; // The conga line of colors to sift through diff --git a/Projectiles/Boss/DarkEnergyBall.cs b/Projectiles/Boss/DarkEnergyBall.cs index b9e79f2352..ad7fa65911 100644 --- a/Projectiles/Boss/DarkEnergyBall.cs +++ b/Projectiles/Boss/DarkEnergyBall.cs @@ -17,9 +17,9 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = DarkEnergy.FrameCount; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = DarkEnergy.FrameCount; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -70,14 +70,14 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } public override void PostDraw(Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int height = texture.Height / Main.projFrames[Type]; int drawStart = height * Projectile.frame; Vector2 origin = Projectile.Size / 2; Main.EntitySpriteDraw(ModContent.Request($"{Texture}Glow").Value, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, drawStart, texture.Width, height)), Color.White * Projectile.Opacity, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Boss/DarkEnergyBall2.cs b/Projectiles/Boss/DarkEnergyBall2.cs index 7ad6d26771..17076168fc 100644 --- a/Projectiles/Boss/DarkEnergyBall2.cs +++ b/Projectiles/Boss/DarkEnergyBall2.cs @@ -17,9 +17,9 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = DarkEnergy.FrameCount; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = DarkEnergy.FrameCount; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -68,14 +68,14 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } public override void PostDraw(Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int height = texture.Height / Main.projFrames[Type]; int drawStart = height * Projectile.frame; Vector2 origin = Projectile.Size / 2; Main.EntitySpriteDraw(ModContent.Request($"{Texture}Glow").Value, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, drawStart, texture.Width, height)), Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Boss/DarkOrb.cs b/Projectiles/Boss/DarkOrb.cs index 3fbd229136..07d6295347 100644 --- a/Projectiles/Boss/DarkOrb.cs +++ b/Projectiles/Boss/DarkOrb.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -557,7 +557,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Boss/DesertScourgeDiveSplash.cs b/Projectiles/Boss/DesertScourgeDiveSplash.cs index 39d9946a5f..42f310eac0 100644 --- a/Projectiles/Boss/DesertScourgeDiveSplash.cs +++ b/Projectiles/Boss/DesertScourgeDiveSplash.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 14; + Main.projFrames[Type] = 14; } public override void SetDefaults() @@ -37,13 +37,13 @@ namespace CalamityMod.Projectiles.Boss Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.Kill(); } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); return false; } } diff --git a/Projectiles/Boss/DesertScourgeSpit.cs b/Projectiles/Boss/DesertScourgeSpit.cs index 66d6e6d8e8..a7e4915e0e 100644 --- a/Projectiles/Boss/DesertScourgeSpit.cs +++ b/Projectiles/Boss/DesertScourgeSpit.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; Projectile.tileCollide = Projectile.timeLeft < (Projectile.aiStyle == ProjAIStyleID.Arrow ? 540 : 300); @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Boss/DeusRitualDrama.cs b/Projectiles/Boss/DeusRitualDrama.cs index 0ba41b6cb2..8ff63ebb1e 100644 --- a/Projectiles/Boss/DeusRitualDrama.cs +++ b/Projectiles/Boss/DeusRitualDrama.cs @@ -118,7 +118,7 @@ namespace CalamityMod.Projectiles.Boss public void DrawStars(SpriteBatch spriteBatch, Vector2 offset) { - Texture2D starTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D starTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; for (int i = 0; i < 6; i++) { float angle = MathHelper.TwoPi * i / 6f + Time / 15f; diff --git a/Projectiles/Boss/DoGBeam.cs b/Projectiles/Boss/DoGBeam.cs index 109c0b94bf..6be31c977f 100644 --- a/Projectiles/Boss/DoGBeam.cs +++ b/Projectiles/Boss/DoGBeam.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 2; + Main.projFrames[Type] = 2; } public override void SetDefaults() diff --git a/Projectiles/Boss/DoGBeamPortal.cs b/Projectiles/Boss/DoGBeamPortal.cs index 8b54b531b6..dca2e08b29 100644 --- a/Projectiles/Boss/DoGBeamPortal.cs +++ b/Projectiles/Boss/DoGBeamPortal.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; + Main.projFrames[Type] = 6; } public override void SetDefaults() diff --git a/Projectiles/Boss/DoGDeath.cs b/Projectiles/Boss/DoGDeath.cs index f3b3d87ad7..b1ff1dcefa 100644 --- a/Projectiles/Boss/DoGDeath.cs +++ b/Projectiles/Boss/DoGDeath.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() diff --git a/Projectiles/Boss/DoGDeathBoom.cs b/Projectiles/Boss/DoGDeathBoom.cs index 8ffe85d908..7cf01dd3ac 100644 --- a/Projectiles/Boss/DoGDeathBoom.cs +++ b/Projectiles/Boss/DoGDeathBoom.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() diff --git a/Projectiles/Boss/DoGFire.cs b/Projectiles/Boss/DoGFire.cs index cf979d61ab..315a98ac61 100644 --- a/Projectiles/Boss/DoGFire.cs +++ b/Projectiles/Boss/DoGFire.cs @@ -12,9 +12,9 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 6; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/DoGP1EndPortal.cs b/Projectiles/Boss/DoGP1EndPortal.cs index 0a12f1f6e9..cd920619f3 100644 --- a/Projectiles/Boss/DoGP1EndPortal.cs +++ b/Projectiles/Boss/DoGP1EndPortal.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() diff --git a/Projectiles/Boss/DoGTeleportRift.cs b/Projectiles/Boss/DoGTeleportRift.cs index a57fd76e88..bf28c53f02 100644 --- a/Projectiles/Boss/DoGTeleportRift.cs +++ b/Projectiles/Boss/DoGTeleportRift.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Boss { float lerpMult = Utils.GetLerpValue(15f, 30f, Projectile.timeLeft, clamped: true) * Utils.GetLerpValue(240f, 200f, Projectile.timeLeft, clamped: true) * (1f + 0.2f * (float)Math.Cos(Main.GlobalTimeWrappedHourly % 30f / 0.5f * (MathHelper.Pi * 2f) * 3f)) * 0.8f; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); Color baseColor = new Color(150, 100, 255, 255) * Projectile.Opacity; baseColor *= 0.5f; diff --git a/Projectiles/Boss/DraedonSummonLaser.cs b/Projectiles/Boss/DraedonSummonLaser.cs index 173b3f3adf..2326b291de 100644 --- a/Projectiles/Boss/DraedonSummonLaser.cs +++ b/Projectiles/Boss/DraedonSummonLaser.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() diff --git a/Projectiles/Boss/DyingSun.cs b/Projectiles/Boss/DyingSun.cs index bf24ecdc3e..ebd8996414 100644 --- a/Projectiles/Boss/DyingSun.cs +++ b/Projectiles/Boss/DyingSun.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Boss public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() diff --git a/Projectiles/Boss/Flare.cs b/Projectiles/Boss/Flare.cs index c187276e6b..5341af3da0 100644 --- a/Projectiles/Boss/Flare.cs +++ b/Projectiles/Boss/Flare.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Projectiles.Boss public static readonly SoundStyle FlareSound = new("CalamityMod/Sounds/Custom/Yharon/YharonInfernado"); public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/FlareBomb.cs b/Projectiles/Boss/FlareBomb.cs index a77545e689..b46e89914d 100644 --- a/Projectiles/Boss/FlareBomb.cs +++ b/Projectiles/Boss/FlareBomb.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; } public override void SetDefaults() @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; Lighting.AddLight(Projectile.Center, 0.5f, 0.25f, 0f); @@ -104,8 +104,8 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = texture.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Rectangle(0, y6, texture.Width, framing), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Boss/FlareDust.cs b/Projectiles/Boss/FlareDust.cs index 82112ea89f..29eca0fc93 100644 --- a/Projectiles/Boss/FlareDust.cs +++ b/Projectiles/Boss/FlareDust.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; } public override void SetDefaults() @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; Lighting.AddLight(Projectile.Center, 0.5f, 0.25f, 0f); @@ -112,8 +112,8 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = texture.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Boss/FlareDust2.cs b/Projectiles/Boss/FlareDust2.cs index afb50d3182..0627b6fd6b 100644 --- a/Projectiles/Boss/FlareDust2.cs +++ b/Projectiles/Boss/FlareDust2.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; } public override void SetDefaults() @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; Lighting.AddLight(Projectile.Center, 0.5f, 0.25f, 0f); @@ -52,8 +52,8 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = texture.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Boss/Flarenado.cs b/Projectiles/Boss/Flarenado.cs index f3e4b4c37a..e8e1ce6b58 100644 --- a/Projectiles/Boss/Flarenado.cs +++ b/Projectiles/Boss/Flarenado.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 12; + Main.projFrames[Type] = 12; } public override void SetDefaults() @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -146,8 +146,8 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = texture.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Boss/FoveanatorEnergyBomb.cs b/Projectiles/Boss/FoveanatorEnergyBomb.cs index 43f47f9196..246e80bfb4 100644 --- a/Projectiles/Boss/FoveanatorEnergyBomb.cs +++ b/Projectiles/Boss/FoveanatorEnergyBomb.cs @@ -145,7 +145,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - Texture2D texture = TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = TextureAssets.Projectile[Type].Value; Vector2 position = Projectile.Center - Main.screenPosition; Vector2 origin = texture.Size() / new Vector2(TotalXFrames, TotalYFrames) * 0.5f; Rectangle frame = texture.Frame(TotalXFrames, TotalYFrames, frameX, frameY); diff --git a/Projectiles/Boss/FoveanatorFlamethrower.cs b/Projectiles/Boss/FoveanatorFlamethrower.cs index 91cdcfcef5..6583bef428 100644 --- a/Projectiles/Boss/FoveanatorFlamethrower.cs +++ b/Projectiles/Boss/FoveanatorFlamethrower.cs @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D fire = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D fire = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D mist = ModContent.Request("CalamityMod/Particles/MediumMist").Value; // The conga line of colors to sift through diff --git a/Projectiles/Boss/FoveanatorLaser.cs b/Projectiles/Boss/FoveanatorLaser.cs index aaaa696a2e..fc73073e84 100644 --- a/Projectiles/Boss/FoveanatorLaser.cs +++ b/Projectiles/Boss/FoveanatorLaser.cs @@ -20,9 +20,9 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/FrostMist.cs b/Projectiles/Boss/FrostMist.cs index 8cddc3dd3d..dc8229123f 100644 --- a/Projectiles/Boss/FrostMist.cs +++ b/Projectiles/Boss/FrostMist.cs @@ -12,9 +12,9 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 8; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 8; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; if (Projectile.ai[1] == 0f) @@ -116,7 +116,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/GreatSandBlast.cs b/Projectiles/Boss/GreatSandBlast.cs index 9a6e845e2d..b7fa0c573f 100644 --- a/Projectiles/Boss/GreatSandBlast.cs +++ b/Projectiles/Boss/GreatSandBlast.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Boss/HiveBombGoliath.cs b/Projectiles/Boss/HiveBombGoliath.cs index 14a62b1d0a..0ebaf1fcc6 100644 --- a/Projectiles/Boss/HiveBombGoliath.cs +++ b/Projectiles/Boss/HiveBombGoliath.cs @@ -17,9 +17,9 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -87,15 +87,15 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { Projectile.DrawBackglow(PlaguebringerGoliath.BackglowColor, 4f); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); Texture2D glow = ModContent.Request("CalamityMod/Projectiles/Boss/HiveBombGoliathGlow").Value; - Vector2 textureArea = new Vector2(glow.Width / 2, glow.Height / Main.projFrames[Projectile.type] / 2); + Vector2 textureArea = new Vector2(glow.Width / 2, glow.Height / Main.projFrames[Type] / 2); Vector2 drawArea = Projectile.Center - Main.screenPosition; - drawArea -= new Vector2(glow.Width, glow.Height / Main.projFrames[Projectile.type]) / 2f; + drawArea -= new Vector2(glow.Width, glow.Height / Main.projFrames[Type]) / 2f; drawArea += textureArea + new Vector2(0f, Projectile.gfxOffY); Color whiteColor = Color.White; - int height = glow.Height / Main.projFrames[Projectile.type]; + int height = glow.Height / Main.projFrames[Type]; int drawStart = height * Projectile.frame; Main.spriteBatch.Draw(glow, drawArea, new Rectangle(0, drawStart, glow.Width, height), whiteColor, Projectile.rotation, textureArea, Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Boss/HolyAura.cs b/Projectiles/Boss/HolyAura.cs index 0837b1a5ea..6ef84c0b5e 100644 --- a/Projectiles/Boss/HolyAura.cs +++ b/Projectiles/Boss/HolyAura.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 origin = texture.Size() / 2f; float time = Main.GlobalTimeWrappedHourly % 10f / 10f; Vector2 drawPosition = Projectile.Center - Main.screenPosition; diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index 5914bc44da..d38d41e26d 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void OnSpawn(IEntitySource source) @@ -127,8 +127,8 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyBlastNight").Value; - int framing = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyBlastNight").Value; + int framing = texture.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Vector2 sc = Vector2.One; Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, sc, texture); diff --git a/Projectiles/Boss/HolyBomb.cs b/Projectiles/Boss/HolyBomb.cs index 228eb43f73..783cbbc98c 100644 --- a/Projectiles/Boss/HolyBomb.cs +++ b/Projectiles/Boss/HolyBomb.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -92,8 +92,8 @@ namespace CalamityMod.Projectiles.Boss { float squish = CalamityUtils.SineBumpEasing(SquishAnimation, 1) * 0.25f; - Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyBombNight").Value; - int framing = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyBombNight").Value; + int framing = texture.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, new Vector2(Projectile.scale + squish, Projectile.scale - squish), texture, offset: new Vector2(0, (-22 * (1 - squish)))); Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, (framing / 2f) + 22), new Vector2(Projectile.scale + squish, Projectile.scale - squish), SpriteEffects.None, 0); diff --git a/Projectiles/Boss/HolyBurnOrb.cs b/Projectiles/Boss/HolyBurnOrb.cs index c8a9dcbb94..1a981b694b 100644 --- a/Projectiles/Boss/HolyBurnOrb.cs +++ b/Projectiles/Boss/HolyBurnOrb.cs @@ -89,7 +89,7 @@ namespace CalamityMod.Projectiles.Boss { float lerpMult = MathHelper.Lerp(0.5f, 1.5f, Math.Abs((float)Math.Sin(Projectile.localAI[1] / 10f))); - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); Color baseColor = ProvUtils.GetProjectileColor(255, true) * 4; Color baseColor2 = ProvUtils.GetProjectileColor(255); diff --git a/Projectiles/Boss/HolyExplosionBoom.cs b/Projectiles/Boss/HolyExplosionBoom.cs index a543577f17..0a1fde0f20 100644 --- a/Projectiles/Boss/HolyExplosionBoom.cs +++ b/Projectiles/Boss/HolyExplosionBoom.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() diff --git a/Projectiles/Boss/HolyFire.cs b/Projectiles/Boss/HolyFire.cs index 612d6e1542..af899962cb 100644 --- a/Projectiles/Boss/HolyFire.cs +++ b/Projectiles/Boss/HolyFire.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -65,8 +65,8 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { Projectile.scale = 1.5f; - Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFireNight").Value; - int framing = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFireNight").Value; + int framing = texture.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, new Vector2(Projectile.scale)); Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, framing / 2f), Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Boss/HolyFire2.cs b/Projectiles/Boss/HolyFire2.cs index 360f7796a4..6c7602c239 100644 --- a/Projectiles/Boss/HolyFire2.cs +++ b/Projectiles/Boss/HolyFire2.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -86,8 +86,8 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFire2Night").Value; - int framing = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFire2Night").Value; + int framing = texture.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, texture); Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, framing / 2f), Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Boss/HolyFlare.cs b/Projectiles/Boss/HolyFlare.cs index 72817641c2..1fc4462898 100644 --- a/Projectiles/Boss/HolyFlare.cs +++ b/Projectiles/Boss/HolyFlare.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -93,8 +93,8 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFlareNight").Value; - int framing = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFlareNight").Value; + int framing = texture.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, texture); Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, framing / 2f), Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Boss/HolyLight.cs b/Projectiles/Boss/HolyLight.cs index 1a0d114a9f..31319ee9f3 100644 --- a/Projectiles/Boss/HolyLight.cs +++ b/Projectiles/Boss/HolyLight.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Projectiles.Boss float vel = Projectile.velocity.Length() / 8; Projectile.localAI[1] += vel; - Texture2D drawTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D drawTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Color brightGreen = new Color(54, 209, 54, 0); Vector2 projDirection = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); Vector2 halfTextureSize = drawTexture.Size() / 2f; diff --git a/Projectiles/Boss/HolySpear.cs b/Projectiles/Boss/HolySpear.cs index 8f1d475119..e09f2ac6e0 100644 --- a/Projectiles/Boss/HolySpear.cs +++ b/Projectiles/Boss/HolySpear.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -153,7 +153,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D drawTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D drawTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; bool aimedSpear = Projectile.ai[0] > 0f; Color baseColor = new Color(255, aimedSpear ? 255 : 125, aimedSpear ? 25 : 125); // Default to day diff --git a/Projectiles/Boss/HomingGasBulb.cs b/Projectiles/Boss/HomingGasBulb.cs index 790a2bcb87..2c080802a1 100644 --- a/Projectiles/Boss/HomingGasBulb.cs +++ b/Projectiles/Boss/HomingGasBulb.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); return false; } diff --git a/Projectiles/Boss/HomingGasBulbSporeGas.cs b/Projectiles/Boss/HomingGasBulbSporeGas.cs index bbe7f1e2c8..d467e3eeb4 100644 --- a/Projectiles/Boss/HomingGasBulbSporeGas.cs +++ b/Projectiles/Boss/HomingGasBulbSporeGas.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { // Changes the texture of the projectile - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; switch ((int)Projectile.ai[0]) { case 0: @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Boss default: break; } - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, texture); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1, texture); return false; } diff --git a/Projectiles/Boss/HomingLaserDart.cs b/Projectiles/Boss/HomingLaserDart.cs index 49f9f9c9e7..dc93ed2c2b 100644 --- a/Projectiles/Boss/HomingLaserDart.cs +++ b/Projectiles/Boss/HomingLaserDart.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 5; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -205,7 +205,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/IchorBlob.cs b/Projectiles/Boss/IchorBlob.cs index 8f266377bd..479fb920eb 100644 --- a/Projectiles/Boss/IchorBlob.cs +++ b/Projectiles/Boss/IchorBlob.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - Main.projFrames[Projectile.type] = 6; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; + Main.projFrames[Type] = 6; } public override void SetDefaults() @@ -185,7 +185,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); return false; } diff --git a/Projectiles/Boss/IchorShot.cs b/Projectiles/Boss/IchorShot.cs index 0f7d9381e2..f1e2338a03 100644 --- a/Projectiles/Boss/IchorShot.cs +++ b/Projectiles/Boss/IchorShot.cs @@ -11,9 +11,9 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 6; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Boss/Infernado.cs b/Projectiles/Boss/Infernado.cs index 0e50df4913..691c909e79 100644 --- a/Projectiles/Boss/Infernado.cs +++ b/Projectiles/Boss/Infernado.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 12; + Main.projFrames[Type] = 12; } public override void SetDefaults() @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -148,8 +148,8 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Boss/Infernado2.cs b/Projectiles/Boss/Infernado2.cs index 74b3d2dcec..c73d5dc424 100644 --- a/Projectiles/Boss/Infernado2.cs +++ b/Projectiles/Boss/Infernado2.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 12; + Main.projFrames[Type] = 12; } public override void SetDefaults() @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -142,8 +142,8 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Boss/InfernadoRevenge.cs b/Projectiles/Boss/InfernadoRevenge.cs index bfc028fc5b..8284f6abec 100644 --- a/Projectiles/Boss/InfernadoRevenge.cs +++ b/Projectiles/Boss/InfernadoRevenge.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Boss public const int TornadoHeight = 8800; public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() diff --git a/Projectiles/Boss/JewelProjectile.cs b/Projectiles/Boss/JewelProjectile.cs index 39e6688a01..d9bbbe769f 100644 --- a/Projectiles/Boss/JewelProjectile.cs +++ b/Projectiles/Boss/JewelProjectile.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Boss/LeviathanBomb.cs b/Projectiles/Boss/LeviathanBomb.cs index ff64d08ed9..f995b4634f 100644 --- a/Projectiles/Boss/LeviathanBomb.cs +++ b/Projectiles/Boss/LeviathanBomb.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Boss/LeviathanSpawner.cs b/Projectiles/Boss/LeviathanSpawner.cs index 13873a7d62..5bca369957 100644 --- a/Projectiles/Boss/LeviathanSpawner.cs +++ b/Projectiles/Boss/LeviathanSpawner.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Boss public static readonly SoundStyle RumbleSound = new("CalamityMod/Sounds/Custom/LeviathanRumble"); public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() diff --git a/Projectiles/Boss/MajesticSparkle.cs b/Projectiles/Boss/MajesticSparkle.cs index aab013ceda..c956aaf35b 100644 --- a/Projectiles/Boss/MajesticSparkle.cs +++ b/Projectiles/Boss/MajesticSparkle.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Boss } public override bool PreDraw(ref Color lightColor) { - Texture2D sparkleTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D sparkleTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition + Vector2.UnitY * Projectile.gfxOffY; Color sparkleColor = Main.hslToRgb(ColorSpectrumHue, 1f, 0.5f) * Projectile.Opacity * 0.5f; diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index c9d5306155..e6f75f7469 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -123,8 +123,8 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/MoltenBlastNight").Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/MoltenBlastNight").Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Projectile.DrawBackglow(ProvUtils.GetProjectileColor(Projectile.alpha, true), 4f, texture); Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, framing / 2f), Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Boss/MoltenBlob.cs b/Projectiles/Boss/MoltenBlob.cs index 6e1562fccd..83f9446068 100644 --- a/Projectiles/Boss/MoltenBlob.cs +++ b/Projectiles/Boss/MoltenBlob.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; + Main.projFrames[Type] = 3; } public override void SetDefaults() @@ -101,8 +101,8 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/MoltenBlobNight").Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/MoltenBlobNight").Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * (1 + Projectile.frame); float squish = CalamityUtils.SineBumpEasing(Landing, 1) * 0.5f; Projectile.rotation = 0f; diff --git a/Projectiles/Boss/MushBomb.cs b/Projectiles/Boss/MushBomb.cs index 13f66d6d3f..3b31f317a9 100644 --- a/Projectiles/Boss/MushBomb.cs +++ b/Projectiles/Boss/MushBomb.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -86,8 +86,8 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int height = texture.Height / Main.projFrames[Type]; int drawStart = height * Projectile.frame; Vector2 origin = Projectile.Size / 2; Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, drawStart, texture.Width, height)), Color.White * Projectile.Opacity, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); @@ -96,8 +96,8 @@ namespace CalamityMod.Projectiles.Boss public override void PostDraw(Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int height = texture.Height / Main.projFrames[Type]; int drawStart = height * Projectile.frame; Vector2 origin = Projectile.Size / 2; SpriteEffects spriteEffects = SpriteEffects.None; diff --git a/Projectiles/Boss/MushBombFall.cs b/Projectiles/Boss/MushBombFall.cs index bbc5cadcfe..5645ec3df9 100644 --- a/Projectiles/Boss/MushBombFall.cs +++ b/Projectiles/Boss/MushBombFall.cs @@ -13,10 +13,11 @@ namespace CalamityMod.Projectiles.Boss public class MushBombFall : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Boss"; + public override string Texture => "CalamityMod/Projectiles/Boss/MushBomb"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -89,8 +90,8 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int height = texture.Height / Main.projFrames[Type]; int drawStart = height * Projectile.frame; Vector2 origin = Projectile.Size / 2; SpriteEffects spriteEffects = SpriteEffects.None; @@ -103,8 +104,8 @@ namespace CalamityMod.Projectiles.Boss public override void PostDraw(Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int height = texture.Height / Main.projFrames[Type]; int drawStart = height * Projectile.frame; Vector2 origin = Projectile.Size / 2; Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Projectiles/Boss/MushBombGlow").Value, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, drawStart, texture.Width, height)), Color.White * Projectile.Opacity, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Boss/MushBombFall.png b/Projectiles/Boss/MushBombFall.png deleted file mode 100644 index 279f8aa2b9..0000000000 Binary files a/Projectiles/Boss/MushBombFall.png and /dev/null differ diff --git a/Projectiles/Boss/OldDukeGore.cs b/Projectiles/Boss/OldDukeGore.cs index fb1110f055..382dc902b0 100644 --- a/Projectiles/Boss/OldDukeGore.cs +++ b/Projectiles/Boss/OldDukeGore.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Boss/OldDukeSummonDrop.cs b/Projectiles/Boss/OldDukeSummonDrop.cs index 5dff1c3c95..abb9efda0c 100644 --- a/Projectiles/Boss/OldDukeSummonDrop.cs +++ b/Projectiles/Boss/OldDukeSummonDrop.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], new Color(255, 255, 255, 127), 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], new Color(255, 255, 255, 127), 2); return false; } } diff --git a/Projectiles/Boss/OldDukeVortex.cs b/Projectiles/Boss/OldDukeVortex.cs index f2c1fd5171..264a595984 100644 --- a/Projectiles/Boss/OldDukeVortex.cs +++ b/Projectiles/Boss/OldDukeVortex.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -150,7 +150,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/OverlyDramaticDukeSummoner.cs b/Projectiles/Boss/OverlyDramaticDukeSummoner.cs index 895de7bbf4..b0c177b13f 100644 --- a/Projectiles/Boss/OverlyDramaticDukeSummoner.cs +++ b/Projectiles/Boss/OverlyDramaticDukeSummoner.cs @@ -19,9 +19,9 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() @@ -181,7 +181,7 @@ namespace CalamityMod.Projectiles.Boss bottomY--; Vector2 bottomVector = new Vector2(centerAsTileCoords.X, bottomY) * 16f + new Vector2(8f); - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; float yMax = 1600f * Projectile.scale; for (int y = 0; y < yMax; y += 30) { diff --git a/Projectiles/Boss/PeanutRocket.cs b/Projectiles/Boss/PeanutRocket.cs index e754966886..e0e203d817 100644 --- a/Projectiles/Boss/PeanutRocket.cs +++ b/Projectiles/Boss/PeanutRocket.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 9; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 9; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/PlagueStingerGoliath.cs b/Projectiles/Boss/PlagueStingerGoliath.cs index fc59234722..0f064415ea 100644 --- a/Projectiles/Boss/PlagueStingerGoliath.cs +++ b/Projectiles/Boss/PlagueStingerGoliath.cs @@ -59,16 +59,16 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { Projectile.DrawBackglow(PlaguebringerGoliath.BackglowColor, 4f); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); return false; } public override void PostDraw(Color lightColor) { Texture2D glow = ModContent.Request("CalamityMod/Projectiles/Boss/PlagueStingerGoliathGlow").Value; - Vector2 textureArea = new Vector2(glow.Width / 2, glow.Height / Main.projFrames[Projectile.type] / 2); + Vector2 textureArea = new Vector2(glow.Width / 2, glow.Height / Main.projFrames[Type] / 2); Vector2 drawArea = Projectile.Center - Main.screenPosition; - drawArea -= new Vector2(glow.Width, glow.Height / Main.projFrames[Projectile.type]) / 2f; + drawArea -= new Vector2(glow.Width, glow.Height / Main.projFrames[Type]) / 2f; drawArea += textureArea + new Vector2(0f, Projectile.gfxOffY); Color whiteColor = Color.White; Main.spriteBatch.Draw(glow, drawArea, null, whiteColor, Projectile.rotation, textureArea, Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Boss/PlagueStingerGoliathV2.cs b/Projectiles/Boss/PlagueStingerGoliathV2.cs index a7615548da..cba5fae545 100644 --- a/Projectiles/Boss/PlagueStingerGoliathV2.cs +++ b/Projectiles/Boss/PlagueStingerGoliathV2.cs @@ -45,16 +45,16 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { Projectile.DrawBackglow(PlaguebringerGoliath.BackglowColor, 4f); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); return false; } public override void PostDraw(Color lightColor) { Texture2D glow = ModContent.Request("CalamityMod/Projectiles/Boss/PlagueStingerGoliathGlow").Value; - Vector2 origin = new Vector2(glow.Width / 2, glow.Height / Main.projFrames[Projectile.type] / 2); + Vector2 origin = new Vector2(glow.Width / 2, glow.Height / Main.projFrames[Type] / 2); Vector2 drawPos = Projectile.Center - Main.screenPosition; - drawPos -= new Vector2(glow.Width, glow.Height / Main.projFrames[Projectile.type]) / 2f; + drawPos -= new Vector2(glow.Width, glow.Height / Main.projFrames[Type]) / 2f; drawPos += origin + new Vector2(0f, Projectile.gfxOffY); Color whiteColor = Color.White; Main.spriteBatch.Draw(glow, drawPos, null, whiteColor, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Boss/ProfanedSpear.cs b/Projectiles/Boss/ProfanedSpear.cs index ecaaa25008..d3cf52037b 100644 --- a/Projectiles/Boss/ProfanedSpear.cs +++ b/Projectiles/Boss/ProfanedSpear.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -66,10 +66,10 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/ProfanedSpearNight").Value; + Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/ProfanedSpearNight").Value; Projectile.DrawBackglow(ProvUtils.GetDayNightColor(Projectile.alpha, true), 4f, texture); Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, texture.Height / 2f), Projectile.scale, SpriteEffects.None, 0); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/ProvidenceCrystal.cs b/Projectiles/Boss/ProvidenceCrystal.cs index a90cc4a6a7..3b03365fff 100644 --- a/Projectiles/Boss/ProvidenceCrystal.cs +++ b/Projectiles/Boss/ProvidenceCrystal.cs @@ -171,8 +171,8 @@ namespace CalamityMod.Projectiles.Boss { Color colorArea = Lighting.GetColor((int)(Projectile.position.X + Projectile.width * 0.5) / 16, (int)((Projectile.position.Y + Projectile.height * 0.5) / 16.0)); Vector2 drawArea = Projectile.position + new Vector2(Projectile.width, Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; - Texture2D texture2D34 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle textureRect = texture2D34.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D texture2D34 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle textureRect = texture2D34.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Color colorAlpha = Projectile.GetAlpha(colorArea); Vector2 halfRect = textureRect.Size() / 2f; float scaleFactor = (float)Math.Cos(MathHelper.TwoPi * (Projectile.localAI[0] / 60f)) + 3f + 3f; diff --git a/Projectiles/Boss/ProvidenceCrystalShard.cs b/Projectiles/Boss/ProvidenceCrystalShard.cs index bfc1e781c0..482e4f40be 100644 --- a/Projectiles/Boss/ProvidenceCrystalShard.cs +++ b/Projectiles/Boss/ProvidenceCrystalShard.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; - ProjectileID.Sets.TrailingMode[Projectile.type] = 3; + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 3; } public override void SetDefaults() diff --git a/Projectiles/Boss/ProvidenceHolyRay.cs b/Projectiles/Boss/ProvidenceHolyRay.cs index 72a56060bf..11d92a468f 100644 --- a/Projectiles/Boss/ProvidenceHolyRay.cs +++ b/Projectiles/Boss/ProvidenceHolyRay.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() diff --git a/Projectiles/Boss/RavagerBlast.cs b/Projectiles/Boss/RavagerBlast.cs index 61b4becedc..66ba50876e 100644 --- a/Projectiles/Boss/RavagerBlast.cs +++ b/Projectiles/Boss/RavagerBlast.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 10; + Main.projFrames[Type] = 10; } public override void SetDefaults() @@ -113,7 +113,7 @@ namespace CalamityMod.Projectiles.Boss // Determine frames. Projectile.frameCounter++; if (Projectile.frameCounter % 5f == 4f) - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; } // Can hit if white (regardless of condition) or blue only if the player is (close to) still @@ -126,9 +126,9 @@ namespace CalamityMod.Projectiles.Boss return false; Color beamColor = LaserOverlayColor; - Rectangle startFrameArea = LaserBeginTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); - Rectangle middleFrameArea = LaserMiddleTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); - Rectangle endFrameArea = LaserEndTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Rectangle startFrameArea = LaserBeginTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Rectangle middleFrameArea = LaserMiddleTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Rectangle endFrameArea = LaserEndTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); // Start texture drawing. Vector2 centerOnLaser = Projectile.Center + Projectile.velocity * Projectile.scale * 116f; diff --git a/Projectiles/Boss/RedLightning.cs b/Projectiles/Boss/RedLightning.cs index b16281511c..7f2f6405fa 100644 --- a/Projectiles/Boss/RedLightning.cs +++ b/Projectiles/Boss/RedLightning.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() diff --git a/Projectiles/Boss/RedLightningFeather.cs b/Projectiles/Boss/RedLightningFeather.cs index d11b3fe2b4..4941a9ffe3 100644 --- a/Projectiles/Boss/RedLightningFeather.cs +++ b/Projectiles/Boss/RedLightningFeather.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value, false); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1, Terraria.GameContent.TextureAssets.Projectile[Type].Value, false); return false; } diff --git a/Projectiles/Boss/SCalBrimstoneFireblast.cs b/Projectiles/Boss/SCalBrimstoneFireblast.cs index fce044dea7..17595f148b 100644 --- a/Projectiles/Boss/SCalBrimstoneFireblast.cs +++ b/Projectiles/Boss/SCalBrimstoneFireblast.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Boss public bool setLifetime = false; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; } public override void SetDefaults() @@ -159,8 +159,8 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int frameHeight = texture.Height / Main.projFrames[Type]; int drawStart = frameHeight * Projectile.frame; lightColor.R = (byte)(255 * Projectile.Opacity); diff --git a/Projectiles/Boss/SCalBrimstoneGigablast.cs b/Projectiles/Boss/SCalBrimstoneGigablast.cs index c0c1fab63b..4ac7522311 100644 --- a/Projectiles/Boss/SCalBrimstoneGigablast.cs +++ b/Projectiles/Boss/SCalBrimstoneGigablast.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Boss public bool setLifetime = false; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; + Main.projFrames[Type] = 6; } public override void SetDefaults() @@ -144,8 +144,8 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int frameHeight = texture.Height / Main.projFrames[Type]; int drawStart = frameHeight * Projectile.frame; lightColor.R = (byte)(255 * Projectile.Opacity); diff --git a/Projectiles/Boss/SCalRitualDrama.cs b/Projectiles/Boss/SCalRitualDrama.cs index f72cbabdbf..22850fc1e5 100644 --- a/Projectiles/Boss/SCalRitualDrama.cs +++ b/Projectiles/Boss/SCalRitualDrama.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Boss public const int TotalRitualTime = 270; public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() diff --git a/Projectiles/Boss/SandBlast.cs b/Projectiles/Boss/SandBlast.cs index 53a8ae4d8c..9b20386e13 100644 --- a/Projectiles/Boss/SandBlast.cs +++ b/Projectiles/Boss/SandBlast.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Boss/SandPoisonCloud.cs b/Projectiles/Boss/SandPoisonCloud.cs index f769f853b0..6db2345c81 100644 --- a/Projectiles/Boss/SandPoisonCloud.cs +++ b/Projectiles/Boss/SandPoisonCloud.cs @@ -12,9 +12,9 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 10; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 10; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Boss { Projectile.damage = 0; } - else if (Projectile.frame >= Main.projFrames[Projectile.type]) + else if (Projectile.frame >= Main.projFrames[Type]) { Projectile.Kill(); } @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); CalamityUtils.DrawProjectileWithBackglow(Projectile, new Color(255, 102, 56), lightColor, 3.75f); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/SandPoisonCloudOldDuke.cs b/Projectiles/Boss/SandPoisonCloudOldDuke.cs index c79b6a8733..30db17a25a 100644 --- a/Projectiles/Boss/SandPoisonCloudOldDuke.cs +++ b/Projectiles/Boss/SandPoisonCloudOldDuke.cs @@ -12,9 +12,9 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 10; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 10; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Boss { Projectile.damage = 0; } - else if (Projectile.frame >= Main.projFrames[Projectile.type]) + else if (Projectile.frame >= Main.projFrames[Type]) { Projectile.Kill(); } @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); CalamityUtils.DrawProjectileWithBackglow(Projectile, new Color(66, 236, 113), lightColor, 3.75f); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/SandTooth.cs b/Projectiles/Boss/SandTooth.cs index 2278a12abd..f7d9a0a6f7 100644 --- a/Projectiles/Boss/SandTooth.cs +++ b/Projectiles/Boss/SandTooth.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Boss/ScavengerNuke.cs b/Projectiles/Boss/ScavengerNuke.cs index 082ee5c27a..e7dcece543 100644 --- a/Projectiles/Boss/ScavengerNuke.cs +++ b/Projectiles/Boss/ScavengerNuke.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Boss public static readonly SoundStyle ExplosionSound = new("CalamityMod/Sounds/Custom/Ravager/RavagerMissileExplosion"); public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; } public override void SetDefaults() diff --git a/Projectiles/Boss/ShadeNimbusHostile.cs b/Projectiles/Boss/ShadeNimbusHostile.cs index 9ebf0fb51a..60a4894904 100644 --- a/Projectiles/Boss/ShadeNimbusHostile.cs +++ b/Projectiles/Boss/ShadeNimbusHostile.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; + Main.projFrames[Type] = 6; } public override void SetDefaults() diff --git a/Projectiles/Boss/ShaderainHostile.cs b/Projectiles/Boss/ShaderainHostile.cs index 8fd4a72096..9c499a84de 100644 --- a/Projectiles/Boss/ShaderainHostile.cs +++ b/Projectiles/Boss/ShaderainHostile.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; Projectile.ignoreWater = true; Projectile.timeLeft = 300; - Projectile.alpha = 50; + Projectile.alpha = 255; } public override void OnKill(int timeLeft) @@ -32,7 +32,18 @@ namespace CalamityMod.Projectiles.Boss dust.scale = 0.95f; } - public override Color? GetAlpha(Color lightColor) => new Color(100, 255, 100, Projectile.alpha); + public override bool CanHitPlayer(Player target) => Projectile.timeLeft >= 85; + + public override Color? GetAlpha(Color lightColor) + { + if (Projectile.timeLeft < 85) + { + byte b2 = (byte)(Projectile.timeLeft * 3); + byte a2 = (byte)(Projectile.alpha * (b2 / 255f)); + return new Color(b2, b2, b2, a2); + } + return new Color(255, 255, 255, Projectile.alpha); + } public override void OnHitPlayer(Player target, Player.HurtInfo info) { diff --git a/Projectiles/Boss/Shadowflamethrower.cs b/Projectiles/Boss/Shadowflamethrower.cs index 78497f54c3..7021df84c2 100644 --- a/Projectiles/Boss/Shadowflamethrower.cs +++ b/Projectiles/Boss/Shadowflamethrower.cs @@ -117,7 +117,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D fire = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D fire = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D mist = ModContent.Request("CalamityMod/Particles/MediumMist").Value; // The conga line of colors to sift through diff --git a/Projectiles/Boss/SignusScythe.cs b/Projectiles/Boss/SignusScythe.cs index fba7051dee..45daa0f955 100644 --- a/Projectiles/Boss/SignusScythe.cs +++ b/Projectiles/Boss/SignusScythe.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/SirenSong.cs b/Projectiles/Boss/SirenSong.cs index c119d5920f..8a343083b5 100644 --- a/Projectiles/Boss/SirenSong.cs +++ b/Projectiles/Boss/SirenSong.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/SkyFlare.cs b/Projectiles/Boss/SkyFlare.cs index 8a7349e2c2..7e8efe47f6 100644 --- a/Projectiles/Boss/SkyFlare.cs +++ b/Projectiles/Boss/SkyFlare.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Boss public static readonly SoundStyle FlareSound = new("CalamityMod/Sounds/Custom/Yharon/YharonInfernado"); public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; } public override void SetDefaults() @@ -56,8 +56,8 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Boss/SkyFlareRevenge.cs b/Projectiles/Boss/SkyFlareRevenge.cs index 8563018980..7cb58e9c83 100644 --- a/Projectiles/Boss/SkyFlareRevenge.cs +++ b/Projectiles/Boss/SkyFlareRevenge.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; } public override void SetDefaults() @@ -46,8 +46,8 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Boss/SporeGasPlantera.cs b/Projectiles/Boss/SporeGasPlantera.cs index 3ab5f9af80..99555ff1b0 100644 --- a/Projectiles/Boss/SporeGasPlantera.cs +++ b/Projectiles/Boss/SporeGasPlantera.cs @@ -3,6 +3,7 @@ using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -11,10 +12,13 @@ namespace CalamityMod.Projectiles.Boss public class SporeGasPlantera : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Boss"; + public override string Texture => "Terraria/Images/Projectile_" + ProjectileID.SporeGas; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; + Main.instance.LoadProjectile(ProjectileID.SporeGas2); + Main.instance.LoadProjectile(ProjectileID.SporeGas3); } public override void SetDefaults() @@ -80,21 +84,21 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { // Changes the texture of the projectile - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; switch ((int)Projectile.ai[0]) { case 0: break; case 1: - texture = ModContent.Request("CalamityMod/Projectiles/Boss/SporeGasPlantera2").Value; + texture = TextureAssets.Projectile[ProjectileID.SporeGas2].Value; break; case 2: - texture = ModContent.Request("CalamityMod/Projectiles/Boss/SporeGasPlantera3").Value; + texture = TextureAssets.Projectile[ProjectileID.SporeGas3].Value; break; default: break; } - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, texture); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1, texture); return false; } diff --git a/Projectiles/Boss/SporeGasPlantera.png b/Projectiles/Boss/SporeGasPlantera.png deleted file mode 100644 index d96df4734e..0000000000 Binary files a/Projectiles/Boss/SporeGasPlantera.png and /dev/null differ diff --git a/Projectiles/Boss/SporeGasPlantera2.png b/Projectiles/Boss/SporeGasPlantera2.png deleted file mode 100644 index 43de36f76c..0000000000 Binary files a/Projectiles/Boss/SporeGasPlantera2.png and /dev/null differ diff --git a/Projectiles/Boss/SporeGasPlantera3.png b/Projectiles/Boss/SporeGasPlantera3.png deleted file mode 100644 index 031824c267..0000000000 Binary files a/Projectiles/Boss/SporeGasPlantera3.png and /dev/null differ diff --git a/Projectiles/Boss/SupremeCataclysmFist.cs b/Projectiles/Boss/SupremeCataclysmFist.cs index c6aa6cdf6c..edb9e872bf 100644 --- a/Projectiles/Boss/SupremeCataclysmFist.cs +++ b/Projectiles/Boss/SupremeCataclysmFist.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -231,7 +231,7 @@ namespace CalamityMod.Projectiles.Boss // Decide frames. Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Type]; // Fade in and handle visuals. if (Projectile.ai[2] < 3) @@ -269,12 +269,12 @@ namespace CalamityMod.Projectiles.Boss lightColor.R = (byte)(255 * Projectile.Opacity); SpriteEffects direction = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (Projectile.ai[1] == 1f) texture = ModContent.Request("CalamityMod/Projectiles/Boss/SupremeCataclysmFistAlt").Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; - Rectangle frame = texture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, direction, 0); return false; } diff --git a/Projectiles/Boss/SupremeCatastropheSlash.cs b/Projectiles/Boss/SupremeCatastropheSlash.cs index 9048168f99..afa91f3d53 100644 --- a/Projectiles/Boss/SupremeCatastropheSlash.cs +++ b/Projectiles/Boss/SupremeCatastropheSlash.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Boss // Decide frames. Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 7 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 7 % Main.projFrames[Type]; // Fade in and handle visuals. if (Projectile.ai[2] < 4 && Projectile.ai[2] < 50) @@ -196,13 +196,13 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { SpriteEffects direction = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (Projectile.ai[1] == 0f) texture = ModContent.Request("CalamityMod/Projectiles/Boss/SupremeCatastropheSlashAlt").Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; drawPosition -= Projectile.velocity.SafeNormalize(Vector2.UnitX) * 38f; - Rectangle frame = texture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); for (int i = 0; i < 3; i++) { diff --git a/Projectiles/Boss/THanosSideLaser.cs b/Projectiles/Boss/THanosSideLaser.cs index 4e6a1aa74a..89b47ae15d 100644 --- a/Projectiles/Boss/THanosSideLaser.cs +++ b/Projectiles/Boss/THanosSideLaser.cs @@ -32,8 +32,8 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + Main.projFrames[Type] = 4; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() @@ -157,7 +157,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.B = (byte)(255 * Projectile.Opacity); Vector2 drawOffset = Projectile.velocity.SafeNormalize(Vector2.Zero) * -30f; Projectile.Center += drawOffset; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); Projectile.Center -= drawOffset; return false; } diff --git a/Projectiles/Boss/ThanatosBeamStart.cs b/Projectiles/Boss/ThanatosBeamStart.cs index 79a3657cbb..1169549444 100644 --- a/Projectiles/Boss/ThanatosBeamStart.cs +++ b/Projectiles/Boss/ThanatosBeamStart.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Boss public override float Lifetime => 180; public override Color LaserOverlayColor => new(250, 250, 250, 100); public override Color LightCastColor => Color.White; - public override Texture2D LaserBeginTexture => Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + public override Texture2D LaserBeginTexture => Terraria.GameContent.TextureAssets.Projectile[Type].Value; public override Texture2D LaserMiddleTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/ThanatosBeamMiddle", AssetRequestMode.ImmediateLoad).Value; public override Texture2D LaserEndTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/ThanatosBeamEnd", AssetRequestMode.ImmediateLoad).Value; @@ -41,8 +41,8 @@ namespace CalamityMod.Projectiles.Boss { // Thanatos' mouth laser // This is its serious name - Main.projFrames[Projectile.type] = 5; - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + Main.projFrames[Type] = 5; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() @@ -168,7 +168,7 @@ namespace CalamityMod.Projectiles.Boss // Determine frames. Projectile.frameCounter++; if (Projectile.frameCounter % 5f == 0f) - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; } public override bool PreDraw(ref Color lightColor) @@ -181,9 +181,9 @@ namespace CalamityMod.Projectiles.Boss return false; Color beamColor = LaserOverlayColor; - Rectangle startFrameArea = LaserBeginTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); - Rectangle middleFrameArea = LaserMiddleTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); - Rectangle endFrameArea = LaserEndTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Rectangle startFrameArea = LaserBeginTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Rectangle middleFrameArea = LaserMiddleTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Rectangle endFrameArea = LaserEndTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); // Start texture drawing. Main.EntitySpriteDraw(LaserBeginTexture, @@ -218,7 +218,7 @@ namespace CalamityMod.Projectiles.Boss 0); incrementalBodyLength += laserOffset; centerOnLaser += Projectile.velocity * laserOffset; - middleFrameArea.Y += LaserMiddleTexture.Height / Main.projFrames[Projectile.type]; + middleFrameArea.Y += LaserMiddleTexture.Height / Main.projFrames[Type]; if (middleFrameArea.Y + middleFrameArea.Height > LaserMiddleTexture.Height) middleFrameArea.Y = 0; } diff --git a/Projectiles/Boss/ThanatosBeamTelegraph.cs b/Projectiles/Boss/ThanatosBeamTelegraph.cs index 9eb50bc6c2..bd2b92755b 100644 --- a/Projectiles/Boss/ThanatosBeamTelegraph.cs +++ b/Projectiles/Boss/ThanatosBeamTelegraph.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Boss public const float BeamPosOffset = 16f; public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() diff --git a/Projectiles/Boss/ThanatosLaser.cs b/Projectiles/Boss/ThanatosLaser.cs index 24e844b4d6..75739ff077 100644 --- a/Projectiles/Boss/ThanatosLaser.cs +++ b/Projectiles/Boss/ThanatosLaser.cs @@ -32,8 +32,8 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + Main.projFrames[Type] = 4; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() @@ -262,7 +262,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.B = (byte)(255 * Projectile.Opacity); Vector2 drawOffset = Projectile.velocity.SafeNormalize(Vector2.Zero) * -30f; Projectile.Center += drawOffset; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); Projectile.Center -= drawOffset; return false; } diff --git a/Projectiles/Boss/ThornBallSpike.cs b/Projectiles/Boss/ThornBallSpike.cs index 86d5b8d957..790a4288bb 100644 --- a/Projectiles/Boss/ThornBallSpike.cs +++ b/Projectiles/Boss/ThornBallSpike.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.timeLeft > TimeLeft - 5) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/ToxicCloud.cs b/Projectiles/Boss/ToxicCloud.cs index 81f4051732..c1c879d50c 100644 --- a/Projectiles/Boss/ToxicCloud.cs +++ b/Projectiles/Boss/ToxicCloud.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 10; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 10; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Boss { Projectile.damage = 0; } - else if (Projectile.frame >= Main.projFrames[Projectile.type]) + else if (Projectile.frame >= Main.projFrames[Type]) { Projectile.Kill(); } @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); CalamityUtils.DrawProjectileWithBackglow(Projectile, new Color(66, 236, 113), lightColor, 3.75f); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/UnstableCrimulanGlob.cs b/Projectiles/Boss/UnstableCrimulanGlob.cs index 5885c845be..5c2a01564d 100644 --- a/Projectiles/Boss/UnstableCrimulanGlob.cs +++ b/Projectiles/Boss/UnstableCrimulanGlob.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Boss/UnstableEbonianGlob.cs b/Projectiles/Boss/UnstableEbonianGlob.cs index b943ead30d..2860149285 100644 --- a/Projectiles/Boss/UnstableEbonianGlob.cs +++ b/Projectiles/Boss/UnstableEbonianGlob.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Boss/WaterSpear.cs b/Projectiles/Boss/WaterSpear.cs index 0580bbf1e2..7a461904d6 100644 --- a/Projectiles/Boss/WaterSpear.cs +++ b/Projectiles/Boss/WaterSpear.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Boss lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/YharonBulletHellVortex.cs b/Projectiles/Boss/YharonBulletHellVortex.cs index ce7aa08e4d..b62cfee279 100644 --- a/Projectiles/Boss/YharonBulletHellVortex.cs +++ b/Projectiles/Boss/YharonBulletHellVortex.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Projectiles.Boss public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() diff --git a/Projectiles/Boss/YharonFireball.cs b/Projectiles/Boss/YharonFireball.cs index 553a32d527..2f8648e584 100644 --- a/Projectiles/Boss/YharonFireball.cs +++ b/Projectiles/Boss/YharonFireball.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + Main.projFrames[Type] = 5; + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -68,8 +68,8 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int frameHeight = texture.Height / Main.projFrames[Type]; int frameY = frameHeight * Projectile.frame; Rectangle rectangle = new Rectangle(0, frameY, texture.Width, frameHeight); if (CalamityClientConfig.Instance.Afterimages) diff --git a/Projectiles/Boss/YharonFireball2.cs b/Projectiles/Boss/YharonFireball2.cs index 52db19e003..df9e249e70 100644 --- a/Projectiles/Boss/YharonFireball2.cs +++ b/Projectiles/Boss/YharonFireball2.cs @@ -22,9 +22,9 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 5; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; if (Projectile.ai[0] < TimeBeforeFalling) @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 197d669db3..da6acb39cd 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -7,6 +7,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Dusts; using CalamityMod.EntitySources; +using CalamityMod.Enums; using CalamityMod.Events; using CalamityMod.ExtraTextures; using CalamityMod.Items.Accessories; @@ -156,6 +157,9 @@ namespace CalamityMod.Projectiles ///
public bool DealsDefenseDamage = false; + // Old Fashioned buff. This does not have effect unless the player has the buff consumed. + public bool? buffedByOldFashioned; + // Nihility Quiver public bool nihilicArrow = false; @@ -302,7 +306,6 @@ namespace CalamityMod.Projectiles if (projectile.minion && ExplosiveEnchantCountdown > 0) { ExplosiveEnchantCountdown--; - projectile.damage = (int)(projectile.originalDamage * MathHelper.SmoothStep(1f, 1.6f, 1f - ExplosiveEnchantCountdown / (float)ExplosiveEnchantTime)); // Make fizzle sounds and fire dust to indicate the impending explosion. if (ExplosiveEnchantCountdown <= 300) @@ -3714,7 +3717,6 @@ namespace CalamityMod.Projectiles if (projectile.owner == Main.myPlayer && player.ownedProjectileCounts[ProjectileType()] < 5) { int damage = (int)player.GetTotalDamage().ApplyTo(60); - damage = player.ApplyArmorAccDamageBonusesTo(damage); Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileType(), damage, 0f, projectile.owner); } } @@ -3726,7 +3728,6 @@ namespace CalamityMod.Projectiles if (projectile.owner == Main.myPlayer && player.ownedProjectileCounts[ProjectileType()] < 5) { int damage = (int)player.GetTotalDamage().ApplyTo(42); - damage = player.ApplyArmorAccDamageBonusesTo(damage); int proj = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileType(), damage, 0f, projectile.owner); if (proj.WithinBounds(Main.maxProjectiles)) @@ -3742,7 +3743,6 @@ namespace CalamityMod.Projectiles if (projectile.owner == Main.myPlayer && player.ownedProjectileCounts[ProjectileType()] < 5) { int damage = (int)player.GetTotalDamage().ApplyTo(DragonScales.ShitBaseDamage); - damage = player.ApplyArmorAccDamageBonusesTo(damage); int proj = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.One.RotatedByRandom(MathHelper.TwoPi) * 1.2f, ProjectileType(), damage, 0f, projectile.owner); if (proj.WithinBounds(Main.maxProjectiles)) @@ -3762,7 +3762,6 @@ namespace CalamityMod.Projectiles { // Daedalus Rogue Crystals: 2 x 25%, soft cap starts at 120 base damage int crystalDamage = CalamityUtils.DamageSoftCap(projectile.damage * 0.25, 30); - crystalDamage = player.ApplyArmorAccDamageBonusesTo(crystalDamage); for (int i = 0; i < 2; i++) { @@ -4187,102 +4186,9 @@ namespace CalamityMod.Projectiles Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - // Old Fashioned damage boost - if (modPlayer.oldFashioned) - { - // Yoyo bullshit - if (player.counterWeight > 0) - { - if (projectile.type >= ProjectileID.BlackCounterweight && projectile.type <= ProjectileID.YellowCounterweight) - modifiers.SourceDamage *= OldFashioned.AccessoryAndSetBonusDamageMultiplier; - } - - // Honey Balloon, Bee Cloak, Honey Comb, Stinger Necklace, Sweetheart Necklace - if (player.honeyCombItem != null && !player.honeyCombItem.IsAir) - { - if (projectile.type == ProjectileID.Bee) - modifiers.SourceDamage *= OldFashioned.AccessoryAndSetBonusDamageMultiplier; - } - - // Star Cloak, Mana Cloak, Star Veil, Bee Cloak - if (player.starCloakItem != null && !player.starCloakItem.IsAir) - { - if (projectile.type == ProjectileID.BeeCloakStar || projectile.type == ProjectileID.ManaCloakStar || projectile.type == ProjectileID.StarCloakStar) - modifiers.SourceDamage *= OldFashioned.AccessoryAndSetBonusDamageMultiplier; - } - - // Hive Pack - if (player.strongBees) - { - if (projectile.type == ProjectileID.GiantBee) - modifiers.SourceDamage *= OldFashioned.AccessoryAndSetBonusDamageMultiplier; - } - - // Bone Glove - if (player.boneGloveItem != null && !player.boneGloveItem.IsAir) - { - if (projectile.type == ProjectileID.BoneGloveProj) - modifiers.SourceDamage *= OldFashioned.AccessoryAndSetBonusDamageMultiplier; - } - - // Bone Helm - if (player.HasItem(ItemID.BoneHelm)) - { - if (projectile.type == ProjectileID.InsanityShadowFriendly) - modifiers.SourceDamage *= OldFashioned.AccessoryAndSetBonusDamageMultiplier; - } - - // Volatile Gelatin - if (player.volatileGelatin) - { - if (projectile.type == ProjectileID.VolatileGelatinBall) - modifiers.SourceDamage *= OldFashioned.AccessoryAndSetBonusDamageMultiplier; - } - - // Spore Sac - if (player.sporeSac) - { - if (projectile.type == ProjectileID.SporeTrap || projectile.type == ProjectileID.SporeTrap2 || - projectile.type == ProjectileID.SporeGas || projectile.type == ProjectileID.SporeGas2 || - projectile.type == ProjectileID.SporeGas3) - modifiers.SourceDamage *= OldFashioned.AccessoryAndSetBonusDamageMultiplier; - } - - // Spectre Mask bonus - if (player.ghostHurt) - { - if (projectile.type == ProjectileID.SpectreWrath) - modifiers.SourceDamage *= OldFashioned.AccessoryAndSetBonusDamageMultiplier; - } - - // Orichalcum Armor bonus - if (player.onHitPetal) - { - if (projectile.type == ProjectileID.FlowerPetal) - modifiers.SourceDamage *= OldFashioned.AccessoryAndSetBonusDamageMultiplier; - } - - // Titanium Armor bonus - if (player.onHitTitaniumStorm) - { - if (projectile.type == ProjectileID.TitaniumStormShard) - modifiers.SourceDamage *= OldFashioned.AccessoryAndSetBonusDamageMultiplier; - } - - // Forbidden Armor bonus - if (player.setForbidden) - { - if (projectile.type == ProjectileID.SandnadoFriendly) - modifiers.SourceDamage *= OldFashioned.AccessoryAndSetBonusDamageMultiplier; - } - - // Stardust Armor bonus - if (player.setStardust) - { - if (projectile.type == ProjectileID.StardustGuardianExplosion || projectile.type == ProjectileID.StardustPunch) - modifiers.SourceDamage *= OldFashioned.AccessoryAndSetBonusDamageMultiplier; - } - } + // Old Fashioned buffs (or debuffs) apply if the player has Old Fashioned + if (modPlayer.oldFashioned && buffedByOldFashioned.HasValue) + modifiers.SourceDamage *= buffedByOldFashioned.Value ? OldFashioned.DamageBoostMultiplier : OldFashioned.DamageReductionMultiplier; if (projectile.type == ProjectileID.JoustingLance || projectile.type == ProjectileID.HallowJoustingLance || projectile.type == ProjectileID.ShadowJoustingLance) { @@ -4293,6 +4199,10 @@ namespace CalamityMod.Projectiles modifiers.SourceDamage *= calamityVelocityDamageMultiplier / vanillaVelocityDamageMultiplier; } + // Stardust Wings buff the Stardust Guardian's damage. + if (player.wingsLogic == (int)VanillaWingID.WingsStardust && projectile.type == ProjectileID.StardustGuardian) + modifiers.SourceDamage *= 3f; + // If applicable, use ricoshot bonus damage. if (totalRicoshotDamageBonus > 0f) modifiers.ScalingBonusDamage += totalRicoshotDamageBonus; @@ -4307,6 +4217,10 @@ namespace CalamityMod.Projectiles if (modPlayer.flamingItemEnchant && !projectile.minion && !projectile.npcProj && !projectile.Calamity().CreatedByPlayerDash) target.AddBuff(BuffType(), VulnerabilityHex.AflameDuration); + // This can apply to minions or minion shots + if (ExplosiveEnchantCountdown > 0) + modifiers.SourceDamage *= MathHelper.SmoothStep(1f, 1.6f, 1f - ExplosiveEnchantCountdown / (float)ExplosiveEnchantTime); + if (modPlayer.farProximityRewardEnchant) { float proximityDamageInterpolant = Utils.GetLerpValue(250f, 2400f, target.Distance(player.Center), true); @@ -4350,7 +4264,6 @@ namespace CalamityMod.Projectiles if (projectile.owner == Main.myPlayer && !projectile.npcProj && !projectile.trap && projectile.CountsAsClass() && modPlayer.scuttlersJewel && stealthStrike && modPlayer.scuttlerCooldown <= 0 && !JewelSpikeSpawned) { int damage = (int)player.GetTotalDamage().ApplyTo(16); - damage = player.ApplyArmorAccDamageBonusesTo(damage); int spike = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileType(), damage, projectile.knockBack, projectile.owner); Main.projectile[spike].frame = 4; @@ -4596,6 +4509,18 @@ namespace CalamityMod.Projectiles return false; } + // Manual drawing to adjust for scale change + if (projectile.type == ProjectileID.Terragrim || projectile.type == ProjectileID.Arkhalis) + { + Texture2D tex = TextureAssets.Projectile[projectile.type].Value; + Rectangle frame = tex.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); + Vector2 origin = frame.Size() / 2f; + SpriteEffects spriteEffects = projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + Main.spriteBatch.Draw(tex, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), frame, projectile.GetAlpha(lightColor), projectile.rotation, origin, projectile.scale, spriteEffects, 0f); + return false; + } + // Chlorophyte Crystal AI rework. if (projectile.type == ProjectileID.CrystalLeaf) return ChlorophyteCrystalAI.DoChlorophyteCrystalDrawing(projectile); @@ -4950,7 +4875,6 @@ namespace CalamityMod.Projectiles Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); int damage = (int)player.GetTotalDamage().ApplyTo(20); - damage = player.ApplyArmorAccDamageBonusesTo(damage); int soul = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, velocity, ProjectileType(), damage, 0f, projectile.owner); Main.projectile[soul].tileCollide = false; @@ -4963,7 +4887,6 @@ namespace CalamityMod.Projectiles if (modPlayer.scuttlersJewel && stealthStrike && modPlayer.scuttlerCooldown <= 0 && !JewelSpikeSpawned) { int damage = (int)player.GetTotalDamage().ApplyTo(16); - damage = player.ApplyArmorAccDamageBonusesTo(damage); int spike = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileType(), damage, projectile.knockBack, projectile.owner); Main.projectile[spike].frame = 4; diff --git a/Projectiles/CalamityGlobalProjectileTweaks.cs b/Projectiles/CalamityGlobalProjectileTweaks.cs index aff44a5736..276dfe1fbd 100644 --- a/Projectiles/CalamityGlobalProjectileTweaks.cs +++ b/Projectiles/CalamityGlobalProjectileTweaks.cs @@ -115,7 +115,9 @@ namespace CalamityMod.Projectiles #region CATEGORY 2: Weapon/Enemy Balancing { ProjectileID.AdamantiteChainsaw, standardChainsawTweaks }, { ProjectileID.AdamantiteDrill, standardDrillTweaks }, + { ProjectileID.AdamantiteGlaive, Do(TrueMelee, LocalIFrames(7)) }, { ProjectileID.Anchor, Do(ExtraUpdatesExact(1)) }, + { ProjectileID.Arkhalis, Do(TrueMeleeNoSpeed, ScaleExact(1.25f)) }, { ProjectileID.Bee, Do(PiercingExact(2)) }, { ProjectileID.BeeArrow, Do(PointBlank, ExtraUpdatesExact(1)) }, { ProjectileID.BlackCounterweight, counterweightTweaks }, @@ -129,6 +131,7 @@ namespace CalamityMod.Projectiles { ProjectileID.ChlorophyteOrb, Do(NoPiercing) }, { ProjectileID.CobaltChainsaw, standardChainsawTweaks }, { ProjectileID.CobaltDrill, standardDrillTweaks }, + { ProjectileID.CobaltNaginata, Do(TrueMelee, LocalIFrames(9)) }, { ProjectileID.CrystalBullet, standardBulletTweaks }, { ProjectileID.CrystalVileShardHead, Do(LocalIFrames(23)) }, { ProjectileID.CrystalVileShardShaft, Do(LocalIFrames(23)) }, @@ -177,6 +180,7 @@ namespace CalamityMod.Projectiles { ProjectileID.MoonlordBullet, standardBulletTweaks }, // Luminite Bullet { ProjectileID.MythrilChainsaw, standardChainsawTweaks }, { ProjectileID.MythrilDrill, standardDrillTweaks }, + { ProjectileID.MythrilHalberd, Do(TrueMelee, LocalIFrames(8)) }, { ProjectileID.NanoBullet, standardBulletTweaks }, { ProjectileID.NebulaDrill, standardDrillTweaks }, { ProjectileID.NebulaLaser, Do(ExtraUpdatesDelta(-1)) }, @@ -202,6 +206,7 @@ namespace CalamityMod.Projectiles { ProjectileID.StarWrath, Do(NoPiercing) }, { ProjectileID.Sunfury, Do(ExtraUpdatesExact(1)) }, { ProjectileID.SwordBeam, Do(ExtraUpdatesExact(1)) }, // Beam Sword projectile + { ProjectileID.Terragrim, Do(TrueMeleeNoSpeed, ScaleExact(1.25f)) }, { ProjectileID.ThunderStaffShot, Do(PiercingExact(3)) }, //Thunder Zapper projectile { ProjectileID.TitaniumChainsaw, standardChainsawTweaks }, { ProjectileID.TitaniumDrill, standardDrillTweaks }, @@ -211,15 +216,12 @@ namespace CalamityMod.Projectiles { ProjectileID.VenomFang, Do(LocalIFrames(10)) }, { ProjectileID.VortexDrill, standardDrillTweaks }, { ProjectileID.Wasp, Do(PiercingExact(2)) }, - { ProjectileID.WeatherPainShot, Do(ExtraUpdatesExact(2), TimeLeftExact(1400)) }, + { ProjectileID.WeatherPainShot, Do(ExtraUpdatesExact(3), TimeLeftExact(1920)) }, { ProjectileID.YellowCounterweight, counterweightTweaks }, #endregion #region CATEGORY 3: True Melee support - { ProjectileID.AdamantiteGlaive, trueMelee }, - { ProjectileID.Arkhalis, trueMeleeNoSpeed }, { ProjectileID.ChlorophyteJackhammer, trueMeleeNoSpeed }, - { ProjectileID.CobaltNaginata, trueMelee }, { ProjectileID.CopperShortswordStab, trueMelee }, { ProjectileID.DarkLance, trueMelee }, { ProjectileID.GoldShortswordStab, trueMelee }, @@ -229,7 +231,6 @@ namespace CalamityMod.Projectiles { ProjectileID.JoustingLance, trueMelee }, { ProjectileID.LeadShortswordStab, trueMelee }, { ProjectileID.MushroomSpear, trueMelee }, - { ProjectileID.MythrilHalberd, trueMelee }, { ProjectileID.NebulaChainsaw, trueMeleeNoSpeed }, { ProjectileID.ObsidianSwordfish, trueMelee }, { ProjectileID.OrichalcumHalberd, trueMelee }, @@ -243,7 +244,6 @@ namespace CalamityMod.Projectiles { ProjectileID.Spear, trueMelee }, { ProjectileID.StardustChainsaw, trueMeleeNoSpeed }, { ProjectileID.Swordfish, trueMelee }, - { ProjectileID.Terragrim, trueMeleeNoSpeed }, { ProjectileID.TheRottedFork, trueMelee }, { ProjectileID.TinShortswordStab, trueMelee }, { ProjectileID.TitaniumTrident, trueMelee }, diff --git a/Projectiles/DraedonsArsenal/AnomalysNanogunMPFBDevastator.cs b/Projectiles/DraedonsArsenal/AnomalysNanogunMPFBDevastator.cs index 7a763570fa..c143c8b02b 100644 --- a/Projectiles/DraedonsArsenal/AnomalysNanogunMPFBDevastator.cs +++ b/Projectiles/DraedonsArsenal/AnomalysNanogunMPFBDevastator.cs @@ -52,12 +52,12 @@ namespace CalamityMod.Projectiles.DraedonsArsenal // Animate the projectile Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 3 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 3 % Main.projFrames[Type]; } public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; int yPos = texture.Height / Main.projFrames[Type] * Projectile.frame; Main.EntitySpriteDraw(texture, Projectile.position - Main.screenPosition, diff --git a/Projectiles/DraedonsArsenal/AnomalysNanogunPlasmaBeam.cs b/Projectiles/DraedonsArsenal/AnomalysNanogunPlasmaBeam.cs index f910d2c453..a1b875a79d 100644 --- a/Projectiles/DraedonsArsenal/AnomalysNanogunPlasmaBeam.cs +++ b/Projectiles/DraedonsArsenal/AnomalysNanogunPlasmaBeam.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Projectile.timeLeft = 12; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Main.projFrames[Projectile.type] = 18; + Main.projFrames[Type] = 18; } public override void AI() @@ -122,9 +122,9 @@ namespace CalamityMod.Projectiles.DraedonsArsenal private void DrawPlasmaBeam(Color beamColor, float scale, int startFrame = 0, int middleFrame = 0, int endFrame = 0) { - Rectangle startFrameArea = LaserBeginTexture.Frame(1, Main.projFrames[Projectile.type], 0, startFrame); - Rectangle middleFrameArea = LaserMiddleTexture.Frame(1, Main.projFrames[Projectile.type], 0, middleFrame); - Rectangle endFrameArea = LaserEndTexture.Frame(1, Main.projFrames[Projectile.type], 0, endFrame); + Rectangle startFrameArea = LaserBeginTexture.Frame(1, Main.projFrames[Type], 0, startFrame); + Rectangle middleFrameArea = LaserMiddleTexture.Frame(1, Main.projFrames[Type], 0, middleFrame); + Rectangle endFrameArea = LaserEndTexture.Frame(1, Main.projFrames[Type], 0, endFrame); // Start texture drawing. Main.EntitySpriteDraw(LaserBeginTexture, diff --git a/Projectiles/DraedonsArsenal/FrequencyManipulatorEnergy.cs b/Projectiles/DraedonsArsenal/FrequencyManipulatorEnergy.cs index 1db526bbda..4bd40a578c 100644 --- a/Projectiles/DraedonsArsenal/FrequencyManipulatorEnergy.cs +++ b/Projectiles/DraedonsArsenal/FrequencyManipulatorEnergy.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public const int Lifetime = 240; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 12; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 12; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/DraedonsArsenal/GalvanizingGlaiveProjectile.cs b/Projectiles/DraedonsArsenal/GalvanizingGlaiveProjectile.cs index e51c3a9d58..d552e4e2b2 100644 --- a/Projectiles/DraedonsArsenal/GalvanizingGlaiveProjectile.cs +++ b/Projectiles/DraedonsArsenal/GalvanizingGlaiveProjectile.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override LocalizedText DisplayName => CalamityUtils.GetItemName(); public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 90; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 90; } public override void SetDefaults() @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override bool PreDraw(ref Color lightColor) { Vector2 drawPosition = Projectile.position + new Vector2(Projectile.width, Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 origin = texture.Size() * 0.5f; Main.EntitySpriteDraw(texture, drawPosition, null, lightColor, Projectile.rotation, origin, Projectile.scale, Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); return false; diff --git a/Projectiles/DraedonsArsenal/GatlingLaserProj.cs b/Projectiles/DraedonsArsenal/GatlingLaserProj.cs index 1b90b5bb90..afe5e4399e 100644 --- a/Projectiles/DraedonsArsenal/GatlingLaserProj.cs +++ b/Projectiles/DraedonsArsenal/GatlingLaserProj.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal { Projectile.frameCounter = 10; Projectile.frame++; - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; } diff --git a/Projectiles/DraedonsArsenal/GaussPistolShot.cs b/Projectiles/DraedonsArsenal/GaussPistolShot.cs index 552d68adc5..8b69e78d76 100644 --- a/Projectiles/DraedonsArsenal/GaussPistolShot.cs +++ b/Projectiles/DraedonsArsenal/GaussPistolShot.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public const float ChargeTime = 30f; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 12; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 12; } public override void SetDefaults() diff --git a/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs b/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs index 9a99cf55b4..168199c675 100644 --- a/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs +++ b/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; + Main.projFrames[Type] = 3; } public override void SetDefaults() @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal if (Projectile.frameCounter % 4f == 3f) { Projectile.frame++; - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -170,7 +170,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal return false; } } - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), npc.Center, + Projectile.NewProjectile(Projectile.GetSource_FromThis(), npc.Center, Vector2.Zero, attackType, Projectile.damage, @@ -183,8 +183,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int height = texture.Height / Main.projFrames[Type]; int frameHeight = height * Projectile.frame; SpriteEffects spriteEffects = SpriteEffects.None; if (Projectile.spriteDirection == -1) diff --git a/Projectiles/DraedonsArsenal/MassivePlasmaExplosion.cs b/Projectiles/DraedonsArsenal/MassivePlasmaExplosion.cs index b0e8e818b4..fe98ee4a84 100644 --- a/Projectiles/DraedonsArsenal/MassivePlasmaExplosion.cs +++ b/Projectiles/DraedonsArsenal/MassivePlasmaExplosion.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; int length = texture.Width / horizontalFrames; int height = texture.Height / verticalFrames; Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); diff --git a/Projectiles/DraedonsArsenal/MountedScannerLaser.cs b/Projectiles/DraedonsArsenal/MountedScannerLaser.cs index 4e1fd3599e..e51fce714d 100644 --- a/Projectiles/DraedonsArsenal/MountedScannerLaser.cs +++ b/Projectiles/DraedonsArsenal/MountedScannerLaser.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/DraedonsArsenal/MountedScannerSummon.cs b/Projectiles/DraedonsArsenal/MountedScannerSummon.cs index 996aca33d1..e925397619 100644 --- a/Projectiles/DraedonsArsenal/MountedScannerSummon.cs +++ b/Projectiles/DraedonsArsenal/MountedScannerSummon.cs @@ -28,9 +28,9 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - ProjectileID.Sets.NeedsUUID[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; + ProjectileID.Sets.NeedsUUID[Type] = true; } public override void SetDefaults() @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void AI() { Player player = Main.player[Projectile.owner]; - Projectile.Center = player.Center + AngularOffsetRelativeToPlayer.ToRotationVector2() * OffsetDistanceFromPlayer; + Projectile.Center = player.Center + AngularOffsetRelativeToPlayer.ToRotationVector2() * OffsetDistanceFromPlayer + Vector2.UnitY * player.gfxOffY; GrantBuffs(player); NPC potentialTarget = Projectile.Center.MinionHoming(960f, player); diff --git a/Projectiles/DraedonsArsenal/PhaseslayerBeam.cs b/Projectiles/DraedonsArsenal/PhaseslayerBeam.cs index 694a2b26ef..1299ef33d0 100644 --- a/Projectiles/DraedonsArsenal/PhaseslayerBeam.cs +++ b/Projectiles/DraedonsArsenal/PhaseslayerBeam.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public const int Lifetime = 180; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override bool PreDraw(ref Color lightColor) { - Texture2D bladeTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D bladeTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); diff --git a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs index d11e1de3a4..d070d4e388 100644 --- a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs +++ b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs @@ -63,8 +63,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 13; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 13; } public override void SetDefaults() @@ -296,7 +296,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override bool PreDraw(ref Color lightColor) { Texture2D bladeTexture = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/PhaseslayerBlade").Value; - Texture2D hiltTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D hiltTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (IsSmall) bladeTexture = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/PhaseslayerBladeSmall").Value; diff --git a/Projectiles/DraedonsArsenal/PlasmaGrenadeSmallExplosion.cs b/Projectiles/DraedonsArsenal/PlasmaGrenadeSmallExplosion.cs index f2e91c5f2c..f85af545bb 100644 --- a/Projectiles/DraedonsArsenal/PlasmaGrenadeSmallExplosion.cs +++ b/Projectiles/DraedonsArsenal/PlasmaGrenadeSmallExplosion.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; int length = texture.Width / horizontalFrames; int height = texture.Height / verticalFrames; Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); diff --git a/Projectiles/DraedonsArsenal/PoleWarperSummon.cs b/Projectiles/DraedonsArsenal/PoleWarperSummon.cs index 9cf0a0aff5..9501d9e619 100644 --- a/Projectiles/DraedonsArsenal/PoleWarperSummon.cs +++ b/Projectiles/DraedonsArsenal/PoleWarperSummon.cs @@ -25,10 +25,10 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; } public override void SetDefaults() diff --git a/Projectiles/DraedonsArsenal/PulsePistolShot.cs b/Projectiles/DraedonsArsenal/PulsePistolShot.cs index 6f5450ad20..55ad51e8d3 100644 --- a/Projectiles/DraedonsArsenal/PulsePistolShot.cs +++ b/Projectiles/DraedonsArsenal/PulsePistolShot.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public List NPCsAlreadyHit = new List(); public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 12; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 12; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/DraedonsArsenal/PulseTurret.cs b/Projectiles/DraedonsArsenal/PulseTurret.cs index 80ee8dd273..e820312872 100644 --- a/Projectiles/DraedonsArsenal/PulseTurret.cs +++ b/Projectiles/DraedonsArsenal/PulseTurret.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public new string LocalizationCategory => "Projectiles.Misc"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override bool PreDraw(ref Color lightColor) { Texture2D standTexture = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/PulseTurretStand").Value; - Main.EntitySpriteDraw(Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value, + Main.EntitySpriteDraw(Terraria.GameContent.TextureAssets.Projectile[Type].Value, Projectile.Center - ((standTexture.Height / 2 + 6f) * Vector2.UnitY) - Main.screenPosition, null, lightColor, diff --git a/Projectiles/DraedonsArsenal/PulseTurretShot.cs b/Projectiles/DraedonsArsenal/PulseTurretShot.cs index ccd8d1458c..7bd968780f 100644 --- a/Projectiles/DraedonsArsenal/PulseTurretShot.cs +++ b/Projectiles/DraedonsArsenal/PulseTurretShot.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public const int SpiralRings = 6; public override void SetStaticDefaults() { - ProjectileID.Sets.SentryShot[Projectile.type] = true; + ProjectileID.Sets.SentryShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs b/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs index 594ca6cc18..45174b4fd5 100644 --- a/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs +++ b/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs @@ -180,7 +180,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; diff --git a/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs b/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs index 18ad44c4b2..ac77a1ed3e 100644 --- a/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs +++ b/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs @@ -240,7 +240,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; diff --git a/Projectiles/DraedonsArsenal/StarSwallowerAcid.cs b/Projectiles/DraedonsArsenal/StarSwallowerAcid.cs index d4ac4417e8..5d981f5dc8 100644 --- a/Projectiles/DraedonsArsenal/StarSwallowerAcid.cs +++ b/Projectiles/DraedonsArsenal/StarSwallowerAcid.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public const float Gravity = 0.25f; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.MinionShot[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], new Color(255, 255, 255, 127) * Projectile.Opacity, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], new Color(255, 255, 255, 127) * Projectile.Opacity, 2); return false; } } diff --git a/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs b/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs index 6de89b202f..526dcb0227 100644 --- a/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs +++ b/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs @@ -27,9 +27,9 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 12; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 12; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -271,8 +271,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle frame = texture.Frame(2, Main.projFrames[Projectile.type], ReleasingAcid.ToInt(), Projectile.frame); + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle frame = texture.Frame(2, Main.projFrames[Type], ReleasingAcid.ToInt(), Projectile.frame); Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, frame, diff --git a/Projectiles/DraedonsArsenal/SystemBaneLightning.cs b/Projectiles/DraedonsArsenal/SystemBaneLightning.cs index 2bf1588312..d6c5867358 100644 --- a/Projectiles/DraedonsArsenal/SystemBaneLightning.cs +++ b/Projectiles/DraedonsArsenal/SystemBaneLightning.cs @@ -27,8 +27,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 60; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 60; } public override void SetDefaults() { @@ -114,11 +114,11 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Vector2 start = oldPositions[i] + Projectile.Size * 0.5f - Main.screenPosition; Vector2 end = oldPositions[i + 1] + Projectile.Size * 0.5f - Main.screenPosition; - Utils.DrawLaser(Main.spriteBatch, Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value, start, end, new Vector2(OuterLightningScale), new Utils.LaserLineFraming(DelegateMethods.LightningLaserDraw)); + Utils.DrawLaser(Main.spriteBatch, Terraria.GameContent.TextureAssets.Projectile[Type].Value, start, end, new Vector2(OuterLightningScale), new Utils.LaserLineFraming(DelegateMethods.LightningLaserDraw)); DelegateMethods.f_1 = InnerLightningOpacity; DelegateMethods.c_1 = InnerLightningColor; - Utils.DrawLaser(Main.spriteBatch, Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value, start, end, new Vector2(InnerLightningScale), new Utils.LaserLineFraming(DelegateMethods.LightningLaserDraw)); + Utils.DrawLaser(Main.spriteBatch, Terraria.GameContent.TextureAssets.Projectile[Type].Value, start, end, new Vector2(InnerLightningScale), new Utils.LaserLineFraming(DelegateMethods.LightningLaserDraw)); } return false; } diff --git a/Projectiles/DraedonsArsenal/SystemBaneProjectile.cs b/Projectiles/DraedonsArsenal/SystemBaneProjectile.cs index 51ade30681..ffccae3cda 100644 --- a/Projectiles/DraedonsArsenal/SystemBaneProjectile.cs +++ b/Projectiles/DraedonsArsenal/SystemBaneProjectile.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal if (Time % LightningFireRate == 0f && Main.myPlayer == Projectile.owner) { int lightningDamage = Projectile.damage; - int totalSystemBanes = Main.player[Projectile.owner].ownedProjectileCounts[Projectile.type]; + int totalSystemBanes = Main.player[Projectile.owner].ownedProjectileCounts[Type]; // Make the damage of the lightning have diminishing returns depending on how many systems are present. lightningDamage = (int)Math.Ceiling(lightningDamage / Math.Pow(totalSystemBanes, 1D / 3D)); diff --git a/Projectiles/DraedonsArsenal/TaserHook.cs b/Projectiles/DraedonsArsenal/TaserHook.cs index b729eb0c54..fc876533ee 100644 --- a/Projectiles/DraedonsArsenal/TaserHook.cs +++ b/Projectiles/DraedonsArsenal/TaserHook.cs @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override bool PreDraw(ref Color lightColor) { Player player = Main.player[Projectile.owner]; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Utils.DrawLine(Main.spriteBatch, player.MountedCenter, Projectile.Center, Color.Cyan, Color.White, 4f); Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, lightColor, Projectile.rotation, texture.Size() * 0.5f, Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/DraedonsArsenal/TrackingDiskProjectile.cs b/Projectiles/DraedonsArsenal/TrackingDiskProjectile.cs index 9184114052..5bb2ae7fd9 100644 --- a/Projectiles/DraedonsArsenal/TrackingDiskProjectile.cs +++ b/Projectiles/DraedonsArsenal/TrackingDiskProjectile.cs @@ -35,8 +35,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -141,7 +141,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, ProjectileID.Sets.TrailCacheLength[Projectile.type]); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, ProjectileID.Sets.TrailCacheLength[Type]); return false; } } diff --git a/Projectiles/Enemy/AstralMeteorProj.cs b/Projectiles/Enemy/AstralMeteorProj.cs index 9048e87fa1..aa52ac2ac9 100644 --- a/Projectiles/Enemy/AstralMeteorProj.cs +++ b/Projectiles/Enemy/AstralMeteorProj.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Enemy public new string LocalizationCategory => "Projectiles.Enemy"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 4; } public override void SetDefaults() @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Enemy public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); return false; } diff --git a/Projectiles/Enemy/BelchingCoralSpike.cs b/Projectiles/Enemy/BelchingCoralSpike.cs index 5bb82dcfd8..d9c6fce5e7 100644 --- a/Projectiles/Enemy/BelchingCoralSpike.cs +++ b/Projectiles/Enemy/BelchingCoralSpike.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Enemy public new string LocalizationCategory => "Projectiles.Enemy"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Enemy public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } public override void OnKill(int timeLeft) diff --git a/Projectiles/Enemy/CrabBoulder.cs b/Projectiles/Enemy/CrabBoulder.cs index 4a332d07f3..0043b4923b 100644 --- a/Projectiles/Enemy/CrabBoulder.cs +++ b/Projectiles/Enemy/CrabBoulder.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Enemy public new string LocalizationCategory => "Projectiles.Enemy"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Enemy public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Enemy/CragmawVibeCheckChain.cs b/Projectiles/Enemy/CragmawVibeCheckChain.cs index 1b4a1cd930..8bcb308698 100644 --- a/Projectiles/Enemy/CragmawVibeCheckChain.cs +++ b/Projectiles/Enemy/CragmawVibeCheckChain.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Projectiles.Enemy public override bool PreDraw(ref Color lightColor) { - Texture2D endTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D endTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D chainTexture = ModContent.Request("CalamityMod/Projectiles/Enemy/CragmawVibeCheckMid").Value; Vector2 drawPosition = ReelingPlayer ? Main.player[(int)Projectile.ai[1]].Center : Projectile.Center; Vector2 distanceVectorToStart = Main.npc[(int)Projectile.ai[0]].Top + Vector2.UnitY * 30f - drawPosition; diff --git a/Projectiles/Enemy/CrimsonSpike.cs b/Projectiles/Enemy/CrimsonSpike.cs index c44c0e7349..5fcc1c12c6 100644 --- a/Projectiles/Enemy/CrimsonSpike.cs +++ b/Projectiles/Enemy/CrimsonSpike.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Enemy lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Enemy/EarthRockBig.cs b/Projectiles/Enemy/EarthRockBig.cs index adb9ae03d4..9c6b8b2761 100644 --- a/Projectiles/Enemy/EarthRockBig.cs +++ b/Projectiles/Enemy/EarthRockBig.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Enemy public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Enemy/EarthRockSmall.cs b/Projectiles/Enemy/EarthRockSmall.cs index 4620b5eee9..50fe80569b 100644 --- a/Projectiles/Enemy/EarthRockSmall.cs +++ b/Projectiles/Enemy/EarthRockSmall.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Enemy public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Enemy/FlakAcid.cs b/Projectiles/Enemy/FlakAcid.cs index 3edadc017d..bb83aa3073 100644 --- a/Projectiles/Enemy/FlakAcid.cs +++ b/Projectiles/Enemy/FlakAcid.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Enemy public new string LocalizationCategory => "Projectiles.Enemy"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Enemy public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Enemy/GammRayBurst.cs b/Projectiles/Enemy/GammRayBurst.cs index 0c8edea13a..54f9905839 100644 --- a/Projectiles/Enemy/GammRayBurst.cs +++ b/Projectiles/Enemy/GammRayBurst.cs @@ -30,15 +30,15 @@ namespace CalamityMod.Projectiles.Enemy public override float Lifetime => 300; public override Color LaserOverlayColor => new Color(0, 200, 50, 100); public override Color LightCastColor => Color.White; - public override Texture2D LaserBeginTexture => Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + public override Texture2D LaserBeginTexture => Terraria.GameContent.TextureAssets.Projectile[Type].Value; public override Texture2D LaserMiddleTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/AresLaserBeamMiddle", AssetRequestMode.ImmediateLoad).Value; public override Texture2D LaserEndTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/AresLaserBeamEnd", AssetRequestMode.ImmediateLoad).Value; public override string Texture => "CalamityMod/Projectiles/Boss/AresLaserBeamStart"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + Main.projFrames[Type] = 5; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Enemy // Determine frames. Projectile.frameCounter++; if (Projectile.frameCounter % 5f == 0f) - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; } public float LaserWidthFunction(float _) => Projectile.scale * Projectile.width + 180; diff --git a/Projectiles/Enemy/GammaAcid.cs b/Projectiles/Enemy/GammaAcid.cs index f917bb3e8e..b355a8e34d 100644 --- a/Projectiles/Enemy/GammaAcid.cs +++ b/Projectiles/Enemy/GammaAcid.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Enemy public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Enemy public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Enemy/IceClasperEnemyProjectile.cs b/Projectiles/Enemy/IceClasperEnemyProjectile.cs index 05065edba3..8217a565d5 100644 --- a/Projectiles/Enemy/IceClasperEnemyProjectile.cs +++ b/Projectiles/Enemy/IceClasperEnemyProjectile.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Enemy public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 4; } public override void SetDefaults() @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Enemy public override bool PreDraw(ref Color lightColor) { if (CalamityClientConfig.Instance.Afterimages) - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); return true; } diff --git a/Projectiles/Enemy/InkBombHostile.cs b/Projectiles/Enemy/InkBombHostile.cs index 5a60fec270..28acf8fd17 100644 --- a/Projectiles/Enemy/InkBombHostile.cs +++ b/Projectiles/Enemy/InkBombHostile.cs @@ -42,10 +42,10 @@ namespace CalamityMod.Projectiles.Enemy public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawOrigin = new(tex.Width * 0.5f, Projectile.height * 0.5f); Vector2 vector = new Vector2(Projectile.Center.X, Projectile.Center.Y) - Main.screenPosition + new Vector2(0, Projectile.gfxOffY); - Rectangle rectangle = new(0, tex.Height / Main.projFrames[Projectile.type] * Projectile.frame, tex.Width, tex.Height / Main.projFrames[Projectile.type]); + Rectangle rectangle = new(0, tex.Height / Main.projFrames[Type] * Projectile.frame, tex.Width, tex.Height / Main.projFrames[Type]); Main.EntitySpriteDraw(tex, vector, rectangle, Color.DarkGray, Projectile.rotation, drawOrigin, Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Enemy/InkPoisonCloud.cs b/Projectiles/Enemy/InkPoisonCloud.cs index d74d2a8f1e..7fd5c520a6 100644 --- a/Projectiles/Enemy/InkPoisonCloud.cs +++ b/Projectiles/Enemy/InkPoisonCloud.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Enemy public new string LocalizationCategory => "Projectiles.Enemy"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 10; + Main.projFrames[Type] = 10; } public override void SetDefaults() @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Enemy { Projectile.damage = 0; } - else if (Projectile.frame >= Main.projFrames[Projectile.type]) + else if (Projectile.frame >= Main.projFrames[Type]) { Projectile.Kill(); } @@ -61,11 +61,11 @@ namespace CalamityMod.Projectiles.Enemy public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; var effects = Projectile.direction == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; Vector2 drawOrigin = new(tex.Width * 0.5f, Projectile.height * 0.5f); Vector2 vector = new Vector2(Projectile.Center.X, Projectile.Center.Y) - Main.screenPosition + new Vector2(0, Projectile.gfxOffY); - Rectangle rectangle = new(0, tex.Height / Main.projFrames[Projectile.type] * Projectile.frame, tex.Width, tex.Height / Main.projFrames[Projectile.type]); + Rectangle rectangle = new(0, tex.Height / Main.projFrames[Type] * Projectile.frame, tex.Width, tex.Height / Main.projFrames[Type]); Main.EntitySpriteDraw(tex, vector, rectangle, Color.White * 0.75f, Projectile.rotation, drawOrigin, Projectile.scale * 1.2f, effects, 0); return true; diff --git a/Projectiles/Enemy/JellyghoulBolt.cs b/Projectiles/Enemy/JellyghoulBolt.cs index e59b35ed62..bf9edbf051 100644 --- a/Projectiles/Enemy/JellyghoulBolt.cs +++ b/Projectiles/Enemy/JellyghoulBolt.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Enemy { ProjectileID.Sets.TrailingMode[Type] = 2; ProjectileID.Sets.TrailCacheLength[Type] = 10; - Main.projFrames[Projectile.type] = 20; + Main.projFrames[Type] = 20; } public override void SetDefaults() @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Enemy { Lighting.AddLight(Projectile.Center, 1f * Projectile.Opacity, 0.1f * Projectile.Opacity, 0.1f); Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 4 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 4 % Main.projFrames[Type]; Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; @@ -88,8 +88,8 @@ namespace CalamityMod.Projectiles.Enemy PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(SlashWidthFunction, SlashColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ExobladePierce"]), 30); - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int projFrame = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int projFrame = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = projFrame * Projectile.frame; /*Main.spriteBatch.EnterShaderRegion(BlendState.Additive); diff --git a/Projectiles/Enemy/LightningCloud.cs b/Projectiles/Enemy/LightningCloud.cs index 8d0e6037df..8dc6e54c65 100644 --- a/Projectiles/Enemy/LightningCloud.cs +++ b/Projectiles/Enemy/LightningCloud.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Enemy public new string LocalizationCategory => "Projectiles.Enemy"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; + Main.projFrames[Type] = 6; } public override void SetDefaults() diff --git a/Projectiles/Enemy/MantisRing.cs b/Projectiles/Enemy/MantisRing.cs index 5daadcdeef..002314546d 100644 --- a/Projectiles/Enemy/MantisRing.cs +++ b/Projectiles/Enemy/MantisRing.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Projectiles.Enemy public new string LocalizationCategory => "Projectiles.Enemy"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 3; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Enemy public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Enemy/MaulerAcidBubble.cs b/Projectiles/Enemy/MaulerAcidBubble.cs index e649011ecf..f67e3b5b38 100644 --- a/Projectiles/Enemy/MaulerAcidBubble.cs +++ b/Projectiles/Enemy/MaulerAcidBubble.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Enemy public override string Texture => "CalamityMod/Projectiles/Enemy/SulphuricAcidBubble"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 7; + Main.projFrames[Type] = 7; } public override void SetDefaults() @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Enemy { // Handle frames. Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 4 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 4 % Main.projFrames[Type]; // Home in on players after a sufficient amount of time has passed. if (Time > 60f) @@ -55,8 +55,8 @@ namespace CalamityMod.Projectiles.Enemy public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle frame = texture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Enemy/NuclearToadGoo.cs b/Projectiles/Enemy/NuclearToadGoo.cs index c38799573f..635f4bcc53 100644 --- a/Projectiles/Enemy/NuclearToadGoo.cs +++ b/Projectiles/Enemy/NuclearToadGoo.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Projectiles.Enemy public new string LocalizationCategory => "Projectiles.Enemy"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; + Main.projFrames[Type] = 3; } public override void SetDefaults() diff --git a/Projectiles/Enemy/PearlBurst.cs b/Projectiles/Enemy/PearlBurst.cs index 3e35181991..3bc8a1c361 100644 --- a/Projectiles/Enemy/PearlBurst.cs +++ b/Projectiles/Enemy/PearlBurst.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Enemy public new string LocalizationCategory => "Projectiles.Enemy"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() diff --git a/Projectiles/Enemy/PearlRain.cs b/Projectiles/Enemy/PearlRain.cs index 97435f618b..29fde3728f 100644 --- a/Projectiles/Enemy/PearlRain.cs +++ b/Projectiles/Enemy/PearlRain.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Enemy public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() diff --git a/Projectiles/Enemy/StormMarkHostile.cs b/Projectiles/Enemy/StormMarkHostile.cs index ead43ea48d..8c637f4aeb 100644 --- a/Projectiles/Enemy/StormMarkHostile.cs +++ b/Projectiles/Enemy/StormMarkHostile.cs @@ -137,8 +137,8 @@ namespace CalamityMod.Projectiles.Enemy { Color originalColor = Lighting.GetColor((int)((double)Projectile.position.X + (double)Projectile.width * 0.5) / 16, (int)(((double)Projectile.position.Y + (double)Projectile.height * 0.5) / 16.0)); Vector2 drawPos = Projectile.position + new Vector2((float)Projectile.width, (float)Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; - Texture2D texture2D27 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle rectangl = texture2D27.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D texture2D27 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle rectangl = texture2D27.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Color alphaColor = Projectile.GetAlpha(originalColor); Vector2 halfRect = rectangl.Size() / 2f; Color whiteColor = Main.hslToRgb(0.25f, 1f, 1f).MultiplyRGBA(new Color(255, 255, 255, 0)); diff --git a/Projectiles/Enemy/SulphuricAcidBubble.cs b/Projectiles/Enemy/SulphuricAcidBubble.cs index 3b0544545e..acfa65b1b3 100644 --- a/Projectiles/Enemy/SulphuricAcidBubble.cs +++ b/Projectiles/Enemy/SulphuricAcidBubble.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Enemy public new string LocalizationCategory => "Projectiles.Enemy"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 7; + Main.projFrames[Type] = 7; } public override void SetDefaults() @@ -85,8 +85,8 @@ namespace CalamityMod.Projectiles.Enemy public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); diff --git a/Projectiles/Enemy/SulphuricAcidMist.cs b/Projectiles/Enemy/SulphuricAcidMist.cs index b037e6fabc..f1f5d6b825 100644 --- a/Projectiles/Enemy/SulphuricAcidMist.cs +++ b/Projectiles/Enemy/SulphuricAcidMist.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Enemy public new string LocalizationCategory => "Projectiles.Enemy"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 10; + Main.projFrames[Type] = 10; } public override void SetDefaults() @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Enemy lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Enemy/TornadoHostile.cs b/Projectiles/Enemy/TornadoHostile.cs index ae8c8e1392..ed74fd0215 100644 --- a/Projectiles/Enemy/TornadoHostile.cs +++ b/Projectiles/Enemy/TornadoHostile.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Enemy public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() @@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Enemy Vector2 sizeModdingPos = new Vector2(0f, sizeModdingVector2.Y - sizeModdingVector.Y); sizeModdingPos.X = sizeModdingPos.Y * vectorMult; new Vector2(sizeModdingVector.X - sizeModdingPos.X / 2f, sizeModdingVector.Y); - Texture2D texture2D23 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture2D23 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle drawRectangle = texture2D23.Frame(1, 1, 0, 0); Vector2 smallRect = drawRectangle.Size() / 2f; float aiTrackMult = -0.06283186f * aiTracker; diff --git a/Projectiles/Enemy/ToxicMinnowCloud.cs b/Projectiles/Enemy/ToxicMinnowCloud.cs index 40254c224a..fa67dcad89 100644 --- a/Projectiles/Enemy/ToxicMinnowCloud.cs +++ b/Projectiles/Enemy/ToxicMinnowCloud.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Enemy public new string LocalizationCategory => "Projectiles.Enemy"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 10; + Main.projFrames[Type] = 10; } public override void SetDefaults() @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Enemy { Projectile.damage = 0; } - else if (Projectile.frame >= Main.projFrames[Projectile.type]) + else if (Projectile.frame >= Main.projFrames[Type]) { Projectile.Kill(); } @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Enemy lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); return false; } diff --git a/Projectiles/Environment/AcidDrop.cs b/Projectiles/Environment/AcidDrop.cs index e027fa1379..a76420bc98 100644 --- a/Projectiles/Environment/AcidDrop.cs +++ b/Projectiles/Environment/AcidDrop.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Environment public new string LocalizationCategory => "Projectiles.Misc"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Environment public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], new Color(255, 255, 255, 127), 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], new Color(255, 255, 255, 127), 2); return false; } } diff --git a/Projectiles/Environment/HotSteam.cs b/Projectiles/Environment/HotSteam.cs index 861ef86c45..7a9029974e 100644 --- a/Projectiles/Environment/HotSteam.cs +++ b/Projectiles/Environment/HotSteam.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Environment if (Projectile.localAI[0] == 1f) return; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 origin = texture.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition; float opacity = Projectile.Opacity * 0.45f; diff --git a/Projectiles/Environment/LavaChunk.cs b/Projectiles/Environment/LavaChunk.cs index 6bf6a55c07..2137bd3404 100644 --- a/Projectiles/Environment/LavaChunk.cs +++ b/Projectiles/Environment/LavaChunk.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Environment public new string LocalizationCategory => "Projectiles.Misc"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; + Main.projFrames[Type] = 6; } public override void SetDefaults() @@ -87,8 +87,8 @@ namespace CalamityMod.Projectiles.Environment public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Environment/MurkySteam.cs b/Projectiles/Environment/MurkySteam.cs index 27dd0b7e11..74523462b0 100644 --- a/Projectiles/Environment/MurkySteam.cs +++ b/Projectiles/Environment/MurkySteam.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Environment if (Projectile.localAI[0] == 1f) return; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 origin = texture.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition; float opacity = Projectile.Opacity * 0.45f; diff --git a/Projectiles/Environment/ThermalSteam.cs b/Projectiles/Environment/ThermalSteam.cs index cff4ecee12..2b4061379c 100644 --- a/Projectiles/Environment/ThermalSteam.cs +++ b/Projectiles/Environment/ThermalSteam.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Environment if (Projectile.localAI[0] == 1f) return; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 origin = texture.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition; float opacity = Projectile.Opacity * 0.45f; diff --git a/Projectiles/Environment/WaterAlgae.cs b/Projectiles/Environment/WaterAlgae.cs index d28cbb522b..340942f2d5 100644 --- a/Projectiles/Environment/WaterAlgae.cs +++ b/Projectiles/Environment/WaterAlgae.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Environment public ref float Direction => ref Projectile.ai[0]; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; - ProjectileID.Sets.CanDistortWater[Projectile.type] = false; + Main.projFrames[Type] = 3; + ProjectileID.Sets.CanDistortWater[Type] = false; } public override void SetDefaults() @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Environment Projectile.hide = Projectile.Opacity < 0.2f; if (Projectile.localAI[0] == 0f) { - Projectile.frame = Main.rand.Next(Main.projFrames[Projectile.type]); + Projectile.frame = Main.rand.Next(Main.projFrames[Type]); Projectile.localAI[0] = 1f; } diff --git a/Projectiles/Healing/EssenceFlame.cs b/Projectiles/Healing/EssenceFlame.cs index 2b07b2e939..ad272fe761 100644 --- a/Projectiles/Healing/EssenceFlame.cs +++ b/Projectiles/Healing/EssenceFlame.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Healing public new string LocalizationCategory => "Projectiles.Healing"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() diff --git a/Projectiles/Healing/GladiatorHealOrb.cs b/Projectiles/Healing/GladiatorHealOrb.cs index 1b8bd6b2db..a7ce7ed980 100644 --- a/Projectiles/Healing/GladiatorHealOrb.cs +++ b/Projectiles/Healing/GladiatorHealOrb.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Projectiles.Healing public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 20; } public override void SetDefaults() diff --git a/Projectiles/Healing/PhantomicHeart.cs b/Projectiles/Healing/PhantomicHeart.cs index ad93a844e0..ea6c6c6de7 100644 --- a/Projectiles/Healing/PhantomicHeart.cs +++ b/Projectiles/Healing/PhantomicHeart.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Projectiles.Healing public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } diff --git a/Projectiles/Magic/AcidicSaxBubble.cs b/Projectiles/Magic/AcidicSaxBubble.cs index 8173932661..740ff708e4 100644 --- a/Projectiles/Magic/AcidicSaxBubble.cs +++ b/Projectiles/Magic/AcidicSaxBubble.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 7; + Main.projFrames[Type] = 7; } public override void SetDefaults() @@ -127,8 +127,8 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Magic/AcidicSaxMist.cs b/Projectiles/Magic/AcidicSaxMist.cs index 4ff3e96349..df7c684ca2 100644 --- a/Projectiles/Magic/AcidicSaxMist.cs +++ b/Projectiles/Magic/AcidicSaxMist.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 10; + Main.projFrames[Type] = 10; } public override void SetDefaults() diff --git a/Projectiles/Magic/AetherfluxCannonHoldout.cs b/Projectiles/Magic/AetherfluxCannonHoldout.cs index 69891cace5..4e5aa5931a 100644 --- a/Projectiles/Magic/AetherfluxCannonHoldout.cs +++ b/Projectiles/Magic/AetherfluxCannonHoldout.cs @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 dustOnlySpread = Main.rand.NextVector2Circular(shootSpeed, shootSpeed); Vector2 dustVelocity = shootVelocity + dustInaccuracy * dustOnlySpread; if (actuallyShoot && Main.myPlayer == Projectile.owner) - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), laserStartPos, shootVelocity, projID, Projectile.damage, Projectile.knockBack, Projectile.owner, i * 0.5f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), laserStartPos, shootVelocity, projID, Projectile.damage, Projectile.knockBack, Projectile.owner, i * 0.5f); SpawnFiringDust(GunTipPosition, dustVelocity); } } diff --git a/Projectiles/Magic/AnahitasArpeggioNote.cs b/Projectiles/Magic/AnahitasArpeggioNote.cs index 6269d9feae..62e5a3eaec 100644 --- a/Projectiles/Magic/AnahitasArpeggioNote.cs +++ b/Projectiles/Magic/AnahitasArpeggioNote.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -183,7 +183,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Magic/Ancient2.cs b/Projectiles/Magic/Ancient2.cs index abc16039f9..8e71e9d3fb 100644 --- a/Projectiles/Magic/Ancient2.cs +++ b/Projectiles/Magic/Ancient2.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; + Main.projFrames[Type] = 6; } public override void SetDefaults() @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -91,9 +91,9 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - int height = texture.Height / Main.projFrames[Projectile.type]; + int height = texture.Height / Main.projFrames[Type]; int frameHeight = height * Projectile.frame; Rectangle rectangle = new Rectangle(0, frameHeight, texture.Width, height); Vector2 origin = new Vector2(texture.Width / 2f, height / 2f); diff --git a/Projectiles/Magic/ApotheosisEnergy.cs b/Projectiles/Magic/ApotheosisEnergy.cs index 672bae6e48..aa6b8bae8d 100644 --- a/Projectiles/Magic/ApotheosisEnergy.cs +++ b/Projectiles/Magic/ApotheosisEnergy.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() diff --git a/Projectiles/Magic/ApotheosisWorm.cs b/Projectiles/Magic/ApotheosisWorm.cs index cc5217bb41..b9701da8a0 100644 --- a/Projectiles/Magic/ApotheosisWorm.cs +++ b/Projectiles/Magic/ApotheosisWorm.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() @@ -261,9 +261,9 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D headTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D headTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; - Vector2 headTextureOrigin = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Size() * 0.5f; + Vector2 headTextureOrigin = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Size() * 0.5f; drawPosition -= headTexture.Size() * Projectile.scale * 0.5f; drawPosition += headTextureOrigin * Projectile.scale + new Vector2(0f, 4f + Projectile.gfxOffY); diff --git a/Projectiles/Magic/AquamarineBolt.cs b/Projectiles/Magic/AquamarineBolt.cs index fa7697db9b..f426b89a09 100644 --- a/Projectiles/Magic/AquamarineBolt.cs +++ b/Projectiles/Magic/AquamarineBolt.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -9,8 +10,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -39,12 +40,13 @@ namespace CalamityMod.Projectiles.Magic } Projectile.rotation += 0.3f * (float)Projectile.direction; } - + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 200); public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Magic/ArtAttackStar.cs b/Projectiles/Magic/ArtAttackStar.cs index aea6eae32c..c07be77f85 100644 --- a/Projectiles/Magic/ArtAttackStar.cs +++ b/Projectiles/Magic/ArtAttackStar.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 180; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 180; } public override void SetDefaults() @@ -218,7 +218,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition + Vector2.UnitY * Projectile.gfxOffY; Vector2 origin = texture.Size() * 0.5f; diff --git a/Projectiles/Magic/Asteroid.cs b/Projectiles/Magic/Asteroid.cs index a89860f6d3..5d354632ee 100644 --- a/Projectiles/Magic/Asteroid.cs +++ b/Projectiles/Magic/Asteroid.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Magic/AsteroidMolten.cs b/Projectiles/Magic/AsteroidMolten.cs index 5c16a3b188..5c1561bd7b 100644 --- a/Projectiles/Magic/AsteroidMolten.cs +++ b/Projectiles/Magic/AsteroidMolten.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { //Changes the texture of the projectile - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; switch ((int)Projectile.ai[0]) { case 0: @@ -143,7 +143,7 @@ namespace CalamityMod.Projectiles.Magic default: break; } - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, texture); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1, texture); return false; } diff --git a/Projectiles/Magic/AstralCrystal.cs b/Projectiles/Magic/AstralCrystal.cs index 366c34f1db..296fb9b03d 100644 --- a/Projectiles/Magic/AstralCrystal.cs +++ b/Projectiles/Magic/AstralCrystal.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Magic/AstralStarMagic.cs b/Projectiles/Magic/AstralStarMagic.cs index 00c363b42d..5b201e4b1e 100644 --- a/Projectiles/Magic/AstralStarMagic.cs +++ b/Projectiles/Magic/AstralStarMagic.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { Projectile.DrawStarTrail(Color.Coral, Color.White); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Magic/AstralachneaFang.cs b/Projectiles/Magic/AstralachneaFang.cs index e6e1d8aa48..cf5ed838f9 100644 --- a/Projectiles/Magic/AstralachneaFang.cs +++ b/Projectiles/Magic/AstralachneaFang.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Magic/AtlantisSpear.cs b/Projectiles/Magic/AtlantisSpear.cs index 40e73700a1..09533fe2b7 100644 --- a/Projectiles/Magic/AtlantisSpear.cs +++ b/Projectiles/Magic/AtlantisSpear.cs @@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles.Magic } public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (time > 0) Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor) * fade, Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Magic/BeamStar.cs b/Projectiles/Magic/BeamStar.cs index 8da90bd2cb..4c0c69d905 100644 --- a/Projectiles/Magic/BeamStar.cs +++ b/Projectiles/Magic/BeamStar.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { Vector2 drawPosition; - Texture2D starTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D starTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; for (int i = 1; i < Projectile.oldPos.Length; i++) { float scale = Projectile.scale * MathHelper.Lerp(0.9f, 0.6f, i / (float)Projectile.oldPos.Length) * 0.56f; diff --git a/Projectiles/Magic/BeamingBolt.cs b/Projectiles/Magic/BeamingBolt.cs index fb30fb008e..6c069c3319 100644 --- a/Projectiles/Magic/BeamingBolt.cs +++ b/Projectiles/Magic/BeamingBolt.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (Projectile.ai[0] == 1f) tex = ModContent.Request("CalamityMod/Projectiles/Magic/BeamingThornBlossom").Value; diff --git a/Projectiles/Magic/BeamingBolt2.cs b/Projectiles/Magic/BeamingBolt2.cs index 4dd05b2777..df78947c31 100644 --- a/Projectiles/Magic/BeamingBolt2.cs +++ b/Projectiles/Magic/BeamingBolt2.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (Projectile.ai[0] == 1f) tex = ModContent.Request("CalamityMod/Projectiles/Magic/BeamingThorn").Value; diff --git a/Projectiles/Magic/BeastScythe.cs b/Projectiles/Magic/BeastScythe.cs index 13d14f67e9..0c309d3205 100644 --- a/Projectiles/Magic/BeastScythe.cs +++ b/Projectiles/Magic/BeastScythe.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -175,7 +175,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Magic/BlackAnurianPlankton.cs b/Projectiles/Magic/BlackAnurianPlankton.cs index 02bfa93279..7478e3231e 100644 --- a/Projectiles/Magic/BlackAnurianPlankton.cs +++ b/Projectiles/Magic/BlackAnurianPlankton.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Magic/BlueBubble.cs b/Projectiles/Magic/BlueBubble.cs index 7143b55d96..e54b7b72f7 100644 --- a/Projectiles/Magic/BlueBubble.cs +++ b/Projectiles/Magic/BlueBubble.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 12; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 12; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Magic Color drawColor = Color.Lerp(mainColor, Color.White, 0.2f) with { A = 0 }; float drawRotation = Projectile.rotation; Vector2 rotationPoint = texture.Size() * 0.5f; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], drawColor, 1, texture, true, true); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], drawColor, 1, texture, true, true); Main.EntitySpriteDraw(texture, drawPosition, null, drawColor, drawRotation, rotationPoint, Projectile.scale, SpriteEffects.None); return false; } diff --git a/Projectiles/Magic/BrimstoneHellfireballFriendly.cs b/Projectiles/Magic/BrimstoneHellfireballFriendly.cs index fa627a0ebc..d19ac4ede9 100644 --- a/Projectiles/Magic/BrimstoneHellfireballFriendly.cs +++ b/Projectiles/Magic/BrimstoneHellfireballFriendly.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 6; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Magic/CauldronProj.cs b/Projectiles/Magic/CauldronProj.cs index 4c6b92ca08..21c716e995 100644 --- a/Projectiles/Magic/CauldronProj.cs +++ b/Projectiles/Magic/CauldronProj.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Magic public static Asset Glow; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; if (!Main.dedServ) { Glow = ModContent.Request(Texture + "Glow"); @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); Vector2 origin = Glow.Value.Size() / 2f; Main.EntitySpriteDraw(Glow.Value, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Magic/CauldronProjSmall.cs b/Projectiles/Magic/CauldronProjSmall.cs index e3d01d3509..1ae7f52f9a 100644 --- a/Projectiles/Magic/CauldronProjSmall.cs +++ b/Projectiles/Magic/CauldronProjSmall.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Magic public static Asset Glow; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; if (!Main.dedServ) { Glow = ModContent.Request(Texture + "Glow"); @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Magic } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); Vector2 origin = Glow.Value.Size() / 2f; Main.EntitySpriteDraw(Glow.Value, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Magic/ChronomancersScytheHoldout.cs b/Projectiles/Magic/ChronomancersScytheHoldout.cs index d5861097b5..ed6c379bfd 100644 --- a/Projectiles/Magic/ChronomancersScytheHoldout.cs +++ b/Projectiles/Magic/ChronomancersScytheHoldout.cs @@ -109,7 +109,7 @@ namespace CalamityMod.Projectiles.Magic { Owner.ChangeDir((int)Projectile.ai[2]); - Texture2D scytheTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D scytheTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 handleOrigin = Projectile.ai[2] == -1 ? new Vector2(scytheTexture.Width, scytheTexture.Height) : new Vector2(0, scytheTexture.Height); float scytheRotation = Projectile.rotation; diff --git a/Projectiles/Magic/ChronomancersScytheSwing.cs b/Projectiles/Magic/ChronomancersScytheSwing.cs index 5cbd28a35b..f6fc717b09 100644 --- a/Projectiles/Magic/ChronomancersScytheSwing.cs +++ b/Projectiles/Magic/ChronomancersScytheSwing.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Magic public static int ClockChance = 30; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; + Main.projFrames[Type] = 6; } public override void SetDefaults() @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; Projectile.soundDelay--; diff --git a/Projectiles/Magic/ClamorNoctusStar.cs b/Projectiles/Magic/ClamorNoctusStar.cs index 7386caa9e2..0930c2506c 100644 --- a/Projectiles/Magic/ClamorNoctusStar.cs +++ b/Projectiles/Magic/ClamorNoctusStar.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Magic/ClamorNoctusWyvern.cs b/Projectiles/Magic/ClamorNoctusWyvern.cs index db0583c6e5..3de2a503bc 100644 --- a/Projectiles/Magic/ClamorNoctusWyvern.cs +++ b/Projectiles/Magic/ClamorNoctusWyvern.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Magic/ClimaxProj.cs b/Projectiles/Magic/ClimaxProj.cs index 8ff285b156..2b7085481d 100644 --- a/Projectiles/Magic/ClimaxProj.cs +++ b/Projectiles/Magic/ClimaxProj.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Magic public bool firedBeam = false; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; } public override void SetDefaults() @@ -78,8 +78,8 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture2D13.Width / 2f, framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Magic/CosmicRainbowFront.cs b/Projectiles/Magic/CosmicRainbowFront.cs index 707cdc9bbd..3f6a2c3f1a 100644 --- a/Projectiles/Magic/CosmicRainbowFront.cs +++ b/Projectiles/Magic/CosmicRainbowFront.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Projectiles.Magic public class CosmicRainbowFront : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; - public override string Texture => "CalamityMod/Projectiles/Ranged/RainbowFront"; + public override string Texture => "Terraria/Images/Projectile_251"; public override void SetDefaults() { diff --git a/Projectiles/Magic/CosmicRainbowTrail.cs b/Projectiles/Magic/CosmicRainbowTrail.cs index e48af16b3f..ceedd2c90b 100644 --- a/Projectiles/Magic/CosmicRainbowTrail.cs +++ b/Projectiles/Magic/CosmicRainbowTrail.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Magic public class CosmicRainbowTrail : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; - public override string Texture => "CalamityMod/Projectiles/Ranged/RainbowFront"; + public override string Texture => "Terraria/Images/Projectile_251"; public const int Lifetime = 25; public override void SetDefaults() diff --git a/Projectiles/Magic/CryoBlast.cs b/Projectiles/Magic/CryoBlast.cs index 2a0515bc4d..a25787701b 100644 --- a/Projectiles/Magic/CryoBlast.cs +++ b/Projectiles/Magic/CryoBlast.cs @@ -14,12 +14,13 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() { - Projectile.width = Projectile.height = 35; + Projectile.width = 40; + Projectile.height = 62; Projectile.friendly = true; Projectile.DamageType = DamageClass.Magic; Projectile.penetrate = 3; @@ -64,7 +65,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; Lighting.AddLight(Projectile.Center, 0.5f, 0.5f, 0.5f); @@ -86,9 +87,9 @@ namespace CalamityMod.Projectiles.Magic if ((Projectile.timeLeft > 596 && Projectile.ai[0] == 0f) || (Projectile.timeLeft > 599 && Projectile.ai[0] > 0f)) return false; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - int height = texture.Height / Main.projFrames[Projectile.type]; + int height = texture.Height / Main.projFrames[Type]; int frameHeight = height * Projectile.frame; Rectangle rectangle = new Rectangle(0, frameHeight, texture.Width, height); Vector2 origin = new Vector2(texture.Width / 2f, height / 2f); @@ -126,6 +127,8 @@ namespace CalamityMod.Projectiles.Magic } } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 30); diff --git a/Projectiles/Magic/DarkSparkBeam.cs b/Projectiles/Magic/DarkSparkBeam.cs index 32a30db723..aee980f024 100644 --- a/Projectiles/Magic/DarkSparkBeam.cs +++ b/Projectiles/Magic/DarkSparkBeam.cs @@ -173,7 +173,7 @@ namespace CalamityMod.Projectiles.Magic if (Projectile.velocity == Vector2.Zero) return false; - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; float drawArea = Projectile.localAI[1]; Projectile projectile2 = Main.projectile[(int)Projectile.ai[1]]; Color color = GetBeamColor((int)projectile2.ai[0], (int)Projectile.ai[0]); diff --git a/Projectiles/Magic/DarkSparkPrism.cs b/Projectiles/Magic/DarkSparkPrism.cs index e3c0d1a384..a512651328 100644 --- a/Projectiles/Magic/DarkSparkPrism.cs +++ b/Projectiles/Magic/DarkSparkPrism.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.NeedsUUID[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.NeedsUUID[Type] = true; } public override void SetDefaults() @@ -160,7 +160,7 @@ namespace CalamityMod.Projectiles.Magic { Vector2 mountedCenter = Main.player[Projectile.owner].MountedCenter; Color prismColorArea = Lighting.GetColor((int)((double)Projectile.position.X + (double)Projectile.width * 0.5) / 16, (int)(((double)Projectile.position.Y + (double)Projectile.height * 0.5) / 16.0)); - if (Projectile.hide && !ProjectileID.Sets.DontAttachHideToAlpha[Projectile.type]) + if (Projectile.hide && !ProjectileID.Sets.DontAttachHideToAlpha[Type]) { prismColorArea = Lighting.GetColor((int)mountedCenter.X / 16, (int)(mountedCenter.Y / 16f)); } @@ -169,8 +169,8 @@ namespace CalamityMod.Projectiles.Magic { spriteEffects = SpriteEffects.FlipHorizontally; } - Texture2D texture2D14 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D14 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y7 = framing * Projectile.frame; Vector2 drawStart = (Projectile.position + new Vector2((float)Projectile.width, (float)Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition).Floor(); if (Main.player[Projectile.owner].shroomiteStealth && Main.player[Projectile.owner].inventory[Main.player[Projectile.owner].selectedItem].CountsAsClass()) diff --git a/Projectiles/Magic/DeathValleyDusterProjectile.cs b/Projectiles/Magic/DeathValleyDusterProjectile.cs index 873f582895..d7602bf560 100644 --- a/Projectiles/Magic/DeathValleyDusterProjectile.cs +++ b/Projectiles/Magic/DeathValleyDusterProjectile.cs @@ -21,9 +21,9 @@ namespace CalamityMod.Projectiles.Magic public List buffList = new List(new bool[Main.maxPlayers]); public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + Main.projFrames[Type] = 6; + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -182,7 +182,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { if (Projectile.timeLeft > 50) - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor * 0.4f * Projectile.Opacity, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor * 0.4f * Projectile.Opacity, 1); return true; } } diff --git a/Projectiles/Magic/DivineRetributionSpear.cs b/Projectiles/Magic/DivineRetributionSpear.cs index ad5e534495..6f1a6aad3b 100644 --- a/Projectiles/Magic/DivineRetributionSpear.cs +++ b/Projectiles/Magic/DivineRetributionSpear.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 7; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 7; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Magic/EelDrop.cs b/Projectiles/Magic/EelDrop.cs index e932ba247a..b636db1279 100644 --- a/Projectiles/Magic/EelDrop.cs +++ b/Projectiles/Magic/EelDrop.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], new Color(255, 255, 255, 127), 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], new Color(255, 255, 255, 127), 2); return false; } } diff --git a/Projectiles/Magic/EidolicWailSoundwave.cs b/Projectiles/Magic/EidolicWailSoundwave.cs index 18559438c0..0f15340a45 100644 --- a/Projectiles/Magic/EidolicWailSoundwave.cs +++ b/Projectiles/Magic/EidolicWailSoundwave.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Magic/EternityBook.cs b/Projectiles/Magic/EternityBook.cs index a2b8f21950..47b4accb86 100644 --- a/Projectiles/Magic/EternityBook.cs +++ b/Projectiles/Magic/EternityBook.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Magic } public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 8; + Main.projFrames[Type] = 8; } public override void SetDefaults() @@ -60,8 +60,8 @@ namespace CalamityMod.Projectiles.Magic // Switch frames at a linearly increasing rate to make it look like the player is flipping pages quickly. Projectile.localAI[0] += Utils.Remap(Time, 0f, 200f, 1f, 5f); - Projectile.frame = (int)Math.Round(Projectile.localAI[0] / 10f) % Main.projFrames[Projectile.type]; - if (Projectile.localAI[0] >= Main.projFrames[Projectile.type] * 10f) + Projectile.frame = (int)Math.Round(Projectile.localAI[0] / 10f) % Main.projFrames[Type]; + if (Projectile.localAI[0] >= Main.projFrames[Type] * 10f) Projectile.localAI[0] = 0f; AdjustPlayerValues(player); @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Magic // Update the player's arm directions to make it look as though they're flipping through the book. float frontArmRotation = (MathHelper.PiOver2 - 0.46f) * -player.direction; - float backArmRotation = frontArmRotation + MathHelper.Lerp(0.12f, 1.1f, CalamityUtils.Convert01To010(Projectile.localAI[0] / Main.projFrames[Projectile.type] / 10f)) * -player.direction; + float backArmRotation = frontArmRotation + MathHelper.Lerp(0.12f, 1.1f, CalamityUtils.Convert01To010(Projectile.localAI[0] / Main.projFrames[Type] / 10f)) * -player.direction; player.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, backArmRotation); player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, frontArmRotation); } diff --git a/Projectiles/Magic/EternityCrystal.cs b/Projectiles/Magic/EternityCrystal.cs index 1aa03fe4b0..089eb63ded 100644 --- a/Projectiles/Magic/EternityCrystal.cs +++ b/Projectiles/Magic/EternityCrystal.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Magic public const int InwardCollapseTime = 70; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 2; + Main.projFrames[Type] = 2; } public override void SetDefaults() @@ -165,8 +165,8 @@ namespace CalamityMod.Projectiles.Magic } public override bool PreDraw(ref Color lightColor) { - Texture2D myTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle frame = myTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D myTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle frame = myTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Color trasparentCrystalColor = Projectile.GetAlpha(lightColor) * 0.6f; Vector2 origin = frame.Size() / 2f; diff --git a/Projectiles/Magic/EternityHex.cs b/Projectiles/Magic/EternityHex.cs index 8443eb4ffb..857b001868 100644 --- a/Projectiles/Magic/EternityHex.cs +++ b/Projectiles/Magic/EternityHex.cs @@ -42,8 +42,8 @@ namespace CalamityMod.Projectiles.Magic public const float NormalEnemyLifeMaxDamageMult = 1f / 100f; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 63; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 63; } public override void SetDefaults() diff --git a/Projectiles/Magic/EventHorizonBlackhole.cs b/Projectiles/Magic/EventHorizonBlackhole.cs index 290e297da8..6b19a3af06 100644 --- a/Projectiles/Magic/EventHorizonBlackhole.cs +++ b/Projectiles/Magic/EventHorizonBlackhole.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 8; + Main.projFrames[Type] = 8; } public override void SetDefaults() @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Magic/EventHorizonStar.cs b/Projectiles/Magic/EventHorizonStar.cs index d8608b9f81..3b309decb3 100644 --- a/Projectiles/Magic/EventHorizonStar.cs +++ b/Projectiles/Magic/EventHorizonStar.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -134,13 +134,13 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } public override void PostDraw(Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), new Color(255, 255, 255, 127), Projectile.rotation, texture.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); } } diff --git a/Projectiles/Magic/EvergladeSprayProjectile.cs b/Projectiles/Magic/EvergladeSprayProjectile.cs index db5714d406..dbd85e0838 100644 --- a/Projectiles/Magic/EvergladeSprayProjectile.cs +++ b/Projectiles/Magic/EvergladeSprayProjectile.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Magic/ExoVortex.cs b/Projectiles/Magic/ExoVortex.cs index 4bc02319c6..ba25da0d47 100644 --- a/Projectiles/Magic/ExoVortex.cs +++ b/Projectiles/Magic/ExoVortex.cs @@ -26,8 +26,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 35; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 35; } public override void SetDefaults() diff --git a/Projectiles/Magic/ExoVortex2.cs b/Projectiles/Magic/ExoVortex2.cs index 11282c7696..e8e1c97ce0 100644 --- a/Projectiles/Magic/ExoVortex2.cs +++ b/Projectiles/Magic/ExoVortex2.cs @@ -26,8 +26,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 27; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 27; } public override void SetDefaults() diff --git a/Projectiles/Magic/FabBolt.cs b/Projectiles/Magic/FabBolt.cs index 8b9149b5bf..75521fc686 100644 --- a/Projectiles/Magic/FabBolt.cs +++ b/Projectiles/Magic/FabBolt.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 23; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 23; } public override void SetDefaults() diff --git a/Projectiles/Magic/FabRay.cs b/Projectiles/Magic/FabRay.cs index a58f5f7bfa..48288510f6 100644 --- a/Projectiles/Magic/FabRay.cs +++ b/Projectiles/Magic/FabRay.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 54; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 54; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() diff --git a/Projectiles/Magic/FatesRevealFlame.cs b/Projectiles/Magic/FatesRevealFlame.cs index 38bca14e6e..d31fb68c89 100644 --- a/Projectiles/Magic/FatesRevealFlame.cs +++ b/Projectiles/Magic/FatesRevealFlame.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Magic/FlareBoltProjectile.cs b/Projectiles/Magic/FlareBoltProjectile.cs index d744d9eb4f..d07901184d 100644 --- a/Projectiles/Magic/FlareBoltProjectile.cs +++ b/Projectiles/Magic/FlareBoltProjectile.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Magic/ForbiddenAxeBlade.cs b/Projectiles/Magic/ForbiddenAxeBlade.cs index b865086f2e..d320fcfb4c 100644 --- a/Projectiles/Magic/ForbiddenAxeBlade.cs +++ b/Projectiles/Magic/ForbiddenAxeBlade.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Magic/ForbiddenSunProjectile.cs b/Projectiles/Magic/ForbiddenSunProjectile.cs index 6aaf251d2a..0472da95c3 100644 --- a/Projectiles/Magic/ForbiddenSunProjectile.cs +++ b/Projectiles/Magic/ForbiddenSunProjectile.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Magic { Projectile.rotation = Projectile.velocity.ToRotation(); Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 4 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 4 % Main.projFrames[Type]; Lighting.AddLight(Projectile.Center, 0.25f, 0.2f, 0.01f); if (Projectile.wet && !Projectile.lavaWet) { diff --git a/Projectiles/Magic/FrigidflashBoltProjectile.cs b/Projectiles/Magic/FrigidflashBoltProjectile.cs index 3011c145e7..420a0b7dc3 100644 --- a/Projectiles/Magic/FrigidflashBoltProjectile.cs +++ b/Projectiles/Magic/FrigidflashBoltProjectile.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Magic/FrostBoltProjectile.cs b/Projectiles/Magic/FrostBoltProjectile.cs index 06cadcc66d..d906f20215 100644 --- a/Projectiles/Magic/FrostBoltProjectile.cs +++ b/Projectiles/Magic/FrostBoltProjectile.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Magic/GammaLaser.cs b/Projectiles/Magic/GammaLaser.cs index 85f8aa17ec..0030bf2cdc 100644 --- a/Projectiles/Magic/GammaLaser.cs +++ b/Projectiles/Magic/GammaLaser.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Magic/GenesisHoldout.cs b/Projectiles/Magic/GenesisHoldout.cs index d0d83c08e1..a5dc0753e8 100644 --- a/Projectiles/Magic/GenesisHoldout.cs +++ b/Projectiles/Magic/GenesisHoldout.cs @@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Magic SoundEngine.PlaySound(fire with { Volume = 0.35f, Pitch = 1f, PitchVariance = 0.15f }, Projectile.Center); if (Main.myPlayer == Projectile.owner) - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity3, ModContent.ProjectileType(), Projectile.damage * 9, Projectile.knockBack, Projectile.owner, 0, 0); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity3, ModContent.ProjectileType(), Projectile.damage * 9, Projectile.knockBack, Projectile.owner, 0, 0); Particle pulse3 = new GlowSparkParticle(GunTipPosition, shootDirection * 18, false, 6, 0.057f, EffectsColor, new Vector2(1.7f, 0.8f), true); GeneralParticleHandler.SpawnParticle(pulse3); @@ -117,14 +117,14 @@ namespace CalamityMod.Projectiles.Magic firingVelocity3 = (shootDirection * 10).RotatedBy((0.05f * (i + 1)) * Utils.GetLerpValue(0, 55, Windup, true)); if (Main.myPlayer == Projectile.owner) - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity3 * (1 - i * 0.1f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 1); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity3 * (1 - i * 0.1f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 1); } for (int i = 0; i < 4; i++) { firingVelocity3 = (shootDirection * 10).RotatedBy((-0.05f * (i + 1)) * Utils.GetLerpValue(0, 55, Windup, true)); if (Main.myPlayer == Projectile.owner) - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity3 * (1 - i * 0.1f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 1); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity3 * (1 - i * 0.1f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 1); } Particle pulse3 = new GlowSparkParticle(GunTipPosition, shootDirection * 18, false, 6, 0.057f, EffectsColor, new Vector2(1.7f, 0.8f), true); diff --git a/Projectiles/Magic/GhastlyBlast.cs b/Projectiles/Magic/GhastlyBlast.cs index 992934a4a1..f6201dcd9a 100644 --- a/Projectiles/Magic/GhastlyBlast.cs +++ b/Projectiles/Magic/GhastlyBlast.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -233,7 +233,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Magic/GhastlyVisageProj.cs b/Projectiles/Magic/GhastlyVisageProj.cs index 1946027091..42cd6b630f 100644 --- a/Projectiles/Magic/GhastlyVisageProj.cs +++ b/Projectiles/Magic/GhastlyVisageProj.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Magic public override LocalizedText DisplayName => CalamityUtils.GetItemName(); public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -203,8 +203,8 @@ namespace CalamityMod.Projectiles.Magic public override void PostDraw(Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Vector2 origin = new Vector2(13f, 16f); SpriteEffects spriteEffects = SpriteEffects.None; diff --git a/Projectiles/Magic/GranitePulse.cs b/Projectiles/Magic/GranitePulse.cs index 1cee67b0f7..885df7e794 100644 --- a/Projectiles/Magic/GranitePulse.cs +++ b/Projectiles/Magic/GranitePulse.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; + Main.projFrames[Type] = 6; } public override void SetDefaults() @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -145,8 +145,8 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int height = texture.Height / Main.projFrames[Type]; int frameHeight = height * Projectile.frame; Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, height / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Magic/HadalUrnIsopod.cs b/Projectiles/Magic/HadalUrnIsopod.cs index 1ac62e58f1..08c64edc11 100644 --- a/Projectiles/Magic/HadalUrnIsopod.cs +++ b/Projectiles/Magic/HadalUrnIsopod.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() diff --git a/Projectiles/Magic/HadalUrnJellyfish.cs b/Projectiles/Magic/HadalUrnJellyfish.cs index fd7a241f3c..e85edb4ef0 100644 --- a/Projectiles/Magic/HadalUrnJellyfish.cs +++ b/Projectiles/Magic/HadalUrnJellyfish.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Magic bool neartarget = false; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -132,8 +132,8 @@ namespace CalamityMod.Projectiles.Magic } public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int textureheight = tex.Height / Main.projFrames[Projectile.type]; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int textureheight = tex.Height / Main.projFrames[Type]; int y = textureheight * Projectile.frame; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y, tex.Width, textureheight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)tex.Width / 2f, (float)textureheight / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Magic/HadalUrnLamprey.cs b/Projectiles/Magic/HadalUrnLamprey.cs index 972180a9d2..a8b5030619 100644 --- a/Projectiles/Magic/HadalUrnLamprey.cs +++ b/Projectiles/Magic/HadalUrnLamprey.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Magic int invistimer = 0; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 8; + Main.projFrames[Type] = 8; } public override void SetDefaults() @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Magic //AI exclusive to when it isn't sticking if (Projectile.ai[0] == 0) { - if (Projectile.frame >= Main.projFrames[Projectile.type] / 2) + if (Projectile.frame >= Main.projFrames[Type] / 2) { Projectile.frame = 0; } @@ -79,9 +79,9 @@ namespace CalamityMod.Projectiles.Magic //If it IS sticking else { - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { - Projectile.frame = Main.projFrames[Projectile.type] / 2; + Projectile.frame = Main.projFrames[Type] / 2; } } } @@ -99,8 +99,8 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int textureheight = tex.Height / Main.projFrames[Projectile.type]; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int textureheight = tex.Height / Main.projFrames[Type]; int y = textureheight * Projectile.frame; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y, tex.Width, textureheight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(tex.Width, tex.Height / 16f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Magic/HadalUrnStarfish.cs b/Projectiles/Magic/HadalUrnStarfish.cs index d2043be509..b69111abb1 100644 --- a/Projectiles/Magic/HadalUrnStarfish.cs +++ b/Projectiles/Magic/HadalUrnStarfish.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; Shards(); diff --git a/Projectiles/Magic/HeliumFlashBlast.cs b/Projectiles/Magic/HeliumFlashBlast.cs index 76982a34f4..67b98a66f5 100644 --- a/Projectiles/Magic/HeliumFlashBlast.cs +++ b/Projectiles/Magic/HeliumFlashBlast.cs @@ -36,6 +36,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.ignoreWater = true; Projectile.tileCollide = false; Projectile.penetrate = -1; + Projectile.timeLeft = 20; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; } diff --git a/Projectiles/Magic/HellwingBat.cs b/Projectiles/Magic/HellwingBat.cs index 735877902a..f07139620d 100644 --- a/Projectiles/Magic/HellwingBat.cs +++ b/Projectiles/Magic/HellwingBat.cs @@ -11,9 +11,9 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 12; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 12; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Magic/HeresyProj.cs b/Projectiles/Magic/HeresyProj.cs index 0c48a337cb..d3da71c8c8 100644 --- a/Projectiles/Magic/HeresyProj.cs +++ b/Projectiles/Magic/HeresyProj.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Magic public ref float AttackTimer => ref Projectile.ai[1]; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 8; + Main.projFrames[Type] = 8; } public override void SetDefaults() @@ -48,8 +48,8 @@ namespace CalamityMod.Projectiles.Magic // Switch frames at a linearly increasing rate to make it look like the player is flipping pages quickly. Projectile.localAI[0] += Utils.Remap(Time, 0f, 180f, 1f, 5f); - Projectile.frame = (int)Math.Round(Projectile.localAI[0] / 10f) % Main.projFrames[Projectile.type]; - if (Projectile.localAI[0] >= Main.projFrames[Projectile.type] * 10f) + Projectile.frame = (int)Math.Round(Projectile.localAI[0] / 10f) % Main.projFrames[Type]; + if (Projectile.localAI[0] >= Main.projFrames[Type] * 10f) Projectile.localAI[0] = 0f; AdjustPlayerValues(); @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Magic // Update the player's arm directions to make it look as though they're flipping through the book. float frontArmRotation = (MathHelper.PiOver2 - 0.46f) * -Owner.direction; - float backArmRotation = frontArmRotation + MathHelper.Lerp(0.23f, 0.97f, CalamityUtils.Convert01To010(Projectile.localAI[0] / Main.projFrames[Projectile.type] / 10f)) * -Owner.direction; + float backArmRotation = frontArmRotation + MathHelper.Lerp(0.23f, 0.97f, CalamityUtils.Convert01To010(Projectile.localAI[0] / Main.projFrames[Type] / 10f)) * -Owner.direction; Owner.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, backArmRotation); Owner.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, frontArmRotation); } @@ -112,8 +112,8 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { float glowOutwardness = MathHelper.SmoothStep(0f, 4f, Utils.GetLerpValue(90f, 270f, Time, true)); - Texture2D bookTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle frame = bookTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D bookTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle frame = bookTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 drawPosition; Vector2 origin = frame.Size() * 0.5f; Color glowColor = Color.Lerp(Color.Pink, Color.Red, (float)Math.Cos(Main.GlobalTimeWrappedHourly * 5f) * 0.5f + 0.5f); diff --git a/Projectiles/Magic/HolyFlame.cs b/Projectiles/Magic/HolyFlame.cs index 0d58ed03c6..caea82db64 100644 --- a/Projectiles/Magic/HolyFlame.cs +++ b/Projectiles/Magic/HolyFlame.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() diff --git a/Projectiles/Magic/IceCluster.cs b/Projectiles/Magic/IceCluster.cs index c5a292e024..40d362af69 100644 --- a/Projectiles/Magic/IceCluster.cs +++ b/Projectiles/Magic/IceCluster.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Magic/IncineratingFireball.cs b/Projectiles/Magic/IncineratingFireball.cs index d3a353aa63..1978c2724d 100644 --- a/Projectiles/Magic/IncineratingFireball.cs +++ b/Projectiles/Magic/IncineratingFireball.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.Magic public ref float Timer => ref Projectile.ai[0]; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() diff --git a/Projectiles/Magic/InfernadoFriendly.cs b/Projectiles/Magic/InfernadoFriendly.cs index 46ab217618..2dd9e9497f 100644 --- a/Projectiles/Magic/InfernadoFriendly.cs +++ b/Projectiles/Magic/InfernadoFriendly.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Magic bool intersectingSomething = false; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 12; + Main.projFrames[Type] = 12; } public override void SetDefaults() @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -144,8 +144,8 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Magic/InfernalBlade.cs b/Projectiles/Magic/InfernalBlade.cs index 4d960c272a..98a4418dea 100644 --- a/Projectiles/Magic/InfernalBlade.cs +++ b/Projectiles/Magic/InfernalBlade.cs @@ -79,8 +79,8 @@ namespace CalamityMod.Projectiles.Magic spriteEffects = SpriteEffects.FlipHorizontally; } Color colorArea = Lighting.GetColor((int)((double)Projectile.position.X + (double)Projectile.width * 0.5) / 16, (int)(((double)Projectile.position.Y + (double)Projectile.height * 0.5) / 16.0)); - Texture2D texture2D3 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int textureArea = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D3 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int textureArea = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y3 = textureArea * Projectile.frame; Rectangle rectangle = new Rectangle(0, y3, texture2D3.Width, textureArea); Vector2 halfRect = rectangle.Size() / 2f; @@ -90,11 +90,11 @@ namespace CalamityMod.Projectiles.Magic { Color alphaColor = colorArea; alphaColor = Projectile.GetAlpha(alphaColor); - alphaColor *= (float)(3 - i) / ((float)ProjectileID.Sets.TrailCacheLength[Projectile.type] * 1.5f); + alphaColor *= (float)(3 - i) / ((float)ProjectileID.Sets.TrailCacheLength[Type] * 1.5f); Vector2 oldPosition = Projectile.oldPos[i]; float projRotation = Projectile.rotation; SpriteEffects effects = spriteEffects; - if (ProjectileID.Sets.TrailingMode[Projectile.type] == 2) + if (ProjectileID.Sets.TrailingMode[Type] == 2) { projRotation = Projectile.oldRot[i]; effects = (Projectile.oldSpriteDirection[i] == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; diff --git a/Projectiles/Magic/InfernalBlade2.cs b/Projectiles/Magic/InfernalBlade2.cs index 55094dd6c6..8a2bc0d826 100644 --- a/Projectiles/Magic/InfernalBlade2.cs +++ b/Projectiles/Magic/InfernalBlade2.cs @@ -86,8 +86,8 @@ namespace CalamityMod.Projectiles.Magic spriteEffects = SpriteEffects.FlipHorizontally; } Color colorArea = Lighting.GetColor((int)((double)Projectile.position.X + (double)Projectile.width * 0.5) / 16, (int)(((double)Projectile.position.Y + (double)Projectile.height * 0.5) / 16.0)); - Texture2D texture2D3 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int textureArea = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D3 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int textureArea = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y3 = textureArea * Projectile.frame; Rectangle rectangle = new Rectangle(0, y3, texture2D3.Width, textureArea); Vector2 halfRect = rectangle.Size() / 2f; @@ -97,11 +97,11 @@ namespace CalamityMod.Projectiles.Magic { Color alphaColor = colorArea; alphaColor = Projectile.GetAlpha(alphaColor); - alphaColor *= (float)(3 - j) / ((float)ProjectileID.Sets.TrailCacheLength[Projectile.type] * 1.5f); + alphaColor *= (float)(3 - j) / ((float)ProjectileID.Sets.TrailCacheLength[Type] * 1.5f); Vector2 oldPosition = Projectile.oldPos[j]; float projRotation = Projectile.rotation; SpriteEffects effects = spriteEffects; - if (ProjectileID.Sets.TrailingMode[Projectile.type] == 2) + if (ProjectileID.Sets.TrailingMode[Type] == 2) { projRotation = Projectile.oldRot[j]; effects = (Projectile.oldSpriteDirection[j] == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; diff --git a/Projectiles/Magic/IonBlast.cs b/Projectiles/Magic/IonBlast.cs index 16f2ce592a..708fe8812d 100644 --- a/Projectiles/Magic/IonBlast.cs +++ b/Projectiles/Magic/IonBlast.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Magic/KeelhaulGeyserBottom.cs b/Projectiles/Magic/KeelhaulGeyserBottom.cs index 97cc0ab147..632c9c9e08 100644 --- a/Projectiles/Magic/KeelhaulGeyserBottom.cs +++ b/Projectiles/Magic/KeelhaulGeyserBottom.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() diff --git a/Projectiles/Magic/KeelhaulGeyserTop.cs b/Projectiles/Magic/KeelhaulGeyserTop.cs index 70fa1eabeb..69aeb8f78b 100644 --- a/Projectiles/Magic/KeelhaulGeyserTop.cs +++ b/Projectiles/Magic/KeelhaulGeyserTop.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() diff --git a/Projectiles/Magic/LightBlade.cs b/Projectiles/Magic/LightBlade.cs index d036aa40c8..b67da9d6d7 100644 --- a/Projectiles/Magic/LightBlade.cs +++ b/Projectiles/Magic/LightBlade.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = NumAfterimages; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = NumAfterimages; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -152,7 +152,7 @@ namespace CalamityMod.Projectiles.Magic Point projTile = Projectile.Center.ToTileCoordinates(); Color localLight = Lighting.GetColor(projTile.X, projTile.Y); - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle rect = new Rectangle(38 * Projectile.frame, 0, 38, 38); Vector2 halfSpriteSize = rect.Size() / 2f; diff --git a/Projectiles/Magic/LiquidBlade.cs b/Projectiles/Magic/LiquidBlade.cs index fbf6ce611f..cf4d6601f1 100644 --- a/Projectiles/Magic/LiquidBlade.cs +++ b/Projectiles/Magic/LiquidBlade.cs @@ -85,8 +85,8 @@ namespace CalamityMod.Projectiles.Magic spriteEffects = SpriteEffects.FlipHorizontally; } Color colorArea = Lighting.GetColor((int)((double)Projectile.position.X + (double)Projectile.width * 0.5) / 16, (int)(((double)Projectile.position.Y + (double)Projectile.height * 0.5) / 16.0)); - Texture2D texture2D3 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int textureArea = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D3 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int textureArea = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y3 = textureArea * Projectile.frame; Rectangle rectangle = new Rectangle(0, y3, texture2D3.Width, textureArea); Vector2 halfRect = rectangle.Size() / 2f; @@ -96,11 +96,11 @@ namespace CalamityMod.Projectiles.Magic { Color alphaColor = colorArea; alphaColor = Projectile.GetAlpha(alphaColor); - alphaColor *= (float)(3 - i) / ((float)ProjectileID.Sets.TrailCacheLength[Projectile.type] * 1.5f); + alphaColor *= (float)(3 - i) / ((float)ProjectileID.Sets.TrailCacheLength[Type] * 1.5f); Vector2 oldPosition = Projectile.oldPos[i]; float projRotation = Projectile.rotation; SpriteEffects effects = spriteEffects; - if (ProjectileID.Sets.TrailingMode[Projectile.type] == 2) + if (ProjectileID.Sets.TrailingMode[Type] == 2) { projRotation = Projectile.oldRot[i]; effects = (Projectile.oldSpriteDirection[i] == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; diff --git a/Projectiles/Magic/LiquidBlade2.cs b/Projectiles/Magic/LiquidBlade2.cs index 21876dd11d..94ab1d3557 100644 --- a/Projectiles/Magic/LiquidBlade2.cs +++ b/Projectiles/Magic/LiquidBlade2.cs @@ -86,8 +86,8 @@ namespace CalamityMod.Projectiles.Magic spriteEffects = SpriteEffects.FlipHorizontally; } Color colorArea = Lighting.GetColor((int)((double)Projectile.position.X + (double)Projectile.width * 0.5) / 16, (int)(((double)Projectile.position.Y + (double)Projectile.height * 0.5) / 16.0)); - Texture2D texture2D3 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int textureArea = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D3 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int textureArea = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y3 = textureArea * Projectile.frame; Rectangle rectangle = new Rectangle(0, y3, texture2D3.Width, textureArea); Vector2 halfRect = rectangle.Size() / 2f; @@ -97,11 +97,11 @@ namespace CalamityMod.Projectiles.Magic { Color alphaColor = colorArea; alphaColor = Projectile.GetAlpha(alphaColor); - alphaColor *= (float)(3 - j) / ((float)ProjectileID.Sets.TrailCacheLength[Projectile.type] * 1.5f); + alphaColor *= (float)(3 - j) / ((float)ProjectileID.Sets.TrailCacheLength[Type] * 1.5f); Vector2 oldPosition = Projectile.oldPos[j]; float projRotation = Projectile.rotation; SpriteEffects effects = spriteEffects; - if (ProjectileID.Sets.TrailingMode[Projectile.type] == 2) + if (ProjectileID.Sets.TrailingMode[Type] == 2) { projRotation = Projectile.oldRot[j]; effects = (Projectile.oldSpriteDirection[j] == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; diff --git a/Projectiles/Magic/LuxorsGiftMagic.cs b/Projectiles/Magic/LuxorsGiftMagic.cs index 01915b5d3e..aaeb7a4d68 100644 --- a/Projectiles/Magic/LuxorsGiftMagic.cs +++ b/Projectiles/Magic/LuxorsGiftMagic.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Magic/MagneticOrb.cs b/Projectiles/Magic/MagneticOrb.cs index 8a6e384e68..e5b9faf445 100644 --- a/Projectiles/Magic/MagneticOrb.cs +++ b/Projectiles/Magic/MagneticOrb.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; } public override void SetDefaults() @@ -81,8 +81,8 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Magic/ManaChargedCoral.cs b/Projectiles/Magic/ManaChargedCoral.cs index 9fd20d08f4..2a0c915a13 100644 --- a/Projectiles/Magic/ManaChargedCoral.cs +++ b/Projectiles/Magic/ManaChargedCoral.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; + Main.projFrames[Type] = 3; } public override void SetDefaults() @@ -239,7 +239,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 position = Projectile.Center - Main.screenPosition; int variant = (int)(Projectile.frame - 1); Rectangle frame = new Rectangle(0, 26 * variant, 24, 24); diff --git a/Projectiles/Magic/ManaMonster.cs b/Projectiles/Magic/ManaMonster.cs index c8c85b203f..13c05a348d 100644 --- a/Projectiles/Magic/ManaMonster.cs +++ b/Projectiles/Magic/ManaMonster.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Magic public const int PlayerAttackRedirectTime = 45; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -109,7 +109,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Magic/MelterAmp.cs b/Projectiles/Magic/MelterAmp.cs index 12729568a3..3d959df991 100644 --- a/Projectiles/Magic/MelterAmp.cs +++ b/Projectiles/Magic/MelterAmp.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; + Main.projFrames[Type] = 3; } public override void SetDefaults() diff --git a/Projectiles/Magic/MeteorStar.cs b/Projectiles/Magic/MeteorStar.cs index ac9a45264c..2ae86002c8 100644 --- a/Projectiles/Magic/MeteorStar.cs +++ b/Projectiles/Magic/MeteorStar.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - Main.projFrames[Projectile.type] = 3; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; + Main.projFrames[Type] = 3; } public override void SetDefaults() @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 6 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 6 % Main.projFrames[Type]; Color LightYellow = new Color(255, 255, 76); Lighting.AddLight(Projectile.Center, LightYellow.ToVector3() * Projectile.Opacity * 0.5f); @@ -112,10 +112,10 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); // Draw the main texture in fullbright - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, SpriteEffects.None); return false; diff --git a/Projectiles/Magic/MeteorStarExplosion.cs b/Projectiles/Magic/MeteorStarExplosion.cs index aa7a66e539..200e4d1f14 100644 --- a/Projectiles/Magic/MeteorStarExplosion.cs +++ b/Projectiles/Magic/MeteorStarExplosion.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 7; + Main.projFrames[Type] = 7; } public override void SetDefaults() @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.friendly = true; Projectile.DamageType = DamageClass.Magic; Projectile.penetrate = -1; - Projectile.timeLeft = Main.projFrames[Projectile.type] * 5; + Projectile.timeLeft = Main.projFrames[Type] * 5; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 35; Projectile.tileCollide = false; diff --git a/Projectiles/Magic/MiasmaGas.cs b/Projectiles/Magic/MiasmaGas.cs index d7df7b79ea..2bece586d9 100644 --- a/Projectiles/Magic/MiasmaGas.cs +++ b/Projectiles/Magic/MiasmaGas.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Magic/NanoPurgeHoldout.cs b/Projectiles/Magic/NanoPurgeHoldout.cs index 4127860c0a..2437fb60be 100644 --- a/Projectiles/Magic/NanoPurgeHoldout.cs +++ b/Projectiles/Magic/NanoPurgeHoldout.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Magic ChargeTowardsNextShot -= itemUseTime; // Update the animation. - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; bool manaCostPaid = Owner.CheckMana(Owner.ActiveItem(), -1, true, false); if (manaCostPaid) diff --git a/Projectiles/Magic/NebulaCloud.cs b/Projectiles/Magic/NebulaCloud.cs index 89797b1b20..d2cafeea2e 100644 --- a/Projectiles/Magic/NebulaCloud.cs +++ b/Projectiles/Magic/NebulaCloud.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() diff --git a/Projectiles/Magic/NebulaCloudCore.cs b/Projectiles/Magic/NebulaCloudCore.cs index a5c36b5bb0..d48efbeab7 100644 --- a/Projectiles/Magic/NebulaCloudCore.cs +++ b/Projectiles/Magic/NebulaCloudCore.cs @@ -16,10 +16,10 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; // Decide what state the projectile is in. @@ -261,14 +261,14 @@ namespace CalamityMod.Projectiles.Magic float rotationScale = 0.95f + (Projectile.rotation * 0.75f).ToRotationVector2().Y * 0.1f; cloudColor *= rotationScale; float cloudScale = 0.6f + Projectile.scale * 0.6f * rotationScale; - Texture2D coreTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D coreTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D nebulaCloudTexture = ModContent.Request("CalamityMod/Projectiles/Magic/NebulaCloud", AssetRequestMode.ImmediateLoad).Value; Vector2 position = Projectile.Center - Main.screenPosition; - Vector2 coreOrigin = coreTexture.Size() / new Vector2(0, Main.projFrames[Projectile.type]) * 0.5f; + Vector2 coreOrigin = coreTexture.Size() / new Vector2(0, Main.projFrames[Type]) * 0.5f; Vector2 cloudOrigin = nebulaCloudTexture.Size() * 0.5f; Main.EntitySpriteDraw(nebulaCloudTexture, position, null, cloudColor, 0f - Projectile.rotation + 0.35f, cloudOrigin, cloudScale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0); Main.EntitySpriteDraw(nebulaCloudTexture, position, null, fuckYou, 0f - Projectile.rotation, cloudOrigin, Projectile.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0); - Main.EntitySpriteDraw(coreTexture, position, new Rectangle?(new Rectangle(0, Main.projFrames[Projectile.type] * Projectile.frame, coreTexture.Width, Main.projFrames[Projectile.type])), coreColor, (0f - Projectile.rotation) * 0.7f, coreOrigin, Projectile.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0); + Main.EntitySpriteDraw(coreTexture, position, new Rectangle?(new Rectangle(0, Main.projFrames[Type] * Projectile.frame, coreTexture.Width, Main.projFrames[Type])), coreColor, (0f - Projectile.rotation) * 0.7f, coreOrigin, Projectile.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0); Main.EntitySpriteDraw(nebulaCloudTexture, position, null, fuckYou * 0.8f, Projectile.rotation * 0.5f, cloudOrigin, Projectile.scale * 0.9f, spriteEffects, 0); fuckYou.A = 0; diff --git a/Projectiles/Magic/NebulaNova.cs b/Projectiles/Magic/NebulaNova.cs index 141a2e4745..84830b3f48 100644 --- a/Projectiles/Magic/NebulaNova.cs +++ b/Projectiles/Magic/NebulaNova.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 position = Projectile.Center - Main.screenPosition; Vector2 origin = texture.Size() / new Vector2(TotalXFrames, TotalYFrames) * 0.5f; Rectangle frame = texture.Frame(TotalXFrames, TotalYFrames, frameX, frameY); diff --git a/Projectiles/Magic/NebulousCataclysm_Held.cs b/Projectiles/Magic/NebulousCataclysm_Held.cs index 1e137421ee..d29dbbe09e 100644 --- a/Projectiles/Magic/NebulousCataclysm_Held.cs +++ b/Projectiles/Magic/NebulousCataclysm_Held.cs @@ -162,7 +162,7 @@ namespace CalamityMod.Projectiles.Magic if (Projectile.frameCounter < 5) return; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 position = Projectile.Center - Main.screenPosition; Vector2 origin = texture.Size() / new Vector2(TotalXFrames, TotalYFrames) * 0.5f; Rectangle frame = texture.Frame(TotalXFrames, TotalYFrames, frameX, frameY); diff --git a/Projectiles/Magic/NettleRight.cs b/Projectiles/Magic/NettleRight.cs index 6029ca4ce6..87e17e8810 100644 --- a/Projectiles/Magic/NettleRight.cs +++ b/Projectiles/Magic/NettleRight.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Magic // Draw the tip for the final thorn public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (Projectile.ai[0] == TotalSegments) texture = ModContent.Request("CalamityMod/Projectiles/Magic/NettleTip").Value; diff --git a/Projectiles/Magic/NuclearFuryProjectile.cs b/Projectiles/Magic/NuclearFuryProjectile.cs index 6629661976..24e443b373 100644 --- a/Projectiles/Magic/NuclearFuryProjectile.cs +++ b/Projectiles/Magic/NuclearFuryProjectile.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -148,7 +148,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Magic/OmicronHoldout.cs b/Projectiles/Magic/OmicronHoldout.cs index 9d3aef3fb7..a476798def 100644 --- a/Projectiles/Magic/OmicronHoldout.cs +++ b/Projectiles/Magic/OmicronHoldout.cs @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Magic } Owner.Calamity().GeneralScreenShakePower = 6.5f; - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity3, ModContent.ProjectileType(), Projectile.damage * 32, Projectile.knockBack, Projectile.owner, 0, 0); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity3, ModContent.ProjectileType(), Projectile.damage * 32, Projectile.knockBack, Projectile.owner, 0, 0); for (int i = 0; i < 8; i++) { @@ -123,12 +123,12 @@ namespace CalamityMod.Projectiles.Magic for (int i = 0; i < 5; i++) { firingVelocity3 = (shootDirection * 10).RotatedBy((0.035f * (i + 1)) * Utils.GetLerpValue(0, 55, Windup, true)); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity3 * (1 - i * 0.1f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 2); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity3 * (1 - i * 0.1f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 2); } for (int i = 0; i < 5; i++) { firingVelocity3 = (shootDirection * 10).RotatedBy((-0.035f * (i + 1)) * Utils.GetLerpValue(0, 55, Windup, true)); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity3 * (1 - i * 0.1f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 2); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity3 * (1 - i * 0.1f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 2); } Particle pulse3 = new GlowSparkParticle(GunTipPosition, shootDirection * 18, false, 6, 0.057f, EffectsColor, new Vector2(1.7f, 0.8f), true); diff --git a/Projectiles/Magic/OmicronWingman.cs b/Projectiles/Magic/OmicronWingman.cs index 9b830bea2a..9612ab824f 100644 --- a/Projectiles/Magic/OmicronWingman.cs +++ b/Projectiles/Magic/OmicronWingman.cs @@ -169,7 +169,7 @@ namespace CalamityMod.Projectiles.Magic { Projectile bomb = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, firingVelocity, ModContent.ProjectileType(), Projectile.damage * 14, Projectile.knockBack * 5, Projectile.owner, 0, 2); bomb.timeLeft = 530; - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, firingVelocity * 1.2f, ModContent.ProjectileType(), Projectile.damage * 14, Projectile.knockBack * 5, Projectile.owner, 0, 2); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, firingVelocity * 1.2f, ModContent.ProjectileType(), Projectile.damage * 14, Projectile.knockBack * 5, Projectile.owner, 0, 2); } } else @@ -179,9 +179,9 @@ namespace CalamityMod.Projectiles.Magic if (Main.myPlayer == Projectile.owner) { - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, firingVelocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 2); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, firingVelocity.RotatedBy(-0.05) * 0.85f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 2); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, firingVelocity.RotatedBy(0.05) * 0.85f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 2); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, firingVelocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 2); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, firingVelocity.RotatedBy(-0.05) * 0.85f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 2); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, firingVelocity.RotatedBy(0.05) * 0.85f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 2); } } @@ -258,7 +258,7 @@ namespace CalamityMod.Projectiles.Magic if (Projectile.spriteDirection == -1 ? MovingUp : !MovingUp) flipSprite |= SpriteEffects.FlipVertically; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Lerp(StaticEffectsColor, Color.White, 0.5f) * 0.2f, 1, texture); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Lerp(StaticEffectsColor, Color.White, 0.5f) * 0.2f, 1, texture); Main.EntitySpriteDraw(texture, drawPosition, null, drawColor, drawRotation, rotationPoint, Projectile.scale, flipSprite); return false; diff --git a/Projectiles/Magic/PartySparkle.cs b/Projectiles/Magic/PartySparkle.cs index f9d953761f..f2a5df1a09 100644 --- a/Projectiles/Magic/PartySparkle.cs +++ b/Projectiles/Magic/PartySparkle.cs @@ -10,6 +10,9 @@ namespace CalamityMod.Projectiles.Magic public class PartySparkle : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; + + public override string Texture => "CalamityMod/Projectiles/StarProj"; + public float Time { get => Projectile.ai[0]; @@ -60,7 +63,7 @@ namespace CalamityMod.Projectiles.Magic } public override bool PreDraw(ref Color lightColor) { - Texture2D sparkleTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D sparkleTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Color sparkleColor = CalamityUtils.MulticolorLerp(ColorSpectrumHue, RainbowPartyCannon.ColorSet) * Projectile.Opacity * 0.5f; sparkleColor.A = 0; diff --git a/Projectiles/Magic/PartySparkle.png b/Projectiles/Magic/PartySparkle.png deleted file mode 100644 index 0968156e79..0000000000 Binary files a/Projectiles/Magic/PartySparkle.png and /dev/null differ diff --git a/Projectiles/Magic/PhantasmalFuryProj.cs b/Projectiles/Magic/PhantasmalFuryProj.cs index d3e831b9f3..2250576b86 100644 --- a/Projectiles/Magic/PhantasmalFuryProj.cs +++ b/Projectiles/Magic/PhantasmalFuryProj.cs @@ -16,10 +16,10 @@ namespace CalamityMod.Projectiles.Magic public bool launched = false; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; dustRotation += 0.12f; @@ -136,7 +136,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.White, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.White, 1); return false; } diff --git a/Projectiles/Magic/PhasedGodRay.cs b/Projectiles/Magic/PhasedGodRay.cs index 633e74c335..06e3528bdc 100644 --- a/Projectiles/Magic/PhasedGodRay.cs +++ b/Projectiles/Magic/PhasedGodRay.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() diff --git a/Projectiles/Magic/PoseidonTyphoon.cs b/Projectiles/Magic/PoseidonTyphoon.cs index 2d992ffb05..e9b2f197a4 100644 --- a/Projectiles/Magic/PoseidonTyphoon.cs +++ b/Projectiles/Magic/PoseidonTyphoon.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, lightColor, Projectile.rotation, texture.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Magic/PrimordialAncientProjectile.cs b/Projectiles/Magic/PrimordialAncientProjectile.cs index 7d83787b70..a21659f739 100644 --- a/Projectiles/Magic/PrimordialAncientProjectile.cs +++ b/Projectiles/Magic/PrimordialAncientProjectile.cs @@ -28,9 +28,9 @@ namespace CalamityMod.Projectiles.Magic public List buffList = new List(new bool[Main.maxPlayers]); public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + Main.projFrames[Type] = 6; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -276,7 +276,7 @@ namespace CalamityMod.Projectiles.Magic public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.width * 0.5f * Projectile.scale, targetHitbox); public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor * 0.7f, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor * 0.7f, 1); Texture2D rTexture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; float randSize = Main.rand.NextFloat(0.8f, 1.2f); diff --git a/Projectiles/Magic/PrimordialEarthProjectile.cs b/Projectiles/Magic/PrimordialEarthProjectile.cs index 80592b03cc..e7d99309b2 100644 --- a/Projectiles/Magic/PrimordialEarthProjectile.cs +++ b/Projectiles/Magic/PrimordialEarthProjectile.cs @@ -22,9 +22,9 @@ namespace CalamityMod.Projectiles.Magic public List buffList = new List(new bool[Main.maxPlayers]); public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + Main.projFrames[Type] = 6; + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -192,7 +192,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { if (Projectile.timeLeft > 50) - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor * 0.4f, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor * 0.4f, 1); return true; } } diff --git a/Projectiles/Magic/PrinceFlameLarge.cs b/Projectiles/Magic/PrinceFlameLarge.cs index d29aae3dde..f79be51059 100644 --- a/Projectiles/Magic/PrinceFlameLarge.cs +++ b/Projectiles/Magic/PrinceFlameLarge.cs @@ -18,9 +18,9 @@ namespace CalamityMod.Projectiles.Magic public const int FadeoutTime = 25; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; + Main.projFrames[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 4; } public override void SetDefaults() @@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Magic { lightColor = Color.Lerp(lightColor, Color.White, 0.8f); lightColor.A /= 4; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Magic/PrinceFlameSmall.cs b/Projectiles/Magic/PrinceFlameSmall.cs index 23ad14f604..35c6dbffe4 100644 --- a/Projectiles/Magic/PrinceFlameSmall.cs +++ b/Projectiles/Magic/PrinceFlameSmall.cs @@ -13,10 +13,10 @@ namespace CalamityMod.Projectiles.Magic public const int AttackDelay = 12; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 3; } public override void SetDefaults() @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Magic { Time++; Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Type]; Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; Projectile.Opacity = Utils.GetLerpValue(0f, 15f, Projectile.timeLeft, true); @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Magic { lightColor = Color.Lerp(lightColor, Color.White, 0.8f); lightColor.A /= 3; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Magic/RainbowComet.cs b/Projectiles/Magic/RainbowComet.cs index b6fa5e20be..3bd0b240f3 100644 --- a/Projectiles/Magic/RainbowComet.cs +++ b/Projectiles/Magic/RainbowComet.cs @@ -17,9 +17,9 @@ namespace CalamityMod.Projectiles.Magic public const float FadeinTime = 40f; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 12; - Main.projFrames[Projectile.type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 12; + Main.projFrames[Type] = 3; } public override void SetDefaults() @@ -42,14 +42,14 @@ namespace CalamityMod.Projectiles.Magic Projectile.frameCounter++; if (Projectile.frameCounter % 4 == 3) - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; } public override bool PreDraw(ref Color lightColor) { - Texture2D cometTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D cometTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(cometTexture, Projectile.Center + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition, - cometTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame), + cometTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame), Color.White * Projectile.Opacity, Projectile.rotation, cometTexture.Size() * 0.5f, diff --git a/Projectiles/Magic/RainbowRocket.cs b/Projectiles/Magic/RainbowRocket.cs index 37b7d50a5a..8d93e5a912 100644 --- a/Projectiles/Magic/RainbowRocket.cs +++ b/Projectiles/Magic/RainbowRocket.cs @@ -37,10 +37,10 @@ namespace CalamityMod.Projectiles.Magic public const float HomingAcceleration = 0.4f; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; + Main.projFrames[Type] = 3; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.frameCounter++; if (Projectile.frameCounter % 4 == 3) - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; NPC potentialTarget = Projectile.Center.ClosestNPCAt(2300f, true, true); if (Time < SwerveTime) @@ -139,10 +139,10 @@ namespace CalamityMod.Projectiles.Magic Projectile.oldPos[0] = Projectile.position + Projectile.velocity.SafeNormalize(Vector2.Zero) * 50f; PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + Projectile.velocity), 80); - Texture2D rocketTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D rocketTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(rocketTexture, Projectile.Center - Main.screenPosition, - rocketTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame), + rocketTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame), GetRocketColor(), Projectile.rotation, rocketTexture.Size() * 0.5f, diff --git a/Projectiles/Magic/RancorArm.cs b/Projectiles/Magic/RancorArm.cs index 2f3c7a281c..e2ad741f5e 100644 --- a/Projectiles/Magic/RancorArm.cs +++ b/Projectiles/Magic/RancorArm.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Magic public ref float Time => ref Projectile.ai[1]; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; + Main.projFrames[Type] = 6; } public override void SetDefaults() @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Magic SoundStyle sound = Time == 0 ? SoundID.NPCDeath52 : SoundID.Item20; SoundEngine.PlaySound(sound, Projectile.Center); - Projectile.frame = Main.rand.Next(Main.projFrames[Projectile.type]); + Projectile.frame = Main.rand.Next(Main.projFrames[Type]); Vector2 newSize; switch (Projectile.frame) @@ -137,8 +137,8 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle frame = texture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Color light = Lighting.GetColor((int)Projectile.Center.X / 16, (int)Projectile.Center.Y / 16); diff --git a/Projectiles/Magic/RancorFog.cs b/Projectiles/Magic/RancorFog.cs index caa7e8cfb2..5ef1397d9e 100644 --- a/Projectiles/Magic/RancorFog.cs +++ b/Projectiles/Magic/RancorFog.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Magic { Main.spriteBatch.SetBlendState(BlendState.Additive); - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 origin = texture.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition; float opacity = Utils.GetLerpValue(0f, 0.08f, LightPower, true) * Projectile.Opacity * 0.5f; diff --git a/Projectiles/Magic/RancorHoldout.cs b/Projectiles/Magic/RancorHoldout.cs index e0edf03517..e845a63e6c 100644 --- a/Projectiles/Magic/RancorHoldout.cs +++ b/Projectiles/Magic/RancorHoldout.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Magic public const int ManaConsumeRate = 12; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 16; + Main.projFrames[Type] = 16; } public override void SetDefaults() @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.frameCounter++; if (Projectile.frameCounter >= 4) { - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; Projectile.frameCounter = 0; } diff --git a/Projectiles/Magic/RancorMagicCircle.cs b/Projectiles/Magic/RancorMagicCircle.cs index f048530309..ec4eefc63e 100644 --- a/Projectiles/Magic/RancorMagicCircle.cs +++ b/Projectiles/Magic/RancorMagicCircle.cs @@ -191,7 +191,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D outerCircleTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D outerCircleTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D outerCircleGlowmask = ModContent.Request(Texture + "Glowmask").Value; Texture2D innerCircleTexture = ModContent.Request(Texture + "Inner").Value; Texture2D innerCircleGlowmask = ModContent.Request(Texture + "InnerGlowmask").Value; diff --git a/Projectiles/Magic/RancorSmallCinder.cs b/Projectiles/Magic/RancorSmallCinder.cs index 01e6135270..30b36d11b1 100644 --- a/Projectiles/Magic/RancorSmallCinder.cs +++ b/Projectiles/Magic/RancorSmallCinder.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Magic public ref float Lifetime => ref Projectile.ai[1]; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; + Main.projFrames[Type] = 3; } public override void SetDefaults() @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Magic // Decide a frame to use on the first frame this projectile exists. if (Projectile.localAI[0] == 0f) { - Projectile.frame = Main.rand.Next(Main.projFrames[Projectile.type]); + Projectile.frame = Main.rand.Next(Main.projFrames[Type]); Projectile.localAI[0] = 1f; } diff --git a/Projectiles/Magic/RedirectingGildedSoul.cs b/Projectiles/Magic/RedirectingGildedSoul.cs index a8c0001025..f49200a9d7 100644 --- a/Projectiles/Magic/RedirectingGildedSoul.cs +++ b/Projectiles/Magic/RedirectingGildedSoul.cs @@ -15,10 +15,10 @@ namespace CalamityMod.Projectiles.Magic public ref float Time => ref Projectile.ai[1]; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -44,8 +44,8 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle frame = texture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); SpriteEffects direction = Projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; for (int i = 0; i < 4; i++) { diff --git a/Projectiles/Magic/RedirectingLostSoul.cs b/Projectiles/Magic/RedirectingLostSoul.cs index d70963e256..c4bae2a019 100644 --- a/Projectiles/Magic/RedirectingLostSoul.cs +++ b/Projectiles/Magic/RedirectingLostSoul.cs @@ -15,10 +15,10 @@ namespace CalamityMod.Projectiles.Magic public ref float Time => ref Projectile.ai[1]; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -44,8 +44,8 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { SpriteEffects direction = Projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle frame = texture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); for (int j = 0; j < Projectile.oldPos.Length / 2; j++) { diff --git a/Projectiles/Magic/RedirectingVengefulSoul.cs b/Projectiles/Magic/RedirectingVengefulSoul.cs index 9876be7596..550b223e20 100644 --- a/Projectiles/Magic/RedirectingVengefulSoul.cs +++ b/Projectiles/Magic/RedirectingVengefulSoul.cs @@ -15,10 +15,10 @@ namespace CalamityMod.Projectiles.Magic public ref float Time => ref Projectile.ai[1]; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -80,8 +80,8 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { SpriteEffects direction = Projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle frame = texture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); for (int i = 0; i < 4; i++) { for (int j = 0; j < Projectile.oldPos.Length / 2; j++) diff --git a/Projectiles/Magic/RougeSlashLarge.cs b/Projectiles/Magic/RougeSlashLarge.cs index 008c535d98..309880636c 100644 --- a/Projectiles/Magic/RougeSlashLarge.cs +++ b/Projectiles/Magic/RougeSlashLarge.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Magic/RougeSlashMedium.cs b/Projectiles/Magic/RougeSlashMedium.cs index 69ac3a213d..332bd32555 100644 --- a/Projectiles/Magic/RougeSlashMedium.cs +++ b/Projectiles/Magic/RougeSlashMedium.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Magic/RougeSlashSmall.cs b/Projectiles/Magic/RougeSlashSmall.cs index 558ea6a65d..a542522e7a 100644 --- a/Projectiles/Magic/RougeSlashSmall.cs +++ b/Projectiles/Magic/RougeSlashSmall.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Magic/SHPB.cs b/Projectiles/Magic/SHPB.cs index 6760d73471..8872be23e2 100644 --- a/Projectiles/Magic/SHPB.cs +++ b/Projectiles/Magic/SHPB.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() diff --git a/Projectiles/Magic/Sandstream.cs b/Projectiles/Magic/Sandstream.cs index 3333fb74ac..2b79fe2656 100644 --- a/Projectiles/Magic/Sandstream.cs +++ b/Projectiles/Magic/Sandstream.cs @@ -53,8 +53,18 @@ namespace CalamityMod.Projectiles.Magic dust2.velocity = -Projectile.velocity * Main.rand.NextFloat(0.2f, 0.5f); dust2.scale = Main.rand.NextFloat(0.3f, 1.3f); Projectile.penetrate = 1; - Projectile.velocity.Y += 0.1f; - Projectile.velocity.X *= 0.97f; + + //Projectile.velocity.Y += 0.1f; + //Projectile.velocity.X *= 0.97f; + + int falloffTime = 13 + 2; + if (Time > falloffTime) + Projectile.velocity.X *= 0.9711f; + if (Projectile.velocity.Y < 15 && Time > falloffTime) + Projectile.velocity.Y += 0.16f; + if (Projectile.velocity.Y < 5) + Projectile.velocity.Y *= 0.98f; + Projectile.extraUpdates = 3; } else @@ -86,6 +96,8 @@ namespace CalamityMod.Projectiles.Magic } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { + if (PostHit == false) + Time = 2; PostHit = true; Projectile.timeLeft = 300; float numberOfDusts = 6f; @@ -95,7 +107,7 @@ namespace CalamityMod.Projectiles.Magic float rot = MathHelper.ToRadians(i * rotFactor); Vector2 offset = new Vector2(Main.rand.NextFloat(0.5f, 1.5f), 0).RotatedBy(rot * Main.rand.NextFloat(1.1f, 9.1f)); Vector2 velOffset = new Vector2(Main.rand.NextFloat(0.5f, 1.5f), 0).RotatedBy(rot * Main.rand.NextFloat(1.1f, 9.1f)); - Dust dust = Dust.NewDustPerfect(target.Center + offset, Main.rand.NextBool(3) ? 288 : 207, new Vector2(velOffset.X, velOffset.Y)); + Dust dust = Dust.NewDustPerfect(target.Center + offset, Main.rand.NextBool(3) ? 288 : 121, new Vector2(velOffset.X, velOffset.Y)); dust.noGravity = false; dust.velocity = velOffset; dust.scale = Main.rand.NextFloat(0.5f, 0.8f); @@ -113,7 +125,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 velOffset = new Vector2(Main.rand.NextFloat(1.5f, 5.5f), 0).RotatedBy(rot * Main.rand.NextFloat(3.1f, 9.1f)); MediumMistParticle SandCloud = new MediumMistParticle(Projectile.Center + offset, velOffset * Main.rand.NextFloat(1.5f, 3f), Color.Peru, Color.PeachPuff, Main.rand.NextFloat(0.9f, 1.2f), 160f, Main.rand.NextFloat(0.03f, -0.03f)); GeneralParticleHandler.SpawnParticle(SandCloud); - Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, Main.rand.NextBool() ? 288 : 207, new Vector2(velOffset.X, velOffset.Y)); + Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, Main.rand.NextBool() ? 288 : 121, new Vector2(velOffset.X, velOffset.Y)); dust.noGravity = false; dust.velocity = velOffset; dust.scale = Main.rand.NextFloat(1.2f, 1.6f); diff --git a/Projectiles/Magic/SanguineFlareProj.cs b/Projectiles/Magic/SanguineFlareProj.cs index 33b8185b8d..e4c05b622e 100644 --- a/Projectiles/Magic/SanguineFlareProj.cs +++ b/Projectiles/Magic/SanguineFlareProj.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.cs b/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.cs index f43be3785f..fb896cbdec 100644 --- a/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.cs +++ b/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.cs @@ -16,10 +16,10 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.cs b/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.cs index 2535e7ee60..4810a27147 100644 --- a/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.cs +++ b/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.cs @@ -17,9 +17,9 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Magic/SerpentineBody.cs b/Projectiles/Magic/SerpentineBody.cs index c3586ae240..aa3ca04383 100644 --- a/Projectiles/Magic/SerpentineBody.cs +++ b/Projectiles/Magic/SerpentineBody.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.NeedsUUID[Projectile.type] = true; + ProjectileID.Sets.NeedsUUID[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Magic/SerpentineHead.cs b/Projectiles/Magic/SerpentineHead.cs index b49cdfa57a..59bb7d7b8b 100644 --- a/Projectiles/Magic/SerpentineHead.cs +++ b/Projectiles/Magic/SerpentineHead.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.NeedsUUID[Projectile.type] = true; + ProjectileID.Sets.NeedsUUID[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Magic/SerpentineTail.cs b/Projectiles/Magic/SerpentineTail.cs index 0d147b0b30..f187432d5e 100644 --- a/Projectiles/Magic/SerpentineTail.cs +++ b/Projectiles/Magic/SerpentineTail.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.NeedsUUID[Projectile.type] = true; + ProjectileID.Sets.NeedsUUID[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Magic/ShadeNimbusCloud.cs b/Projectiles/Magic/ShadeNimbusCloud.cs index a94a50d56c..29a58b8da6 100644 --- a/Projectiles/Magic/ShadeNimbusCloud.cs +++ b/Projectiles/Magic/ShadeNimbusCloud.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Magic // Does the animation of the projectile, the number in the middle determines the speed of the animatino. Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 8 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 8 % Main.projFrames[Type]; // If the projectile is about to die or it collides with a tile, start fading. // Depending on how strong the fade-out speed is, it'll adapt by the amount of time left for it do die. diff --git a/Projectiles/Magic/ShadecrystalProjectile.cs b/Projectiles/Magic/ShadecrystalProjectile.cs index b30d1e466a..27b15744f2 100644 --- a/Projectiles/Magic/ShadecrystalProjectile.cs +++ b/Projectiles/Magic/ShadecrystalProjectile.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Magic/Shadowbolt.cs b/Projectiles/Magic/Shadowbolt.cs index 2384ea76c7..2b1574d21e 100644 --- a/Projectiles/Magic/Shadowbolt.cs +++ b/Projectiles/Magic/Shadowbolt.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() { diff --git a/Projectiles/Magic/ShiftingSandsProj.cs b/Projectiles/Magic/ShiftingSandsProj.cs index 509fa87d59..f231dfd265 100644 --- a/Projectiles/Magic/ShiftingSandsProj.cs +++ b/Projectiles/Magic/ShiftingSandsProj.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -133,7 +133,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Magic/SlitheringEelProjectile.cs b/Projectiles/Magic/SlitheringEelProjectile.cs index 21beaa4a6d..1c1582c4af 100644 --- a/Projectiles/Magic/SlitheringEelProjectile.cs +++ b/Projectiles/Magic/SlitheringEelProjectile.cs @@ -26,8 +26,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() diff --git a/Projectiles/Magic/SmallSpirit.cs b/Projectiles/Magic/SmallSpirit.cs index 495e8611b2..d220c36ccd 100644 --- a/Projectiles/Magic/SmallSpirit.cs +++ b/Projectiles/Magic/SmallSpirit.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; + Main.projFrames[Type] = 3; } public override void SetDefaults() @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Magic // Handle frames. Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Type]; float maxOpacity = 1f; diff --git a/Projectiles/Magic/Snowflake.cs b/Projectiles/Magic/Snowflake.cs index 75b16aec3f..f024feb401 100644 --- a/Projectiles/Magic/Snowflake.cs +++ b/Projectiles/Magic/Snowflake.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -167,7 +167,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Magic/SnowflakeIceStar.cs b/Projectiles/Magic/SnowflakeIceStar.cs index 31783bb77f..4984b0cd42 100644 --- a/Projectiles/Magic/SnowflakeIceStar.cs +++ b/Projectiles/Magic/SnowflakeIceStar.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Magic/SparklingLaser.cs b/Projectiles/Magic/SparklingLaser.cs index 1adfe56d9c..ced25d2724 100644 --- a/Projectiles/Magic/SparklingLaser.cs +++ b/Projectiles/Magic/SparklingLaser.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; } public override void SetDefaults() @@ -123,7 +123,7 @@ namespace CalamityMod.Projectiles.Magic // Determine frames. Projectile.frameCounter++; if (Projectile.frameCounter % 5f == 4f) - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; } // Gently adjusts the aim vector of the laser to point towards the mouse. @@ -174,9 +174,9 @@ namespace CalamityMod.Projectiles.Magic return false; Color beamColor = LaserOverlayColor; - Rectangle startFrameArea = LaserBeginTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); - Rectangle middleFrameArea = LaserMiddleTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); - Rectangle endFrameArea = LaserEndTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Rectangle startFrameArea = LaserBeginTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Rectangle middleFrameArea = LaserMiddleTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Rectangle endFrameArea = LaserEndTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); // Start texture drawing. // This is a lot more scuffed than other lasers... for some reason I'll try not to think about right now. diff --git a/Projectiles/Magic/SpiritCongregation.cs b/Projectiles/Magic/SpiritCongregation.cs index 703931b497..06ed20b5e5 100644 --- a/Projectiles/Magic/SpiritCongregation.cs +++ b/Projectiles/Magic/SpiritCongregation.cs @@ -46,8 +46,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 8; } public override void SetDefaults() @@ -269,7 +269,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (CurrentPower > LargeMouthPowerLowerBound) texture = ModContent.Request("CalamityMod/Projectiles/Magic/SpiritCongregationBig").Value; diff --git a/Projectiles/Magic/Starblast.cs b/Projectiles/Magic/Starblast.cs index f590783b6c..b267683a8d 100644 --- a/Projectiles/Magic/Starblast.cs +++ b/Projectiles/Magic/Starblast.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Magic/StickyFeather.cs b/Projectiles/Magic/StickyFeather.cs index 233d5383dd..96822f36ce 100644 --- a/Projectiles/Magic/StickyFeather.cs +++ b/Projectiles/Magic/StickyFeather.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Magic/TacticiansTrumpCardProj.cs b/Projectiles/Magic/TacticiansTrumpCardProj.cs index 8d57cb81ef..a186aa8245 100644 --- a/Projectiles/Magic/TacticiansTrumpCardProj.cs +++ b/Projectiles/Magic/TacticiansTrumpCardProj.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Magic if (Projectile.timeLeft > 295) return false; - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Magic/TearsofHeavenProjectile.cs b/Projectiles/Magic/TearsofHeavenProjectile.cs index ad1e1449b4..c3c2809d12 100644 --- a/Projectiles/Magic/TearsofHeavenProjectile.cs +++ b/Projectiles/Magic/TearsofHeavenProjectile.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Magic/Teslabeam.cs b/Projectiles/Magic/Teslabeam.cs index bc5f59087b..15583e7412 100644 --- a/Projectiles/Magic/Teslabeam.cs +++ b/Projectiles/Magic/Teslabeam.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 1; + Main.projFrames[Type] = 1; } public override void SetDefaults() diff --git a/Projectiles/Magic/ThunderboltHoldout.cs b/Projectiles/Magic/ThunderboltHoldout.cs index 1e7782345f..1fdc41da6f 100644 --- a/Projectiles/Magic/ThunderboltHoldout.cs +++ b/Projectiles/Magic/ThunderboltHoldout.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Magic public static Asset MuzzleFlash; public override void Load() => MuzzleFlash = ModContent.Request("CalamityMod/Projectiles/Magic/ThunderboltHoldoutFlash"); - public override void SetStaticDefaults() => Main.projFrames[Projectile.type] = 15; + public override void SetStaticDefaults() => Main.projFrames[Type] = 15; public override void SetDefaults() { diff --git a/Projectiles/Magic/ThunderboltOrb.cs b/Projectiles/Magic/ThunderboltOrb.cs index 6be0dc9933..56d7a48e04 100644 --- a/Projectiles/Magic/ThunderboltOrb.cs +++ b/Projectiles/Magic/ThunderboltOrb.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; } public override void SetDefaults() @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 4 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 4 % Main.projFrames[Type]; Projectile.velocity *= 0.8f; Projectile.rotation += 0.01f; diff --git a/Projectiles/Magic/TradewindsProjectile.cs b/Projectiles/Magic/TradewindsProjectile.cs index 3963edfbe5..ba0a63c9e0 100644 --- a/Projectiles/Magic/TradewindsProjectile.cs +++ b/Projectiles/Magic/TradewindsProjectile.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Magic/UndinesRetributionSpear.cs b/Projectiles/Magic/UndinesRetributionSpear.cs index 186b8ea30d..4b973c8524 100644 --- a/Projectiles/Magic/UndinesRetributionSpear.cs +++ b/Projectiles/Magic/UndinesRetributionSpear.cs @@ -13,10 +13,10 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Magic/ValkyrieRayBeam.cs b/Projectiles/Magic/ValkyrieRayBeam.cs index f1ab86759c..c23a73f8d4 100644 --- a/Projectiles/Magic/ValkyrieRayBeam.cs +++ b/Projectiles/Magic/ValkyrieRayBeam.cs @@ -141,7 +141,7 @@ namespace CalamityMod.Projectiles.Magic if (beamVector == Vector2.Zero || Projectile.velocity != Vector2.Zero) return false; - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; float beamLength = Projectile.ai[0]; Vector2 centerFloored = Projectile.Center.Floor() + beamVector * Projectile.scale * BeamRenderTileOffset; Vector2 scaleVec = new Vector2(Projectile.scale); diff --git a/Projectiles/Magic/VeeringWindAirWave.cs b/Projectiles/Magic/VeeringWindAirWave.cs index debc0d10d9..654b6a8349 100644 --- a/Projectiles/Magic/VeeringWindAirWave.cs +++ b/Projectiles/Magic/VeeringWindAirWave.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; } public override void SetDefaults() @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) // Photoviscerator ball drawcode, slightly edited. { - Texture2D lightTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D lightTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; for (int i = 0; i < Projectile.oldPos.Length; i++) { float colorInterpolation = (float)Math.Cos(Projectile.timeLeft / 2.4f + Main.GlobalTimeWrappedHourly / 20f + i / (float)Projectile.oldPos.Length * MathHelper.Pi) * 0.5f + 0.5f; diff --git a/Projectiles/Magic/VeeringWindFrostWave.cs b/Projectiles/Magic/VeeringWindFrostWave.cs index c5d52e0493..4716b8c50c 100644 --- a/Projectiles/Magic/VeeringWindFrostWave.cs +++ b/Projectiles/Magic/VeeringWindFrostWave.cs @@ -12,11 +12,12 @@ namespace CalamityMod.Projectiles.Magic public class VeeringWindFrostWave : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; + public override string Texture => "Terraria/Images/Projectile_348"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; } public override void SetDefaults() @@ -47,7 +48,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) // Photoviscerator ball drawcode, slightly edited. { - Texture2D lightTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D lightTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; for (int i = 0; i < Projectile.oldPos.Length; i++) { float colorInterpolation = (float)Math.Cos(Projectile.timeLeft / 4.8f + Main.GlobalTimeWrappedHourly / 20f + i / (float)Projectile.oldPos.Length * MathHelper.Pi) * 0.5f + 0.5f; diff --git a/Projectiles/Magic/VeeringWindFrostWave.png b/Projectiles/Magic/VeeringWindFrostWave.png deleted file mode 100644 index 8246150f12..0000000000 Binary files a/Projectiles/Magic/VeeringWindFrostWave.png and /dev/null differ diff --git a/Projectiles/Magic/VehemenceBolt.cs b/Projectiles/Magic/VehemenceBolt.cs index b0b4bf4cb7..ea3f439cc1 100644 --- a/Projectiles/Magic/VehemenceBolt.cs +++ b/Projectiles/Magic/VehemenceBolt.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Magic public Player Owner => Main.player[Projectile.owner]; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -116,7 +116,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Magic/VehemenceSkull.cs b/Projectiles/Magic/VehemenceSkull.cs index 514291573a..2a4cf2e042 100644 --- a/Projectiles/Magic/VehemenceSkull.cs +++ b/Projectiles/Magic/VehemenceSkull.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Magic public ref float Time => ref Projectile.ai[0]; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 10; + Main.projFrames[Type] = 10; } public override void SetDefaults() @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Magic if (Projectile.frame >= 4) Projectile.frame = 0; } - else if (Projectile.owner == Main.myPlayer && Projectile.frame >= Main.projFrames[Projectile.type]) + else if (Projectile.owner == Main.myPlayer && Projectile.frame >= Main.projFrames[Type]) Projectile.Kill(); // Produce some light. diff --git a/Projectiles/Magic/VenusianBolt.cs b/Projectiles/Magic/VenusianBolt.cs index 0b377eb749..4c5d14a937 100644 --- a/Projectiles/Magic/VenusianBolt.cs +++ b/Projectiles/Magic/VenusianBolt.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public int time = 0; public bool explode = true; @@ -133,7 +133,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.White, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.White, 1); return true; } } diff --git a/Projectiles/Magic/VenusianFlame.cs b/Projectiles/Magic/VenusianFlame.cs index 9d06d4ffea..6d87b5c89c 100644 --- a/Projectiles/Magic/VenusianFlame.cs +++ b/Projectiles/Magic/VenusianFlame.cs @@ -12,9 +12,9 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 3; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Magic if (!initialized) { initialized = true; - Projectile.frame = Main.rand.Next(Main.projFrames[Projectile.type]); + Projectile.frame = Main.rand.Next(Main.projFrames[Type]); } Projectile.frameCounter++; if (Projectile.frameCounter > 4) @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -143,7 +143,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Magic/VisceraBeam.cs b/Projectiles/Magic/VisceraBeam.cs index 6352e6ca85..d2b5f5d155 100644 --- a/Projectiles/Magic/VisceraBeam.cs +++ b/Projectiles/Magic/VisceraBeam.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() diff --git a/Projectiles/Magic/VitriolicViperFang.cs b/Projectiles/Magic/VitriolicViperFang.cs index b011911b30..74432eebd5 100644 --- a/Projectiles/Magic/VitriolicViperFang.cs +++ b/Projectiles/Magic/VitriolicViperFang.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Magic Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + rotationalDrawOffset, null, auraColor with { A = 0 } * Utils.GetLerpValue(255, 0, Projectile.alpha), Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None); } - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor * 0.5f, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor * 0.5f, 2); return true; } diff --git a/Projectiles/Magic/VoidVortexProj.cs b/Projectiles/Magic/VoidVortexProj.cs index e855c2f25c..c0a5cfbf3f 100644 --- a/Projectiles/Magic/VoidVortexProj.cs +++ b/Projectiles/Magic/VoidVortexProj.cs @@ -23,9 +23,9 @@ namespace CalamityMod.Projectiles.Magic public bool rotDirection = false; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + Main.projFrames[Type] = 5; + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -191,13 +191,13 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture2D13.Width / 2f, framing / 2f), Projectile.scale * (Projectile.ai[2] == 3 ? 1.3f : 1f), SpriteEffects.None, 0); if (Projectile.ai[2] == 3) - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor * 0.3f, 1, texture2D13); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor * 0.3f, 1, texture2D13); return false; } diff --git a/Projectiles/Magic/VolatileStarcore.cs b/Projectiles/Magic/VolatileStarcore.cs index d4aa82ba38..8a061d7cf4 100644 --- a/Projectiles/Magic/VolatileStarcore.cs +++ b/Projectiles/Magic/VolatileStarcore.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = NumAnimationFrames; + Main.projFrames[Type] = NumAnimationFrames; } public override void SetDefaults() { diff --git a/Projectiles/Magic/VortexElementalBeam.cs b/Projectiles/Magic/VortexElementalBeam.cs index 588e6a436f..d1ee143217 100644 --- a/Projectiles/Magic/VortexElementalBeam.cs +++ b/Projectiles/Magic/VortexElementalBeam.cs @@ -23,9 +23,9 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 30; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.MinionShot[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 30; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -118,7 +118,7 @@ namespace CalamityMod.Projectiles.Magic #region Drawing public override bool PreDraw(ref Color lightColor) { - Texture2D lightningSegmentTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D lightningSegmentTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Projectile.GetAlpha(lightColor); Vector2 lightningScale = new Vector2(Projectile.scale) / 2f; for (int i = 0; i < 3; i++) diff --git a/Projectiles/Magic/WaterLeechProj.cs b/Projectiles/Magic/WaterLeechProj.cs index 6345b2e1f5..cc1d8ddeb6 100644 --- a/Projectiles/Magic/WaterLeechProj.cs +++ b/Projectiles/Magic/WaterLeechProj.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -70,8 +70,8 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int height = texture.Height / Main.projFrames[Type]; int drawStart = height * Projectile.frame; Vector2 origin = Projectile.Size / 2; SpriteEffects spriteEffects = SpriteEffects.None; @@ -85,8 +85,8 @@ namespace CalamityMod.Projectiles.Magic public override void PostDraw(Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int height = texture.Height / Main.projFrames[Type]; int drawStart = height * Projectile.frame; Vector2 origin = Projectile.Size / 2; SpriteEffects spriteEffects = SpriteEffects.None; diff --git a/Projectiles/Magic/WingmanHoldout.cs b/Projectiles/Magic/WingmanHoldout.cs index c0a303c917..ecf2db24b1 100644 --- a/Projectiles/Magic/WingmanHoldout.cs +++ b/Projectiles/Magic/WingmanHoldout.cs @@ -191,13 +191,13 @@ namespace CalamityMod.Projectiles.Magic { SoundStyle fire = new("CalamityMod/Sounds/Item/DeadSunExplosion"); SoundEngine.PlaySound(fire with { Volume = 0.35f, Pitch = -0.4f, PitchVariance = 0.2f }, Projectile.Center); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, (firingVelocity * 1.3f) * Utils.GetLerpValue(60, 10, FiringTime, true), ModContent.ProjectileType(), (int)(Projectile.damage * 6), Projectile.knockBack * 5, Projectile.owner, 0); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, (firingVelocity * 1.3f) * Utils.GetLerpValue(60, 10, FiringTime, true), ModContent.ProjectileType(), (int)(Projectile.damage * 6), Projectile.knockBack * 5, Projectile.owner, 0); } else { SoundStyle fire = new("CalamityMod/Sounds/Item/MagnaCannonShot"); SoundEngine.PlaySound(fire with { Volume = 0.25f, Pitch = 1f, PitchVariance = 0.35f }, Projectile.Center); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, firingVelocity * Utils.GetLerpValue(80, 10, FiringTime, true), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, firingVelocity * Utils.GetLerpValue(80, 10, FiringTime, true), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0); } // Inside here go all the things that dedicated servers shouldn't spend resources on. @@ -270,7 +270,7 @@ namespace CalamityMod.Projectiles.Magic if (Projectile.spriteDirection == -1 ? MovingUp : !MovingUp) flipSprite |= SpriteEffects.FlipVertically; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Lerp(StaticEffectsColor, Color.White, 0.5f) * 0.2f, 1, texture); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Lerp(StaticEffectsColor, Color.White, 0.5f) * 0.2f, 1, texture); Main.EntitySpriteDraw(texture, drawPosition, null, drawColor, drawRotation, rotationPoint, Projectile.scale, flipSprite); return false; diff --git a/Projectiles/Magic/WingmanShot.cs b/Projectiles/Magic/WingmanShot.cs index d964fb366e..4a291ae93a 100644 --- a/Projectiles/Magic/WingmanShot.cs +++ b/Projectiles/Magic/WingmanShot.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Magic public int time = 0; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 14; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 14; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Magic float drawRotation = Projectile.rotation; Vector2 rotationPoint = texture.Size() * 0.5f; - //CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Lerp(Color.Cyan, Color.White, 0.7f) * 0.6f, 1); + //CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Lerp(Color.Cyan, Color.White, 0.7f) * 0.6f, 1); Main.EntitySpriteDraw(texture, drawPosition, null, mainColor with { A = 0 }, drawRotation, rotationPoint, new Vector2(0.5f, 1.4f) * 0.025f * Projectile.scale, SpriteEffects.None); Main.EntitySpriteDraw(texture, drawPosition, null, Color.White with { A = 0 }, drawRotation, rotationPoint, new Vector2(0.5f, 1.4f) * 0.02f * Projectile.scale, SpriteEffects.None); return false; diff --git a/Projectiles/Magic/WulfrumBolt.cs b/Projectiles/Magic/WulfrumBolt.cs index ce3f7716a0..591346ae76 100644 --- a/Projectiles/Magic/WulfrumBolt.cs +++ b/Projectiles/Magic/WulfrumBolt.cs @@ -46,8 +46,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() diff --git a/Projectiles/Magic/WyvernFeatherGreen.cs b/Projectiles/Magic/WyvernFeatherGreen.cs index 77753bde0f..74c6d6ee5f 100644 --- a/Projectiles/Magic/WyvernFeatherGreen.cs +++ b/Projectiles/Magic/WyvernFeatherGreen.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Magic/WyvernFeatherPink.cs b/Projectiles/Magic/WyvernFeatherPink.cs index 0603088547..c336051740 100644 --- a/Projectiles/Magic/WyvernFeatherPink.cs +++ b/Projectiles/Magic/WyvernFeatherPink.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Magic/WyvernFeatherPurple.cs b/Projectiles/Magic/WyvernFeatherPurple.cs index 11dab5c10b..fbc4db8a6d 100644 --- a/Projectiles/Magic/WyvernFeatherPurple.cs +++ b/Projectiles/Magic/WyvernFeatherPurple.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Magic/WyvernProjectile.cs b/Projectiles/Magic/WyvernProjectile.cs index 97a304fa72..8900d5bdd0 100644 --- a/Projectiles/Magic/WyvernProjectile.cs +++ b/Projectiles/Magic/WyvernProjectile.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Magic/YharimsCrystalBeam.cs b/Projectiles/Magic/YharimsCrystalBeam.cs index 9f3bf8f341..7c811c7501 100644 --- a/Projectiles/Magic/YharimsCrystalBeam.cs +++ b/Projectiles/Magic/YharimsCrystalBeam.cs @@ -221,7 +221,7 @@ namespace CalamityMod.Projectiles.Magic if (Projectile.velocity == Vector2.Zero) return false; - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; float beamLength = Projectile.localAI[1]; Vector2 centerFloored = Projectile.Center.Floor() + Projectile.velocity * Projectile.scale * BeamRenderTileOffset; Vector2 scaleVec = new Vector2(Projectile.scale); diff --git a/Projectiles/Magic/YharimsCrystalPrism.cs b/Projectiles/Magic/YharimsCrystalPrism.cs index aeb274e80e..5be4576bfe 100644 --- a/Projectiles/Magic/YharimsCrystalPrism.cs +++ b/Projectiles/Magic/YharimsCrystalPrism.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.NeedsUUID[Projectile.type] = true; + Main.projFrames[Type] = 6; + ProjectileID.Sets.NeedsUUID[Type] = true; } public override void SetDefaults() @@ -176,8 +176,8 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { SpriteEffects eff = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int frameHeight = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int frameHeight = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int texYOffset = frameHeight * Projectile.frame; Vector2 sheetInsertVec = (Projectile.Center + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition).Floor(); Main.spriteBatch.Draw(tex, sheetInsertVec, new Rectangle?(new Rectangle(0, texYOffset, tex.Width, frameHeight)), Color.White, Projectile.rotation, new Vector2(tex.Width / 2f, frameHeight / 2f), Projectile.scale, eff, 0f); diff --git a/Projectiles/Melee/AbyssBladeProjectile.cs b/Projectiles/Melee/AbyssBladeProjectile.cs index ff30c4275e..9f9a13004b 100644 --- a/Projectiles/Melee/AbyssBladeProjectile.cs +++ b/Projectiles/Melee/AbyssBladeProjectile.cs @@ -40,8 +40,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() diff --git a/Projectiles/Melee/AmidiasWhirlpool.cs b/Projectiles/Melee/AmidiasWhirlpool.cs index 0b200a0bf7..a381b0710a 100644 --- a/Projectiles/Melee/AmidiasWhirlpool.cs +++ b/Projectiles/Melee/AmidiasWhirlpool.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -13,8 +14,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -139,7 +140,8 @@ namespace CalamityMod.Projectiles.Melee { return new Color(30, 255, 253); } - + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item10, Projectile.position); diff --git a/Projectiles/Melee/AncientBeam.cs b/Projectiles/Melee/AncientBeam.cs index 5ae73dd099..f0d35c5aed 100644 --- a/Projectiles/Melee/AncientBeam.cs +++ b/Projectiles/Melee/AncientBeam.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 2; } const float MaxTime = 40; @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > 35) return false; - DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/AncientStar.cs b/Projectiles/Melee/AncientStar.cs index 5dc157d780..dfbfc0db3d 100644 --- a/Projectiles/Melee/AncientStar.cs +++ b/Projectiles/Melee/AncientStar.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); if (Shine == 1f) { diff --git a/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs b/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs index 69c3d25b70..7306abe908 100644 --- a/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs +++ b/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs @@ -33,8 +33,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -131,7 +131,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 drawOrigin = new Vector2(Owner.direction < 0 ? sword.Width : 0f, sword.Height); Vector2 drawOffset = Owner.Center + drawAngle.ToRotationVector2() * 10f - Main.screenPosition; - if (CalamityClientConfig.Instance.Afterimages && Timer > ProjectileID.Sets.TrailCacheLength[Projectile.type]) + if (CalamityClientConfig.Instance.Afterimages && Timer > ProjectileID.Sets.TrailCacheLength[Type]) { for (int i = 0; i < Projectile.oldRot.Length; ++i) { diff --git a/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs b/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs index 7ef7023edc..78e0a6833b 100644 --- a/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs +++ b/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs @@ -75,8 +75,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -184,9 +184,7 @@ namespace CalamityMod.Projectiles.Melee var source = Projectile.GetSource_FromThis(); Projectile blast = Projectile.NewProjectileDirect(source, Owner.Center + adjustedBlastRotation.ToRotationVector2() * 10f, adjustedBlastRotation.ToRotationVector2() * 20f, ProjectileType(), (int)(ArkoftheCosmos.SwirlBoltDamageMultiplier / ArkoftheCosmos.SwirlBoltAmount * Projectile.damage), 0f, Owner.whoAmI, 0.55f, MathHelper.Pi * 0.05f); - { - blast.timeLeft = 100; - } + blast.timeLeft = 100; } } @@ -244,9 +242,7 @@ namespace CalamityMod.Projectiles.Melee { var source = Projectile.GetSource_FromThis(); Projectile blast = Projectile.NewProjectileDirect(source, Projectile.Center + (MathHelper.TwoPi * (i / 3f) + rotationOffset).ToRotationVector2() * 30f, (MathHelper.TwoPi * (i / 3f) + rotationOffset).ToRotationVector2() * 20f, ProjectileType(), (int)(ArkoftheCosmos.SnapBoltsDamageMultiplier * Projectile.damage), 0f, Owner.whoAmI, 0.55f, MathHelper.Pi * 0.05f); - { - blast.timeLeft = 100; - } + blast.timeLeft = 100; } //Reset local immunity so that the snap can do damage @@ -489,7 +485,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 drawOrigin = new Vector2(flipped ? sword.Width : 0f, sword.Height); Vector2 drawOffset = Owner.Center + drawAngle.ToRotationVector2() * 10f - Main.screenPosition; - if (CalamityClientConfig.Instance.Afterimages && SwingTimer > ProjectileID.Sets.TrailCacheLength[Projectile.type] && Combo == 0f) + if (CalamityClientConfig.Instance.Afterimages && SwingTimer > ProjectileID.Sets.TrailCacheLength[Type] && Combo == 0f) { for (int i = 1; i < Projectile.oldRot.Length; ++i) { @@ -544,7 +540,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 backScissorDrawPosition = Owner.Center + drawAngle.ToRotationVector2() * 10f + (drawAngle.ToRotationVector2() * 56f + (drawAngle - MathHelper.PiOver2).ToRotationVector2() * 11 * Owner.direction) * Projectile.scale - Main.screenPosition; //Lined up with the hole in the front blade - if (CalamityClientConfig.Instance.Afterimages && SwingTimer > ProjectileID.Sets.TrailCacheLength[Projectile.type]) + if (CalamityClientConfig.Instance.Afterimages && SwingTimer > ProjectileID.Sets.TrailCacheLength[Type]) { Texture2D afterimage = Request("CalamityMod/Projectiles/Melee/SunderingScissorsGlow").Value; diff --git a/Projectiles/Melee/ArkOfTheElements_SwungBlade.cs b/Projectiles/Melee/ArkOfTheElements_SwungBlade.cs index 7afe20cae8..861b0490a3 100644 --- a/Projectiles/Melee/ArkOfTheElements_SwungBlade.cs +++ b/Projectiles/Melee/ArkOfTheElements_SwungBlade.cs @@ -74,8 +74,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -308,7 +308,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 drawOrigin = new Vector2(Combo == 1 ? sword.Width / 2f : flipped ? sword.Width : 0f, sword.Height); Vector2 drawOffset = Owner.Center + drawAngle.ToRotationVector2() * 10f - Main.screenPosition; - if (CalamityClientConfig.Instance.Afterimages && SwingTimer > ProjectileID.Sets.TrailCacheLength[Projectile.type]) + if (CalamityClientConfig.Instance.Afterimages && SwingTimer > ProjectileID.Sets.TrailCacheLength[Type]) { for (int i = 0; i < Projectile.oldRot.Length; ++i) { @@ -362,7 +362,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 backScissorDrawPosition = Owner.Center + drawAngle.ToRotationVector2() * 10f + functionalDrawAngle.ToRotationVector2() * 70f * Projectile.scale - Main.screenPosition; //Lined up with the hole in the front blade float backScissorRotation = drawRotation + (Combo == 1 ? (!flipped ? MathHelper.PiOver4 * 0.75f : MathHelper.PiOver4 * -0.75f) : 0f); - if (CalamityClientConfig.Instance.Afterimages && SwingTimer > ProjectileID.Sets.TrailCacheLength[Projectile.type]) + if (CalamityClientConfig.Instance.Afterimages && SwingTimer > ProjectileID.Sets.TrailCacheLength[Type]) { for (int i = 0; i < Projectile.oldRot.Length; ++i) { diff --git a/Projectiles/Melee/ArkoftheCosmos_Constellation.cs b/Projectiles/Melee/ArkoftheCosmos_Constellation.cs index 279ffadd27..20f812135e 100644 --- a/Projectiles/Melee/ArkoftheCosmos_Constellation.cs +++ b/Projectiles/Melee/ArkoftheCosmos_Constellation.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 1; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 1; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { diff --git a/Projectiles/Melee/AstralScytheProjectile.cs b/Projectiles/Melee/AstralScytheProjectile.cs index f57ef7acea..a821a14477 100644 --- a/Projectiles/Melee/AstralScytheProjectile.cs +++ b/Projectiles/Melee/AstralScytheProjectile.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 3; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Melee/AtaraxiaMain.cs b/Projectiles/Melee/AtaraxiaMain.cs index b359302337..ca674586b8 100644 --- a/Projectiles/Melee/AtaraxiaMain.cs +++ b/Projectiles/Melee/AtaraxiaMain.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = NumAnimationFrames; + Main.projFrames[Type] = NumAnimationFrames; } public override void SetDefaults() diff --git a/Projectiles/Melee/AtaraxiaSide.cs b/Projectiles/Melee/AtaraxiaSide.cs index 9af813ba37..9b4779611c 100644 --- a/Projectiles/Melee/AtaraxiaSide.cs +++ b/Projectiles/Melee/AtaraxiaSide.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = NumAnimationFrames; + Main.projFrames[Type] = NumAnimationFrames; } public override void SetDefaults() diff --git a/Projectiles/Melee/BalefulHarvesterProjectile.cs b/Projectiles/Melee/BalefulHarvesterProjectile.cs index ae84265cb7..3841513df9 100644 --- a/Projectiles/Melee/BalefulHarvesterProjectile.cs +++ b/Projectiles/Melee/BalefulHarvesterProjectile.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/BiomeBladeHoldout.cs b/Projectiles/Melee/BiomeBladeHoldout.cs index a5d92275f1..39dc41139c 100644 --- a/Projectiles/Melee/BiomeBladeHoldout.cs +++ b/Projectiles/Melee/BiomeBladeHoldout.cs @@ -171,7 +171,7 @@ namespace CalamityMod.Projectiles.Melee else if (ChanneledState == 1f) { - Texture2D tex = TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = TextureAssets.Projectile[Type].Value; Vector2 squishyScale = new Vector2(Math.Abs((float)Math.Sin(MathHelper.Pi + MathHelper.TwoPi * Projectile.timeLeft / 30f)), 1f); SpriteEffects flip = (float)Math.Sin(MathHelper.Pi + MathHelper.TwoPi * Projectile.timeLeft / 30f) > 0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; Main.EntitySpriteDraw(tex, Projectile.position - Main.screenPosition, null, lightColor * (Projectile.timeLeft / 60f), 0, tex.Size() / 2, squishyScale * (2f - (Projectile.timeLeft / 60f)), flip, 0); diff --git a/Projectiles/Melee/BladecrestOathswordProj.cs b/Projectiles/Melee/BladecrestOathswordProj.cs index 4b0fdfee15..f3520c41c4 100644 --- a/Projectiles/Melee/BladecrestOathswordProj.cs +++ b/Projectiles/Melee/BladecrestOathswordProj.cs @@ -38,8 +38,8 @@ namespace CalamityMod.Projectiles.Melee { base.SetStaticDefaults(); // DO NOT REMOVE THIS - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 3; } public override void SetDefaults() diff --git a/Projectiles/Melee/BlazingPhantomBlade.cs b/Projectiles/Melee/BlazingPhantomBlade.cs index dd67236ae3..a4cc2fb971 100644 --- a/Projectiles/Melee/BlazingPhantomBlade.cs +++ b/Projectiles/Melee/BlazingPhantomBlade.cs @@ -26,10 +26,10 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.NoMeleeSpeedVelocityScaling[Projectile.type] = true; - Main.projFrames[Projectile.type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.NoMeleeSpeedVelocityScaling[Type] = true; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -159,7 +159,7 @@ namespace CalamityMod.Projectiles.Melee bool hyperBlade = fullyVisibleDuration == DefiledGreatsword.ProjectileFullyVisibleDuration + DefiledGreatsword.ProjectileFullyVisibleDurationIncreasePerAdditionalProjectile; bool sunlightBlade = fullyVisibleDuration == DefiledGreatsword.ProjectileFullyVisibleDuration + DefiledGreatsword.ProjectileFullyVisibleDurationIncreasePerAdditionalProjectile * 2f; - Texture2D asset = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D asset = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Microsoft.Xna.Framework.Rectangle rectangle = asset.Frame(1, 4); Vector2 origin = rectangle.Size() / 2f; float num = Projectile.scale * 1.1f; diff --git a/Projectiles/Melee/BloodScythe.cs b/Projectiles/Melee/BloodScythe.cs index d7ed77bd5c..72d7b034ef 100644 --- a/Projectiles/Melee/BloodScythe.cs +++ b/Projectiles/Melee/BloodScythe.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Melee/BonebreakerProjectile.cs b/Projectiles/Melee/BonebreakerProjectile.cs index 817f36b1d3..4e3dd6de31 100644 --- a/Projectiles/Melee/BonebreakerProjectile.cs +++ b/Projectiles/Melee/BonebreakerProjectile.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Melee/BotanicSpear.cs b/Projectiles/Melee/BotanicSpear.cs index 94de7a4f18..f42ce6103b 100644 --- a/Projectiles/Melee/BotanicSpear.cs +++ b/Projectiles/Melee/BotanicSpear.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > TimeLeft - 5) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Melee/Brimlash2.cs b/Projectiles/Melee/Brimlash2.cs index 7fd3ff0d50..8451bb0894 100644 --- a/Projectiles/Melee/Brimlash2.cs +++ b/Projectiles/Melee/Brimlash2.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > 115) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/BrimlashProj.cs b/Projectiles/Melee/BrimlashProj.cs index ce54bdae0b..52d339417e 100644 --- a/Projectiles/Melee/BrimlashProj.cs +++ b/Projectiles/Melee/BrimlashProj.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > 295) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/BrimstoneSwordProj.cs b/Projectiles/Melee/BrimstoneSwordProj.cs index 4a38898b22..c1b453c184 100644 --- a/Projectiles/Melee/BrimstoneSwordProj.cs +++ b/Projectiles/Melee/BrimstoneSwordProj.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > 595) return false; - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Melee/BrinySpout.cs b/Projectiles/Melee/BrinySpout.cs index 8d243f41f0..9f3f068b51 100644 --- a/Projectiles/Melee/BrinySpout.cs +++ b/Projectiles/Melee/BrinySpout.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; + Main.projFrames[Type] = 6; } public override void SetDefaults() @@ -117,8 +117,8 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Melee/BrinySpout.png b/Projectiles/Melee/BrinySpout.png index c2a07fcfb6..d404b3db93 100644 Binary files a/Projectiles/Melee/BrinySpout.png and b/Projectiles/Melee/BrinySpout.png differ diff --git a/Projectiles/Melee/BrinyTyphoonBubble.cs b/Projectiles/Melee/BrinyTyphoonBubble.cs index ad9261f9bd..3fbd52fcf1 100644 --- a/Projectiles/Melee/BrinyTyphoonBubble.cs +++ b/Projectiles/Melee/BrinyTyphoonBubble.cs @@ -10,9 +10,11 @@ namespace CalamityMod.Projectiles.Melee public class BrinyTyphoonBubble : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Melee"; + public override string Texture => "Terraria/Images/Projectile_385"; + public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; + Main.projFrames[Type] = 3; } public override void SetDefaults() diff --git a/Projectiles/Melee/BrinyTyphoonBubble.png b/Projectiles/Melee/BrinyTyphoonBubble.png deleted file mode 100644 index 90a422dbd8..0000000000 Binary files a/Projectiles/Melee/BrinyTyphoonBubble.png and /dev/null differ diff --git a/Projectiles/Melee/BrokenBiomeBladeHoldout.cs b/Projectiles/Melee/BrokenBiomeBladeHoldout.cs index 5b8413e628..f8c734e346 100644 --- a/Projectiles/Melee/BrokenBiomeBladeHoldout.cs +++ b/Projectiles/Melee/BrokenBiomeBladeHoldout.cs @@ -176,7 +176,7 @@ namespace CalamityMod.Projectiles.Melee else if (ChanneledState == 1f) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 squishyScale = new Vector2(Math.Abs((float)Math.Sin(MathHelper.Pi + MathHelper.TwoPi * Projectile.timeLeft / 30f)), 1f); SpriteEffects flip = (float)Math.Sin(MathHelper.Pi + MathHelper.TwoPi * Projectile.timeLeft / 30f) > 0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; Main.EntitySpriteDraw(tex, Projectile.position - Main.screenPosition, null, lightColor * (Projectile.timeLeft / 60f), 0, tex.Size() / 2, squishyScale * (2f - (Projectile.timeLeft / 60f)), flip, 0); diff --git a/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs b/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs index 89c1276071..43aed82d98 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; //The true trolling is that we only really use this for the third swing. + Main.projFrames[Type] = 6; //The true trolling is that we only really use this for the third swing. } public override void SetDefaults() { @@ -153,7 +153,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.Center = Owner.Center + (direction * ThrustDisplaceRatio() * 60); Projectile.frameCounter++; - if (Projectile.frameCounter % 5 == 0 && Projectile.frame + 1 < Main.projFrames[Projectile.type]) + if (Projectile.frameCounter % 5 == 0 && Projectile.frame + 1 < Main.projFrames[Type]) Projectile.frame++; if (Main.rand.NextBool()) diff --git a/Projectiles/Melee/BrokenBiomeBlade_PurityProjection.cs b/Projectiles/Melee/BrokenBiomeBlade_PurityProjection.cs index 35b530522b..b2f7d3f023 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_PurityProjection.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_PurityProjection.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > 35) return false; - DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/BurningMeteor.cs b/Projectiles/Melee/BurningMeteor.cs index 9602d219c3..61dafb5b13 100644 --- a/Projectiles/Melee/BurningMeteor.cs +++ b/Projectiles/Melee/BurningMeteor.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > 175) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Melee/CausticEdgeProjectile.cs b/Projectiles/Melee/CausticEdgeProjectile.cs index 82ae873f32..bbf1077d4e 100644 --- a/Projectiles/Melee/CausticEdgeProjectile.cs +++ b/Projectiles/Melee/CausticEdgeProjectile.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > TimeLeft - 5) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Melee/CometQuasherHoldout.cs b/Projectiles/Melee/CometQuasherHoldout.cs index 0c77a63ce3..506e964532 100644 --- a/Projectiles/Melee/CometQuasherHoldout.cs +++ b/Projectiles/Melee/CometQuasherHoldout.cs @@ -223,7 +223,7 @@ namespace CalamityMod.Projectiles.Melee if (spawnBoom) { Vector2 spawnSpot = target.Center + new Vector2(Main.rand.NextFloat(-550, 550), Main.rand.NextFloat(-750, -950)); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 1.3f), Projectile.knockBack, Projectile.owner, 0, 0, 4); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 1.3f), Projectile.knockBack, Projectile.owner, 0, 0, 4); spawnBoom = false; } } diff --git a/Projectiles/Melee/CometQuasherMeteor.cs b/Projectiles/Melee/CometQuasherMeteor.cs index 3193c97b84..4e177131e0 100644 --- a/Projectiles/Melee/CometQuasherMeteor.cs +++ b/Projectiles/Melee/CometQuasherMeteor.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Projectiles.Melee public NPC chosenTarget; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -91,13 +91,13 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (Projectile.Calamity().lineColor == 1) tex = ModContent.Request("CalamityMod/Projectiles/Melee/CometQuasherMeteor2").Value; if (Projectile.Calamity().lineColor == 2) tex = ModContent.Request("CalamityMod/Projectiles/Melee/CometQuasherMeteor3").Value; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.White, 1, tex); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.White, 1, tex); return false; } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) @@ -116,7 +116,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.ai[2] > 0) { Vector2 spawnSpot = Owner.Center + new Vector2(Main.rand.NextFloat(-550, 550), Main.rand.NextFloat(-750, -950)); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 0, Projectile.ai[2] - 1); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 0, Projectile.ai[2] - 1); } if (Projectile.owner == Main.myPlayer) diff --git a/Projectiles/Melee/CosmicDischargeFlail.cs b/Projectiles/Melee/CosmicDischargeFlail.cs index eb980cd6f7..df46b60a8a 100644 --- a/Projectiles/Melee/CosmicDischargeFlail.cs +++ b/Projectiles/Melee/CosmicDischargeFlail.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 mountedCenter = Main.player[Projectile.owner].MountedCenter; Color colorAtCenter = Lighting.GetColor((int)(Projectile.position.X + Projectile.width * 0.5) / 16, (int)((Projectile.position.Y + Projectile.height * 0.5) / 16.0)); - if (Projectile.hide && !ProjectileID.Sets.DontAttachHideToAlpha[Projectile.type]) + if (Projectile.hide && !ProjectileID.Sets.DontAttachHideToAlpha[Type]) { colorAtCenter = Lighting.GetColor((int)mountedCenter.X / 16, (int)(mountedCenter.Y / 16f)); } diff --git a/Projectiles/Melee/CosmicIceBurst.cs b/Projectiles/Melee/CosmicIceBurst.cs index 14d9f76f4c..997501b309 100644 --- a/Projectiles/Melee/CosmicIceBurst.cs +++ b/Projectiles/Melee/CosmicIceBurst.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; + Main.projFrames[Type] = 6; } public override void SetDefaults() @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.ai[1] += 0.01f; Projectile.scale = Projectile.ai[1]; Projectile.ai[0] += 1f; - if (Projectile.ai[0] >= (3 * Main.projFrames[Projectile.type])) + if (Projectile.ai[0] >= (3 * Main.projFrames[Type])) { Projectile.Kill(); return; @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Melee if (++Projectile.frameCounter >= 3) { Projectile.frameCounter = 0; - if (++Projectile.frame >= Main.projFrames[Projectile.type]) + if (++Projectile.frame >= Main.projFrames[Type]) { Projectile.hide = true; } @@ -101,12 +101,12 @@ namespace CalamityMod.Projectiles.Melee { Vector2 mountedCenter = Main.player[Projectile.owner].MountedCenter; Color colorArea = Lighting.GetColor((int)(Projectile.position.X + Projectile.width * 0.5f) / 16, (int)((Projectile.position.Y + Projectile.height * 0.5f) / 16)); - if (Projectile.hide && !ProjectileID.Sets.DontAttachHideToAlpha[Projectile.type]) + if (Projectile.hide && !ProjectileID.Sets.DontAttachHideToAlpha[Type]) { colorArea = Lighting.GetColor((int)mountedCenter.X / 16, (int)(mountedCenter.Y / 16f)); } - Texture2D texture2D33 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle rectangl = texture2D33.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D texture2D33 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle rectangl = texture2D33.Frame(1, Main.projFrames[Type], 0, Projectile.frame); return true; } diff --git a/Projectiles/Melee/CosmicShivBlade.cs b/Projectiles/Melee/CosmicShivBlade.cs index 34015b7af1..074d2769c8 100644 --- a/Projectiles/Melee/CosmicShivBlade.cs +++ b/Projectiles/Melee/CosmicShivBlade.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() diff --git a/Projectiles/Melee/CrescentMoonProj.cs b/Projectiles/Melee/CrescentMoonProj.cs index dad5dc93d5..1d705276ba 100644 --- a/Projectiles/Melee/CrescentMoonProj.cs +++ b/Projectiles/Melee/CrescentMoonProj.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/CrystylCrusherRay.cs b/Projectiles/Melee/CrystylCrusherRay.cs index 6fe3b3ff24..d66c58b184 100644 --- a/Projectiles/Melee/CrystylCrusherRay.cs +++ b/Projectiles/Melee/CrystylCrusherRay.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Melee { Vector2 maxLength = Main.MouseWorld - Main.player[Projectile.owner].Center; - DrawLaser(Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value, Main.player[Projectile.owner].Center, + DrawLaser(Terraria.GameContent.TextureAssets.Projectile[Type].Value, Main.player[Projectile.owner].Center, Projectile.velocity, 15f, Projectile.damage, -MathHelper.PiOver2, Projectile.scale, maxLength.Length(), new Color(Main.DiscoR, 0, 255), (int)MOVE_DISTANCE); } return false; diff --git a/Projectiles/Melee/Cyclone.cs b/Projectiles/Melee/Cyclone.cs index 0a14bde12d..449613f3d8 100644 --- a/Projectiles/Melee/Cyclone.cs +++ b/Projectiles/Melee/Cyclone.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Melee public int dustvortex = 0; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/DNA.cs b/Projectiles/Melee/DNA.cs index 4392fa8bb6..671209f27b 100644 --- a/Projectiles/Melee/DNA.cs +++ b/Projectiles/Melee/DNA.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Melee // This is essential for Vilethorn-type projectiles, as velocity is a stored parameter and isn't supposed to actually move the projectile public override bool ShouldUpdatePosition() => false; - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox.TopLeft(), targetHitbox.Size()); + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox); public override void OnKill(int timeLeft) { diff --git a/Projectiles/Melee/DarkBeam.cs b/Projectiles/Melee/DarkBeam.cs index 892b90beb5..b4e4995aaa 100644 --- a/Projectiles/Melee/DarkBeam.cs +++ b/Projectiles/Melee/DarkBeam.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Melee/DarkMasterBeam.cs b/Projectiles/Melee/DarkMasterBeam.cs index 65cd9deac0..7a8fa76ef3 100644 --- a/Projectiles/Melee/DarkMasterBeam.cs +++ b/Projectiles/Melee/DarkMasterBeam.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 6; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Melee/DarklightGreatswordSlash.cs b/Projectiles/Melee/DarklightGreatswordSlash.cs index f745eabf07..b8f1bd63f0 100644 --- a/Projectiles/Melee/DarklightGreatswordSlash.cs +++ b/Projectiles/Melee/DarklightGreatswordSlash.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Melee } } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox.TopLeft(), targetHitbox.Size()); + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox); public override bool ShouldUpdatePosition() => true; diff --git a/Projectiles/Melee/DeathsAscensionProjectile.cs b/Projectiles/Melee/DeathsAscensionProjectile.cs index 52e243df5b..9492d93041 100644 --- a/Projectiles/Melee/DeathsAscensionProjectile.cs +++ b/Projectiles/Melee/DeathsAscensionProjectile.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor * Projectile.Opacity, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor * Projectile.Opacity, 2); return false; } diff --git a/Projectiles/Melee/DeathsAscensionSwing.cs b/Projectiles/Melee/DeathsAscensionSwing.cs index 379f042834..2a229ebcaf 100644 --- a/Projectiles/Melee/DeathsAscensionSwing.cs +++ b/Projectiles/Melee/DeathsAscensionSwing.cs @@ -150,7 +150,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 position = Projectile.Center - Main.screenPosition + (Projectile.spriteDirection == -1 ? new Vector2(60, 0) : new Vector2(-60, 0)) - Projectile.velocity; Vector2 origin = texture.Size() / new Vector2(2f, 6f) * 0.5f; Rectangle frame = texture.Frame(2, 6, frameX, frameY); diff --git a/Projectiles/Melee/DemonBlast.cs b/Projectiles/Melee/DemonBlast.cs index 6e8e7402e0..7cb3fcd4a9 100644 --- a/Projectiles/Melee/DemonBlast.cs +++ b/Projectiles/Melee/DemonBlast.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/DepthCrusherProjectile.cs b/Projectiles/Melee/DepthCrusherProjectile.cs index d0b0e7f55d..96f9496617 100644 --- a/Projectiles/Melee/DepthCrusherProjectile.cs +++ b/Projectiles/Melee/DepthCrusherProjectile.cs @@ -32,8 +32,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() diff --git a/Projectiles/Melee/DevilsSunriseCyclone.cs b/Projectiles/Melee/DevilsSunriseCyclone.cs index 8c04e8c38f..c958d2c2f8 100644 --- a/Projectiles/Melee/DevilsSunriseCyclone.cs +++ b/Projectiles/Melee/DevilsSunriseCyclone.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -196,7 +196,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/DevilsSunriseProj.cs b/Projectiles/Melee/DevilsSunriseProj.cs index 186640c5ad..805f06e933 100644 --- a/Projectiles/Melee/DevilsSunriseProj.cs +++ b/Projectiles/Melee/DevilsSunriseProj.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 28; + Main.projFrames[Type] = 28; } public override void SetDefaults() @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Melee if (red > 255) red = 255; - if (++Projectile.frame >= Main.projFrames[Projectile.type]) + if (++Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; Projectile.soundDelay--; diff --git a/Projectiles/Melee/DivineHatchetBoomerang.cs b/Projectiles/Melee/DivineHatchetBoomerang.cs index 561fb30b9c..9b0c3acdf9 100644 --- a/Projectiles/Melee/DivineHatchetBoomerang.cs +++ b/Projectiles/Melee/DivineHatchetBoomerang.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -149,7 +149,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/DracoBeam.cs b/Projectiles/Melee/DracoBeam.cs index a213272e50..e75c10b4c5 100644 --- a/Projectiles/Melee/DracoBeam.cs +++ b/Projectiles/Melee/DracoBeam.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 14; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 14; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > 595) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Melee/DracoBeam2.cs b/Projectiles/Melee/DracoBeam2.cs index 359ea9af86..e389a628c6 100644 --- a/Projectiles/Melee/DracoBeam2.cs +++ b/Projectiles/Melee/DracoBeam2.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Melee/DragonRageFireball.cs b/Projectiles/Melee/DragonRageFireball.cs index 51789ebee6..ff741f31f5 100644 --- a/Projectiles/Melee/DragonRageFireball.cs +++ b/Projectiles/Melee/DragonRageFireball.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Melee private int lifeTime = 420; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -66,8 +66,8 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Texture2D projectileTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int frameHeight = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D projectileTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int frameHeight = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int frameY = frameHeight * Projectile.frame; Main.spriteBatch.Draw(projectileTexture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameY, projectileTexture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)projectileTexture.Width / 2f, (float)frameHeight / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Melee/DragonRageStaff.cs b/Projectiles/Melee/DragonRageStaff.cs index 79c116440d..9c93805d20 100644 --- a/Projectiles/Melee/DragonRageStaff.cs +++ b/Projectiles/Melee/DragonRageStaff.cs @@ -251,7 +251,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); Rectangle rectangle = new Rectangle(0, 0, tex.Width, tex.Height); Vector2 origin = tex.Size() / 2f; diff --git a/Projectiles/Melee/EarthHoldout.cs b/Projectiles/Melee/EarthHoldout.cs index 6e352bc5dc..fbb092c636 100644 --- a/Projectiles/Melee/EarthHoldout.cs +++ b/Projectiles/Melee/EarthHoldout.cs @@ -255,7 +255,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.ai[1] == -1) { Vector2 spawnSpot = target.Center + new Vector2(Main.rand.NextFloat(-450, 450), Main.rand.NextFloat(-450, -650)); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 0, 2); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 0, 2); } spawnBoom = false; diff --git a/Projectiles/Melee/EarthMeteor.cs b/Projectiles/Melee/EarthMeteor.cs index 64bcf12c7e..23b50a4d24 100644 --- a/Projectiles/Melee/EarthMeteor.cs +++ b/Projectiles/Melee/EarthMeteor.cs @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Melee if (time == (int)(fallTime * 0.2f) && Projectile.ai[2] > 0) { Vector2 spawnSpot = Owner.Center + new Vector2(Main.rand.NextFloat(-450, 450), Main.rand.NextFloat(-450, -650)); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 0, Projectile.ai[2] - 1); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 0, Projectile.ai[2] - 1); } if (time == fallTime) { @@ -134,7 +134,7 @@ namespace CalamityMod.Projectiles.Melee Color auraColor = mainColor; CalamityUtils.DrawProjectileWithBackglow(Projectile, auraColor, Color.White * 0.5f, 9); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Lerp(Color.White, randomColor, 0.3f), 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Lerp(Color.White, randomColor, 0.3f), 1); return false; } @@ -150,7 +150,7 @@ namespace CalamityMod.Projectiles.Melee { Player Owner = Main.player[Projectile.owner]; Owner.Calamity().GeneralScreenShakePower = 4.5f; - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75f), Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75f), Projectile.knockBack, Projectile.owner); for (int i = 0; i < 20; i++) { randomColor = Main.rand.Next(3) switch diff --git a/Projectiles/Melee/ElementalGlassStar.cs b/Projectiles/Melee/ElementalGlassStar.cs index 96b2638973..8c711f571f 100644 --- a/Projectiles/Melee/ElementalGlassStar.cs +++ b/Projectiles/Melee/ElementalGlassStar.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); diff --git a/Projectiles/Melee/EmpyreanKnife.cs b/Projectiles/Melee/EmpyreanKnife.cs index 0883369104..eb5905ac47 100644 --- a/Projectiles/Melee/EmpyreanKnife.cs +++ b/Projectiles/Melee/EmpyreanKnife.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Melee/EonBolt.cs b/Projectiles/Melee/EonBolt.cs index 98960cc01b..e6988ef0c0 100644 --- a/Projectiles/Melee/EonBolt.cs +++ b/Projectiles/Melee/EonBolt.cs @@ -28,8 +28,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() diff --git a/Projectiles/Melee/EssenceFlame2.cs b/Projectiles/Melee/EssenceFlame2.cs index 92b88b7c62..e48ffa2e5b 100644 --- a/Projectiles/Melee/EssenceFlame2.cs +++ b/Projectiles/Melee/EssenceFlame2.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Melee/EssenceScythe.cs b/Projectiles/Melee/EssenceScythe.cs index 1b715aaa50..f487a0cd93 100644 --- a/Projectiles/Melee/EssenceScythe.cs +++ b/Projectiles/Melee/EssenceScythe.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; - Main.EntitySpriteDraw(Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value, Projectile.Center - Main.screenPosition, null, color, Projectile.rotation, origin, 1f, spriteEffects, 0); + Main.EntitySpriteDraw(Terraria.GameContent.TextureAssets.Projectile[Type].Value, Projectile.Center - Main.screenPosition, null, color, Projectile.rotation, origin, 1f, spriteEffects, 0); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Melee/ExcelsusBlue.cs b/Projectiles/Melee/ExcelsusBlue.cs index df52f54cfd..2ae98ca2fc 100644 --- a/Projectiles/Melee/ExcelsusBlue.cs +++ b/Projectiles/Melee/ExcelsusBlue.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Melee/ExcelsusMain.cs b/Projectiles/Melee/ExcelsusMain.cs index 55d116045f..4b86ba15d7 100644 --- a/Projectiles/Melee/ExcelsusMain.cs +++ b/Projectiles/Melee/ExcelsusMain.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Melee/ExcelsusPink.cs b/Projectiles/Melee/ExcelsusPink.cs index d260c54745..5bf63ee24e 100644 --- a/Projectiles/Melee/ExcelsusPink.cs +++ b/Projectiles/Melee/ExcelsusPink.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Melee/Exobeam.cs b/Projectiles/Melee/Exobeam.cs index 4d103b0f24..553cb5793c 100644 --- a/Projectiles/Melee/Exobeam.cs +++ b/Projectiles/Melee/Exobeam.cs @@ -30,8 +30,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 30; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 30; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -142,7 +142,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > 595) return false; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; float bladeScale = Utils.GetLerpValue(3f, 13f, Projectile.velocity.Length(), true) * 1.2f; //Draw the blade. diff --git a/Projectiles/Melee/ExobeamSlash.cs b/Projectiles/Melee/ExobeamSlash.cs index c93a8ee983..731a9e3e59 100644 --- a/Projectiles/Melee/ExobeamSlash.cs +++ b/Projectiles/Melee/ExobeamSlash.cs @@ -41,10 +41,7 @@ namespace CalamityMod.Projectiles.Melee } } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) - { - return Projectile.RotatingHitboxCollision(targetHitbox.TopLeft(), targetHitbox.Size()); - } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox); public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { diff --git a/Projectiles/Melee/ExobladeProj.cs b/Projectiles/Melee/ExobladeProj.cs index c754b6d14e..d7f94d1966 100644 --- a/Projectiles/Melee/ExobladeProj.cs +++ b/Projectiles/Melee/ExobladeProj.cs @@ -172,8 +172,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 120; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 120; } public override void SetDefaults() @@ -514,7 +514,7 @@ namespace CalamityMod.Projectiles.Melee public void DrawBlade() { - var texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + var texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; SpriteEffects direction = Direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; if (State == SwingState.Swinging) diff --git a/Projectiles/Melee/FallenPaladinsHammerEcho.cs b/Projectiles/Melee/FallenPaladinsHammerEcho.cs index b13a989cf2..6ae479f6fe 100644 --- a/Projectiles/Melee/FallenPaladinsHammerEcho.cs +++ b/Projectiles/Melee/FallenPaladinsHammerEcho.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() { @@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { Texture2D texture = ModContent.Request("CalamityMod/Items/Weapons/Melee/FallenPaladinsHammer").Value; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.DarkRed with { A = 0 } * 0.5f, 1, texture, true, true); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.DarkRed with { A = 0 } * 0.5f, 1, texture, true, true); Projectile.DrawProjectileWithBackglow(Color.Red with { A = 0 }, Color.Lerp(Color.Red, Color.White, 0.5f), 5f, texture); return false; diff --git a/Projectiles/Melee/FallenPaladinsHammerProj.cs b/Projectiles/Melee/FallenPaladinsHammerProj.cs index 5686dff56a..fae1893ed4 100644 --- a/Projectiles/Melee/FallenPaladinsHammerProj.cs +++ b/Projectiles/Melee/FallenPaladinsHammerProj.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 7; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 7; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -214,7 +214,7 @@ namespace CalamityMod.Projectiles.Melee } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Melee/ForbiddenOathbladeProjectile.cs b/Projectiles/Melee/ForbiddenOathbladeProjectile.cs index 3af5f732c7..0274780ffe 100644 --- a/Projectiles/Melee/ForbiddenOathbladeProjectile.cs +++ b/Projectiles/Melee/ForbiddenOathbladeProjectile.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Melee/GaelSkull.cs b/Projectiles/Melee/GaelSkull.cs index dccf7c12be..173ff6754d 100644 --- a/Projectiles/Melee/GaelSkull.cs +++ b/Projectiles/Melee/GaelSkull.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - Main.projFrames[Projectile.type] = 5; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; + Main.projFrames[Type] = 5; } public override void SetDefaults() @@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Melee { Projectile.frame++; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Melee } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/GaelSkull2.cs b/Projectiles/Melee/GaelSkull2.cs index 1edd731ae0..43b3fc5cc5 100644 --- a/Projectiles/Melee/GaelSkull2.cs +++ b/Projectiles/Melee/GaelSkull2.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - Main.projFrames[Projectile.type] = 5; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; + Main.projFrames[Type] = 5; } public override void SetDefaults() @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Melee { Projectile.frame++; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -109,7 +109,7 @@ namespace CalamityMod.Projectiles.Melee } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/GalacticaComet.cs b/Projectiles/Melee/GalacticaComet.cs index fedde06c1d..97d7e8eb92 100644 --- a/Projectiles/Melee/GalacticaComet.cs +++ b/Projectiles/Melee/GalacticaComet.cs @@ -1,5 +1,9 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using CalamityMod.Particles; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Steamworks; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -11,139 +15,104 @@ namespace CalamityMod.Projectiles.Melee { public new string LocalizationCategory => "Projectiles.Melee"; private int noTileHitCounter = 90; - + public int time = 0; + public int cometType = 0; + public Color useColor = Color.White; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; ProjectileID.Sets.TrailingMode[Projectile.type] = 1; } - public override void SetDefaults() { - Projectile.width = 34; - Projectile.height = 34; - Projectile.alpha = 100; + Projectile.width = 102; + Projectile.height = 102; Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; Projectile.tileCollide = false; - Projectile.penetrate = 1; - Projectile.extraUpdates = 1; + Projectile.penetrate = -1; + Projectile.extraUpdates = 2; Projectile.timeLeft = 600; Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; } public override void AI() { - noTileHitCounter -= 1; - if (noTileHitCounter == 0) - Projectile.tileCollide = true; - - if (Projectile.soundDelay == 0) - { - Projectile.soundDelay = 20 + Main.rand.Next(40); - if (Main.rand.NextBool(5)) - SoundEngine.PlaySound(SoundID.Item9, Projectile.position); - } - - Projectile.localAI[0] += 1f; - if (Projectile.localAI[0] == 18f) - { - Projectile.localAI[0] = 0f; - for (int l = 0; l < 12; l++) - { - Vector2 dustRotate = Vector2.UnitX * (float)-(float)Projectile.width / 2f; - dustRotate += -Vector2.UnitY.RotatedBy((double)((float)l * MathHelper.Pi / 6f), default) * new Vector2(8f, 16f); - dustRotate = dustRotate.RotatedBy((double)(Projectile.rotation - MathHelper.PiOver2), default); - int galactic = Dust.NewDust(Projectile.Center, 0, 0, Main.rand.NextBool() ? 164 : 229, 0f, 0f, 160, default, 1f); - Main.dust[galactic].noGravity = true; - Main.dust[galactic].position = Projectile.Center + dustRotate; - Main.dust[galactic].velocity = Projectile.velocity * 0.1f; - Main.dust[galactic].velocity = Vector2.Normalize(Projectile.Center - Projectile.velocity * 3f - Main.dust[galactic].position) * 1.25f; - } - } - - Projectile.alpha -= 15; - int alphaControl = 150; - if (Projectile.Center.Y >= Projectile.ai[1]) - alphaControl = 0; - if (Projectile.alpha < alphaControl) - Projectile.alpha = alphaControl; - + Player Owner = Main.player[Projectile.owner]; + float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); + Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; - - if (Main.rand.NextBool(16)) + if (time == 0) { - Vector2 rotation = Vector2.UnitX.RotatedByRandom(MathHelper.PiOver2).RotatedBy((double)Projectile.velocity.ToRotation(), default); - int pinkDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.TeleportationPotion, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, 150, default, 1f); - Main.dust[pinkDust].velocity = rotation * 0.66f; - Main.dust[pinkDust].position = Projectile.Center + rotation * 12f; + Projectile.scale = Main.rand.NextFloat(0.6f, 0.8f); + cometType = Main.rand.Next(1, 3 + 1); + useColor = cometType switch + { + 1 => Color.Cyan, + 2 => Color.Gold, + _ => Color.HotPink, + }; } - if (Main.rand.NextBool(48) && Main.netMode != NetmodeID.Server) + if (targetDist < 1400) { - int gored = Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.Center, new Vector2(Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f), 16, 1f); - Main.gore[gored].velocity *= 0.66f; - Main.gore[gored].velocity += Projectile.velocity * 0.3f; + Particle spark = new GlowSparkParticle(Projectile.Center + Projectile.velocity * Main.rand.NextFloat(-2, -1), -Projectile.velocity * 0.3f, false, 7, 0.1f, useColor * 0.45f, new Vector2(1, 0.3f), true, false, 1f); + GeneralParticleHandler.SpawnParticle(spark); } - if (Projectile.ai[1] == 1f) - { - Projectile.light = 0.5f; - if (Main.rand.NextBool(10)) - Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Vortex, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, 150, default, 1f); - if (Main.rand.NextBool(20) && Main.netMode != NetmodeID.Server) - Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.position, new Vector2(Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f); - } + time++; + Projectile.velocity *= 1.01f; } - - public override bool PreDraw(ref Color lightColor) - { - if (Projectile.timeLeft > 595) - return false; - - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); - return false; - } - - public override Color? GetAlpha(Color lightColor) - { - return new Color(Main.DiscoR, 100, 255, Projectile.alpha); - } - public override void OnKill(int timeLeft) { - if (Projectile.ai[0] == 1f) - return; - SoundEngine.PlaySound(SoundID.Item10, Projectile.position); - Projectile.position = Projectile.Center; - Projectile.width = Projectile.height = 68; - Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2); - Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2); - for (int i = 0; i < 4; i++) - { - Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.TeleportationPotion, 0f, 0f, 50, default, 1.5f); - } - for (int j = 0; j < 20; j++) - { - int galaxyDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Vortex, 0f, 0f, 0, default, 2.5f); - Main.dust[galaxyDust].noGravity = true; - Main.dust[galaxyDust].velocity *= 3f; - galaxyDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Vortex, 0f, 0f, 50, default, 1.5f); - Main.dust[galaxyDust].velocity *= 2f; - Main.dust[galaxyDust].noGravity = true; - } - Projectile.maxPenetrate = -1; - Projectile.penetrate = -1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.Damage(); + + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + if (Projectile.numHits > 0) + Projectile.damage = (int)(Projectile.damage * 0.9f); // 10% damage nerf for every enemy hit + if (Projectile.damage < 1) + Projectile.damage = 1; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (Projectile.DamageType != DamageClass.Ranged) - target.AddBuff(ModContent.BuffType(), 180); + if (Projectile.numHits == 0) + { + for (int i = 0; i <= 12; i++) + { + if (i < 8) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType(), (Vector2.One * 9).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 1.8f), 0, default, Main.rand.NextFloat(1.3f, 1.8f)); + dust.noGravity = true; + dust.color = useColor; + } + else + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, 278, (Vector2.One * 9).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 1.8f), 0, default, Main.rand.NextFloat(0.8f, 1.3f)); + dust.noGravity = false; + dust.color = Color.Lerp(useColor, Color.White, 0.5f); + } + } + SoundEngine.PlaySound(SoundID.DD2_CrystalCartImpact with { Volume = 0.7f, PitchVariance = 0.3f }, Projectile.Center); + SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact with { Volume = 1f, PitchVariance = 0.3f }, Projectile.Center); + } + } + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + if (cometType == 1) + tex = ModContent.Request("CalamityMod/Projectiles/Melee/GalacticaComet").Value; + if (cometType == 2) + tex = ModContent.Request("CalamityMod/Projectiles/Melee/GalacticaComet2").Value; + if (cometType == 3) + tex = ModContent.Request("CalamityMod/Projectiles/Melee/GalacticaComet3").Value; + + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.White, 2, tex); + return false; } } } diff --git a/Projectiles/Melee/GalacticaComet.png b/Projectiles/Melee/GalacticaComet.png index a48c0a7b7a..35fbcc775e 100644 Binary files a/Projectiles/Melee/GalacticaComet.png and b/Projectiles/Melee/GalacticaComet.png differ diff --git a/Projectiles/Melee/GalacticaComet2.png b/Projectiles/Melee/GalacticaComet2.png new file mode 100644 index 0000000000..720e83734a Binary files /dev/null and b/Projectiles/Melee/GalacticaComet2.png differ diff --git a/Projectiles/Melee/GalacticaComet3.png b/Projectiles/Melee/GalacticaComet3.png new file mode 100644 index 0000000000..716ecda257 Binary files /dev/null and b/Projectiles/Melee/GalacticaComet3.png differ diff --git a/Projectiles/Melee/GalaxiaBolt.cs b/Projectiles/Melee/GalaxiaBolt.cs index d1ad4f81fa..ae0a519b2d 100644 --- a/Projectiles/Melee/GalaxiaBolt.cs +++ b/Projectiles/Melee/GalaxiaBolt.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Melee/Galaxia_AriesWrath.cs b/Projectiles/Melee/Galaxia_AriesWrath.cs index fbfac04194..01b0079f53 100644 --- a/Projectiles/Melee/Galaxia_AriesWrath.cs +++ b/Projectiles/Melee/Galaxia_AriesWrath.cs @@ -30,8 +30,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() diff --git a/Projectiles/Melee/Galaxia_AriesWrathConstellation.cs b/Projectiles/Melee/Galaxia_AriesWrathConstellation.cs index 12ed46f183..a4d35ba78d 100644 --- a/Projectiles/Melee/Galaxia_AriesWrathConstellation.cs +++ b/Projectiles/Melee/Galaxia_AriesWrathConstellation.cs @@ -28,8 +28,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 1; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 1; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { diff --git a/Projectiles/Melee/Galaxia_PhoenixsPride.cs b/Projectiles/Melee/Galaxia_PhoenixsPride.cs index 3bb96e5877..d76dde0d6f 100644 --- a/Projectiles/Melee/Galaxia_PhoenixsPride.cs +++ b/Projectiles/Melee/Galaxia_PhoenixsPride.cs @@ -44,8 +44,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { diff --git a/Projectiles/Melee/Galaxia_PolarisGaze.cs b/Projectiles/Melee/Galaxia_PolarisGaze.cs index fc1201ae05..c676136f38 100644 --- a/Projectiles/Melee/Galaxia_PolarisGaze.cs +++ b/Projectiles/Melee/Galaxia_PolarisGaze.cs @@ -174,9 +174,7 @@ namespace CalamityMod.Projectiles.Melee for (int i = 0; i < 5; i++) { Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center, Main.rand.NextVector2CircularEdge(15, 15), ProjectileType(), blastDamage, 0f, Owner.whoAmI, 0.55f, MathHelper.Pi * 0.02f); - { - blast.timeLeft = 100; - } + blast.timeLeft = 100; } diff --git a/Projectiles/Melee/Galaxia_PolarisGazeDash.cs b/Projectiles/Melee/Galaxia_PolarisGazeDash.cs index 93dde5a6cc..aa04d60b0b 100644 --- a/Projectiles/Melee/Galaxia_PolarisGazeDash.cs +++ b/Projectiles/Melee/Galaxia_PolarisGazeDash.cs @@ -58,9 +58,7 @@ namespace CalamityMod.Projectiles.Melee for (int i = 0; i < 3; i++) { Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center, Owner.SafeDirectionTo(target.Center, Vector2.Zero).RotatedByRandom(MathHelper.PiOver4) * 30f, ProjectileType(), blastDamage, 0f, Owner.whoAmI, 0.55f, MathHelper.Pi * 0.01f); - { - blast.timeLeft = 100; - } + blast.timeLeft = 100; } } diff --git a/Projectiles/Melee/GalaxyBlast.cs b/Projectiles/Melee/GalaxyBlast.cs index 53de74b650..9c26fe5e20 100644 --- a/Projectiles/Melee/GalaxyBlast.cs +++ b/Projectiles/Melee/GalaxyBlast.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void AI() @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.frameCounter = 0; Projectile.frame++; } - if (Projectile.ai[0] >= (float)(Main.projFrames[Projectile.type] * Projectile.MaxUpdates * 3)) + if (Projectile.ai[0] >= (float)(Main.projFrames[Type] * Projectile.MaxUpdates * 3)) { Projectile.Kill(); } diff --git a/Projectiles/Melee/GalaxyBlastType2.cs b/Projectiles/Melee/GalaxyBlastType2.cs index 3620edaacb..476153872a 100644 --- a/Projectiles/Melee/GalaxyBlastType2.cs +++ b/Projectiles/Melee/GalaxyBlastType2.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void AI() @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.frameCounter = 0; Projectile.frame++; } - if (Projectile.ai[0] >= (float)(Main.projFrames[Projectile.type] * Projectile.MaxUpdates * 3)) + if (Projectile.ai[0] >= (float)(Main.projFrames[Type] * Projectile.MaxUpdates * 3)) { Projectile.Kill(); } diff --git a/Projectiles/Melee/GalaxyBlastType3.cs b/Projectiles/Melee/GalaxyBlastType3.cs index 6ee3f57b3a..030e73e15d 100644 --- a/Projectiles/Melee/GalaxyBlastType3.cs +++ b/Projectiles/Melee/GalaxyBlastType3.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void AI() @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.frameCounter = 0; Projectile.frame++; } - if (Projectile.ai[0] >= (float)(Main.projFrames[Projectile.type] * Projectile.MaxUpdates * 3)) + if (Projectile.ai[0] >= (float)(Main.projFrames[Type] * Projectile.MaxUpdates * 3)) { Projectile.Kill(); } diff --git a/Projectiles/Melee/GalaxySmasherEcho.cs b/Projectiles/Melee/GalaxySmasherEcho.cs index 9afc7239fb..4a61eb830e 100644 --- a/Projectiles/Melee/GalaxySmasherEcho.cs +++ b/Projectiles/Melee/GalaxySmasherEcho.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { @@ -149,7 +149,7 @@ namespace CalamityMod.Projectiles.Melee Texture2D texture = ModContent.Request("CalamityMod/Items/Weapons/Melee/GalaxySmasher").Value; Asset p2 = ModContent.Request("CalamityMod/Particles/CircularSmearSmokey"); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor * 0.5f, 3, texture, true, true); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor * 0.5f, 3, texture, true, true); Vector2 generalDrawPos = Projectile.Center - Main.screenPosition; diff --git a/Projectiles/Melee/GalaxySmasherHammer.cs b/Projectiles/Melee/GalaxySmasherHammer.cs index 9e6a5434f9..d36e49c644 100644 --- a/Projectiles/Melee/GalaxySmasherHammer.cs +++ b/Projectiles/Melee/GalaxySmasherHammer.cs @@ -34,8 +34,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -281,7 +281,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 offset = new Vector2(5f, 0).RotatedBy(rot).RotatedBy(randRot); Vector2 velOffset = new Vector2(1f, 0).RotatedBy(rot).RotatedBy(randRot); - Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, velOffset, FunSizeHamID, FunSizeHamDamage, FunSizeHamKB, Projectile.owner, EmpoweredHammer, (EmpoweredHammer % 2 == 0 ? -1 : 1), target.whoAmI); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, velOffset, FunSizeHamID, FunSizeHamDamage, FunSizeHamKB, Projectile.owner, EmpoweredHammer, (EmpoweredHammer % 2 == 0 ? -1 : 1), target.whoAmI); } } @@ -326,7 +326,7 @@ namespace CalamityMod.Projectiles.Melee Asset p2 = ModContent.Request("CalamityMod/Particles/CircularSmearSmokey"); Asset p3 = ModContent.Request("CalamityMod/Particles/SmallBloom"); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor * 0.5f, 3, texture, true, true); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor * 0.5f, 3, texture, true, true); float shrinkLerp = (Utils.GetLerpValue(40, 35, EchoHammerPrep, true)); float growLerp = (Utils.GetLerpValue(0, 35, EchoHammerPrep, true)); diff --git a/Projectiles/Melee/GalileosMoon.cs b/Projectiles/Melee/GalileosMoon.cs index 1390ce7d95..6a8bc39a8a 100644 --- a/Projectiles/Melee/GalileosMoon.cs +++ b/Projectiles/Melee/GalileosMoon.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/GalileosPlanet.cs b/Projectiles/Melee/GalileosPlanet.cs index bc651357af..5cf1d49137 100644 --- a/Projectiles/Melee/GalileosPlanet.cs +++ b/Projectiles/Melee/GalileosPlanet.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/GayBeam.cs b/Projectiles/Melee/GayBeam.cs index fdfe26c180..5d016effdc 100644 --- a/Projectiles/Melee/GayBeam.cs +++ b/Projectiles/Melee/GayBeam.cs @@ -31,8 +31,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = TrailLength; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = TrailLength; } public override void SetDefaults() @@ -332,8 +332,8 @@ namespace CalamityMod.Projectiles.Melee Main.spriteBatch.ExitShaderRegion(); - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int frameHeight = texture.Height / Main.projFrames[Type]; int frameY = frameHeight * Projectile.frame; float scale = Projectile.scale; Rectangle rectangle = new Rectangle(0, frameY, texture.Width, frameHeight); diff --git a/Projectiles/Melee/GelWave.cs b/Projectiles/Melee/GelWave.cs index 81ae99eb2c..de43a94052 100644 --- a/Projectiles/Melee/GelWave.cs +++ b/Projectiles/Melee/GelWave.cs @@ -12,14 +12,14 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() { - Projectile.width = 164; - Projectile.height = 164; + Projectile.width = 42; + Projectile.height = 84; Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.DamageType = DamageClass.Melee; @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.localAI[0] += 1f; } Lighting.AddLight(Projectile.Center, Color.Blue.ToVector3()); - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + Projectile.rotation = Projectile.velocity.ToRotation(); if (Main.rand.NextBool(10)) { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.BlueFairy, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); @@ -62,11 +62,13 @@ namespace CalamityMod.Projectiles.Melee } } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox); + public override bool? CanDamage() => (Projectile.alpha == 0 ? null : false); public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Melee/GelWave.png b/Projectiles/Melee/GelWave.png index 861756b15d..b41c0d4722 100644 Binary files a/Projectiles/Melee/GelWave.png and b/Projectiles/Melee/GelWave.png differ diff --git a/Projectiles/Melee/GhastlySoulLarge.cs b/Projectiles/Melee/GhastlySoulLarge.cs index db5d77867d..085ce42998 100644 --- a/Projectiles/Melee/GhastlySoulLarge.cs +++ b/Projectiles/Melee/GhastlySoulLarge.cs @@ -20,10 +20,10 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; Lighting.AddLight(Projectile.Center, 0.5f, 0.2f, 0.9f); @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > TimeLeft - 5) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/GhastlySoulMedium.cs b/Projectiles/Melee/GhastlySoulMedium.cs index bb14c96f6b..874f2f8820 100644 --- a/Projectiles/Melee/GhastlySoulMedium.cs +++ b/Projectiles/Melee/GhastlySoulMedium.cs @@ -20,10 +20,10 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; Lighting.AddLight(Projectile.Center, 0.5f, 0.2f, 0.9f); @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > TimeLeft - 5) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/GhastlySoulSmall.cs b/Projectiles/Melee/GhastlySoulSmall.cs index ba0e187ad7..8a37f9eae7 100644 --- a/Projectiles/Melee/GhastlySoulSmall.cs +++ b/Projectiles/Melee/GhastlySoulSmall.cs @@ -21,10 +21,10 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; Lighting.AddLight(Projectile.Center, 0.5f, 0.2f, 0.9f); @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > TimeLeft - 5) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/GrandDadHoldout.cs b/Projectiles/Melee/GrandDadHoldout.cs index be4ff0a9bb..cd8d165a80 100644 --- a/Projectiles/Melee/GrandDadHoldout.cs +++ b/Projectiles/Melee/GrandDadHoldout.cs @@ -216,7 +216,7 @@ namespace CalamityMod.Projectiles.Melee Owner.Calamity().GeneralScreenShakePower = 6.5f; } - int heal = (int)(MathHelper.Clamp(20 - Projectile.numHits * 5, 1, 20)); + int heal = (int)(MathHelper.Clamp(25 - Projectile.numHits * 8, 1, 25)); if (Projectile.numHits < 20) { Owner.HealPlayer(heal); diff --git a/Projectiles/Melee/GrandGuardianHoldout.cs b/Projectiles/Melee/GrandGuardianHoldout.cs index 9a09685e78..f73e63aa3a 100644 --- a/Projectiles/Melee/GrandGuardianHoldout.cs +++ b/Projectiles/Melee/GrandGuardianHoldout.cs @@ -196,7 +196,7 @@ namespace CalamityMod.Projectiles.Melee if (spawnBoom) { - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage / 3, Projectile.knockBack * 0.5f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage / 3, Projectile.knockBack * 0.5f, Projectile.owner); spawnBoom = false; } diff --git a/Projectiles/Melee/HellionSpike.cs b/Projectiles/Melee/HellionSpike.cs index a847d50f03..7955c988a0 100644 --- a/Projectiles/Melee/HellionSpike.cs +++ b/Projectiles/Melee/HellionSpike.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > 595) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Melee/HolyColliderHolyFire.cs b/Projectiles/Melee/HolyColliderHolyFire.cs index e38b466afd..ed2c6ba922 100644 --- a/Projectiles/Melee/HolyColliderHolyFire.cs +++ b/Projectiles/Melee/HolyColliderHolyFire.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } @@ -57,8 +57,8 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Melee/IllustriousKnife.cs b/Projectiles/Melee/IllustriousKnife.cs index 0b79e6acae..ac9f8c2017 100644 --- a/Projectiles/Melee/IllustriousKnife.cs +++ b/Projectiles/Melee/IllustriousKnife.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Melee/InsidiousHarpoon.cs b/Projectiles/Melee/InsidiousHarpoon.cs index 162c726b27..cc0681195a 100644 --- a/Projectiles/Melee/InsidiousHarpoon.cs +++ b/Projectiles/Melee/InsidiousHarpoon.cs @@ -31,8 +31,8 @@ namespace CalamityMod.Projectiles.Melee public bool hasHitTarget = false; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 11; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 11; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -188,7 +188,7 @@ namespace CalamityMod.Projectiles.Melee } if (!isPowered) - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return true; } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 40, targetHitbox); diff --git a/Projectiles/Melee/IridescentExcaliburSlash.cs b/Projectiles/Melee/IridescentExcaliburSlash.cs index 623ef18e98..5d64f82220 100644 --- a/Projectiles/Melee/IridescentExcaliburSlash.cs +++ b/Projectiles/Melee/IridescentExcaliburSlash.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { Vector2 vector = Projectile.Center - Main.screenPosition; - Texture2D asset = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D asset = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle rectangle = asset.Frame(1, 4); Vector2 origin = rectangle.Size() / 2f; float num = Projectile.scale * 1.1f; diff --git a/Projectiles/Melee/IridescentExcaliburSlash2.cs b/Projectiles/Melee/IridescentExcaliburSlash2.cs index fcdacfc7d9..54728381f9 100644 --- a/Projectiles/Melee/IridescentExcaliburSlash2.cs +++ b/Projectiles/Melee/IridescentExcaliburSlash2.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -102,7 +102,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { Vector2 vector = Projectile.Center - Main.screenPosition; - Texture2D asset = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D asset = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle rectangle = asset.Frame(1, 4); Vector2 origin = rectangle.Size() / 2f; float num = Projectile.scale * 1.1f; diff --git a/Projectiles/Melee/IridescentExcaliburSlash3.cs b/Projectiles/Melee/IridescentExcaliburSlash3.cs index 73ac9b7231..b370bdf8b5 100644 --- a/Projectiles/Melee/IridescentExcaliburSlash3.cs +++ b/Projectiles/Melee/IridescentExcaliburSlash3.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { Vector2 vector = Projectile.Center - Main.screenPosition; - Texture2D asset = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D asset = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle rectangle = asset.Frame(1, 4); Vector2 origin = rectangle.Size() / 2f; float num = Projectile.scale * 1.1f; diff --git a/Projectiles/Melee/LifeScythe.cs b/Projectiles/Melee/LifeScythe.cs index 369ffaea81..ac2bb88855 100644 --- a/Projectiles/Melee/LifeScythe.cs +++ b/Projectiles/Melee/LifeScythe.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Melee/LightBeam.cs b/Projectiles/Melee/LightBeam.cs index cfe7c32b91..b955bf6f86 100644 --- a/Projectiles/Melee/LightBeam.cs +++ b/Projectiles/Melee/LightBeam.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Melee/LuxorsGiftMelee.cs b/Projectiles/Melee/LuxorsGiftMelee.cs index 6e7647375e..83d423e61e 100644 --- a/Projectiles/Melee/LuxorsGiftMelee.cs +++ b/Projectiles/Melee/LuxorsGiftMelee.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Melee/MantisClawHoldout.cs b/Projectiles/Melee/MantisClawHoldout.cs index f73be31680..d36aa9cfc3 100644 --- a/Projectiles/Melee/MantisClawHoldout.cs +++ b/Projectiles/Melee/MantisClawHoldout.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Melee { Owner.Calamity().mouseWorldListener = true; - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center + new Vector2(20, 0).RotatedBy(Projectile.rotation), + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center + new Vector2(20, 0).RotatedBy(Projectile.rotation), Owner.DirectionTo(Owner.Calamity().mouseWorld) * 30, ModContent.ProjectileType(), (int)(Projectile.damage * JetDamageMultiplier), 7, Owner.whoAmI); for (int i = 0; i < 9; i++) @@ -127,7 +127,8 @@ namespace CalamityMod.Projectiles.Melee Owner.Calamity().mouseWorldListener = true; - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center, Owner.DirectionTo(Owner.Calamity().mouseWorld) * 6f, ModContent.ProjectileType(), Projectile.damage, 4f, Owner.whoAmI).rotation = Owner.AngleTo(Owner.Calamity().mouseWorld) + MathHelper.ToRadians(Main.rand.NextFloat(-25, 25)); + Projectile slash = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center, Owner.DirectionTo(Owner.Calamity().mouseWorld) * 6f, ModContent.ProjectileType(), Projectile.damage, 4f, Owner.whoAmI); + slash.rotation = Owner.AngleTo(Owner.Calamity().mouseWorld) + MathHelper.ToRadians(Main.rand.NextFloat(-25, 25)); } SlashTimer++; diff --git a/Projectiles/Melee/MantisClawJet.cs b/Projectiles/Melee/MantisClawJet.cs index 5c3ae0a27d..87821016d3 100644 --- a/Projectiles/Melee/MantisClawJet.cs +++ b/Projectiles/Melee/MantisClawJet.cs @@ -30,8 +30,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 40; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 40; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() diff --git a/Projectiles/Melee/MarniteDeconstructorProj.cs b/Projectiles/Melee/MarniteDeconstructorProj.cs index 31c639c24e..35145b1729 100644 --- a/Projectiles/Melee/MarniteDeconstructorProj.cs +++ b/Projectiles/Melee/MarniteDeconstructorProj.cs @@ -167,7 +167,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 normalizedVelocity = Projectile.velocity.SafeNormalize(Vector2.Zero); //Draw the holdout. - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 origin = new Vector2(9f, tex.Height / 2f); SpriteEffects effect = SpriteEffects.None; if (Owner.direction * Owner.gravDir < 0) diff --git a/Projectiles/Melee/MarniteObliteratorProj.cs b/Projectiles/Melee/MarniteObliteratorProj.cs index d3f9272e13..60b4ae4975 100644 --- a/Projectiles/Melee/MarniteObliteratorProj.cs +++ b/Projectiles/Melee/MarniteObliteratorProj.cs @@ -179,7 +179,7 @@ namespace CalamityMod.Projectiles.Melee Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 origin = new Vector2(9f, tex.Height / 2f); SpriteEffects effect = SpriteEffects.None; if (Owner.direction * Owner.gravDir < 0) diff --git a/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs b/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs index 88a1444c12..cdc5b7f8a3 100644 --- a/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs +++ b/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs @@ -43,8 +43,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { diff --git a/Projectiles/Melee/MendedBiomeBlade_PurityProjectionSigil.cs b/Projectiles/Melee/MendedBiomeBlade_PurityProjectionSigil.cs index 1b24f9949d..1d50aff5e3 100644 --- a/Projectiles/Melee/MendedBiomeBlade_PurityProjectionSigil.cs +++ b/Projectiles/Melee/MendedBiomeBlade_PurityProjectionSigil.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Melee { if (Main.myPlayer != Projectile.owner) // don't show for other players return false; - DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Melee/MendedBiomeBlade_TrueBitingEmbrace.cs b/Projectiles/Melee/MendedBiomeBlade_TrueBitingEmbrace.cs index 17f21ef9ae..39309dc368 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TrueBitingEmbrace.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TrueBitingEmbrace.cs @@ -149,7 +149,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.Center = Owner.Center + (direction * ThrustDisplaceRatio() * 60); Projectile.frameCounter++; - if (Projectile.frameCounter % 5 == 0 && Projectile.frame + 1 < Main.projFrames[Projectile.type]) + if (Projectile.frameCounter % 5 == 0 && Projectile.frame + 1 < Main.projFrames[Type]) Projectile.frame++; if (Main.rand.NextBool() && Owner.whoAmI == Main.myPlayer) diff --git a/Projectiles/Melee/MendedBiomeBlade_TruePurityProjection.cs b/Projectiles/Melee/MendedBiomeBlade_TruePurityProjection.cs index 841004a76f..56f513e75c 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TruePurityProjection.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TruePurityProjection.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > TrueBiomeBlade.DefaultAttunement_BeamTime - 5f) return false; - DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/MirrorBlast.cs b/Projectiles/Melee/MirrorBlast.cs index 5b768e9693..bcf7c10932 100644 --- a/Projectiles/Melee/MirrorBlast.cs +++ b/Projectiles/Melee/MirrorBlast.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > 295) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Melee/MourningSkull.cs b/Projectiles/Melee/MourningSkull.cs index 9c8aa59826..a6dd1f7b10 100644 --- a/Projectiles/Melee/MourningSkull.cs +++ b/Projectiles/Melee/MourningSkull.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/MurasamaSlash.cs b/Projectiles/Melee/MurasamaSlash.cs index c6b615e264..4ae6bfea79 100644 --- a/Projectiles/Melee/MurasamaSlash.cs +++ b/Projectiles/Melee/MurasamaSlash.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Melee public int time = 0; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 14; + Main.projFrames[Type] = 14; } public bool Slashing = false; @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Melee { if (Projectile.frameCounter <= 1) return false; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = texture.Frame(verticalFrames: Main.projFrames[Type], frameY: Projectile.frame); Vector2 origin = frame.Size() * 0.5f; SpriteEffects spriteEffects = Projectile.direction == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; diff --git a/Projectiles/Melee/NeptunesBountyProjectile.cs b/Projectiles/Melee/NeptunesBountyProjectile.cs index 48173262b6..f86a683e98 100644 --- a/Projectiles/Melee/NeptunesBountyProjectile.cs +++ b/Projectiles/Melee/NeptunesBountyProjectile.cs @@ -40,8 +40,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -296,7 +296,7 @@ namespace CalamityMod.Projectiles.Melee { if (spinMode2) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Aqua with { A = 0 } * 0.6f, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Aqua with { A = 0 } * 0.6f, 1); } Asset p = ModContent.Request("CalamityMod/Particles/CircularSmearSmokey"); Asset p2 = ModContent.Request("CalamityMod/Particles/SemiCircularSmearSwipe"); diff --git a/Projectiles/Melee/Oathblade.cs b/Projectiles/Melee/Oathblade.cs index 5be1f636f3..12457fe915 100644 --- a/Projectiles/Melee/Oathblade.cs +++ b/Projectiles/Melee/Oathblade.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Melee/OldLordClaymoreProj.cs b/Projectiles/Melee/OldLordClaymoreProj.cs index a15390c1b4..f15552b0a2 100644 --- a/Projectiles/Melee/OldLordClaymoreProj.cs +++ b/Projectiles/Melee/OldLordClaymoreProj.cs @@ -43,8 +43,8 @@ namespace CalamityMod.Projectiles.Melee { base.SetStaticDefaults(); // DO NOT REMOVE THIS - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 3; } public override void SetDefaults() diff --git a/Projectiles/Melee/OmnibladeSwing.cs b/Projectiles/Melee/OmnibladeSwing.cs index 396202ab0b..d7bb4b4043 100644 --- a/Projectiles/Melee/OmnibladeSwing.cs +++ b/Projectiles/Melee/OmnibladeSwing.cs @@ -14,14 +14,13 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; + Main.projFrames[Type] = 6; } public override void SetDefaults() { - Projectile.width = 246; + Projectile.width = 308; Projectile.height = 184; - Projectile.scale = 1.15f; Projectile.friendly = true; Projectile.penetrate = -1; @@ -36,7 +35,7 @@ namespace CalamityMod.Projectiles.Melee { Projectile.frameCounter++; Projectile.frame = Projectile.frameCounter / 3; - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.Kill(); Vector2 playerRotatedPoint = Owner.RotatedRelativePoint(Owner.MountedCenter, true); @@ -49,16 +48,17 @@ namespace CalamityMod.Projectiles.Melee } // Rotation and directioning. + Projectile.rotation = Owner.gravDir == -1f ? MathHelper.Pi : 0f; Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); // Sprite and player directioning. - Projectile.spriteDirection = -Projectile.direction; + Projectile.spriteDirection = Projectile.direction * (int)(Owner.gravDir); if (Projectile.direction == 1) Projectile.Left = Owner.MountedCenter; else Projectile.Right = Owner.MountedCenter; - Projectile.position.X += Projectile.spriteDirection == -1 ? -116f : 88f; - Projectile.position.Y -= Projectile.scale * 66f; + Projectile.position.X += (Projectile.spriteDirection == 1 ? -92f : 96f) * Owner.gravDir; + Projectile.position.Y -= 80f * Owner.gravDir; Owner.ChangeDir(Projectile.direction); // Prevents the projectile from dying diff --git a/Projectiles/Melee/OmnibladeSwing.png b/Projectiles/Melee/OmnibladeSwing.png index bb0103db68..6fc79d67b1 100644 Binary files a/Projectiles/Melee/OmnibladeSwing.png and b/Projectiles/Melee/OmnibladeSwing.png differ diff --git a/Projectiles/Melee/Orbacle.cs b/Projectiles/Melee/Orbacle.cs index 6f4f88e0e0..1dc8a2244f 100644 --- a/Projectiles/Melee/Orbacle.cs +++ b/Projectiles/Melee/Orbacle.cs @@ -30,15 +30,15 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Main.spriteBatch.SetBlendState(BlendState.Additive); - - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Main.spriteBatch.EnterShaderRegion(BlendState.Additive); + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Vector2 origin = texture.Size() * 0.5f; Color color = Color.Goldenrod; Main.EntitySpriteDraw(texture, drawPosition, null, Color.Gold * 0.2f, Projectile.rotation, origin, Projectile.scale * 1.6f, SpriteEffects.None, 0); Main.EntitySpriteDraw(texture, drawPosition, null, color, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + Main.spriteBatch.ExitShaderRegion(); return false; } diff --git a/Projectiles/Melee/OrderbringerBeam.cs b/Projectiles/Melee/OrderbringerBeam.cs index fe41a6d1a7..ea5a3dc017 100644 --- a/Projectiles/Melee/OrderbringerBeam.cs +++ b/Projectiles/Melee/OrderbringerBeam.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 12; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 12; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Melee } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Lerp(mainColor, Color.White, 0.3f) with { A = 0 }, 1, null, true, true); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Lerp(mainColor, Color.White, 0.3f) with { A = 0 }, 1, null, true, true); return false; } diff --git a/Projectiles/Melee/OrderbringerWaveProj.cs b/Projectiles/Melee/OrderbringerWaveProj.cs index 2a396cb395..d38407612a 100644 --- a/Projectiles/Melee/OrderbringerWaveProj.cs +++ b/Projectiles/Melee/OrderbringerWaveProj.cs @@ -55,12 +55,6 @@ namespace CalamityMod.Projectiles.Melee Projectile.scale += 0.0026f; hitboxSize += 0.4525f; Projectile.velocity *= 0.995f; - - if (time % 50 == 0 && time > 10) - { - //Projectile stars = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center + Main.rand.NextVector2Circular(hitboxSize * 0.8f, hitboxSize * 0.8f) - Projectile.velocity * 2, (-Projectile.velocity * 3).RotatedByRandom(0.9f), ModContent.ProjectileType(), (int)(Projectile.damage * 0.2f), 3f, Projectile.owner, 0f); - //stars.penetrate = 1; - } } else { diff --git a/Projectiles/Melee/PhosphorescentGauntletPunches.cs b/Projectiles/Melee/PhosphorescentGauntletPunches.cs index 2c02f06d22..e9385e48e5 100644 --- a/Projectiles/Melee/PhosphorescentGauntletPunches.cs +++ b/Projectiles/Melee/PhosphorescentGauntletPunches.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Melee public const float LungeSpeed = 19f; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 14; + Main.projFrames[Type] = 14; } public override void SetDefaults() @@ -141,7 +141,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.frame++; // Die at the end of the final punch. - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.Kill(); } } @@ -158,8 +158,8 @@ namespace CalamityMod.Projectiles.Melee // Manual drawing is used to correct the origin of the projectile when drawn. public override bool PreDraw(ref Color lightColor) { - Texture2D punchTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle frame = punchTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D punchTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle frame = punchTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; SpriteEffects directionEffect = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; Main.EntitySpriteDraw(punchTexture, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, origin, Projectile.scale, directionEffect, 0); diff --git a/Projectiles/Melee/PhotonRipperProjectile.cs b/Projectiles/Melee/PhotonRipperProjectile.cs index ea3a7d4c47..0fd61c4476 100644 --- a/Projectiles/Melee/PhotonRipperProjectile.cs +++ b/Projectiles/Melee/PhotonRipperProjectile.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D glowmaskTexture = ModContent.Request("CalamityMod/Projectiles/Melee/PhotonRipperGlowmask").Value; Rectangle glowmaskRectangle = glowmaskTexture.Frame(1, 6, 0, Projectile.frame); Vector2 origin = texture.Size() * 0.5f; diff --git a/Projectiles/Melee/PlagueSeeker.cs b/Projectiles/Melee/PlagueSeeker.cs index 62293378b4..842c7102ee 100644 --- a/Projectiles/Melee/PlagueSeeker.cs +++ b/Projectiles/Melee/PlagueSeeker.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Melee { int cap = 3; float capDamageFactor = 0.05f; - int excessCount = Main.player[Projectile.owner].ownedProjectileCounts[Projectile.type] - cap; + int excessCount = Main.player[Projectile.owner].ownedProjectileCounts[Type] - cap; modifiers.SourceDamage *= MathHelper.Clamp(1f - (capDamageFactor * excessCount), 0f, 1f); } diff --git a/Projectiles/Melee/PrismRay.cs b/Projectiles/Melee/PrismRay.cs index 82014e4644..e1638f5750 100644 --- a/Projectiles/Melee/PrismRay.cs +++ b/Projectiles/Melee/PrismRay.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -107,8 +107,8 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { Vector2 baseDrawPosition = Projectile.Center + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle frame = texture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() / 2f; Color fadedRayColor = Projectile.GetAlpha(lightColor); Color fullbrightRayColor = HueDownscaledRayColor.MultiplyRGBA(new Color(255, 255, 255, 0)); diff --git a/Projectiles/Melee/PrismTooth.cs b/Projectiles/Melee/PrismTooth.cs index c8e2d143d1..6f9361c6a7 100644 --- a/Projectiles/Melee/PrismTooth.cs +++ b/Projectiles/Melee/PrismTooth.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Projectiles.Melee public ref float CanBreakTrees => ref Projectile.ai[2]; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 3; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 90; + ProjectileID.Sets.TrailingMode[Type] = 3; + ProjectileID.Sets.TrailCacheLength[Type] = 90; } public override void SetDefaults() @@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Melee Time++; } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox.TopLeft(), targetHitbox.Size()); + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox); public void AbsolutelyFuckingAnnihilateTrees(int x, int y) { diff --git a/Projectiles/Melee/PrismaticRay.cs b/Projectiles/Melee/PrismaticRay.cs index ea33aa5184..a920374e94 100644 --- a/Projectiles/Melee/PrismaticRay.cs +++ b/Projectiles/Melee/PrismaticRay.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Melee public override string Texture => "CalamityMod/Projectiles/Melee/PrismaticRayStart"; public Player Owner => Main.player[Projectile.owner]; - public override Texture2D LaserBeginTexture => Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + public override Texture2D LaserBeginTexture => Terraria.GameContent.TextureAssets.Projectile[Type].Value; public override Texture2D LaserMiddleTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/PrismaticRayMid", AssetRequestMode.ImmediateLoad).Value; public override Texture2D LaserEndTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/PrismaticRayEnd", AssetRequestMode.ImmediateLoad).Value; public override float MaxScale => 5f; diff --git a/Projectiles/Melee/PrismaticWave.cs b/Projectiles/Melee/PrismaticWave.cs index 017cf67e73..98dec241ce 100644 --- a/Projectiles/Melee/PrismaticWave.cs +++ b/Projectiles/Melee/PrismaticWave.cs @@ -32,8 +32,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Melee/PwnagehammerEcho.cs b/Projectiles/Melee/PwnagehammerEcho.cs index cf48232e18..e24dfc9dd5 100644 --- a/Projectiles/Melee/PwnagehammerEcho.cs +++ b/Projectiles/Melee/PwnagehammerEcho.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 7; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 7; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -134,8 +134,8 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Gold with { A = 0 } * 0.5f, 1, texture, true, true); + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Gold with { A = 0 } * 0.5f, 1, texture, true, true); return false; } diff --git a/Projectiles/Melee/PwnagehammerProj.cs b/Projectiles/Melee/PwnagehammerProj.cs index d180d605ef..be9c4ce20d 100644 --- a/Projectiles/Melee/PwnagehammerProj.cs +++ b/Projectiles/Melee/PwnagehammerProj.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 7; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 7; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -117,7 +117,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Melee/RSSolarFlare.cs b/Projectiles/Melee/RSSolarFlare.cs index c0d7da5f0f..1365f97247 100644 --- a/Projectiles/Melee/RSSolarFlare.cs +++ b/Projectiles/Melee/RSSolarFlare.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -73,8 +73,8 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Melee/Razorwind.cs b/Projectiles/Melee/Razorwind.cs index 85eea04146..cd3a626853 100644 --- a/Projectiles/Melee/Razorwind.cs +++ b/Projectiles/Melee/Razorwind.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Melee/RedtideWhirlpool.cs b/Projectiles/Melee/RedtideWhirlpool.cs index 319032448d..42d3b112e9 100644 --- a/Projectiles/Melee/RedtideWhirlpool.cs +++ b/Projectiles/Melee/RedtideWhirlpool.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -45,7 +46,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; SpriteEffects flip = Math.Sign(Projectile.velocity.X) < 0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; @@ -54,7 +55,8 @@ namespace CalamityMod.Projectiles.Melee return false; } - + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.NPCDeath19, Projectile.position); diff --git a/Projectiles/Melee/RendingNeedle.cs b/Projectiles/Melee/RendingNeedle.cs index 6d609a9ec7..6c4ad50df0 100644 --- a/Projectiles/Melee/RendingNeedle.cs +++ b/Projectiles/Melee/RendingNeedle.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; } const float MaxTime = 30; diff --git a/Projectiles/Melee/RespiteblockHoldout.cs b/Projectiles/Melee/RespiteblockHoldout.cs index 4cd26ca080..5428e86b9a 100644 --- a/Projectiles/Melee/RespiteblockHoldout.cs +++ b/Projectiles/Melee/RespiteblockHoldout.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; SpriteEffects direction = Projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Melee } if (Time % 4 == 0) { - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center + (Projectile.velocity.RotatedBy(MathHelper.ToRadians(45f * Projectile.direction)) * 10) + Main.rand.NextVector2Circular(13, 13) + Projectile.velocity * Main.rand.Next(10, 20 + 1), Projectile.velocity.RotatedBy(Main.rand.NextFloat(-0.01f, -0.25f) * Projectile.direction) * 4, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4f), Projectile.knockBack, Projectile.owner, 0); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + (Projectile.velocity.RotatedBy(MathHelper.ToRadians(45f * Projectile.direction)) * 10) + Main.rand.NextVector2Circular(13, 13) + Projectile.velocity * Main.rand.Next(10, 20 + 1), Projectile.velocity.RotatedBy(Main.rand.NextFloat(-0.01f, -0.25f) * Projectile.direction) * 4, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4f), Projectile.knockBack, Projectile.owner, 0); } DetermineVisuals(playerRotatedPosition); diff --git a/Projectiles/Melee/RoxcaliburProj.cs b/Projectiles/Melee/RoxcaliburProj.cs index e970f4b362..8241beb5f4 100644 --- a/Projectiles/Melee/RoxcaliburProj.cs +++ b/Projectiles/Melee/RoxcaliburProj.cs @@ -268,7 +268,7 @@ namespace CalamityMod.Projectiles.Melee } public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle rectangle = texture.Bounds; Vector2 origin2 = rectangle.Size() / 2f; SpriteEffects effects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; diff --git a/Projectiles/Melee/SaharaSlicersBlade.png b/Projectiles/Melee/SaharaSlicersBlade.png index abf539a5d6..d3667f574b 100644 Binary files a/Projectiles/Melee/SaharaSlicersBlade.png and b/Projectiles/Melee/SaharaSlicersBlade.png differ diff --git a/Projectiles/Melee/SaharaSlicersBladeAlt.png b/Projectiles/Melee/SaharaSlicersBladeAlt.png index 989f6b5acf..69a74d3ac1 100644 Binary files a/Projectiles/Melee/SaharaSlicersBladeAlt.png and b/Projectiles/Melee/SaharaSlicersBladeAlt.png differ diff --git a/Projectiles/Melee/SaharaSlicersBolt.cs b/Projectiles/Melee/SaharaSlicersBolt.cs index 0150b4757a..3304c67806 100644 --- a/Projectiles/Melee/SaharaSlicersBolt.cs +++ b/Projectiles/Melee/SaharaSlicersBolt.cs @@ -13,14 +13,15 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 9; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 9; + ProjectileID.Sets.TrailingMode[Type] = 0; } public ref int Bolts => ref Main.player[Projectile.owner].Calamity().saharaSlicersBolts; public override void SetDefaults() { Projectile.width = 18; Projectile.height = 18; + Projectile.timeLeft = 300; Projectile.friendly = true; Projectile.penetrate = 2; Projectile.tileCollide = true; @@ -42,12 +43,12 @@ namespace CalamityMod.Projectiles.Melee Projectile.extraUpdates = 6; if (Main.rand.NextBool(2)) { - Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(5, 5), Main.rand.NextBool() ? 288 : 207); + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(5, 5), Main.rand.NextBool() ? 288 : 121); dust.scale = Main.rand.NextFloat(0.2f, 0.45f); dust.noGravity = true; dust.velocity = -Projectile.velocity * 0.5f; } - if (Projectile.timeLeft % 2 == 0 && playerDist < 1400f) + if (Projectile.timeLeft % 2 == 0 && playerDist < 1400f && Projectile.timeLeft < 295) { SparkParticle spark = new SparkParticle(Projectile.Center - Projectile.velocity * 3f, -Projectile.velocity * 0.05f, false, 10, 1f, Color.White * 0.135f); GeneralParticleHandler.SpawnParticle(spark); @@ -73,10 +74,10 @@ namespace CalamityMod.Projectiles.Melee { for (int i = 0; i <= 8; i++) { - Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool() ? 288 : 207, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.3f, 1.9f)); + Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool() ? 288 : 121, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.3f, 1.9f)); dust.noGravity = false; dust.scale = Main.rand.NextFloat(0.6f, 0.9f); - Dust dust2 = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool() ? 288 : 207, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(35f)) * Main.rand.NextFloat(0.05f, 0.9f)); + Dust dust2 = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool() ? 288 : 121, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(35f)) * Main.rand.NextFloat(0.05f, 0.9f)); dust2.noGravity = false; dust2.scale = Main.rand.NextFloat(0.6f, 0.9f); } @@ -88,10 +89,10 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(SoundID.Item10, Projectile.position); for (int i = 0; i <= 5; i++) { - Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool() ? 216 : 207, -Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.2f, 1f)); + Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool() ? 216 : 121, -Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.2f, 1f)); dust.noGravity = true; dust.scale = Main.rand.NextFloat(1.1f, 1.8f); - Dust dust2 = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool() ? 216 : 207, -Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(35f)) * Main.rand.NextFloat(0.05f, 0.4f)); + Dust dust2 = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool() ? 216 : 121, -Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(35f)) * Main.rand.NextFloat(0.05f, 0.4f)); dust2.noGravity = true; dust2.scale = Main.rand.NextFloat(1.1f, 1.8f); } @@ -100,7 +101,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { if (Projectile.ai[0] == 1) - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return true; } public override bool? CanDamage() => Projectile.ai[0] == 1 ? true : false; diff --git a/Projectiles/Melee/SaharaSlicersBolt.png b/Projectiles/Melee/SaharaSlicersBolt.png index 9c954972d8..7bcc8d6378 100644 Binary files a/Projectiles/Melee/SaharaSlicersBolt.png and b/Projectiles/Melee/SaharaSlicersBolt.png differ diff --git a/Projectiles/Melee/SandBlade.cs b/Projectiles/Melee/SandBlade.cs index daf43041df..1ff0f70ab3 100644 --- a/Projectiles/Melee/SandBlade.cs +++ b/Projectiles/Melee/SandBlade.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Melee/ScourgeoftheCosmosMini.cs b/Projectiles/Melee/ScourgeoftheCosmosMini.cs index 6e95d9e0be..9e1fff2b3e 100644 --- a/Projectiles/Melee/ScourgeoftheCosmosMini.cs +++ b/Projectiles/Melee/ScourgeoftheCosmosMini.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 2; + Main.projFrames[Type] = 2; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } @@ -149,8 +149,8 @@ namespace CalamityMod.Projectiles.Melee public override void PostDraw(Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Vector2 origin = new Vector2(9f, 10f); Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Projectiles/Melee/ScourgeoftheCosmosMiniGlow").Value, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Melee/ScourgeoftheCosmosProj.cs b/Projectiles/Melee/ScourgeoftheCosmosProj.cs index bb5bb91e57..4767611827 100644 --- a/Projectiles/Melee/ScourgeoftheCosmosProj.cs +++ b/Projectiles/Melee/ScourgeoftheCosmosProj.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/SeashineSwordProj.cs b/Projectiles/Melee/SeashineSwordProj.cs index 91b63de8bb..00272dd585 100644 --- a/Projectiles/Melee/SeashineSwordProj.cs +++ b/Projectiles/Melee/SeashineSwordProj.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -17,8 +18,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -89,12 +90,12 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > TimeLeft - 5) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } - public override Color? GetAlpha(Color lightColor) => new Color(128, byte.MaxValue, byte.MaxValue); - + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 60); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 60); public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item10, Projectile.Center); diff --git a/Projectiles/Melee/Shortswords/SaharaSlicersBlade.cs b/Projectiles/Melee/Shortswords/SaharaSlicersBlade.cs index 21b5e40527..c1f78143ce 100644 --- a/Projectiles/Melee/Shortswords/SaharaSlicersBlade.cs +++ b/Projectiles/Melee/Shortswords/SaharaSlicersBlade.cs @@ -35,8 +35,8 @@ namespace CalamityMod.Projectiles.Melee.Shortswords public override void SetVisualOffsets() { - const int HalfSpriteWidth = 32 / 2; - const int HalfSpriteHeight = 32 / 2; + const int HalfSpriteWidth = 40 / 2; + const int HalfSpriteHeight = 40 / 2; int HalfProjWidth = Projectile.width / 2; int HalfProjHeight = Projectile.height / 2; @@ -66,14 +66,13 @@ namespace CalamityMod.Projectiles.Melee.Shortswords public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { // Add to bolt counter, spawn 2 quiver bolts, and on hit visual - if (Bolts < 10) + for (int i = 0; i < 2; i++) { - Bolts++; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, Bolts); if (Bolts < 10) { Bolts++; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, Bolts); + Projectile quiverBolt = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, Bolts); + quiverBolt.tileCollide = false; } } float numberOfDusts = 5f; @@ -83,7 +82,7 @@ namespace CalamityMod.Projectiles.Melee.Shortswords float rot = MathHelper.ToRadians(i * rotFactor); Vector2 offset = new Vector2(Main.rand.NextFloat(0.5f, 2.5f), 0).RotatedBy(rot * Main.rand.NextFloat(1.1f, 9.1f)); Vector2 velOffset = new Vector2(Main.rand.NextFloat(0.5f, 2.5f), 0).RotatedBy(rot * Main.rand.NextFloat(1.1f, 9.1f)); - Dust dust = Dust.NewDustPerfect(target.Center + offset, Main.rand.NextBool() ? 288 : 207, new Vector2(velOffset.X, velOffset.Y)); + Dust dust = Dust.NewDustPerfect(target.Center + offset, Main.rand.NextBool() ? 288 : 121, new Vector2(velOffset.X, velOffset.Y)); dust.noGravity = false; dust.velocity = velOffset; dust.scale = Main.rand.NextFloat(1.5f, 1.2f); diff --git a/Projectiles/Melee/Shortswords/SaharaSlicersBladeAlt.cs b/Projectiles/Melee/Shortswords/SaharaSlicersBladeAlt.cs index 2b361ba73d..bb6b42d38a 100644 --- a/Projectiles/Melee/Shortswords/SaharaSlicersBladeAlt.cs +++ b/Projectiles/Melee/Shortswords/SaharaSlicersBladeAlt.cs @@ -37,8 +37,8 @@ namespace CalamityMod.Projectiles.Melee.Shortswords public override void SetVisualOffsets() { - const int HalfSpriteWidth = 32 / 2; - const int HalfSpriteHeight = 32 / 2; + const int HalfSpriteWidth = 40 / 2; + const int HalfSpriteHeight = 40 / 2; int HalfProjWidth = Projectile.width / 2; int HalfProjHeight = Projectile.height / 2; @@ -69,14 +69,13 @@ namespace CalamityMod.Projectiles.Melee.Shortswords public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { // Add to bolt counter, spawn 2 quiver bolts, and on hit visual - if (Bolts < 10) + for (int i = 0; i < 2; i++) { - Bolts++; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, Bolts); if (Bolts < 10) { Bolts++; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, Bolts); + Projectile quiverBolt = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, Bolts); + quiverBolt.tileCollide = false; } } float numberOfDusts = 5f; @@ -86,7 +85,7 @@ namespace CalamityMod.Projectiles.Melee.Shortswords float rot = MathHelper.ToRadians(i * rotFactor); Vector2 offset = new Vector2(Main.rand.NextFloat(0.5f, 2.5f), 0).RotatedBy(rot * Main.rand.NextFloat(1.1f, 9.1f)); Vector2 velOffset = new Vector2(Main.rand.NextFloat(0.5f, 2.5f), 0).RotatedBy(rot * Main.rand.NextFloat(1.1f, 9.1f)); - Dust dust = Dust.NewDustPerfect(target.Center + offset, Main.rand.NextBool() ? 288 : 207, new Vector2(velOffset.X, velOffset.Y)); + Dust dust = Dust.NewDustPerfect(target.Center + offset, Main.rand.NextBool() ? 288 : 121, new Vector2(velOffset.X, velOffset.Y)); dust.noGravity = false; dust.velocity = velOffset; dust.scale = Main.rand.NextFloat(1.5f, 1.2f); diff --git a/Projectiles/Melee/SolarNeedle.cs b/Projectiles/Melee/SolarNeedle.cs index a2cb9c4f29..73ff5cf5ef 100644 --- a/Projectiles/Melee/SolarNeedle.cs +++ b/Projectiles/Melee/SolarNeedle.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 2; } const float MaxTime = 30; @@ -99,7 +99,7 @@ namespace CalamityMod.Projectiles.Melee } - DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); diff --git a/Projectiles/Melee/SolsticeBeam.cs b/Projectiles/Melee/SolsticeBeam.cs index 909c591cff..c51f791152 100644 --- a/Projectiles/Melee/SolsticeBeam.cs +++ b/Projectiles/Melee/SolsticeBeam.cs @@ -130,7 +130,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > 595) return false; - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Melee/SoulScythe.cs b/Projectiles/Melee/SoulScythe.cs index 8e22c60646..0f4dd0e19c 100644 --- a/Projectiles/Melee/SoulScythe.cs +++ b/Projectiles/Melee/SoulScythe.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Melee/SpatialSpear.cs b/Projectiles/Melee/SpatialSpear.cs index 8d06a0e6d5..db4bd66be8 100644 --- a/Projectiles/Melee/SpatialSpear.cs +++ b/Projectiles/Melee/SpatialSpear.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > TimeLeft - 5) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Melee/SpatialSpear2.cs b/Projectiles/Melee/SpatialSpear2.cs index bcf1a5c36b..fcdd40ad08 100644 --- a/Projectiles/Melee/SpatialSpear2.cs +++ b/Projectiles/Melee/SpatialSpear2.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > TimeLeft - 5) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Melee/SpatialSpear3.cs b/Projectiles/Melee/SpatialSpear3.cs index db84085d23..2b5f59aa0d 100644 --- a/Projectiles/Melee/SpatialSpear3.cs +++ b/Projectiles/Melee/SpatialSpear3.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > TimeLeft - 5) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Melee/SpatialSpear4.cs b/Projectiles/Melee/SpatialSpear4.cs index 85754074fa..f7932ebf8d 100644 --- a/Projectiles/Melee/SpatialSpear4.cs +++ b/Projectiles/Melee/SpatialSpear4.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > TimeLeft - 5) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Melee/Spears/BansheeHookProj.cs b/Projectiles/Melee/Spears/BansheeHookProj.cs index f93eefbdd9..cb3b1f3b6b 100644 --- a/Projectiles/Melee/Spears/BansheeHookProj.cs +++ b/Projectiles/Melee/Spears/BansheeHookProj.cs @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override bool PreDraw(ref Color lightColor) { Vector2 drawPosition = Projectile.position + new Vector2(Projectile.width, Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; - Texture2D alternateHookTexture = Projectile.spriteDirection == -1 ? ModContent.Request("CalamityMod/Projectiles/Melee/Spears/BansheeHookAlt").Value : Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D alternateHookTexture = Projectile.spriteDirection == -1 ? ModContent.Request("CalamityMod/Projectiles/Melee/Spears/BansheeHookAlt").Value : Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 origin = new Vector2(Projectile.spriteDirection == 1 ? alternateHookTexture.Width + 8f : -8f, -8f); Main.EntitySpriteDraw(alternateHookTexture, drawPosition, null, new Color(255, 255, 255, 127), Projectile.rotation, diff --git a/Projectiles/Melee/Spears/RedtideSpearProjectile.cs b/Projectiles/Melee/Spears/RedtideSpearProjectile.cs index 3eef0e3a0a..f1d42d5b71 100644 --- a/Projectiles/Melee/Spears/RedtideSpearProjectile.cs +++ b/Projectiles/Melee/Spears/RedtideSpearProjectile.cs @@ -325,7 +325,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, lightColor, AppropriateRotation + MathHelper.PiOver2 * 1.5f - MathHelper.ToRadians(12), texture.Size() / 2f, Projectile.scale, 0, 0); return false; diff --git a/Projectiles/Melee/Spears/StreamGougeProj.cs b/Projectiles/Melee/Spears/StreamGougeProj.cs index 49a36ff07b..659d3f95ee 100644 --- a/Projectiles/Melee/Spears/StreamGougeProj.cs +++ b/Projectiles/Melee/Spears/StreamGougeProj.cs @@ -146,7 +146,7 @@ namespace CalamityMod.Projectiles.Melee.Spears bool portalIsInteractable = portalOpacity >= 1f; Vector2 portalDrawPosition = Owner.Center + InitialDirection.ToRotationVector2() * 130f - Main.screenPosition; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (portalIsInteractable) { Main.spriteBatch.EnterShaderRegion(); diff --git a/Projectiles/Melee/StarburstSHIV.cs b/Projectiles/Melee/StarburstSHIV.cs index 0642318a7b..6bdbcae1a7 100644 --- a/Projectiles/Melee/StarburstSHIV.cs +++ b/Projectiles/Melee/StarburstSHIV.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > 85) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Melee/StarnightBeam.cs b/Projectiles/Melee/StarnightBeam.cs index 305f72a60a..69151c2493 100644 --- a/Projectiles/Melee/StarnightBeam.cs +++ b/Projectiles/Melee/StarnightBeam.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > 595) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/StarofJudgement.cs b/Projectiles/Melee/StarofJudgement.cs index aca5ea6566..7d8e9fb74c 100644 --- a/Projectiles/Melee/StarofJudgement.cs +++ b/Projectiles/Melee/StarofJudgement.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 12; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 12; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Melee Color drawColor = Color.Lerp(mainColor, Color.White, 0.2f) with { A = 0 }; float drawRotation = Projectile.rotation; Vector2 rotationPoint = texture.Size() * 0.5f; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], drawColor * 0.5f, 1, texture, true, true); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], drawColor * 0.5f, 1, texture, true, true); Main.EntitySpriteDraw(texture, drawPosition, null, drawColor, drawRotation, rotationPoint, Projectile.scale, SpriteEffects.None); return false; } diff --git a/Projectiles/Melee/StellarContemptEcho.cs b/Projectiles/Melee/StellarContemptEcho.cs index 39a9736341..8d094996f2 100644 --- a/Projectiles/Melee/StellarContemptEcho.cs +++ b/Projectiles/Melee/StellarContemptEcho.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -189,8 +189,8 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Turquoise with { A = 0 } * 0.5f, 1, texture, true, true); + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Turquoise with { A = 0 } * 0.5f, 1, texture, true, true); Projectile.DrawProjectileWithBackglow(Color.Turquoise with { A = 0 }, Color.White, 12f * Utils.GetLerpValue(0, 42, Projectile.ai[0], true) , texture); return true; diff --git a/Projectiles/Melee/StellarContemptHammer.cs b/Projectiles/Melee/StellarContemptHammer.cs index 30e8240cd5..c46e2eb20a 100644 --- a/Projectiles/Melee/StellarContemptHammer.cs +++ b/Projectiles/Melee/StellarContemptHammer.cs @@ -26,8 +26,8 @@ namespace CalamityMod.Projectiles.Melee public int time = 0; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 11; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 11; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -310,7 +310,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 3); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 3); return false; } } diff --git a/Projectiles/Melee/StellarStrikerHoldout.cs b/Projectiles/Melee/StellarStrikerHoldout.cs index 6af8c3b7d9..309cff866e 100644 --- a/Projectiles/Melee/StellarStrikerHoldout.cs +++ b/Projectiles/Melee/StellarStrikerHoldout.cs @@ -221,7 +221,7 @@ namespace CalamityMod.Projectiles.Melee if (spawnBoom) { Vector2 spawnSpot = target.Center + new Vector2(Main.rand.NextFloat(-550, 550), Main.rand.NextFloat(-750, -950)); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 1.3f), Projectile.knockBack, Projectile.owner, 0, 0, 6); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 1.3f), Projectile.knockBack, Projectile.owner, 0, 0, 6); spawnBoom = false; } diff --git a/Projectiles/Melee/StellarStrikerMeteor.cs b/Projectiles/Melee/StellarStrikerMeteor.cs index 7cfefe6248..d247b25c68 100644 --- a/Projectiles/Melee/StellarStrikerMeteor.cs +++ b/Projectiles/Melee/StellarStrikerMeteor.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -104,15 +104,15 @@ namespace CalamityMod.Projectiles.Melee { spawnMet = false; Vector2 spawnSpot = Owner.Center + new Vector2(Main.rand.NextFloat(-550, 550), Main.rand.NextFloat(-750, -950)); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 0, Projectile.ai[2] - 1); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 0, Projectile.ai[2] - 1); } } public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.White, 1, tex); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.White, 1, tex); return false; } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) @@ -133,7 +133,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.ai[2] > 0 && spawnMet) { Vector2 spawnSpot = Owner.Center + new Vector2(Main.rand.NextFloat(-550, 550), Main.rand.NextFloat(-750, -950)); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 0, Projectile.ai[2] - 1); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 0, Projectile.ai[2] - 1); } if (Projectile.owner == Main.myPlayer) diff --git a/Projectiles/Melee/StormBeam.cs b/Projectiles/Melee/StormBeam.cs index cb38b8d20f..0d8723c6a6 100644 --- a/Projectiles/Melee/StormBeam.cs +++ b/Projectiles/Melee/StormBeam.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > 595) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Melee/StormMark.cs b/Projectiles/Melee/StormMark.cs index c2ce3af1f8..23dbddc32c 100644 --- a/Projectiles/Melee/StormMark.cs +++ b/Projectiles/Melee/StormMark.cs @@ -138,8 +138,8 @@ namespace CalamityMod.Projectiles.Melee { Color originalColor = Lighting.GetColor((int)((double)Projectile.position.X + (double)Projectile.width * 0.5) / 16, (int)(((double)Projectile.position.Y + (double)Projectile.height * 0.5) / 16.0)); Vector2 drawPos = Projectile.position + new Vector2((float)Projectile.width, (float)Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; - Texture2D texture2D27 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle rectangl = texture2D27.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D texture2D27 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle rectangl = texture2D27.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Color alphaColor = Projectile.GetAlpha(originalColor); Vector2 halfRect = rectangl.Size() / 2f; Color whiteColor = Main.hslToRgb(0.25f, 1f, 1f).MultiplyRGBA(new Color(255, 255, 255, 0)); diff --git a/Projectiles/Melee/StormRulerProj.cs b/Projectiles/Melee/StormRulerProj.cs index 307aca13a6..337f994549 100644 --- a/Projectiles/Melee/StormRulerProj.cs +++ b/Projectiles/Melee/StormRulerProj.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > 595) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Melee/StygianShieldAttack.cs b/Projectiles/Melee/StygianShieldAttack.cs index 2293e3eb0e..c82c514d61 100644 --- a/Projectiles/Melee/StygianShieldAttack.cs +++ b/Projectiles/Melee/StygianShieldAttack.cs @@ -33,8 +33,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -189,7 +189,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { // Textures and general use stuff - Texture2D mainTex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D mainTex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D bloomTex = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; Texture2D flatTex = ModContent.Request("CalamityMod/Particles/FlatShape").Value; Texture2D shieldTex = ModContent.Request("CalamityMod/Projectiles/Melee/StygianShieldBloom").Value; diff --git a/Projectiles/Melee/StygianShieldThrown.cs b/Projectiles/Melee/StygianShieldThrown.cs index 3ee45d065b..c786c5a669 100644 --- a/Projectiles/Melee/StygianShieldThrown.cs +++ b/Projectiles/Melee/StygianShieldThrown.cs @@ -30,8 +30,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = (int)TotalTrailLength; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = (int)TotalTrailLength; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() diff --git a/Projectiles/Melee/SwordsplosionBlue.cs b/Projectiles/Melee/SwordsplosionBlue.cs index a914389a7b..b7678895ef 100644 --- a/Projectiles/Melee/SwordsplosionBlue.cs +++ b/Projectiles/Melee/SwordsplosionBlue.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > 195) return false; - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Melee/SwordsplosionGreen.cs b/Projectiles/Melee/SwordsplosionGreen.cs index c92125967f..3ca4b3ffff 100644 --- a/Projectiles/Melee/SwordsplosionGreen.cs +++ b/Projectiles/Melee/SwordsplosionGreen.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > 295) return false; - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Melee/SwordsplosionPurple.cs b/Projectiles/Melee/SwordsplosionPurple.cs index 3763256b22..bb39cca1c7 100644 --- a/Projectiles/Melee/SwordsplosionPurple.cs +++ b/Projectiles/Melee/SwordsplosionPurple.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > 295) return false; - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Melee/SwordsplosionRed.cs b/Projectiles/Melee/SwordsplosionRed.cs index 1b5a77cb25..dac1a1a59e 100644 --- a/Projectiles/Melee/SwordsplosionRed.cs +++ b/Projectiles/Melee/SwordsplosionRed.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > 195) return false; - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Melee/TaintedBladeSlasher.cs b/Projectiles/Melee/TaintedBladeSlasher.cs index 4bc31dba95..c17cd585cf 100644 --- a/Projectiles/Melee/TaintedBladeSlasher.cs +++ b/Projectiles/Melee/TaintedBladeSlasher.cs @@ -106,8 +106,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 70; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 70; } public override void SetDefaults() @@ -120,6 +120,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.timeLeft = 90000; Projectile.usesLocalNPCImmunity = true; Projectile.noEnchantmentVisuals = true; + Projectile.ContinuouslyUpdateDamageStats = true; } public override void SendExtraAI(BinaryWriter writer) => writer.Write(VerticalOffset); diff --git a/Projectiles/Melee/TenebreusTidesWaterProjectile.cs b/Projectiles/Melee/TenebreusTidesWaterProjectile.cs index e9f30041da..2d717a89c9 100644 --- a/Projectiles/Melee/TenebreusTidesWaterProjectile.cs +++ b/Projectiles/Melee/TenebreusTidesWaterProjectile.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Melee { if (Projectile.timeLeft == 300) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/TenebreusTidesWaterSpear.cs b/Projectiles/Melee/TenebreusTidesWaterSpear.cs index da2fbddebb..97a536f5f8 100644 --- a/Projectiles/Melee/TenebreusTidesWaterSpear.cs +++ b/Projectiles/Melee/TenebreusTidesWaterSpear.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -205,8 +205,8 @@ namespace CalamityMod.Projectiles.Melee { if (dontDraw) return false; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int height = texture.Height / Main.projFrames[Type]; int frameHeight = height * Projectile.frame; Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture.Width / 2f, (float)height / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Melee/TenebreusTidesWaterSword.cs b/Projectiles/Melee/TenebreusTidesWaterSword.cs index 8eeca5bc8d..272ea31e28 100644 --- a/Projectiles/Melee/TenebreusTidesWaterSword.cs +++ b/Projectiles/Melee/TenebreusTidesWaterSword.cs @@ -187,7 +187,7 @@ namespace CalamityMod.Projectiles.Melee { if (dontDraw) return false; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture.Width / 2f, (float)texture.Height / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Melee/TerratomereExplosion.cs b/Projectiles/Melee/TerratomereExplosion.cs index 6082d67ae7..09d1b72d13 100644 --- a/Projectiles/Melee/TerratomereExplosion.cs +++ b/Projectiles/Melee/TerratomereExplosion.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Melee public void AdditiveDraw(SpriteBatch spriteBatch) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D lightTexture = ModContent.Request("CalamityMod/Skies/XerocLight").Value; Rectangle frame = texture.Frame(3, 6, Projectile.frame / 6, Projectile.frame % 6); Vector2 drawPosition = Projectile.Center - Main.screenPosition; diff --git a/Projectiles/Melee/TerratomereHoldoutProj.cs b/Projectiles/Melee/TerratomereHoldoutProj.cs index 95ff843ca5..f1366e5835 100644 --- a/Projectiles/Melee/TerratomereHoldoutProj.cs +++ b/Projectiles/Melee/TerratomereHoldoutProj.cs @@ -254,7 +254,7 @@ namespace CalamityMod.Projectiles.Melee public void DrawBlade(Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Vector2 origin = texture.Size() * Vector2.UnitY; if (Projectile.spriteDirection == -1) diff --git a/Projectiles/Melee/TerratomereMeleeSlash.cs b/Projectiles/Melee/TerratomereMeleeSlash.cs index 1f95774c5f..3445abe5ee 100644 --- a/Projectiles/Melee/TerratomereMeleeSlash.cs +++ b/Projectiles/Melee/TerratomereMeleeSlash.cs @@ -34,6 +34,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { + Projectile.rotation = Projectile.velocity.ToRotation(); Projectile.Opacity = Utils.GetLerpValue(0f, 26f, Projectile.timeLeft, true); Projectile.velocity *= 0.91f; Projectile.scale *= 1.01f; @@ -61,6 +62,6 @@ namespace CalamityMod.Projectiles.Melee return false; } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox.TopLeft(), targetHitbox.Size()); + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox); } } diff --git a/Projectiles/Melee/TerratomereSlash.cs b/Projectiles/Melee/TerratomereSlash.cs index 56677a094d..fa00458626 100644 --- a/Projectiles/Melee/TerratomereSlash.cs +++ b/Projectiles/Melee/TerratomereSlash.cs @@ -42,10 +42,7 @@ namespace CalamityMod.Projectiles.Melee } } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) - { - return Projectile.RotatingHitboxCollision(targetHitbox.TopLeft(), targetHitbox.Size()); - } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox); public override bool ShouldUpdatePosition() => true; diff --git a/Projectiles/Melee/TerrorBeam.cs b/Projectiles/Melee/TerrorBeam.cs index 3dadc5c1ea..1f00829413 100644 --- a/Projectiles/Melee/TerrorBeam.cs +++ b/Projectiles/Melee/TerrorBeam.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > 595) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Melee/ThornBase.cs b/Projectiles/Melee/ThornBase.cs index 637585167f..3c82181917 100644 --- a/Projectiles/Melee/ThornBase.cs +++ b/Projectiles/Melee/ThornBase.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Melee // Draw the tip for the final thorn public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (Projectile.ai[0] == TotalSegments) texture = ModContent.Request("CalamityMod/Projectiles/Melee/ThornTip").Value; diff --git a/Projectiles/Melee/Tornado.cs b/Projectiles/Melee/Tornado.cs index e1c3021502..cd8fb99aaf 100644 --- a/Projectiles/Melee/Tornado.cs +++ b/Projectiles/Melee/Tornado.cs @@ -172,7 +172,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 sizeModdingPos = new Vector2(0f, sizeModdingVector2.Y - sizeModdingVector.Y); sizeModdingPos.X = sizeModdingPos.Y * vectorMult; new Vector2(sizeModdingVector.X - sizeModdingPos.X / 2f, sizeModdingVector.Y); - Texture2D texture2D23 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture2D23 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle drawRectangle = texture2D23.Frame(1, 1, 0, 0); Vector2 smallRect = drawRectangle.Size() / 2f; float aiTrackMult = -0.06283186f * aiTracker; diff --git a/Projectiles/Melee/TriactisHammerProj.cs b/Projectiles/Melee/TriactisHammerProj.cs index 1c010ff50e..15c555b76b 100644 --- a/Projectiles/Melee/TriactisHammerProj.cs +++ b/Projectiles/Melee/TriactisHammerProj.cs @@ -40,8 +40,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -301,7 +301,7 @@ namespace CalamityMod.Projectiles.Melee return false; } - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/TrueAncientBeam.cs b/Projectiles/Melee/TrueAncientBeam.cs index ac70351edc..1aa7a7af72 100644 --- a/Projectiles/Melee/TrueAncientBeam.cs +++ b/Projectiles/Melee/TrueAncientBeam.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 2; } const float MaxTime = 75; @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > 70) return false; - DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); diff --git a/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs b/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs index dbf5921c89..77452e7e1e 100644 --- a/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs +++ b/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs @@ -33,8 +33,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -133,7 +133,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 drawOrigin = new Vector2(Owner.direction < 0 ? sword.Width : 0f, sword.Height); Vector2 drawOffset = Owner.Center + drawAngle.ToRotationVector2() * 10f - Main.screenPosition; - if (CalamityClientConfig.Instance.Afterimages && Timer > ProjectileID.Sets.TrailCacheLength[Projectile.type]) + if (CalamityClientConfig.Instance.Afterimages && Timer > ProjectileID.Sets.TrailCacheLength[Type]) { for (int i = 0; i < Projectile.oldRot.Length; ++i) { diff --git a/Projectiles/Melee/TrueBiomeBladeHoldout.cs b/Projectiles/Melee/TrueBiomeBladeHoldout.cs index 4dae7e2423..675b93172a 100644 --- a/Projectiles/Melee/TrueBiomeBladeHoldout.cs +++ b/Projectiles/Melee/TrueBiomeBladeHoldout.cs @@ -187,7 +187,7 @@ namespace CalamityMod.Projectiles.Melee if (ChanneledState == 0f && ChannelTimer > 10f) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, lightColor, Projectile.rotation, tex.Size() / 2, 1, 0, 0); return false; @@ -195,7 +195,7 @@ namespace CalamityMod.Projectiles.Melee } else if (ChanneledState == 1f) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 squishyScale = new Vector2(Math.Abs((float)Math.Sin(MathHelper.Pi + MathHelper.TwoPi * Projectile.timeLeft / 30f)), 1f); SpriteEffects flip = (float)Math.Sin(MathHelper.Pi + MathHelper.TwoPi * Projectile.timeLeft / 30f) > 0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; Main.EntitySpriteDraw(tex, Projectile.position - Main.screenPosition, null, lightColor * (Projectile.timeLeft / 60f), 0, tex.Size() / 2, squishyScale * (2f - (Projectile.timeLeft / 60f)), flip, 0); diff --git a/Projectiles/Melee/TrueBiomeBlade_EarthenTidesBeam.cs b/Projectiles/Melee/TrueBiomeBlade_EarthenTidesBeam.cs index 8ab9d6e068..33373afe04 100644 --- a/Projectiles/Melee/TrueBiomeBlade_EarthenTidesBeam.cs +++ b/Projectiles/Melee/TrueBiomeBlade_EarthenTidesBeam.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -101,12 +101,12 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.timeLeft > 145) return false; - DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); Main.spriteBatch.End(); //Yippee wahoo spritebatch restarting! Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Color.Lerp(Color.HotPink, Color.GreenYellow, (float)Math.Sin(Main.GlobalTimeWrappedHourly * 2f)), Projectile.rotation, tex.Size() * 0.5f, 1f, 0f, 0); diff --git a/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs b/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs index fc2fd8d82c..aa7e99784a 100644 --- a/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs +++ b/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs @@ -45,8 +45,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { diff --git a/Projectiles/Melee/TyphonsGreedBubble.cs b/Projectiles/Melee/TyphonsGreedBubble.cs index 057ab4b520..b62d82e9dd 100644 --- a/Projectiles/Melee/TyphonsGreedBubble.cs +++ b/Projectiles/Melee/TyphonsGreedBubble.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } @@ -76,8 +76,8 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), diff --git a/Projectiles/Melee/UrchinMaceProjectile.cs b/Projectiles/Melee/UrchinMaceProjectile.cs index 57a93c8b70..c6a2d9fee3 100644 --- a/Projectiles/Melee/UrchinMaceProjectile.cs +++ b/Projectiles/Melee/UrchinMaceProjectile.cs @@ -144,7 +144,7 @@ namespace CalamityMod.Projectiles.Melee { Owner.ChangeDir(Math.Sign(Owner.Calamity().mouseWorld.X - Owner.position.X)); - Texture2D maceTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D maceTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D whirlpoolTexture = ModContent.Request("CalamityMod/Projectiles/Melee/RedtideWhirlpool").Value; float whirlpoolScale = MathHelper.Clamp(WindupProgress * 3f - 0.4f, 0f, 1f) * 2f; @@ -167,7 +167,7 @@ namespace CalamityMod.Projectiles.Melee //Spawn a whirlpool typhoon after sending it out if (WindupProgress >= 1f && Projectile.owner == Main.myPlayer) { - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, (Main.MouseWorld - Owner.position).SafeNormalize(Vector2.One) * 25f, ModContent.ProjectileType(), (int)(Projectile.damage * whirlpoolDamageMultiplier), Projectile.knockBack, Projectile.owner, 0, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, (Main.MouseWorld - Owner.position).SafeNormalize(Vector2.One) * 25f, ModContent.ProjectileType(), (int)(Projectile.damage * whirlpoolDamageMultiplier), Projectile.knockBack, Projectile.owner, 0, 0f); } SoundEngine.PlaySound(SoundID.Item7, Projectile.position); diff --git a/Projectiles/Melee/UrchinSpikeFugu.cs b/Projectiles/Melee/UrchinSpikeFugu.cs index 667a5789f9..89652246eb 100644 --- a/Projectiles/Melee/UrchinSpikeFugu.cs +++ b/Projectiles/Melee/UrchinSpikeFugu.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() diff --git a/Projectiles/Melee/ViolenceSlashProjectile.cs b/Projectiles/Melee/ViolenceSlashProjectile.cs index 7d888bd361..88203f77a0 100644 --- a/Projectiles/Melee/ViolenceSlashProjectile.cs +++ b/Projectiles/Melee/ViolenceSlashProjectile.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Projectiles.Melee public override string Texture => "CalamityMod/Items/Weapons/Melee/Violence"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 36; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 36; } public override void SetDefaults() @@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Melee { GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/SwordSlashTexture")); - Texture2D spearProjectile = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D spearProjectile = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Player player = Main.player[Projectile.owner]; List positions = new List(); diff --git a/Projectiles/Melee/ViolenceThrownProjectile.cs b/Projectiles/Melee/ViolenceThrownProjectile.cs index 393fc828d1..4879094cc4 100644 --- a/Projectiles/Melee/ViolenceThrownProjectile.cs +++ b/Projectiles/Melee/ViolenceThrownProjectile.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Projectiles.Melee public override string Texture => "CalamityMod/Items/Weapons/Melee/Violence"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 36; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 36; } public override void SetDefaults() @@ -199,7 +199,7 @@ namespace CalamityMod.Projectiles.Melee { GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/FabstaffStreak")); - Texture2D spearProjectile = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D spearProjectile = Terraria.GameContent.TextureAssets.Projectile[Type].Value; // Not cloning the points causes the below operations to be applied to the original oldPos value by reference // and thus causes it to be consistently added over and over, which is not intended behavior. diff --git a/Projectiles/Melee/VirulentWave.cs b/Projectiles/Melee/VirulentWave.cs index 4f8ce857f1..5f713dd71e 100644 --- a/Projectiles/Melee/VirulentWave.cs +++ b/Projectiles/Melee/VirulentWave.cs @@ -10,9 +10,9 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Melee/VoidEssence.cs b/Projectiles/Melee/VoidEssence.cs index e3d8dc1dd5..047bad504b 100644 --- a/Projectiles/Melee/VoidEssence.cs +++ b/Projectiles/Melee/VoidEssence.cs @@ -18,10 +18,10 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = NumAnimationFrames; + Main.projFrames[Type] = NumAnimationFrames; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -127,7 +127,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/VolcanicFireball.cs b/Projectiles/Melee/VolcanicFireball.cs index 6386cef05d..16215da6ae 100644 --- a/Projectiles/Melee/VolcanicFireball.cs +++ b/Projectiles/Melee/VolcanicFireball.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Melee/VolcanicFireballLarge.cs b/Projectiles/Melee/VolcanicFireballLarge.cs index c031cf1664..690b93fada 100644 --- a/Projectiles/Melee/VolcanicFireballLarge.cs +++ b/Projectiles/Melee/VolcanicFireballLarge.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Melee/WulfrumScrew.cs b/Projectiles/Melee/WulfrumScrew.cs index 263a358bd3..f45e68d8d1 100644 --- a/Projectiles/Melee/WulfrumScrew.cs +++ b/Projectiles/Melee/WulfrumScrew.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 60; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 60; + ProjectileID.Sets.TrailingMode[Type] = 0; } public static int Lifetime = 950; @@ -151,7 +151,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; float distanceFromAim = Projectile.Center.ShortestDistanceToLine(Owner.MountedCenter, Main.MouseWorld); float distanceFromPlayerAcrossSightLine = (Owner.MountedCenter - Projectile.Center.ClosestPointOnLine(Owner.MountedCenter, Main.MouseWorld)).Length(); diff --git a/Projectiles/Melee/WulfrumScrewdriverProj.cs b/Projectiles/Melee/WulfrumScrewdriverProj.cs index 1f76e30360..200b137924 100644 --- a/Projectiles/Melee/WulfrumScrewdriverProj.cs +++ b/Projectiles/Melee/WulfrumScrewdriverProj.cs @@ -212,7 +212,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (SmearTex == null) SmearTex = ModContent.Request("CalamityMod/Particles/MediumLongThrust"); diff --git a/Projectiles/Melee/YinYoDark.cs b/Projectiles/Melee/YinYoDark.cs index f4a3ad684b..51cdfe150d 100644 --- a/Projectiles/Melee/YinYoDark.cs +++ b/Projectiles/Melee/YinYoDark.cs @@ -8,11 +8,12 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; private const int speedTimerMax = 30; private int speedTimer = speedTimerMax; + public override string Texture => "Terraria/Images/Item_527"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -41,7 +42,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Melee/YinYoDark.png b/Projectiles/Melee/YinYoDark.png deleted file mode 100644 index 7f62b3dfe7..0000000000 Binary files a/Projectiles/Melee/YinYoDark.png and /dev/null differ diff --git a/Projectiles/Melee/YinYoLight.cs b/Projectiles/Melee/YinYoLight.cs index 13a31524b7..57610ed4d3 100644 --- a/Projectiles/Melee/YinYoLight.cs +++ b/Projectiles/Melee/YinYoLight.cs @@ -8,11 +8,12 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; private const int speedTimerMax = 30; private int speedTimer = 0; + public override string Texture => "Terraria/Images/Item_528"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -41,7 +42,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Melee/YinYoLight.png b/Projectiles/Melee/YinYoLight.png deleted file mode 100644 index 90c73a1903..0000000000 Binary files a/Projectiles/Melee/YinYoLight.png and /dev/null differ diff --git a/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs b/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs index f43f41c800..a0f3ab6cc9 100644 --- a/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs +++ b/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs @@ -14,12 +14,12 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void SetStaticDefaults() { - ProjectileID.Sets.YoyosLifeTimeMultiplier[Projectile.type] = 30f * MaxUpdates; - ProjectileID.Sets.YoyosMaximumRange[Projectile.type] = 330f; - ProjectileID.Sets.YoyosTopSpeed[Projectile.type] = 32f / MaxUpdates; + ProjectileID.Sets.YoyosLifeTimeMultiplier[Type] = 30f * MaxUpdates; + ProjectileID.Sets.YoyosMaximumRange[Type] = 330f; + ProjectileID.Sets.YoyosTopSpeed[Type] = 32f / MaxUpdates; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Melee/Yoyos/AortaYoyo.cs b/Projectiles/Melee/Yoyos/AortaYoyo.cs index 64dd6c5d35..4ede694904 100644 --- a/Projectiles/Melee/Yoyos/AortaYoyo.cs +++ b/Projectiles/Melee/Yoyos/AortaYoyo.cs @@ -15,12 +15,12 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void SetStaticDefaults() { - ProjectileID.Sets.YoyosLifeTimeMultiplier[Projectile.type] = 24f * MaxUpdates; - ProjectileID.Sets.YoyosMaximumRange[Projectile.type] = 330f; - ProjectileID.Sets.YoyosTopSpeed[Projectile.type] = 25f / MaxUpdates; + ProjectileID.Sets.YoyosLifeTimeMultiplier[Type] = 24f * MaxUpdates; + ProjectileID.Sets.YoyosMaximumRange[Type] = 330f; + ProjectileID.Sets.YoyosTopSpeed[Type] = 25f / MaxUpdates; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Melee/Yoyos/AzathothYoyo.cs b/Projectiles/Melee/Yoyos/AzathothYoyo.cs index 2f99f79c09..2bd20fd772 100644 --- a/Projectiles/Melee/Yoyos/AzathothYoyo.cs +++ b/Projectiles/Melee/Yoyos/AzathothYoyo.cs @@ -14,12 +14,12 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void SetStaticDefaults() { - ProjectileID.Sets.YoyosLifeTimeMultiplier[Projectile.type] = -1f; - ProjectileID.Sets.YoyosMaximumRange[Projectile.type] = 880f; - ProjectileID.Sets.YoyosTopSpeed[Projectile.type] = 60f / MaxUpdates; + ProjectileID.Sets.YoyosLifeTimeMultiplier[Type] = -1f; + ProjectileID.Sets.YoyosMaximumRange[Type] = 880f; + ProjectileID.Sets.YoyosTopSpeed[Type] = 60f / MaxUpdates; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Melee/Yoyos/BurningRevelationYoyo.cs b/Projectiles/Melee/Yoyos/BurningRevelationYoyo.cs index c1b176f8e6..3c498738c9 100644 --- a/Projectiles/Melee/Yoyos/BurningRevelationYoyo.cs +++ b/Projectiles/Melee/Yoyos/BurningRevelationYoyo.cs @@ -16,12 +16,12 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void SetStaticDefaults() { - ProjectileID.Sets.YoyosLifeTimeMultiplier[Projectile.type] = -1f; - ProjectileID.Sets.YoyosMaximumRange[Projectile.type] = 560f; - ProjectileID.Sets.YoyosTopSpeed[Projectile.type] = 54f / MaxUpdates; + ProjectileID.Sets.YoyosLifeTimeMultiplier[Type] = -1f; + ProjectileID.Sets.YoyosMaximumRange[Type] = 560f; + ProjectileID.Sets.YoyosTopSpeed[Type] = 54f / MaxUpdates; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Melee/Yoyos/FaultLineYoyo.cs b/Projectiles/Melee/Yoyos/FaultLineYoyo.cs index 2a8f012961..0efc358a1f 100644 --- a/Projectiles/Melee/Yoyos/FaultLineYoyo.cs +++ b/Projectiles/Melee/Yoyos/FaultLineYoyo.cs @@ -15,12 +15,12 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void SetStaticDefaults() { - ProjectileID.Sets.YoyosLifeTimeMultiplier[Projectile.type] = -1f; - ProjectileID.Sets.YoyosMaximumRange[Projectile.type] = 480f; - ProjectileID.Sets.YoyosTopSpeed[Projectile.type] = 40f / MaxUpdates; + ProjectileID.Sets.YoyosLifeTimeMultiplier[Type] = -1f; + ProjectileID.Sets.YoyosMaximumRange[Type] = 480f; + ProjectileID.Sets.YoyosTopSpeed[Type] = 40f / MaxUpdates; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Melee/Yoyos/GodsGambitYoyo.cs b/Projectiles/Melee/Yoyos/GodsGambitYoyo.cs index 986d085580..2eee2ebee7 100644 --- a/Projectiles/Melee/Yoyos/GodsGambitYoyo.cs +++ b/Projectiles/Melee/Yoyos/GodsGambitYoyo.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void SetStaticDefaults() { - ProjectileID.Sets.YoyosLifeTimeMultiplier[Projectile.type] = -1f; - ProjectileID.Sets.YoyosMaximumRange[Projectile.type] = 400f; - ProjectileID.Sets.YoyosTopSpeed[Projectile.type] = 32f / MaxUpdates; + ProjectileID.Sets.YoyosLifeTimeMultiplier[Type] = -1f; + ProjectileID.Sets.YoyosMaximumRange[Type] = 400f; + ProjectileID.Sets.YoyosTopSpeed[Type] = 32f / MaxUpdates; } public override void SetDefaults() @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Melee/Yoyos/LaceratorYoyo.cs b/Projectiles/Melee/Yoyos/LaceratorYoyo.cs index 16bcd345fd..6a6dcd51f9 100644 --- a/Projectiles/Melee/Yoyos/LaceratorYoyo.cs +++ b/Projectiles/Melee/Yoyos/LaceratorYoyo.cs @@ -15,12 +15,12 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void SetStaticDefaults() { - ProjectileID.Sets.YoyosLifeTimeMultiplier[Projectile.type] = -1f; - ProjectileID.Sets.YoyosMaximumRange[Projectile.type] = 640f; - ProjectileID.Sets.YoyosTopSpeed[Projectile.type] = 48f / MaxUpdates; + ProjectileID.Sets.YoyosLifeTimeMultiplier[Type] = -1f; + ProjectileID.Sets.YoyosMaximumRange[Type] = 640f; + ProjectileID.Sets.YoyosTopSpeed[Type] = 48f / MaxUpdates; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Melee/Yoyos/MicrowaveYoyo.cs b/Projectiles/Melee/Yoyos/MicrowaveYoyo.cs index d77d1ab63c..9fd8eba495 100644 --- a/Projectiles/Melee/Yoyos/MicrowaveYoyo.cs +++ b/Projectiles/Melee/Yoyos/MicrowaveYoyo.cs @@ -24,12 +24,12 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void SetStaticDefaults() { - ProjectileID.Sets.YoyosLifeTimeMultiplier[Projectile.type] = -1f; - ProjectileID.Sets.YoyosMaximumRange[Projectile.type] = 512f; - ProjectileID.Sets.YoyosTopSpeed[Projectile.type] = 54f / MaxUpdates; + ProjectileID.Sets.YoyosLifeTimeMultiplier[Type] = -1f; + ProjectileID.Sets.YoyosMaximumRange[Type] = 512f; + ProjectileID.Sets.YoyosTopSpeed[Type] = 54f / MaxUpdates; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -116,7 +116,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs b/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs index 4676977462..def2f76387 100644 --- a/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs +++ b/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs @@ -27,12 +27,12 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void SetStaticDefaults() { - ProjectileID.Sets.YoyosLifeTimeMultiplier[Projectile.type] = -1f; - ProjectileID.Sets.YoyosMaximumRange[Projectile.type] = 720f; - ProjectileID.Sets.YoyosTopSpeed[Projectile.type] = 54f / UpdatesPerFrame; + ProjectileID.Sets.YoyosLifeTimeMultiplier[Type] = -1f; + ProjectileID.Sets.YoyosMaximumRange[Type] = 720f; + ProjectileID.Sets.YoyosTopSpeed[Type] = 54f / UpdatesPerFrame; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -137,7 +137,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/Yoyos/OblivionYoyo.cs b/Projectiles/Melee/Yoyos/OblivionYoyo.cs index ded14484d2..072661bdad 100644 --- a/Projectiles/Melee/Yoyos/OblivionYoyo.cs +++ b/Projectiles/Melee/Yoyos/OblivionYoyo.cs @@ -16,12 +16,12 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void SetStaticDefaults() { - ProjectileID.Sets.YoyosLifeTimeMultiplier[Projectile.type] = -1f; - ProjectileID.Sets.YoyosMaximumRange[Projectile.type] = 512f; - ProjectileID.Sets.YoyosTopSpeed[Projectile.type] = 36f / MaxUpdates; + ProjectileID.Sets.YoyosLifeTimeMultiplier[Type] = -1f; + ProjectileID.Sets.YoyosMaximumRange[Type] = 512f; + ProjectileID.Sets.YoyosTopSpeed[Type] = 36f / MaxUpdates; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Melee/Yoyos/OracleYoyo.cs b/Projectiles/Melee/Yoyos/OracleYoyo.cs index db442ce25f..b34a655cf9 100644 --- a/Projectiles/Melee/Yoyos/OracleYoyo.cs +++ b/Projectiles/Melee/Yoyos/OracleYoyo.cs @@ -52,12 +52,12 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void SetStaticDefaults() { - ProjectileID.Sets.YoyosLifeTimeMultiplier[Projectile.type] = -1f; - ProjectileID.Sets.YoyosMaximumRange[Projectile.type] = 800f; - ProjectileID.Sets.YoyosTopSpeed[Projectile.type] = 60f / UpdatesPerFrame; + ProjectileID.Sets.YoyosLifeTimeMultiplier[Type] = -1f; + ProjectileID.Sets.YoyosMaximumRange[Type] = 800f; + ProjectileID.Sets.YoyosTopSpeed[Type] = 60f / UpdatesPerFrame; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SendExtraAI(BinaryWriter writer) @@ -210,7 +210,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Melee/Yoyos/PandemicYoyo.cs b/Projectiles/Melee/Yoyos/PandemicYoyo.cs index bb0ac459d2..462b04a0f6 100644 --- a/Projectiles/Melee/Yoyos/PandemicYoyo.cs +++ b/Projectiles/Melee/Yoyos/PandemicYoyo.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public const int MaxUpdates = 2; public override void SetStaticDefaults() { - ProjectileID.Sets.YoyosLifeTimeMultiplier[Projectile.type] = -1f; - ProjectileID.Sets.YoyosMaximumRange[Projectile.type] = 480f; - ProjectileID.Sets.YoyosTopSpeed[Projectile.type] = 40f / MaxUpdates; + ProjectileID.Sets.YoyosLifeTimeMultiplier[Type] = -1f; + ProjectileID.Sets.YoyosMaximumRange[Type] = 480f; + ProjectileID.Sets.YoyosTopSpeed[Type] = 40f / MaxUpdates; } public override void SetDefaults() @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Melee/Yoyos/QuagmireYoyo.cs b/Projectiles/Melee/Yoyos/QuagmireYoyo.cs index 281c95a226..14b9c77152 100644 --- a/Projectiles/Melee/Yoyos/QuagmireYoyo.cs +++ b/Projectiles/Melee/Yoyos/QuagmireYoyo.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void SetStaticDefaults() { - ProjectileID.Sets.YoyosLifeTimeMultiplier[Projectile.type] = -1f; - ProjectileID.Sets.YoyosMaximumRange[Projectile.type] = 480f; - ProjectileID.Sets.YoyosTopSpeed[Projectile.type] = 36f / MaxUpdates; + ProjectileID.Sets.YoyosLifeTimeMultiplier[Type] = -1f; + ProjectileID.Sets.YoyosMaximumRange[Type] = 480f; + ProjectileID.Sets.YoyosTopSpeed[Type] = 36f / MaxUpdates; } public override void SetDefaults() @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Melee/Yoyos/RiptideYoyo.cs b/Projectiles/Melee/Yoyos/RiptideYoyo.cs index 464e265922..caa23fdf28 100644 --- a/Projectiles/Melee/Yoyos/RiptideYoyo.cs +++ b/Projectiles/Melee/Yoyos/RiptideYoyo.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void SetStaticDefaults() { - ProjectileID.Sets.YoyosLifeTimeMultiplier[Projectile.type] = 18f; - ProjectileID.Sets.YoyosMaximumRange[Projectile.type] = 288f; - ProjectileID.Sets.YoyosTopSpeed[Projectile.type] = 25f; + ProjectileID.Sets.YoyosLifeTimeMultiplier[Type] = 18f; + ProjectileID.Sets.YoyosMaximumRange[Type] = 288f; + ProjectileID.Sets.YoyosTopSpeed[Type] = 25f; } public override void SetDefaults() diff --git a/Projectiles/Melee/Yoyos/ShimmersparkYoyo.cs b/Projectiles/Melee/Yoyos/ShimmersparkYoyo.cs index df7f2d90c3..9e3a335dc1 100644 --- a/Projectiles/Melee/Yoyos/ShimmersparkYoyo.cs +++ b/Projectiles/Melee/Yoyos/ShimmersparkYoyo.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void SetStaticDefaults() { - ProjectileID.Sets.YoyosLifeTimeMultiplier[Projectile.type] = -1f; - ProjectileID.Sets.YoyosMaximumRange[Projectile.type] = 448f; - ProjectileID.Sets.YoyosTopSpeed[Projectile.type] = 36f / MaxUpdates; + ProjectileID.Sets.YoyosLifeTimeMultiplier[Type] = -1f; + ProjectileID.Sets.YoyosMaximumRange[Type] = 448f; + ProjectileID.Sets.YoyosTopSpeed[Type] = 36f / MaxUpdates; } public override void SetDefaults() @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Melee/Yoyos/SmokingCometYoyo.cs b/Projectiles/Melee/Yoyos/SmokingCometYoyo.cs index 11fbb9e90f..785fa38aa9 100644 --- a/Projectiles/Melee/Yoyos/SmokingCometYoyo.cs +++ b/Projectiles/Melee/Yoyos/SmokingCometYoyo.cs @@ -16,12 +16,12 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void SetStaticDefaults() { - ProjectileID.Sets.YoyosLifeTimeMultiplier[Projectile.type] = 21f; - ProjectileID.Sets.YoyosMaximumRange[Projectile.type] = 320f; - ProjectileID.Sets.YoyosTopSpeed[Projectile.type] = 20f; + ProjectileID.Sets.YoyosLifeTimeMultiplier[Type] = 21f; + ProjectileID.Sets.YoyosMaximumRange[Type] = 320f; + ProjectileID.Sets.YoyosTopSpeed[Type] = 20f; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -180,7 +180,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos Main.spriteBatch.Draw(stringTexture, new Vector2(vector.X - Main.screenPosition.X + (float)ModContent.Request("CalamityMod/Projectiles/Melee/Yoyos/SmokingCometChain").Width() * 0.5f, vector.Y - Main.screenPosition.Y + (float)ModContent.Request("CalamityMod/Projectiles/Melee/Yoyos/SmokingCometChain").Height() * 0.5f) - new Vector2(6f, 0f), new Rectangle(0, 0, ModContent.Request("CalamityMod/Projectiles/Melee/Yoyos/SmokingCometChain").Width(), (int)chainWidth), Color.White, stringHelper, new Vector2((float)ModContent.Request("CalamityMod/Projectiles/Melee/Yoyos/SmokingCometChain").Width() * 0.5f, 0f), 1f, SpriteEffects.None, 0f); } - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Melee/Yoyos/SulphurousGrabberYoyo.cs b/Projectiles/Melee/Yoyos/SulphurousGrabberYoyo.cs index d47df05a8d..893686cc9a 100644 --- a/Projectiles/Melee/Yoyos/SulphurousGrabberYoyo.cs +++ b/Projectiles/Melee/Yoyos/SulphurousGrabberYoyo.cs @@ -20,12 +20,12 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void SetStaticDefaults() { - ProjectileID.Sets.YoyosLifeTimeMultiplier[Projectile.type] = -1f; - ProjectileID.Sets.YoyosMaximumRange[Projectile.type] = 400f; - ProjectileID.Sets.YoyosTopSpeed[Projectile.type] = 16f; // 32 effective, 48 bubbled + ProjectileID.Sets.YoyosLifeTimeMultiplier[Type] = -1f; + ProjectileID.Sets.YoyosMaximumRange[Type] = 400f; + ProjectileID.Sets.YoyosTopSpeed[Type] = 16f; // 32 effective, 48 bubbled - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -97,12 +97,12 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); if (bubbleStronk) { tex = ModContent.Request("CalamityMod/Projectiles/Melee/Yoyos/SulphurousGrabberYoyoBubble").Value; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, tex); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1, tex); } return false; } diff --git a/Projectiles/Melee/Yoyos/YinYoyo.cs b/Projectiles/Melee/Yoyos/YinYoyo.cs index 0dae90d883..e977ac6a72 100644 --- a/Projectiles/Melee/Yoyos/YinYoyo.cs +++ b/Projectiles/Melee/Yoyos/YinYoyo.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void SetStaticDefaults() { - ProjectileID.Sets.YoyosLifeTimeMultiplier[Projectile.type] = -1f; - ProjectileID.Sets.YoyosMaximumRange[Projectile.type] = 400f; - ProjectileID.Sets.YoyosTopSpeed[Projectile.type] = 32f / MaxUpdates; + ProjectileID.Sets.YoyosLifeTimeMultiplier[Type] = -1f; + ProjectileID.Sets.YoyosMaximumRange[Type] = 400f; + ProjectileID.Sets.YoyosTopSpeed[Type] = 32f / MaxUpdates; } public override void SetDefaults() @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Pets/Akato.cs b/Projectiles/Pets/Akato.cs index a7e6431f73..7f422f60b0 100644 --- a/Projectiles/Pets/Akato.cs +++ b/Projectiles/Pets/Akato.cs @@ -10,10 +10,10 @@ namespace CalamityMod.Projectiles.Pets public new string LocalizationCategory => "Projectiles.Pets"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - Main.projPet[Projectile.type] = true; + Main.projFrames[Type] = 6; + Main.projPet[Type] = true; - ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6) + ProjectileID.Sets.CharacterPreviewAnimations[Type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Type], 6) .WithOffset(-38f, 0f).WithSpriteDirection(1).WhenNotSelected(0, 0); } diff --git a/Projectiles/Pets/Astrophage.cs b/Projectiles/Pets/Astrophage.cs index b44752567f..081821e8f7 100644 --- a/Projectiles/Pets/Astrophage.cs +++ b/Projectiles/Pets/Astrophage.cs @@ -13,10 +13,10 @@ namespace CalamityMod.Projectiles.Pets public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - Main.projPet[Projectile.type] = true; + Main.projFrames[Type] = 5; + Main.projPet[Type] = true; - ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6) + ProjectileID.Sets.CharacterPreviewAnimations[Type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Type], 6) .WithOffset(-10f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } diff --git a/Projectiles/Pets/BabyGhostBell.cs b/Projectiles/Pets/BabyGhostBell.cs index 9af28bf336..ec696d2407 100644 --- a/Projectiles/Pets/BabyGhostBell.cs +++ b/Projectiles/Pets/BabyGhostBell.cs @@ -11,9 +11,9 @@ namespace CalamityMod.Projectiles.Pets public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - Main.projPet[Projectile.type] = true; - ProjectileID.Sets.LightPet[Projectile.type] = true; + Main.projFrames[Type] = 4; + Main.projPet[Type] = true; + ProjectileID.Sets.LightPet[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Pets/Bear.cs b/Projectiles/Pets/Bear.cs index b07928bc79..1219fbbc89 100644 --- a/Projectiles/Pets/Bear.cs +++ b/Projectiles/Pets/Bear.cs @@ -18,10 +18,10 @@ namespace CalamityMod.Projectiles.Pets public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 22; - Main.projPet[Projectile.type] = true; + Main.projFrames[Type] = 22; + Main.projPet[Type] = true; - ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 13, 6) + ProjectileID.Sets.CharacterPreviewAnimations[Type] = ProjectileID.Sets.SimpleLoop(0, 13, 6) .WithOffset(-20f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } diff --git a/Projectiles/Pets/BendyPet.cs b/Projectiles/Pets/BendyPet.cs index 5d5d505804..75c302d373 100644 --- a/Projectiles/Pets/BendyPet.cs +++ b/Projectiles/Pets/BendyPet.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Projectiles.Pets public new string LocalizationCategory => "Projectiles.Pets"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - Main.projPet[Projectile.type] = true; - ProjectileID.Sets.LightPet[Projectile.type] = true; + Main.projFrames[Type] = 5; + Main.projPet[Type] = true; + ProjectileID.Sets.LightPet[Type] = true; } public override void SetDefaults() @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Pets Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -223,8 +223,8 @@ namespace CalamityMod.Projectiles.Pets public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int height = texture.Height / Main.projFrames[Type]; int frameHeight = height * Projectile.frame; SpriteEffects spriteEffects = SpriteEffects.None; if (Projectile.spriteDirection == -1) @@ -236,7 +236,7 @@ namespace CalamityMod.Projectiles.Pets public override void PostDraw(Color lightColor) { Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Pets/BendyPetGlow").Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + int height = texture.Height / Main.projFrames[Type]; int frameHeight = height * Projectile.frame; SpriteEffects spriteEffects = SpriteEffects.None; if (Projectile.spriteDirection == -1) diff --git a/Projectiles/Pets/BrimlingPet.cs b/Projectiles/Pets/BrimlingPet.cs index fd95edd8ed..8b7e5d7d9c 100644 --- a/Projectiles/Pets/BrimlingPet.cs +++ b/Projectiles/Pets/BrimlingPet.cs @@ -13,10 +13,10 @@ namespace CalamityMod.Projectiles.Pets public new string LocalizationCategory => "Projectiles.Pets"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 8; - Main.projPet[Projectile.type] = true; + Main.projFrames[Type] = 8; + Main.projPet[Type] = true; - ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 4, 5) + ProjectileID.Sets.CharacterPreviewAnimations[Type] = ProjectileID.Sets.SimpleLoop(0, 4, 5) .WithOffset(-25f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } diff --git a/Projectiles/Pets/ChibiiDoggo.cs b/Projectiles/Pets/ChibiiDoggo.cs index 9954324dac..95ea59780d 100644 --- a/Projectiles/Pets/ChibiiDoggo.cs +++ b/Projectiles/Pets/ChibiiDoggo.cs @@ -20,12 +20,12 @@ namespace CalamityMod.Projectiles.Pets public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 11; //same as black cat - Main.projPet[Projectile.type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + Main.projFrames[Type] = 11; //same as black cat + Main.projPet[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; - ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6) + ProjectileID.Sets.CharacterPreviewAnimations[Type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Type], 6) .WithOffset(-7f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Pets spriteEffects = SpriteEffects.FlipHorizontally; Color colorArea = Lighting.GetColor((int)(Projectile.Center.X / 16), (int)(Projectile.Center.Y / 16)); Texture2D texture2D3 = ModContent.Request("CalamityMod/Projectiles/Pets/ChibiiDoggoMonochrome").Value; - int textureArea = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + int textureArea = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y3 = textureArea * Projectile.frame; Rectangle rectangle = new Rectangle(0, y3, texture2D3.Width, textureArea); Vector2 halfRect = rectangle.Size() / 2f; @@ -75,14 +75,14 @@ IL_6899: { trailColorChange = (float)(1 - counter); } - colorAlpha *= trailColorChange / ((float)ProjectileID.Sets.TrailCacheLength[Projectile.type] * 1.5f); + colorAlpha *= trailColorChange / ((float)ProjectileID.Sets.TrailCacheLength[Type] * 1.5f); Vector2 oldDrawPos = Projectile.oldPos[counter]; float projRotate = Projectile.rotation; SpriteEffects effects = spriteEffects; Main.spriteBatch.Draw(texture2D3, oldDrawPos + Projectile.Size / 2f - Main.screenPosition + new Vector2(0, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), colorAlpha, projRotate + Projectile.rotation * 0f * (float)(counter - 1) * Projectile.spriteDirection, halfRect, Projectile.scale, effects, 0f); goto IL_6881; } - Main.spriteBatch.Draw(Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value, Projectile.position + Projectile.Size / 2f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), lightColor, Projectile.rotation, halfRect, Projectile.scale, spriteEffects, 0); + Main.spriteBatch.Draw(Terraria.GameContent.TextureAssets.Projectile[Type].Value, Projectile.position + Projectile.Size / 2f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), lightColor, Projectile.rotation, halfRect, Projectile.scale, spriteEffects, 0); return false; } diff --git a/Projectiles/Pets/ChibiiDoggoFly.cs b/Projectiles/Pets/ChibiiDoggoFly.cs index b726b1f09f..2775e51300 100644 --- a/Projectiles/Pets/ChibiiDoggoFly.cs +++ b/Projectiles/Pets/ChibiiDoggoFly.cs @@ -11,9 +11,9 @@ namespace CalamityMod.Projectiles.Pets public new string LocalizationCategory => "Projectiles.Pets"; public override void SetStaticDefaults() { - Main.projPet[Projectile.type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 12; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + Main.projPet[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 12; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Pets spriteEffects = SpriteEffects.FlipHorizontally; Color colorArea = Lighting.GetColor((int)(Projectile.Center.X / 16), (int)(Projectile.Center.Y / 16)); Texture2D texture2D3 = ModContent.Request("CalamityMod/Projectiles/Pets/ChibiiDoggoFlyMonochrome").Value; - int textureArea = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + int textureArea = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y3 = textureArea * Projectile.frame; Rectangle rectangle = new Rectangle(0, y3, texture2D3.Width, textureArea); Vector2 origin2 = rectangle.Size() / 2f; @@ -58,14 +58,14 @@ IL_6899: { trailColorChange = (float)(1 - counter); } - colorAlpha *= trailColorChange / ((float)ProjectileID.Sets.TrailCacheLength[Projectile.type] * 1.5f); + colorAlpha *= trailColorChange / ((float)ProjectileID.Sets.TrailCacheLength[Type] * 1.5f); Vector2 oldDrawPos = Projectile.oldPos[counter]; float projRotate = Projectile.rotation; SpriteEffects effects = spriteEffects; Main.spriteBatch.Draw(texture2D3, oldDrawPos + Projectile.Size / 2f - Main.screenPosition + new Vector2(0, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), colorAlpha, projRotate + Projectile.rotation * 0f * (float)(counter - 1) * Projectile.spriteDirection, origin2, Projectile.scale, effects, 0f); goto IL_6881; } - Main.spriteBatch.Draw(Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value, Projectile.position + Projectile.Size / 2f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), lightColor, Projectile.rotation, origin2, Projectile.scale, spriteEffects, 0); + Main.spriteBatch.Draw(Terraria.GameContent.TextureAssets.Projectile[Type].Value, Projectile.position + Projectile.Size / 2f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), lightColor, Projectile.rotation, origin2, Projectile.scale, spriteEffects, 0); return false; } diff --git a/Projectiles/Pets/DannyDevitoPet.cs b/Projectiles/Pets/DannyDevitoPet.cs index 43b6b5f3f1..a57bd3e2d5 100644 --- a/Projectiles/Pets/DannyDevitoPet.cs +++ b/Projectiles/Pets/DannyDevitoPet.cs @@ -15,10 +15,10 @@ namespace CalamityMod.Projectiles.Pets public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 8; - Main.projPet[Projectile.type] = true; + Main.projFrames[Type] = 8; + Main.projPet[Type] = true; - ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(2, 5, 5) + ProjectileID.Sets.CharacterPreviewAnimations[Type] = ProjectileID.Sets.SimpleLoop(2, 5, 5) .WithOffset(-12f, 2f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } diff --git a/Projectiles/Pets/EidolonSnail.cs b/Projectiles/Pets/EidolonSnail.cs index 5e1e05f16b..7e8f2c8910 100644 --- a/Projectiles/Pets/EidolonSnail.cs +++ b/Projectiles/Pets/EidolonSnail.cs @@ -17,10 +17,10 @@ namespace CalamityMod.Projectiles.Pets public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 12; - Main.projPet[Projectile.type] = true; + Main.projFrames[Type] = 12; + Main.projPet[Type] = true; - ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 4, 5) + ProjectileID.Sets.CharacterPreviewAnimations[Type] = ProjectileID.Sets.SimpleLoop(0, 4, 5) .WithOffset(-18f, 0f).WithSpriteDirection(1).WhenNotSelected(0, 0); } @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Pets { Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Pets/EidolonSnail").Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + int height = texture.Height / Main.projFrames[Type]; int frameHeight = height * Projectile.frame; SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Pets { Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Pets/EidolonSnailGlow").Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + int height = texture.Height / Main.projFrames[Type]; int frameHeight = height * Projectile.frame; SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; diff --git a/Projectiles/Pets/FlakPet.cs b/Projectiles/Pets/FlakPet.cs index 2f60ed8740..afdace01c1 100644 --- a/Projectiles/Pets/FlakPet.cs +++ b/Projectiles/Pets/FlakPet.cs @@ -17,10 +17,10 @@ namespace CalamityMod.Projectiles.Pets public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 7; - Main.projPet[Projectile.type] = true; + Main.projFrames[Type] = 7; + Main.projPet[Type] = true; - ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(2, 4, 6) + ProjectileID.Sets.CharacterPreviewAnimations[Type] = ProjectileID.Sets.SimpleLoop(2, 4, 6) .WithOffset(-7f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } diff --git a/Projectiles/Pets/FoxPet.cs b/Projectiles/Pets/FoxPet.cs index 3dafc5d4bd..148b6862f5 100644 --- a/Projectiles/Pets/FoxPet.cs +++ b/Projectiles/Pets/FoxPet.cs @@ -10,10 +10,10 @@ namespace CalamityMod.Projectiles.Pets public new string LocalizationCategory => "Projectiles.Pets"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 11; - Main.projPet[Projectile.type] = true; + Main.projFrames[Type] = 11; + Main.projPet[Type] = true; - ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 7, 6) + ProjectileID.Sets.CharacterPreviewAnimations[Type] = ProjectileID.Sets.SimpleLoop(0, 7, 6) .WithOffset(-35f, 0f).WithSpriteDirection(1).WhenNotSelected(0, 0); } diff --git a/Projectiles/Pets/GoldiePet.cs b/Projectiles/Pets/GoldiePet.cs index 1479dff3f8..3fc1a3d6ee 100644 --- a/Projectiles/Pets/GoldiePet.cs +++ b/Projectiles/Pets/GoldiePet.cs @@ -20,9 +20,9 @@ namespace CalamityMod.Projectiles.Pets public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - Main.projPet[Projectile.type] = true; - ProjectileID.Sets.LightPet[Projectile.type] = true; + Main.projFrames[Type] = 5; + Main.projPet[Type] = true; + ProjectileID.Sets.LightPet[Type] = true; } public override void SetDefaults() @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Pets return; Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Type]; Lighting.AddLight(Projectile.Center, GoldColor.ToVector3() * (0.9f + 0.45f * SparkleTimer / MaxSparkleTime)); if (SparkleTimer < MaxBloomTime) diff --git a/Projectiles/Pets/KendraPet.cs b/Projectiles/Pets/KendraPet.cs index c05c9a6eeb..417fb901bf 100644 --- a/Projectiles/Pets/KendraPet.cs +++ b/Projectiles/Pets/KendraPet.cs @@ -22,10 +22,10 @@ namespace CalamityMod.Projectiles.Pets public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 31; - Main.projPet[Projectile.type] = true; + Main.projFrames[Type] = 31; + Main.projPet[Type] = true; - ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 13, 6) + ProjectileID.Sets.CharacterPreviewAnimations[Type] = ProjectileID.Sets.SimpleLoop(0, 13, 6) .WithOffset(-30f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } @@ -354,8 +354,8 @@ namespace CalamityMod.Projectiles.Pets public override bool PreDraw(ref Color lightColor) { SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, spriteEffects, 0); return false; diff --git a/Projectiles/Pets/LadShark.cs b/Projectiles/Pets/LadShark.cs index ca68ec4c9c..314e849006 100644 --- a/Projectiles/Pets/LadShark.cs +++ b/Projectiles/Pets/LadShark.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Projectiles.Pets public new string LocalizationCategory => "Projectiles.Pets"; public override void SetStaticDefaults() { - Main.projPet[Projectile.type] = true; + Main.projPet[Type] = true; - ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 0, 1) + ProjectileID.Sets.CharacterPreviewAnimations[Type] = ProjectileID.Sets.SimpleLoop(0, 0, 1) .WithOffset(-12f, -12f).WithSpriteDirection(-1); } diff --git a/Projectiles/Pets/LeviPet.cs b/Projectiles/Pets/LeviPet.cs index d7505a1750..dcf9d60e09 100644 --- a/Projectiles/Pets/LeviPet.cs +++ b/Projectiles/Pets/LeviPet.cs @@ -10,10 +10,10 @@ namespace CalamityMod.Projectiles.Pets public new string LocalizationCategory => "Projectiles.Pets"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - Main.projPet[Projectile.type] = true; + Main.projFrames[Type] = 5; + Main.projPet[Type] = true; - ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6) + ProjectileID.Sets.CharacterPreviewAnimations[Type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Type], 6) .WithOffset(-18f, -12f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } diff --git a/Projectiles/Pets/LittleLightProj.cs b/Projectiles/Pets/LittleLightProj.cs index 670adb081a..c9988efd4c 100644 --- a/Projectiles/Pets/LittleLightProj.cs +++ b/Projectiles/Pets/LittleLightProj.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Pets public ref float Time => ref Projectile.ai[0]; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 9; - Main.projPet[Projectile.type] = true; - ProjectileID.Sets.LightPet[Projectile.type] = true; + Main.projFrames[Type] = 9; + Main.projPet[Type] = true; + ProjectileID.Sets.LightPet[Type] = true; } public override void SetDefaults() @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Pets public void HandleFrames() { Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Type]; } public void DoSpinEffect() diff --git a/Projectiles/Pets/LordePet.cs b/Projectiles/Pets/LordePet.cs index d44b91473b..96843ca749 100644 --- a/Projectiles/Pets/LordePet.cs +++ b/Projectiles/Pets/LordePet.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Pets public override string Texture => "CalamityMod/NPCs/Other/THELORDE"; public override void SetStaticDefaults() { - Main.projPet[Projectile.type] = true; + Main.projPet[Type] = true; } public override void SetDefaults() @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Pets SpriteEffects spriteEffects = SpriteEffects.None; if (Projectile.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frameUsed = texture.Frame(2, 7, 0, 1); Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), frameUsed, drawColor, Projectile.rotation, new Vector2(texture.Width / 4f, texture.Height / 14f), Projectile.scale, spriteEffects, 0); diff --git a/Projectiles/Pets/MiniHiveMind.cs b/Projectiles/Pets/MiniHiveMind.cs index 46508b2fe8..8c593910ba 100644 --- a/Projectiles/Pets/MiniHiveMind.cs +++ b/Projectiles/Pets/MiniHiveMind.cs @@ -17,12 +17,12 @@ namespace CalamityMod.Projectiles.Pets public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 16; - Main.projPet[Projectile.type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 16; + Main.projPet[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; - ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6) + ProjectileID.Sets.CharacterPreviewAnimations[Type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Type], 6) .WithOffset(-12f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Pets { Projectile.frame++; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Pets/OceanSpirit.cs b/Projectiles/Pets/OceanSpirit.cs index 64e4cb27e1..233fb80d29 100644 --- a/Projectiles/Pets/OceanSpirit.cs +++ b/Projectiles/Pets/OceanSpirit.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Pets public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 17; - Main.projPet[Projectile.type] = true; - ProjectileID.Sets.LightPet[Projectile.type] = true; + Main.projFrames[Type] = 17; + Main.projPet[Type] = true; + ProjectileID.Sets.LightPet[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Pets/PerforaMini.cs b/Projectiles/Pets/PerforaMini.cs index 64659ece26..d11e8856f5 100644 --- a/Projectiles/Pets/PerforaMini.cs +++ b/Projectiles/Pets/PerforaMini.cs @@ -12,10 +12,10 @@ namespace CalamityMod.Projectiles.Pets public new string LocalizationCategory => "Projectiles.Pets"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 8; - Main.projPet[Projectile.type] = true; + Main.projFrames[Type] = 8; + Main.projPet[Type] = true; - ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6) + ProjectileID.Sets.CharacterPreviewAnimations[Type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Type], 6) .WithOffset(-8f, -20f).WithSpriteDirection(1).WhenNotSelected(0, 0); } diff --git a/Projectiles/Pets/PineapplePetProj.cs b/Projectiles/Pets/PineapplePetProj.cs index 4ab4afddce..c7a8323e1e 100644 --- a/Projectiles/Pets/PineapplePetProj.cs +++ b/Projectiles/Pets/PineapplePetProj.cs @@ -11,10 +11,10 @@ namespace CalamityMod.Projectiles.Pets public new string LocalizationCategory => "Projectiles.Pets"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - Main.projPet[Projectile.type] = true; + Main.projFrames[Type] = 5; + Main.projPet[Type] = true; - ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6) + ProjectileID.Sets.CharacterPreviewAnimations[Type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Type], 6) .WithOffset(-2f, -20f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Pets Projectile.frameCounter++; if (Projectile.frameCounter > 6) { - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; Projectile.frameCounter = 0; } diff --git a/Projectiles/Pets/PlaguebringerBab.cs b/Projectiles/Pets/PlaguebringerBab.cs index 5bcc934fc0..60bff4d0a0 100644 --- a/Projectiles/Pets/PlaguebringerBab.cs +++ b/Projectiles/Pets/PlaguebringerBab.cs @@ -10,10 +10,10 @@ namespace CalamityMod.Projectiles.Pets public new string LocalizationCategory => "Projectiles.Pets"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - Main.projPet[Projectile.type] = true; + Main.projFrames[Type] = 6; + Main.projPet[Type] = true; - ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 4, 6) + ProjectileID.Sets.CharacterPreviewAnimations[Type] = ProjectileID.Sets.SimpleLoop(0, 4, 6) .WithOffset(-25f, -20f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } diff --git a/Projectiles/Pets/PrimroseKeepsakeDisplay.cs b/Projectiles/Pets/PrimroseKeepsakeDisplay.cs index 6fca15e509..5f4baf9ecf 100644 --- a/Projectiles/Pets/PrimroseKeepsakeDisplay.cs +++ b/Projectiles/Pets/PrimroseKeepsakeDisplay.cs @@ -10,9 +10,9 @@ namespace CalamityMod.Projectiles.Pets public new string LocalizationCategory => "Projectiles.Pets"; public override void SetStaticDefaults() { - Main.projPet[Projectile.type] = true; + Main.projPet[Type] = true; - ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 0, 1) + ProjectileID.Sets.CharacterPreviewAnimations[Type] = ProjectileID.Sets.SimpleLoop(0, 0, 1) .WithOffset(-22f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } diff --git a/Projectiles/Pets/RadiatorPet.cs b/Projectiles/Pets/RadiatorPet.cs index 701e26229d..406c8e749d 100644 --- a/Projectiles/Pets/RadiatorPet.cs +++ b/Projectiles/Pets/RadiatorPet.cs @@ -12,9 +12,9 @@ namespace CalamityMod.Projectiles.Pets public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - Main.projPet[Projectile.type] = true; - ProjectileID.Sets.LightPet[Projectile.type] = true; + Main.projFrames[Type] = 4; + Main.projPet[Type] = true; + ProjectileID.Sets.LightPet[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Pets/RotomPet.cs b/Projectiles/Pets/RotomPet.cs index b58699ab21..f9920c8963 100644 --- a/Projectiles/Pets/RotomPet.cs +++ b/Projectiles/Pets/RotomPet.cs @@ -26,10 +26,10 @@ namespace CalamityMod.Projectiles.Pets public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - Main.projPet[Projectile.type] = true; + Main.projFrames[Type] = 4; + Main.projPet[Type] = true; - ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6) + ProjectileID.Sets.CharacterPreviewAnimations[Type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Type], 6) .WithOffset(-10f, 0f).WithSpriteDirection(1).WhenNotSelected(0, 0); } @@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles.Pets public override bool PreDraw(ref Color lightColor) { Drawing(lightColor, - Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value, + Terraria.GameContent.TextureAssets.Projectile[Type].Value, ModContent.Request("CalamityMod/Projectiles/Pets/RotomDex").Value, ModContent.Request("CalamityMod/Projectiles/Pets/RotomWash").Value, ModContent.Request("CalamityMod/Projectiles/Pets/RotomHeat").Value, @@ -168,7 +168,7 @@ namespace CalamityMod.Projectiles.Pets break; } - int height = texture.Height / Main.projFrames[Projectile.type]; + int height = texture.Height / Main.projFrames[Type]; int frameHeight = height * Projectile.frame; SpriteEffects spriteEffects = SpriteEffects.None; if (Projectile.spriteDirection == -1) diff --git a/Projectiles/Pets/SCalPet.cs b/Projectiles/Pets/SCalPet.cs index 9ae7ed1612..e36dffffe6 100644 --- a/Projectiles/Pets/SCalPet.cs +++ b/Projectiles/Pets/SCalPet.cs @@ -11,10 +11,10 @@ namespace CalamityMod.Projectiles.Pets public new string LocalizationCategory => "Projectiles.Pets"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - Main.projPet[Projectile.type] = true; + Main.projFrames[Type] = 6; + Main.projPet[Type] = true; - ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6) + ProjectileID.Sets.CharacterPreviewAnimations[Type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Type], 6) .WithOffset(-12f, -18).WithSpriteDirection(-1).WhenNotSelected(0, 0); } @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Pets Projectile.frameCounter++; if (Projectile.frameCounter > 6) { - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; Projectile.frameCounter = 0; } } diff --git a/Projectiles/Pets/Sparks.cs b/Projectiles/Pets/Sparks.cs index 6cde17f7d5..e7918942b7 100644 --- a/Projectiles/Pets/Sparks.cs +++ b/Projectiles/Pets/Sparks.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Projectiles.Pets public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - Main.projPet[Projectile.type] = true; - ProjectileID.Sets.LightPet[Projectile.type] = true; + Main.projFrames[Type] = 4; + Main.projPet[Type] = true; + ProjectileID.Sets.LightPet[Type] = true; } public override void SetDefaults() @@ -453,12 +453,12 @@ namespace CalamityMod.Projectiles.Pets public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (color == 1) texture = ModContent.Request("CalamityMod/Projectiles/Pets/SparksBlue").Value; if (color == 2) texture = ModContent.Request("CalamityMod/Projectiles/Pets/SparksGreen").Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + int height = texture.Height / Main.projFrames[Type]; int frameHeight = height * Projectile.frame; SpriteEffects spriteEffects = SpriteEffects.None; if (Projectile.spriteDirection == -1) diff --git a/Projectiles/Pets/ThirdSage.cs b/Projectiles/Pets/ThirdSage.cs index 8aa69533f3..1191d75421 100644 --- a/Projectiles/Pets/ThirdSage.cs +++ b/Projectiles/Pets/ThirdSage.cs @@ -11,10 +11,10 @@ namespace CalamityMod.Projectiles.Pets public new string LocalizationCategory => "Projectiles.Pets"; public override void SetStaticDefaults() { - Main.projPet[Projectile.type] = true; - Main.projFrames[Projectile.type] = 7; + Main.projPet[Type] = true; + Main.projFrames[Type] = 7; - ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 4, 6) + ProjectileID.Sets.CharacterPreviewAnimations[Type] = ProjectileID.Sets.SimpleLoop(0, 4, 6) .WithOffset(-15f, -5f).WithSpriteDirection(1).WhenNotSelected(0, 0); } diff --git a/Projectiles/Pets/YharonSonPet.cs b/Projectiles/Pets/YharonSonPet.cs index 0992ce81da..32a8114fb5 100644 --- a/Projectiles/Pets/YharonSonPet.cs +++ b/Projectiles/Pets/YharonSonPet.cs @@ -29,11 +29,11 @@ namespace CalamityMod.Projectiles.Pets public override void SetStaticDefaults() { - Main.projPet[Projectile.type] = true; + Main.projPet[Type] = true; //i cannot be bothered to figure out why it keeps flickering everytime it repeats the animation //as a "solution" i have set the frame counter to an obnoxiously high number so it probably wont be noticed by players - ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(1, 1, int.MaxValue) + ProjectileID.Sets.CharacterPreviewAnimations[Type] = ProjectileID.Sets.SimpleLoop(1, 1, int.MaxValue) .WithOffset(-55f, 2f).WithSpriteDirection(-1).WhenNotSelected(0, 0); } @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Pets { if (Projectile.frameCounter <= 1) return false; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 origin = texture.Size() / new Vector2((float)xFrameAmt, (float)yFrameAmt) * 0.5f; Rectangle frame = texture.Frame(xFrameAmt, yFrameAmt, frameX, frameY); SpriteEffects spriteEffects = Projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; diff --git a/Projectiles/Ranged/AdamAcceleratorBeam.cs b/Projectiles/Ranged/AdamAcceleratorBeam.cs index bd50ea7155..cb36de16a4 100644 --- a/Projectiles/Ranged/AdamAcceleratorBeam.cs +++ b/Projectiles/Ranged/AdamAcceleratorBeam.cs @@ -181,7 +181,7 @@ namespace CalamityMod.Projectiles.Ranged if (beamVector == Vector2.Zero || Projectile.velocity != Vector2.Zero) return false; - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; float beamLength = Projectile.ai[0]; Vector2 centerFloored = Projectile.Center.Floor() + beamVector * Projectile.scale * BeamRenderTileOffset; Vector2 scaleVec = new Vector2(Projectile.scale); diff --git a/Projectiles/Ranged/AnimosityBullet.cs b/Projectiles/Ranged/AnimosityBullet.cs index 69bb9b21de..546f2b7cf2 100644 --- a/Projectiles/Ranged/AnimosityBullet.cs +++ b/Projectiles/Ranged/AnimosityBullet.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Projectiles.Ranged public ref float Time => ref Projectile.ai[0]; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { @@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Crimson * 0.45f, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Crimson * 0.45f, 1); return true; } } diff --git a/Projectiles/Ranged/AquaBlast.cs b/Projectiles/Ranged/AquaBlast.cs index 4f3777524d..4a0a100b61 100644 --- a/Projectiles/Ranged/AquaBlast.cs +++ b/Projectiles/Ranged/AquaBlast.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 20; + Main.projFrames[Type] = 20; } public int spreadDust = 0; public static int Lifetime = 600; @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Ranged { Projectile.frame = 0; } - Projectile.frame = Projectile.frameCounter / 4 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 4 % Main.projFrames[Type]; //Rotation Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); diff --git a/Projectiles/Ranged/ArcherfishRing.cs b/Projectiles/Ranged/ArcherfishRing.cs index 72c3133e72..afbe1a3107 100644 --- a/Projectiles/Ranged/ArcherfishRing.cs +++ b/Projectiles/Ranged/ArcherfishRing.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox.TopLeft(), targetHitbox.Size(), scale: Projectile.scale); + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox); public override void AI() { @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 ringScale = Projectile.Size / tex.Size() * Projectile.scale; Color ringColor = Color.Lerp(Color.DodgerBlue, Color.Blue, Projectile.Opacity) * Projectile.Opacity * 1.2f; diff --git a/Projectiles/Ranged/ArcherfishShot.cs b/Projectiles/Ranged/ArcherfishShot.cs index 7b82e11a0f..918ebc8a95 100644 --- a/Projectiles/Ranged/ArcherfishShot.cs +++ b/Projectiles/Ranged/ArcherfishShot.cs @@ -1,4 +1,5 @@ -using CalamityMod.Dusts; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -59,6 +60,15 @@ namespace CalamityMod.Projectiles.Ranged } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Wet, 240); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(BuffID.Wet, 120); + target.AddBuff(ModContent.BuffType(), 120); + } + public override void OnHitPlayer(Player target, Player.HurtInfo info) + { + target.AddBuff(BuffID.Wet, 120); + target.AddBuff(ModContent.BuffType(), 120); + } } } diff --git a/Projectiles/Ranged/AstralCannonProjectile.cs b/Projectiles/Ranged/AstralCannonProjectile.cs index 2be0ef7466..e07b194773 100644 --- a/Projectiles/Ranged/AstralCannonProjectile.cs +++ b/Projectiles/Ranged/AstralCannonProjectile.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Ranged/AstralRound.cs b/Projectiles/Ranged/AstralRound.cs index 7418a50382..834728bd1c 100644 --- a/Projectiles/Ranged/AstralRound.cs +++ b/Projectiles/Ranged/AstralRound.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Ranged/AstrealArrow.cs b/Projectiles/Ranged/AstrealArrow.cs index 0fe493e714..4d72d5c9f0 100644 --- a/Projectiles/Ranged/AstrealArrow.cs +++ b/Projectiles/Ranged/AstrealArrow.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Ranged/AstrealFlame.cs b/Projectiles/Ranged/AstrealFlame.cs index d29f10eb2e..06d379b47a 100644 --- a/Projectiles/Ranged/AstrealFlame.cs +++ b/Projectiles/Ranged/AstrealFlame.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Ranged/AuricBullet.cs b/Projectiles/Ranged/AuricBullet.cs index da301a6e41..9a2f524c55 100644 --- a/Projectiles/Ranged/AuricBullet.cs +++ b/Projectiles/Ranged/AuricBullet.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 9; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 9; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() diff --git a/Projectiles/Ranged/AuroraFire.cs b/Projectiles/Ranged/AuroraFire.cs index a404c8b5a2..afd3c9a209 100644 --- a/Projectiles/Ranged/AuroraFire.cs +++ b/Projectiles/Ranged/AuroraFire.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { Main.spriteBatch.SetBlendState(BlendState.Additive); - Texture2D fog = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D fog = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; float opacity = Utils.GetLerpValue(0f, 0.08f, LightPower, true) * Projectile.Opacity * 0.3f; Main.EntitySpriteDraw(fog, drawPosition, null, OrangeFogColor * opacity, Projectile.rotation + OrangeFogRot, fog.Size() * 0.5f, Projectile.scale * OrangeFogScale, SpriteEffects.None); diff --git a/Projectiles/Ranged/BallistaGreatArrow.cs b/Projectiles/Ranged/BallistaGreatArrow.cs index 1f11dc004b..f80294e65a 100644 --- a/Projectiles/Ranged/BallistaGreatArrow.cs +++ b/Projectiles/Ranged/BallistaGreatArrow.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Ranged/BarinadeArrow.cs b/Projectiles/Ranged/BarinadeArrow.cs index 3b663a244f..8e5a2ad405 100644 --- a/Projectiles/Ranged/BarinadeArrow.cs +++ b/Projectiles/Ranged/BarinadeArrow.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 12; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 12; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() { @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Ranged { for (int i = 0; i <= 5; i++) { - Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(3) ? 216 : 207, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.1f, 0.6f), 0, default, Main.rand.NextFloat(1.2f, 1.6f)); + Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(3) ? 216 : 121, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.1f, 0.6f), 0, default, Main.rand.NextFloat(1.2f, 1.6f)); dust.noGravity = true; } } @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Ranged } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor * 2, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor * 2, 1); return true; } } diff --git a/Projectiles/Ranged/BarinadeArrow.png b/Projectiles/Ranged/BarinadeArrow.png index d4720a0d0e..6e8c0c4a87 100644 Binary files a/Projectiles/Ranged/BarinadeArrow.png and b/Projectiles/Ranged/BarinadeArrow.png differ diff --git a/Projectiles/Ranged/BlightFlames.cs b/Projectiles/Ranged/BlightFlames.cs index 16c693e4cc..cf32ee4072 100644 --- a/Projectiles/Ranged/BlightFlames.cs +++ b/Projectiles/Ranged/BlightFlames.cs @@ -166,7 +166,7 @@ namespace CalamityMod.Projectiles.Ranged { Main.spriteBatch.SetBlendState(BlendState.Additive); - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; float opacity = Utils.GetLerpValue(0f, 0.08f, LightPower, true) * Projectile.Opacity * 0.65f; Color drawColor = FogColor * opacity; diff --git a/Projectiles/Ranged/BloodClotFriendly.cs b/Projectiles/Ranged/BloodClotFriendly.cs index 1d96edd43d..a72db98d46 100644 --- a/Projectiles/Ranged/BloodClotFriendly.cs +++ b/Projectiles/Ranged/BloodClotFriendly.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() diff --git a/Projectiles/Ranged/BloodfireArrowProj.cs b/Projectiles/Ranged/BloodfireArrowProj.cs index 69a3118522..985287bd5b 100644 --- a/Projectiles/Ranged/BloodfireArrowProj.cs +++ b/Projectiles/Ranged/BloodfireArrowProj.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Ranged/BloodfireBulletProj.cs b/Projectiles/Ranged/BloodfireBulletProj.cs index e45df960a2..cdf8888264 100644 --- a/Projectiles/Ranged/BloodfireBulletProj.cs +++ b/Projectiles/Ranged/BloodfireBulletProj.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() diff --git a/Projectiles/Ranged/BloodflareSoul.cs b/Projectiles/Ranged/BloodflareSoul.cs index 2e30e64aa0..e124ee2a71 100644 --- a/Projectiles/Ranged/BloodflareSoul.cs +++ b/Projectiles/Ranged/BloodflareSoul.cs @@ -12,10 +12,10 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Ranged/Bolt.cs b/Projectiles/Ranged/Bolt.cs index e45cd19672..2e67071502 100644 --- a/Projectiles/Ranged/Bolt.cs +++ b/Projectiles/Ranged/Bolt.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Ranged } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Ranged/BrimstoneFireFriendly.cs b/Projectiles/Ranged/BrimstoneFireFriendly.cs index e419809b56..75f421c5e6 100644 --- a/Projectiles/Ranged/BrimstoneFireFriendly.cs +++ b/Projectiles/Ranged/BrimstoneFireFriendly.cs @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D fire = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D fire = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D mist = ModContent.Request("CalamityMod/Particles/MediumMist").Value; // The conga line of colors to sift through diff --git a/Projectiles/Ranged/BubonicRoundProj.cs b/Projectiles/Ranged/BubonicRoundProj.cs index 5c9a9c260d..d591810015 100644 --- a/Projectiles/Ranged/BubonicRoundProj.cs +++ b/Projectiles/Ranged/BubonicRoundProj.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() diff --git a/Projectiles/Ranged/BuzzkillHoldout.cs b/Projectiles/Ranged/BuzzkillHoldout.cs index 44db5dd77a..e7833c92a3 100644 --- a/Projectiles/Ranged/BuzzkillHoldout.cs +++ b/Projectiles/Ranged/BuzzkillHoldout.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; } public override void SetDefaults() diff --git a/Projectiles/Ranged/BuzzkillSaw.cs b/Projectiles/Ranged/BuzzkillSaw.cs index be7825b949..ac72578d91 100644 --- a/Projectiles/Ranged/BuzzkillSaw.cs +++ b/Projectiles/Ranged/BuzzkillSaw.cs @@ -25,9 +25,9 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -193,7 +193,7 @@ namespace CalamityMod.Projectiles.Ranged return true; // Special afterimage drawing to include the slashes - Texture2D buzzsawTexture = TextureAssets.Projectile[Projectile.type].Value; + Texture2D buzzsawTexture = TextureAssets.Projectile[Type].Value; Rectangle frame = buzzsawTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); for (int i = 1; i < Projectile.oldPos.Length; i++) { diff --git a/Projectiles/Ranged/CardClub.cs b/Projectiles/Ranged/CardClub.cs index 91aaec67ac..34900bde02 100644 --- a/Projectiles/Ranged/CardClub.cs +++ b/Projectiles/Ranged/CardClub.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Ranged/CardClubSplit.cs b/Projectiles/Ranged/CardClubSplit.cs index cd3c6dc6cf..3a5b856b38 100644 --- a/Projectiles/Ranged/CardClubSplit.cs +++ b/Projectiles/Ranged/CardClubSplit.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Ranged/CardDiamond.cs b/Projectiles/Ranged/CardDiamond.cs index 8bb7a7706c..30ffcf5781 100644 --- a/Projectiles/Ranged/CardDiamond.cs +++ b/Projectiles/Ranged/CardDiamond.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -125,7 +125,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Ranged/CardHeart.cs b/Projectiles/Ranged/CardHeart.cs index da83907400..8995ad87c6 100644 --- a/Projectiles/Ranged/CardHeart.cs +++ b/Projectiles/Ranged/CardHeart.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Ranged/CardSpade.cs b/Projectiles/Ranged/CardSpade.cs index 4e9861bb9d..b0addec51c 100644 --- a/Projectiles/Ranged/CardSpade.cs +++ b/Projectiles/Ranged/CardSpade.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Ranged/ChargedBlast.cs b/Projectiles/Ranged/ChargedBlast.cs index 30a3a8ef6f..abb9c2c20f 100644 --- a/Projectiles/Ranged/ChargedBlast.cs +++ b/Projectiles/Ranged/ChargedBlast.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Ranged public Vector2 baseVel; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Ranged if (Projectile.owner == Main.myPlayer) { for (int k = 0; k < projectiles; k++) - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, -baseVel.RotatedByRandom(0.9f) * Main.rand.NextFloat(0.6f, 0.7f), ModContent.ProjectileType(), (int)(Projectile.damage * (Projectile.ai[2] > 0 ? 0.3f : 0.5f)), Projectile.knockBack * 0.8f, Main.myPlayer, 0, 0, Projectile.ai[2]); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -baseVel.RotatedByRandom(0.9f) * Main.rand.NextFloat(0.6f, 0.7f), ModContent.ProjectileType(), (int)(Projectile.damage * (Projectile.ai[2] > 0 ? 0.3f : 0.5f)), Projectile.knockBack * 0.8f, Main.myPlayer, 0, 0, Projectile.ai[2]); } for (int k = 0; k < 3; k++) { @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Ranged if (baseColor == Color.White) return false; Texture2D texture = ModContent.Request("CalamityMod/Particles/DrainLineBloom").Value; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], (baseColor * 0.7f) with { A = 0 }, 1, texture); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], (baseColor * 0.7f) with { A = 0 }, 1, texture); Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, baseColor with { A = 0 }, Projectile.rotation, texture.Size() * 0.5f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Ranged/ChargedBlastSplit.cs b/Projectiles/Ranged/ChargedBlastSplit.cs index fb72db7217..ed90969521 100644 --- a/Projectiles/Ranged/ChargedBlastSplit.cs +++ b/Projectiles/Ranged/ChargedBlastSplit.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Projectiles.Ranged public float homeSpeed; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { @@ -116,7 +116,7 @@ namespace CalamityMod.Projectiles.Ranged if (baseColor == Color.White) return false; Texture2D texture = ModContent.Request("CalamityMod/Particles/DrainLineBloom").Value; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], (baseColor * 0.7f) with { A = 0 }, 1, texture); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], (baseColor * 0.7f) with { A = 0 }, 1, texture); Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, baseColor with { A = 0 }, Projectile.rotation, texture.Size() * 0.5f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Ranged/ChickenCannonHeld.cs b/Projectiles/Ranged/ChickenCannonHeld.cs index f1e2ebb30e..acaafa0d12 100644 --- a/Projectiles/Ranged/ChickenCannonHeld.cs +++ b/Projectiles/Ranged/ChickenCannonHeld.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Ranged/ChromaticFlare.cs b/Projectiles/Ranged/ChromaticFlare.cs index 873f213973..4c9cb7dd55 100644 --- a/Projectiles/Ranged/ChromaticFlare.cs +++ b/Projectiles/Ranged/ChromaticFlare.cs @@ -37,8 +37,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 18; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 18; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -128,7 +128,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D lightTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D lightTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; for (int i = 0; i < Projectile.oldPos.Length; i++) { float hue = 0.5f + 0.5f * i / (float)Projectile.oldPos.Length * MathF.Sin(Main.GlobalTimeWrappedHourly * 5f); diff --git a/Projectiles/Ranged/CinderArrowProj.cs b/Projectiles/Ranged/CinderArrowProj.cs index cfd82c1257..52d673fc7d 100644 --- a/Projectiles/Ranged/CinderArrowProj.cs +++ b/Projectiles/Ranged/CinderArrowProj.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { @@ -126,14 +126,14 @@ namespace CalamityMod.Projectiles.Ranged if (splitShot) { Texture2D texture = ModContent.Request("CalamityMod/Particles/DrainLine").Value; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Crimson * 0.3f, 1, texture); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Crimson * 0.3f, 1, texture); return false; } else { Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Ranged/BloodfireBulletProj").Value; if (Time > 6f) - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.White * 0.3f, 1, texture); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.White * 0.3f, 1, texture); return true; } } diff --git a/Projectiles/Ranged/ClaretCannonProj.cs b/Projectiles/Ranged/ClaretCannonProj.cs index 3c9c5699d9..1719f76360 100644 --- a/Projectiles/Ranged/ClaretCannonProj.cs +++ b/Projectiles/Ranged/ClaretCannonProj.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Ranged/CondemnationArrow.cs b/Projectiles/Ranged/CondemnationArrow.cs index 1807a79a2b..a35be9307b 100644 --- a/Projectiles/Ranged/CondemnationArrow.cs +++ b/Projectiles/Ranged/CondemnationArrow.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Ranged public ref float Time => ref Projectile.ai[0]; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 9; + ProjectileID.Sets.TrailingMode[Type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 9; } public override void SetDefaults() @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); return false; } @@ -91,6 +91,6 @@ namespace CalamityMod.Projectiles.Ranged } } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox.TopLeft(), targetHitbox.Size()); + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox); } } diff --git a/Projectiles/Ranged/CondemnationArrowHoming.cs b/Projectiles/Ranged/CondemnationArrowHoming.cs index 97c832c568..c9c5268e33 100644 --- a/Projectiles/Ranged/CondemnationArrowHoming.cs +++ b/Projectiles/Ranged/CondemnationArrowHoming.cs @@ -14,14 +14,14 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 9; + ProjectileID.Sets.TrailingMode[Type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 9; } public override void SetDefaults() { - Projectile.width = 14; - Projectile.height = 45; + Projectile.width = 26; + Projectile.height = 90; Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.tileCollide = true; @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); return false; } @@ -72,6 +72,6 @@ namespace CalamityMod.Projectiles.Ranged } } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox.TopLeft(), targetHitbox.Size()); + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox); } } diff --git a/Projectiles/Ranged/ContagionArrow.cs b/Projectiles/Ranged/ContagionArrow.cs index 04e8f7b438..067c7820e3 100644 --- a/Projectiles/Ranged/ContagionArrow.cs +++ b/Projectiles/Ranged/ContagionArrow.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Ranged/CorinthPrimeAirburstGrenade.cs b/Projectiles/Ranged/CorinthPrimeAirburstGrenade.cs index b77d4e0bec..a097576c82 100644 --- a/Projectiles/Ranged/CorinthPrimeAirburstGrenade.cs +++ b/Projectiles/Ranged/CorinthPrimeAirburstGrenade.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() diff --git a/Projectiles/Ranged/DaemonsFlameBow.cs b/Projectiles/Ranged/DaemonsFlameBow.cs index 907806df64..6653ea2313 100644 --- a/Projectiles/Ranged/DaemonsFlameBow.cs +++ b/Projectiles/Ranged/DaemonsFlameBow.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Ranged public override LocalizedText DisplayName => CalamityUtils.GetItemName(); public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -156,8 +156,8 @@ namespace CalamityMod.Projectiles.Ranged public override void PostDraw(Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Vector2 origin = new Vector2(27f, 58f); SpriteEffects spriteEffects = SpriteEffects.None; diff --git a/Projectiles/Ranged/DragonsBreathFlames.cs b/Projectiles/Ranged/DragonsBreathFlames.cs index 37b20c4c80..d6a65bac8e 100644 --- a/Projectiles/Ranged/DragonsBreathFlames.cs +++ b/Projectiles/Ranged/DragonsBreathFlames.cs @@ -205,7 +205,7 @@ namespace CalamityMod.Projectiles.Ranged Particle blastRing = new CustomPulse(target.Center, Vector2.Zero, Color.Lerp(Color.Orange, Color.OrangeRed, sine) * 0.7f, "CalamityMod/Particles/BloomRing", Vector2.One, Main.rand.NextFloat(-10, 10), Main.rand.NextFloat(0.2f, 1.2f), 2.5f * Main.rand.NextFloat(0.9f, 1.2f), 15, true); GeneralParticleHandler.SpawnParticle(blastRing); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); target.AddBuff(ModContent.BuffType(), 420); } diff --git a/Projectiles/Ranged/DragonsBreathHoldout.cs b/Projectiles/Ranged/DragonsBreathHoldout.cs index 0600bc37de..6fe3f79f47 100644 --- a/Projectiles/Ranged/DragonsBreathHoldout.cs +++ b/Projectiles/Ranged/DragonsBreathHoldout.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Ranged } if (weldingTimer % 2 == 0) - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.velocity.SafeNormalize(Vector2.UnitX) * 5, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 1, weldingTimer, (Time % 15 < 10 ? 18 : 0)); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.velocity.SafeNormalize(Vector2.UnitX) * 5, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 1, weldingTimer, (Time % 15 < 10 ? 18 : 0)); weldingTimer--; if (Time % 3 == 0) @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Ranged SoundStyle bigShot = new("CalamityMod/Sounds/Item/DudFire"); SoundEngine.PlaySound(bigShot with { PitchVariance = 0.15f, Volume = 0.75f }, Projectile.Center); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, (Projectile.velocity.SafeNormalize(Vector2.UnitX) * 6).RotatedBy(-2.3f * Projectile.direction), ModContent.ProjectileType(), Main.zenithWorld ? 250000 : 1, Projectile.knockBack, Projectile.owner, 1); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, (Projectile.velocity.SafeNormalize(Vector2.UnitX) * 6).RotatedBy(-2.3f * Projectile.direction), ModContent.ProjectileType(), Main.zenithWorld ? 250000 : 1, Projectile.knockBack, Projectile.owner, 1); hasLaunchedMag = true; } } @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Ranged Owner.PickAmmo(Owner.ActiveItem(), out _, out float shootSpeed, out int damage, out float knockback, out _, !Main.rand.NextBool(5)); for (int i = 0; i < 3; i++) - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.15f * i * 0.5f) * shootSpeed * (i == 0 ? 0.5f : i == 1 ? 0.7f : 1) * Main.rand.NextFloat(0.8f, 1f), ModContent.ProjectileType(), damage, knockback, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.15f * i * 0.5f) * shootSpeed * (i == 0 ? 0.5f : i == 1 ? 0.7f : 1) * Main.rand.NextFloat(0.8f, 1f), ModContent.ProjectileType(), damage, knockback, Projectile.owner); SoundEngine.PlaySound(DragonsBreath.FireballSound, Projectile.Center); hasLaunchedMag = false; @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Ranged if (Time < 2) return false; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 position = Projectile.Center - Main.screenPosition; float rotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); Vector2 origin = texture.Size() * 0.5f; diff --git a/Projectiles/Ranged/DragonsBreathMag.cs b/Projectiles/Ranged/DragonsBreathMag.cs index 0908d58da1..89bafd2447 100644 --- a/Projectiles/Ranged/DragonsBreathMag.cs +++ b/Projectiles/Ranged/DragonsBreathMag.cs @@ -34,12 +34,12 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { // Unsure if it will look good with these - //ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - //ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + //ProjectileID.Sets.TrailCacheLength[Type] = 8; + //ProjectileID.Sets.TrailingMode[Type] = 0; } public override bool PreDraw(ref Color lightColor) { - //CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, ModContent.Request("CalamityMod/Projectiles/Ranged/DragonsBreathMag").Value); + //CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1, ModContent.Request("CalamityMod/Projectiles/Ranged/DragonsBreathMag").Value); return true; } public override void AI() diff --git a/Projectiles/Ranged/DrataliornusFlame.cs b/Projectiles/Ranged/DrataliornusFlame.cs index eb614b0583..2b7c2cf2d0 100644 --- a/Projectiles/Ranged/DrataliornusFlame.cs +++ b/Projectiles/Ranged/DrataliornusFlame.cs @@ -143,7 +143,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, texture2D13.Width, texture2D13.Height)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)texture2D13.Height / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Ranged/DrizzlefishFire.cs b/Projectiles/Ranged/DrizzlefishFire.cs index 7d1dd34af7..a1384538d8 100644 --- a/Projectiles/Ranged/DrizzlefishFire.cs +++ b/Projectiles/Ranged/DrizzlefishFire.cs @@ -28,19 +28,19 @@ namespace CalamityMod.Projectiles.Ranged } public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override bool PreDraw(ref Color lightColor) { if (Time < 7) - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, ModContent.Request("CalamityMod/Projectiles/InvisibleProj").Value); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1, ModContent.Request("CalamityMod/Projectiles/InvisibleProj").Value); else { if (Projectile.ai[1] == 1f) - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, ModContent.Request("CalamityMod/Projectiles/Ranged/DrizzlefishFire2").Value); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1, ModContent.Request("CalamityMod/Projectiles/Ranged/DrizzlefishFire2").Value); else - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, ModContent.Request("CalamityMod/Projectiles/Ranged/DrizzlefishFire").Value); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1, ModContent.Request("CalamityMod/Projectiles/Ranged/DrizzlefishFire").Value); } //Changes the texture of the projectile if (Projectile.ai[1] == 1f) diff --git a/Projectiles/Ranged/DrizzlefishFireSplit.cs b/Projectiles/Ranged/DrizzlefishFireSplit.cs index 8ab731eafa..29155befd3 100644 --- a/Projectiles/Ranged/DrizzlefishFireSplit.cs +++ b/Projectiles/Ranged/DrizzlefishFireSplit.cs @@ -28,15 +28,15 @@ namespace CalamityMod.Projectiles.Ranged } public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override bool PreDraw(ref Color lightColor) { if (Projectile.ai[1] == 1f) - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, ModContent.Request("CalamityMod/Projectiles/Ranged/DrizzlefishFire2").Value); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1, ModContent.Request("CalamityMod/Projectiles/Ranged/DrizzlefishFire2").Value); else - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, ModContent.Request("CalamityMod/Projectiles/Ranged/DrizzlefishFire").Value); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1, ModContent.Request("CalamityMod/Projectiles/Ranged/DrizzlefishFire").Value); //Changes the texture of the projectile if (Projectile.ai[1] == 1f) { diff --git a/Projectiles/Ranged/DrizzlefishFireball.cs b/Projectiles/Ranged/DrizzlefishFireball.cs index 864bcdaa33..d6de88439b 100644 --- a/Projectiles/Ranged/DrizzlefishFireball.cs +++ b/Projectiles/Ranged/DrizzlefishFireball.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.Ranged } public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void AI() { @@ -117,13 +117,13 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { if (Time < 7) - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, ModContent.Request("CalamityMod/Projectiles/InvisibleProj").Value); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1, ModContent.Request("CalamityMod/Projectiles/InvisibleProj").Value); else { if (Projectile.ai[1] == 1f) - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, ModContent.Request("CalamityMod/Projectiles/Ranged/DrizzlefishFire2").Value); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1, ModContent.Request("CalamityMod/Projectiles/Ranged/DrizzlefishFire2").Value); else - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, ModContent.Request("CalamityMod/Projectiles/Ranged/DrizzlefishFire").Value); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1, ModContent.Request("CalamityMod/Projectiles/Ranged/DrizzlefishFire").Value); } //Changes the texture of the projectile if (Projectile.ai[1] == 1f) diff --git a/Projectiles/Ranged/DryadsTearMain.cs b/Projectiles/Ranged/DryadsTearMain.cs index 2002b27fe6..81766cb87a 100644 --- a/Projectiles/Ranged/DryadsTearMain.cs +++ b/Projectiles/Ranged/DryadsTearMain.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() diff --git a/Projectiles/Ranged/DryadsTearSplit.cs b/Projectiles/Ranged/DryadsTearSplit.cs index 4fc7b04a76..dc63930a32 100644 --- a/Projectiles/Ranged/DryadsTearSplit.cs +++ b/Projectiles/Ranged/DryadsTearSplit.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() diff --git a/Projectiles/Ranged/ElysianArrowRain.cs b/Projectiles/Ranged/ElysianArrowRain.cs index cae1a8b482..2963288945 100644 --- a/Projectiles/Ranged/ElysianArrowRain.cs +++ b/Projectiles/Ranged/ElysianArrowRain.cs @@ -26,8 +26,8 @@ namespace CalamityMod.Projectiles.Ranged { ProjectileID.Sets.CultistIsResistantTo[Type] = true; // While this projectile doesn't have afterimages, it keeps track of old positions for its primitive drawcode. - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 21; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 21; } public override void SetDefaults() diff --git a/Projectiles/Ranged/EssenceFire.cs b/Projectiles/Ranged/EssenceFire.cs index 0edd066459..18d29ded2c 100644 --- a/Projectiles/Ranged/EssenceFire.cs +++ b/Projectiles/Ranged/EssenceFire.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Ranged } public override bool PreDraw(ref Color lightColor) { - Texture2D fire = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D fire = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D mist = ModContent.Request("CalamityMod/Particles/MediumMist").Value; // The conga line of colors to sift through diff --git a/Projectiles/Ranged/ExoCrystalArrow.cs b/Projectiles/Ranged/ExoCrystalArrow.cs index fbcffc2110..add3758658 100644 --- a/Projectiles/Ranged/ExoCrystalArrow.cs +++ b/Projectiles/Ranged/ExoCrystalArrow.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 10; } public override void SetDefaults() @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Ranged GameShaders.Misc["CalamityMod:HeavenlyGaleTrail"].UseSecondaryColor(secondaryColor); GameShaders.Misc["CalamityMod:HeavenlyGaleTrail"].Apply(); PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => trailOffset, shader: GameShaders.Misc["CalamityMod:HeavenlyGaleTrail"]), 53); - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 origin = tex.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Main.spriteBatch.Draw(tex, drawPosition, null, Projectile.GetAlpha(Color.White), Projectile.rotation, origin, Projectile.scale, 0, 0f); diff --git a/Projectiles/Ranged/ExoLight.cs b/Projectiles/Ranged/ExoLight.cs index 2cf433a89a..7e169f185c 100644 --- a/Projectiles/Ranged/ExoLight.cs +++ b/Projectiles/Ranged/ExoLight.cs @@ -29,8 +29,8 @@ namespace CalamityMod.Projectiles.Ranged public Vector2 oldPos = Vector2.Zero; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 36; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 36; } public override void SetDefaults() diff --git a/Projectiles/Ranged/ExoLightningBolt.cs b/Projectiles/Ranged/ExoLightningBolt.cs index 1a3338f0af..9fb2aad3a1 100644 --- a/Projectiles/Ranged/ExoLightningBolt.cs +++ b/Projectiles/Ranged/ExoLightningBolt.cs @@ -35,8 +35,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 50; + ProjectileID.Sets.TrailingMode[Type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 50; } public override void SetDefaults() diff --git a/Projectiles/Ranged/FeatherLarge.cs b/Projectiles/Ranged/FeatherLarge.cs index f516e7080f..db3737de73 100644 --- a/Projectiles/Ranged/FeatherLarge.cs +++ b/Projectiles/Ranged/FeatherLarge.cs @@ -10,10 +10,11 @@ namespace CalamityMod.Projectiles.Ranged public class FeatherLarge : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "Terraria/Images/Item_1516"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -41,7 +42,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Ranged/FeatherLarge.png b/Projectiles/Ranged/FeatherLarge.png deleted file mode 100644 index add436a025..0000000000 Binary files a/Projectiles/Ranged/FeatherLarge.png and /dev/null differ diff --git a/Projectiles/Ranged/FlakKrakenHoldout.cs b/Projectiles/Ranged/FlakKrakenHoldout.cs index 362c7e66a2..5e05ab6402 100644 --- a/Projectiles/Ranged/FlakKrakenHoldout.cs +++ b/Projectiles/Ranged/FlakKrakenHoldout.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Ranged } // Spawns the projectile. - Projectile.NewProjectileDirect( + Projectile.NewProjectile( Projectile.GetSource_FromThis(), GunTipPosition, direction * itemShootSpeed, diff --git a/Projectiles/Ranged/FlakKrakenProj.png b/Projectiles/Ranged/FlakKrakenProj.png deleted file mode 100644 index ebffc498ad..0000000000 Binary files a/Projectiles/Ranged/FlakKrakenProj.png and /dev/null differ diff --git a/Projectiles/Ranged/FlakKrakenProjectile.cs b/Projectiles/Ranged/FlakKrakenProjectile.cs index 98db63bb3b..7eee3c9790 100644 --- a/Projectiles/Ranged/FlakKrakenProjectile.cs +++ b/Projectiles/Ranged/FlakKrakenProjectile.cs @@ -250,7 +250,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Color drawColor = IsShrapnel ? Projectile.GetAlpha(lightColor) : Color.Black; diff --git a/Projectiles/Ranged/FlakToxicannonHoldout.cs b/Projectiles/Ranged/FlakToxicannonHoldout.cs index 1bf6ce82a7..b8e3ba2345 100644 --- a/Projectiles/Ranged/FlakToxicannonHoldout.cs +++ b/Projectiles/Ranged/FlakToxicannonHoldout.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Ranged } // Spawns the projectile. - Projectile.NewProjectileDirect( + Projectile.NewProjectile( Projectile.GetSource_FromThis(), GunTipPosition, direction * itemShootSpeed, diff --git a/Projectiles/Ranged/FlakToxicannonProjectile.cs b/Projectiles/Ranged/FlakToxicannonProjectile.cs index a01cdd3535..d8ab7107d2 100644 --- a/Projectiles/Ranged/FlakToxicannonProjectile.cs +++ b/Projectiles/Ranged/FlakToxicannonProjectile.cs @@ -252,10 +252,10 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D texture = IsShrapnel ? Request("CalamityMod/Projectiles/Environment/AcidDrop").Value : Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = IsShrapnel ? Request("CalamityMod/Projectiles/Environment/AcidDrop").Value : Terraria.GameContent.TextureAssets.Projectile[Type].Value; Color drawColor = Projectile.GetAlpha(lightColor); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], drawColor * 0.35f, 1, texture); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], drawColor * 0.35f, 1, texture); return false; } diff --git a/Projectiles/Ranged/FlareBat.cs b/Projectiles/Ranged/FlareBat.cs index ec5583125c..eec96dfc86 100644 --- a/Projectiles/Ranged/FlareBat.cs +++ b/Projectiles/Ranged/FlareBat.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Ranged/FlashRoundProj.cs b/Projectiles/Ranged/FlashRoundProj.cs index 9d44f9e9f9..6eb86ba08f 100644 --- a/Projectiles/Ranged/FlashRoundProj.cs +++ b/Projectiles/Ranged/FlashRoundProj.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Ranged public float ExplosionPower = 1.5f; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() diff --git a/Projectiles/Ranged/FlurrystormCannonShooting.cs b/Projectiles/Ranged/FlurrystormCannonShooting.cs index 3e0da96543..52bee35333 100644 --- a/Projectiles/Ranged/FlurrystormCannonShooting.cs +++ b/Projectiles/Ranged/FlurrystormCannonShooting.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Ranged public override LocalizedText DisplayName => CalamityUtils.GetItemName(); public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 2; + Main.projFrames[Type] = 2; } public override void SetDefaults() diff --git a/Projectiles/Ranged/FreedomStarBeam.cs b/Projectiles/Ranged/FreedomStarBeam.cs index 859e5d49d5..f647654627 100644 --- a/Projectiles/Ranged/FreedomStarBeam.cs +++ b/Projectiles/Ranged/FreedomStarBeam.cs @@ -203,7 +203,7 @@ namespace CalamityMod.Projectiles.Ranged if (Projectile.velocity == Vector2.Zero) return false; - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; float beamLength = Projectile.ai[0]; Vector2 centerFloored = Projectile.Center.Floor() + Projectile.velocity * Projectile.scale * BeamRenderTileOffset; Vector2 scaleVec = new Vector2(Projectile.scale); diff --git a/Projectiles/Ranged/GemTechGreenFlechette.cs b/Projectiles/Ranged/GemTechGreenFlechette.cs index 2f2410091a..981761315d 100644 --- a/Projectiles/Ranged/GemTechGreenFlechette.cs +++ b/Projectiles/Ranged/GemTechGreenFlechette.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 5; } public override void SetDefaults() @@ -69,8 +69,8 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - int afterimageCount = ProjectileID.Sets.TrailCacheLength[Projectile.type]; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + int afterimageCount = ProjectileID.Sets.TrailCacheLength[Type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Vector2 origin = texture.Size() * 0.5f; for (int i = 0; i < afterimageCount; i++) diff --git a/Projectiles/Ranged/GodSlayerSlugProj.cs b/Projectiles/Ranged/GodSlayerSlugProj.cs index cc839fb9b4..cbd98e805f 100644 --- a/Projectiles/Ranged/GodSlayerSlugProj.cs +++ b/Projectiles/Ranged/GodSlayerSlugProj.cs @@ -28,8 +28,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; if (Main.netMode != NetmodeID.Server) TextureBlue = Mod.Assets.Request("Projectiles/Ranged/GodSlayerSlugBlue", AssetRequestMode.ImmediateLoad).Value; @@ -135,7 +135,7 @@ namespace CalamityMod.Projectiles.Ranged // Set all old positions to the bullet's warp position so that there aren't weird afterimages. // If an old position is uninitialized (0,0 aka never used), then don't change it. - for (int i = 0; i < ProjectileID.Sets.TrailCacheLength[Projectile.type]; ++i) + for (int i = 0; i < ProjectileID.Sets.TrailCacheLength[Type]; ++i) { Vector2 oldPosElem = Projectile.oldPos[i]; if (!(oldPosElem == Vector2.Zero)) diff --git a/Projectiles/Ranged/HailstormBulletProj.cs b/Projectiles/Ranged/HailstormBulletProj.cs index ac240f4e5d..3ab6b52907 100644 --- a/Projectiles/Ranged/HailstormBulletProj.cs +++ b/Projectiles/Ranged/HailstormBulletProj.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Particles; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -17,8 +18,8 @@ namespace CalamityMod.Projectiles.Ranged public Vector2 startVelocity; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 18; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 18; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -93,7 +94,8 @@ namespace CalamityMod.Projectiles.Ranged GeneralParticleHandler.SpawnParticle(subTrail); } int onHitDamage = (int)(Projectile.damage * 0.5f); - Owner.ApplyDamageToNPC(target, onHitDamage, 0f, 0, false); + Projectile flash = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), onHitDamage, 0f, Projectile.owner, target.whoAmI); + flash.DamageType = Projectile.DamageType; } } diff --git a/Projectiles/Ranged/HallowPointRoundProj.cs b/Projectiles/Ranged/HallowPointRoundProj.cs index 2318b6c5d1..8d8ec76fec 100644 --- a/Projectiles/Ranged/HallowPointRoundProj.cs +++ b/Projectiles/Ranged/HallowPointRoundProj.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() diff --git a/Projectiles/Ranged/HeavenlyGaleProj.cs b/Projectiles/Ranged/HeavenlyGaleProj.cs index 09e5b1616b..9902e03773 100644 --- a/Projectiles/Ranged/HeavenlyGaleProj.cs +++ b/Projectiles/Ranged/HeavenlyGaleProj.cs @@ -196,7 +196,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D textureGlow = ModContent.Request("CalamityMod/Projectiles/Ranged/HeavenlyGaleProjGlow").Value; Vector2 origin = texture.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition; diff --git a/Projectiles/Ranged/HellbornHoldout.cs b/Projectiles/Ranged/HellbornHoldout.cs index 12a6cb31e7..969adee906 100644 --- a/Projectiles/Ranged/HellbornHoldout.cs +++ b/Projectiles/Ranged/HellbornHoldout.cs @@ -35,8 +35,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 12; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 12; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { @@ -180,7 +180,7 @@ namespace CalamityMod.Projectiles.Ranged if (cooldownTimer > 1) { - if (!Owner.Calamity().mouseRight && cooldownTimer < Owner.itemAnimationMax * 1.7f && !failedShot) + if (!Owner.Calamity().mouseRight && cooldownTimer < Owner.itemAnimationMax * 1.7f && !failedShot && !Main.mouseLeftRelease) Projectile.ai[2] = 0; if (cooldownTimer <= 18 && !hasPlayedReloadSound) { diff --git a/Projectiles/Ranged/HellbornProj.cs b/Projectiles/Ranged/HellbornProj.cs index 9f12d7abfb..288d075844 100644 --- a/Projectiles/Ranged/HellbornProj.cs +++ b/Projectiles/Ranged/HellbornProj.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; + Main.projFrames[Type] = 6; } public override void SetDefaults() diff --git a/Projectiles/Ranged/HighExplosivePeanutShell.cs b/Projectiles/Ranged/HighExplosivePeanutShell.cs index 10fdaa11e0..cefe2998ce 100644 --- a/Projectiles/Ranged/HighExplosivePeanutShell.cs +++ b/Projectiles/Ranged/HighExplosivePeanutShell.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 9; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 9; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Ranged/HiveMissile.cs b/Projectiles/Ranged/HiveMissile.cs index 33ceb2d7f6..a660154ee0 100644 --- a/Projectiles/Ranged/HiveMissile.cs +++ b/Projectiles/Ranged/HiveMissile.cs @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Ranged/HiveNuke.cs b/Projectiles/Ranged/HiveNuke.cs index fd07e0e2ba..cbf2793e2f 100644 --- a/Projectiles/Ranged/HiveNuke.cs +++ b/Projectiles/Ranged/HiveNuke.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.Ranged private Player Owner => Main.player[Projectile.owner]; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { @@ -153,8 +153,8 @@ namespace CalamityMod.Projectiles.Ranged if (BonusEffectMode) { return false; } Texture2D texture = ModContent.Request("CalamityMod/Projectiles/StarProj").Value; if (Time > 6) - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], EffectsColor * 0.4f, 1, texture); - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], EffectsColor * 0.4f, 1, texture); + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Ranged/HolyFireBulletProj.cs b/Projectiles/Ranged/HolyFireBulletProj.cs index 501562259e..1a126bde6b 100644 --- a/Projectiles/Ranged/HolyFireBulletProj.cs +++ b/Projectiles/Ranged/HolyFireBulletProj.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() diff --git a/Projectiles/Ranged/HydraHead.cs b/Projectiles/Ranged/HydraHead.cs index f4a93d2ee6..6cccc366b3 100644 --- a/Projectiles/Ranged/HydraHead.cs +++ b/Projectiles/Ranged/HydraHead.cs @@ -89,7 +89,7 @@ namespace CalamityMod.Projectiles.Ranged public void PerformInitializationEffects() { - int totalHeads = Owner.ownedProjectileCounts[Projectile.type]; + int totalHeads = Owner.ownedProjectileCounts[Type]; CurrentPositionOffset = IdealPositionOffset = new Vector2(Main.rand.NextFloat(-72f - 8f * totalHeads, 72f + 8f * totalHeads), -Main.rand.NextFloat(8f, 84f + 4f * totalHeads)); Projectile.netUpdate = true; } @@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.velocity = (Projectile.velocity * 9f + Projectile.SafeDirectionTo(returnPosition) * flySpeed) / 10f; } - int totalHeads = Owner.ownedProjectileCounts[Projectile.type]; + int totalHeads = Owner.ownedProjectileCounts[Type]; int moveRate = 40 + totalHeads * 4; // Reset the ideal offset from time to time. @@ -229,7 +229,7 @@ namespace CalamityMod.Projectiles.Ranged } bool shouldFlip = Math.Abs(Projectile.rotation) > MathHelper.PiOver2; - Texture2D headTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D headTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(headTexture, Projectile.Center - Main.screenPosition + Vector2.UnitY * Projectile.gfxOffY, null, diff --git a/Projectiles/Ranged/HydraHeadLaunch.cs b/Projectiles/Ranged/HydraHeadLaunch.cs index 96026b9f59..db6d8fc4aa 100644 --- a/Projectiles/Ranged/HydraHeadLaunch.cs +++ b/Projectiles/Ranged/HydraHeadLaunch.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Ranged } //Normal hitbox size for explosion, rotated otherwise - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => (Projectile.ai[1] < 1f ? Projectile.RotatingHitboxCollision(targetHitbox.TopLeft(), targetHitbox.Size()) : null); + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => (Projectile.ai[1] < 1f ? Projectile.RotatingHitboxCollision(targetHitbox) : null); public override void AI() { diff --git a/Projectiles/Ranged/HydrasBlood.cs b/Projectiles/Ranged/HydrasBlood.cs index 0ba74cfb66..ee78b8b6ae 100644 --- a/Projectiles/Ranged/HydrasBlood.cs +++ b/Projectiles/Ranged/HydrasBlood.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox.TopLeft(), targetHitbox.Size()); + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox); public override void AI() { diff --git a/Projectiles/Ranged/HyperiusBulletProj.cs b/Projectiles/Ranged/HyperiusBulletProj.cs index 0399e05bd4..11cf611ac4 100644 --- a/Projectiles/Ranged/HyperiusBulletProj.cs +++ b/Projectiles/Ranged/HyperiusBulletProj.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Ranged public float variance; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() diff --git a/Projectiles/Ranged/HyperiusSplit.cs b/Projectiles/Ranged/HyperiusSplit.cs index 8bff3cfed8..5c8111fc06 100644 --- a/Projectiles/Ranged/HyperiusSplit.cs +++ b/Projectiles/Ranged/HyperiusSplit.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Ranged private bool rotPhase2 = false; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { @@ -104,8 +104,8 @@ namespace CalamityMod.Projectiles.Ranged Texture2D texture = ModContent.Request("CalamityMod/Particles/LargeBloom").Value; Texture2D texture2 = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Lerp(currentColor, Color.White, 0.15f), 1, texture); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.White with { A = 0 }, 1, texture2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Lerp(currentColor, Color.White, 0.15f), 1, texture); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.White with { A = 0 }, 1, texture2); //Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, Color.White, 0, texture.Size() * 0.5f, Projectile.scale * 1.5f, 0, 0f); return false; } diff --git a/Projectiles/Ranged/KingsbaneHoldout.cs b/Projectiles/Ranged/KingsbaneHoldout.cs index 09d7d84584..4f7c6b7c73 100644 --- a/Projectiles/Ranged/KingsbaneHoldout.cs +++ b/Projectiles/Ranged/KingsbaneHoldout.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Ranged } public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 10; + Main.projFrames[Type] = 10; } public override void AI() { @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Ranged { Projectile.frame++; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 2; } diff --git a/Projectiles/Ranged/LeafArrow.cs b/Projectiles/Ranged/LeafArrow.cs index 495a5168e8..e5fb34f26e 100644 --- a/Projectiles/Ranged/LeafArrow.cs +++ b/Projectiles/Ranged/LeafArrow.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Ranged/LeviatitanAberration.cs b/Projectiles/Ranged/LeviatitanAberration.cs index 836c490874..2d8f5fdeef 100644 --- a/Projectiles/Ranged/LeviatitanAberration.cs +++ b/Projectiles/Ranged/LeviatitanAberration.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Ranged public override string Texture => "CalamityMod/Projectiles/Summon/GastricBelcher"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } public override void SetDefaults() @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Ranged { Projectile.frame++; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Ranged/LeviatitanMeteor.cs b/Projectiles/Ranged/LeviatitanMeteor.cs index ef3279a3ea..3cc53d20e9 100644 --- a/Projectiles/Ranged/LeviatitanMeteor.cs +++ b/Projectiles/Ranged/LeviatitanMeteor.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Ranged public override string Texture => "CalamityMod/Projectiles/Melee/AftershockRock"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public static int Lifetime = 600; public override void SetDefaults() @@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Ranged } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Ranged/LuxorsGiftRanged.cs b/Projectiles/Ranged/LuxorsGiftRanged.cs index 70ab922648..07ef96b9fc 100644 --- a/Projectiles/Ranged/LuxorsGiftRanged.cs +++ b/Projectiles/Ranged/LuxorsGiftRanged.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Ranged/MagnaShot.cs b/Projectiles/Ranged/MagnaShot.cs index acdb64ef78..874aa255a4 100644 --- a/Projectiles/Ranged/MagnaShot.cs +++ b/Projectiles/Ranged/MagnaShot.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } public override void OnKill(int timeLeft) diff --git a/Projectiles/Ranged/MagnomalyRocket.cs b/Projectiles/Ranged/MagnomalyRocket.cs index 49bb1cc4b6..12dacb88a4 100644 --- a/Projectiles/Ranged/MagnomalyRocket.cs +++ b/Projectiles/Ranged/MagnomalyRocket.cs @@ -13,10 +13,10 @@ namespace CalamityMod.Projectiles.Ranged private bool spawnedAura = false; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -165,7 +165,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Ranged/MarksmanShot.cs b/Projectiles/Ranged/MarksmanShot.cs index e3db98ad8c..f0ed4e0c90 100644 --- a/Projectiles/Ranged/MarksmanShot.cs +++ b/Projectiles/Ranged/MarksmanShot.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 4000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 4000; } public override void SetDefaults() diff --git a/Projectiles/Ranged/MechanicalBarracuda.cs b/Projectiles/Ranged/MechanicalBarracuda.cs index 0afe862a35..ee921712b0 100644 --- a/Projectiles/Ranged/MechanicalBarracuda.cs +++ b/Projectiles/Ranged/MechanicalBarracuda.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Ranged/MegalodonShot.cs b/Projectiles/Ranged/MegalodonShot.cs index 9d5fba397e..9ecee22bea 100644 --- a/Projectiles/Ranged/MegalodonShot.cs +++ b/Projectiles/Ranged/MegalodonShot.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Ranged bubble.type = Main.rand.NextBool(3) ? 412 : 411; } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 240); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 240); } } diff --git a/Projectiles/Ranged/MeowCreature.cs b/Projectiles/Ranged/MeowCreature.cs index f8b11ada31..081011d165 100644 --- a/Projectiles/Ranged/MeowCreature.cs +++ b/Projectiles/Ranged/MeowCreature.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 36; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 36; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Ranged public override void PostDraw(Color lightColor) { PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f), 30); - Texture2D glow = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D glow = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, glow.Size() * 0.5f, Projectile.scale, SpriteEffects.None); } } diff --git a/Projectiles/Ranged/MineralMortarHoldout.cs b/Projectiles/Ranged/MineralMortarHoldout.cs index aa1f8f32b6..494c7d15f4 100644 --- a/Projectiles/Ranged/MineralMortarHoldout.cs +++ b/Projectiles/Ranged/MineralMortarHoldout.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Ranged { Owner.PickAmmo(Owner.ActiveItem(), out _, out float speed, out int damage, out float knockback, out int usedItemAmmoId); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.velocity.SafeNormalize(Vector2.UnitX) * speed * 1.5f, ModContent.ProjectileType(), damage, knockback, Projectile.owner, usedItemAmmoId); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.velocity.SafeNormalize(Vector2.UnitX) * speed * 1.5f, ModContent.ProjectileType(), damage, knockback, Projectile.owner, usedItemAmmoId); // Doesn't sync this to the server, it's just effects. if (!Main.dedServ) @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 position = Projectile.Center - Main.screenPosition; float rotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); Vector2 origin = texture.Size() * 0.5f; diff --git a/Projectiles/Ranged/MineralMortarProjectile.cs b/Projectiles/Ranged/MineralMortarProjectile.cs index 98a7ae6fec..9e50f46a25 100644 --- a/Projectiles/Ranged/MineralMortarProjectile.cs +++ b/Projectiles/Ranged/MineralMortarProjectile.cs @@ -172,7 +172,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 position = Projectile.Center - Main.screenPosition; float rotation = Projectile.rotation + MathHelper.PiOver2; Vector2 origin = texture.Size() * 0.5f; diff --git a/Projectiles/Ranged/MiniSharkron.cs b/Projectiles/Ranged/MiniSharkron.cs index f0e32544b6..0f1e920e05 100644 --- a/Projectiles/Ranged/MiniSharkron.cs +++ b/Projectiles/Ranged/MiniSharkron.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 2; + Main.projFrames[Type] = 2; } public override void SetDefaults() diff --git a/Projectiles/Ranged/MiniatureFolly.cs b/Projectiles/Ranged/MiniatureFolly.cs index d779746349..a9f4250725 100644 --- a/Projectiles/Ranged/MiniatureFolly.cs +++ b/Projectiles/Ranged/MiniatureFolly.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 2; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame > 1) + if (Projectile.frame > 3) { Projectile.frame = 0; } diff --git a/Projectiles/Ranged/MiniatureFolly.png b/Projectiles/Ranged/MiniatureFolly.png index 0cfd804a6c..f18e06eb3f 100644 Binary files a/Projectiles/Ranged/MiniatureFolly.png and b/Projectiles/Ranged/MiniatureFolly.png differ diff --git a/Projectiles/Ranged/MistArrow.cs b/Projectiles/Ranged/MistArrow.cs index 50b745512a..60782c2b63 100644 --- a/Projectiles/Ranged/MistArrow.cs +++ b/Projectiles/Ranged/MistArrow.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; + Main.projFrames[Type] = 3; } public override void SetDefaults() diff --git a/Projectiles/Ranged/MistArrowFrostMist.cs b/Projectiles/Ranged/MistArrowFrostMist.cs index 64f4f7d36d..2c38992adf 100644 --- a/Projectiles/Ranged/MistArrowFrostMist.cs +++ b/Projectiles/Ranged/MistArrowFrostMist.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; switch (Projectile.ai[0]) { case 0: diff --git a/Projectiles/Ranged/MortarRoundProj.cs b/Projectiles/Ranged/MortarRoundProj.cs index 07ac04dbda..95dee8af46 100644 --- a/Projectiles/Ranged/MortarRoundProj.cs +++ b/Projectiles/Ranged/MortarRoundProj.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Ranged/NorfleetCannon.cs b/Projectiles/Ranged/NorfleetCannon.cs index ff90d3f020..7d1661b57b 100644 --- a/Projectiles/Ranged/NorfleetCannon.cs +++ b/Projectiles/Ranged/NorfleetCannon.cs @@ -194,7 +194,7 @@ namespace CalamityMod.Projectiles.Ranged for (int i = 0; i < 3; i++) { Vector2 firingVelocity = shootDirection.RotatedByRandom((0.2f * i) + 0.02f) * 5f * Main.rand.NextFloat(0.7f, 1.3f); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, firingVelocity, ModContent.ProjectileType(), Projectile.damage / 3, Projectile.knockBack, Projectile.owner, 0, i, PUNISHMENTMODE ? 1 : 0); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, firingVelocity, ModContent.ProjectileType(), Projectile.damage / 3, Projectile.knockBack, Projectile.owner, 0, i, PUNISHMENTMODE ? 1 : 0); } NetUpdate(); diff --git a/Projectiles/Ranged/NorfleetComet.cs b/Projectiles/Ranged/NorfleetComet.cs index bcc684bd6a..6ad655c2d3 100644 --- a/Projectiles/Ranged/NorfleetComet.cs +++ b/Projectiles/Ranged/NorfleetComet.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnKill(int timeLeft) { - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0, Projectile.ai[1], Projectile.ai[2] == 1 ? 1 : 0); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0, Projectile.ai[1], Projectile.ai[2] == 1 ? 1 : 0); if (Projectile.ai[1] == 0) { @@ -184,7 +184,7 @@ namespace CalamityMod.Projectiles.Ranged Main.EntitySpriteDraw(rechargeTexture, Projectile.Center - Main.screenPosition, null, drawColor2 with { A = 0 }, Projectile.rotation, rechargeTexture.Size() * 0.5f, 0.25f * Utils.GetLerpValue(0, 25, time, true) * randSize, SpriteEffects.None, 0); Main.EntitySpriteDraw(rechargeTexture, Projectile.Center - Main.screenPosition, null, Color.White with { A = 0 }, Projectile.rotation, rechargeTexture.Size() * 0.5f, 0.1f * Utils.GetLerpValue(0, 25, time, true) * randSize, SpriteEffects.None, 0); - //CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + //CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 75, targetHitbox); diff --git a/Projectiles/Ranged/NovaChargedShot.cs b/Projectiles/Ranged/NovaChargedShot.cs index 7571a40057..26e5da2318 100644 --- a/Projectiles/Ranged/NovaChargedShot.cs +++ b/Projectiles/Ranged/NovaChargedShot.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Ranged } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Ranged/NovaShot.cs b/Projectiles/Ranged/NovaShot.cs index 01f16f0119..c121177a34 100644 --- a/Projectiles/Ranged/NovaShot.cs +++ b/Projectiles/Ranged/NovaShot.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Ranged } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Ranged/Nuke.cs b/Projectiles/Ranged/Nuke.cs index 255fa30cd0..dd6560362e 100644 --- a/Projectiles/Ranged/Nuke.cs +++ b/Projectiles/Ranged/Nuke.cs @@ -18,9 +18,9 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 3; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -208,7 +208,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Ranged/NullShot.cs b/Projectiles/Ranged/NullShot.cs index 972d90826a..73d93eb49b 100644 --- a/Projectiles/Ranged/NullShot.cs +++ b/Projectiles/Ranged/NullShot.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 25; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 25; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { @@ -225,8 +225,8 @@ namespace CalamityMod.Projectiles.Ranged Asset tex = ModContent.Request("CalamityMod/Particles/DrainLineBloom"); Asset tex2 = ModContent.Request("CalamityMod/Particles/DrainLine"); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], baseColor with { A = 0 } * 0.35f, 1, tex.Value); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Projectile.ai[1] == 5 ? Color.Black : Color.Lerp(baseColor, Color.White, 0.5f), 1, tex2.Value, true, true); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], baseColor with { A = 0 } * 0.35f, 1, tex.Value); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Projectile.ai[1] == 5 ? Color.Black : Color.Lerp(baseColor, Color.White, 0.5f), 1, tex2.Value, true, true); return false; } } diff --git a/Projectiles/Ranged/OntologicalDespoilerGrenade.cs b/Projectiles/Ranged/OntologicalDespoilerGrenade.cs index 31553262ae..b48b7d0628 100644 --- a/Projectiles/Ranged/OntologicalDespoilerGrenade.cs +++ b/Projectiles/Ranged/OntologicalDespoilerGrenade.cs @@ -27,8 +27,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 25; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 25; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { @@ -186,7 +186,7 @@ namespace CalamityMod.Projectiles.Ranged SoundStyle fire2 = new("CalamityMod/Sounds/Item/ShadowboltReflect"); SoundEngine.PlaySound(fire2 with { Volume = 0.9f, Pitch = -0.4f}, Projectile.Center); - Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 12f), Projectile.knockBack * 3, Projectile.owner, 0, 0, 0); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 12f), Projectile.knockBack * 3, Projectile.owner, 0, 0, 0); } else { @@ -216,8 +216,8 @@ namespace CalamityMod.Projectiles.Ranged Asset tex = ModContent.Request("CalamityMod/Particles/DrainLineBloom2"); Asset tex2 = ModContent.Request("CalamityMod/Particles/DrainLine2"); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], baseColor with { A = 0 } * 0.8f, 1, tex.Value); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Black, 1, tex2.Value, true, true); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], baseColor with { A = 0 } * 0.8f, 1, tex.Value); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Black, 1, tex2.Value, true, true); Asset tex3 = ModContent.Request("CalamityMod/Projectiles/Ranged/OntologicalDespoilerGrenade"); Rectangle frame = tex3.Frame(1, 6, 0, Projectile.frame); diff --git a/Projectiles/Ranged/OntologicalDespoilerShot.cs b/Projectiles/Ranged/OntologicalDespoilerShot.cs index d4bd330f5e..17077e746b 100644 --- a/Projectiles/Ranged/OntologicalDespoilerShot.cs +++ b/Projectiles/Ranged/OntologicalDespoilerShot.cs @@ -29,8 +29,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 25; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 25; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { @@ -205,8 +205,8 @@ namespace CalamityMod.Projectiles.Ranged Asset tex = ModContent.Request("CalamityMod/Particles/DrainLineBloom2"); Asset tex2 = ModContent.Request("CalamityMod/Particles/DrainLine2"); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], baseColor with { A = 0 } * 0.8f, 1, tex.Value); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Positive ? Color.Lerp(Color.White, baseColor, MathHelper.Clamp(Utils.GetLerpValue(50, 175, time, true), 0, 0.5f)) with { A = 0 } : Color.Black, 1, tex2.Value, true, true); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], baseColor with { A = 0 } * 0.8f, 1, tex.Value); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Positive ? Color.Lerp(Color.White, baseColor, MathHelper.Clamp(Utils.GetLerpValue(50, 175, time, true), 0, 0.5f)) with { A = 0 } : Color.Black, 1, tex2.Value, true, true); Asset tex3 = ModContent.Request("CalamityMod/Projectiles/Ranged/OntologicalDespoilerShot"); Asset tex4 = ModContent.Request("CalamityMod/Projectiles/Ranged/OntologicalDespoilerShot2"); diff --git a/Projectiles/Ranged/OpalChargedStrike.cs b/Projectiles/Ranged/OpalChargedStrike.cs index 6abb6efd69..52cf57f8aa 100644 --- a/Projectiles/Ranged/OpalChargedStrike.cs +++ b/Projectiles/Ranged/OpalChargedStrike.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) diff --git a/Projectiles/Ranged/OpalStrike.cs b/Projectiles/Ranged/OpalStrike.cs index e4fa59607f..c2d0bbc307 100644 --- a/Projectiles/Ranged/OpalStrike.cs +++ b/Projectiles/Ranged/OpalStrike.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) diff --git a/Projectiles/Ranged/PhotovisceratorHoldout.cs b/Projectiles/Ranged/PhotovisceratorHoldout.cs index 0d13e87d20..3038418116 100644 --- a/Projectiles/Ranged/PhotovisceratorHoldout.cs +++ b/Projectiles/Ranged/PhotovisceratorHoldout.cs @@ -288,7 +288,7 @@ namespace CalamityMod.Projectiles.Ranged public override void PostDraw(Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 origin = new Vector2(85f, 33f); SpriteEffects spriteEffects = SpriteEffects.None; if (Projectile.spriteDirection == -1) diff --git a/Projectiles/Ranged/PlagueArrow.cs b/Projectiles/Ranged/PlagueArrow.cs index 6a40f1bd25..f6ee408e98 100644 --- a/Projectiles/Ranged/PlagueArrow.cs +++ b/Projectiles/Ranged/PlagueArrow.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Ranged/PlagueTaintedDrone.cs b/Projectiles/Ranged/PlagueTaintedDrone.cs index 85511f3095..834053e7a0 100644 --- a/Projectiles/Ranged/PlagueTaintedDrone.cs +++ b/Projectiles/Ranged/PlagueTaintedDrone.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } @@ -81,7 +81,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; NPC target = Projectile.FindTargetWithinRange(1600f); @@ -91,8 +91,8 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int height = texture.Height / Main.projFrames[Type]; int drawStart = height * Projectile.frame; Vector2 origin = Projectile.Size / 2; Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, drawStart, texture.Width, height)), Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); @@ -101,8 +101,8 @@ namespace CalamityMod.Projectiles.Ranged public override void PostDraw(Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int height = texture.Height / Main.projFrames[Type]; int drawStart = height * Projectile.frame; Vector2 origin = Projectile.Size / 2; SpriteEffects spriteEffects = SpriteEffects.None; diff --git a/Projectiles/Ranged/PlagueTaintedProjectile.cs b/Projectiles/Ranged/PlagueTaintedProjectile.cs index 93191a077a..1c24282b48 100644 --- a/Projectiles/Ranged/PlagueTaintedProjectile.cs +++ b/Projectiles/Ranged/PlagueTaintedProjectile.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() diff --git a/Projectiles/Ranged/PlanarRipperBolt.cs b/Projectiles/Ranged/PlanarRipperBolt.cs index 217acf83c3..48917303c7 100644 --- a/Projectiles/Ranged/PlanarRipperBolt.cs +++ b/Projectiles/Ranged/PlanarRipperBolt.cs @@ -17,9 +17,9 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Ranged/PlasmaBlast.cs b/Projectiles/Ranged/PlasmaBlast.cs index 6eba241bce..4c9fda47d3 100644 --- a/Projectiles/Ranged/PlasmaBlast.cs +++ b/Projectiles/Ranged/PlasmaBlast.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) diff --git a/Projectiles/Ranged/PressurizedBubbleStream.cs b/Projectiles/Ranged/PressurizedBubbleStream.cs index 54b78cc3e1..4b593181e5 100644 --- a/Projectiles/Ranged/PressurizedBubbleStream.cs +++ b/Projectiles/Ranged/PressurizedBubbleStream.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Particles; using Microsoft.Xna.Framework; @@ -32,9 +33,11 @@ namespace CalamityMod.Projectiles.Ranged Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.DamageType = DamageClass.Ranged; - Projectile.penetrate = 1; + Projectile.penetrate = 3; Projectile.extraUpdates = 4; Projectile.timeLeft = FireTime + ChargeupTime; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override bool ShouldUpdatePosition() @@ -80,7 +83,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 bubblePosition = Owner.MountedCenter - Vector2.UnitY * 4f + bubbleRotation.ToRotationVector2() * 55f; - SoundEngine.PlaySound(ReedBlowgun.BubbleBurstSound, bubblePosition); + SoundEngine.PlaySound(SoundID.Item64, bubblePosition); } Projectile.velocity *= 0.985f; @@ -130,7 +133,8 @@ namespace CalamityMod.Projectiles.Ranged waterDust.velocity -= Projectile.velocity * 0.1f; } } - + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item21, Projectile.position); diff --git a/Projectiles/Ranged/PrismComet.cs b/Projectiles/Ranged/PrismComet.cs index ce8d5fa495..94d0ccf5c0 100644 --- a/Projectiles/Ranged/PrismComet.cs +++ b/Projectiles/Ranged/PrismComet.cs @@ -13,10 +13,10 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Ranged Lighting.AddLight(Projectile.Center, Color.LightSeaGreen.ToVector3()); Projectile.frameCounter++; if (Projectile.frameCounter % 6 == 5) - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; Projectile.alpha = Utils.Clamp(Projectile.alpha - 25, 30, 255); @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); return false; } diff --git a/Projectiles/Ranged/PrismEnergyBullet.cs b/Projectiles/Ranged/PrismEnergyBullet.cs index e28af7dd0d..7de5fd8833 100644 --- a/Projectiles/Ranged/PrismEnergyBullet.cs +++ b/Projectiles/Ranged/PrismEnergyBullet.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 origin = texture.Size() * 0.5f; Vector2 currentDirection = Projectile.velocity.SafeNormalize(Vector2.Zero); for (int i = 0; i < CurrentLaserLength; i++) diff --git a/Projectiles/Ranged/PrismExplosionLarge.cs b/Projectiles/Ranged/PrismExplosionLarge.cs index 9279a24993..d8fefeee20 100644 --- a/Projectiles/Ranged/PrismExplosionLarge.cs +++ b/Projectiles/Ranged/PrismExplosionLarge.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D lightTexture = ModContent.Request("CalamityMod/ExtraTextures/SmallGreyscaleCircle").Value; Rectangle frame = texture.Frame(3, 6, Projectile.frame / 6, Projectile.frame % 6); Vector2 drawPosition = Projectile.Center - Main.screenPosition; diff --git a/Projectiles/Ranged/PrismExplosionSmall.cs b/Projectiles/Ranged/PrismExplosionSmall.cs index 1a7fff1cfc..c4f8675e0f 100644 --- a/Projectiles/Ranged/PrismExplosionSmall.cs +++ b/Projectiles/Ranged/PrismExplosionSmall.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 7; + Main.projFrames[Type] = 7; } public override void SetDefaults() @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Ranged if (Projectile.frameCounter % 8 == 7) Projectile.frame++; - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.Kill(); Projectile.scale *= 1.0115f; Projectile.Opacity = Utils.GetLerpValue(5f, 36f, Projectile.timeLeft, true); @@ -43,9 +43,9 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D lightTexture = ModContent.Request("CalamityMod/ExtraTextures/SmallGreyscaleCircle").Value; - Rectangle frame = texture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 drawPosition = Projectile.Center - Main.screenPosition; Vector2 origin = frame.Size() * 0.5f; diff --git a/Projectiles/Ranged/PrismMine.cs b/Projectiles/Ranged/PrismMine.cs index d677b63c99..de7662ace0 100644 --- a/Projectiles/Ranged/PrismMine.cs +++ b/Projectiles/Ranged/PrismMine.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D baseTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D baseTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D glowTexture = ModContent.Request($"{Texture}Glowmask").Value; Texture2D laserTexture = ModContent.Request($"CalamityMod/Projectiles/Ranged/PrismMineArc").Value; diff --git a/Projectiles/Ranged/PrismaticEnergyBlast.cs b/Projectiles/Ranged/PrismaticEnergyBlast.cs index 2fe416f9c6..e7f29f76f0 100644 --- a/Projectiles/Ranged/PrismaticEnergyBlast.cs +++ b/Projectiles/Ranged/PrismaticEnergyBlast.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; } public override void SetDefaults() @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { // Start texture drawing. - Rectangle beginFrame = LaserBeginTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Rectangle beginFrame = LaserBeginTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Main.EntitySpriteDraw(LaserBeginTexture, Projectile.Center - Main.screenPosition, beginFrame, @@ -108,14 +108,14 @@ namespace CalamityMod.Projectiles.Ranged // Prepare things for body drawing. float laserBodyLength = LaserLength; - laserBodyLength -= (LaserBeginTexture.Height * 0.5f + LaserEndTexture.Height) * Projectile.scale / Main.projFrames[Projectile.type]; + laserBodyLength -= (LaserBeginTexture.Height * 0.5f + LaserEndTexture.Height) * Projectile.scale / Main.projFrames[Type]; Vector2 centerOnLaser = Projectile.Center; // Body drawing. - Rectangle middleFrame = LaserMiddleTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Rectangle middleFrame = LaserMiddleTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); if (laserBodyLength > 30f) { - float laserOffset = (LaserMiddleTexture.Height - 10f) * Projectile.scale / Main.projFrames[Projectile.type]; + float laserOffset = (LaserMiddleTexture.Height - 10f) * Projectile.scale / Main.projFrames[Type]; float incrementalBodyLength = 0f; while (incrementalBodyLength + 1f < laserBodyLength) { @@ -134,7 +134,7 @@ namespace CalamityMod.Projectiles.Ranged } // End texture drawing. - Rectangle endFrame = LaserEndTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Rectangle endFrame = LaserEndTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 laserEndCenter = centerOnLaser - Main.screenPosition; Main.EntitySpriteDraw(LaserEndTexture, laserEndCenter, diff --git a/Projectiles/Ranged/PristineSecondary.cs b/Projectiles/Ranged/PristineSecondary.cs index ef5744f2d4..be33fda1e1 100644 --- a/Projectiles/Ranged/PristineSecondary.cs +++ b/Projectiles/Ranged/PristineSecondary.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Ranged { Main.spriteBatch.SetBlendState(BlendState.Additive); - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; float opacity = Utils.GetLerpValue(0f, 0.08f, LightPower, true) * Projectile.Opacity * 0.5f; Color drawColor = FogColor * opacity; diff --git a/Projectiles/Ranged/PumplerHoldout.cs b/Projectiles/Ranged/PumplerHoldout.cs index 6dea938198..54844c1430 100644 --- a/Projectiles/Ranged/PumplerHoldout.cs +++ b/Projectiles/Ranged/PumplerHoldout.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 9; + Main.projFrames[Type] = 9; } private Player Owner => Main.player[Projectile.owner]; @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Ranged if (Projectile.frameCounter >= 10) //10 fps anim { Projectile.frame++; - if (Projectile.frame >= Main.projFrames[Projectile.type] - 1) + if (Projectile.frame >= Main.projFrames[Type] - 1) Projectile.frame = 0; Projectile.frameCounter = 0; } @@ -232,8 +232,8 @@ namespace CalamityMod.Projectiles.Ranged GameShaders.Misc["CalamityMod:BasicTint"].Apply(); Vector2 drawPosition = Projectile.Center - Main.screenPosition; - Rectangle frameRectangle = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Frame(1, 9, 0, Projectile.frame); - Main.EntitySpriteDraw(Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value, drawPosition, frameRectangle, lightColor, Projectile.rotation, frameRectangle.Size() * 0.5f, 1f, Projectile.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); + Rectangle frameRectangle = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Frame(1, 9, 0, Projectile.frame); + Main.EntitySpriteDraw(Terraria.GameContent.TextureAssets.Projectile[Type].Value, drawPosition, frameRectangle, lightColor, Projectile.rotation, frameRectangle.Size() * 0.5f, 1f, Projectile.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); Main.spriteBatch.ExitShaderRegion(); diff --git a/Projectiles/Ranged/RainbowFront.cs b/Projectiles/Ranged/RainbowFront.cs index b8154deb06..0a4305437a 100644 --- a/Projectiles/Ranged/RainbowFront.cs +++ b/Projectiles/Ranged/RainbowFront.cs @@ -7,6 +7,7 @@ namespace CalamityMod.Projectiles.Ranged public class RainbowFront : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "Terraria/Images/Projectile_251"; public override void SetDefaults() { Projectile.width = 12; diff --git a/Projectiles/Ranged/RainbowFront.png b/Projectiles/Ranged/RainbowFront.png deleted file mode 100644 index 5ee9d346d1..0000000000 Binary files a/Projectiles/Ranged/RainbowFront.png and /dev/null differ diff --git a/Projectiles/Ranged/RainbowTrail.cs b/Projectiles/Ranged/RainbowTrail.cs index 20abe41bb0..b785e78402 100644 --- a/Projectiles/Ranged/RainbowTrail.cs +++ b/Projectiles/Ranged/RainbowTrail.cs @@ -6,7 +6,7 @@ namespace CalamityMod.Projectiles.Ranged public class RainbowTrail : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; - public override string Texture => "CalamityMod/Projectiles/Ranged/RainbowFront"; + public override string Texture => "Terraria/Images/Projectile_251"; public override void SetDefaults() { diff --git a/Projectiles/Ranged/RealmRavagerBullet.cs b/Projectiles/Ranged/RealmRavagerBullet.cs index 64d52761a0..76570d8ccd 100644 --- a/Projectiles/Ranged/RealmRavagerBullet.cs +++ b/Projectiles/Ranged/RealmRavagerBullet.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() diff --git a/Projectiles/Ranged/RicoshotCoin.cs b/Projectiles/Ranged/RicoshotCoin.cs index 96d3acca3c..b8090108e7 100644 --- a/Projectiles/Ranged/RicoshotCoin.cs +++ b/Projectiles/Ranged/RicoshotCoin.cs @@ -91,9 +91,9 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 60; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - Main.projFrames[Projectile.type] = 8; + ProjectileID.Sets.TrailCacheLength[Type] = 60; + ProjectileID.Sets.TrailingMode[Type] = 0; + Main.projFrames[Type] = 8; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } @@ -140,7 +140,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; // Produce a tiny amount of light based on coin type. @@ -253,8 +253,8 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int numFrames = Main.projFrames[Projectile.type]; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int numFrames = Main.projFrames[Type]; Rectangle frame = new Rectangle( /* X */ (int)CoinType * tex.Width / 3, /* Y */ Projectile.frame * tex.Height / numFrames, diff --git a/Projectiles/Ranged/RocketFire.cs b/Projectiles/Ranged/RocketFire.cs index 47a34a1452..899990b1ac 100644 --- a/Projectiles/Ranged/RocketFire.cs +++ b/Projectiles/Ranged/RocketFire.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 3; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Ranged if (!initialized) { initialized = true; - Projectile.frame = Main.rand.Next(Main.projFrames[Projectile.type]); + Projectile.frame = Main.rand.Next(Main.projFrames[Type]); } Projectile.frameCounter++; if (Projectile.frameCounter > 6) @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -129,7 +129,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Ranged/RubberMortarRoundProj.cs b/Projectiles/Ranged/RubberMortarRoundProj.cs index 8355606f88..1c734273d3 100644 --- a/Projectiles/Ranged/RubberMortarRoundProj.cs +++ b/Projectiles/Ranged/RubberMortarRoundProj.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Ranged/SandblasterBullet.cs b/Projectiles/Ranged/SandblasterBullet.cs index f0c141ba49..7bdf86ebc3 100644 --- a/Projectiles/Ranged/SandblasterBullet.cs +++ b/Projectiles/Ranged/SandblasterBullet.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Ranged/ScorchedEarthRocket.cs b/Projectiles/Ranged/ScorchedEarthRocket.cs index 5066793bdd..2e1a91320e 100644 --- a/Projectiles/Ranged/ScorchedEarthRocket.cs +++ b/Projectiles/Ranged/ScorchedEarthRocket.cs @@ -10,10 +10,10 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 10; + Main.projFrames[Type] = 10; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 6; } @@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Ranged/ScorpioHoldout.cs b/Projectiles/Ranged/ScorpioHoldout.cs index 36669dd5f8..ea27ca7445 100644 --- a/Projectiles/Ranged/ScorpioHoldout.cs +++ b/Projectiles/Ranged/ScorpioHoldout.cs @@ -143,7 +143,7 @@ namespace CalamityMod.Projectiles.Ranged } // Spawns the projectile. - Projectile.NewProjectileDirect( + Projectile.NewProjectile( Projectile.GetSource_FromThis(), GunTipPosition, projectileVelocity.RotatedByRandom(isRMB ? 0f : MathHelper.PiOver4) * projSpeed * (isRMB ? 1f : Main.rand.NextFloat(0.8f, 1f)), @@ -194,7 +194,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D glowTexture = Request(GlowTexture).Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Color drawColor = Projectile.GetAlpha(lightColor); diff --git a/Projectiles/Ranged/ScorpioLargeRocket.cs b/Projectiles/Ranged/ScorpioLargeRocket.cs index aad9d581b0..0e6e837318 100644 --- a/Projectiles/Ranged/ScorpioLargeRocket.cs +++ b/Projectiles/Ranged/ScorpioLargeRocket.cs @@ -210,7 +210,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D glowTexture = Request("CalamityMod/Projectiles/Ranged/ScorpioLargeRocket_Glow").Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); diff --git a/Projectiles/Ranged/ScorpioRocket.cs b/Projectiles/Ranged/ScorpioRocket.cs index f1f39ce548..4b5e53b013 100644 --- a/Projectiles/Ranged/ScorpioRocket.cs +++ b/Projectiles/Ranged/ScorpioRocket.cs @@ -159,7 +159,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D glowTexture = Request("CalamityMod/Projectiles/Ranged/ScorpioRocket_Glow").Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); diff --git a/Projectiles/Ranged/SeasSearingBubble.cs b/Projectiles/Ranged/SeasSearingBubble.cs index a9a0fa85c7..f6f3aa3cb7 100644 --- a/Projectiles/Ranged/SeasSearingBubble.cs +++ b/Projectiles/Ranged/SeasSearingBubble.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Ranged/SeasSearingSpout.cs b/Projectiles/Ranged/SeasSearingSpout.cs index 1a0f8a08e4..51c231e793 100644 --- a/Projectiles/Ranged/SeasSearingSpout.cs +++ b/Projectiles/Ranged/SeasSearingSpout.cs @@ -9,9 +9,11 @@ namespace CalamityMod.Projectiles.Ranged public class SeasSearingSpout : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "CalamityMod/Projectiles/Melee/BrinySpout"; + public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; + Main.projFrames[Type] = 6; } public override void SetDefaults() @@ -118,8 +120,8 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Ranged/SeasSearingSpout.png b/Projectiles/Ranged/SeasSearingSpout.png deleted file mode 100644 index 1cca5e1bae..0000000000 Binary files a/Projectiles/Ranged/SeasSearingSpout.png and /dev/null differ diff --git a/Projectiles/Ranged/SepticSkewerHarpoon.cs b/Projectiles/Ranged/SepticSkewerHarpoon.cs index d53a9969ce..10ffcec20c 100644 --- a/Projectiles/Ranged/SepticSkewerHarpoon.cs +++ b/Projectiles/Ranged/SepticSkewerHarpoon.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Ranged public bool pullCheckValid => ((chosenTarget != null && chosenTarget.life < Projectile.damage * 28f && !calledToPull && chosenTarget.realLife == -1 && !normalHit) || Main.zenithWorld); public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public Vector2 DrawStartPosition { @@ -256,15 +256,15 @@ namespace CalamityMod.Projectiles.Ranged closestTarget = Main.npc[index]; } } - if (Main.zenithWorld && Main.npc[index] != null && index < 80 && Main.npc[index].realLife == -1 && Owner.ownedProjectileCounts[Projectile.type] < 80) + if (Main.zenithWorld && Main.npc[index] != null && index < 80 && Main.npc[index].realLife == -1 && Owner.ownedProjectileCounts[Type] < 80) { closestTarget = Main.npc[index]; - Projectile harpoon = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center, ((closestTarget.Center - Owner.Center + closestTarget.velocity * 1.5f).SafeNormalize(Vector2.UnitX) * 18), Projectile.type, Projectile.damage, Projectile.knockBack, Projectile.owner, 0, Projectile.ai[1] + 1); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center, ((closestTarget.Center - Owner.Center + closestTarget.velocity * 1.5f).SafeNormalize(Vector2.UnitX) * 18), Projectile.type, Projectile.damage, Projectile.knockBack, Projectile.owner, 0, Projectile.ai[1] + 1); } } if (closestTarget != null) { - Projectile harpoon = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center, ((closestTarget.Center - Owner.Center + closestTarget.velocity * 1.5f).SafeNormalize(Vector2.UnitX) * 18), Projectile.type, Projectile.damage, Projectile.knockBack, Projectile.owner, 0, Projectile.ai[1] + 1); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center, ((closestTarget.Center - Owner.Center + closestTarget.velocity * 1.5f).SafeNormalize(Vector2.UnitX) * 18), Projectile.type, Projectile.damage, Projectile.knockBack, Projectile.owner, 0, Projectile.ai[1] + 1); } int heal = 25; @@ -377,7 +377,7 @@ namespace CalamityMod.Projectiles.Ranged { chosenTarget.velocity += storedVelocity * (strongEnemy ? 0.3f : 1.5f); hasLatchedTarget = true; - if ((chosenTarget.life <= chosenTarget.lifeMax * 0.3f) || chosenTarget.boss) + if ((chosenTarget.lifeMax >= Projectile.damage * 28f) || chosenTarget.boss) strongEnemy = true; SoundStyle sound5 = new("CalamityMod/Sounds/Item/HeliumFlashCoreImpact"); SoundEngine.PlaySound(sound5 with { Volume = 0.55f, Pitch = Main.rand.NextFloat(-0.3f, -0.4f) }, Projectile.Center); diff --git a/Projectiles/Ranged/SevensStrikerHoldout.cs b/Projectiles/Ranged/SevensStrikerHoldout.cs index 52c5f49420..b94d1e005f 100644 --- a/Projectiles/Ranged/SevensStrikerHoldout.cs +++ b/Projectiles/Ranged/SevensStrikerHoldout.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 19; + Main.projFrames[Type] = 19; } public override void SetDefaults() @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.frameCounter = 0; } // Once the animation is finished, stop rolling, set the extra timer to 16 frames, and reset the sprite to frame 0 - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { rolling = false; rolltimer = 16; @@ -214,7 +214,7 @@ namespace CalamityMod.Projectiles.Ranged // Sounds // Crank & new casino - if (Projectile.frameCounter == 0 && Projectile.frame == 2 * (Main.projFrames[Projectile.type] / 19)) + if (Projectile.frameCounter == 0 && Projectile.frame == 2 * (Main.projFrames[Type] / 19)) { SoundEngine.PlaySound(SoundID.Item108 with { Volume = SoundID.Item108.Volume * 0.9f }, Projectile.Center); RouletteSoundSlot = SoundEngine.PlaySound(TheSevensStriker.RouletteSound, Projectile.Center); @@ -340,7 +340,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 drawOrigin = new Vector2(Owner.direction < 0 ? gun.Width - 33f : 33f, 33f); Vector2 drawOffset = Owner.MountedCenter + Projectile.rotation.ToRotationVector2() - Main.screenPosition; drawOffset.Y -= 10; - int indframeheight = gun.Height / Main.projFrames[Projectile.type]; + int indframeheight = gun.Height / Main.projFrames[Type]; int currentframe = indframeheight * Projectile.frame; Rectangle frame = new Rectangle(0, currentframe, gun.Width, indframeheight); diff --git a/Projectiles/Ranged/ShockblastRound.cs b/Projectiles/Ranged/ShockblastRound.cs index fab6292353..fd34f249f8 100644 --- a/Projectiles/Ranged/ShockblastRound.cs +++ b/Projectiles/Ranged/ShockblastRound.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Ranged/Shroom.cs b/Projectiles/Ranged/Shroom.cs index e708d40665..0adf02657b 100644 --- a/Projectiles/Ranged/Shroom.cs +++ b/Projectiles/Ranged/Shroom.cs @@ -8,11 +8,13 @@ namespace CalamityMod.Projectiles.Ranged public class Shroom : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "Terraria/Images/Item_183"; + public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -39,7 +41,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Ranged/Shroom.png b/Projectiles/Ranged/Shroom.png deleted file mode 100644 index a6cd029b87..0000000000 Binary files a/Projectiles/Ranged/Shroom.png and /dev/null differ diff --git a/Projectiles/Ranged/SicknessRound.cs b/Projectiles/Ranged/SicknessRound.cs index 0140d85c0a..b67f488a47 100644 --- a/Projectiles/Ranged/SicknessRound.cs +++ b/Projectiles/Ranged/SicknessRound.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Ranged/SicknessRound2.cs b/Projectiles/Ranged/SicknessRound2.cs index 44e91f2563..0cf0fafcba 100644 --- a/Projectiles/Ranged/SicknessRound2.cs +++ b/Projectiles/Ranged/SicknessRound2.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Ranged/SlagRound.cs b/Projectiles/Ranged/SlagRound.cs index 919494bf8b..acfbcffc99 100644 --- a/Projectiles/Ranged/SlagRound.cs +++ b/Projectiles/Ranged/SlagRound.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() diff --git a/Projectiles/Ranged/SlimeBolt.cs b/Projectiles/Ranged/SlimeBolt.cs index efe0d6612b..a89ee193a5 100644 --- a/Projectiles/Ranged/SlimeBolt.cs +++ b/Projectiles/Ranged/SlimeBolt.cs @@ -28,8 +28,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -143,7 +143,7 @@ namespace CalamityMod.Projectiles.Ranged { Main.spriteBatch.SetBlendState(BlendState.Additive); - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Main.EntitySpriteDraw(texture, drawPosition, null, SlimeColor, Projectile.rotation, texture.Size() * 0.5f, Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Ranged/SpeedBlasterShot.cs b/Projectiles/Ranged/SpeedBlasterShot.cs index d5258593dc..f55c9d7c5d 100644 --- a/Projectiles/Ranged/SpeedBlasterShot.cs +++ b/Projectiles/Ranged/SpeedBlasterShot.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() diff --git a/Projectiles/Ranged/SporeBomb.cs b/Projectiles/Ranged/SporeBomb.cs index 8bf8a13126..8dce1067ed 100644 --- a/Projectiles/Ranged/SporeBomb.cs +++ b/Projectiles/Ranged/SporeBomb.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Ranged/SputterComet.cs b/Projectiles/Ranged/SputterComet.cs index 8a519534ad..c0f6a38eb1 100644 --- a/Projectiles/Ranged/SputterComet.cs +++ b/Projectiles/Ranged/SputterComet.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Ranged/SputterCometBig.cs b/Projectiles/Ranged/SputterCometBig.cs index 60555865fe..99391f093e 100644 --- a/Projectiles/Ranged/SputterCometBig.cs +++ b/Projectiles/Ranged/SputterCometBig.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Ranged/SpykerProj.cs b/Projectiles/Ranged/SpykerProj.cs index 34ccd4eba6..78994fca75 100644 --- a/Projectiles/Ranged/SpykerProj.cs +++ b/Projectiles/Ranged/SpykerProj.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Ranged/StarfleetMK2Gun.cs b/Projectiles/Ranged/StarfleetMK2Gun.cs index 9b872555ba..304bdf7b2b 100644 --- a/Projectiles/Ranged/StarfleetMK2Gun.cs +++ b/Projectiles/Ranged/StarfleetMK2Gun.cs @@ -102,7 +102,6 @@ namespace CalamityMod.Projectiles.Ranged { ModContent.ProjectileType(), ModContent.ProjectileType(), - ModContent.ProjectileType(), ProjectileID.StarCannonStar, ProjectileID.Starfury }); diff --git a/Projectiles/Ranged/StarmageddonBinaryStarCenter.cs b/Projectiles/Ranged/StarmageddonBinaryStarCenter.cs index 13f69b0956..30c4c325b1 100644 --- a/Projectiles/Ranged/StarmageddonBinaryStarCenter.cs +++ b/Projectiles/Ranged/StarmageddonBinaryStarCenter.cs @@ -35,8 +35,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; - ProjectileID.Sets.NeedsUUID[Projectile.type] = true; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; + ProjectileID.Sets.NeedsUUID[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Ranged/StarmageddonHeld.cs b/Projectiles/Ranged/StarmageddonHeld.cs index b19eea0f43..87f3bc97ff 100644 --- a/Projectiles/Ranged/StarmageddonHeld.cs +++ b/Projectiles/Ranged/StarmageddonHeld.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 8; - ProjectileID.Sets.NeedsUUID[Projectile.type] = true; + Main.projFrames[Type] = 8; + ProjectileID.Sets.NeedsUUID[Type] = true; } public override void SetDefaults() @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 7; bool timeToFire = noStars && Projectile.frame == 7; @@ -155,8 +155,8 @@ namespace CalamityMod.Projectiles.Ranged public override void PostDraw(Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int height = texture.Height / Main.projFrames[Type]; int drawStart = height * Projectile.frame; Vector2 origin = Projectile.Size / 2; SpriteEffects spriteEffects = SpriteEffects.None; diff --git a/Projectiles/Ranged/StarmageddonStar.cs b/Projectiles/Ranged/StarmageddonStar.cs index fbc18cf57d..1f37ecea6d 100644 --- a/Projectiles/Ranged/StarmageddonStar.cs +++ b/Projectiles/Ranged/StarmageddonStar.cs @@ -23,9 +23,9 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; double deg = Projectile.ai[2]; @@ -138,7 +138,6 @@ namespace CalamityMod.Projectiles.Ranged { ModContent.ProjectileType(), ModContent.ProjectileType(), - ModContent.ProjectileType(), ProjectileID.StarCannonStar, ProjectileID.Starfury }); @@ -146,7 +145,7 @@ namespace CalamityMod.Projectiles.Ranged int star = Projectile.NewProjectile(Projectile.GetSource_FromThis(), position, speed, type, Projectile.damage / 2, Projectile.knockBack * 0.5f, Projectile.owner); if (star.WithinBounds(Main.maxProjectiles)) { - if (type == ModContent.ProjectileType() || type == ModContent.ProjectileType() || type == ModContent.ProjectileType()) + if (type == ModContent.ProjectileType() || type == ModContent.ProjectileType()) Main.projectile[star].ai[0] = 1f; Main.projectile[star].extraUpdates += 4; @@ -164,8 +163,8 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int height = texture.Height / Main.projFrames[Type]; int drawStart = height * Projectile.frame; Vector2 origin = Projectile.Size / 2; Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, drawStart, texture.Width, height)), Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Ranged/StarmageddonStar2.cs b/Projectiles/Ranged/StarmageddonStar2.cs index d5f6d2b84d..99b8d1a175 100644 --- a/Projectiles/Ranged/StarmageddonStar2.cs +++ b/Projectiles/Ranged/StarmageddonStar2.cs @@ -23,9 +23,9 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; double deg = Projectile.ai[2]; @@ -138,7 +138,6 @@ namespace CalamityMod.Projectiles.Ranged { ModContent.ProjectileType(), ModContent.ProjectileType(), - ModContent.ProjectileType(), ProjectileID.StarCannonStar, ProjectileID.Starfury }); @@ -146,7 +145,7 @@ namespace CalamityMod.Projectiles.Ranged int star = Projectile.NewProjectile(Projectile.GetSource_FromThis(), position, speed, type, Projectile.damage / 2, Projectile.knockBack * 0.5f, Projectile.owner); if (star.WithinBounds(Main.maxProjectiles)) { - if (type == ModContent.ProjectileType() || type == ModContent.ProjectileType() || type == ModContent.ProjectileType()) + if (type == ModContent.ProjectileType() || type == ModContent.ProjectileType()) Main.projectile[star].ai[0] = 1f; Main.projectile[star].extraUpdates += 4; @@ -164,8 +163,8 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int height = texture.Height / Main.projFrames[Type]; int drawStart = height * Projectile.frame; Vector2 origin = Projectile.Size / 2; Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, drawStart, texture.Width, height)), Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Ranged/StormSurgeTornado.cs b/Projectiles/Ranged/StormSurgeTornado.cs index a66d24cc72..75f40154c6 100644 --- a/Projectiles/Ranged/StormSurgeTornado.cs +++ b/Projectiles/Ranged/StormSurgeTornado.cs @@ -1,23 +1,24 @@ using System; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Ranged { public class StormSurgeTornado : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "CalamityMod/Projectiles/Melee/BrinySpout"; + public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; + Main.projFrames[Type] = 6; } public override void SetDefaults() { - Projectile.width = 66; - Projectile.height = 66; - Projectile.scale = 0.5f; + Projectile.width = 160; + Projectile.height = 42; Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.tileCollide = false; @@ -29,35 +30,19 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { - Lighting.AddLight(Projectile.Center, 0f, 1.25f, 1.25f); - if (Projectile.scale <= 2f) - { - Projectile.scale *= 1.03f; - } - if (Projectile.scale >= 2f) - { - Projectile.Kill(); - } - Projectile.frameCounter++; - if (Projectile.frameCounter > 2) - { - Projectile.frame++; - Projectile.frameCounter = 0; - } - if (Projectile.frame >= 6) - { - Projectile.frame = 0; - } Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + Lighting.AddLight(Projectile.Center, 0f, 1.25f, 1.25f); + + Projectile.ai[0]++; + Projectile.scale = 0.25f * MathF.Pow(1.03f, Projectile.ai[0]); + + if (Projectile.scale >= 1f) + Projectile.Kill(); + + Projectile.frameCounter++; + Projectile.frame = Projectile.frameCounter / 3 % Main.projFrames[Type]; } - public override bool PreDraw(ref Color lightColor) - { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; - int y6 = framing * Projectile.frame; - Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); - return false; - } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox); } } diff --git a/Projectiles/Ranged/StormSurgeTornado.png b/Projectiles/Ranged/StormSurgeTornado.png deleted file mode 100644 index c3b106595a..0000000000 Binary files a/Projectiles/Ranged/StormSurgeTornado.png and /dev/null differ diff --git a/Projectiles/Ranged/SulphuricBlast.cs b/Projectiles/Ranged/SulphuricBlast.cs index fba65d999f..d75283807b 100644 --- a/Projectiles/Ranged/SulphuricBlast.cs +++ b/Projectiles/Ranged/SulphuricBlast.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Ranged public const int TotalSecondsToStick = 8; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 20; + Main.projFrames[Type] = 20; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Ranged { if (Projectile.FinalExtraUpdate()) Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 4 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 4 % Main.projFrames[Type]; Projectile.StickyProjAI(8); Projectile.Opacity = Utils.GetLerpValue(CalamityUtils.SecondsToFrames(TotalSecondsToStick), CalamityUtils.SecondsToFrames(TotalSecondsToStick * 0.5f), Projectile.localAI[0], true); @@ -80,8 +80,8 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int projFrame = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int projFrame = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = projFrame * Projectile.frame; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, projFrame)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)projFrame / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Ranged/SuperradiantBolt.cs b/Projectiles/Ranged/SuperradiantBolt.cs index d46167f8d3..2ba1733524 100644 --- a/Projectiles/Ranged/SuperradiantBolt.cs +++ b/Projectiles/Ranged/SuperradiantBolt.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Ranged { GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/FabstaffStreak")); PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 20); - Texture2D glow = TextureAssets.Projectile[Projectile.type].Value; + Texture2D glow = TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, glow.Size() * 0.5f, Projectile.scale, SpriteEffects.None); return false; } diff --git a/Projectiles/Ranged/SuperradiantSaw.cs b/Projectiles/Ranged/SuperradiantSaw.cs index 5e43af296a..91b754c63d 100644 --- a/Projectiles/Ranged/SuperradiantSaw.cs +++ b/Projectiles/Ranged/SuperradiantSaw.cs @@ -43,8 +43,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -353,7 +353,7 @@ namespace CalamityMod.Projectiles.Ranged } // Draw the saw itself at full brightness - Texture2D buzzsawTexture = TextureAssets.Projectile[Projectile.type].Value; + Texture2D buzzsawTexture = TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(buzzsawTexture, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, buzzsawTexture.Size() * 0.5f, 1f, SpriteEffects.None); if (Empowered) // Rainbow outline while empowered diff --git a/Projectiles/Ranged/SuperradiantSawLingering.cs b/Projectiles/Ranged/SuperradiantSawLingering.cs index 49529f2016..5687ab125b 100644 --- a/Projectiles/Ranged/SuperradiantSawLingering.cs +++ b/Projectiles/Ranged/SuperradiantSawLingering.cs @@ -27,8 +27,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { @@ -174,7 +174,7 @@ namespace CalamityMod.Projectiles.Ranged } // Draw the saw itself at full brightness, glow and outline in rainbow - Texture2D buzzsawTexture = TextureAssets.Projectile[Projectile.type].Value; + Texture2D buzzsawTexture = TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(buzzsawTexture, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, buzzsawTexture.Size() * 0.5f, 1f, SpriteEffects.None); SawOutline ??= ModContent.Request("CalamityMod/Projectiles/Ranged/SuperradiantSawOutline"); diff --git a/Projectiles/Ranged/SuperradiantSlaughtererHoldout.cs b/Projectiles/Ranged/SuperradiantSlaughtererHoldout.cs index 16e78c01b0..02017800c3 100644 --- a/Projectiles/Ranged/SuperradiantSlaughtererHoldout.cs +++ b/Projectiles/Ranged/SuperradiantSlaughtererHoldout.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; } public override void SetDefaults() diff --git a/Projectiles/Ranged/TauCannonHoldout.cs b/Projectiles/Ranged/TauCannonHoldout.cs index 9000ccd154..172e8943a1 100644 --- a/Projectiles/Ranged/TauCannonHoldout.cs +++ b/Projectiles/Ranged/TauCannonHoldout.cs @@ -113,7 +113,7 @@ namespace CalamityMod.Projectiles.Ranged if (Projectile.timeLeft % 4 == 0 && Projectile.timeLeft > CoolingDownTime) { - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.velocity.RotatedByRandom(MathHelper.PiOver4 * 0.25f) * HeldItem.shootSpeed, ProjectileType(), @@ -134,7 +134,7 @@ namespace CalamityMod.Projectiles.Ranged if (!HasShotBeam) { - Projectile.NewProjectileDirect( + Projectile.NewProjectile( Projectile.GetSource_FromThis(), GunTipPosition, Projectile.velocity, @@ -160,7 +160,7 @@ namespace CalamityMod.Projectiles.Ranged { if (Projectile.owner == Main.myPlayer) { - Projectile.NewProjectileDirect( + Projectile.NewProjectile( Projectile.GetSource_FromThis(), GunTipPosition + Projectile.velocity * 25f, Projectile.velocity, @@ -174,7 +174,7 @@ namespace CalamityMod.Projectiles.Ranged int randomPortalAmount = Main.rand.Next(4, 5+1); for (int i = 0; i < randomPortalAmount; i++) { - Projectile.NewProjectileDirect( + Projectile.NewProjectile( Projectile.GetSource_FromThis(), Owner.Center + Main.rand.NextVector2CircularEdge(480f, 480f) * Main.rand.NextFloat(0.8f, 1.2f), Vector2.Zero, diff --git a/Projectiles/Ranged/TauCannonPortal.cs b/Projectiles/Ranged/TauCannonPortal.cs index a8fb07b51d..a3b5a0852b 100644 --- a/Projectiles/Ranged/TauCannonPortal.cs +++ b/Projectiles/Ranged/TauCannonPortal.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Ranged { float angle = starterAngle + (MathHelper.TwoPi / randomBoltAmount * i); Vector2 velocity = angle.ToRotationVector2() * 14f; - Projectile.NewProjectileDirect( + Projectile.NewProjectile( Projectile.GetSource_FromThis(), Projectile.Center, velocity, diff --git a/Projectiles/Ranged/TelluricGlareArrow.cs b/Projectiles/Ranged/TelluricGlareArrow.cs index 5cfd0ef4b3..b87de92696 100644 --- a/Projectiles/Ranged/TelluricGlareArrow.cs +++ b/Projectiles/Ranged/TelluricGlareArrow.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { // While this projectile doesn't have afterimages, it keeps track of old positions for its primitive drawcode. - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 21; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 21; } public override void SetDefaults() diff --git a/Projectiles/Ranged/TheHiveHoldout.cs b/Projectiles/Ranged/TheHiveHoldout.cs index a282f52ad9..6be2de4d51 100644 --- a/Projectiles/Ranged/TheHiveHoldout.cs +++ b/Projectiles/Ranged/TheHiveHoldout.cs @@ -140,7 +140,7 @@ namespace CalamityMod.Projectiles.Ranged SoundStyle fire = new("CalamityMod/Sounds/Custom/PlagueSounds/PBGBarrageLaunch"); SoundEngine.PlaySound(fire with { Volume = 0.5f, Pitch = 0.1f }, Projectile.Center); - Projectile.NewProjectileDirect( + Projectile.NewProjectile( Projectile.GetSource_FromThis(), GunTipPosition, shootDirection * projSpeed * 0.3f, @@ -161,7 +161,7 @@ namespace CalamityMod.Projectiles.Ranged for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = (shootDirection).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - Projectile.NewProjectileDirect( + Projectile.NewProjectile( Projectile.GetSource_FromThis(), GunTipPosition, perturbedSpeed * projSpeed * VelocityMultiplier, @@ -245,7 +245,7 @@ namespace CalamityMod.Projectiles.Ranged if (ShootingTimer <= 0) return false; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D glowTexture = Request(GlowTexture).Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Color drawColor = Projectile.GetAlpha(lightColor); diff --git a/Projectiles/Ranged/TheMaelstromExplosion.cs b/Projectiles/Ranged/TheMaelstromExplosion.cs index 77bc361ffb..d4c0e99c0c 100644 --- a/Projectiles/Ranged/TheMaelstromExplosion.cs +++ b/Projectiles/Ranged/TheMaelstromExplosion.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 75; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 75; } public override void SetDefaults() @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 origin = texture.Size() * 0.5f; float scale = Projectile.scale * Projectile.width / texture.Width; diff --git a/Projectiles/Ranged/TheMaelstromShark.cs b/Projectiles/Ranged/TheMaelstromShark.cs index 2af536ec39..56ba605ef4 100644 --- a/Projectiles/Ranged/TheMaelstromShark.cs +++ b/Projectiles/Ranged/TheMaelstromShark.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 6; + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Type]; Projectile.rotation = Projectile.velocity.ToRotation(); Projectile.spriteDirection = (Math.Cos(Projectile.rotation) > 0f).ToDirectionInt(); @@ -91,8 +91,8 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle frame = texture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition; SpriteEffects direction = Projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; diff --git a/Projectiles/Ranged/ThePackMinissile.cs b/Projectiles/Ranged/ThePackMinissile.cs index b595b2bb01..7044b1bbb1 100644 --- a/Projectiles/Ranged/ThePackMinissile.cs +++ b/Projectiles/Ranged/ThePackMinissile.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Ranged/ThePackMissile.cs b/Projectiles/Ranged/ThePackMissile.cs index 8257904285..6d16b07aaf 100644 --- a/Projectiles/Ranged/ThePackMissile.cs +++ b/Projectiles/Ranged/ThePackMissile.cs @@ -11,10 +11,10 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -113,7 +113,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Ranged/TitaniumRailgunScope.cs b/Projectiles/Ranged/TitaniumRailgunScope.cs index 9d79448e35..d064c083d1 100644 --- a/Projectiles/Ranged/TitaniumRailgunScope.cs +++ b/Projectiles/Ranged/TitaniumRailgunScope.cs @@ -169,7 +169,7 @@ namespace CalamityMod.Projectiles.Ranged // Converge the sights float spread = (1f - ChargePercent) * MaxSightAngle; float halfAngle = spread / 2f; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Color sightsColor = Color.Lerp(Color.LightBlue, Color.Crimson, ChargePercent); diff --git a/Projectiles/Ranged/TyphoonBubble.cs b/Projectiles/Ranged/TyphoonBubble.cs index 85307684f9..08be6cba30 100644 --- a/Projectiles/Ranged/TyphoonBubble.cs +++ b/Projectiles/Ranged/TyphoonBubble.cs @@ -9,11 +9,11 @@ namespace CalamityMod.Projectiles.Ranged public class TyphoonBubble : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; - public override string Texture => "CalamityMod/Projectiles/Melee/BrinyTyphoonBubble"; + public override string Texture => "Terraria/Images/Projectile_385"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; + Main.projFrames[Type] = 3; } public override void SetDefaults() diff --git a/Projectiles/Ranged/UltimaBolt.cs b/Projectiles/Ranged/UltimaBolt.cs index 588d3b154c..2c321b7ad7 100644 --- a/Projectiles/Ranged/UltimaBolt.cs +++ b/Projectiles/Ranged/UltimaBolt.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Ranged public const int MaxBounces = 1; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 3; } public override void SetDefaults() @@ -81,7 +81,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; for (int i = 0; i < Projectile.oldPos.Length; i++) { if (i > 0) diff --git a/Projectiles/Ranged/UniversalGenesisStar.cs b/Projectiles/Ranged/UniversalGenesisStar.cs index 5f3a7af876..25b8a78224 100644 --- a/Projectiles/Ranged/UniversalGenesisStar.cs +++ b/Projectiles/Ranged/UniversalGenesisStar.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DrawStarTrail(Color.Blue, Color.White); //Draw the actual projectile - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Ranged/UniversalGenesisStarcaller.cs b/Projectiles/Ranged/UniversalGenesisStarcaller.cs index 2c95e6bdeb..86c3d946d9 100644 --- a/Projectiles/Ranged/UniversalGenesisStarcaller.cs +++ b/Projectiles/Ranged/UniversalGenesisStarcaller.cs @@ -11,9 +11,9 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Ranged/VanquisherArrowProj.cs b/Projectiles/Ranged/VanquisherArrowProj.cs index 7f2542ddaa..b0c39fb9b8 100644 --- a/Projectiles/Ranged/VanquisherArrowProj.cs +++ b/Projectiles/Ranged/VanquisherArrowProj.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Ranged public override void PostDraw(Color lightColor) { Color color = Color.White; - Rectangle frame = new Rectangle(0, 0, Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Width, Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height); + Rectangle frame = new Rectangle(0, 0, Terraria.GameContent.TextureAssets.Projectile[Type].Value.Width, Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height); Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Items/Ammo/VanquisherArrowGlow").Value, Projectile.Center - Main.screenPosition, frame, color, Projectile.rotation, Projectile.Size / 2, 1f, SpriteEffects.None, 0); } @@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Ranged { Texture2D texture = ModContent.Request("CalamityMod/Projectiles/StarProj").Value; if (Time > 6) - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], MainColor * 0.3f, 1, texture); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], MainColor * 0.3f, 1, texture); return true; } } diff --git a/Projectiles/Ranged/VeriumBoltProj.cs b/Projectiles/Ranged/VeriumBoltProj.cs index cfe3975f58..3c62464ca2 100644 --- a/Projectiles/Ranged/VeriumBoltProj.cs +++ b/Projectiles/Ranged/VeriumBoltProj.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Ranged public override string Texture => "CalamityMod/Items/Ammo/VeriumBolt"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 12; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 12; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -34,8 +34,8 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, 0, Color.Plum); - return true; + CalamityUtils.DrawAfterimagesCentered(Projectile, 2, Color.Plum); + return false; } public override void AI() diff --git a/Projectiles/Ranged/Voidragon.cs b/Projectiles/Ranged/Voidragon.cs index 950f54cd19..558e564049 100644 --- a/Projectiles/Ranged/Voidragon.cs +++ b/Projectiles/Ranged/Voidragon.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) diff --git a/Projectiles/Ranged/WaterSpout.cs b/Projectiles/Ranged/WaterSpout.cs index fd74bc6e11..b46c5fb43a 100644 --- a/Projectiles/Ranged/WaterSpout.cs +++ b/Projectiles/Ranged/WaterSpout.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; + Main.projFrames[Type] = 6; } public override void SetDefaults() @@ -112,8 +112,8 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Ranged/WildfireBloomFlare.cs b/Projectiles/Ranged/WildfireBloomFlare.cs index 2cbe955247..f21d9f5d93 100644 --- a/Projectiles/Ranged/WildfireBloomFlare.cs +++ b/Projectiles/Ranged/WildfireBloomFlare.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 18; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 18; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - Texture2D lightTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D lightTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; for (int i = 0; i < Projectile.oldPos.Length; i++) { float colorInterpolation = MathF.Cos(Projectile.timeLeft / 16f + Main.GlobalTimeWrappedHourly / 20f + i / (float)Projectile.oldPos.Length * MathHelper.Pi) * 0.5f + 0.5f; diff --git a/Projectiles/Ranged/WulfrumScrapBullet.cs b/Projectiles/Ranged/WulfrumScrapBullet.cs index 09cfa52d89..908adae75c 100644 --- a/Projectiles/Ranged/WulfrumScrapBullet.cs +++ b/Projectiles/Ranged/WulfrumScrapBullet.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; diff --git a/Projectiles/Rogue/AbyssalMirrorProjectile.cs b/Projectiles/Rogue/AbyssalMirrorProjectile.cs index b08dea9d1e..514bdfd82d 100644 --- a/Projectiles/Rogue/AbyssalMirrorProjectile.cs +++ b/Projectiles/Rogue/AbyssalMirrorProjectile.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; + Main.projFrames[Type] = 3; } public override void SetDefaults() diff --git a/Projectiles/Rogue/AcidBarrelDrop.cs b/Projectiles/Rogue/AcidBarrelDrop.cs index 0591f2951a..d635b81c3f 100644 --- a/Projectiles/Rogue/AcidBarrelDrop.cs +++ b/Projectiles/Rogue/AcidBarrelDrop.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], new Color(255, 255, 255, 127), 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], new Color(255, 255, 255, 127), 2); return false; } } diff --git a/Projectiles/Rogue/AcidShrapnel.cs b/Projectiles/Rogue/AcidShrapnel.cs index 4feb1b9207..8797e58c73 100644 --- a/Projectiles/Rogue/AcidShrapnel.cs +++ b/Projectiles/Rogue/AcidShrapnel.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Rogue public bool HitTile = false; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; + Main.projFrames[Type] = 3; } public override void SetDefaults() diff --git a/Projectiles/Rogue/AdamantiteThrowingAxeProjectile.cs b/Projectiles/Rogue/AdamantiteThrowingAxeProjectile.cs index 39a07ff343..755047ab3a 100644 --- a/Projectiles/Rogue/AdamantiteThrowingAxeProjectile.cs +++ b/Projectiles/Rogue/AdamantiteThrowingAxeProjectile.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/ApoctolithProj.cs b/Projectiles/Rogue/ApoctolithProj.cs index 873ba49c82..6952d4915d 100644 --- a/Projectiles/Rogue/ApoctolithProj.cs +++ b/Projectiles/Rogue/ApoctolithProj.cs @@ -33,8 +33,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -206,7 +206,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 origin = new Vector2(32f, 33f); Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Rogue/ApoctolithShard.cs b/Projectiles/Rogue/ApoctolithShard.cs index 71b80be562..7255ff54fb 100644 --- a/Projectiles/Rogue/ApoctolithShard.cs +++ b/Projectiles/Rogue/ApoctolithShard.cs @@ -20,9 +20,9 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - Main.projFrames[Projectile.type] = 3; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 2; + Main.projFrames[Type] = 3; } public override void SetDefaults() diff --git a/Projectiles/Rogue/AshenStalactiteDebris.cs b/Projectiles/Rogue/AshenStalactiteDebris.cs index 2d3f21e080..45e2583878 100644 --- a/Projectiles/Rogue/AshenStalactiteDebris.cs +++ b/Projectiles/Rogue/AshenStalactiteDebris.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/AshenStalactiteProj.cs b/Projectiles/Rogue/AshenStalactiteProj.cs index b0baa5e4f5..f0e3046f7a 100644 --- a/Projectiles/Rogue/AshenStalactiteProj.cs +++ b/Projectiles/Rogue/AshenStalactiteProj.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/AshenStalagmiteProj.cs b/Projectiles/Rogue/AshenStalagmiteProj.cs index 2802db70f0..d6df8cb06e 100644 --- a/Projectiles/Rogue/AshenStalagmiteProj.cs +++ b/Projectiles/Rogue/AshenStalagmiteProj.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/AuroradicalSplitter.cs b/Projectiles/Rogue/AuroradicalSplitter.cs index 40d0ea5715..519b63f719 100644 --- a/Projectiles/Rogue/AuroradicalSplitter.cs +++ b/Projectiles/Rogue/AuroradicalSplitter.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/AuroradicalStar.cs b/Projectiles/Rogue/AuroradicalStar.cs index 850672aa0d..2d471c304d 100644 --- a/Projectiles/Rogue/AuroradicalStar.cs +++ b/Projectiles/Rogue/AuroradicalStar.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -109,7 +109,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/BallisticPoisonCloud.cs b/Projectiles/Rogue/BallisticPoisonCloud.cs index f6255437fe..efd74924e6 100644 --- a/Projectiles/Rogue/BallisticPoisonCloud.cs +++ b/Projectiles/Rogue/BallisticPoisonCloud.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 10; + Main.projFrames[Type] = 10; } public override void SetDefaults() @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.frame = 0; } } - else if (Projectile.owner == Main.myPlayer && Projectile.frame >= Main.projFrames[Projectile.type]) + else if (Projectile.owner == Main.myPlayer && Projectile.frame >= Main.projFrames[Type]) { Projectile.Kill(); } diff --git a/Projectiles/Rogue/BarrelShrapnel.cs b/Projectiles/Rogue/BarrelShrapnel.cs index 28f65cdfae..b753bc41b3 100644 --- a/Projectiles/Rogue/BarrelShrapnel.cs +++ b/Projectiles/Rogue/BarrelShrapnel.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Rogue public bool hitTile = false; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; + Main.projFrames[Type] = 3; } public override void SetDefaults() diff --git a/Projectiles/Rogue/BlastBarrelProjectile.cs b/Projectiles/Rogue/BlastBarrelProjectile.cs index 390b2f5ba3..50ebbd1133 100644 --- a/Projectiles/Rogue/BlastBarrelProjectile.cs +++ b/Projectiles/Rogue/BlastBarrelProjectile.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Projectiles.Rogue public bool CollideX => Projectile.oldPosition.X == Projectile.position.X; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool OnTileCollide(Vector2 oldVelocity) => false; public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Rogue/BlazingStarProj.cs b/Projectiles/Rogue/BlazingStarProj.cs index acbeb72bc4..79ce3bb0d0 100644 --- a/Projectiles/Rogue/BlazingStarProj.cs +++ b/Projectiles/Rogue/BlazingStarProj.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/BloodsoakedCrashax.cs b/Projectiles/Rogue/BloodsoakedCrashax.cs index 276796b634..3b6fe23afb 100644 --- a/Projectiles/Rogue/BloodsoakedCrashax.cs +++ b/Projectiles/Rogue/BloodsoakedCrashax.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -129,7 +129,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) //afterimages { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/BlueFlamePillar.cs b/Projectiles/Rogue/BlueFlamePillar.cs index 4f97fc008e..414069dc13 100644 --- a/Projectiles/Rogue/BlueFlamePillar.cs +++ b/Projectiles/Rogue/BlueFlamePillar.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Rogue } public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = new Rectangle(frameX * 80, frameY * 322, 80, 322); Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, Projectile.Size / 2, 1f, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Rogue/BlunderBoosterLightning.cs b/Projectiles/Rogue/BlunderBoosterLightning.cs index ee80f8c99b..29bd9d4098 100644 --- a/Projectiles/Rogue/BlunderBoosterLightning.cs +++ b/Projectiles/Rogue/BlunderBoosterLightning.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Rogue/BouncingEyeballProjectile.cs b/Projectiles/Rogue/BouncingEyeballProjectile.cs index 22eaba59ad..00510d890d 100644 --- a/Projectiles/Rogue/BouncingEyeballProjectile.cs +++ b/Projectiles/Rogue/BouncingEyeballProjectile.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Rogue private int Bounces = 5; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Rogue } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Rogue/BouncingEyeballProjectileStealthStrike.cs b/Projectiles/Rogue/BouncingEyeballProjectileStealthStrike.cs index c8bd1fc82f..923fcfb63d 100644 --- a/Projectiles/Rogue/BouncingEyeballProjectileStealthStrike.cs +++ b/Projectiles/Rogue/BouncingEyeballProjectileStealthStrike.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Rogue } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Rogue/ButcherKnife.cs b/Projectiles/Rogue/ButcherKnife.cs index 3cf2ecce4f..444921731e 100644 --- a/Projectiles/Rogue/ButcherKnife.cs +++ b/Projectiles/Rogue/ButcherKnife.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/CarvingFork.cs b/Projectiles/Rogue/CarvingFork.cs index 6a4d2fb686..4a997ecf91 100644 --- a/Projectiles/Rogue/CarvingFork.cs +++ b/Projectiles/Rogue/CarvingFork.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/CelestusMiniScythe.cs b/Projectiles/Rogue/CelestusMiniScythe.cs index 87e4349b9b..cb561bc9cd 100644 --- a/Projectiles/Rogue/CelestusMiniScythe.cs +++ b/Projectiles/Rogue/CelestusMiniScythe.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/CelestusProj.cs b/Projectiles/Rogue/CelestusProj.cs index 4b226f24f5..3ff5f325cb 100644 --- a/Projectiles/Rogue/CelestusProj.cs +++ b/Projectiles/Rogue/CelestusProj.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -168,7 +168,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/CinquedeaProj.cs b/Projectiles/Rogue/CinquedeaProj.cs index 5528b5bf67..1ba199ca9b 100644 --- a/Projectiles/Rogue/CinquedeaProj.cs +++ b/Projectiles/Rogue/CinquedeaProj.cs @@ -27,8 +27,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); return false; } diff --git a/Projectiles/Rogue/CircletMark.cs b/Projectiles/Rogue/CircletMark.cs index d3d27dd67c..1222796e47 100644 --- a/Projectiles/Rogue/CircletMark.cs +++ b/Projectiles/Rogue/CircletMark.cs @@ -145,8 +145,8 @@ namespace CalamityMod.Projectiles.Rogue spriteEffects = SpriteEffects.FlipHorizontally; } Vector2 drawPos = Projectile.position + new Vector2((float)Projectile.width, (float)Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; - Texture2D texture2D27 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle rectangle = texture2D27.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D texture2D27 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle rectangle = texture2D27.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Color alphaColor = Projectile.GetAlpha(originalColor); Vector2 origin7 = rectangle.Size() / 2f; Color sandyColor = Main.hslToRgb(0.25f, 1f, 1f).MultiplyRGBA(new Color(255, 255, 255, 0)); diff --git a/Projectiles/Rogue/CircletTornado.cs b/Projectiles/Rogue/CircletTornado.cs index 083ef42cd3..8ea5f2ff63 100644 --- a/Projectiles/Rogue/CircletTornado.cs +++ b/Projectiles/Rogue/CircletTornado.cs @@ -140,7 +140,7 @@ namespace CalamityMod.Projectiles.Rogue Vector2 sizeModdingPos = new Vector2(0f, sizeModdingVector2.Y - sizeModdingVector.Y); sizeModdingPos.X = sizeModdingPos.Y * vectorMult; new Vector2(sizeModdingVector.X - sizeModdingPos.X / 2f, sizeModdingVector.Y); - Texture2D texture2D23 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture2D23 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle drawRectangle = texture2D23.Frame(1, 1, 0, 0); Vector2 smallRect = drawRectangle.Size() / 2f; float aiTrackMult = -0.06283186f * aiTracker; diff --git a/Projectiles/Rogue/CobaltEnergy.cs b/Projectiles/Rogue/CobaltEnergy.cs index 1f74e418a9..0bfb8cffe7 100644 --- a/Projectiles/Rogue/CobaltEnergy.cs +++ b/Projectiles/Rogue/CobaltEnergy.cs @@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/CobaltKunaiProjectile.cs b/Projectiles/Rogue/CobaltKunaiProjectile.cs index 6113862dfa..ed004b2435 100644 --- a/Projectiles/Rogue/CobaltKunaiProjectile.cs +++ b/Projectiles/Rogue/CobaltKunaiProjectile.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/CorpusAvertorClone.cs b/Projectiles/Rogue/CorpusAvertorClone.cs index 680dfd30d1..740a9c4f82 100644 --- a/Projectiles/Rogue/CorpusAvertorClone.cs +++ b/Projectiles/Rogue/CorpusAvertorClone.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/CorpusAvertorProj.cs b/Projectiles/Rogue/CorpusAvertorProj.cs index f0411b6978..a16cb344c3 100644 --- a/Projectiles/Rogue/CorpusAvertorProj.cs +++ b/Projectiles/Rogue/CorpusAvertorProj.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/CorpusAvertorStealth.cs b/Projectiles/Rogue/CorpusAvertorStealth.cs index 57c49b9897..ab2d5f309a 100644 --- a/Projectiles/Rogue/CorpusAvertorStealth.cs +++ b/Projectiles/Rogue/CorpusAvertorStealth.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/Corrocloud1.cs b/Projectiles/Rogue/Corrocloud1.cs index 206005a920..1a277ec5db 100644 --- a/Projectiles/Rogue/Corrocloud1.cs +++ b/Projectiles/Rogue/Corrocloud1.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 8; + Main.projFrames[Type] = 8; } public override void SetDefaults() diff --git a/Projectiles/Rogue/Corrocloud2.cs b/Projectiles/Rogue/Corrocloud2.cs index 67711f3448..32115a9cf5 100644 --- a/Projectiles/Rogue/Corrocloud2.cs +++ b/Projectiles/Rogue/Corrocloud2.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 8; + Main.projFrames[Type] = 8; } public override void SetDefaults() diff --git a/Projectiles/Rogue/Corrocloud3.cs b/Projectiles/Rogue/Corrocloud3.cs index 720440764a..06fa8761d7 100644 --- a/Projectiles/Rogue/Corrocloud3.cs +++ b/Projectiles/Rogue/Corrocloud3.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 8; + Main.projFrames[Type] = 8; } public override void SetDefaults() diff --git a/Projectiles/Rogue/CosmicScythe.cs b/Projectiles/Rogue/CosmicScythe.cs index 994cff3517..10c8612d1e 100644 --- a/Projectiles/Rogue/CosmicScythe.cs +++ b/Projectiles/Rogue/CosmicScythe.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/Crushax.cs b/Projectiles/Rogue/Crushax.cs index efebdce745..b0a1f1e7fa 100644 --- a/Projectiles/Rogue/Crushax.cs +++ b/Projectiles/Rogue/Crushax.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/CrystalPiercerProjectile.cs b/Projectiles/Rogue/CrystalPiercerProjectile.cs index 0e52f58ddb..61cb9505f0 100644 --- a/Projectiles/Rogue/CrystalPiercerProjectile.cs +++ b/Projectiles/Rogue/CrystalPiercerProjectile.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/Crystalline2.cs b/Projectiles/Rogue/Crystalline2.cs index f14f4858d9..0401358dc1 100644 --- a/Projectiles/Rogue/Crystalline2.cs +++ b/Projectiles/Rogue/Crystalline2.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Rogue { if (Projectile.timeLeft == (Projectile.ai[1] == 2f ? 20 : 30)) return false; - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/CrystallineProj.cs b/Projectiles/Rogue/CrystallineProj.cs index 7ff1767715..237e3bb6f0 100644 --- a/Projectiles/Rogue/CrystallineProj.cs +++ b/Projectiles/Rogue/CrystallineProj.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/CursedDaggerProj.cs b/Projectiles/Rogue/CursedDaggerProj.cs index 90127ca24c..36a402f45e 100644 --- a/Projectiles/Rogue/CursedDaggerProj.cs +++ b/Projectiles/Rogue/CursedDaggerProj.cs @@ -66,13 +66,13 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.Calamity().stealthStrike) { SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact, Projectile.position); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage), Projectile.knockBack * 2, Projectile.owner, 0, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage), Projectile.knockBack * 2, Projectile.owner, 0, 0f); } } public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/DeepWounderProjectile.cs b/Projectiles/Rogue/DeepWounderProjectile.cs index 3cbadfac87..eccc24db80 100644 --- a/Projectiles/Rogue/DeepWounderProjectile.cs +++ b/Projectiles/Rogue/DeepWounderProjectile.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (Projectile.direction > 0) { Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Rogue/DeepWounderWater.cs b/Projectiles/Rogue/DeepWounderWater.cs index e9cf620e03..d6dcd18c22 100644 --- a/Projectiles/Rogue/DeepWounderWater.cs +++ b/Projectiles/Rogue/DeepWounderWater.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/DesecratedWaterProj.cs b/Projectiles/Rogue/DesecratedWaterProj.cs index f38e07224b..3f8cab8c40 100644 --- a/Projectiles/Rogue/DesecratedWaterProj.cs +++ b/Projectiles/Rogue/DesecratedWaterProj.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/DestructionBolt.cs b/Projectiles/Rogue/DestructionBolt.cs index a6aa89de0b..1138898d74 100644 --- a/Projectiles/Rogue/DestructionBolt.cs +++ b/Projectiles/Rogue/DestructionBolt.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Rogue } public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Asset tex2 = ModContent.Request("CalamityMod/Projectiles/Rogue/DestructionBoltGhost"); Asset tex3 = ModContent.Request("CalamityMod/Particles/BloomCircle"); float fading = Utils.GetLerpValue(180, 90, time, true); diff --git a/Projectiles/Rogue/DragonScalesInfernado.cs b/Projectiles/Rogue/DragonScalesInfernado.cs index a2d7cfb451..f30b9462d4 100644 --- a/Projectiles/Rogue/DragonScalesInfernado.cs +++ b/Projectiles/Rogue/DragonScalesInfernado.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Rogue bool intersectingSomething = false; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 12; + Main.projFrames[Type] = 12; } public override void SetDefaults() @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -146,8 +146,8 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int frameDraw = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int frameDraw = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = frameDraw * Projectile.frame; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, frameDraw)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)frameDraw / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Rogue/DragonShit.cs b/Projectiles/Rogue/DragonShit.cs index 2f0cbb809e..3946698d41 100644 --- a/Projectiles/Rogue/DragonShit.cs +++ b/Projectiles/Rogue/DragonShit.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; } public override void SetDefaults() @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; if (Projectile.timeLeft >= 420) @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Rogue { int cap = 5; float capDamageFactor = 0.05f; - int excessCount = Main.player[Projectile.owner].ownedProjectileCounts[Projectile.type] - cap; + int excessCount = Main.player[Projectile.owner].ownedProjectileCounts[Type] - cap; modifiers.SourceDamage *= MathHelper.Clamp(1f - (capDamageFactor * excessCount), 0f, 1f); } @@ -82,8 +82,8 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D projectileTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int frameHeight = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D projectileTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int frameHeight = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int frameY = frameHeight * Projectile.frame; Main.spriteBatch.Draw(projectileTexture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameY, projectileTexture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)projectileTexture.Width / 2f, (float)frameHeight / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Rogue/DukesDecapitatorProj.cs b/Projectiles/Rogue/DukesDecapitatorProj.cs index f6684198f6..35b995769f 100644 --- a/Projectiles/Rogue/DukesDecapitatorProj.cs +++ b/Projectiles/Rogue/DukesDecapitatorProj.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Rogue public override string Texture => "CalamityMod/Items/Weapons/Rogue/DukesDecapitator"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/DuststormCloud.cs b/Projectiles/Rogue/DuststormCloud.cs index 394602c8c5..be9d2ec200 100644 --- a/Projectiles/Rogue/DuststormCloud.cs +++ b/Projectiles/Rogue/DuststormCloud.cs @@ -5,7 +5,7 @@ namespace CalamityMod.Projectiles.Rogue public class DuststormCloud : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; - public override void SetStaticDefaults() => Main.projFrames[Projectile.type] = 4; + public override void SetStaticDefaults() => Main.projFrames[Type] = 4; public override void SetDefaults() { @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Rogue/DuststormInABottleProj.png b/Projectiles/Rogue/DuststormInABottleProj.png deleted file mode 100644 index 1e049812e3..0000000000 Binary files a/Projectiles/Rogue/DuststormInABottleProj.png and /dev/null differ diff --git a/Projectiles/Rogue/DynamicPursuerElectricity.cs b/Projectiles/Rogue/DynamicPursuerElectricity.cs index 1e79b95400..9e44160aad 100644 --- a/Projectiles/Rogue/DynamicPursuerElectricity.cs +++ b/Projectiles/Rogue/DynamicPursuerElectricity.cs @@ -27,9 +27,9 @@ namespace CalamityMod.Projectiles.Rogue }*/ public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 50; + ProjectileID.Sets.TrailCacheLength[Type] = 50; ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() { diff --git a/Projectiles/Rogue/DynamicPursuerProjectile.cs b/Projectiles/Rogue/DynamicPursuerProjectile.cs index d12823defd..132302e852 100644 --- a/Projectiles/Rogue/DynamicPursuerProjectile.cs +++ b/Projectiles/Rogue/DynamicPursuerProjectile.cs @@ -48,8 +48,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -289,8 +289,8 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, ProjectileID.Sets.TrailCacheLength[Projectile.type]); - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, ProjectileID.Sets.TrailCacheLength[Type]); + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D glowmaskTexture = ModContent.Request("CalamityMod/Projectiles/Rogue/DynamicPursuerProjectileGlowmask").Value; Rectangle glowmaskRectangle = glowmaskTexture.Frame(1, 9, 0, glowmaskFrame); Vector2 origin = glowmaskRectangle.Size() / 2f; diff --git a/Projectiles/Rogue/EclipseMirrorBurst.cs b/Projectiles/Rogue/EclipseMirrorBurst.cs index 9076e35af0..e378a547f9 100644 --- a/Projectiles/Rogue/EclipseMirrorBurst.cs +++ b/Projectiles/Rogue/EclipseMirrorBurst.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.spriteBatch.Draw ( texture, diff --git a/Projectiles/Rogue/EclipsesSmol.cs b/Projectiles/Rogue/EclipsesSmol.cs index f6e5558869..f9831d85bc 100644 --- a/Projectiles/Rogue/EclipsesSmol.cs +++ b/Projectiles/Rogue/EclipsesSmol.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None); return false; } diff --git a/Projectiles/Rogue/EnchantedAxe2.cs b/Projectiles/Rogue/EnchantedAxe2.cs index db675587c8..201416cdb1 100644 --- a/Projectiles/Rogue/EnchantedAxe2.cs +++ b/Projectiles/Rogue/EnchantedAxe2.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, new Color(192, 192, 255, 128), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/EnchantedAxeProj.cs b/Projectiles/Rogue/EnchantedAxeProj.cs index 08c006a756..ff859e9c29 100644 --- a/Projectiles/Rogue/EnchantedAxeProj.cs +++ b/Projectiles/Rogue/EnchantedAxeProj.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -121,9 +121,9 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/EquanimityProj.cs b/Projectiles/Rogue/EquanimityProj.cs index 9d06b322be..4c62672278 100644 --- a/Projectiles/Rogue/EquanimityProj.cs +++ b/Projectiles/Rogue/EquanimityProj.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -115,7 +115,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 3); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 3); return false; } diff --git a/Projectiles/Rogue/EradicatorProjectile.cs b/Projectiles/Rogue/EradicatorProjectile.cs index 6ae62597b9..6c32ebf15d 100644 --- a/Projectiles/Rogue/EradicatorProjectile.cs +++ b/Projectiles/Rogue/EradicatorProjectile.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -227,7 +227,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); return false; } diff --git a/Projectiles/Rogue/ExecutionersBladeProj.cs b/Projectiles/Rogue/ExecutionersBladeProj.cs index 7ce21a95ba..ae1c6226d1 100644 --- a/Projectiles/Rogue/ExecutionersBladeProj.cs +++ b/Projectiles/Rogue/ExecutionersBladeProj.cs @@ -28,8 +28,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/ExecutionersBladeStealthProj.cs b/Projectiles/Rogue/ExecutionersBladeStealthProj.cs index 40b244acc3..7eca83fe91 100644 --- a/Projectiles/Rogue/ExecutionersBladeStealthProj.cs +++ b/Projectiles/Rogue/ExecutionersBladeStealthProj.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/ExorcismProj.cs b/Projectiles/Rogue/ExorcismProj.cs index 79b74887d0..6757dae3cb 100644 --- a/Projectiles/Rogue/ExorcismProj.cs +++ b/Projectiles/Rogue/ExorcismProj.cs @@ -89,7 +89,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/ExorcismStar.cs b/Projectiles/Rogue/ExorcismStar.cs index 9c31376c1d..81f3637e11 100644 --- a/Projectiles/Rogue/ExorcismStar.cs +++ b/Projectiles/Rogue/ExorcismStar.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { Projectile.DrawStarTrail(Color.DarkGoldenrod, Color.Gold); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/FantasyTalismanProj.cs b/Projectiles/Rogue/FantasyTalismanProj.cs index f9c734ca63..8af3ec9732 100644 --- a/Projectiles/Rogue/FantasyTalismanProj.cs +++ b/Projectiles/Rogue/FantasyTalismanProj.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Rogue/FantasyTalismanStealth.cs b/Projectiles/Rogue/FantasyTalismanStealth.cs index 25d6cbf1f7..bdc7db0f27 100644 --- a/Projectiles/Rogue/FantasyTalismanStealth.cs +++ b/Projectiles/Rogue/FantasyTalismanStealth.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Rogue/FeatherKnifeProjectile.cs b/Projectiles/Rogue/FeatherKnifeProjectile.cs index 8fc80ea665..1c454320dd 100644 --- a/Projectiles/Rogue/FeatherKnifeProjectile.cs +++ b/Projectiles/Rogue/FeatherKnifeProjectile.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/FinalDawnFireSlash.cs b/Projectiles/Rogue/FinalDawnFireSlash.cs index 77e2e24401..bfd59add8c 100644 --- a/Projectiles/Rogue/FinalDawnFireSlash.cs +++ b/Projectiles/Rogue/FinalDawnFireSlash.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Projectiles.Rogue public static float StealthReturnRatio = 0.40f; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 11; + Main.projFrames[Type] = 11; } public override void SetDefaults() { @@ -110,7 +110,7 @@ namespace CalamityMod.Projectiles.Rogue Vector2 drawCenter = Projectile.Center; Rectangle frameRectangle = new Rectangle(Projectile.frame / 5 * width, Projectile.frame % 5 * height, width, height); - Texture2D scytheTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D scytheTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D glowTexture = ModContent.Request("CalamityMod/Projectiles/Rogue/FinalDawnFireSlash_Glow").Value; Main.spriteBatch.Draw(scytheTexture, diff --git a/Projectiles/Rogue/FinalDawnFireball.cs b/Projectiles/Rogue/FinalDawnFireball.cs index 1071ebfb2e..58ca9578a5 100644 --- a/Projectiles/Rogue/FinalDawnFireball.cs +++ b/Projectiles/Rogue/FinalDawnFireball.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Rogue public const float InterpolationTime = 10; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } public override void SetDefaults() @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Rogue { Projectile.frame++; Projectile.frameCounter = 0; - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; } } @@ -71,8 +71,8 @@ namespace CalamityMod.Projectiles.Rogue } public override bool PreDraw(ref Color lightColor) { - Texture2D glowmask = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int height = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D glowmask = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int height = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int yStart = height * Projectile.frame; Main.spriteBatch.Draw(glowmask, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), diff --git a/Projectiles/Rogue/FinalDawnFlame.cs b/Projectiles/Rogue/FinalDawnFlame.cs index 60789f2f1f..d45cb79e75 100644 --- a/Projectiles/Rogue/FinalDawnFlame.cs +++ b/Projectiles/Rogue/FinalDawnFlame.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Rogue public const int TotalFlames = 120; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 8; + Main.projFrames[Type] = 8; } public override void SetDefaults() { @@ -59,8 +59,8 @@ namespace CalamityMod.Projectiles.Rogue } public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int frameHeight = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int frameHeight = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; if (Flames.Length > 0) diff --git a/Projectiles/Rogue/FinalDawnHorizontalSlash.cs b/Projectiles/Rogue/FinalDawnHorizontalSlash.cs index e41cb19294..1f03f7c82b 100644 --- a/Projectiles/Rogue/FinalDawnHorizontalSlash.cs +++ b/Projectiles/Rogue/FinalDawnHorizontalSlash.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 9; + Main.projFrames[Type] = 9; } public override void SetDefaults() { @@ -72,9 +72,9 @@ namespace CalamityMod.Projectiles.Rogue } public override bool PreDraw(ref Color lightColor) { - Texture2D scytheTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D scytheTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D scytheGlowTexture = ModContent.Request("CalamityMod/Projectiles/Rogue/FinalDawnHorizontalSlash_Glow").Value; - int height = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + int height = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int yStart = height * Projectile.frame; Main.spriteBatch.Draw(scytheTexture, Projectile.Center - Main.screenPosition + Projectile.gfxOffY * Vector2.UnitY, diff --git a/Projectiles/Rogue/FinalDawnProjectile.cs b/Projectiles/Rogue/FinalDawnProjectile.cs index d6c0d2e372..1678c054c7 100644 --- a/Projectiles/Rogue/FinalDawnProjectile.cs +++ b/Projectiles/Rogue/FinalDawnProjectile.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Rogue public const float MaxChargeTime = 20f; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 2; + Main.projFrames[Type] = 2; } public override void SetDefaults() { @@ -156,9 +156,9 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D scytheTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D scytheTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D glowmask = ModContent.Request("CalamityMod/Projectiles/Rogue/FinalDawnProjectile_Glow").Value; - int height = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + int height = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int yStart = height * Projectile.frame; Main.spriteBatch.Draw(scytheTexture, Projectile.Center - Main.screenPosition + Vector2.UnitY * Projectile.gfxOffY, diff --git a/Projectiles/Rogue/FinalDawnReticle.cs b/Projectiles/Rogue/FinalDawnReticle.cs index 19001e5563..3e1f091290 100644 --- a/Projectiles/Rogue/FinalDawnReticle.cs +++ b/Projectiles/Rogue/FinalDawnReticle.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Rogue } public override bool PreDraw(ref Color lightColor) { - Texture2D ring = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D ring = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D symbol = ModContent.Request("CalamityMod/Projectiles/Rogue/FinalDawnReticleSymbol").Value; Main.EntitySpriteDraw(symbol, Projectile.Center - Main.screenPosition, diff --git a/Projectiles/Rogue/FinalDawnThrow.cs b/Projectiles/Rogue/FinalDawnThrow.cs index 273f8d58d7..b5743c9437 100644 --- a/Projectiles/Rogue/FinalDawnThrow.cs +++ b/Projectiles/Rogue/FinalDawnThrow.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Rogue public const float InterpolationTime = 15; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() { @@ -70,9 +70,9 @@ namespace CalamityMod.Projectiles.Rogue } public override bool PreDraw(ref Color lightColor) { - Texture2D scytheTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D scytheTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D scytheGlowTexture = ModContent.Request("CalamityMod/Projectiles/Rogue/FinalDawnThrow_Glow").Value; - int height = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + int height = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int yStart = height * Projectile.frame; Main.spriteBatch.Draw(scytheTexture, Projectile.Center - Main.screenPosition + Vector2.UnitY * Projectile.gfxOffY, diff --git a/Projectiles/Rogue/FinalDawnThrow2.cs b/Projectiles/Rogue/FinalDawnThrow2.cs index 71e5979a8f..7038aeda7c 100644 --- a/Projectiles/Rogue/FinalDawnThrow2.cs +++ b/Projectiles/Rogue/FinalDawnThrow2.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Rogue bool HasHitEnemy = false; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() { @@ -115,9 +115,9 @@ namespace CalamityMod.Projectiles.Rogue Player player = Main.player[Projectile.owner]; float scytheRotation = player.fullRotation; - Texture2D scytheTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D scytheTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D glowScytheTexture = ModContent.Request("CalamityMod/Projectiles/Rogue/FinalDawnThrow2_Glow").Value; - int num214 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + int num214 = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = num214 * Projectile.frame; Vector2 origin = new Vector2(scytheTexture.Width / 2f + 40f * player.direction, num214 * 1.1f); diff --git a/Projectiles/Rogue/FishboneBoomerangProjectile.cs b/Projectiles/Rogue/FishboneBoomerangProjectile.cs index f15ed5da4d..47f1d6eae8 100644 --- a/Projectiles/Rogue/FishboneBoomerangProjectile.cs +++ b/Projectiles/Rogue/FishboneBoomerangProjectile.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() diff --git a/Projectiles/Rogue/Fork.cs b/Projectiles/Rogue/Fork.cs index 3a621e5fa9..7467556d56 100644 --- a/Projectiles/Rogue/Fork.cs +++ b/Projectiles/Rogue/Fork.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/FrostShardFriendly.cs b/Projectiles/Rogue/FrostShardFriendly.cs index 5f166e6d70..fe9ca6f148 100644 --- a/Projectiles/Rogue/FrostShardFriendly.cs +++ b/Projectiles/Rogue/FrostShardFriendly.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; } public override void AI() diff --git a/Projectiles/Rogue/GelDartProjectile.cs b/Projectiles/Rogue/GelDartProjectile.cs index 2a7639c289..79f2a0b1fb 100644 --- a/Projectiles/Rogue/GelDartProjectile.cs +++ b/Projectiles/Rogue/GelDartProjectile.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/GhoulishGougerBoomerang.cs b/Projectiles/Rogue/GhoulishGougerBoomerang.cs index 850823fa0c..ffb1af702c 100644 --- a/Projectiles/Rogue/GhoulishGougerBoomerang.cs +++ b/Projectiles/Rogue/GhoulishGougerBoomerang.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 7; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 7; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -117,7 +117,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/GildedDaggerProj.cs b/Projectiles/Rogue/GildedDaggerProj.cs index 5d1d4d48f2..bafb14937a 100644 --- a/Projectiles/Rogue/GildedDaggerProj.cs +++ b/Projectiles/Rogue/GildedDaggerProj.cs @@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/GlaiveProj.cs b/Projectiles/Rogue/GlaiveProj.cs index ef3c88a0a6..5ba3bdc63f 100644 --- a/Projectiles/Rogue/GlaiveProj.cs +++ b/Projectiles/Rogue/GlaiveProj.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -118,7 +118,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/GleamingDaggerProj.cs b/Projectiles/Rogue/GleamingDaggerProj.cs index 99c742ee71..2adb2139bb 100644 --- a/Projectiles/Rogue/GleamingDaggerProj.cs +++ b/Projectiles/Rogue/GleamingDaggerProj.cs @@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/GodsParanoiaDart.cs b/Projectiles/Rogue/GodsParanoiaDart.cs index 5313f73144..16caa8444d 100644 --- a/Projectiles/Rogue/GodsParanoiaDart.cs +++ b/Projectiles/Rogue/GodsParanoiaDart.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.timeLeft > 595) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/GodsParanoiaProj.cs b/Projectiles/Rogue/GodsParanoiaProj.cs index 5bf12b95e5..3a6c251b5b 100644 --- a/Projectiles/Rogue/GodsParanoiaProj.cs +++ b/Projectiles/Rogue/GodsParanoiaProj.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -109,7 +109,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/GraveGrimreaverProjectile.cs b/Projectiles/Rogue/GraveGrimreaverProjectile.cs index fec13ec0b2..2d405329bb 100644 --- a/Projectiles/Rogue/GraveGrimreaverProjectile.cs +++ b/Projectiles/Rogue/GraveGrimreaverProjectile.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/GreenDonkeyKongReference.cs b/Projectiles/Rogue/GreenDonkeyKongReference.cs index 1b8e63e9dd..fce9c945f1 100644 --- a/Projectiles/Rogue/GreenDonkeyKongReference.cs +++ b/Projectiles/Rogue/GreenDonkeyKongReference.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Rogue } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Rogue/GrimreaverBat.cs b/Projectiles/Rogue/GrimreaverBat.cs index 2577bb628c..035f912300 100644 --- a/Projectiles/Rogue/GrimreaverBat.cs +++ b/Projectiles/Rogue/GrimreaverBat.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); diff --git a/Projectiles/Rogue/GrimreaverSkull.cs b/Projectiles/Rogue/GrimreaverSkull.cs index b52d7d6c4b..36f83f8a40 100644 --- a/Projectiles/Rogue/GrimreaverSkull.cs +++ b/Projectiles/Rogue/GrimreaverSkull.cs @@ -11,10 +11,10 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs b/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs index 2916cc6b65..aa6704c88a 100644 --- a/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs +++ b/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -167,7 +167,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Rogue/Honeycomb.cs b/Projectiles/Rogue/Honeycomb.cs index 307c85c0b0..fa275b5ea9 100644 --- a/Projectiles/Rogue/Honeycomb.cs +++ b/Projectiles/Rogue/Honeycomb.cs @@ -99,7 +99,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/HypothermiaChunk.cs b/Projectiles/Rogue/HypothermiaChunk.cs index 7e2cecaddf..bdedfa919b 100644 --- a/Projectiles/Rogue/HypothermiaChunk.cs +++ b/Projectiles/Rogue/HypothermiaChunk.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/HypothermiaShard.cs b/Projectiles/Rogue/HypothermiaShard.cs index 343c1c80c2..054cdff67c 100644 --- a/Projectiles/Rogue/HypothermiaShard.cs +++ b/Projectiles/Rogue/HypothermiaShard.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { //Changes the texture of the projectile - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (Projectile.ai[0] == 1f) { texture = ModContent.Request("CalamityMod/Projectiles/Rogue/HypothermiaShard2").Value; diff --git a/Projectiles/Rogue/IcebreakerHammer.cs b/Projectiles/Rogue/IcebreakerHammer.cs index d040baf46a..3ab30014a9 100644 --- a/Projectiles/Rogue/IcebreakerHammer.cs +++ b/Projectiles/Rogue/IcebreakerHammer.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/IchorSpearProj.cs b/Projectiles/Rogue/IchorSpearProj.cs index c61396d01c..8829f4d7e7 100644 --- a/Projectiles/Rogue/IchorSpearProj.cs +++ b/Projectiles/Rogue/IchorSpearProj.cs @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/InfernalKrisCinder.cs b/Projectiles/Rogue/InfernalKrisCinder.cs index 237bfae602..648d864ded 100644 --- a/Projectiles/Rogue/InfernalKrisCinder.cs +++ b/Projectiles/Rogue/InfernalKrisCinder.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Rogue { // If this is a stealth strike, make the blade glow orange Color glowColour = new Color(255, 215, 100, 100); - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, glowColour, Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); float minScale = 1.9f; diff --git a/Projectiles/Rogue/InfernalKrisProjectile.cs b/Projectiles/Rogue/InfernalKrisProjectile.cs index 66c7e17204..60d4e259a8 100644 --- a/Projectiles/Rogue/InfernalKrisProjectile.cs +++ b/Projectiles/Rogue/InfernalKrisProjectile.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Rogue { // If this is a stealth strike, make the blade glow orange Color glowColour = new Color(255, 215, 100, 100); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], glowColour, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], glowColour, 1); float minScale = 1.9f; float maxScale = 2.5f; @@ -123,7 +123,7 @@ namespace CalamityMod.Projectiles.Rogue } else { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); } return false; } diff --git a/Projectiles/Rogue/InfestedClawmerangProj.cs b/Projectiles/Rogue/InfestedClawmerangProj.cs index 13a9af0825..ab0c7314d9 100644 --- a/Projectiles/Rogue/InfestedClawmerangProj.cs +++ b/Projectiles/Rogue/InfestedClawmerangProj.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/InkBombProjectile.cs b/Projectiles/Rogue/InkBombProjectile.cs index d63bb9830f..61728d7f5b 100644 --- a/Projectiles/Rogue/InkBombProjectile.cs +++ b/Projectiles/Rogue/InkBombProjectile.cs @@ -67,7 +67,6 @@ namespace CalamityMod.Projectiles.Rogue break; } int damage = (int)player.GetTotalDamage().ApplyTo(22); - damage = player.ApplyArmorAccDamageBonusesTo(damage); int inkID = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, Main.rand.NextFloat(-2f, 2f), Main.rand.NextFloat(-2f, 2f), inkType, damage, 7, Projectile.owner); Main.projectile[inkID].timeLeft += Main.rand.Next(-20, 25); diff --git a/Projectiles/Rogue/IronFranciscaProj.cs b/Projectiles/Rogue/IronFranciscaProj.cs index 92520b56eb..6352c68223 100644 --- a/Projectiles/Rogue/IronFranciscaProj.cs +++ b/Projectiles/Rogue/IronFranciscaProj.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/JawsProjectile.cs b/Projectiles/Rogue/JawsProjectile.cs index 73a0ad5587..897081520a 100644 --- a/Projectiles/Rogue/JawsProjectile.cs +++ b/Projectiles/Rogue/JawsProjectile.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/KelvinCatalystBoomerang.cs b/Projectiles/Rogue/KelvinCatalystBoomerang.cs index 6a2f3827e0..db15c7a74b 100644 --- a/Projectiles/Rogue/KelvinCatalystBoomerang.cs +++ b/Projectiles/Rogue/KelvinCatalystBoomerang.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 12; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 12; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -188,7 +188,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Rogue/Knife.cs b/Projectiles/Rogue/Knife.cs index 32e6c36e8d..31f3c1cf9b 100644 --- a/Projectiles/Rogue/Knife.cs +++ b/Projectiles/Rogue/Knife.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/LanceofDestiny.cs b/Projectiles/Rogue/LanceofDestiny.cs index 49ec34f37a..60d06ad8ae 100644 --- a/Projectiles/Rogue/LanceofDestiny.cs +++ b/Projectiles/Rogue/LanceofDestiny.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/LeadTomahawkProj.cs b/Projectiles/Rogue/LeadTomahawkProj.cs index d2a961382c..714492858c 100644 --- a/Projectiles/Rogue/LeadTomahawkProj.cs +++ b/Projectiles/Rogue/LeadTomahawkProj.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/LeonidCometBig.cs b/Projectiles/Rogue/LeonidCometBig.cs index d797ae04f1..0491cc876c 100644 --- a/Projectiles/Rogue/LeonidCometBig.cs +++ b/Projectiles/Rogue/LeonidCometBig.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), 1); return false; } diff --git a/Projectiles/Rogue/LeonidCometSmall.cs b/Projectiles/Rogue/LeonidCometSmall.cs index 9714deddb6..9bcf7cc54e 100644 --- a/Projectiles/Rogue/LeonidCometSmall.cs +++ b/Projectiles/Rogue/LeonidCometSmall.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), Projectile.rotation, tex.Size() / 2, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/LeonidProgenitorBombshell.cs b/Projectiles/Rogue/LeonidProgenitorBombshell.cs index 1eedb2ca47..8ecefdb0c6 100644 --- a/Projectiles/Rogue/LeonidProgenitorBombshell.cs +++ b/Projectiles/Rogue/LeonidProgenitorBombshell.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, lightColor, Projectile.rotation, tex.Size() / 2, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/LeviathanTooth.cs b/Projectiles/Rogue/LeviathanTooth.cs index bc64091280..d8917d0db4 100644 --- a/Projectiles/Rogue/LeviathanTooth.cs +++ b/Projectiles/Rogue/LeviathanTooth.cs @@ -35,8 +35,8 @@ namespace CalamityMod.Projectiles.Rogue public bool chomping = true; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -256,7 +256,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (Projectile.ai[1] == 2) tex = ModContent.Request("CalamityMod/Projectiles/Rogue/LeviathanTooth2").Value; if (Projectile.ai[1] == 3) diff --git a/Projectiles/Rogue/LionfishProj.cs b/Projectiles/Rogue/LionfishProj.cs index 33fe5a4944..6d6bd45d06 100644 --- a/Projectiles/Rogue/LionfishProj.cs +++ b/Projectiles/Rogue/LionfishProj.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; SpriteEffects spriteEffects = SpriteEffects.None; if (Projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; diff --git a/Projectiles/Rogue/LostSoulFriendly.cs b/Projectiles/Rogue/LostSoulFriendly.cs index 1b233eb724..2afa877aae 100644 --- a/Projectiles/Rogue/LostSoulFriendly.cs +++ b/Projectiles/Rogue/LostSoulFriendly.cs @@ -9,10 +9,10 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; Lighting.AddLight(Projectile.Center, 0.25f, 0.25f, 0.25f); @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Rogue { int cap = 5; float capDamageFactor = 0.05f; - int excessCount = Main.player[Projectile.owner].ownedProjectileCounts[Projectile.type] - cap; + int excessCount = Main.player[Projectile.owner].ownedProjectileCounts[Type] - cap; modifiers.SourceDamage *= MathHelper.Clamp(1f - (capDamageFactor * excessCount), 0f, 1f); } } @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/LunarKunaiProj.cs b/Projectiles/Rogue/LunarKunaiProj.cs index a7afccb20d..0e9238f4ce 100644 --- a/Projectiles/Rogue/LunarKunaiProj.cs +++ b/Projectiles/Rogue/LunarKunaiProj.cs @@ -16,10 +16,10 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 2; + Main.projFrames[Type] = 2; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/LuxorsGiftRogue.cs b/Projectiles/Rogue/LuxorsGiftRogue.cs index c970824e1c..2b0e580ad5 100644 --- a/Projectiles/Rogue/LuxorsGiftRogue.cs +++ b/Projectiles/Rogue/LuxorsGiftRogue.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Rogue/MalachiteBolt.cs b/Projectiles/Rogue/MalachiteBolt.cs index bfcae585c3..6645114223 100644 --- a/Projectiles/Rogue/MalachiteBolt.cs +++ b/Projectiles/Rogue/MalachiteBolt.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/MalachiteProj.cs b/Projectiles/Rogue/MalachiteProj.cs index f5653839f9..6ee5620237 100644 --- a/Projectiles/Rogue/MalachiteProj.cs +++ b/Projectiles/Rogue/MalachiteProj.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/MalachiteStealth.cs b/Projectiles/Rogue/MalachiteStealth.cs index 5cc69d9c07..d8bd435577 100644 --- a/Projectiles/Rogue/MalachiteStealth.cs +++ b/Projectiles/Rogue/MalachiteStealth.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/MangroveChakramProjectile.cs b/Projectiles/Rogue/MangroveChakramProjectile.cs index 6bd879b46b..81f4212305 100644 --- a/Projectiles/Rogue/MangroveChakramProjectile.cs +++ b/Projectiles/Rogue/MangroveChakramProjectile.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/MoltenAmputatorProj.cs b/Projectiles/Rogue/MoltenAmputatorProj.cs index 4abfdf3453..b2c7c1966d 100644 --- a/Projectiles/Rogue/MoltenAmputatorProj.cs +++ b/Projectiles/Rogue/MoltenAmputatorProj.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Rogue/MoltenBlobThrown.cs b/Projectiles/Rogue/MoltenBlobThrown.cs index 588a14db6c..4cf8a1b0ea 100644 --- a/Projectiles/Rogue/MoltenBlobThrown.cs +++ b/Projectiles/Rogue/MoltenBlobThrown.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; + Main.projFrames[Type] = 3; } public override void SetDefaults() diff --git a/Projectiles/Rogue/MonkeyDart.cs b/Projectiles/Rogue/MonkeyDart.cs index 7d120c08aa..727b4ffe66 100644 --- a/Projectiles/Rogue/MonkeyDart.cs +++ b/Projectiles/Rogue/MonkeyDart.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Rogue { if (Projectile.ai[0] == 1) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } return true; diff --git a/Projectiles/Rogue/MoonSigil.cs b/Projectiles/Rogue/MoonSigil.cs index 3527d04e0b..1e519983af 100644 --- a/Projectiles/Rogue/MoonSigil.cs +++ b/Projectiles/Rogue/MoonSigil.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Rogue { int cap = 5; float capDamageFactor = 0.05f; - int excessCount = Main.player[Projectile.owner].ownedProjectileCounts[Projectile.type] - cap; + int excessCount = Main.player[Projectile.owner].ownedProjectileCounts[Type] - cap; modifiers.SourceDamage *= MathHelper.Clamp(1f - (capDamageFactor * excessCount), 0f, 1f); } diff --git a/Projectiles/Rogue/MycorootProj.cs b/Projectiles/Rogue/MycorootProj.cs index 3fe48a9a8c..681c6a2201 100644 --- a/Projectiles/Rogue/MycorootProj.cs +++ b/Projectiles/Rogue/MycorootProj.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/MythrilKnifeProjectile.cs b/Projectiles/Rogue/MythrilKnifeProjectile.cs index 57eaf29f2b..0e041f6aba 100644 --- a/Projectiles/Rogue/MythrilKnifeProjectile.cs +++ b/Projectiles/Rogue/MythrilKnifeProjectile.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/NanoblackMain.cs b/Projectiles/Rogue/NanoblackMain.cs index 829a6f0a22..cd18f9f0ff 100644 --- a/Projectiles/Rogue/NanoblackMain.cs +++ b/Projectiles/Rogue/NanoblackMain.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 7; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 7; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -143,7 +143,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/NanoblackSplit.cs b/Projectiles/Rogue/NanoblackSplit.cs index a8b470856e..b311e37066 100644 --- a/Projectiles/Rogue/NanoblackSplit.cs +++ b/Projectiles/Rogue/NanoblackSplit.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -168,7 +168,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/NanoblackStealthSplit.cs b/Projectiles/Rogue/NanoblackStealthSplit.cs index 173092cc0d..eaaef636bf 100644 --- a/Projectiles/Rogue/NanoblackStealthSplit.cs +++ b/Projectiles/Rogue/NanoblackStealthSplit.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 7; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 7; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -177,7 +177,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/NiceCock.cs b/Projectiles/Rogue/NiceCock.cs index 11bc1ff1ca..51360e48a2 100644 --- a/Projectiles/Rogue/NiceCock.cs +++ b/Projectiles/Rogue/NiceCock.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; } public override void SetDefaults() @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Rogue if (!initialized) { // Pick a random frame to start on - Projectile.frame = Main.rand.Next(Main.projFrames[Projectile.type]); + Projectile.frame = Main.rand.Next(Main.projFrames[Type]); initialized = true; } @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; int index = (int)Projectile.ai[1]; diff --git a/Projectiles/Rogue/NightsGazeProjectile.cs b/Projectiles/Rogue/NightsGazeProjectile.cs index 380d4a6bc8..1676e41309 100644 --- a/Projectiles/Rogue/NightsGazeProjectile.cs +++ b/Projectiles/Rogue/NightsGazeProjectile.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/NightsGazeStar.cs b/Projectiles/Rogue/NightsGazeStar.cs index e45644d91c..69829d8f21 100644 --- a/Projectiles/Rogue/NightsGazeStar.cs +++ b/Projectiles/Rogue/NightsGazeStar.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -109,7 +109,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.White, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.White, 1); return false; } diff --git a/Projectiles/Rogue/NychthemeronOrb.cs b/Projectiles/Rogue/NychthemeronOrb.cs index b7230922fa..aa26e41cc1 100644 --- a/Projectiles/Rogue/NychthemeronOrb.cs +++ b/Projectiles/Rogue/NychthemeronOrb.cs @@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D texLight = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texLight = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D texDark = ModContent.Request("CalamityMod/Projectiles/Rogue/NychthemeronOrb2").Value; if (Projectile.ai[0] == 0f) { diff --git a/Projectiles/Rogue/NychthemeronProjectile.cs b/Projectiles/Rogue/NychthemeronProjectile.cs index 8810f57ab2..283a21e0b8 100644 --- a/Projectiles/Rogue/NychthemeronProjectile.cs +++ b/Projectiles/Rogue/NychthemeronProjectile.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.cs b/Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.cs index 1bdd516980..dab49da486 100644 --- a/Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.cs +++ b/Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/PalladiumJavelinProjectile.cs b/Projectiles/Rogue/PalladiumJavelinProjectile.cs index 2b5a7562de..a43502280a 100644 --- a/Projectiles/Rogue/PalladiumJavelinProjectile.cs +++ b/Projectiles/Rogue/PalladiumJavelinProjectile.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/PanSpark.cs b/Projectiles/Rogue/PanSpark.cs index 9fcf5404d8..941dae41cc 100644 --- a/Projectiles/Rogue/PanSpark.cs +++ b/Projectiles/Rogue/PanSpark.cs @@ -12,9 +12,9 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 3; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Rogue if (!initialized) { initialized = true; - Projectile.frame = Main.rand.Next(Main.projFrames[Projectile.type]); + Projectile.frame = Main.rand.Next(Main.projFrames[Type]); } Projectile.frameCounter++; if (Projectile.frameCounter > 6) @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -132,7 +132,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/PenumbraBomb.cs b/Projectiles/Rogue/PenumbraBomb.cs index adff0d85fb..3ecbfb63bd 100644 --- a/Projectiles/Rogue/PenumbraBomb.cs +++ b/Projectiles/Rogue/PenumbraBomb.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/PenumbraSoul.cs b/Projectiles/Rogue/PenumbraSoul.cs index 8e4930114c..a942a55356 100644 --- a/Projectiles/Rogue/PenumbraSoul.cs +++ b/Projectiles/Rogue/PenumbraSoul.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/PhantasmalRuinProj.cs b/Projectiles/Rogue/PhantasmalRuinProj.cs index 28c391a7cc..e0b8e583db 100644 --- a/Projectiles/Rogue/PhantasmalRuinProj.cs +++ b/Projectiles/Rogue/PhantasmalRuinProj.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 12; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 12; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 3); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 3); return false; } diff --git a/Projectiles/Rogue/PhantasmalSoul.cs b/Projectiles/Rogue/PhantasmalSoul.cs index f0f89a8501..f902cf4c79 100644 --- a/Projectiles/Rogue/PhantasmalSoul.cs +++ b/Projectiles/Rogue/PhantasmalSoul.cs @@ -17,10 +17,10 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.timeLeft > Lifetime - NoDrawFrames) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/PhantasmalSoulBlue.cs b/Projectiles/Rogue/PhantasmalSoulBlue.cs index 6b8fe467e9..a8d0612531 100644 --- a/Projectiles/Rogue/PhantasmalSoulBlue.cs +++ b/Projectiles/Rogue/PhantasmalSoulBlue.cs @@ -18,10 +18,10 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -81,7 +81,7 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.timeLeft > Lifetime - NoDrawFrames) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/PlaguenadeBee.cs b/Projectiles/Rogue/PlaguenadeBee.cs index a5143606fb..b7bd8e95f2 100644 --- a/Projectiles/Rogue/PlaguenadeBee.cs +++ b/Projectiles/Rogue/PlaguenadeBee.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -137,8 +137,8 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int frameHeight = texture.Height / Main.projFrames[Type]; int drawStart = frameHeight * Projectile.frame; SpriteEffects spriteEffects = SpriteEffects.None; if (Projectile.spriteDirection == -1) diff --git a/Projectiles/Rogue/PlaguenadeProj.cs b/Projectiles/Rogue/PlaguenadeProj.cs index 4efa0328c3..8f8ff934e5 100644 --- a/Projectiles/Rogue/PlaguenadeProj.cs +++ b/Projectiles/Rogue/PlaguenadeProj.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/PrismShurikenBlade.cs b/Projectiles/Rogue/PrismShurikenBlade.cs index d535d70023..fe3d80d954 100644 --- a/Projectiles/Rogue/PrismShurikenBlade.cs +++ b/Projectiles/Rogue/PrismShurikenBlade.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); return false; } } diff --git a/Projectiles/Rogue/Prismalline2.cs b/Projectiles/Rogue/Prismalline2.cs index 84c7e8de2f..040527656c 100644 --- a/Projectiles/Rogue/Prismalline2.cs +++ b/Projectiles/Rogue/Prismalline2.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/Prismalline3.cs b/Projectiles/Rogue/Prismalline3.cs index b93567254b..a57b72b223 100644 --- a/Projectiles/Rogue/Prismalline3.cs +++ b/Projectiles/Rogue/Prismalline3.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/PrismallineProj.cs b/Projectiles/Rogue/PrismallineProj.cs index c47deff442..60ff9fdaa0 100644 --- a/Projectiles/Rogue/PrismallineProj.cs +++ b/Projectiles/Rogue/PrismallineProj.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/ProfanedPartisanProj.cs b/Projectiles/Rogue/ProfanedPartisanProj.cs index edb349683d..b7c056a4ad 100644 --- a/Projectiles/Rogue/ProfanedPartisanProj.cs +++ b/Projectiles/Rogue/ProfanedPartisanProj.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/ProfanedPartisanSpear.cs b/Projectiles/Rogue/ProfanedPartisanSpear.cs index f0f15157a0..0f9ab63c40 100644 --- a/Projectiles/Rogue/ProfanedPartisanSpear.cs +++ b/Projectiles/Rogue/ProfanedPartisanSpear.cs @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/RadiantStar2.cs b/Projectiles/Rogue/RadiantStar2.cs index e2253b15ee..d50bc1c07a 100644 --- a/Projectiles/Rogue/RadiantStar2.cs +++ b/Projectiles/Rogue/RadiantStar2.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -81,7 +81,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/RadiantStarKnife.cs b/Projectiles/Rogue/RadiantStarKnife.cs index fa3d6ca7ff..33e48e406f 100644 --- a/Projectiles/Rogue/RadiantStarKnife.cs +++ b/Projectiles/Rogue/RadiantStarKnife.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -110,7 +110,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/RadiationRain.cs b/Projectiles/Rogue/RadiationRain.cs index 711076d314..cc11835bbd 100644 --- a/Projectiles/Rogue/RadiationRain.cs +++ b/Projectiles/Rogue/RadiationRain.cs @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Rogue } if (Projectile.ai[2] > 0 && time == 30) - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), spawnSpot, Projectile.velocity, ModContent.ProjectileType(), (int)(Projectile.damage), 0f, Projectile.owner, 0, 0, Projectile.ai[2] - 1); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnSpot, Projectile.velocity, ModContent.ProjectileType(), (int)(Projectile.damage), 0f, Projectile.owner, 0, 0, Projectile.ai[2] - 1); time++; } diff --git a/Projectiles/Rogue/RealityRuptureLance.cs b/Projectiles/Rogue/RealityRuptureLance.cs index 3fe8595e45..1c809342c0 100644 --- a/Projectiles/Rogue/RealityRuptureLance.cs +++ b/Projectiles/Rogue/RealityRuptureLance.cs @@ -54,9 +54,9 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + int frameHeight = texture.Height / Main.projFrames[Type]; int frameY = frameHeight * Projectile.frame; float scale = Projectile.scale; float rotation = Projectile.rotation; diff --git a/Projectiles/Rogue/RealityRuptureStealth.cs b/Projectiles/Rogue/RealityRuptureStealth.cs index ce21f21560..5842c87c3b 100644 --- a/Projectiles/Rogue/RealityRuptureStealth.cs +++ b/Projectiles/Rogue/RealityRuptureStealth.cs @@ -77,9 +77,9 @@ namespace CalamityMod.Projectiles.Rogue } public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + int frameHeight = texture.Height / Main.projFrames[Type]; int frameY = frameHeight * Projectile.frame; float scale = Projectile.scale; float rotation = Projectile.rotation; diff --git a/Projectiles/Rogue/ReaperProjectile.cs b/Projectiles/Rogue/ReaperProjectile.cs index 34378bfbbb..602a1d1119 100644 --- a/Projectiles/Rogue/ReaperProjectile.cs +++ b/Projectiles/Rogue/ReaperProjectile.cs @@ -37,8 +37,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -249,13 +249,13 @@ namespace CalamityMod.Projectiles.Rogue } Particle Smear = new CustomPulse(rainSpot, Vector2.Zero, Color.Chartreuse * 0.7f, "CalamityMod/Particles/DustyCircleHardEdge", Vector2.One, Main.rand.NextFloat(-5, 5), 0, 0.35f, 12); GeneralParticleHandler.SpawnParticle(Smear); - Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), rainSpot, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.1), 0f, Projectile.owner, 0, 0, 100); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), rainSpot, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.1), 0f, Projectile.owner, 0, 0, 100); } else // Radiation Burst { SoundStyle fire = new("CalamityMod/Sounds/Item/RadiationBurst"); SoundEngine.PlaySound(fire with { Volume = 1f, Pitch = 0, MaxInstances = -1 }, Projectile.Center); - Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center + target.velocity * 32, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage), Projectile.knockBack * 3, Projectile.owner, 0, 0, 0); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + target.velocity * 32, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage), Projectile.knockBack * 3, Projectile.owner, 0, 0, 0); } } target.AddBuff(ModContent.BuffType(), 90); @@ -282,7 +282,7 @@ namespace CalamityMod.Projectiles.Rogue if (spinning) { Main.EntitySpriteDraw(p.Value, drawPos + Projectile.velocity.SafeNormalize(Vector2.UnitX) * 4, null, Color.Chartreuse with { A = 0 } * 0.45f, Projectile.velocity.ToRotation() + MathHelper.PiOver2, p.Size() * 0.5f, new Vector2(0.9f - 0.3f * Utils.GetLerpValue(25, 0, time, true), 1 + 0.6f * Utils.GetLerpValue(25, 0, time, true)) * Main.rand.NextFloat(1.25f, 1.4f), SpriteEffects.None); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Chartreuse * 0.5f, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Chartreuse * 0.5f, 1); } return false; } diff --git a/Projectiles/Rogue/ReboundingRainbowProj.cs b/Projectiles/Rogue/ReboundingRainbowProj.cs index dc64249bbe..7a05825cc5 100644 --- a/Projectiles/Rogue/ReboundingRainbowProj.cs +++ b/Projectiles/Rogue/ReboundingRainbowProj.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -191,7 +191,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Rogue/ReboundingRainbowSplit.cs b/Projectiles/Rogue/ReboundingRainbowSplit.cs index d9ee841801..95aecb60a2 100644 --- a/Projectiles/Rogue/ReboundingRainbowSplit.cs +++ b/Projectiles/Rogue/ReboundingRainbowSplit.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) diff --git a/Projectiles/Rogue/RefractionRotorProjectile.cs b/Projectiles/Rogue/RefractionRotorProjectile.cs index 7bafa8c5b8..529037d242 100644 --- a/Projectiles/Rogue/RefractionRotorProjectile.cs +++ b/Projectiles/Rogue/RefractionRotorProjectile.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 16; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 16; } public override void SetDefaults() @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.MaxUpdates = 2; Projectile.tileCollide = false; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 20; + Projectile.localNPCHitCooldown = 10; Projectile.DamageType = RogueDamageClass.Instance; } diff --git a/Projectiles/Rogue/RefractionRotorSlashCreator.cs b/Projectiles/Rogue/RefractionRotorSlashCreator.cs index ad9b68446f..48414382ae 100644 --- a/Projectiles/Rogue/RefractionRotorSlashCreator.cs +++ b/Projectiles/Rogue/RefractionRotorSlashCreator.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Rogue Vector2 spawnOffset = SlashDirection.ToRotationVector2(); spawnOffset *= Main.rand.NextFloatDirection() * maxOffset; Vector2 sliceVelocity = spawnOffset.SafeNormalize(Vector2.UnitY) * 0.1f; - for (int i = 0; i < 4; i++) + for (int i = 0; i < 2; i++) { Projectile.NewProjectile(Projectile.GetSource_FromAI(), Projectile.Center + spawnOffset, sliceVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5), 0f, Projectile.owner); } diff --git a/Projectiles/Rogue/RefractionSlash.cs b/Projectiles/Rogue/RefractionSlash.cs index e60cf1910b..69aa4d974d 100644 --- a/Projectiles/Rogue/RefractionSlash.cs +++ b/Projectiles/Rogue/RefractionSlash.cs @@ -42,10 +42,7 @@ namespace CalamityMod.Projectiles.Rogue } } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) - { - return Projectile.RotatingHitboxCollision(targetHitbox.TopLeft(), targetHitbox.Size()); - } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox); public override bool ShouldUpdatePosition() => true; diff --git a/Projectiles/Rogue/RegulusRiotProj.cs b/Projectiles/Rogue/RegulusRiotProj.cs index 331c820572..894510f190 100644 --- a/Projectiles/Rogue/RegulusRiotProj.cs +++ b/Projectiles/Rogue/RegulusRiotProj.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -154,7 +154,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Rogue/RotBallProjectile.cs b/Projectiles/Rogue/RotBallProjectile.cs index 47437ea0d3..66ce8495dc 100644 --- a/Projectiles/Rogue/RotBallProjectile.cs +++ b/Projectiles/Rogue/RotBallProjectile.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/SacrificeProjectile.cs b/Projectiles/Rogue/SacrificeProjectile.cs index fd2c11b97d..d14526b969 100644 --- a/Projectiles/Rogue/SacrificeProjectile.cs +++ b/Projectiles/Rogue/SacrificeProjectile.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Rogue public override string Texture => "CalamityMod/Items/Weapons/Rogue/Sacrifice"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; } public override void SetDefaults() @@ -102,7 +102,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); return false; } diff --git a/Projectiles/Rogue/SamsaraSlicerProjectile.cs b/Projectiles/Rogue/SamsaraSlicerProjectile.cs index e4e11c27af..1433f615a4 100644 --- a/Projectiles/Rogue/SamsaraSlicerProjectile.cs +++ b/Projectiles/Rogue/SamsaraSlicerProjectile.cs @@ -31,8 +31,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -215,7 +215,7 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.ai[2] < 0) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], new Color(0f, 0.6f, 0f, 0f), 2, ModContent.Request("CalamityMod/Items/Weapons/Rogue/SamsaraSlicerGlow").Value); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], new Color(0f, 0.6f, 0f, 0f), 2, ModContent.Request("CalamityMod/Items/Weapons/Rogue/SamsaraSlicerGlow").Value); } else { diff --git a/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs b/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs index 9e29cade13..dac74b5b0d 100644 --- a/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs +++ b/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Rogue public Projectile Parent = null; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.oldPos[i] = oldP2 + (oldP2.DirectionTo(oldP1) * MathHelper.Min(oldP2.Distance(oldP1), 5)); } - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], new Color(0.2f, 1f, 0f, 0f), 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], new Color(0.2f, 1f, 0f, 0f), 2); return false; } } diff --git a/Projectiles/Rogue/ScarletDevilProjectile.cs b/Projectiles/Rogue/ScarletDevilProjectile.cs index 07873133be..26bd32b34d 100644 --- a/Projectiles/Rogue/ScarletDevilProjectile.cs +++ b/Projectiles/Rogue/ScarletDevilProjectile.cs @@ -19,13 +19,13 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 45; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 45; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 45; + ProjectileID.Sets.TrailCacheLength[Type] = 45; Projectile.width = 108; Projectile.height = 108; Projectile.friendly = true; @@ -183,7 +183,7 @@ namespace CalamityMod.Projectiles.Rogue { if (!Projectile.Calamity().stealthStrike) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], new Color(100, 100, 100)); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], new Color(100, 100, 100)); return true; } else @@ -192,7 +192,7 @@ namespace CalamityMod.Projectiles.Rogue PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + Projectile.velocity.SafeNormalize(Vector2.Zero) * 86f, false, shader: GameShaders.Misc["CalamityMod:OverpoweredTouhouSpearShader"]), 60); - Texture2D spearTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D spearTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; for (int i = 0; i < 7; i++) { diff --git a/Projectiles/Rogue/ScourgeVenomCloud.cs b/Projectiles/Rogue/ScourgeVenomCloud.cs index 1ea306b316..a1fa4c3477 100644 --- a/Projectiles/Rogue/ScourgeVenomCloud.cs +++ b/Projectiles/Rogue/ScourgeVenomCloud.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 10; + Main.projFrames[Type] = 10; } public override void SetDefaults() @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.frame = 0; } } - else if (Projectile.owner == Main.myPlayer && Projectile.frame >= Main.projFrames[Projectile.type]) + else if (Projectile.owner == Main.myPlayer && Projectile.frame >= Main.projFrames[Type]) { Projectile.Kill(); } diff --git a/Projectiles/Rogue/ScourgeoftheDesertProj.cs b/Projectiles/Rogue/ScourgeoftheDesertProj.cs index 90d25a4c2c..3b9e665621 100644 --- a/Projectiles/Rogue/ScourgeoftheDesertProj.cs +++ b/Projectiles/Rogue/ScourgeoftheDesertProj.cs @@ -21,12 +21,14 @@ namespace CalamityMod.Projectiles.Rogue public Vector2 SavedOldVelocity; public Vector2 NPCDestination; public bool SetPierce = false; + public int postHitNoDig = 0; + public bool collideWithTiles = true; public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -36,7 +38,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.friendly = true; Projectile.penetrate = 2; Projectile.DamageType = RogueDamageClass.Instance; - Projectile.tileCollide = true; + Projectile.tileCollide = false; Projectile.timeLeft = 600; Projectile.extraUpdates = 1; Projectile.usesLocalNPCImmunity = true; @@ -49,7 +51,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.penetrate = Projectile.Calamity().stealthStrike ? 4 : 2; SetPierce = true; } - InsideTiles = Collision.SolidCollision(Projectile.Center, 50, 50); + InsideTiles = Collision.SolidCollision(Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitX * 10), 10, 10); Time++; Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; Player Owner = Main.player[Projectile.owner]; @@ -57,12 +59,15 @@ namespace CalamityMod.Projectiles.Rogue if (Main.rand.NextBool(2)) { - Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(20, 20), Main.rand.NextBool() ? 288 : 207); + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(20, 20), Main.rand.NextBool() ? 288 : 121); dust.scale = Main.rand.NextFloat(0.3f, 0.55f); dust.noGravity = true; dust.velocity = -Projectile.velocity * 0.5f; } + if (postHitNoDig > 0) + postHitNoDig--; + if (!InitialTileHit && Time > 45) { if (Projectile.velocity.Y < 0) @@ -81,13 +86,15 @@ namespace CalamityMod.Projectiles.Rogue SoundEngine.PlaySound(SoundID.NPCHit11 with { Volume = 1.3f, Pitch = 1.1f }, Projectile.Center); for (int i = 0; i <= 25; i++) { - Dust dust = Dust.NewDustPerfect(Projectile.Center - Projectile.velocity * 6.5f, Main.rand.NextBool() ? 207 : 216, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(30f)) * Main.rand.NextFloat(0.3f, 0.9f), 0, default, Main.rand.NextFloat(1.3f, 1.8f)); + Dust dust = Dust.NewDustPerfect(Projectile.Center - Projectile.velocity * 6.5f, Main.rand.NextBool() ? 121 : 216, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(30f)) * Main.rand.NextFloat(0.3f, 0.9f), 0, default, Main.rand.NextFloat(1.3f, 1.8f)); dust.noGravity = true; } PostExitTiles = true; } if (PostExitTiles) { + if (Projectile.velocity.Length() < 10) + Projectile.velocity *= 1.02f; if (Projectile.timeLeft % 2 == 0 && playerDist < 1400f) { SparkParticle spark = new SparkParticle(Projectile.Center - Projectile.velocity * 8f, -Projectile.velocity * 0.1f, false, 9, 2.3f, Color.White * 0.1f); @@ -155,23 +162,28 @@ namespace CalamityMod.Projectiles.Rogue } } } + + CustomTileCollide(); } - public override bool OnTileCollide(Vector2 oldVelocity) + public void CustomTileCollide() { - SavedOldVelocity = oldVelocity; - Projectile.tileCollide = false; - if (!InitialTileHit) // Enter ground + if (collideWithTiles && postHitNoDig == 0 && InsideTiles && Time > 5) { - for (int i = 0; i <= 25; i++) + SavedOldVelocity = Projectile.velocity; + collideWithTiles = false; + + if (!InitialTileHit) // Enter ground { - Dust dust = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 3, Main.rand.NextBool() ? 207 : 216, -Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(30f)) * Main.rand.NextFloat(0.3f, 0.9f), 0, default, Main.rand.NextFloat(1.3f, 1.8f)); - dust.noGravity = true; + for (int i = 0; i <= 25; i++) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 3, Main.rand.NextBool() ? 121 : 216, -Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(30f)) * Main.rand.NextFloat(0.3f, 0.9f), 0, default, Main.rand.NextFloat(1.3f, 1.8f)); + dust.noGravity = true; + } + Projectile.velocity = SavedOldVelocity * 0.7f; + SoundEngine.PlaySound(SoundID.WormDig with { Volume = 1.5f, Pitch = 1.1f }, Projectile.Center); + InitialTileHit = true; } - Projectile.velocity = oldVelocity * 0.7f; - SoundEngine.PlaySound(SoundID.WormDig with { Volume = 1.5f, Pitch = 1.1f }, Projectile.Center); - InitialTileHit = true; } - return false; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { @@ -182,26 +194,28 @@ namespace CalamityMod.Projectiles.Rogue } if (Projectile.Calamity().stealthStrike) { + if (PostExitTiles || InsideTiles) + Projectile.extraUpdates = 4; Projectile.timeLeft = 600; Time = 10; TimeUnderground = 0; PostExitTiles = false; + postHitNoDig = 50; InitialTileHit = false; - InsideTiles = false; - Projectile.tileCollide = true; + collideWithTiles = true; } } public override void OnKill(int timeLeft) { for (int i = 0; i <= 25; i++) { - Dust dust = Dust.NewDustPerfect(Projectile.Center - Projectile.velocity, Main.rand.NextBool(3) ? 216 : 207, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.05f, 2.2f), 0, default, Main.rand.NextFloat(1.5f, 2.8f)); + Dust dust = Dust.NewDustPerfect(Projectile.Center - Projectile.velocity, Main.rand.NextBool(3) ? 216 : 121, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.05f, 2.2f), 0, default, Main.rand.NextFloat(1.5f, 2.8f)); dust.noGravity = true; } } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2, null, true, true); return false; } } diff --git a/Projectiles/Rogue/ScourgeoftheSeasProjectile.cs b/Projectiles/Rogue/ScourgeoftheSeasProjectile.cs index e3a34b3310..ec0174b1a5 100644 --- a/Projectiles/Rogue/ScourgeoftheSeasProjectile.cs +++ b/Projectiles/Rogue/ScourgeoftheSeasProjectile.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -89,7 +89,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/SeafoamBubble.cs b/Projectiles/Rogue/SeafoamBubble.cs index d33e0aa2b0..31a35ff41b 100644 --- a/Projectiles/Rogue/SeafoamBubble.cs +++ b/Projectiles/Rogue/SeafoamBubble.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -42,7 +43,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.damage *= 2; } } - + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item54, Projectile.position); diff --git a/Projectiles/Rogue/SealedSingularityBlackhole.cs b/Projectiles/Rogue/SealedSingularityBlackhole.cs index 2450b07510..2ca31c17bd 100644 --- a/Projectiles/Rogue/SealedSingularityBlackhole.cs +++ b/Projectiles/Rogue/SealedSingularityBlackhole.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 7; + Main.projFrames[Type] = 7; } public override void SetDefaults() @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); return false; } @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Rogue { Projectile.frame++; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Rogue/SealedSingularityGore.cs b/Projectiles/Rogue/SealedSingularityGore.cs index 4a8db4cc51..77492eb2cc 100644 --- a/Projectiles/Rogue/SealedSingularityGore.cs +++ b/Projectiles/Rogue/SealedSingularityGore.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Rogue texture = ModContent.Request("CalamityMod/Projectiles/Rogue/SealedSingularityGore3").Value; break; default: - texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; break; } Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, texture.Height / 2f), Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Rogue/SearedPanProjectile.cs b/Projectiles/Rogue/SearedPanProjectile.cs index a7022fce06..11e591ffc0 100644 --- a/Projectiles/Rogue/SearedPanProjectile.cs +++ b/Projectiles/Rogue/SearedPanProjectile.cs @@ -29,8 +29,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -199,7 +199,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/SeraphimAngelicLight.cs b/Projectiles/Rogue/SeraphimAngelicLight.cs index 3519a18273..e1f1561977 100644 --- a/Projectiles/Rogue/SeraphimAngelicLight.cs +++ b/Projectiles/Rogue/SeraphimAngelicLight.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 10; + Main.projFrames[Type] = 10; } public override void SetDefaults() @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.scale = CalamityUtils.Convert01To010(Projectile.timeLeft / 10f); Projectile.Opacity = (float)Math.Sqrt(Projectile.scale); Projectile.velocity *= 0.8f; - Projectile.frame = Main.projFrames[Projectile.type] - Projectile.timeLeft; + Projectile.frame = Main.projFrames[Type] - Projectile.timeLeft; } public override void OnKill(int timeLeft) diff --git a/Projectiles/Rogue/SeraphimAngelicLight2.cs b/Projectiles/Rogue/SeraphimAngelicLight2.cs index bae53092ef..3c3d4e443b 100644 --- a/Projectiles/Rogue/SeraphimAngelicLight2.cs +++ b/Projectiles/Rogue/SeraphimAngelicLight2.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Rogue public override string Texture => "CalamityMod/Projectiles/Rogue/SeraphimAngelicLight"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 10; + Main.projFrames[Type] = 10; } public override void SetDefaults() @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.scale = CalamityUtils.Convert01To010(Projectile.timeLeft / (float)Lifetime); Projectile.Opacity = (float)Math.Sqrt(Projectile.scale); Projectile.velocity *= 0.8f; - Projectile.frame = (int)(Utils.GetLerpValue(Lifetime, 0f, Projectile.timeLeft, true) * Main.projFrames[Projectile.type]); + Projectile.frame = (int)(Utils.GetLerpValue(Lifetime, 0f, Projectile.timeLeft, true) * Main.projFrames[Type]); } public override void OnKill(int timeLeft) diff --git a/Projectiles/Rogue/SeraphimBeamLarge.cs b/Projectiles/Rogue/SeraphimBeamLarge.cs index f0940f0ab8..ad41f9fa89 100644 --- a/Projectiles/Rogue/SeraphimBeamLarge.cs +++ b/Projectiles/Rogue/SeraphimBeamLarge.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 10; + Main.projFrames[Type] = 10; } public override void SetDefaults() @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Rogue // Determine frames. Projectile.frameCounter++; if (Projectile.frameCounter % 5f == 4f) - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; } // Rapidly decrease damage every hit @@ -117,9 +117,9 @@ namespace CalamityMod.Projectiles.Rogue return false; Color beamColor = LaserOverlayColor; - Rectangle startFrameArea = LaserBeginTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); - Rectangle middleFrameArea = LaserMiddleTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); - Rectangle endFrameArea = LaserEndTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Rectangle startFrameArea = LaserBeginTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Rectangle middleFrameArea = LaserMiddleTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Rectangle endFrameArea = LaserEndTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); // Start texture drawing. Vector2 centerOnLaser = Projectile.Center + Projectile.velocity * Projectile.scale * 116f; diff --git a/Projectiles/Rogue/SeraphimDagger.cs b/Projectiles/Rogue/SeraphimDagger.cs index aaea9660ad..fc174afd86 100644 --- a/Projectiles/Rogue/SeraphimDagger.cs +++ b/Projectiles/Rogue/SeraphimDagger.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 origin = texture.Size() * 0.5f; Vector2 baseDrawPosition = Projectile.Center - Main.screenPosition; diff --git a/Projectiles/Rogue/SeraphimProjectile.cs b/Projectiles/Rogue/SeraphimProjectile.cs index 2e27bbe5bd..e16685c4a0 100644 --- a/Projectiles/Rogue/SeraphimProjectile.cs +++ b/Projectiles/Rogue/SeraphimProjectile.cs @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 origin = texture.Size() * 0.5f; Vector2 baseDrawPosition = Projectile.Center - Main.screenPosition; diff --git a/Projectiles/Rogue/ShatteredSunKnife.cs b/Projectiles/Rogue/ShatteredSunKnife.cs index 9a6017b8d5..dc2a14cb85 100644 --- a/Projectiles/Rogue/ShatteredSunKnife.cs +++ b/Projectiles/Rogue/ShatteredSunKnife.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -123,7 +123,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs index a62c7f499b..60081d12c1 100644 --- a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs +++ b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -145,7 +145,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/ShinobiBladeProjectile.cs b/Projectiles/Rogue/ShinobiBladeProjectile.cs index 2b457f6bdb..7eee20f797 100644 --- a/Projectiles/Rogue/ShinobiBladeProjectile.cs +++ b/Projectiles/Rogue/ShinobiBladeProjectile.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/ShockGrenadeBolt.cs b/Projectiles/Rogue/ShockGrenadeBolt.cs index 3d647376a3..1a1db9e013 100644 --- a/Projectiles/Rogue/ShockGrenadeBolt.cs +++ b/Projectiles/Rogue/ShockGrenadeBolt.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Rogue/ShockGrenadeProjectile.cs b/Projectiles/Rogue/ShockGrenadeProjectile.cs index 16ec5fcfd3..591bea4e50 100644 --- a/Projectiles/Rogue/ShockGrenadeProjectile.cs +++ b/Projectiles/Rogue/ShockGrenadeProjectile.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/ShockTeslaAura.cs b/Projectiles/Rogue/ShockTeslaAura.cs index 799665639c..da9583480a 100644 --- a/Projectiles/Rogue/ShockTeslaAura.cs +++ b/Projectiles/Rogue/ShockTeslaAura.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D sprite = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D sprite = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Color drawColour = Color.White; Rectangle sourceRect = new Rectangle(Projectile.width * (int)Projectile.localAI[1], Projectile.height * (int)Projectile.localAI[0], Projectile.width, Projectile.height); diff --git a/Projectiles/Rogue/SlickCaneProjectile.cs b/Projectiles/Rogue/SlickCaneProjectile.cs index 5e325c56e6..85c60db307 100644 --- a/Projectiles/Rogue/SlickCaneProjectile.cs +++ b/Projectiles/Rogue/SlickCaneProjectile.cs @@ -1,6 +1,7 @@ using System; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.NPCs.NormalNPCs; using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -22,7 +23,7 @@ namespace CalamityMod.Projectiles.Rogue private bool initialized = false; public override void SetDefaults() { - Projectile.width = 42; + Projectile.width = 40; Projectile.height = 36; Projectile.DamageType = RogueDamageClass.Instance; Projectile.timeLeft = 120; @@ -55,7 +56,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { Vector2 drawPosition = Projectile.position + new Vector2(Projectile.width, Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; - Texture2D alternateHookTexture = Projectile.spriteDirection == -1 ? ModContent.Request("CalamityMod/Projectiles/Rogue/SlickCaneProjectileAlt").Value : Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D alternateHookTexture = Projectile.spriteDirection == -1 ? ModContent.Request("CalamityMod/Projectiles/Rogue/SlickCaneProjectileAlt").Value : Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 origin = new Vector2(Projectile.spriteDirection == 1 ? alternateHookTexture.Width + 8f : -8f, -8f); Main.EntitySpriteDraw(alternateHookTexture, drawPosition, null, lightColor, Projectile.rotation, @@ -80,14 +81,15 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { Player player = Main.player[Projectile.owner]; - if (Projectile.owner == Main.myPlayer && target.IsAnEnemy(false)) + //Dont drop money from Dummies, WoF eyes and worm segments to make grinding money a bit harder and not give money from Dummies since that was apparently happening + if (Projectile.owner == Main.myPlayer && target.IsAnEnemy(false) && !target.dontCountMe && !CalamityLists.needsDebuffIconDisplayList.Contains(target.type)) { float moneyValueToDrop = target.value / Main.rand.NextFloat(15f, 35f); // Maximum of 50 silver, not counting steath strikes moneyValueToDrop = (int)MathHelper.Clamp(moneyValueToDrop, 0, 5000f); if (Projectile.Calamity().stealthStrike && Main.rand.NextBool(20)) { - moneyValueToDrop += Item.buyPrice(0, Main.rand.Next(1, 4), Main.rand.Next(0, 100), Main.rand.Next(0, 100)); + moneyValueToDrop += Item.buyPrice(0, Main.rand.Next(1, 3), Main.rand.Next(0, 100), Main.rand.Next(0, 100)); SoundEngine.PlaySound(TheSevensStriker.TriplesSound, Projectile.Center); } else if (moneyValueToDrop > 0f) @@ -142,16 +144,16 @@ namespace CalamityMod.Projectiles.Rogue } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - // Boost dmg in proportion to money, caps at 2 plat + // Boost dmg in proportion to money, caps at 5 plat. Unless in Gfb cuz it would be funny if (Projectile.Calamity().stealthStrike) { Player player = Main.player[Projectile.owner]; double money = Utils.CoinsCount(out bool overflow, player.inventory); - if (money >= 2000000) - money = 2000000; + if (money >= 5000000 && !Main.zenithWorld) + money = 5000000; if (money != 0) { - modifiers.SourceDamage *= (float)(money / 500000 + 1); + modifiers.SourceDamage *= (float)(money / 1250000 + 1); SoundEngine.PlaySound(TheSevensStriker.JackpotSound, Projectile.Center); for (int j = 0; j < 8; j++) { diff --git a/Projectiles/Rogue/SludgeSplotchProj2.cs b/Projectiles/Rogue/SludgeSplotchProj2.cs index db7798497c..9d8560b6c3 100644 --- a/Projectiles/Rogue/SludgeSplotchProj2.cs +++ b/Projectiles/Rogue/SludgeSplotchProj2.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/SnapClamProj.cs b/Projectiles/Rogue/SnapClamProj.cs index f9dfd6d0da..f84567151f 100644 --- a/Projectiles/Rogue/SnapClamProj.cs +++ b/Projectiles/Rogue/SnapClamProj.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 2; + Main.projFrames[Type] = 2; } public override void SetDefaults() diff --git a/Projectiles/Rogue/SnapClamStealth.cs b/Projectiles/Rogue/SnapClamStealth.cs index 7e8c16117d..a7dd3b8d1c 100644 --- a/Projectiles/Rogue/SnapClamStealth.cs +++ b/Projectiles/Rogue/SnapClamStealth.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 2; + Main.projFrames[Type] = 2; } public override void SetDefaults() diff --git a/Projectiles/Rogue/SpearofDestinyProjectile.cs b/Projectiles/Rogue/SpearofDestinyProjectile.cs index f63822b705..7326defabb 100644 --- a/Projectiles/Rogue/SpearofDestinyProjectile.cs +++ b/Projectiles/Rogue/SpearofDestinyProjectile.cs @@ -109,9 +109,9 @@ namespace CalamityMod.Projectiles.Rogue } public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + int frameHeight = texture.Height / Main.projFrames[Type]; int frameY = frameHeight * Projectile.frame; float scale = Projectile.scale; float rotation = Projectile.rotation; diff --git a/Projectiles/Rogue/SpearofDestinyStealth.cs b/Projectiles/Rogue/SpearofDestinyStealth.cs index 9e68d646a7..d117d5262e 100644 --- a/Projectiles/Rogue/SpearofDestinyStealth.cs +++ b/Projectiles/Rogue/SpearofDestinyStealth.cs @@ -87,9 +87,9 @@ namespace CalamityMod.Projectiles.Rogue } public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + int frameHeight = texture.Height / Main.projFrames[Type]; int frameY = frameHeight * Projectile.frame; float scale = Projectile.scale; float rotation = Projectile.rotation; diff --git a/Projectiles/Rogue/SpearofPaleolithProj.cs b/Projectiles/Rogue/SpearofPaleolithProj.cs index d8ba7f1c6a..1ddf1453bf 100644 --- a/Projectiles/Rogue/SpearofPaleolithProj.cs +++ b/Projectiles/Rogue/SpearofPaleolithProj.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/SphereBladed.cs b/Projectiles/Rogue/SphereBladed.cs index ba66d6bdc2..41f5c87f10 100644 --- a/Projectiles/Rogue/SphereBladed.cs +++ b/Projectiles/Rogue/SphereBladed.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/SphereBlue.cs b/Projectiles/Rogue/SphereBlue.cs index a688974964..d2c7637ab4 100644 --- a/Projectiles/Rogue/SphereBlue.cs +++ b/Projectiles/Rogue/SphereBlue.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/SphereSpiked.cs b/Projectiles/Rogue/SphereSpiked.cs index 443ccef165..7d2c53512d 100644 --- a/Projectiles/Rogue/SphereSpiked.cs +++ b/Projectiles/Rogue/SphereSpiked.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/SphereYellow.cs b/Projectiles/Rogue/SphereYellow.cs index 77c6e434de..cfa9694d3b 100644 --- a/Projectiles/Rogue/SphereYellow.cs +++ b/Projectiles/Rogue/SphereYellow.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/StealthNimbus.cs b/Projectiles/Rogue/StealthNimbus.cs index 7a5cfc0e3e..dcc429b897 100644 --- a/Projectiles/Rogue/StealthNimbus.cs +++ b/Projectiles/Rogue/StealthNimbus.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; + Main.projFrames[Type] = 6; } public override void SetDefaults() @@ -26,10 +26,10 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (Projectile.ai[0] == 1f) texture = ModContent.Request("CalamityMod/Projectiles/Rogue/StealthNimbus2").Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + int height = texture.Height / Main.projFrames[Type]; int frameHeight = height * Projectile.frame; SpriteEffects spriteEffects = SpriteEffects.None; if (Projectile.spriteDirection == -1) diff --git a/Projectiles/Rogue/StealthNimbusCloud.cs b/Projectiles/Rogue/StealthNimbusCloud.cs index d1e3eab024..3f6c3d1f6e 100644 --- a/Projectiles/Rogue/StealthNimbusCloud.cs +++ b/Projectiles/Rogue/StealthNimbusCloud.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -26,10 +26,10 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (Projectile.ai[0] == 1f) texture = ModContent.Request("CalamityMod/Projectiles/Rogue/StealthNimbusCloud2").Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + int height = texture.Height / Main.projFrames[Type]; int frameHeight = height * Projectile.frame; Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture.Width / 2f, (float)height / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Rogue/StellarKnifeProj.cs b/Projectiles/Rogue/StellarKnifeProj.cs index 4be9d7c5da..6b1d717b9b 100644 --- a/Projectiles/Rogue/StellarKnifeProj.cs +++ b/Projectiles/Rogue/StellarKnifeProj.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -110,7 +110,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Rogue/StormfrontLightning.cs b/Projectiles/Rogue/StormfrontLightning.cs index 00b1816ea2..bab525c68b 100644 --- a/Projectiles/Rogue/StormfrontLightning.cs +++ b/Projectiles/Rogue/StormfrontLightning.cs @@ -39,8 +39,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 50; + ProjectileID.Sets.TrailingMode[Type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 50; } public override void SetDefaults() diff --git a/Projectiles/Rogue/StormfrontRazorProjectile.cs b/Projectiles/Rogue/StormfrontRazorProjectile.cs index 3a9dc47f28..625317777c 100644 --- a/Projectiles/Rogue/StormfrontRazorProjectile.cs +++ b/Projectiles/Rogue/StormfrontRazorProjectile.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -160,7 +160,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/SubductionFlameburst.cs b/Projectiles/Rogue/SubductionFlameburst.cs index bbcb328bf8..9ba236808d 100644 --- a/Projectiles/Rogue/SubductionFlameburst.cs +++ b/Projectiles/Rogue/SubductionFlameburst.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = new Rectangle(frameX * Projectile.width, frameY * Projectile.height, Projectile.width, Projectile.height); Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, Projectile.Size / 2, 1f, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Rogue/SubductionSlicerProj.cs b/Projectiles/Rogue/SubductionSlicerProj.cs index e1a0b88425..8136bb01ce 100644 --- a/Projectiles/Rogue/SubductionSlicerProj.cs +++ b/Projectiles/Rogue/SubductionSlicerProj.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/SupernovaBomb.cs b/Projectiles/Rogue/SupernovaBomb.cs index ae4babe2e3..fdfb0aea35 100644 --- a/Projectiles/Rogue/SupernovaBomb.cs +++ b/Projectiles/Rogue/SupernovaBomb.cs @@ -27,8 +27,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -308,7 +308,7 @@ namespace CalamityMod.Projectiles.Rogue } if (!homing) - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Lerp(Color.White, randomColor, 0.3f), 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Lerp(Color.White, randomColor, 0.3f), 1); return true; } } diff --git a/Projectiles/Rogue/SupernovaBoom.cs b/Projectiles/Rogue/SupernovaBoom.cs index a2616f9c96..0a285d4df6 100644 --- a/Projectiles/Rogue/SupernovaBoom.cs +++ b/Projectiles/Rogue/SupernovaBoom.cs @@ -214,7 +214,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; int length = texture.Width / horizontalFrames; int height = texture.Height / verticalFrames; Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); diff --git a/Projectiles/Rogue/TalonLargeProj.cs b/Projectiles/Rogue/TalonLargeProj.cs index f5ed435467..e5c7941a05 100644 --- a/Projectiles/Rogue/TalonLargeProj.cs +++ b/Projectiles/Rogue/TalonLargeProj.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/TalonSmallProj.cs b/Projectiles/Rogue/TalonSmallProj.cs index da51fad4f5..921bcc1e21 100644 --- a/Projectiles/Rogue/TalonSmallProj.cs +++ b/Projectiles/Rogue/TalonSmallProj.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/TarraThornRight.cs b/Projectiles/Rogue/TarraThornRight.cs index 7560dbac9e..32413a97ee 100644 --- a/Projectiles/Rogue/TarraThornRight.cs +++ b/Projectiles/Rogue/TarraThornRight.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Rogue // Draw the tip for the final thorn public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (Projectile.ai[0] == TotalSegments) texture = ModContent.Request("CalamityMod/Projectiles/Magic/NettleTip").Value; diff --git a/Projectiles/Rogue/TarragonThrowingDartProjectile.cs b/Projectiles/Rogue/TarragonThrowingDartProjectile.cs index 3989f2219e..7b4cbfeb6e 100644 --- a/Projectiles/Rogue/TarragonThrowingDartProjectile.cs +++ b/Projectiles/Rogue/TarragonThrowingDartProjectile.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/TheAtomSplitterDuplicate.cs b/Projectiles/Rogue/TheAtomSplitterDuplicate.cs index b7c764094e..a4af127001 100644 --- a/Projectiles/Rogue/TheAtomSplitterDuplicate.cs +++ b/Projectiles/Rogue/TheAtomSplitterDuplicate.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Rogue public ref float Lifetime => ref Projectile.ai[1]; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Rogue Color drawColor = CalamityUtils.MulticolorLerp((Time / 35f + Projectile.identity / 4f) % 1f, CalamityUtils.ExoPalette); drawColor.A = 0; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], drawColor); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], drawColor); return false; } } diff --git a/Projectiles/Rogue/TheSyringeCinder.cs b/Projectiles/Rogue/TheSyringeCinder.cs index 7a16399617..fcd99f75ce 100644 --- a/Projectiles/Rogue/TheSyringeCinder.cs +++ b/Projectiles/Rogue/TheSyringeCinder.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() diff --git a/Projectiles/Rogue/TheSyringeProj.cs b/Projectiles/Rogue/TheSyringeProj.cs index 583442bdf8..21301511b7 100644 --- a/Projectiles/Rogue/TheSyringeProj.cs +++ b/Projectiles/Rogue/TheSyringeProj.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Rogue/TheSyringeS1.cs b/Projectiles/Rogue/TheSyringeS1.cs index 8b05b75c90..66832fedd0 100644 --- a/Projectiles/Rogue/TheSyringeS1.cs +++ b/Projectiles/Rogue/TheSyringeS1.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; + Main.projFrames[Type] = 3; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Rogue/TimeBoltKnife.cs b/Projectiles/Rogue/TimeBoltKnife.cs index 26cf772940..b9a74852d3 100644 --- a/Projectiles/Rogue/TimeBoltKnife.cs +++ b/Projectiles/Rogue/TimeBoltKnife.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -225,7 +225,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/TitaniumClone.cs b/Projectiles/Rogue/TitaniumClone.cs index 4f4b696192..e43e62128d 100644 --- a/Projectiles/Rogue/TitaniumClone.cs +++ b/Projectiles/Rogue/TitaniumClone.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/TitaniumShurikenProjectile.cs b/Projectiles/Rogue/TitaniumShurikenProjectile.cs index 286c01ae26..d8f0da7267 100644 --- a/Projectiles/Rogue/TitaniumShurikenProjectile.cs +++ b/Projectiles/Rogue/TitaniumShurikenProjectile.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -133,10 +133,10 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (Projectile.Calamity().stealthStrike) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); } else { diff --git a/Projectiles/Rogue/ToothBallProjectile.cs b/Projectiles/Rogue/ToothBallProjectile.cs index 13742c844d..dda87de504 100644 --- a/Projectiles/Rogue/ToothBallProjectile.cs +++ b/Projectiles/Rogue/ToothBallProjectile.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/TotalMeltdown.cs b/Projectiles/Rogue/TotalMeltdown.cs index 1b824a2e4e..48e2eb7e92 100644 --- a/Projectiles/Rogue/TotalMeltdown.cs +++ b/Projectiles/Rogue/TotalMeltdown.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 13; + Main.projFrames[Type] = 13; } public override void SetDefaults() @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.friendly = true; Projectile.DamageType = RogueDamageClass.Instance; Projectile.penetrate = -1; - Projectile.timeLeft = Main.projFrames[Projectile.type] * 5; + Projectile.timeLeft = Main.projFrames[Type] * 5; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 30; } diff --git a/Projectiles/Rogue/TotalityFire.cs b/Projectiles/Rogue/TotalityFire.cs index 3202ed7114..9ecf91af5a 100644 --- a/Projectiles/Rogue/TotalityFire.cs +++ b/Projectiles/Rogue/TotalityFire.cs @@ -12,9 +12,9 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 3; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Rogue if (!initialized) { initialized = true; - Projectile.frame = Main.rand.Next(Main.projFrames[Projectile.type]); + Projectile.frame = Main.rand.Next(Main.projFrames[Type]); } Projectile.frameCounter++; if (Projectile.frameCounter > 6) @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -132,7 +132,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/ToxicantTwisterProj.cs b/Projectiles/Rogue/ToxicantTwisterProj.cs index 5e5720b627..db053ab2f9 100644 --- a/Projectiles/Rogue/ToxicantTwisterProj.cs +++ b/Projectiles/Rogue/ToxicantTwisterProj.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Projectiles.Rogue public float circleSpeed = 1; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() { @@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Rogue Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + rotationalDrawOffset, null, auraColor with { A = 0 } * Utils.GetLerpValue(255, 0, Projectile.alpha), Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None); } - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor * 0.3f, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor * 0.3f, 2); return true; } diff --git a/Projectiles/Rogue/TurbulanceProjectile.cs b/Projectiles/Rogue/TurbulanceProjectile.cs index 514385eaef..138663322f 100644 --- a/Projectiles/Rogue/TurbulanceProjectile.cs +++ b/Projectiles/Rogue/TurbulanceProjectile.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/TurbulanceWindSlash.cs b/Projectiles/Rogue/TurbulanceWindSlash.cs index 42853a34a6..b524a9179d 100644 --- a/Projectiles/Rogue/TurbulanceWindSlash.cs +++ b/Projectiles/Rogue/TurbulanceWindSlash.cs @@ -9,10 +9,10 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/TwistingThunderProj.cs b/Projectiles/Rogue/TwistingThunderProj.cs index 38e242db93..f0703df833 100644 --- a/Projectiles/Rogue/TwistingThunderProj.cs +++ b/Projectiles/Rogue/TwistingThunderProj.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - Main.projFrames[Projectile.type] = 8; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; + Main.projFrames[Type] = 8; } public override void SetDefaults() @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/UrchinStingerProj.cs b/Projectiles/Rogue/UrchinStingerProj.cs index 51847ff991..d43e496b7d 100644 --- a/Projectiles/Rogue/UrchinStingerProj.cs +++ b/Projectiles/Rogue/UrchinStingerProj.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/ValedictionBoomerang.cs b/Projectiles/Rogue/ValedictionBoomerang.cs index 30d2881c68..739bd2364b 100644 --- a/Projectiles/Rogue/ValedictionBoomerang.cs +++ b/Projectiles/Rogue/ValedictionBoomerang.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -115,7 +115,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/VeneratedKnife.cs b/Projectiles/Rogue/VeneratedKnife.cs index 8efa1a6d19..11d4cf013e 100644 --- a/Projectiles/Rogue/VeneratedKnife.cs +++ b/Projectiles/Rogue/VeneratedKnife.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -72,13 +72,13 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.ai[0] == 0f) { - Texture2D knife1 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 3, knife1); + Texture2D knife1 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 3, knife1); } else if (Projectile.ai[0] == 1f) { Texture2D knife2 = ModContent.Request("CalamityMod/Projectiles/Rogue/VeneratedKnife2").Value; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 3, knife2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 3, knife2); } return false; } diff --git a/Projectiles/Rogue/WaveSkipperProjectile.cs b/Projectiles/Rogue/WaveSkipperProjectile.cs index 3d1277da7d..82ab76963c 100644 --- a/Projectiles/Rogue/WaveSkipperProjectile.cs +++ b/Projectiles/Rogue/WaveSkipperProjectile.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, Projectile.Calamity().stealthStrike ? 4 : 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, Projectile.Calamity().stealthStrike ? 4 : 2); return false; } } diff --git a/Projectiles/Rogue/WhitewaterProj.cs b/Projectiles/Rogue/WhitewaterProj.cs index 4815b5e882..f80670dde2 100644 --- a/Projectiles/Rogue/WhitewaterProj.cs +++ b/Projectiles/Rogue/WhitewaterProj.cs @@ -218,7 +218,7 @@ namespace CalamityMod.Projectiles.Rogue } public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D rTexture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; Texture2D wTexture = ModContent.Request("CalamityMod/Particles/HalfStar").Value; Color drawColor2 = Color.LightBlue; diff --git a/Projectiles/Rogue/WrathwingCinder.cs b/Projectiles/Rogue/WrathwingCinder.cs index accba2f53e..ab70362863 100644 --- a/Projectiles/Rogue/WrathwingCinder.cs +++ b/Projectiles/Rogue/WrathwingCinder.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 5; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Rogue/WrathwingFireball.cs b/Projectiles/Rogue/WrathwingFireball.cs index 2d3428e84c..b5996c3d83 100644 --- a/Projectiles/Rogue/WrathwingFireball.cs +++ b/Projectiles/Rogue/WrathwingFireball.cs @@ -11,9 +11,9 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + Main.projFrames[Type] = 5; + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; // Keep the fireball rotated the correct way because the sheet faces down, not up @@ -53,8 +53,8 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int frameHeight = texture.Height / Main.projFrames[Type]; int frameY = frameHeight * Projectile.frame; Rectangle rectangle = new Rectangle(0, frameY, texture.Width, frameHeight); if (CalamityClientConfig.Instance.Afterimages) diff --git a/Projectiles/Rogue/WrathwingSpear.cs b/Projectiles/Rogue/WrathwingSpear.cs index 0be8e931aa..93d1a16cf8 100644 --- a/Projectiles/Rogue/WrathwingSpear.cs +++ b/Projectiles/Rogue/WrathwingSpear.cs @@ -14,10 +14,10 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -110,7 +110,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Rogue/WulfrumKnifeProj.cs b/Projectiles/Rogue/WulfrumKnifeProj.cs index a233eb1fa8..ed3d183604 100644 --- a/Projectiles/Rogue/WulfrumKnifeProj.cs +++ b/Projectiles/Rogue/WulfrumKnifeProj.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 0; } public static int Lifetime = 950; @@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; float opacitey = StealthEffectOpacity; if (Projectile.Calamity().stealthStrike) diff --git a/Projectiles/Summon/AmphibiansGuitarHoldout.cs b/Projectiles/Summon/AmphibiansGuitarHoldout.cs index 1bae99776a..f9920ae191 100644 --- a/Projectiles/Summon/AmphibiansGuitarHoldout.cs +++ b/Projectiles/Summon/AmphibiansGuitarHoldout.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Summon SpawnTimer++; if (SpawnTimer > 19f && Owner.ownedProjectileCounts[MinionType] < 8) { - Projectile.NewProjectileDirect( + Projectile.NewProjectile( Projectile.GetSource_FromThis(), Owner.MountedCenter, Vector2.Zero, diff --git a/Projectiles/Summon/AmphibiansGuitarMinion.cs b/Projectiles/Summon/AmphibiansGuitarMinion.cs index 3f2c37ed7e..e227486158 100644 --- a/Projectiles/Summon/AmphibiansGuitarMinion.cs +++ b/Projectiles/Summon/AmphibiansGuitarMinion.cs @@ -89,7 +89,7 @@ namespace CalamityMod.Projectiles.Summon for (int i = 0; i < (bigShot ? 3 : 1); i++) { float rot = i == 1 ? -0.25f : i == 2 ? 0.25f : 0; - Projectile.NewProjectileDirect( + Projectile.NewProjectile( Projectile.GetSource_FromThis(), Projectile.Center, CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, Target, 18f * (1 - Math.Abs(rot))).RotatedBy(rot), diff --git a/Projectiles/Summon/AmphibiansGuitarProjectile.cs b/Projectiles/Summon/AmphibiansGuitarProjectile.cs index 471a50ef54..5782e66785 100644 --- a/Projectiles/Summon/AmphibiansGuitarProjectile.cs +++ b/Projectiles/Summon/AmphibiansGuitarProjectile.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { ProjectileID.Sets.MinionShot[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -109,7 +109,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 generalDrawPos = Projectile.Center - Main.screenPosition; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], noteColor with { A = 0 } * 0.4f, 1, tex.Value, true, true); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], noteColor with { A = 0 } * 0.4f, 1, tex.Value, true, true); Main.EntitySpriteDraw(tex.Value, generalDrawPos, null, noteColor with { A = 0 }, Projectile.rotation, tex.Size() * 0.5f, new Vector2(0.9f * Utils.GetLerpValue(-5, 20, time, true), 1) * Projectile.scale, SpriteEffects.None); Main.EntitySpriteDraw(tex.Value, generalDrawPos, null, Color.Lerp(Color.White, noteColor, 0.15f) with { A = 0 }, Projectile.rotation, tex.Size() * 0.5f, new Vector2(0.9f * Utils.GetLerpValue(-5, 20, time, true), 1) * Projectile.scale * 0.88f, SpriteEffects.None); diff --git a/Projectiles/Summon/AndromedaDeathRay.cs b/Projectiles/Summon/AndromedaDeathRay.cs index c9e0b2819f..887b45d8a6 100644 --- a/Projectiles/Summon/AndromedaDeathRay.cs +++ b/Projectiles/Summon/AndromedaDeathRay.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/AndromedaRegislash.cs b/Projectiles/Summon/AndromedaRegislash.cs index cef379f099..e24bd84df7 100644 --- a/Projectiles/Summon/AndromedaRegislash.cs +++ b/Projectiles/Summon/AndromedaRegislash.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; + Main.projFrames[Type] = 6; } public override void SetDefaults() @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Summon { Projectile.frame++; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.Kill(); } @@ -66,9 +66,9 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 startPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + int frameHeight = texture.Height / Main.projFrames[Type]; int frameY = frameHeight * Projectile.frame; Rectangle rectangle = new Rectangle(0, frameY, texture.Width, frameHeight); Vector2 origin = rectangle.Size() / 2f; diff --git a/Projectiles/Summon/AndromedaUI/AndromedaUI_Background.cs b/Projectiles/Summon/AndromedaUI/AndromedaUI_Background.cs index 5546744709..a2094971eb 100644 --- a/Projectiles/Summon/AndromedaUI/AndromedaUI_Background.cs +++ b/Projectiles/Summon/AndromedaUI/AndromedaUI_Background.cs @@ -135,7 +135,7 @@ namespace CalamityMod.Projectiles.Summon.AndromedaUI Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, Main.Rasterizer, null, perspective); // Draw the background UI - Main.spriteBatch.Draw(Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value, + Main.spriteBatch.Draw(Terraria.GameContent.TextureAssets.Projectile[Type].Value, Projectile.Center - Main.screenPosition, null, Color.White * Projectile.Opacity, diff --git a/Projectiles/Summon/AngelBolt.cs b/Projectiles/Summon/AngelBolt.cs index 794ff48ad4..fddc5914d7 100644 --- a/Projectiles/Summon/AngelBolt.cs +++ b/Projectiles/Summon/AngelBolt.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Summon/AngelOrb.cs b/Projectiles/Summon/AngelOrb.cs index ea400a3f84..25e78969da 100644 --- a/Projectiles/Summon/AngelOrb.cs +++ b/Projectiles/Summon/AngelOrb.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/AngelRay.cs b/Projectiles/Summon/AngelRay.cs index 80281bdd10..2aee50bd33 100644 --- a/Projectiles/Summon/AngelRay.cs +++ b/Projectiles/Summon/AngelRay.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Summon/AngelicAllianceArchangel.cs b/Projectiles/Summon/AngelicAllianceArchangel.cs index 9f13089822..c3c46831be 100644 --- a/Projectiles/Summon/AngelicAllianceArchangel.cs +++ b/Projectiles/Summon/AngelicAllianceArchangel.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Projectiles.Summon private int lifeSpan = 900; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -147,8 +147,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int frameHeight = texture.Height / Main.projFrames[Type]; int frameY = frameHeight * Projectile.frame; Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameY, texture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture.Width / 2f, (float)frameHeight / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Summon/ApexShark.cs b/Projectiles/Summon/ApexShark.cs index 58ba156d6c..ecc9ecb312 100644 --- a/Projectiles/Summon/ApexShark.cs +++ b/Projectiles/Summon/ApexShark.cs @@ -17,9 +17,9 @@ namespace CalamityMod.Projectiles.Summon private int HitCooldown = 0; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 8; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 8; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/ApparatusExplosion.cs b/Projectiles/Summon/ApparatusExplosion.cs index 1e3caa54c8..bdac9e8860 100644 --- a/Projectiles/Summon/ApparatusExplosion.cs +++ b/Projectiles/Summon/ApparatusExplosion.cs @@ -8,8 +8,8 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; - Main.projFrames[Projectile.type] = 10; + ProjectileID.Sets.MinionShot[Type] = true; + Main.projFrames[Type] = 10; } public override void SetDefaults() @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.Kill(); } diff --git a/Projectiles/Summon/AquasScepterRaindrop.cs b/Projectiles/Summon/AquasScepterRaindrop.cs index 876910da3f..4df8cfb6ad 100644 --- a/Projectiles/Summon/AquasScepterRaindrop.cs +++ b/Projectiles/Summon/AquasScepterRaindrop.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { // Sets the amount of frames this minion has on its spritesheet - Main.projFrames[Projectile.type] = 1; + Main.projFrames[Type] = 1; } public sealed override void SetDefaults() //If you want to change the damage of this projectile, just change the base damage of AquasScepter, the item. Note that this will affect the damage of AquasScepterTeslaAura as well, because the damage of said projectile is set as a multiple of the base damage at the bottom of AquasScepterCloud.cs diff --git a/Projectiles/Summon/AquasScepterTeslaAura.cs b/Projectiles/Summon/AquasScepterTeslaAura.cs index d3d8c6d728..d55ee2ca0d 100644 --- a/Projectiles/Summon/AquasScepterTeslaAura.cs +++ b/Projectiles/Summon/AquasScepterTeslaAura.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { // Sets the amount of frames this minion has on its spritesheet - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; } public sealed override void SetDefaults() //If you want to change the damage of this projectile, look near the bottom of AquasScepterCloud.cs because this projectile's damage is set in Projectile.NewProjectile as a multiple of the AquasScepterCloud damage value diff --git a/Projectiles/Summon/AquaticStarMinion.cs b/Projectiles/Summon/AquaticStarMinion.cs index 74c039a521..f060849af8 100644 --- a/Projectiles/Summon/AquaticStarMinion.cs +++ b/Projectiles/Summon/AquaticStarMinion.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/AstrageldonLaser.cs b/Projectiles/Summon/AstrageldonLaser.cs index 2ed1ac7556..6b5f11be8b 100644 --- a/Projectiles/Summon/AstrageldonLaser.cs +++ b/Projectiles/Summon/AstrageldonLaser.cs @@ -11,10 +11,10 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + Main.projFrames[Type] = 3; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Summon/AstrageldonSummon.cs b/Projectiles/Summon/AstrageldonSummon.cs index 4d1f353634..795b62514b 100644 --- a/Projectiles/Summon/AstrageldonSummon.cs +++ b/Projectiles/Summon/AstrageldonSummon.cs @@ -20,9 +20,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 6; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -218,8 +218,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int height = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int height = texture.Height / Main.projFrames[Type]; int y6 = height * Projectile.frame; Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, height)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture.Width / 2f, (float)height / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Summon/AstralProbeRound.cs b/Projectiles/Summon/AstralProbeRound.cs index 6f44db1d80..bc9ba0db92 100644 --- a/Projectiles/Summon/AstralProbeRound.cs +++ b/Projectiles/Summon/AstralProbeRound.cs @@ -16,10 +16,10 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + Main.projFrames[Type] = 3; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.rotation = Projectile.velocity.ToRotation(); // The projectile looks at where it's going. Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 3 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 3 % Main.projFrames[Type]; // The projectile does it's animation. Lighting.AddLight(Projectile.Center, Vector3.One * 0.1f); // The projectile emtis light. @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; SpriteEffects direction = Projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; diff --git a/Projectiles/Summon/AstralProbeSummon.cs b/Projectiles/Summon/AstralProbeSummon.cs index c8e16422cd..64de6fe834 100644 --- a/Projectiles/Summon/AstralProbeSummon.cs +++ b/Projectiles/Summon/AstralProbeSummon.cs @@ -40,8 +40,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/AtlasMunitionsAutocannon.cs b/Projectiles/Summon/AtlasMunitionsAutocannon.cs index 5161f2b0b5..fd34912391 100644 --- a/Projectiles/Summon/AtlasMunitionsAutocannon.cs +++ b/Projectiles/Summon/AtlasMunitionsAutocannon.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; } public override void SetDefaults() @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Summon // Handle frames. bool frameChangeInterval = Projectile.frameCounter % 6 == 5; Projectile.frameCounter++; - if (frameChangeInterval && Projectile.frame < Main.projFrames[Projectile.type] - 1) + if (frameChangeInterval && Projectile.frame < Main.projFrames[Type] - 1) Projectile.frame++; // Handle turret frames. diff --git a/Projectiles/Summon/AtlasMunitionsDropPod.cs b/Projectiles/Summon/AtlasMunitionsDropPod.cs index 63355a6e0e..a2850a87e0 100644 --- a/Projectiles/Summon/AtlasMunitionsDropPod.cs +++ b/Projectiles/Summon/AtlasMunitionsDropPod.cs @@ -32,9 +32,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 14; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 14; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -94,8 +94,8 @@ namespace CalamityMod.Projectiles.Summon } } } - if (Projectile.frame >= Main.projFrames[Projectile.type]) - Projectile.frame = Main.projFrames[Projectile.type] - 1; + if (Projectile.frame >= Main.projFrames[Type]) + Projectile.frame = Main.projFrames[Type] - 1; } // Fall downward. @@ -148,7 +148,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D glowmask = ModContent.Request("CalamityMod/Projectiles/Summon/AtlasMunitionsDropPodGlow").Value; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 drawPosition = Projectile.Center - Main.screenPosition; diff --git a/Projectiles/Summon/AtlasMunitionsDropPodUpper.cs b/Projectiles/Summon/AtlasMunitionsDropPodUpper.cs index 8688a7dc16..823f66367d 100644 --- a/Projectiles/Summon/AtlasMunitionsDropPodUpper.cs +++ b/Projectiles/Summon/AtlasMunitionsDropPodUpper.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() diff --git a/Projectiles/Summon/AtlasMunitionsLaser.cs b/Projectiles/Summon/AtlasMunitionsLaser.cs index ac2e8bb612..2087709aef 100644 --- a/Projectiles/Summon/AtlasMunitionsLaser.cs +++ b/Projectiles/Summon/AtlasMunitionsLaser.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 4; - ProjectileID.Sets.SentryShot[Projectile.type] = true; + ProjectileID.Sets.SentryShot[Type] = true; } public override void SetDefaults() @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frameCounter++; if (Projectile.frameCounter >= 5) { - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; Projectile.frameCounter = 0; } diff --git a/Projectiles/Summon/AtlasMunitionsLaserOverdrive.cs b/Projectiles/Summon/AtlasMunitionsLaserOverdrive.cs index cd9a767bb5..b178aadb8e 100644 --- a/Projectiles/Summon/AtlasMunitionsLaserOverdrive.cs +++ b/Projectiles/Summon/AtlasMunitionsLaserOverdrive.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 4; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frameCounter++; if (Projectile.frameCounter >= 5) { - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; Projectile.frameCounter = 0; } @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 drawPosition = Projectile.Center - Main.screenPosition; Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(Color.White), Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, 0, 0); diff --git a/Projectiles/Summon/AureusBomber.cs b/Projectiles/Summon/AureusBomber.cs index 9bae18cf48..4dd7f1f898 100644 --- a/Projectiles/Summon/AureusBomber.cs +++ b/Projectiles/Summon/AureusBomber.cs @@ -16,12 +16,12 @@ namespace CalamityMod.Projectiles.Summon public Player Owner => Main.player[Projectile.owner]; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; + Main.projFrames[Type] = 3; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 1; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 1; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -257,7 +257,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { var dye = Owner?.cMinion ?? 0; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, armorShaderToUse: dye); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1, armorShaderToUse: dye); return false; } diff --git a/Projectiles/Summon/BabyBloodCrawler.cs b/Projectiles/Summon/BabyBloodCrawler.cs index 3bd8c32128..c3b33c47d2 100644 --- a/Projectiles/Summon/BabyBloodCrawler.cs +++ b/Projectiles/Summon/BabyBloodCrawler.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 11; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 11; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/BabyPlaguebringer.cs b/Projectiles/Summon/BabyPlaguebringer.cs index 862928f071..a16bb53690 100644 --- a/Projectiles/Summon/BabyPlaguebringer.cs +++ b/Projectiles/Summon/BabyPlaguebringer.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + Main.projFrames[Type] = 6; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -227,8 +227,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = texture.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Vector2 origin = new Vector2(texture.Width / 2f, framing / 2f); Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Rectangle(0, y6, texture.Width, framing), Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, spriteEffects, 0); diff --git a/Projectiles/Summon/BelladonnaPetal.cs b/Projectiles/Summon/BelladonnaPetal.cs index 245f4f820c..4c2cc34c04 100644 --- a/Projectiles/Summon/BelladonnaPetal.cs +++ b/Projectiles/Summon/BelladonnaPetal.cs @@ -10,6 +10,7 @@ namespace CalamityMod.Projectiles.Summon public class BelladonnaPetal : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "Terraria/Images/Projectile_276"; public Player Owner => Main.player[Projectile.owner]; // The timer for the AI to do it's actions. @@ -23,10 +24,11 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; + Main.projFrames[Type] = 2; } public override void SetDefaults() @@ -55,6 +57,14 @@ namespace CalamityMod.Projectiles.Summon // Gives it a jungl-y green color. Lighting.AddLight(Projectile.Center, 0.5f, 1f, 0.3f); + // Animation + Projectile.frameCounter++; + if (Projectile.frameCounter >= 8) + { + Projectile.frameCounter = 0; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; + } + Projectile.netUpdate = true; } @@ -150,7 +160,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { if (CheckForFiring == 1f) - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return true; } diff --git a/Projectiles/Summon/BelladonnaPetal.png b/Projectiles/Summon/BelladonnaPetal.png deleted file mode 100644 index 43bc9ac92d..0000000000 Binary files a/Projectiles/Summon/BelladonnaPetal.png and /dev/null differ diff --git a/Projectiles/Summon/BelladonnaSpirit.cs b/Projectiles/Summon/BelladonnaSpirit.cs index 81183ea2ce..755728b461 100644 --- a/Projectiles/Summon/BelladonnaSpirit.cs +++ b/Projectiles/Summon/BelladonnaSpirit.cs @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 position = Projectile.Center - Main.screenPosition; Rectangle sourceRectangle = texture.Frame(verticalFrames: AnimationFrames, frameY: Projectile.frame); Vector2 origin = sourceRectangle.Size() * 0.5f; diff --git a/Projectiles/Summon/BetterHornetStinger.cs b/Projectiles/Summon/BetterHornetStinger.cs index a390bb3802..f926621823 100644 --- a/Projectiles/Summon/BetterHornetStinger.cs +++ b/Projectiles/Summon/BetterHornetStinger.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Rectangle frame = texture.Frame(); Vector2 origin = frame.Size() * 0.5f; diff --git a/Projectiles/Summon/BlackDragonHead.cs b/Projectiles/Summon/BlackDragonHead.cs index db0b8331bc..3bca4cd7c6 100644 --- a/Projectiles/Summon/BlackDragonHead.cs +++ b/Projectiles/Summon/BlackDragonHead.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Projectiles.Summon Dictionary segments = new Dictionary(); public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -39,8 +40,8 @@ namespace CalamityMod.Projectiles.Summon Projectile.minionSlots = 2; Projectile.minion = true; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 100; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 100; } public override void AI() @@ -185,7 +186,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D texBody = ModContent.Request("CalamityMod/Projectiles/Summon/BlackDragonBody").Value; Texture2D texBody2 = ModContent.Request("CalamityMod/Projectiles/Summon/BlackDragonBody2").Value; Texture2D texTail = ModContent.Request("CalamityMod/Projectiles/Summon/BlackDragonTail").Value; diff --git a/Projectiles/Summon/BlackHawkBullet.cs b/Projectiles/Summon/BlackHawkBullet.cs index e327863c9d..7d43617505 100644 --- a/Projectiles/Summon/BlackHawkBullet.cs +++ b/Projectiles/Summon/BlackHawkBullet.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/BlackHawkSummon.cs b/Projectiles/Summon/BlackHawkSummon.cs index 44502c4b9f..a3b25021a1 100644 --- a/Projectiles/Summon/BlackHawkSummon.cs +++ b/Projectiles/Summon/BlackHawkSummon.cs @@ -304,7 +304,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; diff --git a/Projectiles/Summon/BloodBreath.cs b/Projectiles/Summon/BloodBreath.cs index 36ade4f63d..b486c23676 100644 --- a/Projectiles/Summon/BloodBreath.cs +++ b/Projectiles/Summon/BloodBreath.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Summon } public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/BloodRain.cs b/Projectiles/Summon/BloodRain.cs index c54f31062a..9d79d29582 100644 --- a/Projectiles/Summon/BloodRain.cs +++ b/Projectiles/Summon/BloodRain.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/BloodSpit.cs b/Projectiles/Summon/BloodSpit.cs index ba286dd60e..5071b436ef 100644 --- a/Projectiles/Summon/BloodSpit.cs +++ b/Projectiles/Summon/BloodSpit.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + Main.projFrames[Type] = 3; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; if (Projectile.frameCounter++ > 4) { - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; Projectile.frameCounter = 0; } } diff --git a/Projectiles/Summon/BoneMatter.cs b/Projectiles/Summon/BoneMatter.cs index a1034d2ec6..5b86428a3d 100644 --- a/Projectiles/Summon/BoneMatter.cs +++ b/Projectiles/Summon/BoneMatter.cs @@ -8,8 +8,8 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + Main.projFrames[Type] = 6; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.frameCounter++ % 9 == 8) { Projectile.frame++; - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.Kill(); } } diff --git a/Projectiles/Summon/BoneMatter2.cs b/Projectiles/Summon/BoneMatter2.cs index 8ad45c4663..f13ef7e259 100644 --- a/Projectiles/Summon/BoneMatter2.cs +++ b/Projectiles/Summon/BoneMatter2.cs @@ -8,8 +8,8 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + Main.projFrames[Type] = 6; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.frameCounter % 9 == 8) { Projectile.frame++; - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.Kill(); } } diff --git a/Projectiles/Summon/BrimseekerAuraBall.cs b/Projectiles/Summon/BrimseekerAuraBall.cs index 243c888d82..5579bd266e 100644 --- a/Projectiles/Summon/BrimseekerAuraBall.cs +++ b/Projectiles/Summon/BrimseekerAuraBall.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/BrimstoneDartMinion.cs b/Projectiles/Summon/BrimstoneDartMinion.cs index 60f7c8aee1..d0161a2496 100644 --- a/Projectiles/Summon/BrimstoneDartMinion.cs +++ b/Projectiles/Summon/BrimstoneDartMinion.cs @@ -14,10 +14,10 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionShot[Projectile.type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionShot[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Type]; Projectile.Opacity = Utils.GetLerpValue(300f, 285f, Projectile.timeLeft, true) * Utils.GetLerpValue(0f, 15f, Projectile.timeLeft, true); Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { lightColor.R = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Summon/BrimstoneDartSummon.cs b/Projectiles/Summon/BrimstoneDartSummon.cs index 61cc1c5666..a422cd416c 100644 --- a/Projectiles/Summon/BrimstoneDartSummon.cs +++ b/Projectiles/Summon/BrimstoneDartSummon.cs @@ -12,10 +12,10 @@ namespace CalamityMod.Projectiles.Summon public override string Texture => "CalamityMod/Projectiles/Boss/BrimstoneBarrage"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionShot[Projectile.type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionShot[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frameCounter++; if (Projectile.frameCounter % 5 == 4) - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; Projectile.Opacity = Utils.GetLerpValue(0f, 40f, Projectile.timeLeft, true); @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { lightColor.R = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Summon/BrimstoneElementalMinion.cs b/Projectiles/Summon/BrimstoneElementalMinion.cs index 7abda0562d..9def69225a 100644 --- a/Projectiles/Summon/BrimstoneElementalMinion.cs +++ b/Projectiles/Summon/BrimstoneElementalMinion.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/BrimstoneExplosionMinion.cs b/Projectiles/Summon/BrimstoneExplosionMinion.cs index c9c5c3e6cc..2e2db8edf5 100644 --- a/Projectiles/Summon/BrimstoneExplosionMinion.cs +++ b/Projectiles/Summon/BrimstoneExplosionMinion.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/BrimstoneFireSummon.cs b/Projectiles/Summon/BrimstoneFireSummon.cs index 166873d105..d3399e3df5 100644 --- a/Projectiles/Summon/BrimstoneFireSummon.cs +++ b/Projectiles/Summon/BrimstoneFireSummon.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/BrimstoneFireballMinion.cs b/Projectiles/Summon/BrimstoneFireballMinion.cs index b547525944..3f6fa09d13 100644 --- a/Projectiles/Summon/BrimstoneFireballMinion.cs +++ b/Projectiles/Summon/BrimstoneFireballMinion.cs @@ -14,10 +14,10 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.MinionShot[Type] = true; + Main.projFrames[Type] = 6; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Summon/BrimstoneLaserSummon.cs b/Projectiles/Summon/BrimstoneLaserSummon.cs index 5c7607822d..4e5fda6383 100644 --- a/Projectiles/Summon/BrimstoneLaserSummon.cs +++ b/Projectiles/Summon/BrimstoneLaserSummon.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/BrittleStarMinion.cs b/Projectiles/Summon/BrittleStarMinion.cs index 9ec49d7203..025b0cc571 100644 --- a/Projectiles/Summon/BrittleStarMinion.cs +++ b/Projectiles/Summon/BrittleStarMinion.cs @@ -32,8 +32,8 @@ namespace CalamityMod.Projectiles.Summon public float ProjKnock; public override void SetDefaults() { - Projectile.width = 30; - Projectile.height = 28; + Projectile.width = 42; + Projectile.height = 42; Projectile.localNPCHitCooldown = 15; base.SetDefaults(); } @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Summon float rot = MathHelper.ToRadians(i * rotFactor); Vector2 offset = new Vector2(Main.rand.NextFloat(1.5f, 4f), 0).RotatedBy(rot * Main.rand.NextFloat(3.1f, 9.1f)); Vector2 velOffset = new Vector2(Main.rand.NextFloat(1.5f, 4f), 0).RotatedBy(rot * Main.rand.NextFloat(3.1f, 9.1f)); - Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, Main.rand.NextBool(3) ? 216 : 207, new Vector2(velOffset.X, velOffset.Y)); + Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, Main.rand.NextBool(3) ? 216 : 121, new Vector2(velOffset.X, velOffset.Y)); dust.noGravity = true; dust.velocity = velOffset; dust.scale = Main.rand.NextFloat(1.3f, 1.9f); @@ -180,7 +180,7 @@ namespace CalamityMod.Projectiles.Summon { for (int i = 0; i <= 5; i++) { - Dust dust = Dust.NewDustPerfect(Projectile.Center - Projectile.velocity, Main.rand.NextBool(3) ? 216 : 207, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.05f, 0.4f), 0, default, Main.rand.NextFloat(1.3f, 1.8f)); + Dust dust = Dust.NewDustPerfect(Projectile.Center - Projectile.velocity, Main.rand.NextBool(3) ? 216 : 121, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.05f, 0.4f), 0, default, Main.rand.NextFloat(1.3f, 1.8f)); dust.noGravity = true; } SoundEngine.PlaySound(SoundID.DD2_SkeletonHurt with { Pitch = 0.5f }, Projectile.Center); @@ -198,7 +198,7 @@ namespace CalamityMod.Projectiles.Summon float rot = MathHelper.ToRadians(i * rotFactor); Vector2 offset = new Vector2(Main.rand.NextFloat(0.5f, 2.5f), 0).RotatedBy(rot * Main.rand.NextFloat(1.1f, 9.1f)); Vector2 velOffset = new Vector2(Main.rand.NextFloat(0.5f, 2.5f), 0).RotatedBy(rot * Main.rand.NextFloat(1.1f, 9.1f)); - Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, Main.rand.NextBool(3) ? 216 : 207, new Vector2(velOffset.X, velOffset.Y)); + Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, Main.rand.NextBool(3) ? 216 : 121, new Vector2(velOffset.X, velOffset.Y)); dust.noGravity = true; dust.velocity = velOffset; dust.scale = Main.rand.NextFloat(1.3f, 1.8f); @@ -206,6 +206,6 @@ namespace CalamityMod.Projectiles.Summon HitCounter = 0; } } - public override bool? CanDamage() => Reforming ? false : null; + public override bool MinionContactDamage() => !Reforming; } } diff --git a/Projectiles/Summon/BrittleStarMinion.png b/Projectiles/Summon/BrittleStarMinion.png index 739f28d509..4497bd57e6 100644 Binary files a/Projectiles/Summon/BrittleStarMinion.png and b/Projectiles/Summon/BrittleStarMinion.png differ diff --git a/Projectiles/Summon/CalamarisLamentMinion.cs b/Projectiles/Summon/CalamarisLamentMinion.cs index a52f6bf1ef..867337a78c 100644 --- a/Projectiles/Summon/CalamarisLamentMinion.cs +++ b/Projectiles/Summon/CalamarisLamentMinion.cs @@ -209,14 +209,14 @@ namespace CalamityMod.Projectiles.Summon } // The minion will only have contact damage if it's on latching mode. - public override bool? CanDamage() => (State == AIState.Latching) ? null : false; + public override bool MinionContactDamage() => State == AIState.Latching; // The minion will do 1.5x damage if it's latched on. public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.SourceDamage *= CalamarisLament.LatchingDamageMultiplier; public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; diff --git a/Projectiles/Summon/CalamarisLamentProjectile.cs b/Projectiles/Summon/CalamarisLamentProjectile.cs index e15d03f94b..fc710a4973 100644 --- a/Projectiles/Summon/CalamarisLamentProjectile.cs +++ b/Projectiles/Summon/CalamarisLamentProjectile.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; diff --git a/Projectiles/Summon/Calamitamini.cs b/Projectiles/Summon/Calamitamini.cs index 7c2f5709c4..a7c0bfb1ec 100644 --- a/Projectiles/Summon/Calamitamini.cs +++ b/Projectiles/Summon/Calamitamini.cs @@ -19,9 +19,10 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 3; + Main.projPet[Type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -238,8 +239,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int frameHeight = texture.Height / Main.projFrames[Type]; int yStart = frameHeight * Projectile.frame; Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, yStart, texture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Summon/Cataclymini.cs b/Projectiles/Summon/Cataclymini.cs index 6b31ab97db..dabd888069 100644 --- a/Projectiles/Summon/Cataclymini.cs +++ b/Projectiles/Summon/Cataclymini.cs @@ -13,9 +13,10 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 3; + Main.projPet[Type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -232,8 +233,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int frameHeight = texture.Height / Main.projFrames[Type]; int yStart = frameHeight * Projectile.frame; Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, yStart, texture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Summon/CataclysmSummon.cs b/Projectiles/Summon/CataclysmSummon.cs index 2a6fcb532d..8c2597e858 100644 --- a/Projectiles/Summon/CataclysmSummon.cs +++ b/Projectiles/Summon/CataclysmSummon.cs @@ -17,11 +17,11 @@ namespace CalamityMod.Projectiles.Summon public override string Texture => "CalamityMod/NPCs/SupremeCalamitas/SupremeCataclysm"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = false; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = false; + Main.projFrames[Type] = 6; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.MinionSacrificable[Type] = false; + ProjectileID.Sets.MinionTargettingFeature[Type] = false; } public override void SetDefaults() @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = texture.Frame(3, 9, Projectile.frame / 9, Projectile.frame % 9); Vector2 origin = frame.Size() * 0.5f; for (int i = 0; i < Projectile.oldPos.Length; i++) diff --git a/Projectiles/Summon/Catastromini.cs b/Projectiles/Summon/Catastromini.cs index 7f7d256486..1766bdf8be 100644 --- a/Projectiles/Summon/Catastromini.cs +++ b/Projectiles/Summon/Catastromini.cs @@ -13,9 +13,10 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 3; + Main.projPet[Type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -84,8 +85,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int frameHeight = texture.Height / Main.projFrames[Type]; int yStart = frameHeight * Projectile.frame; Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, yStart, texture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Summon/CatastropheSummon.cs b/Projectiles/Summon/CatastropheSummon.cs index 48198377b8..d44f9b9b8b 100644 --- a/Projectiles/Summon/CatastropheSummon.cs +++ b/Projectiles/Summon/CatastropheSummon.cs @@ -16,11 +16,11 @@ namespace CalamityMod.Projectiles.Summon public override string Texture => "CalamityMod/NPCs/SupremeCalamitas/SupremeCatastrophe"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = false; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = false; + Main.projFrames[Type] = 6; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.MinionSacrificable[Type] = false; + ProjectileID.Sets.MinionTargettingFeature[Type] = false; } public override void SetDefaults() @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = texture.Frame(2, 8, Projectile.frame / 8, Projectile.frame % 8); Vector2 origin = frame.Size() * 0.5f; for (int i = 0; i < Projectile.oldPos.Length; i++) diff --git a/Projectiles/Summon/CausticStaffProjectile.cs b/Projectiles/Summon/CausticStaffProjectile.cs index 1a93a130b9..79ad9f70d0 100644 --- a/Projectiles/Summon/CausticStaffProjectile.cs +++ b/Projectiles/Summon/CausticStaffProjectile.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/CausticStaffSummon.cs b/Projectiles/Summon/CausticStaffSummon.cs index 41f4126702..ca75b21aa9 100644 --- a/Projectiles/Summon/CausticStaffSummon.cs +++ b/Projectiles/Summon/CausticStaffSummon.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -220,7 +220,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Summon/CelestialAxeMinion.cs b/Projectiles/Summon/CelestialAxeMinion.cs index 0701bef64a..888c97d688 100644 --- a/Projectiles/Summon/CelestialAxeMinion.cs +++ b/Projectiles/Summon/CelestialAxeMinion.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/Cinder.cs b/Projectiles/Summon/Cinder.cs index 4ed48a74b7..3645d9f464 100644 --- a/Projectiles/Summon/Cinder.cs +++ b/Projectiles/Summon/Cinder.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/CinderBlossom.cs b/Projectiles/Summon/CinderBlossom.cs index c28866c326..d594e5ff50 100644 --- a/Projectiles/Summon/CinderBlossom.cs +++ b/Projectiles/Summon/CinderBlossom.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Summon CheckMinionExistince(); // Checks if the minion can still exist. ShootTarget(Target); // Shoots at the target if there's one. - Projectile.Center = Owner.Center - Vector2.UnitY * 60f; + Projectile.Center = Owner.Center - Vector2.UnitY * (60f - Owner.gfxOffY); Projectile.rotation += MathHelper.ToRadians(5f * Owner.direction); // The projectile normally will spin in the direction of the player. Lighting.AddLight(Projectile.Center, Color.Orange.ToVector3()); } diff --git a/Projectiles/Summon/CloudElementalMinion.cs b/Projectiles/Summon/CloudElementalMinion.cs index bb4b1eacb7..2a8fa900b4 100644 --- a/Projectiles/Summon/CloudElementalMinion.cs +++ b/Projectiles/Summon/CloudElementalMinion.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 8; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 8; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/CnidarianJellyfishOnTheString.cs b/Projectiles/Summon/CnidarianJellyfishOnTheString.cs index b8911f6de1..eaea017c3c 100644 --- a/Projectiles/Summon/CnidarianJellyfishOnTheString.cs +++ b/Projectiles/Summon/CnidarianJellyfishOnTheString.cs @@ -176,7 +176,7 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.owner == Main.myPlayer) { - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), CnidarianPos, velocity, ProjectileType(), (int)(Projectile.damage * ZapDamageMultiplier), Projectile.knockBack, Projectile.owner, targetArray[i], 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), CnidarianPos, velocity, ProjectileType(), (int)(Projectile.damage * ZapDamageMultiplier), Projectile.knockBack, Projectile.owner, targetArray[i], 0f); } } } @@ -241,7 +241,7 @@ namespace CalamityMod.Projectiles.Summon PrimitiveRenderer.RenderTrail(segmentPositions, new(PrimWidthFunction, PrimColorFunction), 66); - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 squish = new Vector2(2 - StretchRatio(), StretchRatio()); diff --git a/Projectiles/Summon/CorroslimeMinion.cs b/Projectiles/Summon/CorroslimeMinion.cs index fde825cff4..06d676e565 100644 --- a/Projectiles/Summon/CorroslimeMinion.cs +++ b/Projectiles/Summon/CorroslimeMinion.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 6; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -82,8 +82,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Summon/CorruptionSlimeGodMinion.cs b/Projectiles/Summon/CorruptionSlimeGodMinion.cs index 7127930079..3f0975c5ca 100644 --- a/Projectiles/Summon/CorruptionSlimeGodMinion.cs +++ b/Projectiles/Summon/CorruptionSlimeGodMinion.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 2; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 2; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/CosmicBlast.cs b/Projectiles/Summon/CosmicBlast.cs index 157243ab88..1ae50a8b9d 100644 --- a/Projectiles/Summon/CosmicBlast.cs +++ b/Projectiles/Summon/CosmicBlast.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } @@ -66,8 +66,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Summon/CosmicBlastBig.cs b/Projectiles/Summon/CosmicBlastBig.cs index 32a37bec78..0706b0aca0 100644 --- a/Projectiles/Summon/CosmicBlastBig.cs +++ b/Projectiles/Summon/CosmicBlastBig.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Summon/CosmicEnergySpiral.cs b/Projectiles/Summon/CosmicEnergySpiral.cs index a57cf8ad25..bc06a90b67 100644 --- a/Projectiles/Summon/CosmicEnergySpiral.cs +++ b/Projectiles/Summon/CosmicEnergySpiral.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projPet[Projectile.type] = true; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projPet[Type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/CosmicViperConcussionMissile.cs b/Projectiles/Summon/CosmicViperConcussionMissile.cs index 2766a26437..933047d037 100644 --- a/Projectiles/Summon/CosmicViperConcussionMissile.cs +++ b/Projectiles/Summon/CosmicViperConcussionMissile.cs @@ -11,10 +11,10 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - Main.projFrames[Projectile.type] = 3; + ProjectileID.Sets.MinionShot[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; + Main.projFrames[Type] = 3; } public override void SetDefaults() @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Summon/CosmicViperHomingRocket.cs b/Projectiles/Summon/CosmicViperHomingRocket.cs index 1518acef74..945bfb566d 100644 --- a/Projectiles/Summon/CosmicViperHomingRocket.cs +++ b/Projectiles/Summon/CosmicViperHomingRocket.cs @@ -11,11 +11,11 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - Main.projFrames[Projectile.type] = 3; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; + Main.projFrames[Type] = 3; } public override void SetDefaults() @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -115,7 +115,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Summon/CosmicViperSplitRocket1.cs b/Projectiles/Summon/CosmicViperSplitRocket1.cs index 08b5b6355a..6b28bce238 100644 --- a/Projectiles/Summon/CosmicViperSplitRocket1.cs +++ b/Projectiles/Summon/CosmicViperSplitRocket1.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/CosmicViperSplittingRocket.cs b/Projectiles/Summon/CosmicViperSplittingRocket.cs index 1d69cf8c9f..47f09be8d6 100644 --- a/Projectiles/Summon/CosmicViperSplittingRocket.cs +++ b/Projectiles/Summon/CosmicViperSplittingRocket.cs @@ -11,11 +11,11 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - Main.projFrames[Projectile.type] = 3; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; + Main.projFrames[Type] = 3; } public override void SetDefaults() @@ -164,7 +164,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -195,7 +195,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Summon/CosmicViperSummon.cs b/Projectiles/Summon/CosmicViperSummon.cs index 8f62806777..747eb5e5c6 100644 --- a/Projectiles/Summon/CosmicViperSummon.cs +++ b/Projectiles/Summon/CosmicViperSummon.cs @@ -18,9 +18,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - Main.projFrames[Projectile.type] = 3; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; + Main.projFrames[Type] = 3; } public override void SetDefaults() @@ -311,8 +311,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int frameHeight = texture.Height / Main.projFrames[Type]; int y6 = frameHeight * Projectile.frame; SpriteEffects spriteEffects = SpriteEffects.None; if (Projectile.spriteDirection == -1) @@ -326,7 +326,7 @@ namespace CalamityMod.Projectiles.Summon public override void PostDraw(Color lightColor) { Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Summon/CosmicViperGlow").Value; - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + int frameHeight = texture.Height / Main.projFrames[Type]; int y6 = frameHeight * Projectile.frame; SpriteEffects spriteEffects = SpriteEffects.None; if (Projectile.spriteDirection == -1) diff --git a/Projectiles/Summon/CosmilampBeam.cs b/Projectiles/Summon/CosmilampBeam.cs index c6e9475390..59c85fe961 100644 --- a/Projectiles/Summon/CosmilampBeam.cs +++ b/Projectiles/Summon/CosmilampBeam.cs @@ -24,10 +24,10 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 32; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 32; } public override void SetDefaults() diff --git a/Projectiles/Summon/CosmilampMinion.cs b/Projectiles/Summon/CosmilampMinion.cs index 598b85622b..a3f6adb628 100644 --- a/Projectiles/Summon/CosmilampMinion.cs +++ b/Projectiles/Summon/CosmilampMinion.cs @@ -38,11 +38,12 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; + Main.projPet[Type] = true; ProjectileID.Sets.TrailingMode[Type] = 2; ProjectileID.Sets.TrailCacheLength[Type] = 8; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -107,12 +108,12 @@ namespace CalamityMod.Projectiles.Summon public void DecideFrames() { Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 8 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 8 % Main.projFrames[Type]; } public void HoverInPlace() { - Vector2 hoverDestination = Owner.Top + new Vector2(MathHelper.Lerp(-100f, 100f, HoverOffsetInterpolant), -80f); + Vector2 hoverDestination = Owner.Top + Vector2.UnitY * Owner.gfxOffY + new Vector2(MathHelper.Lerp(-100f, 100f, HoverOffsetInterpolant), -80f); hoverDestination.Y += ((float)Math.Sin(MathHelper.TwoPi * HoverOffsetInterpolant + Timer / 50f) * 0.5f + 0.5f) * 40f; // Zoom towards the hover destination. @@ -121,7 +122,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition; diff --git a/Projectiles/Summon/CrimslimeMinion.cs b/Projectiles/Summon/CrimslimeMinion.cs index f4239eba8b..2ce626218e 100644 --- a/Projectiles/Summon/CrimslimeMinion.cs +++ b/Projectiles/Summon/CrimslimeMinion.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 6; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -82,8 +82,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = texture2D13.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = texture2D13.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Summon/CrimsonSlimeGodMinion.cs b/Projectiles/Summon/CrimsonSlimeGodMinion.cs index de7c9f436c..fa6f533cff 100644 --- a/Projectiles/Summon/CrimsonSlimeGodMinion.cs +++ b/Projectiles/Summon/CrimsonSlimeGodMinion.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 2; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 2; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/DaedalusCrystal.cs b/Projectiles/Summon/DaedalusCrystal.cs index 590cf7215a..67dd230937 100644 --- a/Projectiles/Summon/DaedalusCrystal.cs +++ b/Projectiles/Summon/DaedalusCrystal.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/DaedalusCrystalShot.cs b/Projectiles/Summon/DaedalusCrystalShot.cs index 10f72febfa..8cfb190581 100644 --- a/Projectiles/Summon/DaedalusCrystalShot.cs +++ b/Projectiles/Summon/DaedalusCrystalShot.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/DaedalusGolem.cs b/Projectiles/Summon/DaedalusGolem.cs index 2febf13996..0ac3d2a6ab 100644 --- a/Projectiles/Summon/DaedalusGolem.cs +++ b/Projectiles/Summon/DaedalusGolem.cs @@ -25,9 +25,9 @@ namespace CalamityMod.Projectiles.Summon public ref float StuckJumpSpeed => ref Projectile.ai[1]; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 18; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 18; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Summon #region AI public override void AI() { - Main.projFrames[Projectile.type] = 16; + Main.projFrames[Type] = 16; bool isCorrectProjectile = Projectile.type == ModContent.ProjectileType(); Owner.AddBuff(ModContent.BuffType(), 3600); if (isCorrectProjectile) diff --git a/Projectiles/Summon/DaedalusLightning.cs b/Projectiles/Summon/DaedalusLightning.cs index 4d6959f07d..23d7b00dda 100644 --- a/Projectiles/Summon/DaedalusLightning.cs +++ b/Projectiles/Summon/DaedalusLightning.cs @@ -24,9 +24,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 100; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.MinionShot[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 100; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() diff --git a/Projectiles/Summon/DaedalusPellet.cs b/Projectiles/Summon/DaedalusPellet.cs index 6ff153d027..4589199980 100644 --- a/Projectiles/Summon/DaedalusPellet.cs +++ b/Projectiles/Summon/DaedalusPellet.cs @@ -10,10 +10,10 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + Main.projFrames[Type] = 3; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); return false; } } diff --git a/Projectiles/Summon/DankCreeperMinion.cs b/Projectiles/Summon/DankCreeperMinion.cs index d18311e5fc..98dadc21e2 100644 --- a/Projectiles/Summon/DankCreeperMinion.cs +++ b/Projectiles/Summon/DankCreeperMinion.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -221,7 +221,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/DazzlingStabber.cs b/Projectiles/Summon/DazzlingStabber.cs index 887ba13c2f..45757eb7ee 100644 --- a/Projectiles/Summon/DazzlingStabber.cs +++ b/Projectiles/Summon/DazzlingStabber.cs @@ -16,11 +16,11 @@ namespace CalamityMod.Projectiles.Summon public ref float RestOffsetAngle => ref Projectile.ai[1]; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 25; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 25; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Summon { Projectile.frameCounter++; if (Projectile.frameCounter % 6 == 0) - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; } public void SliceTarget(NPC target) diff --git a/Projectiles/Summon/DeathstareBeam.cs b/Projectiles/Summon/DeathstareBeam.cs index 0346ee2ea4..4c8b737425 100644 --- a/Projectiles/Summon/DeathstareBeam.cs +++ b/Projectiles/Summon/DeathstareBeam.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Summon public ref float OwnerUUID => ref Projectile.ai[0]; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Summon } public override bool PreDraw(ref Color lightColor) { - Texture2D beamTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D beamTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; Vector2 drawScale = new Vector2(0.55f, Projectile.velocity.Length() / beamTexture.Height * 20f); Color color = Color.White * 2.1f * Projectile.Opacity; diff --git a/Projectiles/Summon/DeathstareEyeball.cs b/Projectiles/Summon/DeathstareEyeball.cs index fa43a54fce..6ef2b94958 100644 --- a/Projectiles/Summon/DeathstareEyeball.cs +++ b/Projectiles/Summon/DeathstareEyeball.cs @@ -157,7 +157,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D eyeTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D eyeTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = eyeTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); SpriteEffects spriteEffects = Owner.gravDir == 1 ? SpriteEffects.None : SpriteEffects.FlipVertically; Main.EntitySpriteDraw(eyeTexture, Projectile.Center - Main.screenPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, SpriteEffects.None); diff --git a/Projectiles/Summon/DormantBrimseekerAura.cs b/Projectiles/Summon/DormantBrimseekerAura.cs index e92f6098c6..8f9fea1c46 100644 --- a/Projectiles/Summon/DormantBrimseekerAura.cs +++ b/Projectiles/Summon/DormantBrimseekerAura.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/DormantBrimseekerBab.cs b/Projectiles/Summon/DormantBrimseekerBab.cs index cfa29fec4b..f26f66f14a 100644 --- a/Projectiles/Summon/DormantBrimseekerBab.cs +++ b/Projectiles/Summon/DormantBrimseekerBab.cs @@ -27,12 +27,12 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 8; + Main.projFrames[Type] = 8; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 7; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 7; + ProjectileID.Sets.TrailingMode[Type] = 2; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; } public override void SetDefaults() @@ -157,7 +157,7 @@ namespace CalamityMod.Projectiles.Summon { if ((Projectile.ai[0] > 0f && Projectile.ai[0] <= MaxChargeTime && Projectile.velocity.Length() >= 8f) || SeekingTarget) { - Texture2D projectileTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D projectileTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D flameTexture = TextureAssets.Extra[ExtrasID.MeteorHeadFlame].Value; SpriteEffects spriteEffects = SpriteEffects.None; if (Projectile.spriteDirection == -1) @@ -167,7 +167,7 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.ai[0] > 30f) completionRatio = 1f - (30f - Projectile.ai[0]) / 30f; - Vector2 modifiedProjectileTexture = new Vector2(projectileTexture.Width / 2, projectileTexture.Height / Main.projFrames[Projectile.type] / 2); + Vector2 modifiedProjectileTexture = new Vector2(projectileTexture.Width / 2, projectileTexture.Height / Main.projFrames[Type] / 2); for (int oldPositionDrawIndex = 6; oldPositionDrawIndex >= 0; oldPositionDrawIndex--) { Color drawColor = Color.Lerp(Color.LightGoldenrodYellow, new Color(142, 24, 67), completionRatio); @@ -186,7 +186,7 @@ namespace CalamityMod.Projectiles.Summon Rectangle flameFrameRectangle = flameTexture.Frame(1, 4, 0, yFrame); Vector2 flameOrigin = new Vector2(flameTexture.Width / 2, flameTexture.Height / 8 + 14); Main.EntitySpriteDraw(flameTexture, - new Vector2(Projectile.oldPos[oldPositionDrawIndex].X - Main.screenPosition.X + Projectile.width / 2 - projectileTexture.Width * Projectile.scale / 2f + modifiedProjectileTexture.X * Projectile.scale, Projectile.oldPos[oldPositionDrawIndex].Y - Main.screenPosition.Y + Projectile.height - projectileTexture.Height * Projectile.scale / Main.projFrames[Projectile.type] + 4f + modifiedProjectileTexture.Y * Projectile.scale + Projectile.gfxOffY), + new Vector2(Projectile.oldPos[oldPositionDrawIndex].X - Main.screenPosition.X + Projectile.width / 2 - projectileTexture.Width * Projectile.scale / 2f + modifiedProjectileTexture.X * Projectile.scale, Projectile.oldPos[oldPositionDrawIndex].Y - Main.screenPosition.Y + Projectile.height - projectileTexture.Height * Projectile.scale / Main.projFrames[Type] + 4f + modifiedProjectileTexture.Y * Projectile.scale + Projectile.gfxOffY), new Rectangle?(flameFrameRectangle), drawColor, Projectile.oldRot[oldPositionDrawIndex] + Projectile.oldSpriteDirection[oldPositionDrawIndex] * MathHelper.PiOver2, diff --git a/Projectiles/Summon/DormantBrimseekerSummoner.cs b/Projectiles/Summon/DormantBrimseekerSummoner.cs index e9371d0064..3f8591ac99 100644 --- a/Projectiles/Summon/DormantBrimseekerSummoner.cs +++ b/Projectiles/Summon/DormantBrimseekerSummoner.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/Dreadmine.cs b/Projectiles/Summon/Dreadmine.cs index 31ba1a3c59..6a71d0f425 100644 --- a/Projectiles/Summon/Dreadmine.cs +++ b/Projectiles/Summon/Dreadmine.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.SentryShot[Projectile.type] = true; + ProjectileID.Sets.SentryShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Summon/DreadmineTurret.cs b/Projectiles/Summon/DreadmineTurret.cs index ee71f068e6..eb8f33d7f9 100644 --- a/Projectiles/Summon/DreadmineTurret.cs +++ b/Projectiles/Summon/DreadmineTurret.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Summon/EXPLODINGFROG.cs b/Projectiles/Summon/EXPLODINGFROG.cs index a52bc47d1c..a54e7caea0 100644 --- a/Projectiles/Summon/EXPLODINGFROG.cs +++ b/Projectiles/Summon/EXPLODINGFROG.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Projectiles.Summon public const float ExplosionAngleVariance = 0.8f; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 5; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Summon/EndoBeam.cs b/Projectiles/Summon/EndoBeam.cs index c2e96a448f..54675d40ef 100644 --- a/Projectiles/Summon/EndoBeam.cs +++ b/Projectiles/Summon/EndoBeam.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/EndoCooperBody.cs b/Projectiles/Summon/EndoCooperBody.cs index a2bbd06838..bab1116e24 100644 --- a/Projectiles/Summon/EndoCooperBody.cs +++ b/Projectiles/Summon/EndoCooperBody.cs @@ -19,10 +19,11 @@ namespace CalamityMod.Projectiles.Summon private int laserdirection = 1; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projPet[Type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -339,7 +340,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { var dye = Main.player[Projectile.owner]?.cMinion ?? 0; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, armorShaderToUse: dye); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1, armorShaderToUse: dye); return false; } diff --git a/Projectiles/Summon/EndoCooperLimbs.cs b/Projectiles/Summon/EndoCooperLimbs.cs index cb9330fbc4..80b5efc46f 100644 --- a/Projectiles/Summon/EndoCooperLimbs.cs +++ b/Projectiles/Summon/EndoCooperLimbs.cs @@ -18,10 +18,10 @@ namespace CalamityMod.Projectiles.Summon private int AttackMode = 0; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -131,7 +131,7 @@ namespace CalamityMod.Projectiles.Summon return false; var dye = Main.player[Projectile.owner]?.cMinion ?? 0; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, armorShaderToUse: dye); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1, armorShaderToUse: dye); return false; } diff --git a/Projectiles/Summon/EndoFire.cs b/Projectiles/Summon/EndoFire.cs index 5f3687bdb6..697fa142f3 100644 --- a/Projectiles/Summon/EndoFire.cs +++ b/Projectiles/Summon/EndoFire.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/EndoHydraBody.cs b/Projectiles/Summon/EndoHydraBody.cs index 6d74607809..59dfdbf2f9 100644 --- a/Projectiles/Summon/EndoHydraBody.cs +++ b/Projectiles/Summon/EndoHydraBody.cs @@ -19,9 +19,9 @@ namespace CalamityMod.Projectiles.Summon public const float DistanceToCheck = 2800f; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - ProjectileID.Sets.NeedsUUID[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 5; + ProjectileID.Sets.NeedsUUID[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.frameCounter++ > (potentialTarget is null ? 8 : 6)) { - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; Projectile.frameCounter = 0; } diff --git a/Projectiles/Summon/EndoHydraHead.cs b/Projectiles/Summon/EndoHydraHead.cs index 6fdcbd8e02..70066ab2dc 100644 --- a/Projectiles/Summon/EndoHydraHead.cs +++ b/Projectiles/Summon/EndoHydraHead.cs @@ -25,11 +25,11 @@ namespace CalamityMod.Projectiles.Summon } public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -114,13 +114,13 @@ namespace CalamityMod.Projectiles.Summon } if (Time % 40f >= 33f) - Projectile.frame = Main.projFrames[Projectile.type] - 1; + Projectile.frame = Main.projFrames[Type] - 1; else if (Time % 40f >= 27f) - Projectile.frame = Main.projFrames[Projectile.type] - 2; + Projectile.frame = Main.projFrames[Type] - 2; else if (Time % 40f >= 22f) - Projectile.frame = Main.projFrames[Projectile.type] - 3; + Projectile.frame = Main.projFrames[Type] - 3; else if (Time % 40f >= 17f) - Projectile.frame = Main.projFrames[Projectile.type] - 4; + Projectile.frame = Main.projFrames[Type] - 4; Projectile.direction = Projectile.spriteDirection = (player.Center.X - Projectile.Center.X > 0).ToDirectionInt(); if (Math.Abs(player.Center.X - Projectile.Center.X) < 80f) @@ -229,10 +229,10 @@ namespace CalamityMod.Projectiles.Summon // PreDraw is used instead of PostDraw because of draw order. Drawing the chains after the head // would cause them to be drawn on top of the head, which we do not want. - Texture2D headTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D headTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(headTexture, Projectile.Center - Main.screenPosition + Vector2.UnitY * Projectile.gfxOffY, - headTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame), + headTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame), lightColor, Projectile.rotation, Projectile.Size * 0.5f, diff --git a/Projectiles/Summon/EndoHydraRay.cs b/Projectiles/Summon/EndoHydraRay.cs index 17a8fd6e1b..afc80011de 100644 --- a/Projectiles/Summon/EndoHydraRay.cs +++ b/Projectiles/Summon/EndoHydraRay.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/EndoIceShard.cs b/Projectiles/Summon/EndoIceShard.cs index 7613630e96..eb4dab939e 100644 --- a/Projectiles/Summon/EndoIceShard.cs +++ b/Projectiles/Summon/EndoIceShard.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Summon/EyeOfNightCell.cs b/Projectiles/Summon/EyeOfNightCell.cs index fb4319e683..ffa1a756c0 100644 --- a/Projectiles/Summon/EyeOfNightCell.cs +++ b/Projectiles/Summon/EyeOfNightCell.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/EyeOfNightSummon.cs b/Projectiles/Summon/EyeOfNightSummon.cs index 25b0e139ac..ffeccfa56a 100644 --- a/Projectiles/Summon/EyeOfNightSummon.cs +++ b/Projectiles/Summon/EyeOfNightSummon.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Summon public const int ShootRate = 60; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/FieryDraconid.cs b/Projectiles/Summon/FieryDraconid.cs index dcd0a2b075..f93412f81f 100644 --- a/Projectiles/Summon/FieryDraconid.cs +++ b/Projectiles/Summon/FieryDraconid.cs @@ -21,9 +21,10 @@ namespace CalamityMod.Projectiles.Summon public const int FireballShootRate = 20; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 10; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 10; + Main.projPet[Type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -76,7 +77,7 @@ namespace CalamityMod.Projectiles.Summon { Projectile.frame = 6; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 6; } @@ -239,8 +240,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Rectangle(0, y6, texture2D13.Width, framing), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture2D13.Width / 2f, framing / 2f), Projectile.scale, spriteEffects, 0); return false; diff --git a/Projectiles/Summon/FlameBlast.cs b/Projectiles/Summon/FlameBlast.cs index 58ec9363b6..b4b5709f1e 100644 --- a/Projectiles/Summon/FlameBlast.cs +++ b/Projectiles/Summon/FlameBlast.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.SentryShot[Projectile.type] = true; + ProjectileID.Sets.SentryShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Summon/FlameBurst.cs b/Projectiles/Summon/FlameBurst.cs index 647f466890..275894d092 100644 --- a/Projectiles/Summon/FlameBurst.cs +++ b/Projectiles/Summon/FlameBurst.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.SentryShot[Projectile.type] = true; + ProjectileID.Sets.SentryShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Summon/FlarebatMinion.cs b/Projectiles/Summon/FlarebatMinion.cs index 1d99f0e445..66e1a5b87b 100644 --- a/Projectiles/Summon/FlarebatMinion.cs +++ b/Projectiles/Summon/FlarebatMinion.cs @@ -173,6 +173,8 @@ namespace CalamityMod.Projectiles.Summon } } + public override bool MinionContactDamage() => true; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { if (AttackState.HasFlag(AttackBehaviorFlags.HasDashed) && !AttackState.HasFlag(AttackBehaviorFlags.HasHitTargetOnDash) && Target == target) diff --git a/Projectiles/Summon/FleshBlood.cs b/Projectiles/Summon/FleshBlood.cs index cab404b853..7729f2a5fd 100644 --- a/Projectiles/Summon/FleshBlood.cs +++ b/Projectiles/Summon/FleshBlood.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Summon/FlowersOfMortalityPetal.cs b/Projectiles/Summon/FlowersOfMortalityPetal.cs index 5f4b0f4b04..3ddd3ef53a 100644 --- a/Projectiles/Summon/FlowersOfMortalityPetal.cs +++ b/Projectiles/Summon/FlowersOfMortalityPetal.cs @@ -18,10 +18,11 @@ namespace CalamityMod.Projectiles.Summon public float Hue => OffsetAngle % MathHelper.TwoPi / MathHelper.TwoPi % 1f; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projPet[Type] = true; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -61,7 +62,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 shootVelocity = Projectile.SafeDirectionTo(potentialTarget.Center) * 10f; Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, shootVelocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); } - Projectile.Center = player.Center + OffsetAngle.ToRotationVector2() * (150f + (float)Math.Sin(Time * 0.08f) * 15f); + Projectile.Center = player.Center + OffsetAngle.ToRotationVector2() * (150f + (float)Math.Sin(Time * 0.08f) * 15f) + Vector2.UnitY * Owner.gfxOffY; Projectile.rotation += MathHelper.ToRadians(7f); OffsetAngle += MathHelper.ToRadians(6f); } @@ -83,7 +84,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D petalTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D petalTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D coreTexture = ModContent.Request("CalamityMod/Projectiles/Summon/FlowersOfMortalityCore").Value; Color drawColor = Main.hslToRgb(Hue, 0.95f, 0.5f) * 2.3f; diff --git a/Projectiles/Summon/FlyingOrthocera.cs b/Projectiles/Summon/FlyingOrthocera.cs index 457566b0c8..11ce13b68c 100644 --- a/Projectiles/Summon/FlyingOrthocera.cs +++ b/Projectiles/Summon/FlyingOrthocera.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Summon { Projectile.frame++; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Summon/FlyingOrthoceraStream.cs b/Projectiles/Summon/FlyingOrthoceraStream.cs index 7304b46fb2..b7a9f750ac 100644 --- a/Projectiles/Summon/FlyingOrthoceraStream.cs +++ b/Projectiles/Summon/FlyingOrthoceraStream.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/ForbiddenCircletEater.cs b/Projectiles/Summon/ForbiddenCircletEater.cs index 25079382cc..90472d54b1 100644 --- a/Projectiles/Summon/ForbiddenCircletEater.cs +++ b/Projectiles/Summon/ForbiddenCircletEater.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Summon/FrogGore1.cs b/Projectiles/Summon/FrogGore1.cs index ebb7d39b47..7c325f64d6 100644 --- a/Projectiles/Summon/FrogGore1.cs +++ b/Projectiles/Summon/FrogGore1.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.SentryShot[Projectile.type] = true; + ProjectileID.Sets.SentryShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/FrogGore2.cs b/Projectiles/Summon/FrogGore2.cs index 4fa8ad1efd..7edcfe8e55 100644 --- a/Projectiles/Summon/FrogGore2.cs +++ b/Projectiles/Summon/FrogGore2.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.SentryShot[Projectile.type] = true; + ProjectileID.Sets.SentryShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/FrogGore3.cs b/Projectiles/Summon/FrogGore3.cs index a2ff4f7b71..aeeccd5a2a 100644 --- a/Projectiles/Summon/FrogGore3.cs +++ b/Projectiles/Summon/FrogGore3.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.SentryShot[Projectile.type] = true; + ProjectileID.Sets.SentryShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/FrogGore4.cs b/Projectiles/Summon/FrogGore4.cs index 826b8a7745..9e6b404a0c 100644 --- a/Projectiles/Summon/FrogGore4.cs +++ b/Projectiles/Summon/FrogGore4.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.SentryShot[Projectile.type] = true; + ProjectileID.Sets.SentryShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/FrogGore5.cs b/Projectiles/Summon/FrogGore5.cs index 6dfaba3b8b..59b42510c4 100644 --- a/Projectiles/Summon/FrogGore5.cs +++ b/Projectiles/Summon/FrogGore5.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.SentryShot[Projectile.type] = true; + ProjectileID.Sets.SentryShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/FrostBeam.cs b/Projectiles/Summon/FrostBeam.cs index 4e60263f00..387742cada 100644 --- a/Projectiles/Summon/FrostBeam.cs +++ b/Projectiles/Summon/FrostBeam.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Summon/FrostBlossom.cs b/Projectiles/Summon/FrostBlossom.cs index 3c203d287c..c430427aad 100644 --- a/Projectiles/Summon/FrostBlossom.cs +++ b/Projectiles/Summon/FrostBlossom.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/FrostMistFriendly.cs b/Projectiles/Summon/FrostMistFriendly.cs index 35076dce8d..b315063341 100644 --- a/Projectiles/Summon/FrostMistFriendly.cs +++ b/Projectiles/Summon/FrostMistFriendly.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 8; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + Main.projFrames[Type] = 8; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -98,8 +98,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = texture2D13.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = texture2D13.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Summon/FrostbatMinion.cs b/Projectiles/Summon/FrostbatMinion.cs index 6e919183e9..a6de4258f3 100644 --- a/Projectiles/Summon/FrostbatMinion.cs +++ b/Projectiles/Summon/FrostbatMinion.cs @@ -173,6 +173,8 @@ namespace CalamityMod.Projectiles.Summon } } + public override bool MinionContactDamage() => true; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { if (AttackState.HasFlag(AttackBehaviorFlags.HasDashed) && !AttackState.HasFlag(AttackBehaviorFlags.HasHitTargetOnDash) && Target == target) diff --git a/Projectiles/Summon/GammaCanister.cs b/Projectiles/Summon/GammaCanister.cs index fdd740fc5e..e42c75fcde 100644 --- a/Projectiles/Summon/GammaCanister.cs +++ b/Projectiles/Summon/GammaCanister.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Summon public const float Gravity = 0.2f; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Summon/GammaHead.cs b/Projectiles/Summon/GammaHead.cs index 62059832a9..8ef0bd290e 100644 --- a/Projectiles/Summon/GammaHead.cs +++ b/Projectiles/Summon/GammaHead.cs @@ -31,9 +31,9 @@ namespace CalamityMod.Projectiles.Summon } public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -136,8 +136,8 @@ namespace CalamityMod.Projectiles.Summon // Open the mouth prior to firing. if (Time % canisterShootRate > canisterShootRate - 20) - Projectile.frame = (int)(Main.projFrames[Projectile.type] * Utils.GetLerpValue(canisterShootRate - 20, canisterShootRate - 4, Time % canisterShootRate, true)); - Projectile.frame %= Main.projFrames[Projectile.type]; + Projectile.frame = (int)(Main.projFrames[Type] * Utils.GetLerpValue(canisterShootRate - 20, canisterShootRate - 4, Time % canisterShootRate, true)); + Projectile.frame %= Main.projFrames[Type]; Vector2 spawnPosition = Projectile.Center; float shootSpeed = MathHelper.Lerp(8f, 29f, Utils.GetLerpValue(90f, 850f, target.Distance(spawnPosition), true)); @@ -251,10 +251,10 @@ namespace CalamityMod.Projectiles.Summon 0); } - Texture2D headTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D headTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(headTexture, Projectile.Center - Main.screenPosition + Vector2.UnitY * Projectile.gfxOffY, - headTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame), + headTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame), lightColor, Projectile.rotation, Projectile.Size * 0.5f, diff --git a/Projectiles/Summon/GastricBelcher.cs b/Projectiles/Summon/GastricBelcher.cs index 3be0bd40f2..12856293d4 100644 --- a/Projectiles/Summon/GastricBelcher.cs +++ b/Projectiles/Summon/GastricBelcher.cs @@ -17,9 +17,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Summon { Projectile.frame++; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -303,8 +303,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int frameHeight = texture.Height / Main.projFrames[Type]; int y6 = frameHeight * Projectile.frame; SpriteEffects spriteEffects = SpriteEffects.None; if (Projectile.spriteDirection == -1) diff --git a/Projectiles/Summon/GastricBelcherBubble.cs b/Projectiles/Summon/GastricBelcherBubble.cs index d071f10363..8a1aee8724 100644 --- a/Projectiles/Summon/GastricBelcherBubble.cs +++ b/Projectiles/Summon/GastricBelcherBubble.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/GastricBelcherVomit.cs b/Projectiles/Summon/GastricBelcherVomit.cs index 91a23b1890..f5c7e0265a 100644 --- a/Projectiles/Summon/GastricBelcherVomit.cs +++ b/Projectiles/Summon/GastricBelcherVomit.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Summon texture = ModContent.Request("CalamityMod/Projectiles/Summon/GastricBelcherVomit3").Value; break; default: - texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; break; } Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, texture.Height / 2f), Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Summon/GhostFire.cs b/Projectiles/Summon/GhostFire.cs index fa88888a45..d4f5d8136a 100644 --- a/Projectiles/Summon/GhostFire.cs +++ b/Projectiles/Summon/GhostFire.cs @@ -17,10 +17,10 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 20; } public override void SetDefaults() diff --git a/Projectiles/Summon/GiantIbanRobotOfDoom.cs b/Projectiles/Summon/GiantIbanRobotOfDoom.cs index c79c442c8f..16d8746566 100644 --- a/Projectiles/Summon/GiantIbanRobotOfDoom.cs +++ b/Projectiles/Summon/GiantIbanRobotOfDoom.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.NeedsUUID[Projectile.type] = true; + ProjectileID.Sets.NeedsUUID[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/GlacialEmbracePointyThing.cs b/Projectiles/Summon/GlacialEmbracePointyThing.cs index 92fd4aaa07..cdba300dd8 100644 --- a/Projectiles/Summon/GlacialEmbracePointyThing.cs +++ b/Projectiles/Summon/GlacialEmbracePointyThing.cs @@ -53,8 +53,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 7; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 7; } public override void SetDefaults() @@ -133,7 +133,7 @@ namespace CalamityMod.Projectiles.Summon } if (circlingPlayer) { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; if (Projectile.penetrate == 1) { Projectile.penetrate++; @@ -198,7 +198,7 @@ namespace CalamityMod.Projectiles.Summon { float math = recharging == 0 ? 90f : (300 - recharging) / 3; float regularDistance = math > 90f ? 90f : math; - Projectile.Center = player.Center + Projectile.ai[0].ToRotationVector2() * regularDistance; + Projectile.Center = player.Center + Projectile.ai[0].ToRotationVector2() * regularDistance + Vector2.UnitY * player.gfxOffY; Projectile.rotation = Projectile.ai[0] + (float)Math.Atan(90); Projectile.ai[0] -= MathHelper.ToRadians(4f); NPC target = recharging > 0 ? null : CalamityUtils.MinionHoming(Projectile.Center, 800f, player); @@ -308,7 +308,7 @@ namespace CalamityMod.Projectiles.Summon { if (!circling || (!circlingPlayer && recharging == 0)) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, !circlingPlayer ? 1 : 3); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, !circlingPlayer ? 1 : 3); } return true; } diff --git a/Projectiles/Summon/HallowedStarSummon.cs b/Projectiles/Summon/HallowedStarSummon.cs index c87acbafe7..e009601059 100644 --- a/Projectiles/Summon/HallowedStarSummon.cs +++ b/Projectiles/Summon/HallowedStarSummon.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.MinionShot[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { Projectile.DrawStarTrail(Color.Purple, Color.White); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Summon/HarvestStaffSentry.cs b/Projectiles/Summon/HarvestStaffSentry.cs index f4eeecaec9..c8e839e665 100644 --- a/Projectiles/Summon/HarvestStaffSentry.cs +++ b/Projectiles/Summon/HarvestStaffSentry.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 spawnPosition = Projectile.Center + new Vector2(Main.rand.NextFloat(-randomOffset, randomOffset), -80f); MakeSpawnValid(ref spawnPosition); - Projectile.NewProjectileDirect( + Projectile.NewProjectile( Projectile.GetSource_FromThis(), spawnPosition, Vector2.Zero, @@ -141,7 +141,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition + Vector2.UnitY * Projectile.gfxOffY; Rectangle frame = texture.Frame(verticalFrames: Main.projFrames[Type], frameY: Projectile.frame); Color drawColor = Projectile.GetAlpha(lightColor); diff --git a/Projectiles/Summon/HauntedDishes.cs b/Projectiles/Summon/HauntedDishes.cs index 3e06fb2e60..6fc3619098 100644 --- a/Projectiles/Summon/HauntedDishes.cs +++ b/Projectiles/Summon/HauntedDishes.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - Main.projFrames[Projectile.type] = 19; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; + Main.projFrames[Type] = 19; } public override void SetDefaults() diff --git a/Projectiles/Summon/HermitCrabMinion.cs b/Projectiles/Summon/HermitCrabMinion.cs index 924e296129..c40b5a5741 100644 --- a/Projectiles/Summon/HermitCrabMinion.cs +++ b/Projectiles/Summon/HermitCrabMinion.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 9; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 9; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/HerringAI.cs b/Projectiles/Summon/HerringAI.cs index 9e2f1e0400..1c5e8e6087 100644 --- a/Projectiles/Summon/HerringAI.cs +++ b/Projectiles/Summon/HerringAI.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/HerringMinion.cs b/Projectiles/Summon/HerringMinion.cs index 838e71f4ec..050a280eea 100644 --- a/Projectiles/Summon/HerringMinion.cs +++ b/Projectiles/Summon/HerringMinion.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 8; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + Main.projFrames[Type] = 8; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Summon public void DoAnimation() { Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 8 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 8 % Main.projFrames[Type]; } public void PointInRightDirection(Projectile origin, NPC target) diff --git a/Projectiles/Summon/Hive.cs b/Projectiles/Summon/Hive.cs index 1c04ec50a5..7f93da745a 100644 --- a/Projectiles/Summon/Hive.cs +++ b/Projectiles/Summon/Hive.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 6; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/Hiveling.cs b/Projectiles/Summon/Hiveling.cs index 975c3bb882..5066e2c133 100644 --- a/Projectiles/Summon/Hiveling.cs +++ b/Projectiles/Summon/Hiveling.cs @@ -12,11 +12,11 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.SentryShot[Projectile.type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.SentryShot[Type] = true; } public override void SetDefaults() @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { var dye = Main.player[Projectile.owner]?.cMinion ?? 0; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, armorShaderToUse: dye); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1, armorShaderToUse: dye); return false; } } diff --git a/Projectiles/Summon/HomingGammaBullet.cs b/Projectiles/Summon/HomingGammaBullet.cs index a01a4a13b7..55cbf798a7 100644 --- a/Projectiles/Summon/HomingGammaBullet.cs +++ b/Projectiles/Summon/HomingGammaBullet.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Summon/HowlsHeartCalcifer.cs b/Projectiles/Summon/HowlsHeartCalcifer.cs index b09f42ac20..b82c23fd29 100644 --- a/Projectiles/Summon/HowlsHeartCalcifer.cs +++ b/Projectiles/Summon/HowlsHeartCalcifer.cs @@ -9,9 +9,9 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - Main.projPet[Projectile.type] = true; - ProjectileID.Sets.LightPet[Projectile.type] = true; + Main.projFrames[Type] = 4; + Main.projPet[Type] = true; + ProjectileID.Sets.LightPet[Type] = true; } public override void SetDefaults() @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Summon/HowlsHeartFireball.cs b/Projectiles/Summon/HowlsHeartFireball.cs index 947c20dbe2..a0a3af3ecf 100644 --- a/Projectiles/Summon/HowlsHeartFireball.cs +++ b/Projectiles/Summon/HowlsHeartFireball.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Summon/HowlsHeartHowl.cs b/Projectiles/Summon/HowlsHeartHowl.cs index c2d346f8e8..8bfe2b7d4e 100644 --- a/Projectiles/Summon/HowlsHeartHowl.cs +++ b/Projectiles/Summon/HowlsHeartHowl.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 5; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -217,7 +217,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Summon/HowlsHeartTurnipHead.cs b/Projectiles/Summon/HowlsHeartTurnipHead.cs index 73dc75e9a5..5716b53c44 100644 --- a/Projectiles/Summon/HowlsHeartTurnipHead.cs +++ b/Projectiles/Summon/HowlsHeartTurnipHead.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - Main.projPet[Projectile.type] = true; + Main.projFrames[Type] = 5; + Main.projPet[Type] = true; } public override void SetDefaults() @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Summon/HydrothermicVent.cs b/Projectiles/Summon/HydrothermicVent.cs index fb4e86f626..a90d0b2d32 100644 --- a/Projectiles/Summon/HydrothermicVent.cs +++ b/Projectiles/Summon/HydrothermicVent.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 6; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Summon/IceClasperMinion.cs b/Projectiles/Summon/IceClasperMinion.cs index 89aded9c6b..bfd70d4e4e 100644 --- a/Projectiles/Summon/IceClasperMinion.cs +++ b/Projectiles/Summon/IceClasperMinion.cs @@ -132,7 +132,7 @@ namespace CalamityMod.Projectiles.Summon { Vector2 velocity = CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, Target, 25f); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), @@ -185,11 +185,11 @@ namespace CalamityMod.Projectiles.Summon } } - public override bool? CanDamage() => (State == AIState.Ram) ? null : false; + public override bool MinionContactDamage() => State == AIState.Ram; public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; diff --git a/Projectiles/Summon/IceClasperSummonProjectile.cs b/Projectiles/Summon/IceClasperSummonProjectile.cs index c7c6c17af1..f82d96de31 100644 --- a/Projectiles/Summon/IceClasperSummonProjectile.cs +++ b/Projectiles/Summon/IceClasperSummonProjectile.cs @@ -8,6 +8,7 @@ namespace CalamityMod.Projectiles.Summon public class IceClasperSummonProjectile : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "CalamityMod/Projectiles/Melee/DarkIceZero"; public override void SetStaticDefaults() { diff --git a/Projectiles/Summon/IceClasperSummonProjectile.png b/Projectiles/Summon/IceClasperSummonProjectile.png deleted file mode 100644 index 98bedb5a00..0000000000 Binary files a/Projectiles/Summon/IceClasperSummonProjectile.png and /dev/null differ diff --git a/Projectiles/Summon/IceSentry.cs b/Projectiles/Summon/IceSentry.cs index e6532ff2ba..204cf095bf 100644 --- a/Projectiles/Summon/IceSentry.cs +++ b/Projectiles/Summon/IceSentry.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 18; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 18; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/IceSentryFrostBolt.cs b/Projectiles/Summon/IceSentryFrostBolt.cs index 6dee2bd3a4..c63cf1ebdf 100644 --- a/Projectiles/Summon/IceSentryFrostBolt.cs +++ b/Projectiles/Summon/IceSentryFrostBolt.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.SentryShot[Projectile.type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.SentryShot[Type] = true; } public override void SetDefaults() @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Summon/IceSentryShard.cs b/Projectiles/Summon/IceSentryShard.cs index 05734d51ff..8b2be7394b 100644 --- a/Projectiles/Summon/IceSentryShard.cs +++ b/Projectiles/Summon/IceSentryShard.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.SentryShot[Projectile.type] = true; + ProjectileID.Sets.SentryShot[Type] = true; } public override void AI() diff --git a/Projectiles/Summon/IgneousBlade.cs b/Projectiles/Summon/IgneousBlade.cs index d0623e72a9..4bff9cf79d 100644 --- a/Projectiles/Summon/IgneousBlade.cs +++ b/Projectiles/Summon/IgneousBlade.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Summon public bool Firing = false; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 7; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 7; } public override void SetDefaults() @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Summon if (!Firing) { const float outwardPosition = 180f; - Projectile.Center = player.Center + Projectile.ai[0].ToRotationVector2() * outwardPosition; + Projectile.Center = player.Center + Projectile.ai[0].ToRotationVector2() * outwardPosition + Vector2.UnitY * player.gfxOffY; Projectile.rotation = Projectile.ai[0] + MathHelper.PiOver2 + MathHelper.PiOver4; Projectile.ai[0] -= MathHelper.ToRadians(4f); } diff --git a/Projectiles/Summon/IgneousBladeStrike.cs b/Projectiles/Summon/IgneousBladeStrike.cs index aa3ec7daa4..6762bec590 100644 --- a/Projectiles/Summon/IgneousBladeStrike.cs +++ b/Projectiles/Summon/IgneousBladeStrike.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/LanternFlame.cs b/Projectiles/Summon/LanternFlame.cs index ec3e3b3e10..0707bd5bbf 100644 --- a/Projectiles/Summon/LanternFlame.cs +++ b/Projectiles/Summon/LanternFlame.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.SentryShot[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.SentryShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Summon/LanternSoul.cs b/Projectiles/Summon/LanternSoul.cs index 98817c5858..82211048fc 100644 --- a/Projectiles/Summon/LanternSoul.cs +++ b/Projectiles/Summon/LanternSoul.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/LiliesOfFinalityAriane.cs b/Projectiles/Summon/LiliesOfFinalityAriane.cs index a6e2b0c3bf..75f3a96885 100644 --- a/Projectiles/Summon/LiliesOfFinalityAriane.cs +++ b/Projectiles/Summon/LiliesOfFinalityAriane.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Summon // When the minion goes into its attack state, it spawns a lingering AoE. if (value == AIState.Attack && Main.myPlayer == Projectile.owner) - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ProjectileType(), Projectile.damage, 0f, Projectile.owner, Projectile.whoAmI); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ProjectileType(), Projectile.damage, 0f, Projectile.owner, Projectile.whoAmI); Timer = 0f; } @@ -285,7 +285,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 shootDirection = Projectile.SafeDirectionTo(Target.Center).RotatedByRandom(MathHelper.PiOver4); - Projectile.NewProjectileDirect( + Projectile.NewProjectile( Projectile.GetSource_FromThis(), Projectile.Center, shootDirection * Ariane_BoltProjectileSpeed, @@ -379,7 +379,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D glowTexture = Request(GlowTexture).Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Rectangle frame = texture.Frame(3, 9, (int)Animation, Projectile.frame); diff --git a/Projectiles/Summon/LiliesOfFinalityElster.cs b/Projectiles/Summon/LiliesOfFinalityElster.cs index 04baf4f098..f4ec34bdc9 100644 --- a/Projectiles/Summon/LiliesOfFinalityElster.cs +++ b/Projectiles/Summon/LiliesOfFinalityElster.cs @@ -304,7 +304,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 bulletSpawnPosition = Projectile.Center - Vector2.UnitX * 15f * Projectile.spriteDirection; Vector2 bulletVelocity = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(bulletSpawnPosition, Target, Elster_BulletProjectileSpeed, Elster_BulletMaxUpdates); - Projectile.NewProjectileDirect( + Projectile.NewProjectile( Projectile.GetSource_FromThis(), bulletSpawnPosition, //Vector2.UnitX * Elster_BulletProjectileSpeed * Projectile.spriteDirection, @@ -403,7 +403,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Rectangle frame = texture.Frame(5, 9, (int)Animation, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; diff --git a/Projectiles/Summon/LostSoulGiant.cs b/Projectiles/Summon/LostSoulGiant.cs index 8de55f9d94..c50208768b 100644 --- a/Projectiles/Summon/LostSoulGiant.cs +++ b/Projectiles/Summon/LostSoulGiant.cs @@ -14,11 +14,11 @@ namespace CalamityMod.Projectiles.Summon public ref float Time => ref Projectile.ai[0]; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.SentryShot[Projectile.type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.SentryShot[Type] = true; } public override void SetDefaults() @@ -73,8 +73,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { SpriteEffects direction = Projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle frame = texture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); for (int i = 0; i < 4; i++) { for (int j = 0; j < Projectile.oldPos.Length / 2; j++) diff --git a/Projectiles/Summon/LostSoulGold.cs b/Projectiles/Summon/LostSoulGold.cs index 7e9d96ac49..c9b0b3853d 100644 --- a/Projectiles/Summon/LostSoulGold.cs +++ b/Projectiles/Summon/LostSoulGold.cs @@ -14,11 +14,11 @@ namespace CalamityMod.Projectiles.Summon public ref float Time => ref Projectile.ai[0]; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.SentryShot[Projectile.type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.SentryShot[Type] = true; } public override void SetDefaults() @@ -44,8 +44,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { SpriteEffects direction = Projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle frame = texture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); for (int i = 0; i < 4; i++) { for (int j = 0; j < Projectile.oldPos.Length / 2; j++) diff --git a/Projectiles/Summon/LostSoulLarge.cs b/Projectiles/Summon/LostSoulLarge.cs index 73deead7d2..819ffc07be 100644 --- a/Projectiles/Summon/LostSoulLarge.cs +++ b/Projectiles/Summon/LostSoulLarge.cs @@ -14,11 +14,11 @@ namespace CalamityMod.Projectiles.Summon public ref float Time => ref Projectile.ai[0]; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.SentryShot[Projectile.type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.SentryShot[Type] = true; } public override void SetDefaults() @@ -45,8 +45,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { SpriteEffects direction = Projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle frame = texture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); for (int i = 0; i < 4; i++) { for (int j = 0; j < Projectile.oldPos.Length / 2; j++) diff --git a/Projectiles/Summon/LostSoulSmall.cs b/Projectiles/Summon/LostSoulSmall.cs index 394f0a5f75..6e2bf53586 100644 --- a/Projectiles/Summon/LostSoulSmall.cs +++ b/Projectiles/Summon/LostSoulSmall.cs @@ -14,11 +14,11 @@ namespace CalamityMod.Projectiles.Summon public ref float Time => ref Projectile.ai[0]; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.SentryShot[Projectile.type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.SentryShot[Type] = true; } public override void SetDefaults() @@ -44,8 +44,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { SpriteEffects direction = Projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle frame = texture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); for (int i = 0; i < 4; i++) { for (int j = 0; j < Projectile.oldPos.Length / 2; j++) diff --git a/Projectiles/Summon/LuxorsGiftSummon.cs b/Projectiles/Summon/LuxorsGiftSummon.cs index b15614439d..c26bbef323 100644 --- a/Projectiles/Summon/LuxorsGiftSummon.cs +++ b/Projectiles/Summon/LuxorsGiftSummon.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { var dye = Main.player[Projectile.owner]?.cMinion ?? 0; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2, armorShaderToUse: dye); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2, armorShaderToUse: dye); return false; } } diff --git a/Projectiles/Summon/MK2FlaskSummon.cs b/Projectiles/Summon/MK2FlaskSummon.cs index 13769a795a..019830b134 100644 --- a/Projectiles/Summon/MK2FlaskSummon.cs +++ b/Projectiles/Summon/MK2FlaskSummon.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/MK2RocketHoming.cs b/Projectiles/Summon/MK2RocketHoming.cs index 38096a4cbd..89e47ab7bd 100644 --- a/Projectiles/Summon/MK2RocketHoming.cs +++ b/Projectiles/Summon/MK2RocketHoming.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + Main.projFrames[Type] = 6; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Summon/MK2RocketNormal.cs b/Projectiles/Summon/MK2RocketNormal.cs index 0e785f7f96..4e64dacdbb 100644 --- a/Projectiles/Summon/MK2RocketNormal.cs +++ b/Projectiles/Summon/MK2RocketNormal.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + Main.projFrames[Type] = 3; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Summon/MechwormBody.cs b/Projectiles/Summon/MechwormBody.cs index 071383cb99..7d68b13af9 100644 --- a/Projectiles/Summon/MechwormBody.cs +++ b/Projectiles/Summon/MechwormBody.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.NeedsUUID[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.NeedsUUID[Type] = true; } public override void SetDefaults() @@ -193,7 +193,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Main.EntitySpriteDraw(tex, drawPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Summon/MechwormHead.cs b/Projectiles/Summon/MechwormHead.cs index d84c7adc57..796d528f9f 100644 --- a/Projectiles/Summon/MechwormHead.cs +++ b/Projectiles/Summon/MechwormHead.cs @@ -44,9 +44,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - ProjectileID.Sets.NeedsUUID[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; + ProjectileID.Sets.NeedsUUID[Type] = true; } public override void SetDefaults() @@ -396,7 +396,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/MechwormLaser.cs b/Projectiles/Summon/MechwormLaser.cs index 2790acbd81..8237d39a03 100644 --- a/Projectiles/Summon/MechwormLaser.cs +++ b/Projectiles/Summon/MechwormLaser.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/MechwormTail.cs b/Projectiles/Summon/MechwormTail.cs index 703902e240..3e4257fb5f 100644 --- a/Projectiles/Summon/MechwormTail.cs +++ b/Projectiles/Summon/MechwormTail.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.NeedsUUID[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.NeedsUUID[Type] = true; } public override void SetDefaults() @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Main.EntitySpriteDraw(tex, drawPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Summon/MechwormTeleportRift.cs b/Projectiles/Summon/MechwormTeleportRift.cs index 97406ecd5d..913d734f22 100644 --- a/Projectiles/Summon/MechwormTeleportRift.cs +++ b/Projectiles/Summon/MechwormTeleportRift.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Summon public ref float GeneralRotationalOffset => ref Projectile.ai[0]; public override void SetStaticDefaults() { - ProjectileID.Sets.NeedsUUID[Projectile.type] = true; + ProjectileID.Sets.NeedsUUID[Type] = true; } public override void SetDefaults() @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Summon float currentFade = Utils.GetLerpValue(0f, 5f, Projectile.timeLeft, true) * Utils.GetLerpValue(Projectile.ai[0], Projectile.ai[0] - 5f, Projectile.timeLeft, true); currentFade *= (1f + 0.2f * (float)Math.Cos(Main.GlobalTimeWrappedHourly % 30f * MathHelper.Pi * 3f)) * 0.8f; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); Color baseColor = new Color(150, 100, 255, 255) * Projectile.Opacity; baseColor *= 0.5f; diff --git a/Projectiles/Summon/MidnightSunBeaconProj.cs b/Projectiles/Summon/MidnightSunBeaconProj.cs index 23e4f18854..25a08a7c8e 100644 --- a/Projectiles/Summon/MidnightSunBeaconProj.cs +++ b/Projectiles/Summon/MidnightSunBeaconProj.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/MidnightSunBeam.cs b/Projectiles/Summon/MidnightSunBeam.cs index f921c8feae..a6fef63506 100644 --- a/Projectiles/Summon/MidnightSunBeam.cs +++ b/Projectiles/Summon/MidnightSunBeam.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/MidnightSunShot.cs b/Projectiles/Summon/MidnightSunShot.cs index 372bad85f1..94f9863b41 100644 --- a/Projectiles/Summon/MidnightSunShot.cs +++ b/Projectiles/Summon/MidnightSunShot.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Summon public static int MaxUpdate = 4; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 1; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + Main.projFrames[Type] = 1; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Summon/MidnightSunUFO.cs b/Projectiles/Summon/MidnightSunUFO.cs index fe93e7ab10..c809587298 100644 --- a/Projectiles/Summon/MidnightSunUFO.cs +++ b/Projectiles/Summon/MidnightSunUFO.cs @@ -19,9 +19,9 @@ namespace CalamityMod.Projectiles.Summon public ref float Timer => ref Projectile.ai[0]; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Summon/MiniGuardianAttack.cs b/Projectiles/Summon/MiniGuardianAttack.cs index 1add2c4813..614db32a4d 100644 --- a/Projectiles/Summon/MiniGuardianAttack.cs +++ b/Projectiles/Summon/MiniGuardianAttack.cs @@ -85,11 +85,11 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -358,7 +358,6 @@ namespace CalamityMod.Projectiles.Summon // Dynamically update stats here, originalDamage can be found in MiscEffects Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); Projectile.localNPCHitCooldown = SpawnedFromPSC ? 6 : 9; var currentAIState = getAiState; @@ -395,7 +394,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.direction = Projectile.spriteDirection = Math.Sign(Projectile.velocity.X); Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 6 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 6 % Main.projFrames[Type]; } // Vanity stuff can't damage @@ -453,7 +452,7 @@ namespace CalamityMod.Projectiles.Summon if (!ForcedVanity && SpawnedFromPSC) { var dye = Owner?.cMinion ?? 0; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, armorShaderToUse: dye); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1, armorShaderToUse: dye); return false; } return true; diff --git a/Projectiles/Summon/MiniGuardianDefense.cs b/Projectiles/Summon/MiniGuardianDefense.cs index 4df35a04f4..5ec0668b23 100644 --- a/Projectiles/Summon/MiniGuardianDefense.cs +++ b/Projectiles/Summon/MiniGuardianDefense.cs @@ -30,11 +30,11 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Summon } //dust and framing Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 6 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 6 % Main.projFrames[Type]; var psc = Owner.Calamity().profanedCrystal; if (psc && !SpawnedFromPSC || !psc && SpawnedFromPSC) @@ -283,7 +283,7 @@ namespace CalamityMod.Projectiles.Summon if (SpawnedFromPSC && !ForcedVanity) { var dye = Owner?.cMinion ?? 0; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, armorShaderToUse: dye); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1, armorShaderToUse: dye); return false; } return true; diff --git a/Projectiles/Summon/MiniGuardianHealer.cs b/Projectiles/Summon/MiniGuardianHealer.cs index c8c3632534..92b2796588 100644 --- a/Projectiles/Summon/MiniGuardianHealer.cs +++ b/Projectiles/Summon/MiniGuardianHealer.cs @@ -27,11 +27,11 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public bool isEmpowered => Main.player[Projectile.owner].Calamity().pscState == (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Empowered; @@ -330,7 +330,7 @@ namespace CalamityMod.Projectiles.Summon if (SpawnedFromPSC && !ForcedVanity && Owner.Calamity().pscState == (int)ProfanedSoulCrystalState.Empowered) { var dye = Owner?.cMinion ?? 0; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, armorShaderToUse: dye); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1, armorShaderToUse: dye); return false; } return true; diff --git a/Projectiles/Summon/MiniGuardianHolyRay.cs b/Projectiles/Summon/MiniGuardianHolyRay.cs index a5c7f9dd29..0256dbe178 100644 --- a/Projectiles/Summon/MiniGuardianHolyRay.cs +++ b/Projectiles/Summon/MiniGuardianHolyRay.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } public override void SetDefaults() @@ -62,7 +62,6 @@ namespace CalamityMod.Projectiles.Summon Vector2 fireFrom = new Vector2(owner.Center.X, owner.Center.Y); Projectile.position = fireFrom - new Vector2(Projectile.width, Projectile.height) / 2f; Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); } else Projectile.Kill(); diff --git a/Projectiles/Summon/MiniGuardianRock.cs b/Projectiles/Summon/MiniGuardianRock.cs index be009d6bbe..664e157772 100644 --- a/Projectiles/Summon/MiniGuardianRock.cs +++ b/Projectiles/Summon/MiniGuardianRock.cs @@ -21,10 +21,10 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -46,7 +46,6 @@ namespace CalamityMod.Projectiles.Summon { // Dynamically update stats here, originalDamage can be found in MiscEffects Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); // Despawn properly if (Owner.Calamity().pSoulGuardians && Projectile.ai[0] == 0f) diff --git a/Projectiles/Summon/MiniGuardianStars.cs b/Projectiles/Summon/MiniGuardianStars.cs index 94fec64eb7..100c83282d 100644 --- a/Projectiles/Summon/MiniGuardianStars.cs +++ b/Projectiles/Summon/MiniGuardianStars.cs @@ -33,7 +33,6 @@ namespace CalamityMod.Projectiles.Summon Player owner = Main.player[Projectile.owner]; Projectile.damage = (int)owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - Projectile.damage = owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); if (Projectile.ai[0] < 240f) { @@ -51,7 +50,7 @@ namespace CalamityMod.Projectiles.Summon { float lerpMult = Utils.GetLerpValue(15f, 30f, Projectile.timeLeft, clamped: true) * Utils.GetLerpValue(240f, 200f, Projectile.timeLeft, clamped: true) * (1f + 0.2f * (float)Math.Cos(Main.GlobalTimeWrappedHourly % 30f / 0.5f * (MathHelper.Pi * 2f) * 3f)) * 0.8f; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); Color baseColor = ProfanedSoulCrystal.GetColorForPsc(Main.player[Projectile.owner].Calamity().pscState, Main.dayTime); baseColor *= 0.5f; diff --git a/Projectiles/Summon/MiniSandShark.cs b/Projectiles/Summon/MiniSandShark.cs index e3d59bb319..fd1ef345c5 100644 --- a/Projectiles/Summon/MiniSandShark.cs +++ b/Projectiles/Summon/MiniSandShark.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/MirrorofKalandraMinions/AtzirisDisfavor.cs b/Projectiles/Summon/MirrorofKalandraMinions/AtzirisDisfavor.cs index 062b95b202..f7199ae813 100644 --- a/Projectiles/Summon/MirrorofKalandraMinions/AtzirisDisfavor.cs +++ b/Projectiles/Summon/MirrorofKalandraMinions/AtzirisDisfavor.cs @@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles.Summon.MirrorofKalandraMinions public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; diff --git a/Projectiles/Summon/MirrorofKalandraMinions/HopeShredder.cs b/Projectiles/Summon/MirrorofKalandraMinions/HopeShredder.cs index 240bb95b91..6789b67e45 100644 --- a/Projectiles/Summon/MirrorofKalandraMinions/HopeShredder.cs +++ b/Projectiles/Summon/MirrorofKalandraMinions/HopeShredder.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Summon.MirrorofKalandraMinions { Projectile.frameCounter++; if (Projectile.frameCounter % MirrorofKalandra.Vile_BowChargeTime == 0) - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; } public void ShootTarget() @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Summon.MirrorofKalandraMinions public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; diff --git a/Projectiles/Summon/MirrorofKalandraMinions/HopeShredderArrow.cs b/Projectiles/Summon/MirrorofKalandraMinions/HopeShredderArrow.cs index 1d1faac2f7..03367385bd 100644 --- a/Projectiles/Summon/MirrorofKalandraMinions/HopeShredderArrow.cs +++ b/Projectiles/Summon/MirrorofKalandraMinions/HopeShredderArrow.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Summon.MirrorofKalandraMinions Projectile.MaxUpdates = MirrorofKalandra.Vile_ArrowSpeedMult; } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox.TopLeft(), targetHitbox.Size()); + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox); public override void AI() { @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Summon.MirrorofKalandraMinions public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; diff --git a/Projectiles/Summon/MirrorofKalandraMinions/Paradoxica.cs b/Projectiles/Summon/MirrorofKalandraMinions/Paradoxica.cs index 98bab8425f..34d42f7ebe 100644 --- a/Projectiles/Summon/MirrorofKalandraMinions/Paradoxica.cs +++ b/Projectiles/Summon/MirrorofKalandraMinions/Paradoxica.cs @@ -28,8 +28,8 @@ namespace CalamityMod.Projectiles.Summon.MirrorofKalandraMinions public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 5; ProjectileID.Sets.DrawScreenCheckFluff[Type] = 12000; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -184,7 +184,7 @@ namespace CalamityMod.Projectiles.Summon.MirrorofKalandraMinions public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; diff --git a/Projectiles/Summon/MirrorofKalandraMinions/Starforge.cs b/Projectiles/Summon/MirrorofKalandraMinions/Starforge.cs index c2fdddd74b..4cacdd4e90 100644 --- a/Projectiles/Summon/MirrorofKalandraMinions/Starforge.cs +++ b/Projectiles/Summon/MirrorofKalandraMinions/Starforge.cs @@ -131,7 +131,7 @@ namespace CalamityMod.Projectiles.Summon.MirrorofKalandraMinions public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; diff --git a/Projectiles/Summon/MirrorofKalandraMinions/WindRipper.cs b/Projectiles/Summon/MirrorofKalandraMinions/WindRipper.cs index 9495ba6c3a..3da0112863 100644 --- a/Projectiles/Summon/MirrorofKalandraMinions/WindRipper.cs +++ b/Projectiles/Summon/MirrorofKalandraMinions/WindRipper.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Summon.MirrorofKalandraMinions { Projectile.frameCounter++; if (Projectile.frameCounter % MirrorofKalandra.Wind_BowChargeTime == 0) - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; } public void ShootTarget() @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Summon.MirrorofKalandraMinions public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; diff --git a/Projectiles/Summon/MirrorofKalandraMinions/WindRipperArrow.cs b/Projectiles/Summon/MirrorofKalandraMinions/WindRipperArrow.cs index 006b16a2e1..cfd523dd96 100644 --- a/Projectiles/Summon/MirrorofKalandraMinions/WindRipperArrow.cs +++ b/Projectiles/Summon/MirrorofKalandraMinions/WindRipperArrow.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Summon.MirrorofKalandraMinions Projectile.MaxUpdates = MirrorofKalandra.Wind_ArrowSpeedMult; } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox.TopLeft(), targetHitbox.Size()); + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox); public override void AI() { @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Summon.MirrorofKalandraMinions public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; diff --git a/Projectiles/Summon/MoonFist.cs b/Projectiles/Summon/MoonFist.cs index 75f720a819..dec5c356bd 100644 --- a/Projectiles/Summon/MoonFist.cs +++ b/Projectiles/Summon/MoonFist.cs @@ -44,8 +44,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 18; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projPet[Type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -203,6 +204,8 @@ namespace CalamityMod.Projectiles.Summon Projectile.netUpdate = true; } + public override bool MinionContactDamage() => true; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { // Rebound on collision. @@ -239,7 +242,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition; diff --git a/Projectiles/Summon/MoonFistTeleportVisual.cs b/Projectiles/Summon/MoonFistTeleportVisual.cs index 7b8a3fe0df..bea41c2742 100644 --- a/Projectiles/Summon/MoonFistTeleportVisual.cs +++ b/Projectiles/Summon/MoonFistTeleportVisual.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D telegraphTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D telegraphTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Color telegraphColor = Color.White * Projectile.Opacity * 0.2f; telegraphColor.A = 0; diff --git a/Projectiles/Summon/MortalityBeam.cs b/Projectiles/Summon/MortalityBeam.cs index 019a753622..49e9e13c28 100644 --- a/Projectiles/Summon/MortalityBeam.cs +++ b/Projectiles/Summon/MortalityBeam.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/MortalityBolt.cs b/Projectiles/Summon/MortalityBolt.cs index 26a6c2fcc0..040465d30e 100644 --- a/Projectiles/Summon/MortalityBolt.cs +++ b/Projectiles/Summon/MortalityBolt.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Summon public Color ProjectileColor => Main.hslToRgb(Projectile.localAI[0], 1f, 0.5f); public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/MutatedTruffleMinion.cs b/Projectiles/Summon/MutatedTruffleMinion.cs index 498383c09d..d8ba22f0d2 100644 --- a/Projectiles/Summon/MutatedTruffleMinion.cs +++ b/Projectiles/Summon/MutatedTruffleMinion.cs @@ -253,14 +253,14 @@ namespace CalamityMod.Projectiles.Summon #endregion - public override bool? CanDamage() => (State == AIState.Dashing) ? null : false; + public override bool MinionContactDamage() => State == AIState.Dashing; // The minion while dashing does 1.25x more damge. public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.SourceDamage *= 1.25f; public override bool PreDraw(ref Color lightColor) { - Texture2D texture = TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; diff --git a/Projectiles/Summon/MutatedTruffleToothball.cs b/Projectiles/Summon/MutatedTruffleToothball.cs index e9e60f2538..7e2866795c 100644 --- a/Projectiles/Summon/MutatedTruffleToothball.cs +++ b/Projectiles/Summon/MutatedTruffleToothball.cs @@ -11,6 +11,8 @@ namespace CalamityMod.Projectiles.Summon { public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "CalamityMod/NPCs/OldDuke/OldDukeToothBall"; + public ref float TargetShotID => ref Projectile.ai[0]; public override void SetStaticDefaults() => ProjectileID.Sets.MinionShot[Type] = true; diff --git a/Projectiles/Summon/MutatedTruffleToothball.png b/Projectiles/Summon/MutatedTruffleToothball.png deleted file mode 100644 index dfed859377..0000000000 Binary files a/Projectiles/Summon/MutatedTruffleToothball.png and /dev/null differ diff --git a/Projectiles/Summon/OldDukeHeadCorpse.cs b/Projectiles/Summon/OldDukeHeadCorpse.cs index e546d39384..24986fdf07 100644 --- a/Projectiles/Summon/OldDukeHeadCorpse.cs +++ b/Projectiles/Summon/OldDukeHeadCorpse.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 2; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 2; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/OldDukeSharkVomit.cs b/Projectiles/Summon/OldDukeSharkVomit.cs index c27c7a6aa4..fd7b640122 100644 --- a/Projectiles/Summon/OldDukeSharkVomit.cs +++ b/Projectiles/Summon/OldDukeSharkVomit.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), Projectile.GetAlpha(lightColor), Projectile.rotation, texture.Size() / 2f, Projectile.scale, spriteEffects, 0); return false; } diff --git a/Projectiles/Summon/PhantomGuy.cs b/Projectiles/Summon/PhantomGuy.cs index fbaf86c064..a86a9b90d6 100644 --- a/Projectiles/Summon/PhantomGuy.cs +++ b/Projectiles/Summon/PhantomGuy.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/PhantomicDagger.cs b/Projectiles/Summon/PhantomicDagger.cs index 95fdf5345a..114b11ab6c 100644 --- a/Projectiles/Summon/PhantomicDagger.cs +++ b/Projectiles/Summon/PhantomicDagger.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 7; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 7; } public override void SetDefaults() @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Summon int cap = 3; float capDamageFactor = 0.05f; - int excessCount = Main.player[Projectile.owner].ownedProjectileCounts[Projectile.type] - cap; + int excessCount = Main.player[Projectile.owner].ownedProjectileCounts[Type] - cap; modifiers.SourceDamage *= MathHelper.Clamp(1f - (capDamageFactor * excessCount), 0f, 1f); // Bypass a portion of the target's DR @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Summon { if (CalamityClientConfig.Instance.Afterimages) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); } return true; } diff --git a/Projectiles/Summon/PhantomicShield.cs b/Projectiles/Summon/PhantomicShield.cs index 52bcfcef30..e8cde40735 100644 --- a/Projectiles/Summon/PhantomicShield.cs +++ b/Projectiles/Summon/PhantomicShield.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() diff --git a/Projectiles/Summon/PinkButterfly.cs b/Projectiles/Summon/PinkButterfly.cs index fc97d9b5bf..62400663b8 100644 --- a/Projectiles/Summon/PinkButterfly.cs +++ b/Projectiles/Summon/PinkButterfly.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -239,8 +239,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, spriteEffects, 0); return false; diff --git a/Projectiles/Summon/PlagueBeeSmall.cs b/Projectiles/Summon/PlagueBeeSmall.cs index fdc40e5225..3bf84e8362 100644 --- a/Projectiles/Summon/PlagueBeeSmall.cs +++ b/Projectiles/Summon/PlagueBeeSmall.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -158,8 +158,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int frameHeight = texture.Height / Main.projFrames[Type]; int drawStart = frameHeight * Projectile.frame; SpriteEffects spriteEffects = SpriteEffects.None; if (Projectile.spriteDirection == -1) diff --git a/Projectiles/Summon/PlaguePrincess.cs b/Projectiles/Summon/PlaguePrincess.cs index d605fc559e..be7f43f5e7 100644 --- a/Projectiles/Summon/PlaguePrincess.cs +++ b/Projectiles/Summon/PlaguePrincess.cs @@ -40,7 +40,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; + Main.projFrames[Type] = 6; + Main.projPet[Type] = true; ProjectileID.Sets.TrailingMode[Type] = 2; ProjectileID.Sets.TrailCacheLength[Type] = 8; ProjectileID.Sets.MinionSacrificable[Type] = true; @@ -113,7 +114,7 @@ namespace CalamityMod.Projectiles.Summon public void DecideFrames() { Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 6 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 6 % Main.projFrames[Type]; } public void DoBehavior_HoverNearOwner(NPC potentialTarget) @@ -378,7 +379,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition; @@ -400,6 +401,6 @@ namespace CalamityMod.Projectiles.Summon public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); - public override bool? CanDamage() => CurrentState == ViriliAIState.ChargeAtEnemies ? null : false; + public override bool MinionContactDamage() => CurrentState == ViriliAIState.ChargeAtEnemies; } } diff --git a/Projectiles/Summon/PlaguebringerMK2.cs b/Projectiles/Summon/PlaguebringerMK2.cs index 04167de9f5..45bb6d1396 100644 --- a/Projectiles/Summon/PlaguebringerMK2.cs +++ b/Projectiles/Summon/PlaguebringerMK2.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Summon public const float DistanceToCheck = 1000.0001f; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 6; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -123,7 +123,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Summon/PlaguebringerSummon.cs b/Projectiles/Summon/PlaguebringerSummon.cs index 359b783e52..93401191a7 100644 --- a/Projectiles/Summon/PlaguebringerSummon.cs +++ b/Projectiles/Summon/PlaguebringerSummon.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 6; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/PlantationStaffSeed.cs b/Projectiles/Summon/PlantationStaffSeed.cs index e891f75ec4..b454f87a61 100644 --- a/Projectiles/Summon/PlantationStaffSeed.cs +++ b/Projectiles/Summon/PlantationStaffSeed.cs @@ -1,6 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -9,6 +10,7 @@ namespace CalamityMod.Projectiles.Summon public class PlantationStaffSeed : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "Terraria/Images/Projectile_" + ProjectileID.SeedPlantera; public ref float RandomTexture => ref Projectile.ai[0]; @@ -18,6 +20,7 @@ namespace CalamityMod.Projectiles.Summon ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.TrailingMode[Type] = 2; ProjectileID.Sets.TrailCacheLength[Type] = 3; + Main.instance.LoadProjectile(ProjectileID.PoisonSeedPlantera); } public override void SetDefaults() @@ -54,7 +57,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = (RandomTexture == 0f) ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request("CalamityMod/Projectiles/Summon/PlantationStaffSeed2").Value; + Texture2D texture = (RandomTexture == 0f) ? Terraria.GameContent.TextureAssets.Projectile[ProjectileID.PoisonSeedPlantera].Value : TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; diff --git a/Projectiles/Summon/PlantationStaffSeed.png b/Projectiles/Summon/PlantationStaffSeed.png deleted file mode 100644 index 14abac4751..0000000000 Binary files a/Projectiles/Summon/PlantationStaffSeed.png and /dev/null differ diff --git a/Projectiles/Summon/PlantationStaffSeed2.png b/Projectiles/Summon/PlantationStaffSeed2.png deleted file mode 100644 index 56d10c0cdd..0000000000 Binary files a/Projectiles/Summon/PlantationStaffSeed2.png and /dev/null differ diff --git a/Projectiles/Summon/PlantationStaffSporeCloud.cs b/Projectiles/Summon/PlantationStaffSporeCloud.cs index d483f5e8d6..d41d8bc0d3 100644 --- a/Projectiles/Summon/PlantationStaffSporeCloud.cs +++ b/Projectiles/Summon/PlantationStaffSporeCloud.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (RandomTexture == 1f) tex = ModContent.Request("CalamityMod/Projectiles/Summon/PlantationStaffSporeCloud2").Value; if (RandomTexture == 2f) diff --git a/Projectiles/Summon/PlantationStaffSummon.cs b/Projectiles/Summon/PlantationStaffSummon.cs index 7d8bd78097..8c63dbcea8 100644 --- a/Projectiles/Summon/PlantationStaffSummon.cs +++ b/Projectiles/Summon/PlantationStaffSummon.cs @@ -39,6 +39,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 8; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; ProjectileID.Sets.TrailingMode[Type] = 2; @@ -283,7 +284,7 @@ namespace CalamityMod.Projectiles.Summon int tentacleAmount = 6; for (int tentacleIndex = 0; tentacleIndex < tentacleAmount; tentacleIndex++) - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Owner.whoAmI, tentacleIndex, Projectile.whoAmI); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Owner.whoAmI, tentacleIndex, Projectile.whoAmI); SoundEngine.PlaySound(SoundID.Roar with { Volume = .3f, Pitch = 1f, PitchVariance = .1f }, Projectile.Center); } @@ -328,6 +329,8 @@ namespace CalamityMod.Projectiles.Summon #endregion + public override bool MinionContactDamage() => true; + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { if (State == AIState.Ramming) @@ -336,7 +339,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; diff --git a/Projectiles/Summon/PlateProjectile.cs b/Projectiles/Summon/PlateProjectile.cs index 951280b1a6..a5b13efe10 100644 --- a/Projectiles/Summon/PlateProjectile.cs +++ b/Projectiles/Summon/PlateProjectile.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; - Main.projFrames[Projectile.type] = 5; + ProjectileID.Sets.MinionShot[Type] = true; + Main.projFrames[Type] = 5; } public override void SetDefaults() diff --git a/Projectiles/Summon/PolypLauncherProjectile.cs b/Projectiles/Summon/PolypLauncherProjectile.cs index d82595cdee..d73745b2f2 100644 --- a/Projectiles/Summon/PolypLauncherProjectile.cs +++ b/Projectiles/Summon/PolypLauncherProjectile.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Summon public const float Gravity = 0.4f; public override void SetStaticDefaults() { - ProjectileID.Sets.SentryShot[Projectile.type] = true; + ProjectileID.Sets.SentryShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/PolypLauncherSentry.cs b/Projectiles/Summon/PolypLauncherSentry.cs index 74214ad952..1c30e6c755 100644 --- a/Projectiles/Summon/PolypLauncherSentry.cs +++ b/Projectiles/Summon/PolypLauncherSentry.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Summon/PolypLauncherShrapnel.cs b/Projectiles/Summon/PolypLauncherShrapnel.cs index 77b3440b76..28274fc0ff 100644 --- a/Projectiles/Summon/PolypLauncherShrapnel.cs +++ b/Projectiles/Summon/PolypLauncherShrapnel.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.SentryShot[Projectile.type] = true; + ProjectileID.Sets.SentryShot[Type] = true; } public override void SetDefaults() @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { //Changes the texture of the projectile - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (Projectile.ai[0] == 1f) { texture = ModContent.Request("CalamityMod/Projectiles/Summon/PolypLauncherShrapnel2").Value; diff --git a/Projectiles/Summon/PowerfulRaven.cs b/Projectiles/Summon/PowerfulRaven.cs index 3a0113fe1d..379971a921 100644 --- a/Projectiles/Summon/PowerfulRaven.cs +++ b/Projectiles/Summon/PowerfulRaven.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Projectiles.Summon public const float SeparationAnxietyDistance = 2000f; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 5; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Summon } if (Projectile.ai[1] % 45f >= 28f) { - Projectile.frame = Main.projFrames[Projectile.type] - 1; + Projectile.frame = Main.projFrames[Type] - 1; Lighting.AddLight(Projectile.Center, 1f, 1f, 1f); } else @@ -117,7 +117,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type] - 1) + if (Projectile.frame >= Main.projFrames[Type] - 1) { Projectile.frame = 0; } @@ -133,7 +133,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type] - 1) + if (Projectile.frame >= Main.projFrames[Type] - 1) { Projectile.frame = 0; } diff --git a/Projectiles/Summon/ProfanedEnergy.cs b/Projectiles/Summon/ProfanedEnergy.cs index 66da00abc3..29c66a829a 100644 --- a/Projectiles/Summon/ProfanedEnergy.cs +++ b/Projectiles/Summon/ProfanedEnergy.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs b/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs index 366309c1b3..29d1cbf675 100644 --- a/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs +++ b/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs @@ -30,10 +30,10 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } private void Split(bool hit, bool chaseable) @@ -132,7 +132,6 @@ namespace CalamityMod.Projectiles.Summon Main.dust[num469].velocity *= 0f; var Owner = Main.player[Projectile.owner]; Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); } public override Color? GetAlpha(Color lightColor) @@ -142,8 +141,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyBlastNight").Value; - int num214 = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyBlastNight").Value; + int num214 = texture.Height / Main.projFrames[Type]; int y6 = num214 * Projectile.frame; Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha, true), 4f, texture); Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); @@ -207,9 +206,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; ProjectileID.Sets.SummonTagDamageMultiplier[Type] = 0.3f; } @@ -241,7 +240,6 @@ namespace CalamityMod.Projectiles.Summon Lighting.AddLight(Projectile.Center, 0.5f, 0.1f, 0f); var Owner = Main.player[Projectile.owner]; Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); if (Projectile.timeLeft == 600) { damage = Projectile.damage; @@ -332,8 +330,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFire2Night").Value; - int num214 = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFire2Night").Value; + int num214 = texture.Height / Main.projFrames[Type]; int y6 = num214 * Projectile.frame; Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha, true), 4f, texture); Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); @@ -411,8 +409,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; ProjectileID.Sets.SummonTagDamageMultiplier[Type] = 0.6f; } @@ -439,7 +437,6 @@ namespace CalamityMod.Projectiles.Summon Lighting.AddLight(Projectile.Center, 1f, 0.2f, 0f); var Owner = Main.player[Projectile.owner]; Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); } public override bool PreAI() @@ -502,8 +499,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha, true), 4f, Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha), 1); + Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha, true), 4f, Terraria.GameContent.TextureAssets.Projectile[Type].Value); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha), 1); return false; } @@ -663,9 +660,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - Main.projFrames[Projectile.type] = 3; + ProjectileID.Sets.TrailCacheLength[Type] = 3; + ProjectileID.Sets.TrailingMode[Type] = 0; + Main.projFrames[Type] = 3; ProjectileID.Sets.SummonTagDamageMultiplier[Type] = 0.4f; } @@ -710,7 +707,6 @@ namespace CalamityMod.Projectiles.Summon var Owner = Main.player[Projectile.owner]; Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); Projectile.frameCounter++; if (Projectile.frameCounter > 8) @@ -744,8 +740,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request("CalamityMod/Projectiles/Summon/ProfanedCrystalRangedHugesNight").Value; - int num214 = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Summon/ProfanedCrystalRangedHugesNight").Value; + int num214 = texture.Height / Main.projFrames[Type]; int y6 = num214 * Projectile.frame; Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha, true), 4f, texture); Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); @@ -845,7 +841,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -872,7 +868,6 @@ namespace CalamityMod.Projectiles.Summon { var Owner = Main.player[Projectile.owner]; Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); Projectile.frameCounter++; if (Projectile.frameCounter > 4) @@ -948,8 +943,8 @@ namespace CalamityMod.Projectiles.Summon } public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int num214 = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int num214 = texture.Height / Main.projFrames[Type]; int y6 = num214 * Projectile.frame; Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha, true), 4f, texture); Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); @@ -993,7 +988,6 @@ namespace CalamityMod.Projectiles.Summon { var Owner = Main.player[Projectile.owner]; Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); if (Projectile.timeLeft > 120) { @@ -1296,7 +1290,6 @@ namespace CalamityMod.Projectiles.Summon Player owner = Main.player[Projectile.owner]; Projectile.damage = (int)owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - Projectile.damage = owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); if (Projectile.ai[1] == 0f) { @@ -1449,7 +1442,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.NoLiquidDistortion[Type] = true; } @@ -1568,8 +1561,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; ProjectileID.Sets.NoLiquidDistortion[Type] = true; } @@ -1777,7 +1770,6 @@ namespace CalamityMod.Projectiles.Summon { var Owner = Main.player[Projectile.owner]; Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); //Ensure that psa's spears are not coloured by night var psc = Projectile.ai[0] > 0f; @@ -1798,8 +1790,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { var psc = Projectile.ai[0] > 0f; - Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime && psc, Projectile.alpha, true), 4f, Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], ProvUtils.GetDayNightColor(!Main.dayTime && psc, Projectile.alpha), 1); + Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime && psc, Projectile.alpha, true), 4f, Terraria.GameContent.TextureAssets.Projectile[Type].Value); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], ProvUtils.GetDayNightColor(!Main.dayTime && psc, Projectile.alpha), 1); return false; } @@ -1850,10 +1842,10 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; } private void Split() @@ -1908,7 +1900,6 @@ namespace CalamityMod.Projectiles.Summon { var Owner = Main.player[Projectile.owner]; Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); int num469 = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, ProvUtils.GetDustID(!Main.dayTime), 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; @@ -1922,8 +1913,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyBlastNight").Value; - int num214 = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyBlastNight").Value; + int num214 = texture.Height / Main.projFrames[Type]; int y6 = num214 * Projectile.frame; Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha, true), 4f, texture); Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); @@ -1989,9 +1980,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; ProjectileID.Sets.SummonTagDamageMultiplier[Type] = 0.3f; } @@ -2024,7 +2015,6 @@ namespace CalamityMod.Projectiles.Summon var Owner = Main.player[Projectile.owner]; Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); Projectile.frameCounter++; if (Projectile.frameCounter > 6) @@ -2062,8 +2052,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFire2Night").Value; - int num214 = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFire2Night").Value; + int num214 = texture.Height / Main.projFrames[Type]; int y6 = num214 * Projectile.frame; Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha, true), 4f, texture); Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Summon/PuffCloud.cs b/Projectiles/Summon/PuffCloud.cs index a273d0d622..1239e67bef 100644 --- a/Projectiles/Summon/PuffCloud.cs +++ b/Projectiles/Summon/PuffCloud.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 7; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + Main.projFrames[Type] = 7; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.frameCounter % 4 == 3) { Projectile.frame++; - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.Kill(); } } diff --git a/Projectiles/Summon/PuffWarrior.cs b/Projectiles/Summon/PuffWarrior.cs index 3ca4803c5e..91dc1aa0a2 100644 --- a/Projectiles/Summon/PuffWarrior.cs +++ b/Projectiles/Summon/PuffWarrior.cs @@ -29,9 +29,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 10; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 10; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -108,15 +108,15 @@ namespace CalamityMod.Projectiles.Summon internal void DetermineFrames() { - int startingFrame = Jumping ? Main.projFrames[Projectile.type] - 3 : 0; - int endingFrame = Jumping ? Main.projFrames[Projectile.type] - 4 : Main.projFrames[Projectile.type] - 4; + int startingFrame = Jumping ? Main.projFrames[Type] - 3 : 0; + int endingFrame = Jumping ? Main.projFrames[Type] - 4 : Main.projFrames[Type] - 4; if (Jumping) JumpCountdown = 12f; else if (Math.Abs(Projectile.velocity.Y) <= Gravity && JumpCountdown > 0) { - startingFrame = Main.projFrames[Projectile.type] - 1; - endingFrame = Main.projFrames[Projectile.type] - 1; + startingFrame = Main.projFrames[Type] - 1; + endingFrame = Main.projFrames[Type] - 1; JumpCountdown--; } diff --git a/Projectiles/Summon/PurpleButterfly.cs b/Projectiles/Summon/PurpleButterfly.cs index ad2212ddd2..790c60d81a 100644 --- a/Projectiles/Summon/PurpleButterfly.cs +++ b/Projectiles/Summon/PurpleButterfly.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -90,8 +90,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, spriteEffects, 0); return false; diff --git a/Projectiles/Summon/RustyBeaconPulse.cs b/Projectiles/Summon/RustyBeaconPulse.cs index b562ab9a46..db6d3a5737 100644 --- a/Projectiles/Summon/RustyBeaconPulse.cs +++ b/Projectiles/Summon/RustyBeaconPulse.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Color drawColor = Projectile.GetAlpha(lightColor) * 0.33f; for (int i = 0; i < 8; i++) { diff --git a/Projectiles/Summon/RustyDrone.cs b/Projectiles/Summon/RustyDrone.cs index be4f3b428f..4435cc6f3d 100644 --- a/Projectiles/Summon/RustyDrone.cs +++ b/Projectiles/Summon/RustyDrone.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 12; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 12; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Summon { // Determine frames. Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Type]; // Hover in place. Projectile.velocity = -Vector2.UnitY * (float)Math.Sin(MathHelper.TwoPi * Projectile.timeLeft / 96f) * 3f; diff --git a/Projectiles/Summon/SageNeedle.cs b/Projectiles/Summon/SageNeedle.cs index d015b5019f..0efecc2a3b 100644 --- a/Projectiles/Summon/SageNeedle.cs +++ b/Projectiles/Summon/SageNeedle.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Summon public const int OnDeathHealValue = 1; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/SageSpirit.cs b/Projectiles/Summon/SageSpirit.cs index 467ab93077..c7925c58ac 100644 --- a/Projectiles/Summon/SageSpirit.cs +++ b/Projectiles/Summon/SageSpirit.cs @@ -24,9 +24,9 @@ namespace CalamityMod.Projectiles.Summon internal const int ShootRate = 40; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Summon { Projectile.frameCounter++; if (Projectile.frameCounter % 5 == 4) - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; } internal void ResetOwnerFlyValues() @@ -127,7 +127,7 @@ namespace CalamityMod.Projectiles.Summon { Vector2 destination = Owner.Center + Vector2.UnitX * Owner.width * 1.6f * Owner.direction; - int totalSageSpirits = Owner.ownedProjectileCounts[Projectile.type]; + int totalSageSpirits = Owner.ownedProjectileCounts[Type]; destination += (SageSpiritIndex * MathHelper.TwoPi / totalSageSpirits).ToRotationVector2() * 70f; if (PlayerFlyTime >= 1f) { @@ -175,7 +175,7 @@ namespace CalamityMod.Projectiles.Summon { AttackTimer++; - int totalSageSpirits = Owner.ownedProjectileCounts[Projectile.type]; + int totalSageSpirits = Owner.ownedProjectileCounts[Type]; Vector2 destinationOffsetFactor = Vector2.Max(target.Size, new Vector2(160f)) * new Vector2(0.3f, 0.2f); Vector2 destination = target.Center + (AttackTimer / 12f).ToRotationVector2() * destinationOffsetFactor; destination += (SageSpiritIndex * MathHelper.TwoPi / totalSageSpirits).ToRotationVector2() * 130f; diff --git a/Projectiles/Summon/SakuraBullet.cs b/Projectiles/Summon/SakuraBullet.cs index 238553190b..594ec3ea27 100644 --- a/Projectiles/Summon/SakuraBullet.cs +++ b/Projectiles/Summon/SakuraBullet.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Summon/SandBolt.cs b/Projectiles/Summon/SandBolt.cs index 1a29b4cb0c..409da292f1 100644 --- a/Projectiles/Summon/SandBolt.cs +++ b/Projectiles/Summon/SandBolt.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/SandElementalHealer.cs b/Projectiles/Summon/SandElementalHealer.cs index f1f2029331..8ec3c83484 100644 --- a/Projectiles/Summon/SandElementalHealer.cs +++ b/Projectiles/Summon/SandElementalHealer.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - Main.projPet[Projectile.type] = true; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; + Main.projFrames[Type] = 6; + Main.projPet[Type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; } public override void SetDefaults() @@ -81,7 +81,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Summon/SandElementalMinion.cs b/Projectiles/Summon/SandElementalMinion.cs index c748e8c0da..59c7f9c2bf 100644 --- a/Projectiles/Summon/SandElementalMinion.cs +++ b/Projectiles/Summon/SandElementalMinion.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 12; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 12; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/SandMark.cs b/Projectiles/Summon/SandMark.cs index e48e12b4ff..42213e2c88 100644 --- a/Projectiles/Summon/SandMark.cs +++ b/Projectiles/Summon/SandMark.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -143,8 +143,8 @@ namespace CalamityMod.Projectiles.Summon { Color originalColor = Lighting.GetColor((int)((double)Projectile.position.X + (double)Projectile.width * 0.5) / 16, (int)(((double)Projectile.position.Y + (double)Projectile.height * 0.5) / 16.0)); Vector2 drawPos = Projectile.position + new Vector2((float)Projectile.width, (float)Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; - Texture2D texture2D27 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle rectangle = texture2D27.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D texture2D27 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle rectangle = texture2D27.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Color alphaColor = Projectile.GetAlpha(originalColor); Vector2 origin7 = rectangle.Size() / 2f; Color sandyColor = Main.hslToRgb(0.25f, 1f, 1f).MultiplyRGBA(new Color(255, 255, 255, 0)); diff --git a/Projectiles/Summon/SandTornado.cs b/Projectiles/Summon/SandTornado.cs index 0b5b84344e..5a125e9ce1 100644 --- a/Projectiles/Summon/SandTornado.cs +++ b/Projectiles/Summon/SandTornado.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -113,7 +113,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 sizeModdingPos = new Vector2(0f, sizeModdingVector2.Y - sizeModdingVector.Y); sizeModdingPos.X = sizeModdingPos.Y * vectorMult; new Vector2(sizeModdingVector.X - sizeModdingPos.X / 2f, sizeModdingVector.Y); - Texture2D texture2D23 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture2D23 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle drawRectangle = texture2D23.Frame(1, 1, 0, 0); Vector2 smallRect = drawRectangle.Size() / 2f; float aiTrackMult = -0.06283186f * aiTracker; diff --git a/Projectiles/Summon/SandnadoMinion.cs b/Projectiles/Summon/SandnadoMinion.cs index 6beba7d3f1..4fcc69068f 100644 --- a/Projectiles/Summon/SandnadoMinion.cs +++ b/Projectiles/Summon/SandnadoMinion.cs @@ -21,9 +21,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 6; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Summon public void DoAnimation() { Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 8 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 8 % Main.projFrames[Type]; } public void Idle() diff --git a/Projectiles/Summon/SarosAura.cs b/Projectiles/Summon/SarosAura.cs index ecb2894157..e626a5ea77 100644 --- a/Projectiles/Summon/SarosAura.cs +++ b/Projectiles/Summon/SarosAura.cs @@ -24,9 +24,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Type] = 2; - ProjectileID.Sets.TrailCacheLength[Type] = 8; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + Main.projPet[Type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Summon AttackTarget(potentialTarget); // Stay near the target and spin around. - Projectile.Center = Owner.Center - Vector2.UnitY * 16f; + Projectile.Center = Owner.Center - Vector2.UnitY * (16f - Owner.gfxOffY); // The projectile spins right at a constant speed. Projectile.rotation += MathHelper.ToRadians(1.5f); diff --git a/Projectiles/Summon/SarosMicrosun.cs b/Projectiles/Summon/SarosMicrosun.cs index 0e359bf1bd..4e20199930 100644 --- a/Projectiles/Summon/SarosMicrosun.cs +++ b/Projectiles/Summon/SarosMicrosun.cs @@ -14,10 +14,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; + Main.projFrames[Type] = 6; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -54,12 +53,12 @@ namespace CalamityMod.Projectiles.Summon public void DoAnimation() { Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 6 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 6 % Main.projFrames[Type]; } public override bool PreDraw(ref Color lightColor) // Makes the afterimages of the disk. { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; SpriteEffects direction = Projectile.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; diff --git a/Projectiles/Summon/SarosSunfire.cs b/Projectiles/Summon/SarosSunfire.cs index 5b63b91ce6..d454f593ac 100644 --- a/Projectiles/Summon/SarosSunfire.cs +++ b/Projectiles/Summon/SarosSunfire.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Summon/SeekerSummonProj.cs b/Projectiles/Summon/SeekerSummonProj.cs index 99a0bc8d05..19acb71cf0 100644 --- a/Projectiles/Summon/SeekerSummonProj.cs +++ b/Projectiles/Summon/SeekerSummonProj.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Summon public ref float Time => ref Projectile.ai[1]; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; + Main.projFrames[Type] = 5; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; } public override void SetDefaults() @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.FinalExtraUpdate()) Projectile.frameCounter++; if (Projectile.frameCounter % 6 == 5) - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; } internal void FlyNearOwner() diff --git a/Projectiles/Summon/SepulcherMinion.cs b/Projectiles/Summon/SepulcherMinion.cs index 971d9601d8..903967954a 100644 --- a/Projectiles/Summon/SepulcherMinion.cs +++ b/Projectiles/Summon/SepulcherMinion.cs @@ -105,10 +105,11 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projPet[Type] = true; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; ProjectileID.Sets.DrawScreenCheckFluff[Type] = 12000; } diff --git a/Projectiles/Summon/Shellfish.cs b/Projectiles/Summon/Shellfish.cs index 0417c1e67a..c49d18530f 100644 --- a/Projectiles/Summon/Shellfish.cs +++ b/Projectiles/Summon/Shellfish.cs @@ -17,9 +17,10 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 2; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 2; + Main.projPet[Type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/SilvaCrystal.cs b/Projectiles/Summon/SilvaCrystal.cs index 34b378dcc7..3cbe3f521a 100644 --- a/Projectiles/Summon/SilvaCrystal.cs +++ b/Projectiles/Summon/SilvaCrystal.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -182,8 +182,8 @@ namespace CalamityMod.Projectiles.Summon { Color colorArea = Lighting.GetColor((int)((double)Projectile.position.X + (double)Projectile.width * 0.5) / 16, (int)(((double)Projectile.position.Y + (double)Projectile.height * 0.5) / 16.0)); Vector2 projPos = Projectile.position + new Vector2((float)Projectile.width, (float)Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; - Texture2D texture2D34 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle rectangular = texture2D34.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D texture2D34 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle rectangular = texture2D34.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Color colorAlpha = Projectile.GetAlpha(colorArea); Vector2 halfRectangle = rectangular.Size() / 2f; float scaleFactor = (float)Math.Cos((double)(6.28318548f * (Projectile.localAI[0] / 60f))) + 3f + 3f; diff --git a/Projectiles/Summon/SilvaCrystalExplosion.cs b/Projectiles/Summon/SilvaCrystalExplosion.cs index 75143d5646..70fcf7d03b 100644 --- a/Projectiles/Summon/SilvaCrystalExplosion.cs +++ b/Projectiles/Summon/SilvaCrystalExplosion.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -138,8 +138,8 @@ namespace CalamityMod.Projectiles.Summon { Color colorArea = Lighting.GetColor((int)((double)Projectile.position.X + (double)Projectile.width * 0.5) / 16, (int)(((double)Projectile.position.Y + (double)Projectile.height * 0.5) / 16.0)); Vector2 projPos = Projectile.position + new Vector2((float)Projectile.width, (float)Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; - Texture2D texture2D34 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle rectangular = texture2D34.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D texture2D34 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle rectangular = texture2D34.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Color colorAlpha = Projectile.GetAlpha(colorArea); Vector2 halfRectangle = rectangular.Size() / 2f; Color projColor = Main.hslToRgb(Projectile.ai[0], 1f, 0.5f).MultiplyRGBA(new Color(255, 255, 255, 0)); diff --git a/Projectiles/Summon/SiriusBeam.cs b/Projectiles/Summon/SiriusBeam.cs index 4b29bcd771..8f4c544141 100644 --- a/Projectiles/Summon/SiriusBeam.cs +++ b/Projectiles/Summon/SiriusBeam.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Summon/SiriusExplosion.cs b/Projectiles/Summon/SiriusExplosion.cs index 99670e593b..2dc85a8276 100644 --- a/Projectiles/Summon/SiriusExplosion.cs +++ b/Projectiles/Summon/SiriusExplosion.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -139,8 +139,8 @@ namespace CalamityMod.Projectiles.Summon { Color colorArea = Lighting.GetColor((int)((double)Projectile.position.X + (double)Projectile.width * 0.5) / 16, (int)(((double)Projectile.position.Y + (double)Projectile.height * 0.5) / 16.0)); Vector2 projPos = Projectile.position + new Vector2((float)Projectile.width, (float)Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; - Texture2D texture2D34 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle rectangular = texture2D34.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D texture2D34 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle rectangular = texture2D34.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Color colorAlpha = Projectile.GetAlpha(colorArea); Vector2 halfRectangle = rectangular.Size() / 2f; Color projColor = Main.hslToRgb(0.5f, 1f, Projectile.ai[0]).MultiplyRGBA(new Color(255, 255, 255, 0)); diff --git a/Projectiles/Summon/SiriusMinion.cs b/Projectiles/Summon/SiriusMinion.cs index 1b40d31d96..8078ce92df 100644 --- a/Projectiles/Summon/SiriusMinion.cs +++ b/Projectiles/Summon/SiriusMinion.cs @@ -22,8 +22,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projPet[Type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -50,7 +51,7 @@ namespace CalamityMod.Projectiles.Summon SpawnEffect(); // Does a dust spawn effect. ShootTarget(target); // If there's a target, shoot at the target. - Projectile.Center = Owner.Center - Vector2.UnitY * 60f; // Stays above the player. + Projectile.Center = Owner.Center - Vector2.UnitY * (60f - Owner.gfxOffY); // Stays above the player. Lighting.AddLight(Projectile.Center, 0.5f, 0.5f, 1f); // Passively makes blue light. diff --git a/Projectiles/Summon/SkeletalDragonChild.cs b/Projectiles/Summon/SkeletalDragonChild.cs index ec95b09ac2..1c8edf6dc0 100644 --- a/Projectiles/Summon/SkeletalDragonChild.cs +++ b/Projectiles/Summon/SkeletalDragonChild.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -115,7 +115,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Summon/SkeletalDragonMother.cs b/Projectiles/Summon/SkeletalDragonMother.cs index b8864fe285..533f5934b4 100644 --- a/Projectiles/Summon/SkeletalDragonMother.cs +++ b/Projectiles/Summon/SkeletalDragonMother.cs @@ -12,9 +12,10 @@ namespace CalamityMod.Projectiles.Summon public const float DistanceToCheck = 1100f; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 4; + Main.projPet[Type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -132,7 +133,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Summon/SlimePuppet.cs b/Projectiles/Summon/SlimePuppet.cs index 0272f08163..37f791b7a1 100644 --- a/Projectiles/Summon/SlimePuppet.cs +++ b/Projectiles/Summon/SlimePuppet.cs @@ -18,10 +18,10 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 1; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 1; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { var dye = Owner?.cMinion ?? 0; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, armorShaderToUse: dye); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, armorShaderToUse: dye); return false; } } diff --git a/Projectiles/Summon/SmallAresArms/CannonLaserbeam.cs b/Projectiles/Summon/SmallAresArms/CannonLaserbeam.cs index 4307be1609..d59573fd37 100644 --- a/Projectiles/Summon/SmallAresArms/CannonLaserbeam.cs +++ b/Projectiles/Summon/SmallAresArms/CannonLaserbeam.cs @@ -32,8 +32,8 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + Main.projFrames[Type] = 5; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() { @@ -98,9 +98,9 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms return false; Color beamColor = LaserOverlayColor; - Rectangle startFrameArea = LaserBeginTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); - Rectangle middleFrameArea = LaserMiddleTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); - Rectangle endFrameArea = LaserEndTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Rectangle startFrameArea = LaserBeginTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Rectangle middleFrameArea = LaserMiddleTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Rectangle endFrameArea = LaserEndTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); // Start texture drawing. Main.EntitySpriteDraw(LaserBeginTexture, @@ -135,7 +135,7 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms 0); incrementalBodyLength += laserOffset; centerOnLaser += Projectile.velocity * laserOffset; - middleFrameArea.Y += LaserMiddleTexture.Height / Main.projFrames[Projectile.type]; + middleFrameArea.Y += LaserMiddleTexture.Height / Main.projFrames[Type]; if (middleFrameArea.Y + middleFrameArea.Height > LaserMiddleTexture.Height) middleFrameArea.Y = 0; } diff --git a/Projectiles/Summon/SmallAresArms/ExoskeletonCannon.cs b/Projectiles/Summon/SmallAresArms/ExoskeletonCannon.cs index bf709d1a85..9a86d97a56 100644 --- a/Projectiles/Summon/SmallAresArms/ExoskeletonCannon.cs +++ b/Projectiles/Summon/SmallAresArms/ExoskeletonCannon.cs @@ -150,7 +150,7 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms public void DefaultDrawCannon(Texture2D glowmask) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = texture.Frame(2, Main.projFrames[Type], TargetingSomething.ToInt(), Projectile.frame); Vector2 origin = frame.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition; diff --git a/Projectiles/Summon/SmallAresArms/ExoskeletonGaussNukeCannon.cs b/Projectiles/Summon/SmallAresArms/ExoskeletonGaussNukeCannon.cs index 9364b9f124..de8d848196 100644 --- a/Projectiles/Summon/SmallAresArms/ExoskeletonGaussNukeCannon.cs +++ b/Projectiles/Summon/SmallAresArms/ExoskeletonGaussNukeCannon.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D glowmask = ModContent.Request("CalamityMod/Projectiles/Summon/SmallAresArms/ExoskeletonGaussNukeCannonGlowmask").Value; // The two stabilizers have two different shades of lighting, thus necessitating two different textures. diff --git a/Projectiles/Summon/SmallAresArms/ExoskeletonPanel.cs b/Projectiles/Summon/SmallAresArms/ExoskeletonPanel.cs index bb7dfcce40..1637fc380c 100644 --- a/Projectiles/Summon/SmallAresArms/ExoskeletonPanel.cs +++ b/Projectiles/Summon/SmallAresArms/ExoskeletonPanel.cs @@ -235,7 +235,7 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms if (Main.myPlayer != Projectile.owner) return false; - Texture2D panelTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D panelTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D plasmaTexture = ModContent.Request("CalamityMod/Projectiles/Summon/SmallAresArms/ExoskeletonPanelPlasma").Value; Texture2D arrowTexture = ModContent.Request("CalamityMod/Projectiles/Summon/SmallAresArms/Arrow").Value; Vector2 area = plasmaTexture.Frame(1, 7, 0, 0).Size(); diff --git a/Projectiles/Summon/SmallAresArms/MinionGaussBoom.cs b/Projectiles/Summon/SmallAresArms/MinionGaussBoom.cs index fc42f7a1c5..67c70ca822 100644 --- a/Projectiles/Summon/SmallAresArms/MinionGaussBoom.cs +++ b/Projectiles/Summon/SmallAresArms/MinionGaussBoom.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms public override float GetScreenshakePower(float pulseCompletionRatio) => 0f; public override Color GetCurrentExplosionColor(float pulseCompletionRatio) => Color.Lerp(Color.Yellow * 1.6f, Color.White, MathHelper.Clamp(pulseCompletionRatio * 2.2f, 0f, 1f)); - public override void SetStaticDefaults() => ProjectileID.Sets.MinionShot[Projectile.type] = true; + public override void SetStaticDefaults() => ProjectileID.Sets.MinionShot[Type] = true; public override void SetDefaults() { diff --git a/Projectiles/Summon/SmallAresArms/MinionGaussNuke.cs b/Projectiles/Summon/SmallAresArms/MinionGaussNuke.cs index a8162edc09..4dcd98841d 100644 --- a/Projectiles/Summon/SmallAresArms/MinionGaussNuke.cs +++ b/Projectiles/Summon/SmallAresArms/MinionGaussNuke.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Summon/SmallAresArms/MinionLaserBurst.cs b/Projectiles/Summon/SmallAresArms/MinionLaserBurst.cs index 6cec678d28..c16562f71f 100644 --- a/Projectiles/Summon/SmallAresArms/MinionLaserBurst.cs +++ b/Projectiles/Summon/SmallAresArms/MinionLaserBurst.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms public override void SetStaticDefaults() { Main.projFrames[Type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms // Handle frames and rotation. Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Type]; Projectile.rotation = Projectile.velocity.ToRotation(); } @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Summon/SmallAresArms/MinionPlasmaBlast.cs b/Projectiles/Summon/SmallAresArms/MinionPlasmaBlast.cs index 0f471a310d..8b3cd052b1 100644 --- a/Projectiles/Summon/SmallAresArms/MinionPlasmaBlast.cs +++ b/Projectiles/Summon/SmallAresArms/MinionPlasmaBlast.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms { Main.projFrames[Type] = 6; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms // Handle frames and rotation. Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Type]; Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; // Home towards targets. @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Summon/SmallAresArms/MinionPlasmaGas.cs b/Projectiles/Summon/SmallAresArms/MinionPlasmaGas.cs index a2aa2e83ad..10a4fd4d31 100644 --- a/Projectiles/Summon/SmallAresArms/MinionPlasmaGas.cs +++ b/Projectiles/Summon/SmallAresArms/MinionPlasmaGas.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms public ref float Time => ref Projectile.ai[1]; - public override void SetStaticDefaults() => ProjectileID.Sets.MinionShot[Projectile.type] = true; + public override void SetStaticDefaults() => ProjectileID.Sets.MinionShot[Type] = true; public override void SetDefaults() { @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms public void AdditiveDraw(SpriteBatch spriteBatch) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 origin = texture.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition; float opacity = Utils.GetLerpValue(0f, 0.08f, LightPower, true) * Projectile.Opacity * 0.3f; diff --git a/Projectiles/Summon/SmallAresArms/MinionTeslaOrb.cs b/Projectiles/Summon/SmallAresArms/MinionTeslaOrb.cs index 7e24206cd7..44f5dd439d 100644 --- a/Projectiles/Summon/SmallAresArms/MinionTeslaOrb.cs +++ b/Projectiles/Summon/SmallAresArms/MinionTeslaOrb.cs @@ -22,11 +22,11 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms // Handle frames. Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Type]; Time++; } @@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Summon/SmallSkeletonMinion.cs b/Projectiles/Summon/SmallSkeletonMinion.cs index a0ace7991c..2cc5640838 100644 --- a/Projectiles/Summon/SmallSkeletonMinion.cs +++ b/Projectiles/Summon/SmallSkeletonMinion.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Summon public int Variant; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - Main.projFrames[Projectile.type] = 7; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; + Main.projFrames[Type] = 7; } public override void SetDefaults() @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Summon { Projectile.frame = 1; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 1; } @@ -175,7 +175,7 @@ namespace CalamityMod.Projectiles.Summon { Rectangle frame = new Rectangle(Variant * Projectile.width, Projectile.frame * Projectile.height, Projectile.width, Projectile.height); SpriteEffects spriteEffects = (Projectile.spriteDirection == 1) ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - Main.EntitySpriteDraw(Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, Projectile.Size / 2f, 1f, spriteEffects, 0); + Main.EntitySpriteDraw(Terraria.GameContent.TextureAssets.Projectile[Type].Value, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, Projectile.Size / 2f, 1f, spriteEffects, 0); return false; } diff --git a/Projectiles/Summon/SolarBeam.cs b/Projectiles/Summon/SolarBeam.cs index 5c06c551c7..cee2d0e534 100644 --- a/Projectiles/Summon/SolarBeam.cs +++ b/Projectiles/Summon/SolarBeam.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } diff --git a/Projectiles/Summon/SolarGod.cs b/Projectiles/Summon/SolarGod.cs index 5f9ee985f2..890f7bbf8c 100644 --- a/Projectiles/Summon/SolarGod.cs +++ b/Projectiles/Summon/SolarGod.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/SolarPixie.cs b/Projectiles/Summon/SolarPixie.cs index fd06939b02..3ca4ff1c0f 100644 --- a/Projectiles/Summon/SolarPixie.cs +++ b/Projectiles/Summon/SolarPixie.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/Spikecrag.cs b/Projectiles/Summon/Spikecrag.cs index 219ca81408..f78e7076b2 100644 --- a/Projectiles/Summon/Spikecrag.cs +++ b/Projectiles/Summon/Spikecrag.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/SpikecragSpike.cs b/Projectiles/Summon/SpikecragSpike.cs index 6431b5561c..64bbebe33c 100644 --- a/Projectiles/Summon/SpikecragSpike.cs +++ b/Projectiles/Summon/SpikecragSpike.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.SentryShot[Projectile.type] = true; + ProjectileID.Sets.SentryShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/SquirrelSquireMinion.cs b/Projectiles/Summon/SquirrelSquireMinion.cs index e912f9c7f2..0a2a445616 100644 --- a/Projectiles/Summon/SquirrelSquireMinion.cs +++ b/Projectiles/Summon/SquirrelSquireMinion.cs @@ -131,7 +131,7 @@ namespace CalamityMod.Projectiles.Summon { Vector2 spawnPosition = Projectile.spriteDirection == -1 ? Projectile.Left : Projectile.Right; Vector2 shootVelocity = CalamityUtils.CalculatePredictiveAimToTarget(spawnPosition, Target, ProjectileVelocity); - Projectile.NewProjectileDirect( + Projectile.NewProjectile( Projectile.GetSource_FromThis(), spawnPosition, shootVelocity, diff --git a/Projectiles/Summon/StellarTorusSummon.cs b/Projectiles/Summon/StellarTorusSummon.cs index f3d67efc07..0be79f013e 100644 --- a/Projectiles/Summon/StellarTorusSummon.cs +++ b/Projectiles/Summon/StellarTorusSummon.cs @@ -263,7 +263,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; diff --git a/Projectiles/Summon/StormjawBaby.cs b/Projectiles/Summon/StormjawBaby.cs index e196726c0a..2d75e0c803 100644 --- a/Projectiles/Summon/StormjawBaby.cs +++ b/Projectiles/Summon/StormjawBaby.cs @@ -18,9 +18,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - Main.projFrames[Projectile.type] = 10; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; + Main.projFrames[Type] = 10; } public override void SetDefaults() diff --git a/Projectiles/Summon/StormjawSpark.cs b/Projectiles/Summon/StormjawSpark.cs index 6c06785a0a..4bba548bec 100644 --- a/Projectiles/Summon/StormjawSpark.cs +++ b/Projectiles/Summon/StormjawSpark.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Summon public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; // Clone of Typeless/GenericElectricSpark but specfically benefits from whips - public override void SetStaticDefaults() => ProjectileID.Sets.MinionShot[Projectile.type] = true; + public override void SetStaticDefaults() => ProjectileID.Sets.MinionShot[Type] = true; public override void SetDefaults() { diff --git a/Projectiles/Summon/SummonAstralExplosion.cs b/Projectiles/Summon/SummonAstralExplosion.cs index eb4e8d567e..8dad826d6a 100644 --- a/Projectiles/Summon/SummonAstralExplosion.cs +++ b/Projectiles/Summon/SummonAstralExplosion.cs @@ -1,6 +1,8 @@ -using Terraria; +using CalamityMod.Buffs.DamageOverTime; +using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Summon { public class SummonAstralExplosion : ModProjectile, ILocalizedModType @@ -8,8 +10,8 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; - Main.projFrames[Projectile.type] = 6; + ProjectileID.Sets.MinionShot[Type] = true; + Main.projFrames[Type] = 6; } public override void SetDefaults() @@ -18,7 +20,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.height = 48; Projectile.friendly = true; Projectile.penetrate = 2; - Projectile.timeLeft = Main.projFrames[Projectile.type] * 5; + Projectile.timeLeft = Main.projFrames[Type] * 5; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 30; Projectile.DamageType = DamageClass.Summon; @@ -31,5 +33,7 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.timeLeft % 5f == 4f) Projectile.frame++; } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); } } diff --git a/Projectiles/Summon/SummonBrimstoneExplosion.cs b/Projectiles/Summon/SummonBrimstoneExplosion.cs index f2c539e6aa..2dfde5204e 100644 --- a/Projectiles/Summon/SummonBrimstoneExplosion.cs +++ b/Projectiles/Summon/SummonBrimstoneExplosion.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; - Main.projFrames[Projectile.type] = 6; + ProjectileID.Sets.MinionShot[Type] = true; + Main.projFrames[Type] = 6; } public override void SetDefaults() @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.friendly = true; Projectile.hostile = true; Projectile.penetrate = -1; - Projectile.timeLeft = Main.projFrames[Projectile.type] * 5; + Projectile.timeLeft = Main.projFrames[Type] * 5; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; Projectile.DamageType = DamageClass.Summon; diff --git a/Projectiles/Summon/SummonBrimstoneExplosionSmall.cs b/Projectiles/Summon/SummonBrimstoneExplosionSmall.cs index f827f85f65..888231d2f1 100644 --- a/Projectiles/Summon/SummonBrimstoneExplosionSmall.cs +++ b/Projectiles/Summon/SummonBrimstoneExplosionSmall.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; - Main.projFrames[Projectile.type] = 6; + ProjectileID.Sets.MinionShot[Type] = true; + Main.projFrames[Type] = 6; } public override void SetDefaults() @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.friendly = true; Projectile.hostile = false; Projectile.penetrate = -1; - Projectile.timeLeft = Main.projFrames[Projectile.type] * 5; + Projectile.timeLeft = Main.projFrames[Type] * 5; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; } diff --git a/Projectiles/Summon/TacticalPlagueJet.cs b/Projectiles/Summon/TacticalPlagueJet.cs index 1a98dfb84c..0fad924ff2 100644 --- a/Projectiles/Summon/TacticalPlagueJet.cs +++ b/Projectiles/Summon/TacticalPlagueJet.cs @@ -19,9 +19,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 3; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; player.AddBuff(ModContent.BuffType(), 3600); diff --git a/Projectiles/Summon/TundraFlameBlossom.cs b/Projectiles/Summon/TundraFlameBlossom.cs index 2b34cb6953..8d7d4333ea 100644 --- a/Projectiles/Summon/TundraFlameBlossom.cs +++ b/Projectiles/Summon/TundraFlameBlossom.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Summon TargetNPC(potentialTarget); // Targets the NPC. Lighting.AddLight(Projectile.Center, Color.Fuchsia.ToVector3()); // Makes a light with the same color as the flowers. - Projectile.Center = Owner.Center + RotationMovement.ToRotationVector2() * 100f; // Spins around the player. + Projectile.Center = Owner.Center + RotationMovement.ToRotationVector2() * 100f + Vector2.UnitY * Owner.gfxOffY; // Spins around the player. Projectile.rotation += MathHelper.ToRadians(6.25f * Owner.direction); // Rotates around itself in the direction of the owner Projectile.scale = MathHelper.Lerp(1f, 1.005f, FlowerShootTimer % 100f); // Expands the closer it is to shooting, goes back to normal once shot; peridoically. RotationMovement += MathHelper.ToRadians(1.25f * Owner.direction); // The changing variable that moves the flower, changes directions depending on the player. diff --git a/Projectiles/Summon/TundraFlameBlossomsOrb.cs b/Projectiles/Summon/TundraFlameBlossomsOrb.cs index d1b4a55320..f818350390 100644 --- a/Projectiles/Summon/TundraFlameBlossomsOrb.cs +++ b/Projectiles/Summon/TundraFlameBlossomsOrb.cs @@ -19,9 +19,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Summon/Umbrella/MagicArrow.cs b/Projectiles/Summon/Umbrella/MagicArrow.cs index 428d4e79f8..81cb37803c 100644 --- a/Projectiles/Summon/Umbrella/MagicArrow.cs +++ b/Projectiles/Summon/Umbrella/MagicArrow.cs @@ -161,7 +161,7 @@ namespace CalamityMod.Projectiles.Summon.Umbrella public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); diff --git a/Projectiles/Summon/Umbrella/MagicAxe.cs b/Projectiles/Summon/Umbrella/MagicAxe.cs index 6e5a9657da..8c58102600 100644 --- a/Projectiles/Summon/Umbrella/MagicAxe.cs +++ b/Projectiles/Summon/Umbrella/MagicAxe.cs @@ -31,8 +31,8 @@ namespace CalamityMod.Projectiles.Summon.Umbrella public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 40; - ProjectileID.Sets.TrailingMode[Projectile.type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 40; + ProjectileID.Sets.TrailingMode[Type] = 4; } public override void SetDefaults() @@ -246,7 +246,7 @@ namespace CalamityMod.Projectiles.Summon.Umbrella public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); diff --git a/Projectiles/Summon/Umbrella/MagicBird.cs b/Projectiles/Summon/Umbrella/MagicBird.cs index 2941ed51a6..33389e5744 100644 --- a/Projectiles/Summon/Umbrella/MagicBird.cs +++ b/Projectiles/Summon/Umbrella/MagicBird.cs @@ -10,11 +10,11 @@ namespace CalamityMod.Projectiles.Summon.Umbrella public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 7; + Main.projFrames[Type] = 7; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -128,7 +128,7 @@ namespace CalamityMod.Projectiles.Summon.Umbrella public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Summon/Umbrella/MagicBullet.cs b/Projectiles/Summon/Umbrella/MagicBullet.cs index 10938fe054..d65f48bb37 100644 --- a/Projectiles/Summon/Umbrella/MagicBullet.cs +++ b/Projectiles/Summon/Umbrella/MagicBullet.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Projectiles.Summon.Umbrella public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.MinionShot[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Summon.Umbrella if (Projectile.alpha != 0) return false; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = texture.Frame(1, 1, 0, 0); Vector2 origin = frame.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); @@ -81,7 +81,7 @@ namespace CalamityMod.Projectiles.Summon.Umbrella Main.spriteBatch.Draw(texture, drawPosition, frame, Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); // Draw Afterimages - CalamityUtils.DrawAfterimagesFromEdge(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor); + CalamityUtils.DrawAfterimagesFromEdge(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); return false; } } diff --git a/Projectiles/Summon/Umbrella/MagicBulletBig.cs b/Projectiles/Summon/Umbrella/MagicBulletBig.cs index 5a0b5c307c..4c6080aca4 100644 --- a/Projectiles/Summon/Umbrella/MagicBulletBig.cs +++ b/Projectiles/Summon/Umbrella/MagicBulletBig.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Projectiles.Summon.Umbrella public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.MinionShot[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Summon.Umbrella if (Projectile.alpha != 0) return false; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = texture.Frame(1, 1, 0, 0); Vector2 origin = frame.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Summon.Umbrella Main.spriteBatch.Draw(texture, drawPosition, frame, Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); // Draw Afterimages - CalamityUtils.DrawAfterimagesFromEdge(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor); + CalamityUtils.DrawAfterimagesFromEdge(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor); return false; } } diff --git a/Projectiles/Summon/Umbrella/MagicBunny.cs b/Projectiles/Summon/Umbrella/MagicBunny.cs index c2bb997aa2..fd493f033b 100644 --- a/Projectiles/Summon/Umbrella/MagicBunny.cs +++ b/Projectiles/Summon/Umbrella/MagicBunny.cs @@ -12,9 +12,9 @@ namespace CalamityMod.Projectiles.Summon.Umbrella public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/Umbrella/MagicHammer.cs b/Projectiles/Summon/Umbrella/MagicHammer.cs index d38ce96b8d..dbfb69f4b1 100644 --- a/Projectiles/Summon/Umbrella/MagicHammer.cs +++ b/Projectiles/Summon/Umbrella/MagicHammer.cs @@ -34,8 +34,8 @@ namespace CalamityMod.Projectiles.Summon.Umbrella public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 40; - ProjectileID.Sets.TrailingMode[Projectile.type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 40; + ProjectileID.Sets.TrailingMode[Type] = 4; } public override void SetDefaults() @@ -311,7 +311,7 @@ namespace CalamityMod.Projectiles.Summon.Umbrella public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); diff --git a/Projectiles/Summon/Umbrella/MagicHat.cs b/Projectiles/Summon/Umbrella/MagicHat.cs index 3da5df70a1..367a495d61 100644 --- a/Projectiles/Summon/Umbrella/MagicHat.cs +++ b/Projectiles/Summon/Umbrella/MagicHat.cs @@ -18,10 +18,11 @@ namespace CalamityMod.Projectiles.Summon.Umbrella public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + Main.projPet[Type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -126,7 +127,7 @@ namespace CalamityMod.Projectiles.Summon.Umbrella Player player = Main.player[Projectile.owner]; // Use a different texture if the player is invisible or has at least 50% stealth - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; float stealthPercent = player.Calamity().rogueStealthMax != 0 ? (player.Calamity().rogueStealth / player.Calamity().rogueStealthMax) : 0f; //0 to 1 bool hasStealth = player.Calamity().rogueStealth > 0f && stealthPercent > 0.5f && player.townNPCs < 3f && CalamityClientConfig.Instance.StealthInvisibility; if (player.ShouldNotDraw || hasStealth) diff --git a/Projectiles/Summon/Umbrella/MagicRifle.cs b/Projectiles/Summon/Umbrella/MagicRifle.cs index 292020898d..cd8b8b46d0 100644 --- a/Projectiles/Summon/Umbrella/MagicRifle.cs +++ b/Projectiles/Summon/Umbrella/MagicRifle.cs @@ -33,8 +33,8 @@ namespace CalamityMod.Projectiles.Summon.Umbrella public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 40; - ProjectileID.Sets.TrailingMode[Projectile.type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 40; + ProjectileID.Sets.TrailingMode[Type] = 4; } public override void SetDefaults() @@ -280,7 +280,7 @@ namespace CalamityMod.Projectiles.Summon.Umbrella public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); diff --git a/Projectiles/Summon/Umbrella/MagicTree.cs b/Projectiles/Summon/Umbrella/MagicTree.cs index a02cfacb31..725df0f5ca 100644 --- a/Projectiles/Summon/Umbrella/MagicTree.cs +++ b/Projectiles/Summon/Umbrella/MagicTree.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Summon.Umbrella public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -165,7 +165,7 @@ namespace CalamityMod.Projectiles.Summon.Umbrella if (Projectile.ai[1] == 0f) return false; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; switch (TreeType) { case Tree.Astral: diff --git a/Projectiles/Summon/Umbrella/MagicUmbrella.cs b/Projectiles/Summon/Umbrella/MagicUmbrella.cs index c15f6f8102..093f93a876 100644 --- a/Projectiles/Summon/Umbrella/MagicUmbrella.cs +++ b/Projectiles/Summon/Umbrella/MagicUmbrella.cs @@ -28,8 +28,8 @@ namespace CalamityMod.Projectiles.Summon.Umbrella public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 40; - ProjectileID.Sets.TrailingMode[Projectile.type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 40; + ProjectileID.Sets.TrailingMode[Type] = 4; } public override void SetDefaults() @@ -333,7 +333,7 @@ namespace CalamityMod.Projectiles.Summon.Umbrella public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); diff --git a/Projectiles/Summon/UniverseSplitterHugeBeam.cs b/Projectiles/Summon/UniverseSplitterHugeBeam.cs index ee2d47c20a..0d4b0b518f 100644 --- a/Projectiles/Summon/UniverseSplitterHugeBeam.cs +++ b/Projectiles/Summon/UniverseSplitterHugeBeam.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { ProjectileID.Sets.DrawScreenCheckFluff[Type] = 12000; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/UniverseSplitterSmallBeam.cs b/Projectiles/Summon/UniverseSplitterSmallBeam.cs index 16edc6ca77..e8fc84e72c 100644 --- a/Projectiles/Summon/UniverseSplitterSmallBeam.cs +++ b/Projectiles/Summon/UniverseSplitterSmallBeam.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { ProjectileID.Sets.DrawScreenCheckFluff[Type] = 12000; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/UrchinSpike.cs b/Projectiles/Summon/UrchinSpike.cs index 86f95b21ca..bb7dd11f81 100644 --- a/Projectiles/Summon/UrchinSpike.cs +++ b/Projectiles/Summon/UrchinSpike.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/Valkyrie.cs b/Projectiles/Summon/Valkyrie.cs index 82120f71b2..ddcf3733dc 100644 --- a/Projectiles/Summon/Valkyrie.cs +++ b/Projectiles/Summon/Valkyrie.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -97,8 +97,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, spriteEffects, 0); return false; diff --git a/Projectiles/Summon/VictideSeaSnail.cs b/Projectiles/Summon/VictideSeaSnail.cs index 52e1cc5bf2..64a6a06fbe 100644 --- a/Projectiles/Summon/VictideSeaSnail.cs +++ b/Projectiles/Summon/VictideSeaSnail.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - Main.projFrames[Projectile.type] = 7; + ProjectileID.Sets.MinionSacrificable[Type] = true; + Main.projFrames[Type] = 7; } public override void SetDefaults() @@ -216,7 +216,7 @@ namespace CalamityMod.Projectiles.Summon { Player owner = Main.player[Projectile.owner]; - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = new Rectangle(0, 36 * Projectile.frame, 38, 34); Vector2 origin = !CanComePeekOut ? new Vector2(15, 23) : frame.Size() / 2f; diff --git a/Projectiles/Summon/VileFeederSummon.cs b/Projectiles/Summon/VileFeederSummon.cs index e3ee0abc14..d17ed5e292 100644 --- a/Projectiles/Summon/VileFeederSummon.cs +++ b/Projectiles/Summon/VileFeederSummon.cs @@ -17,9 +17,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 3; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -261,8 +261,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = texture.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Summon/ViridVanguardBlade.cs b/Projectiles/Summon/ViridVanguardBlade.cs index 260d3e8e78..d8180d7698 100644 --- a/Projectiles/Summon/ViridVanguardBlade.cs +++ b/Projectiles/Summon/ViridVanguardBlade.cs @@ -361,7 +361,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition; diff --git a/Projectiles/Summon/VoidConcentrationAura.cs b/Projectiles/Summon/VoidConcentrationAura.cs index 371dc5272b..051bfc1b6a 100644 --- a/Projectiles/Summon/VoidConcentrationAura.cs +++ b/Projectiles/Summon/VoidConcentrationAura.cs @@ -12,6 +12,8 @@ namespace CalamityMod.Projectiles.Summon public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public int timer = 0; + public override void SetStaticDefaults() => Main.projPet[Type] = true; + public override void SetDefaults() { Projectile.width = 46; @@ -67,7 +69,7 @@ namespace CalamityMod.Projectiles.Summon mp.voidAura = false; Projectile.Kill(); } - if (owner.whoAmI == Main.myPlayer && owner.ownedProjectileCounts[Projectile.type] <= 25 && timer > 0 && timer % 4 == 0) + if (owner.whoAmI == Main.myPlayer && owner.ownedProjectileCounts[Type] <= 25 && timer > 0 && timer % 4 == 0) { NPC target = CalamityUtils.MinionHoming(Projectile.Center, 1800f, owner); if (target != null) diff --git a/Projectiles/Summon/VoidConcentrationBlackhole.cs b/Projectiles/Summon/VoidConcentrationBlackhole.cs index b92eae0d7f..b79ca5a550 100644 --- a/Projectiles/Summon/VoidConcentrationBlackhole.cs +++ b/Projectiles/Summon/VoidConcentrationBlackhole.cs @@ -27,9 +27,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionShot[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionShot[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -125,9 +125,9 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - int height = texture.Height / Main.projFrames[Projectile.type]; + int height = texture.Height / Main.projFrames[Type]; int frameHeight = height * Projectile.frame; Rectangle rectangle = new Rectangle(0, frameHeight, texture.Width, height); Vector2 origin = new Vector2(texture.Width / 2f, height / 2f); @@ -160,7 +160,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type] - 1) + if (Projectile.frame >= Main.projFrames[Type] - 1) { Projectile.frame = 0; } diff --git a/Projectiles/Summon/VoidConcentrationOrb.cs b/Projectiles/Summon/VoidConcentrationOrb.cs index 730915ff8f..7de9d93ea7 100644 --- a/Projectiles/Summon/VoidConcentrationOrb.cs +++ b/Projectiles/Summon/VoidConcentrationOrb.cs @@ -11,10 +11,10 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type] - 1) + if (Projectile.frame >= Main.projFrames[Type] - 1) { Projectile.frame = 0; } diff --git a/Projectiles/Summon/VolcanicFireballSummon.cs b/Projectiles/Summon/VolcanicFireballSummon.cs index 203f191d63..3bdb255644 100644 --- a/Projectiles/Summon/VolcanicFireballSummon.cs +++ b/Projectiles/Summon/VolcanicFireballSummon.cs @@ -12,10 +12,10 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.MinionShot[Projectile.type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionShot[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Summon { Projectile.frame++; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.timeLeft == 300) return false; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Summon/WaterElementalMinion.cs b/Projectiles/Summon/WaterElementalMinion.cs index 86e7a1de94..2e5ea2d82f 100644 --- a/Projectiles/Summon/WaterElementalMinion.cs +++ b/Projectiles/Summon/WaterElementalMinion.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 6; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/WaterElementalSong.cs b/Projectiles/Summon/WaterElementalSong.cs index b5725388d7..6cb4b317d4 100644 --- a/Projectiles/Summon/WaterElementalSong.cs +++ b/Projectiles/Summon/WaterElementalSong.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Summon/WaterSpearFriendly.cs b/Projectiles/Summon/WaterSpearFriendly.cs index c13ae788a4..55ad239937 100644 --- a/Projectiles/Summon/WaterSpearFriendly.cs +++ b/Projectiles/Summon/WaterSpearFriendly.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; + ProjectileID.Sets.MinionShot[Type] = true; } public override void SetDefaults() @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/WhiteDragonHead.cs b/Projectiles/Summon/WhiteDragonHead.cs index 0915f26c63..421192a221 100644 --- a/Projectiles/Summon/WhiteDragonHead.cs +++ b/Projectiles/Summon/WhiteDragonHead.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Projectiles.Summon Dictionary segments = new Dictionary(); public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -40,8 +41,8 @@ namespace CalamityMod.Projectiles.Summon Projectile.minionSlots = 2; Projectile.minion = true; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 100; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 100; } public override void AI() @@ -184,7 +185,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D texBody = ModContent.Request("CalamityMod/Projectiles/Summon/WhiteDragonBody").Value; Texture2D texBody2 = ModContent.Request("CalamityMod/Projectiles/Summon/WhiteDragonBody2").Value; Texture2D texTail = ModContent.Request("CalamityMod/Projectiles/Summon/WhiteDragonTail").Value; diff --git a/Projectiles/Summon/WitherBlossom.cs b/Projectiles/Summon/WitherBlossom.cs index f52b50ed24..833562f02a 100644 --- a/Projectiles/Summon/WitherBlossom.cs +++ b/Projectiles/Summon/WitherBlossom.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Summon public override void MinionAI() { - Projectile.Center = Owner.Center + OffsetAngle.ToRotationVector2() * 150f; + Projectile.Center = Owner.Center + OffsetAngle.ToRotationVector2() * 150f + Vector2.UnitY * Owner.gfxOffY; Time++; if (Time % 50 == 49 && Main.myPlayer == Projectile.owner && Target != null) diff --git a/Projectiles/Summon/WitherBolt.cs b/Projectiles/Summon/WitherBolt.cs index b6c4934c04..6711988904 100644 --- a/Projectiles/Summon/WitherBolt.cs +++ b/Projectiles/Summon/WitherBolt.cs @@ -11,6 +11,8 @@ namespace CalamityMod.Projectiles.Summon { public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "CalamityMod/Projectiles/StarProj"; + public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; @@ -54,7 +56,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D boltTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D boltTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; for (int i = 0; i < Projectile.oldPos.Length; i++) { float completionRatio = i / (float)Projectile.oldPos.Length; diff --git a/Projectiles/Summon/WitherBolt.png b/Projectiles/Summon/WitherBolt.png deleted file mode 100644 index 0968156e79..0000000000 Binary files a/Projectiles/Summon/WitherBolt.png and /dev/null differ diff --git a/Projectiles/Summon/WulfrumDroid.cs b/Projectiles/Summon/WulfrumDroid.cs index 1a5083b4db..a71d1b10fa 100644 --- a/Projectiles/Summon/WulfrumDroid.cs +++ b/Projectiles/Summon/WulfrumDroid.cs @@ -98,9 +98,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 12; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 12; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -177,7 +177,7 @@ namespace CalamityMod.Projectiles.Summon bool buffMode = BuffModeBuffer <= 0; //Do frame stuff i guess - Projectile.frame = Projectile.frame % (Main.projFrames[Projectile.type] / 2); + Projectile.frame = Projectile.frame % (Main.projFrames[Type] / 2); Projectile.frameCounter++; if (Projectile.frameCounter > 8) @@ -185,13 +185,13 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type] / 2) + if (Projectile.frame >= Main.projFrames[Type] / 2) { Projectile.frame = 0; } if (buffMode) - Projectile.frame += Main.projFrames[Projectile.type] / 2; + Projectile.frame += Main.projFrames[Type] / 2; //Buff stuff diff --git a/Projectiles/Summon/WulfrumEnergyBurst.cs b/Projectiles/Summon/WulfrumEnergyBurst.cs index 836cfab051..3aa9aab80d 100644 --- a/Projectiles/Summon/WulfrumEnergyBurst.cs +++ b/Projectiles/Summon/WulfrumEnergyBurst.cs @@ -44,9 +44,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - ProjectileID.Sets.MinionShot[Projectile.type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.MinionShot[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -189,7 +189,7 @@ namespace CalamityMod.Projectiles.Summon Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; float stretchy = MathHelper.Clamp((Projectile.velocity.Length() - 6f) / 16f, 0f, 1f); Vector2 scale = new Vector2(1f + stretchy * -0.2f, stretchy * 0.5f + 1f); Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation + MathHelper.PiOver2, tex.Size() / 2f, Projectile.scale * scale, SpriteEffects.None, 0); diff --git a/Projectiles/Summon/WulfrumFusionBolt.cs b/Projectiles/Summon/WulfrumFusionBolt.cs index 056314dfca..6b1d5808af 100644 --- a/Projectiles/Summon/WulfrumFusionBolt.cs +++ b/Projectiles/Summon/WulfrumFusionBolt.cs @@ -47,8 +47,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() diff --git a/Projectiles/Summon/YharonMinionFireball.cs b/Projectiles/Summon/YharonMinionFireball.cs index 6f43faf571..de570b3bec 100644 --- a/Projectiles/Summon/YharonMinionFireball.cs +++ b/Projectiles/Summon/YharonMinionFireball.cs @@ -15,11 +15,11 @@ namespace CalamityMod.Projectiles.Summon public override string Texture => "CalamityMod/Projectiles/Boss/YharonFireball"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - ProjectileID.Sets.MinionShot[Projectile.type] = true; + Main.projFrames[Type] = 5; + ProjectileID.Sets.MinionShot[Type] = true; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 8; } public override void SetDefaults() @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Projectile.type]; + Projectile.frame = Projectile.frameCounter / 5 % Main.projFrames[Type]; Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; Projectile.Opacity = MathHelper.Clamp(Projectile.Opacity + 0.075f, 0f, 1f); @@ -59,8 +59,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Rectangle frame = texture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); SpriteEffects direction = SpriteEffects.None; if (Projectile.spriteDirection == -1) direction = SpriteEffects.FlipHorizontally; diff --git a/Projectiles/Turret/FireShot.cs b/Projectiles/Turret/FireShot.cs index 563e0b7c6c..f6f40c8d53 100644 --- a/Projectiles/Turret/FireShot.cs +++ b/Projectiles/Turret/FireShot.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Turret public bool ableToHit = true; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 16; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 16; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Turret public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.OnFire3, 600); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.OnFire3, 100); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.OnFire, 300); public override bool? CanDamage() => ableToHit ? (bool?)null : false; diff --git a/Projectiles/Turret/IceExplosion.cs b/Projectiles/Turret/IceExplosion.cs index f26d9ac54b..9b8a1cf7c9 100644 --- a/Projectiles/Turret/IceExplosion.cs +++ b/Projectiles/Turret/IceExplosion.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Turret return; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 origin = texture.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition; float opacity = 0.9f; diff --git a/Projectiles/Turret/IceShot.cs b/Projectiles/Turret/IceShot.cs index cbe9c9193d..bef1dc5cb2 100644 --- a/Projectiles/Turret/IceShot.cs +++ b/Projectiles/Turret/IceShot.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Turret public override void OnHitPlayer(Player target, Player.HurtInfo info) { target.AddBuff(ModContent.BuffType(), 30); - target.AddBuff(BuffID.Frostburn2, 180); + target.AddBuff(BuffID.Frostburn, 180); if (Projectile.hostile && Main.netMode == NetmodeID.MultiplayerClient) //hostile version pierces through players in multiplayer return; Projectile.Kill(); diff --git a/Projectiles/Turret/LaserShot.cs b/Projectiles/Turret/LaserShot.cs index 72a11e960f..ae852dfc63 100644 --- a/Projectiles/Turret/LaserShot.cs +++ b/Projectiles/Turret/LaserShot.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Turret public NPC struckNPC = null; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; } public override void SetDefaults() @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Turret { // This is the drawcode from surge driver // Start texture drawing. - Rectangle beginFrame = LaserBeginTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Rectangle beginFrame = LaserBeginTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Main.EntitySpriteDraw(LaserBeginTexture, Projectile.Center - Main.screenPosition, beginFrame, @@ -91,14 +91,14 @@ namespace CalamityMod.Projectiles.Turret // Prepare things for body drawing. float laserBodyLength = LaserLength; - laserBodyLength -= (LaserBeginTexture.Height * 0.5f + LaserEndTexture.Height) * Projectile.scale / Main.projFrames[Projectile.type]; + laserBodyLength -= (LaserBeginTexture.Height * 0.5f + LaserEndTexture.Height) * Projectile.scale / Main.projFrames[Type]; Vector2 centerOnLaser = Projectile.Center; // Body drawing. - Rectangle middleFrame = LaserMiddleTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Rectangle middleFrame = LaserMiddleTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); if (laserBodyLength > 30f) { - float laserOffset = (LaserMiddleTexture.Height - 10f) * Projectile.scale / Main.projFrames[Projectile.type]; + float laserOffset = (LaserMiddleTexture.Height - 10f) * Projectile.scale / Main.projFrames[Type]; float incrementalBodyLength = 0f; while (incrementalBodyLength + 1f < laserBodyLength) { @@ -117,7 +117,7 @@ namespace CalamityMod.Projectiles.Turret } // End texture drawing. - Rectangle endFrame = LaserEndTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Rectangle endFrame = LaserEndTexture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 laserEndCenter = centerOnLaser - Main.screenPosition; Main.EntitySpriteDraw(LaserEndTexture, laserEndCenter, diff --git a/Projectiles/Turret/OnyxShot.cs b/Projectiles/Turret/OnyxShot.cs index ecbfb2d06f..a1b6c4716c 100644 --- a/Projectiles/Turret/OnyxShot.cs +++ b/Projectiles/Turret/OnyxShot.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Turret public bool ableToHit = true; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() diff --git a/Projectiles/Turret/PlagueExplosionGas.cs b/Projectiles/Turret/PlagueExplosionGas.cs index fa76879a54..a4102fba0f 100644 --- a/Projectiles/Turret/PlagueExplosionGas.cs +++ b/Projectiles/Turret/PlagueExplosionGas.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Turret return; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 origin = texture.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition; float opacity = 1f; diff --git a/Projectiles/Turret/WaterShot.cs b/Projectiles/Turret/WaterShot.cs index bf3555dee9..2ec3d66d03 100644 --- a/Projectiles/Turret/WaterShot.cs +++ b/Projectiles/Turret/WaterShot.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Turret public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() diff --git a/Projectiles/Typeless/ArcZap.cs b/Projectiles/Typeless/ArcZap.cs index 4a66e6b033..15c838ea73 100644 --- a/Projectiles/Typeless/ArcZap.cs +++ b/Projectiles/Typeless/ArcZap.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Typeless public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 90; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 90; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() diff --git a/Projectiles/Typeless/ArtifactOfResilienceShards.cs b/Projectiles/Typeless/ArtifactOfResilienceShards.cs index 782c9d73ab..a9f0af6ded 100644 --- a/Projectiles/Typeless/ArtifactOfResilienceShards.cs +++ b/Projectiles/Typeless/ArtifactOfResilienceShards.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Typeless public const float MaxRadius = 240f; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 1; + Main.projFrames[Type] = 1; } public override void SetDefaults() @@ -146,7 +146,7 @@ namespace CalamityMod.Projectiles.Typeless public const float MaxRadius = 660f; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 1; + Main.projFrames[Type] = 1; } public override void SetDefaults() @@ -185,7 +185,7 @@ namespace CalamityMod.Projectiles.Typeless public const float MaxRadius = 660f; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 1; + Main.projFrames[Type] = 1; } public override void SetDefaults() @@ -223,7 +223,7 @@ namespace CalamityMod.Projectiles.Typeless public const float MaxRadius = 660f; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 1; + Main.projFrames[Type] = 1; } public override void SetDefaults() @@ -261,7 +261,7 @@ namespace CalamityMod.Projectiles.Typeless public const float MaxRadius = 660f; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 1; + Main.projFrames[Type] = 1; } public override void SetDefaults() @@ -299,7 +299,7 @@ namespace CalamityMod.Projectiles.Typeless public const float MaxRadius = 660f; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 1; + Main.projFrames[Type] = 1; } public override void SetDefaults() diff --git a/Projectiles/Typeless/AstralStar.cs b/Projectiles/Typeless/AstralStar.cs index fed26b266e..c393d028f3 100644 --- a/Projectiles/Typeless/AstralStar.cs +++ b/Projectiles/Typeless/AstralStar.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -139,7 +139,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { Projectile.DrawStarTrail(Color.Coral, Color.White); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Typeless/BasicPlagueBee.cs b/Projectiles/Typeless/BasicPlagueBee.cs index c60a1d85f3..584818b179 100644 --- a/Projectiles/Typeless/BasicPlagueBee.cs +++ b/Projectiles/Typeless/BasicPlagueBee.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Typeless public int tileCollisions = 0; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; } @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Typeless Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -183,8 +183,8 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int frameHeight = texture.Height / Main.projFrames[Type]; int drawStart = frameHeight * Projectile.frame; SpriteEffects spriteEffects = SpriteEffects.None; if (Projectile.spriteDirection == -1) diff --git a/Projectiles/Typeless/BlazingStarHeal.cs b/Projectiles/Typeless/BlazingStarHeal.cs index 3fc91c4f9f..e8c2d75b79 100644 --- a/Projectiles/Typeless/BlazingStarHeal.cs +++ b/Projectiles/Typeless/BlazingStarHeal.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - Texture2D starTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D starTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Color healGreen = new Color(54, 209, 54, 0); Vector2 projPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); Color healGreenDraw = healGreen; diff --git a/Projectiles/Typeless/BlazingStarThatDoesNotHeal.cs b/Projectiles/Typeless/BlazingStarThatDoesNotHeal.cs index 1498b0c95f..3414996386 100644 --- a/Projectiles/Typeless/BlazingStarThatDoesNotHeal.cs +++ b/Projectiles/Typeless/BlazingStarThatDoesNotHeal.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Typeless { float lerpMult = Utils.GetLerpValue(15f, 30f, Projectile.timeLeft, clamped: true) * Utils.GetLerpValue(240f, 200f, Projectile.timeLeft, clamped: true) * (1f + 0.2f * (float)Math.Cos(Main.GlobalTimeWrappedHourly % 30f / 0.5f * (MathHelper.Pi * 2f) * 3f)) * 0.8f; - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); Color baseColor = new Color(250, 100, 100, 255); baseColor *= 0.5f; diff --git a/Projectiles/Typeless/BlunderBoosterAura.cs b/Projectiles/Typeless/BlunderBoosterAura.cs index 9ef3c27837..4a534b93c1 100644 --- a/Projectiles/Typeless/BlunderBoosterAura.cs +++ b/Projectiles/Typeless/BlunderBoosterAura.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; } public override void SetDefaults() @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - Texture2D sprite = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D sprite = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Color drawColour = Color.White; Rectangle sourceRect = new Rectangle(Projectile.width * (int)Projectile.localAI[1], Projectile.height * (int)Projectile.localAI[0], Projectile.width, Projectile.height); diff --git a/Projectiles/Typeless/BobbitHead.cs b/Projectiles/Typeless/BobbitHead.cs index c49a121a9c..58add5c52b 100644 --- a/Projectiles/Typeless/BobbitHead.cs +++ b/Projectiles/Typeless/BobbitHead.cs @@ -1,5 +1,7 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Items.Tools; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,14 +12,15 @@ namespace CalamityMod.Projectiles.Typeless public class BobbitHead : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Typeless"; - public const float PullSpeed = 24f; - public const float ReelbackSpeed = 28f; - public const float LaunchSpeed = 25f; - public const float GrappleRangInTiles = 40f; - public override void SetDefaults() - { - Projectile.CloneDefaults(ProjectileID.GemHookAmethyst); - } + + public static Asset Chain; + public override void Load() => Chain = Request("CalamityMod/Projectiles/Typeless/BobbitHookChain"); + + public override void SetDefaults() => Projectile.CloneDefaults(ProjectileID.GemHookAmethyst); + + public override float GrappleRange() => BobbitHook.Reach * 16f; + public override void GrappleRetreatSpeed(Player player, ref float speed) => speed = BobbitHook.ReelbackSpeed; + public override void GrapplePullSpeed(Player player, ref float speed) => speed = BobbitHook.PullSpeed; // Use this hook for hooks that can have multiple hooks mid-flight: Dual Hook, Web Slinger, Fish Hook, Static Hook, Lunar Hook public override bool? CanUseGrapple(Player player) @@ -36,31 +39,9 @@ namespace CalamityMod.Projectiles.Typeless } return true; } + public override void NumGrappleHooks(Player player, ref int numHooks) => numHooks = 1; - // Amethyst Hook is 300, Static Hook is 600, 16f = 1 tile - public override float GrappleRange() => GrappleRangInTiles * 16f; - - public override void NumGrappleHooks(Player player, ref int numHooks) - { - numHooks = 1; - } - - // default is 11, Lunar is 24 - public override void GrappleRetreatSpeed(Player player, ref float speed) - { - speed = ReelbackSpeed; - } - - public override void GrapplePullSpeed(Player player, ref float speed) - { - speed = PullSpeed; - } - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawHook(Projectile, Request("CalamityMod/Projectiles/Typeless/BobbitHookChain").Value); - return true; - } + public override bool PreDraw(ref Color lightColor) => Projectile.DrawHook(Chain.Value); public override void AI() { diff --git a/Projectiles/Typeless/ChaoticGeyser.cs b/Projectiles/Typeless/ChaoticGeyser.cs index b3eabf5aef..174b62342d 100644 --- a/Projectiles/Typeless/ChaoticGeyser.cs +++ b/Projectiles/Typeless/ChaoticGeyser.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Typeless { int cap = 3; float capDamageFactor = 0.05f; - int excessCount = Main.player[Projectile.owner].ownedProjectileCounts[Projectile.type] - cap; + int excessCount = Main.player[Projectile.owner].ownedProjectileCounts[Type] - cap; modifiers.SourceDamage *= MathHelper.Clamp(1f - (capDamageFactor * excessCount), 0f, 1f); } diff --git a/Projectiles/Typeless/ChlorophyteLifePulse.cs b/Projectiles/Typeless/ChlorophyteLifePulse.cs index 32d4f715df..98e98e702e 100644 --- a/Projectiles/Typeless/ChlorophyteLifePulse.cs +++ b/Projectiles/Typeless/ChlorophyteLifePulse.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Color drawColor = Projectile.GetAlpha(lightColor) * 0.4f; for (int i = 0; i < 8; i++) { diff --git a/Projectiles/Typeless/ChronoClock.cs b/Projectiles/Typeless/ChronoClock.cs index 565a8ed14a..b699426f5d 100644 --- a/Projectiles/Typeless/ChronoClock.cs +++ b/Projectiles/Typeless/ChronoClock.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 8; + Main.projFrames[Type] = 8; } diff --git a/Projectiles/Typeless/CoralBubble.cs b/Projectiles/Typeless/CoralBubble.cs index c3218486a7..9d4cd5e92e 100644 --- a/Projectiles/Typeless/CoralBubble.cs +++ b/Projectiles/Typeless/CoralBubble.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Typeless/CoralBubbleSmall.cs b/Projectiles/Typeless/CoralBubbleSmall.cs index 1ab46a05b0..d6bc051dae 100644 --- a/Projectiles/Typeless/CoralBubbleSmall.cs +++ b/Projectiles/Typeless/CoralBubbleSmall.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Typeless/CryonicShield.cs b/Projectiles/Typeless/CryonicShield.cs index cf4f131080..d32a00d7f5 100644 --- a/Projectiles/Typeless/CryonicShield.cs +++ b/Projectiles/Typeless/CryonicShield.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; } public override void SetDefaults() diff --git a/Projectiles/Typeless/CursorProj.cs b/Projectiles/Typeless/CursorProj.cs index dc51a83b5f..a84c07f3e1 100644 --- a/Projectiles/Typeless/CursorProj.cs +++ b/Projectiles/Typeless/CursorProj.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -179,7 +179,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Typeless/CursorProjSplit.cs b/Projectiles/Typeless/CursorProjSplit.cs index ccac361080..3c2174243a 100644 --- a/Projectiles/Typeless/CursorProjSplit.cs +++ b/Projectiles/Typeless/CursorProjSplit.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -181,7 +181,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } diff --git a/Projectiles/Typeless/CyanLabSeeker.cs b/Projectiles/Typeless/CyanLabSeeker.cs index f876fb8975..07f7da0ee5 100644 --- a/Projectiles/Typeless/CyanLabSeeker.cs +++ b/Projectiles/Typeless/CyanLabSeeker.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 20; } public override void SetDefaults() @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (Time > 80f && Projectile.ai[1] == 0f) { for (int i = 0; i < 24; i += 2) diff --git a/Projectiles/Typeless/DemonshadeRedDevil.cs b/Projectiles/Typeless/DemonshadeRedDevil.cs index df25b38ec2..2e1a342110 100644 --- a/Projectiles/Typeless/DemonshadeRedDevil.cs +++ b/Projectiles/Typeless/DemonshadeRedDevil.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 5; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -254,8 +254,8 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, spriteEffects, 0); return false; diff --git a/Projectiles/Typeless/EmpyreanStellarDetritus.cs b/Projectiles/Typeless/EmpyreanStellarDetritus.cs index 675d6cd6da..0e33d4b217 100644 --- a/Projectiles/Typeless/EmpyreanStellarDetritus.cs +++ b/Projectiles/Typeless/EmpyreanStellarDetritus.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Typeless/EnergyShell.cs b/Projectiles/Typeless/EnergyShell.cs index 291cd761a3..7850d6aadb 100644 --- a/Projectiles/Typeless/EnergyShell.cs +++ b/Projectiles/Typeless/EnergyShell.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; + Main.projFrames[Type] = 6; } public override void SetDefaults() diff --git a/Projectiles/Typeless/FlameLickedBarrage.cs b/Projectiles/Typeless/FlameLickedBarrage.cs index 494f9b6096..f94d416372 100644 --- a/Projectiles/Typeless/FlameLickedBarrage.cs +++ b/Projectiles/Typeless/FlameLickedBarrage.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Typeless { lightColor.R = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Typeless/FlameLickedHellblast.cs b/Projectiles/Typeless/FlameLickedHellblast.cs index d9071df464..944ca206b1 100644 --- a/Projectiles/Typeless/FlameLickedHellblast.cs +++ b/Projectiles/Typeless/FlameLickedHellblast.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Projectiles.Typeless public override string Texture => "CalamityMod/Projectiles/Boss/BrimstoneHellblast"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + Main.projFrames[Type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Typeless { lightColor.R = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Typeless/FuckYou.cs b/Projectiles/Typeless/FuckYou.cs index 67aef36b36..76dee98268 100644 --- a/Projectiles/Typeless/FuckYou.cs +++ b/Projectiles/Typeless/FuckYou.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Typeless public new string LocalizationCategory => "Projectiles.Typeless"; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; } public override void SetDefaults() @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Typeless Projectile.ai[1] += 0.01f; Projectile.scale = Projectile.ai[1] * 0.5f; Projectile.ai[0] += 1f; - if (Projectile.ai[0] >= (float)(3 * Main.projFrames[Projectile.type])) + if (Projectile.ai[0] >= (float)(3 * Main.projFrames[Type])) { Projectile.Kill(); return; @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Typeless Projectile.frameCounter = 0; incrementer = Projectile.frame + 1; Projectile.frame = incrementer; - if (incrementer >= Main.projFrames[Projectile.type]) + if (incrementer >= Main.projFrames[Type]) { Projectile.hide = true; } diff --git a/Projectiles/Typeless/FungalClumpMinion.cs b/Projectiles/Typeless/FungalClumpMinion.cs index 4b5c5923b8..ba09c8d1a9 100644 --- a/Projectiles/Typeless/FungalClumpMinion.cs +++ b/Projectiles/Typeless/FungalClumpMinion.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + Main.projFrames[Type] = 6; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; } public override void SetDefaults() @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Typeless Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Typeless/GemTechArmorGem.cs b/Projectiles/Typeless/GemTechArmorGem.cs index 8fc477ff90..d31ffe8079 100644 --- a/Projectiles/Typeless/GemTechArmorGem.cs +++ b/Projectiles/Typeless/GemTechArmorGem.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 20; } public override void SetDefaults() @@ -148,7 +148,7 @@ namespace CalamityMod.Projectiles.Typeless { case (int)GemTechArmorGemType.Melee: default: - texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; break; case (int)GemTechArmorGemType.Ranged: texture = ModContent.Request("CalamityMod/Projectiles/Typeless/GemTechGreenGem").Value; @@ -180,7 +180,7 @@ namespace CalamityMod.Projectiles.Typeless public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { Projectile.velocity = Vector2.Zero; - Projectile.timeLeft = ProjectileID.Sets.TrailCacheLength[Projectile.type]; + Projectile.timeLeft = ProjectileID.Sets.TrailCacheLength[Type]; Projectile.netUpdate = true; } } diff --git a/Projectiles/Typeless/GodKiller.cs b/Projectiles/Typeless/GodKiller.cs index 3fcb907ad8..13cfd33eec 100644 --- a/Projectiles/Typeless/GodKiller.cs +++ b/Projectiles/Typeless/GodKiller.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; } public override void SetDefaults() @@ -110,7 +110,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Typeless/GreenLabSeeker.cs b/Projectiles/Typeless/GreenLabSeeker.cs index f9cadeddd6..65a48dec84 100644 --- a/Projectiles/Typeless/GreenLabSeeker.cs +++ b/Projectiles/Typeless/GreenLabSeeker.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 20; } public override void SetDefaults() @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (Time > 80f && Projectile.ai[1] == 0f) { for (int i = 0; i < 24; i += 2) diff --git a/Projectiles/Typeless/JewelSpike.cs b/Projectiles/Typeless/JewelSpike.cs index ae5ea54418..a2de1dd804 100644 --- a/Projectiles/Typeless/JewelSpike.cs +++ b/Projectiles/Typeless/JewelSpike.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; } public override void SetDefaults() diff --git a/Projectiles/Typeless/KelvinCatalystStar.cs b/Projectiles/Typeless/KelvinCatalystStar.cs index 1879c8e154..5442bf8c6e 100644 --- a/Projectiles/Typeless/KelvinCatalystStar.cs +++ b/Projectiles/Typeless/KelvinCatalystStar.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 4; + ProjectileID.Sets.TrailingMode[Type] = 0; } public override void SetDefaults() @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Typeless/MagnusBeam.cs b/Projectiles/Typeless/MagnusBeam.cs index 83a9136e8b..5ee3538016 100644 --- a/Projectiles/Typeless/MagnusBeam.cs +++ b/Projectiles/Typeless/MagnusBeam.cs @@ -26,8 +26,8 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 30; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 30; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Typeless { GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 30); - Texture2D glow = TextureAssets.Projectile[Projectile.type].Value; + Texture2D glow = TextureAssets.Projectile[Type].Value; Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, glow.Size() * 0.5f, Projectile.scale, SpriteEffects.None); } diff --git a/Projectiles/Typeless/MythrilFlare.cs b/Projectiles/Typeless/MythrilFlare.cs index 712a6f992b..d3c1b2d01d 100644 --- a/Projectiles/Typeless/MythrilFlare.cs +++ b/Projectiles/Typeless/MythrilFlare.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 15; } public override void SetDefaults() diff --git a/Projectiles/Typeless/Nanotech.cs b/Projectiles/Typeless/Nanotech.cs index 697c8bc0c8..7be094e82b 100644 --- a/Projectiles/Typeless/Nanotech.cs +++ b/Projectiles/Typeless/Nanotech.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Typeless { int cap = 5; float capDamageFactor = 0.05f; - int excessCount = Main.player[Projectile.owner].ownedProjectileCounts[Projectile.type] - cap; + int excessCount = Main.player[Projectile.owner].ownedProjectileCounts[Type] - cap; modifiers.SourceDamage *= MathHelper.Clamp(1f - (capDamageFactor * excessCount), 0f, 1f); } diff --git a/Projectiles/Typeless/NebulaDust.cs b/Projectiles/Typeless/NebulaDust.cs index 1577d47e52..001369b0f8 100644 --- a/Projectiles/Typeless/NebulaDust.cs +++ b/Projectiles/Typeless/NebulaDust.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Typeless lightColor.R = (byte)(255 * Projectile.Opacity); lightColor.G = (byte)(255 * Projectile.Opacity); lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } } diff --git a/Projectiles/Typeless/NebulaStar.cs b/Projectiles/Typeless/NebulaStar.cs index 2ef868b341..224ac1e258 100644 --- a/Projectiles/Typeless/NebulaStar.cs +++ b/Projectiles/Typeless/NebulaStar.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Typeless public override void PostDraw(Color lightColor) { - Rectangle frame = new Rectangle(0, 0, Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Width, Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height); + Rectangle frame = new Rectangle(0, 0, Terraria.GameContent.TextureAssets.Projectile[Type].Value.Width, Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height); Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Projectiles/Typeless/NebulaStarGlow").Value, Projectile.Center - Main.screenPosition, frame, Color.White * ((255 - Projectile.alpha) / 255f), Projectile.rotation, Projectile.Size / 2, 1f, SpriteEffects.None, 0); } } diff --git a/Projectiles/Typeless/OmegaBlueTentacle.cs b/Projectiles/Typeless/OmegaBlueTentacle.cs index b908dd04a6..3bb6f28ae9 100644 --- a/Projectiles/Typeless/OmegaBlueTentacle.cs +++ b/Projectiles/Typeless/OmegaBlueTentacle.cs @@ -206,7 +206,7 @@ namespace CalamityMod.Projectiles.Typeless Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); GameShaders.Armor.ApplySecondary(Main.player[Projectile.owner].cBody, Main.player[Projectile.owner], new DrawData?()); - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Texture2D segmentSprite = ModContent.Request("CalamityMod/Projectiles/Typeless/OmegaBlueTentacleSegment1").Value; for (int i = 0; i < 5; i++) { diff --git a/Projectiles/Typeless/OnyxLabSeeker.cs b/Projectiles/Typeless/OnyxLabSeeker.cs index a5bc8e7f78..97a26da02c 100644 --- a/Projectiles/Typeless/OnyxLabSeeker.cs +++ b/Projectiles/Typeless/OnyxLabSeeker.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 20; } public override void SetDefaults() @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (Time > 80f && Projectile.ai[1] == 0f) { for (int i = 0; i < 24; i += 2) diff --git a/Projectiles/Typeless/PlaguePulse.cs b/Projectiles/Typeless/PlaguePulse.cs index 14e6e4158e..482dde104f 100644 --- a/Projectiles/Typeless/PlaguePulse.cs +++ b/Projectiles/Typeless/PlaguePulse.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Typeless if ((target.life <= 0 && target.realLife == -1)) { player.Heal(10); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(startDamage * 0.8f), 0f, Projectile.owner, 0, 0, 1); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(startDamage * 0.8f), 0f, Projectile.owner, 0, 0, 1); } } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Typeless/ReaverThornBase.cs b/Projectiles/Typeless/ReaverThornBase.cs index afc80dbf28..a908340bf9 100644 --- a/Projectiles/Typeless/ReaverThornBase.cs +++ b/Projectiles/Typeless/ReaverThornBase.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Typeless // Draw the tip for the final thorn public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (Projectile.ai[0] == TotalSegments) texture = ModContent.Request("CalamityMod/Projectiles/Melee/ThornTip").Value; diff --git a/Projectiles/Typeless/RedLabSeeker.cs b/Projectiles/Typeless/RedLabSeeker.cs index 929d83d3d8..7a57f2aada 100644 --- a/Projectiles/Typeless/RedLabSeeker.cs +++ b/Projectiles/Typeless/RedLabSeeker.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 20; } public override void SetDefaults() @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (Time > 80f && Projectile.ai[1] == 0f) { for (int i = 0; i < 24; i += 2) diff --git a/Projectiles/Typeless/RelicOfConvergenceCrystal.cs b/Projectiles/Typeless/RelicOfConvergenceCrystal.cs index 8cf5bdf606..e33b4a43b6 100644 --- a/Projectiles/Typeless/RelicOfConvergenceCrystal.cs +++ b/Projectiles/Typeless/RelicOfConvergenceCrystal.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Typeless dust.fadeIn = Main.rand.NextFloat(3f, 4f); dust.noGravity = true; } - player.HealPlayer(70, HealTextType.Local); + player.HealPlayer(RelicOfConvergence.HealValue, HealTextType.Local); SoundEngine.PlaySound(SoundID.DD2_DarkMageHealImpact, Projectile.Center); } } @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Typeless if (Projectile.ai[0] >= CrystalsDrawTime) return true; float opacity = Projectile.ai[0] / CrystalsDrawTime; - Texture2D crystalTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D crystalTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; for (int i = 0; i < TotalCrystalsToDraw; i++) { float angle = MathHelper.TwoPi / TotalCrystalsToDraw * i + Projectile.ai[0] / 10f; diff --git a/Projectiles/Typeless/RelicOfDeliveranceSpear.cs b/Projectiles/Typeless/RelicOfDeliveranceSpear.cs index 1c2161af35..0353aa8d9a 100644 --- a/Projectiles/Typeless/RelicOfDeliveranceSpear.cs +++ b/Projectiles/Typeless/RelicOfDeliveranceSpear.cs @@ -24,9 +24,9 @@ namespace CalamityMod.Projectiles.Typeless public const float MaxChargeSpeed = 30f; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - Main.projFrames[Projectile.type] = 4; + ProjectileID.Sets.TrailCacheLength[Type] = 5; + ProjectileID.Sets.TrailingMode[Type] = 0; + Main.projFrames[Type] = 4; } public override void SetDefaults() @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Typeless Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } @@ -226,7 +226,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } // Force the spear to have "priority" when drawing so that it draws over the player. diff --git a/Projectiles/Typeless/SandBall.cs b/Projectiles/Typeless/SandBall.cs index b07b7f1ff3..c5f95893e9 100644 --- a/Projectiles/Typeless/SandBall.cs +++ b/Projectiles/Typeless/SandBall.cs @@ -1,4 +1,7 @@ using System; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Tiles.Abyss; using CalamityMod.Tiles.AstralDesert; using CalamityMod.Tiles.SunkenSea; @@ -13,32 +16,32 @@ namespace CalamityMod.Projectiles.Typeless { public override string Texture => "CalamityMod/Projectiles/Typeless/SandBallAstral"; public override bool Fired => false; - public override int TileType => ModContent.TileType(); - public override int ItemType => ModContent.ItemType(); + public override int TileType => ModContent.TileType(); + public override int ItemType => ModContent.ItemType(); public override int DustType => 108; } public class AstralSandBallGun : SandBall { public override string Texture => "CalamityMod/Projectiles/Typeless/SandBallAstral"; - public override int TileType => ModContent.TileType(); - public override int ItemType => ModContent.ItemType(); + public override int TileType => ModContent.TileType(); + public override int ItemType => ModContent.ItemType(); public override int DustType => 108; } public class EutrophicSandBallGun : SandBall { public override string Texture => "CalamityMod/Projectiles/Typeless/SandBallEutrophic"; - public override int TileType => ModContent.TileType(); - public override int ItemType => ModContent.ItemType(); + public override int TileType => ModContent.TileType(); + public override int ItemType => ModContent.ItemType(); public override int DustType => 108; // Weirdly same dusts as Astral } public class SulphurousSandBallGun : SandBall { public override string Texture => "CalamityMod/Projectiles/Typeless/SandBallSulphurous"; - public override int TileType => ModContent.TileType(); - public override int ItemType => ModContent.ItemType(); + public override int TileType => ModContent.TileType(); + public override int ItemType => ModContent.ItemType(); // Uses normal sand dust } diff --git a/Projectiles/Typeless/SandCloakVeil.cs b/Projectiles/Typeless/SandCloakVeil.cs index a68256bee6..fa7c51d161 100644 --- a/Projectiles/Typeless/SandCloakVeil.cs +++ b/Projectiles/Typeless/SandCloakVeil.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { // Sprite Circle - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; float scaleStep = 0.03f; float rotationOffset = 0.03f; Color drawCol = Projectile.GetAlpha(lightColor); diff --git a/Projectiles/Typeless/SepulcherSoul.cs b/Projectiles/Typeless/SepulcherSoul.cs index 8d42f839a1..1973b199de 100644 --- a/Projectiles/Typeless/SepulcherSoul.cs +++ b/Projectiles/Typeless/SepulcherSoul.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Typeless public ref float Time => ref Projectile.ai[0]; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 3; + Main.projFrames[Type] = 3; } public override void SetDefaults() @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Typeless { if (Projectile.localAI[0] == 0f) { - Projectile.frame = Main.rand.Next(Main.projFrames[Projectile.type]); + Projectile.frame = Main.rand.Next(Main.projFrames[Type]); Projectile.localAI[0] = 1f; } Vector2 idealVelocity = Vector2.Zero; diff --git a/Projectiles/Typeless/SerpentsBiteHook.cs b/Projectiles/Typeless/SerpentsBiteHook.cs index 1737fa6531..7f5b8feb07 100644 --- a/Projectiles/Typeless/SerpentsBiteHook.cs +++ b/Projectiles/Typeless/SerpentsBiteHook.cs @@ -1,5 +1,7 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Items.Fishing.SunkenSeaCatches; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,14 +12,15 @@ namespace CalamityMod.Projectiles.Typeless public class SerpentsBiteHook : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Typeless"; - public const float PullSpeed = 12f; - public const float ReelbackSpeed = 14f; - public const float LaunchSpeed = 18f; - public const float GrappleRangInTiles = 28.125f; - public override void SetDefaults() - { - Projectile.CloneDefaults(ProjectileID.GemHookAmethyst); - } + + public static Asset Chain; + public override void Load() => Chain = Request("CalamityMod/Projectiles/Typeless/SerpentsBiteChain"); + + public override void SetDefaults() => Projectile.CloneDefaults(ProjectileID.GemHookAmethyst); + + public override float GrappleRange() => SerpentsBite.Reach * 16f; + public override void GrappleRetreatSpeed(Player player, ref float speed) => speed = SerpentsBite.ReelbackSpeed; + public override void GrapplePullSpeed(Player player, ref float speed) => speed = SerpentsBite.PullSpeed; // Use this hook for hooks that can have multiple hooks mid-flight: Dual Hook, Web Slinger, Fish Hook, Static Hook, Lunar Hook public override bool? CanUseGrapple(Player player) @@ -36,31 +39,9 @@ namespace CalamityMod.Projectiles.Typeless } return true; } + public override void NumGrappleHooks(Player player, ref int numHooks) => numHooks = 2; - // Amethyst Hook is 300, Static Hook is 600, 16f = 1 tile - public override float GrappleRange() => GrappleRangInTiles * 16f; - - public override void NumGrappleHooks(Player player, ref int numHooks) - { - numHooks = 2; - } - - // default is 11, Lunar is 24 - public override void GrappleRetreatSpeed(Player player, ref float speed) - { - speed = ReelbackSpeed; - } - - public override void GrapplePullSpeed(Player player, ref float speed) - { - speed = PullSpeed; - } - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawHook(Projectile, Request("CalamityMod/Projectiles/Typeless/SerpentsBiteChain").Value); - return true; - } + public override bool PreDraw(ref Color lightColor) => Projectile.DrawHook(Chain.Value); public override void AI() { diff --git a/Projectiles/Typeless/ShadeNimbus.cs b/Projectiles/Typeless/ShadeNimbus.cs index 593d90780c..c09fe95f9f 100644 --- a/Projectiles/Typeless/ShadeNimbus.cs +++ b/Projectiles/Typeless/ShadeNimbus.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; + Main.projFrames[Type] = 6; } public override void SetDefaults() @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Typeless { Projectile.frameCounter = 0; Projectile.frame++; - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) { Projectile.frame = 0; } diff --git a/Projectiles/Typeless/SkyFlareFriendly.cs b/Projectiles/Typeless/SkyFlareFriendly.cs index 13d6819e0d..629bd290f6 100644 --- a/Projectiles/Typeless/SkyFlareFriendly.cs +++ b/Projectiles/Typeless/SkyFlareFriendly.cs @@ -12,9 +12,9 @@ namespace CalamityMod.Projectiles.Typeless public new string LocalizationCategory => "Projectiles.Typeless"; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - Main.projFrames[Projectile.type] = 3; + ProjectileID.Sets.TrailCacheLength[Type] = 2; + ProjectileID.Sets.TrailingMode[Type] = 0; + Main.projFrames[Type] = 3; } public override void SetDefaults() @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } diff --git a/Projectiles/Typeless/StarStruckWaterBottle.cs b/Projectiles/Typeless/StarStruckWaterBottle.cs index d87214f258..b201dfc760 100644 --- a/Projectiles/Typeless/StarStruckWaterBottle.cs +++ b/Projectiles/Typeless/StarStruckWaterBottle.cs @@ -49,5 +49,7 @@ namespace CalamityMod.Projectiles.Typeless Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Projectile.owner, 4f); } } + + public override bool? CanCutTiles() => false; } } diff --git a/Projectiles/Typeless/SuicideBomberDemon.cs b/Projectiles/Typeless/SuicideBomberDemon.cs index 95ed8f5715..06254b320c 100644 --- a/Projectiles/Typeless/SuicideBomberDemon.cs +++ b/Projectiles/Typeless/SuicideBomberDemon.cs @@ -23,10 +23,10 @@ namespace CalamityMod.Projectiles.Typeless public Player Owner => Main.player[Projectile.owner]; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 12; + Main.projFrames[Type] = 12; ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 11; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 11; } public override void SetDefaults() @@ -147,7 +147,7 @@ namespace CalamityMod.Projectiles.Typeless if (Time == 90f) SoundEngine.PlaySound(SoundID.DD2_WyvernDiveDown, Projectile.Center); - Projectile.frame = Main.projFrames[Projectile.type] - 1; + Projectile.frame = Main.projFrames[Type] - 1; // Fly away if no valid target was found. if (target is null) @@ -242,7 +242,7 @@ namespace CalamityMod.Projectiles.Typeless glowmask = ModContent.Request("CalamityMod/Projectiles/Typeless/SuicideBomberDemonGlowmaskFriendly").Value; orbTexture = ModContent.Request("CalamityMod/Projectiles/Typeless/SuicideBomberDemonOrbFriendly").Value; } - Rectangle frame = texture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 drawPosition = Projectile.Center - Main.screenPosition; SpriteEffects direction = Projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; diff --git a/Projectiles/Typeless/SulphuricAcidBubbleFriendly.cs b/Projectiles/Typeless/SulphuricAcidBubbleFriendly.cs index 39500ded01..2f3cab56f4 100644 --- a/Projectiles/Typeless/SulphuricAcidBubbleFriendly.cs +++ b/Projectiles/Typeless/SulphuricAcidBubbleFriendly.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Typeless private bool fromArmour = false; public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 7; + Main.projFrames[Type] = 7; } public override void SetDefaults() @@ -101,8 +101,8 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type]; + Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Typeless/TarraEnergy.cs b/Projectiles/Typeless/TarraEnergy.cs index 7d71c32950..47fb6ba6a7 100644 --- a/Projectiles/Typeless/TarraEnergy.cs +++ b/Projectiles/Typeless/TarraEnergy.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Typeless { int cap = 2; float capDamageFactor = 0.05f; - int excessCount = Main.player[Projectile.owner].ownedProjectileCounts[Projectile.type] - cap; + int excessCount = Main.player[Projectile.owner].ownedProjectileCounts[Type] - cap; modifiers.SourceDamage *= MathHelper.Clamp(1f - (capDamageFactor * excessCount), 0f, 1f); } diff --git a/Projectiles/Typeless/TatteredFairyDust.cs b/Projectiles/Typeless/TatteredFairyDust.cs new file mode 100644 index 0000000000..9d243ee0e6 --- /dev/null +++ b/Projectiles/Typeless/TatteredFairyDust.cs @@ -0,0 +1,34 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class TatteredFairyDust : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 25; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Generic; + Projectile.penetrate = 3; + Projectile.timeLeft = 150; + } + + public override void AI() + { + Lighting.AddLight(Projectile.Center, 0.9f, 0.9f, 0.9f); + if (Projectile.timeLeft % 2 == 0) + { + Dust dustEffect = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.BatScepter, Main.rand.NextFloat(0.1f), Main.rand.NextFloat(0.1f)); + dustEffect.noGravity = true; + Dust lightedDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.TintableDustLighted, Main.rand.NextFloat(0.1f), Main.rand.NextFloat(0.1f), 0, new Color(190, 3, 252)); + lightedDust.noGravity = true; + } + } + } +} diff --git a/Projectiles/Typeless/TerminusHoldout.cs b/Projectiles/Typeless/TerminusHoldout.cs index 5014080271..71e8385dd0 100644 --- a/Projectiles/Typeless/TerminusHoldout.cs +++ b/Projectiles/Typeless/TerminusHoldout.cs @@ -161,7 +161,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Main.zenithWorld ? ModContent.Request("CalamityMod/Items/SummonItems/Terminus_GFB").Value : Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Main.zenithWorld ? ModContent.Request("CalamityMod/Items/SummonItems/Terminus_GFB").Value : Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 baseDrawPosition = Projectile.Center - Main.screenPosition; Vector2 origin = texture.Size() * 0.5f; Color baseColor = Color.Lerp(Projectile.GetAlpha(lightColor), Color.White, Utils.GetLerpValue(40f, 120f, Time, true)); diff --git a/Projectiles/Typeless/TeslaAura.cs b/Projectiles/Typeless/TeslaAura.cs index 1185a9aa11..26e2976644 100644 --- a/Projectiles/Typeless/TeslaAura.cs +++ b/Projectiles/Typeless/TeslaAura.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; } public override void SetDefaults() @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - Texture2D sprite = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D sprite = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Color drawColour = Color.White; Rectangle sourceRect = new Rectangle(Projectile.width * (int)Projectile.localAI[1], Projectile.height * (int)Projectile.localAI[0], Projectile.width, Projectile.height); diff --git a/Projectiles/Typeless/WhiteLabSeeker.cs b/Projectiles/Typeless/WhiteLabSeeker.cs index 374eae49c3..e524e7f0e8 100644 --- a/Projectiles/Typeless/WhiteLabSeeker.cs +++ b/Projectiles/Typeless/WhiteLabSeeker.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 20; } public override void SetDefaults() @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (Time > 80f && Projectile.ai[1] == 0f) { for (int i = 0; i < 24; i += 2) diff --git a/Projectiles/Typeless/WulfrumDrillProj.cs b/Projectiles/Typeless/WulfrumDrillProj.cs index 05eb75eab1..17d6d0cd41 100644 --- a/Projectiles/Typeless/WulfrumDrillProj.cs +++ b/Projectiles/Typeless/WulfrumDrillProj.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Typeless if (!Projectile.active) return false; - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Vector2 origin = new Vector2(9f, tex.Height / 2f); Vector2 shake = Main.rand.NextVector2Circular(1f, 1f) * ((float)Math.Sin(Main.GlobalTimeWrappedHourly) * 0.25f + 0.75f); SpriteEffects effect = SpriteEffects.None; diff --git a/Projectiles/Typeless/WulfrumHook.cs b/Projectiles/Typeless/WulfrumHook.cs index 259e955588..687ac2c0ca 100644 --- a/Projectiles/Typeless/WulfrumHook.cs +++ b/Projectiles/Typeless/WulfrumHook.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { //Expand the draw distance. Should never happen really , but just in case the player basically walks away from the hook. - ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 3000; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 3000; } public override void SetDefaults() diff --git a/Projectiles/Typeless/WulfrumScaffoldKitHoldout.cs b/Projectiles/Typeless/WulfrumScaffoldKitHoldout.cs index 610fbe8bad..ec144b568c 100644 --- a/Projectiles/Typeless/WulfrumScaffoldKitHoldout.cs +++ b/Projectiles/Typeless/WulfrumScaffoldKitHoldout.cs @@ -140,7 +140,7 @@ namespace CalamityMod.Projectiles.Typeless if (Main.myPlayer != Owner.whoAmI) return false; - Texture2D sprite = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D sprite = Terraria.GameContent.TextureAssets.Projectile[Type].Value; Effect tileEffect = Filters.Scene["CalamityMod:WulfrumScaffoldSelection"].GetShader().Shader; diff --git a/Projectiles/Typeless/XykDeathAnim.cs b/Projectiles/Typeless/XykDeathAnim.cs index 61700202c9..96b2bb29b9 100644 --- a/Projectiles/Typeless/XykDeathAnim.cs +++ b/Projectiles/Typeless/XykDeathAnim.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 20; } public override void SetDefaults() diff --git a/Projectiles/Typeless/YanmeisKnifeSlash.cs b/Projectiles/Typeless/YanmeisKnifeSlash.cs index 87e3fa20ed..0f2755e6af 100644 --- a/Projectiles/Typeless/YanmeisKnifeSlash.cs +++ b/Projectiles/Typeless/YanmeisKnifeSlash.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 5; + Main.projFrames[Type] = 5; } public override void SetDefaults() @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Typeless if (Projectile.frameCounter % 7 == 0) { Projectile.frame++; - if (Projectile.frame >= Main.projFrames[Projectile.type]) + if (Projectile.frame >= Main.projFrames[Type]) Projectile.Kill(); } diff --git a/Projectiles/Typeless/YellowLabSeeker.cs b/Projectiles/Typeless/YellowLabSeeker.cs index e81976b4dd..b2668fff1a 100644 --- a/Projectiles/Typeless/YellowLabSeeker.cs +++ b/Projectiles/Typeless/YellowLabSeeker.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Projectile.type] = 1; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 1; + ProjectileID.Sets.TrailCacheLength[Type] = 20; } public override void SetDefaults() @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; if (Time > 80f && Projectile.ai[1] == 0f) { for (int i = 0; i < 24; i += 2) diff --git a/Projectiles/VanillaProjectileOverrides/ChlorophyteCrystalAI.cs b/Projectiles/VanillaProjectileOverrides/ChlorophyteCrystalAI.cs index fa30a51116..2859637b61 100644 --- a/Projectiles/VanillaProjectileOverrides/ChlorophyteCrystalAI.cs +++ b/Projectiles/VanillaProjectileOverrides/ChlorophyteCrystalAI.cs @@ -52,7 +52,6 @@ namespace CalamityMod.Projectiles.VanillaProjectileOverrides if (Main.myPlayer == projectile.owner) { int pulseDamage = (int)owner.GetBestClassDamage().ApplyTo(ChlorophyteArmorSetChange.BaseDamageToEnemies); - pulseDamage = owner.ApplyArmorAccDamageBonusesTo(pulseDamage); Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ModContent.ProjectileType(), pulseDamage, 0f, projectile.owner); } diff --git a/Projectiles/VanillaProjectileOverrides/HornetMinionAI.cs b/Projectiles/VanillaProjectileOverrides/HornetMinionAI.cs index 6b5890f62a..7f05385902 100644 --- a/Projectiles/VanillaProjectileOverrides/HornetMinionAI.cs +++ b/Projectiles/VanillaProjectileOverrides/HornetMinionAI.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.VanillaProjectileOverrides { Vector2 toTargetDirection = CalamityUtils.CalculatePredictiveAimToTarget(proj.Center, Target, ProjectileVelocity); - Projectile.NewProjectileDirect(proj.GetSource_FromThis(), + Projectile.NewProjectile(proj.GetSource_FromThis(), proj.Center, toTargetDirection, ModContent.ProjectileType(), diff --git a/Scenes/MiscScenes/BossRushScene.cs b/Scenes/MiscScenes/BossRushScene.cs index 15dd9727b2..e9f9a021b3 100644 --- a/Scenes/MiscScenes/BossRushScene.cs +++ b/Scenes/MiscScenes/BossRushScene.cs @@ -39,7 +39,13 @@ namespace CalamityMod.Systems SkyManager.Instance.Update(new GameTime()); } - player.ManageSpecialBiomeVisuals("CalamityMod:BossRush", isActive); + if (SkyManager.Instance["CalamityMod:BossRush"] != null && isActive != SkyManager.Instance["CalamityMod:BossRush"].IsActive()) + { + if (isActive) + SkyManager.Instance.Activate("CalamityMod:BossRush"); + else + SkyManager.Instance.Deactivate("CalamityMod:BossRush"); + } } public override float GetWeight(Player player) => 1f; diff --git a/Skies/BossRushScreenShader.cs b/Skies/BossRushScreenShader.cs deleted file mode 100644 index 221d4e516a..0000000000 --- a/Skies/BossRushScreenShader.cs +++ /dev/null @@ -1,23 +0,0 @@ -using CalamityMod.Events; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Graphics.Shaders; - -namespace CalamityMod.Skies -{ - public class BossRushScreenShader : ScreenShaderData - { - public BossRushScreenShader(string passName) : base(passName) { } - - public override void Apply() - { - UseTargetPosition(Main.LocalPlayer.Center); - base.Apply(); - } - - public override void Update(GameTime gameTime) - { - UseColor(Color.Lerp(BossRushSky.GeneralColor, Color.Black, BossRushEvent.WhiteDimness)); - } - } -} diff --git a/Skies/BossRushSky.cs b/Skies/BossRushSky.cs index b36fed965a..c5c2d7c66c 100644 --- a/Skies/BossRushSky.cs +++ b/Skies/BossRushSky.cs @@ -33,14 +33,6 @@ namespace CalamityMod.Skies SkyManager.Instance.Deactivate("CalamityMod:BossRush", new object[0]); } - if (useEffect != Filters.Scene["CalamityMod:BossRush"].IsActive()) - { - if (useEffect) - Filters.Scene.Activate("CalamityMod:BossRush"); - else - Filters.Scene["CalamityMod:BossRush"].Deactivate(new object[0]); - } - return useEffect; } diff --git a/Sounds/Item/HellbornReload.ogg b/Sounds/Item/HellbornReload.ogg index 098e08b0e0..e108eef19b 100644 Binary files a/Sounds/Item/HellbornReload.ogg and b/Sounds/Item/HellbornReload.ogg differ diff --git a/Systems/Graphic/SkyEffectLoaderSystem.cs b/Systems/Graphic/SkyEffectLoaderSystem.cs index 07ed6e0aac..8e8588063f 100644 --- a/Systems/Graphic/SkyEffectLoaderSystem.cs +++ b/Systems/Graphic/SkyEffectLoaderSystem.cs @@ -44,7 +44,6 @@ namespace CalamityMod.Systems Filters.Scene["CalamityMod:Signus"] = new Filter(new SignusScreenShaderData("FilterMiniTower").UseColor(0.35f, 0.1f, 0.55f).UseOpacity(0.35f), EffectPriority.VeryHigh); SkyManager.Instance["CalamityMod:Signus"] = new SignusSky(); - Filters.Scene["CalamityMod:BossRush"] = new Filter(new BossRushScreenShader("FilterMiniTower").UseOpacity(0.75f), EffectPriority.VeryHigh); SkyManager.Instance["CalamityMod:BossRush"] = new BossRushSky(); Filters.Scene["CalamityMod:ExoMechs"] = new Filter(new ExoMechsScreenShaderData("FilterMiniTower").UseColor(ExoMechsSky.DrawColor).UseOpacity(0.25f), EffectPriority.VeryHigh); diff --git a/Systems/Mechanic/RecipeSystem.cs b/Systems/Mechanic/RecipeSystem.cs index fb4d790a98..2da047dd6f 100644 --- a/Systems/Mechanic/RecipeSystem.cs +++ b/Systems/Mechanic/RecipeSystem.cs @@ -9,6 +9,10 @@ using CalamityMod.Items.Fishing.BrimstoneCragCatches; using CalamityMod.Items.Fishing.SunkenSeaCatches; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Items.Placeables.Crags; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Items.Tools; using Terraria; using Terraria.ID; @@ -1384,14 +1388,6 @@ namespace CalamityMod.Systems r.AddTile(TileID.MythrilAnvil); r.Register(); r.DisableDecraft(); - - // Lihzahrd Power Cell (NOT Calamity's Old Power Cell) - r = Recipe.Create(ItemID.LihzahrdPowerCell); - r.AddIngredient(ItemID.LihzahrdBrick, 5); - r.AddIngredient(); - r.AddTile(TileID.LihzahrdFurnace); - r.Register(); - r.DisableDecraft(); } #endregion diff --git a/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs b/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs index 242a68ffc7..5387070e05 100644 --- a/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs +++ b/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs @@ -336,6 +336,9 @@ namespace CalamityMod.Systems if (sideType < 0) return; + if (!_TileTypeToBlendTextureSlot.IndexInRange(sideType)) + return; + var blendTextureSlot = _TileTypeToBlendTextureSlot[sideType]; if (blendTextureSlot == TileBlendTextureLoader.EmptySlot) return; diff --git a/Systems/World/WorldgenManagementSystem.cs b/Systems/World/WorldgenManagementSystem.cs index f37b0f5d2e..a314ebf140 100644 --- a/Systems/World/WorldgenManagementSystem.cs +++ b/Systems/World/WorldgenManagementSystem.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Threading; using CalamityMod.Items.SummonItems; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.World; @@ -362,7 +363,8 @@ namespace CalamityMod.Systems // Insert the Astral biome generation right before the final hardmode announcement. tasks.Insert(announceIndex, new PassLegacy("AstralMeteor", (progress, config) => { - AstralBiome.PlaceAstralMeteor(); + //Delaying it a bit so that weaker pcs dont suffer - Shade + ThreadPool.QueueUserWorkItem(_ => World.AstralBiome.PlaceAstralMeteor()); })); } #endregion diff --git a/Tiles/Abyss/AcidWoodTree.cs b/Tiles/Abyss/AcidWoodTree.cs index 63a8139aba..5c4ca18d92 100644 --- a/Tiles/Abyss/AcidWoodTree.cs +++ b/Tiles/Abyss/AcidWoodTree.cs @@ -1,7 +1,7 @@ using CalamityMod.Dusts; using CalamityMod.Gores.Trees; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using CalamityMod.NPCs.AcidRain; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Tiles/Abyss/PlantyMush.cs b/Tiles/Abyss/PlantyMush.cs index 378a4400bd..76aa71e9e4 100644 --- a/Tiles/Abyss/PlantyMush.cs +++ b/Tiles/Abyss/PlantyMush.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Tiles.Abyss CalamityUtils.MergeWithAbyss(Type); DustType = 2; - AddMapEntry(new Color(84, 102, 39), CalamityUtils.GetItemName()); + AddMapEntry(new Color(84, 102, 39), CalamityUtils.GetItemName()); HitSound = MineSound; this.RegisterUniversalMerge(TileID.Dirt, "CalamityMod/Tiles/Merges/DirtMerge"); diff --git a/Tiles/Astral/AstralGrass.cs b/Tiles/Astral/AstralGrass.cs index 876726f13d..6acc3ddd47 100644 --- a/Tiles/Astral/AstralGrass.cs +++ b/Tiles/Astral/AstralGrass.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Tiles.Astral CalamityUtils.SetMerge(Type, TileID.CrimsonGrass); DustType = ModContent.DustType(); - RegisterItemDrop(ModContent.ItemType()); + RegisterItemDrop(ModContent.ItemType()); AddMapEntry(new Color(133, 109, 140)); diff --git a/Tiles/Astral/AstralMonolith.cs b/Tiles/Astral/AstralMonolith.cs index 6273e857ec..1ff2ad9606 100644 --- a/Tiles/Astral/AstralMonolith.cs +++ b/Tiles/Astral/AstralMonolith.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Tiles.Astral Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/Astral/AstralMonolithGlow").Value; Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; - Color drawColour = GetDrawColour(i, j, new Color(50, 50, 50, 50)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(50, 50, 50, 50)); if (!tile.IsHalfBlock && tile.Slope == 0) { Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); @@ -132,19 +132,6 @@ namespace CalamityMod.Tiles.Astral } } - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } - public override bool IsTileBiomeSightable(int i, int j, ref Color sightColor) { sightColor = Color.Cyan; diff --git a/Tiles/Astral/AstralShortPlants.cs b/Tiles/Astral/AstralShortPlants.cs index 594f285be5..0da771ec2a 100644 --- a/Tiles/Astral/AstralShortPlants.cs +++ b/Tiles/Astral/AstralShortPlants.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Tiles.Astral yield return new Item(ItemID.Hay, Main.rand.Next(1, 2 + 1)); if (Main.rand.NextBool(20)) - yield return new Item(ModContent.ItemType()); + yield return new Item(ModContent.ItemType()); } } diff --git a/Tiles/Astral/AstralStoneLargePiles.cs b/Tiles/Astral/AstralStoneLargePiles.cs new file mode 100644 index 0000000000..bce2f92b0e --- /dev/null +++ b/Tiles/Astral/AstralStoneLargePiles.cs @@ -0,0 +1,45 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Astral +{ + public class AstralStoneLargePiles : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoFail[Type] = true; + Main.tileObsidianKill[Type] = true; + + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); + TileObjectData.addTile(Type); + + DustType = ModContent.DustType(); + + AddMapEntry(new Color(79, 61, 97)); + + base.SetStaticDefaults(); + } + + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) + { + offsetY = 2; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 4; + } + + public override bool IsTileBiomeSightable(int i, int j, ref Color sightColor) + { + sightColor = Color.Cyan; + return true; + } + } +} diff --git a/Tiles/Astral/AstralStoneLargePiles.png b/Tiles/Astral/AstralStoneLargePiles.png new file mode 100644 index 0000000000..c0b47f7a65 Binary files /dev/null and b/Tiles/Astral/AstralStoneLargePiles.png differ diff --git a/Tiles/Astral/AstralStoneMediumPiles.cs b/Tiles/Astral/AstralStoneMediumPiles.cs new file mode 100644 index 0000000000..8ff73668f3 --- /dev/null +++ b/Tiles/Astral/AstralStoneMediumPiles.cs @@ -0,0 +1,45 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Astral +{ + public class AstralStoneMediumPiles : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoFail[Type] = true; + Main.tileObsidianKill[Type] = true; + + TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); + TileObjectData.addTile(Type); + + DustType = ModContent.DustType(); + + AddMapEntry(new Color(79, 61, 97)); + + base.SetStaticDefaults(); + } + + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) + { + offsetY = 2; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 4; + } + + public override bool IsTileBiomeSightable(int i, int j, ref Color sightColor) + { + sightColor = Color.Cyan; + return true; + } + } +} diff --git a/Tiles/Astral/AstralStoneMediumPiles.png b/Tiles/Astral/AstralStoneMediumPiles.png new file mode 100644 index 0000000000..0aaaf71dfc Binary files /dev/null and b/Tiles/Astral/AstralStoneMediumPiles.png differ diff --git a/Tiles/Astral/AstralStoneSmallPiles.cs b/Tiles/Astral/AstralStoneSmallPiles.cs new file mode 100644 index 0000000000..d8215382c1 --- /dev/null +++ b/Tiles/Astral/AstralStoneSmallPiles.cs @@ -0,0 +1,40 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Astral +{ + public class AstralStoneSmallPiles : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoFail[Type] = true; + Main.tileObsidianKill[Type] = true; + + DustType = ModContent.DustType(); + AddMapEntry(new Color(79, 61, 97)); + + base.SetStaticDefaults(); + } + + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) + { + offsetY = 2; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 4; + } + + public override bool IsTileBiomeSightable(int i, int j, ref Color sightColor) + { + sightColor = Color.Cyan; + return true; + } + } +} diff --git a/Tiles/Astral/AstralStoneSmallPiles.png b/Tiles/Astral/AstralStoneSmallPiles.png new file mode 100644 index 0000000000..bbf4dcb9ae Binary files /dev/null and b/Tiles/Astral/AstralStoneSmallPiles.png differ diff --git a/Tiles/Astral/AstralStoneStalactite.cs b/Tiles/Astral/AstralStoneStalactite.cs new file mode 100644 index 0000000000..a6259873be --- /dev/null +++ b/Tiles/Astral/AstralStoneStalactite.cs @@ -0,0 +1,55 @@ + +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Astral +{ + public class AstralStoneStalactite : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoFail[Type] = true; + Main.tileObsidianKill[Type] = true; + Main.tileBlockLight[Type] = true; + + DustType = ModContent.DustType(); + + AddMapEntry(new Color(79, 61, 97)); + + base.SetStaticDefaults(); + } + + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) + { + Tile tile = Main.tile[i, j]; + if (tile.TileFrameY <= 18 || tile.TileFrameY == 72) + { + offsetY = -2; + } + else if ((tile.TileFrameY >= 36 && tile.TileFrameY <= 54) || tile.TileFrameY == 90) + { + offsetY = 2; + } + } + + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + { + WorldGen.CheckTight(i, j); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 4; + } + + public override bool IsTileBiomeSightable(int i, int j, ref Color sightColor) + { + sightColor = Color.Cyan; + return true; + } + } +} diff --git a/Tiles/Astral/AstralStoneStalactite.png b/Tiles/Astral/AstralStoneStalactite.png new file mode 100644 index 0000000000..c17af1aa5f Binary files /dev/null and b/Tiles/Astral/AstralStoneStalactite.png differ diff --git a/Tiles/Astral/AstralTallPlants.cs b/Tiles/Astral/AstralTallPlants.cs index 9e0434f978..88b97212ab 100644 --- a/Tiles/Astral/AstralTallPlants.cs +++ b/Tiles/Astral/AstralTallPlants.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Tiles.Astral yield return new Item(ItemID.Hay, Main.rand.Next(2, 4 + 1)); if (Main.rand.NextBool(20)) - yield return new Item(ModContent.ItemType()); + yield return new Item(ModContent.ItemType()); } } diff --git a/Tiles/Astral/AstralTree.cs b/Tiles/Astral/AstralTree.cs index e65767fa7f..00e225c7df 100644 --- a/Tiles/Astral/AstralTree.cs +++ b/Tiles/Astral/AstralTree.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Tiles.Astral //treeFrame = (i + j * j) % 3; } - public override int DropWood() => ModContent.ItemType(); + public override int DropWood() => ModContent.ItemType(); public override int CreateDust() => ModContent.DustType(); public override int SaplingGrowthType(ref int style) diff --git a/Tiles/AstralDesert/AstralPalmTree.cs b/Tiles/AstralDesert/AstralPalmTree.cs index 0c25cbe285..845f461076 100644 --- a/Tiles/AstralDesert/AstralPalmTree.cs +++ b/Tiles/AstralDesert/AstralPalmTree.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Tiles.AstralDesert return Color.White * MathHelper.Lerp(0.05f, 0.75f, brightness); } - public override int DropWood() => ModContent.ItemType(); + public override int DropWood() => ModContent.ItemType(); public override int CreateDust() => ModContent.DustType(); diff --git a/Tiles/AstralDesert/CelestialRemains.cs b/Tiles/AstralDesert/CelestialRemains.cs index 984b7f9937..70bc6f2963 100644 --- a/Tiles/AstralDesert/CelestialRemains.cs +++ b/Tiles/AstralDesert/CelestialRemains.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Tiles.AstralDesert DustType = ModContent.DustType(); - AddMapEntry(new Color(59, 50, 77), CalamityUtils.GetItemName()); + AddMapEntry(new Color(59, 50, 77), CalamityUtils.GetItemName()); TileID.Sets.ForAdvancedCollision.ForSandshark[Type] = true; diff --git a/Tiles/AstralSnow/AstralIce.png b/Tiles/AstralSnow/AstralIce.png index 924cc4a6fc..86a8d74879 100644 Binary files a/Tiles/AstralSnow/AstralIce.png and b/Tiles/AstralSnow/AstralIce.png differ diff --git a/Tiles/AstralSnow/AstralSnow.png b/Tiles/AstralSnow/AstralSnow.png index ab1fff1134..a0333f7c80 100644 Binary files a/Tiles/AstralSnow/AstralSnow.png and b/Tiles/AstralSnow/AstralSnow.png differ diff --git a/Tiles/AstralSnow/AstralSnowTree.cs b/Tiles/AstralSnow/AstralSnowTree.cs index 1343ccb1af..a411ad61cf 100644 --- a/Tiles/AstralSnow/AstralSnowTree.cs +++ b/Tiles/AstralSnow/AstralSnowTree.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Tiles.AstralSnow //treeFrame = (i + j * j) % 6; } - public override int DropWood() => ModContent.ItemType(); + public override int DropWood() => ModContent.ItemType(); public override int CreateDust() => ModContent.DustType(); diff --git a/Tiles/Crags/BrimstoneSlag.cs b/Tiles/Crags/BrimstoneSlag.cs index 6d64f0c9e3..d88a236f6b 100644 --- a/Tiles/Crags/BrimstoneSlag.cs +++ b/Tiles/Crags/BrimstoneSlag.cs @@ -51,64 +51,5 @@ namespace CalamityMod.Tiles.Crags { return TileFramingSystem.BrimstoneFraming(i, j, resetFrame); } - - /*public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - Tile tile = Main.tile[i, j]; - Texture2D sprite = ModContent.GetTexture("CalamityMod/Tiles/Crags/BrimstoneSlagGlow"); - int frameXOffset = i % 2 * subsheetWidth; - int frameYOffset = j % 2 * subsheetHeight; - Vector2 zero = new Vector2(Main.offScreenRange, Main.offScreenRange); - Color drawColour = GetDrawColour(i, j, new Color(50, 50, 50, 50)); - if (Main.drawToScreen) - { - zero = Vector2.Zero; - } - if (tile.Slope == (byte)0 && !tile.IsHalfBlock) - Main.spriteBatch.Draw(sprite, new Vector2((float)(i * 16 - (int)Main.screenPosition.X), (float)(j * 16 - (int)Main.screenPosition.Y)) + zero, new Rectangle(tile.frameX + frameXOffset, tile.frameY + frameYOffset, 16, 16), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - else if (tile.IsHalfBlock) - { - Main.spriteBatch.Draw(sprite, new Vector2((float)(i * 16 - (int)Main.screenPosition.X), (float)(j * 16 - (int)Main.screenPosition.Y + 10) + 8) + zero, new Rectangle(tile.frameX + frameXOffset, tile.frameY + frameYOffset, 16, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } - else - { - byte num9 = tile.Slope; - for (int index4 = 0; index4 < 8; ++index4) - { - int width2 = index4 << 1; - Rectangle drawRectangle = new Rectangle(tile.frameX + frameXOffset, tile.frameY + frameYOffset + index4 * 2, width2, 2); - int num10 = 0; - switch (num9) - { - case 2: - drawRectangle.X = 16 - width2; - num10 = 16 - width2; - break; - case 3: - drawRectangle.Width = 16 - width2; - break; - case 4: - drawRectangle.Width = 14 - width2; - drawRectangle.X = width2 + 2; - num10 = width2 + 2; - break; - } - Main.spriteBatch.Draw(sprite, new Vector2((float)(i * 16 - (int)Main.screenPosition.X) + (float)num10, (float)(j * 16 - (int)Main.screenPosition.Y + index4 * 2)) + zero, drawRectangle, drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } - } - } - - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - }*/ } } diff --git a/Tiles/Crags/CinderBlossomTallPlants.cs b/Tiles/Crags/CinderBlossomTallPlants.cs index 997a6fa57d..7cdea6fe06 100644 --- a/Tiles/Crags/CinderBlossomTallPlants.cs +++ b/Tiles/Crags/CinderBlossomTallPlants.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Tiles.Crags { if (Main.netMode != NetmodeID.MultiplayerClient && Main.rand.NextBool(20)) { - Item.NewItem(new EntitySource_TileBreak(i, j), new Vector2(i, j) * 16f, ModContent.ItemType()); + Item.NewItem(new EntitySource_TileBreak(i, j), new Vector2(i, j) * 16f, ModContent.ItemType()); } } } diff --git a/Tiles/Crags/ScorchedRemainsGrass.cs b/Tiles/Crags/ScorchedRemainsGrass.cs index 5cf19faafc..c93a845ccb 100644 --- a/Tiles/Crags/ScorchedRemainsGrass.cs +++ b/Tiles/Crags/ScorchedRemainsGrass.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Tiles.Crags HitSound = SoundID.Dig; MinPick = 100; - RegisterItemDrop(ModContent.ItemType()); + RegisterItemDrop(ModContent.ItemType()); AddMapEntry(new Color(212, 82, 227)); this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/BrimstoneSlagMerge"); @@ -149,7 +149,7 @@ namespace CalamityMod.Tiles.Crags { Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; - Color drawColour = GetDrawColour(i, j); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Lighting.GetColor(i, j)); Texture2D leaves = ModContent.Request("CalamityMod/Tiles/Crags/CinderBlossomGrassGrass").Value; DrawExtraTop(i, j, leaves, drawOffset, drawColour); @@ -279,27 +279,6 @@ namespace CalamityMod.Tiles.Crags return Main.tile[i + x, j - y].TileType == type == equal; } - private Color GetDrawColour(int i, int j) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType < 13) - { - paintCol.R = (byte)((paintCol.R / 2f) + 128); - paintCol.G = (byte)((paintCol.G / 2f) + 128); - paintCol.B = (byte)((paintCol.B / 2f) + 128); - } - if (colType == 29) - { - paintCol = Color.Black; - } - Color col = Lighting.GetColor(i, j); - col.R = (byte)(paintCol.R / 255f * col.R); - col.G = (byte)(paintCol.G / 255f * col.G); - col.B = (byte)(paintCol.B / 255f * col.B); - return col; - } - private int GetExtraState(string type) { switch (type) diff --git a/Tiles/Crags/Tree/SpineTree.cs b/Tiles/Crags/Tree/SpineTree.cs index 06da36fa31..0d7628d3f2 100644 --- a/Tiles/Crags/Tree/SpineTree.cs +++ b/Tiles/Crags/Tree/SpineTree.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Tiles.Crags.Tree AddMapEntry(new Color(38, 25, 27), CreateMapEntryName()); DustType = 155; HitSound = SoundID.DD2_SkeletonHurt; - RegisterItemDrop(ModContent.ItemType()); + RegisterItemDrop(ModContent.ItemType()); } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) @@ -176,14 +176,14 @@ namespace CalamityMod.Tiles.Crags.Tree int totalSeeds = Main.rand.Next(1, 3); for (int numSeed = 0; numSeed < totalSeeds; numSeed++) { - yield return new Item(ModContent.ItemType()); + yield return new Item(ModContent.ItemType()); } } //chance to drop extra wood if (Main.rand.NextBool()) { - yield return new Item(ModContent.ItemType()); + yield return new Item(ModContent.ItemType()); } } diff --git a/Tiles/DraedonSummoner/CodebreakerTile.cs b/Tiles/DraedonSummoner/CodebreakerTile.cs index c8454d49f1..013cdf7b8b 100644 --- a/Tiles/DraedonSummoner/CodebreakerTile.cs +++ b/Tiles/DraedonSummoner/CodebreakerTile.cs @@ -78,6 +78,19 @@ namespace CalamityMod.Tiles.DraedonSummoner public override bool CanExplode(int i, int j) => false; + public override bool CanPlace(int i, int j) + { + // Cannot be placed on Teleporters in order to prevent a critical bug. + int startOfTileCoordinateCheckX = i - 2; + for (int k = startOfTileCoordinateCheckX; k < startOfTileCoordinateCheckX + Width; k++) + { + if (Main.tile[k, j + 1].TileType == TileID.Teleporter) + return false; + } + + return true; + } + // Prevent the tile from being destroyed while it's busy decrypting. // If it's destroyed the tile entity would be too and the resources used on decryption would be lost for nothing. public override bool CanKillTile(int i, int j, ref bool blockDamaged) diff --git a/Tiles/FloralParadise/PinkFlower.cs b/Tiles/FloralParadise/PinkFlower.cs index 9ce0123ad4..56c0f03581 100644 --- a/Tiles/FloralParadise/PinkFlower.cs +++ b/Tiles/FloralParadise/PinkFlower.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Tiles.FloralParadise public override void KillMultiTile(int i, int j, int frameX, int frameY) { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); } public override void NumDust(int i, int j, bool fail, ref int num) diff --git a/Tiles/Furniture/BabyCannonballJellyfishBowlTile.png b/Tiles/Furniture/BabyCannonballJellyfishBowlTile.png index aa6c53127b..c06c77a0cb 100644 Binary files a/Tiles/Furniture/BabyCannonballJellyfishBowlTile.png and b/Tiles/Furniture/BabyCannonballJellyfishBowlTile.png differ diff --git a/Tiles/Furniture/BabyFlakCrabCageTile.cs b/Tiles/Furniture/BabyFlakCrabCageTile.cs index 79cf298931..a5130a5078 100644 --- a/Tiles/Furniture/BabyFlakCrabCageTile.cs +++ b/Tiles/Furniture/BabyFlakCrabCageTile.cs @@ -1,7 +1,10 @@ using CalamityMod.Items.Placeables.Furniture; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.DataStructures; +using Terraria.GameContent; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -11,13 +14,18 @@ namespace CalamityMod.Tiles.Furniture { public class BabyFlakCrabCageTile : ModTile { + public static Asset topTexture; + public override void SetStaticDefaults() { + if (!Main.dedServ) + { + topTexture = ModContent.Request("CalamityMod/Tiles/Furniture/TransparentCageTile_Top"); + } Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; Main.tileSolidTop[Type] = true; Main.tileTable[Type] = true; - TileID.Sets.CritterCageLidStyle[Type] = TileID.Sets.CritterCageLidStyle[TileID.BunnyCage]; // Big, gray lid TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); TileObjectData.addTile(Type); AnimationFrameHeight = 54; @@ -60,5 +68,39 @@ namespace CalamityMod.Tiles.Furniture frame = 0; } } + + // Since this uses a custom top sprite, all drawing must be redone + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Main.tile[i, j]; + var zero = Main.drawToScreen ? Vector2.Zero : new(Main.offScreenRange, Main.offScreenRange); + var drawPos = new Vector2(i * 16, j * 16) - Main.screenPosition + zero + CalamityUtils.TileDrawOffset + Vector2.UnitY * 2; + var animateFrameOffset = Main.tileFrame[Type] * AnimationFrameHeight; + var height = 16; + var finalColor = CalamityUtils.ApplyPaint(tile.TileColor, Lighting.GetColor(i, j), false); + + var rect = new Rectangle(tile.TileFrameX, tile.TileFrameY + animateFrameOffset, 16, height); + + if (rect.Y % 54 == 0) + { + Vector2 position = drawPos; + position.Y += 8f; + Rectangle drawRectangle = rect; + drawRectangle.Y += 8; + drawRectangle.Height -= 8; + Main.spriteBatch.Draw(TextureAssets.Tile[Type].Value, position, drawRectangle, finalColor, 0f, zero, 1f, SpriteEffects.None, 0f); + position = drawPos; + position.Y -= 2f; + drawRectangle = rect; + drawRectangle.Y = 0; + drawRectangle.Height = 10; + spriteBatch.Draw(topTexture.Value, position, drawRectangle, finalColor, 0f, zero, 1f, SpriteEffects.None, 0f); + } + else + { + spriteBatch.Draw(TextureAssets.Tile[Type].Value, drawPos, rect, finalColor, 0f, zero, 1f, SpriteEffects.None, 0f); + } + return false; + } } } diff --git a/Tiles/Furniture/CraftingStations/MonolithAmalgam.cs b/Tiles/Furniture/CraftingStations/MonolithAmalgam.cs index 907903a75f..5bdeda2d2b 100644 --- a/Tiles/Furniture/CraftingStations/MonolithAmalgam.cs +++ b/Tiles/Furniture/CraftingStations/MonolithAmalgam.cs @@ -31,23 +31,10 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/Furniture/CraftingStations/MonolithAmalgamGlow").Value; - Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } - - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } } } diff --git a/Tiles/Furniture/CraftingStations/WulfrumLabstation.cs b/Tiles/Furniture/CraftingStations/WulfrumLabstation.cs index 8cd29cfa01..e673581d99 100644 --- a/Tiles/Furniture/CraftingStations/WulfrumLabstation.cs +++ b/Tiles/Furniture/CraftingStations/WulfrumLabstation.cs @@ -36,23 +36,10 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/Furniture/CraftingStations/WulfrumLabstationGlow").Value; - Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } - - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } } } diff --git a/Tiles/Furniture/PiggyCageTile.cs b/Tiles/Furniture/PiggyCageTile.cs index 55aacb60f9..66dfb336a4 100644 --- a/Tiles/Furniture/PiggyCageTile.cs +++ b/Tiles/Furniture/PiggyCageTile.cs @@ -1,7 +1,9 @@ using CalamityMod.Items.Placeables.Furniture; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.DataStructures; +using Terraria.GameContent; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -17,7 +19,6 @@ namespace CalamityMod.Tiles.Furniture Main.tileLavaDeath[Type] = true; Main.tileSolidTop[Type] = true; Main.tileTable[Type] = true; - TileID.Sets.CritterCageLidStyle[Type] = TileID.Sets.CritterCageLidStyle[TileID.BunnyCage]; // Big, gray lid TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); TileObjectData.addTile(Type); AnimationFrameHeight = 54; @@ -60,5 +61,39 @@ namespace CalamityMod.Tiles.Furniture frame = 0; } } + + // Since this uses a custom top sprite, all drawing must be redone + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Main.tile[i, j]; + var zero = Main.drawToScreen ? Vector2.Zero : new(Main.offScreenRange, Main.offScreenRange); + var drawPos = new Vector2(i * 16, j * 16) - Main.screenPosition + zero + CalamityUtils.TileDrawOffset + Vector2.UnitY * 2; + var animateFrameOffset = Main.tileFrame[Type] * AnimationFrameHeight; + var height = 16; + var finalColor = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Lighting.GetColor(i, j), false); + + var rect = new Rectangle(tile.TileFrameX, tile.TileFrameY + animateFrameOffset, 16, height); + + if (rect.Y % 54 == 0) + { + Vector2 position = drawPos; + position.Y += 8f; + Rectangle drawRectangle = rect; + drawRectangle.Y += 8; + drawRectangle.Height -= 8; + Main.spriteBatch.Draw(TextureAssets.Tile[Type].Value, position, drawRectangle, finalColor, 0f, zero, 1f, SpriteEffects.None, 0f); + position = drawPos; + position.Y -= 2f; + drawRectangle = rect; + drawRectangle.Y = 0; + drawRectangle.Height = 10; + spriteBatch.Draw(BabyFlakCrabCageTile.topTexture.Value, position, drawRectangle, finalColor, 0f, zero, 1f, SpriteEffects.None, 0f); + } + else + { + spriteBatch.Draw(TextureAssets.Tile[Type].Value, drawPos, rect, finalColor, 0f, zero, 1f, SpriteEffects.None, 0f); + } + return false; + } } } diff --git a/Tiles/Furniture/RepairUnitCageTile.cs b/Tiles/Furniture/RepairUnitCageTile.cs new file mode 100644 index 0000000000..5785665977 --- /dev/null +++ b/Tiles/Furniture/RepairUnitCageTile.cs @@ -0,0 +1,98 @@ +using CalamityMod.Buffs.Potions; +using CalamityMod.Items.Placeables.Furniture; +using Microsoft.Build.Tasks.Deployment.ManifestUtilities; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Furniture +{ + public class RepairUnitCageTile : ModTile + { + public static Asset topTexture; + + public override void SetStaticDefaults() + { + if (!Main.dedServ) + topTexture = ModContent.Request(Texture + "_Top"); + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = true; + Main.tileSolidTop[Type] = true; + Main.tileTable[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); + TileObjectData.addTile(Type); + AnimationFrameHeight = 54; + AddMapEntry(new Color(122, 217, 232), CalamityUtils.GetItemName()); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Glass, 0f, 0f, 0, new Color(), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => offsetY = 2; + + public override void AnimateTile(ref int frame, ref int frameCounter) + { + int frameAmt = 10; + int timeNeeded = 10; + frameCounter++; + if (frameCounter >= timeNeeded) + { + frame++; + frameCounter = 0; + } + if (frame >= frameAmt) + { + frame = 0; + } + } + + // Since this uses a custom top sprite, all drawing must be redone + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Main.tile[i, j]; + var zero = Main.drawToScreen ? Vector2.Zero : new(Main.offScreenRange, Main.offScreenRange); + var drawPos = new Vector2(i * 16, j * 16) - Main.screenPosition + zero + CalamityUtils.TileDrawOffset + Vector2.UnitY * 2; + var animateFrameOffset = Main.tileFrame[Type] * AnimationFrameHeight; + var height = 16; + var finalColor = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Lighting.GetColor(i, j), false); + + var rect = new Rectangle(tile.TileFrameX, tile.TileFrameY + animateFrameOffset, 16, height); + + if (rect.Y % 54 == 0) + { + Vector2 position = drawPos; + position.Y += 8f; + Rectangle drawRectangle = rect; + drawRectangle.Y += 8; + drawRectangle.Height -= 8; + Main.spriteBatch.Draw(TextureAssets.Tile[Type].Value, position, drawRectangle, finalColor, 0f, zero, 1f, SpriteEffects.None, 0f); + position = drawPos; + position.Y -= 2f; + drawRectangle = rect; + drawRectangle.Y = 0; + drawRectangle.Height = 10; + spriteBatch.Draw(topTexture.Value, position, drawRectangle, finalColor, 0f, zero, 1f, SpriteEffects.None, 0f); + } + else + { + spriteBatch.Draw(TextureAssets.Tile[Type].Value, drawPos, rect, finalColor, 0f, zero, 1f, SpriteEffects.None, 0f); + } + return false; + } + } +} diff --git a/Tiles/Furniture/RepairUnitCageTile.png b/Tiles/Furniture/RepairUnitCageTile.png new file mode 100644 index 0000000000..ed7cc4bb25 Binary files /dev/null and b/Tiles/Furniture/RepairUnitCageTile.png differ diff --git a/Tiles/Furniture/RepairUnitCageTile_Top.png b/Tiles/Furniture/RepairUnitCageTile_Top.png new file mode 100644 index 0000000000..015dbb46eb Binary files /dev/null and b/Tiles/Furniture/RepairUnitCageTile_Top.png differ diff --git a/Tiles/Furniture/TransparentCageTile_Top.png b/Tiles/Furniture/TransparentCageTile_Top.png new file mode 100644 index 0000000000..cf9a09404c Binary files /dev/null and b/Tiles/Furniture/TransparentCageTile_Top.png differ diff --git a/Tiles/FurnitureAshen/AshenAccentSlab.cs b/Tiles/FurnitureAshen/AshenAccentSlab.cs index f92c169a76..97dc53aba5 100644 --- a/Tiles/FurnitureAshen/AshenAccentSlab.cs +++ b/Tiles/FurnitureAshen/AshenAccentSlab.cs @@ -512,7 +512,7 @@ namespace CalamityMod.Tiles.FurnitureAshen Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureAshen/AshenSlabGlow").Value; - Color drawColour = GetDrawColour(i, j, new Color(64, 64, 64, 64)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(64, 64, 64, 64)); Tile trackTile = Main.tile[i, j]; if (!trackTile.IsHalfBlock && trackTile.Slope == 0) { @@ -524,19 +524,6 @@ namespace CalamityMod.Tiles.FurnitureAshen } } - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } - /* /// /// Gets the tile variant to use. Returns -1 by default diff --git a/Tiles/FurnitureAshen/AshenSlab.cs b/Tiles/FurnitureAshen/AshenSlab.cs index 2534a691f7..182a094973 100644 --- a/Tiles/FurnitureAshen/AshenSlab.cs +++ b/Tiles/FurnitureAshen/AshenSlab.cs @@ -512,7 +512,7 @@ namespace CalamityMod.Tiles.FurnitureAshen Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureAshen/AshenSlabGlow").Value; - Color drawColour = GetDrawColour(i, j, new Color(64, 64, 64, 64)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(64, 64, 64, 64)); Tile trackTile = Main.tile[i, j]; if (!trackTile.IsHalfBlock && trackTile.Slope == 0) { @@ -524,19 +524,6 @@ namespace CalamityMod.Tiles.FurnitureAshen } } - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } - /* /// /// Gets the tile variant to use. Returns -1 by default diff --git a/Tiles/FurnitureAuric/AuricAbsorberTile.cs b/Tiles/FurnitureAuric/AuricAbsorberTile.cs index 2d6f075873..133cbee19f 100644 --- a/Tiles/FurnitureAuric/AuricAbsorberTile.cs +++ b/Tiles/FurnitureAuric/AuricAbsorberTile.cs @@ -24,23 +24,9 @@ namespace CalamityMod.Tiles.FurnitureAuric public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { var tileCache = Main.tile[i, j]; - Color drawColour = GetDrawColour(i, j, Color.White); - - TileFramingSystem.SlopedGlowmask(in tileCache, i, j, TextureAssets.Tile[Type].Value, null, GetDrawColour(i, j, drawColour), default); + TileFramingSystem.SlopedGlowmask(in tileCache, i, j, TextureAssets.Tile[Type].Value, null, CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Color.White), default); } - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); diff --git a/Tiles/FurnitureMonolith/MonolithBathtub.cs b/Tiles/FurnitureMonolith/MonolithBathtub.cs index 5aae1e2385..3ce05394fc 100644 --- a/Tiles/FurnitureMonolith/MonolithBathtub.cs +++ b/Tiles/FurnitureMonolith/MonolithBathtub.cs @@ -25,23 +25,10 @@ namespace CalamityMod.Tiles.FurnitureMonolith int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithBathtubGlow").Value; - Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } - - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } } } diff --git a/Tiles/FurnitureMonolith/MonolithBed.cs b/Tiles/FurnitureMonolith/MonolithBed.cs index 6ae7cbfc5e..49e88eb271 100644 --- a/Tiles/FurnitureMonolith/MonolithBed.cs +++ b/Tiles/FurnitureMonolith/MonolithBed.cs @@ -27,25 +27,12 @@ namespace CalamityMod.Tiles.FurnitureMonolith int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithBedGlow").Value; - Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } - public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); diff --git a/Tiles/FurnitureMonolith/MonolithBench.cs b/Tiles/FurnitureMonolith/MonolithBench.cs index 0400bf17ab..624f9e10f4 100644 --- a/Tiles/FurnitureMonolith/MonolithBench.cs +++ b/Tiles/FurnitureMonolith/MonolithBench.cs @@ -28,25 +28,12 @@ namespace CalamityMod.Tiles.FurnitureMonolith int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithBenchGlow").Value; - Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } - public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.BenchSitInfo(i, j, ref info); public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); diff --git a/Tiles/FurnitureMonolith/MonolithBookcase.cs b/Tiles/FurnitureMonolith/MonolithBookcase.cs index 60e6ef752a..573af1ad49 100644 --- a/Tiles/FurnitureMonolith/MonolithBookcase.cs +++ b/Tiles/FurnitureMonolith/MonolithBookcase.cs @@ -26,23 +26,10 @@ namespace CalamityMod.Tiles.FurnitureMonolith int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithBookcaseGlow").Value; - Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } - - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } } } diff --git a/Tiles/FurnitureMonolith/MonolithCandelabra.cs b/Tiles/FurnitureMonolith/MonolithCandelabra.cs index 19f60bb71e..f917cbbb59 100644 --- a/Tiles/FurnitureMonolith/MonolithCandelabra.cs +++ b/Tiles/FurnitureMonolith/MonolithCandelabra.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Tiles.FurnitureMonolith int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithCandelabraGlow").Value; - Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); @@ -35,19 +35,6 @@ namespace CalamityMod.Tiles.FurnitureMonolith Main.spriteBatch.Draw(glowmaskBright, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } - public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { if (Main.tile[i, j].TileFrameX < 18) diff --git a/Tiles/FurnitureMonolith/MonolithCandle.cs b/Tiles/FurnitureMonolith/MonolithCandle.cs index 33fdb3f075..bfff448231 100644 --- a/Tiles/FurnitureMonolith/MonolithCandle.cs +++ b/Tiles/FurnitureMonolith/MonolithCandle.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Tiles.FurnitureMonolith int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithCandleGlow").Value; - Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y - 4) + zero; Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 20)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); @@ -35,19 +35,6 @@ namespace CalamityMod.Tiles.FurnitureMonolith Main.spriteBatch.Draw(glowmaskBright, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 20)), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } - public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { if (Main.tile[i, j].TileFrameX < 18) diff --git a/Tiles/FurnitureMonolith/MonolithChair.cs b/Tiles/FurnitureMonolith/MonolithChair.cs index 408a20c2e3..ac8524312b 100644 --- a/Tiles/FurnitureMonolith/MonolithChair.cs +++ b/Tiles/FurnitureMonolith/MonolithChair.cs @@ -29,25 +29,12 @@ namespace CalamityMod.Tiles.FurnitureMonolith int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithChairGlow").Value; - Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } - public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.ChairSitInfo(i, j, ref info); public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); diff --git a/Tiles/FurnitureMonolith/MonolithChandelier.cs b/Tiles/FurnitureMonolith/MonolithChandelier.cs index 8ff78595b1..b6776a0b44 100644 --- a/Tiles/FurnitureMonolith/MonolithChandelier.cs +++ b/Tiles/FurnitureMonolith/MonolithChandelier.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Tiles.FurnitureMonolith int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithChandelierGlow").Value; - Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); @@ -35,19 +35,6 @@ namespace CalamityMod.Tiles.FurnitureMonolith Main.spriteBatch.Draw(glowmaskBright, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } - public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { if (Main.tile[i, j].TileFrameX < 18) diff --git a/Tiles/FurnitureMonolith/MonolithChest.cs b/Tiles/FurnitureMonolith/MonolithChest.cs index 435852091e..47cba4785d 100644 --- a/Tiles/FurnitureMonolith/MonolithChest.cs +++ b/Tiles/FurnitureMonolith/MonolithChest.cs @@ -66,23 +66,10 @@ namespace CalamityMod.Tiles.FurnitureMonolith int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithChestGlow").Value; - Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } - - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } } } diff --git a/Tiles/FurnitureMonolith/MonolithClock.cs b/Tiles/FurnitureMonolith/MonolithClock.cs index bbb8bcad8a..7cc3d76d67 100644 --- a/Tiles/FurnitureMonolith/MonolithClock.cs +++ b/Tiles/FurnitureMonolith/MonolithClock.cs @@ -29,25 +29,12 @@ namespace CalamityMod.Tiles.FurnitureMonolith int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithClockGlow").Value; - Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } - public override bool RightClick(int x, int y) { return CalamityUtils.ClockRightClick(); diff --git a/Tiles/FurnitureMonolith/MonolithDoorClosed.cs b/Tiles/FurnitureMonolith/MonolithDoorClosed.cs index 2303eff699..9190b4cc09 100644 --- a/Tiles/FurnitureMonolith/MonolithDoorClosed.cs +++ b/Tiles/FurnitureMonolith/MonolithDoorClosed.cs @@ -32,25 +32,12 @@ namespace CalamityMod.Tiles.FurnitureMonolith int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithDoorClosedGlow").Value; - Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } - public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; public override void MouseOver(int i, int j) diff --git a/Tiles/FurnitureMonolith/MonolithDoorOpen.cs b/Tiles/FurnitureMonolith/MonolithDoorOpen.cs index d2c66a4142..a229126bb3 100644 --- a/Tiles/FurnitureMonolith/MonolithDoorOpen.cs +++ b/Tiles/FurnitureMonolith/MonolithDoorOpen.cs @@ -33,25 +33,12 @@ namespace CalamityMod.Tiles.FurnitureMonolith int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithDoorOpenGlow").Value; - Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } - public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; public override void MouseOver(int i, int j) diff --git a/Tiles/FurnitureMonolith/MonolithDresser.cs b/Tiles/FurnitureMonolith/MonolithDresser.cs index 605738a453..7449085189 100644 --- a/Tiles/FurnitureMonolith/MonolithDresser.cs +++ b/Tiles/FurnitureMonolith/MonolithDresser.cs @@ -35,23 +35,10 @@ namespace CalamityMod.Tiles.FurnitureMonolith int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithDresserGlow").Value; - Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } - - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } } } diff --git a/Tiles/FurnitureMonolith/MonolithLamp.cs b/Tiles/FurnitureMonolith/MonolithLamp.cs index 7f89e56e52..c169899dab 100644 --- a/Tiles/FurnitureMonolith/MonolithLamp.cs +++ b/Tiles/FurnitureMonolith/MonolithLamp.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Tiles.FurnitureMonolith int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithLampGlow").Value; - Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); @@ -35,19 +35,6 @@ namespace CalamityMod.Tiles.FurnitureMonolith Main.spriteBatch.Draw(glowmaskBright, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } - public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { if (Main.tile[i, j].TileFrameX < 18) diff --git a/Tiles/FurnitureMonolith/MonolithLantern.cs b/Tiles/FurnitureMonolith/MonolithLantern.cs index 4b4e8d8d3f..e03c7077b2 100644 --- a/Tiles/FurnitureMonolith/MonolithLantern.cs +++ b/Tiles/FurnitureMonolith/MonolithLantern.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Tiles.FurnitureMonolith int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithLanternGlow").Value; - Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); @@ -36,19 +36,6 @@ namespace CalamityMod.Tiles.FurnitureMonolith Main.spriteBatch.Draw(glowmaskBright, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } - public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { if (Main.tile[i, j].TileFrameX < 18) diff --git a/Tiles/FurnitureMonolith/MonolithPiano.cs b/Tiles/FurnitureMonolith/MonolithPiano.cs index d32029c9ba..14385c7fb0 100644 --- a/Tiles/FurnitureMonolith/MonolithPiano.cs +++ b/Tiles/FurnitureMonolith/MonolithPiano.cs @@ -28,23 +28,10 @@ namespace CalamityMod.Tiles.FurnitureMonolith int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithPianoGlow").Value; - Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } - - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } } } diff --git a/Tiles/FurnitureMonolith/MonolithSink.cs b/Tiles/FurnitureMonolith/MonolithSink.cs index bd5897d062..3009c01574 100644 --- a/Tiles/FurnitureMonolith/MonolithSink.cs +++ b/Tiles/FurnitureMonolith/MonolithSink.cs @@ -26,23 +26,10 @@ namespace CalamityMod.Tiles.FurnitureMonolith int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithSinkGlow").Value; - Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } - - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } } } diff --git a/Tiles/FurnitureMonolith/MonolithTable.cs b/Tiles/FurnitureMonolith/MonolithTable.cs index 484b6f4ec1..6a3a0d4c69 100644 --- a/Tiles/FurnitureMonolith/MonolithTable.cs +++ b/Tiles/FurnitureMonolith/MonolithTable.cs @@ -26,23 +26,10 @@ namespace CalamityMod.Tiles.FurnitureMonolith int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithTableGlow").Value; - Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } - - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } } } diff --git a/Tiles/FurnitureMonolith/MonolithWorkbench.cs b/Tiles/FurnitureMonolith/MonolithWorkbench.cs index 2734e9dbbf..cd69fd30d2 100644 --- a/Tiles/FurnitureMonolith/MonolithWorkbench.cs +++ b/Tiles/FurnitureMonolith/MonolithWorkbench.cs @@ -26,23 +26,10 @@ namespace CalamityMod.Tiles.FurnitureMonolith int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithWorkBenchGlow").Value; - Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } - - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } } } diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs b/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs index 7c3049f1ed..016733d5de 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly { Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; - Color drawColour = GetDrawColour(i, j); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Lighting.GetColor(i, j), false); Texture2D cloth = ModContent.Request("CalamityMod/Tiles/FurnitureOtherworldly/OtherworldlyStone_Cloth").Value; DrawExtraTop(i, j, cloth, drawOffset, drawColour); @@ -183,27 +183,6 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly return Main.tile[i + x, j - y].TileType == type == equal; } - private Color GetDrawColour(int i, int j) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType < 13) - { - paintCol.R = (byte)((paintCol.R / 2f) + 128); - paintCol.G = (byte)((paintCol.G / 2f) + 128); - paintCol.B = (byte)((paintCol.B / 2f) + 128); - } - if (colType == 29) - { - paintCol = Color.Black; - } - Color col = Lighting.GetColor(i, j); - col.R = (byte)(paintCol.R / 255f * col.R); - col.G = (byte)(paintCol.G / 255f * col.G); - col.B = (byte)(paintCol.B / 255f * col.B); - return col; - } - private int GetExtraState(string type) { switch (type) diff --git a/Tiles/GlowMaskTile.cs b/Tiles/GlowMaskTile.cs index 80036efbf8..8cbef860ca 100644 --- a/Tiles/GlowMaskTile.cs +++ b/Tiles/GlowMaskTile.cs @@ -64,20 +64,5 @@ namespace CalamityMod.Tiles public virtual void OnUnload() { } public abstract Color GetGlowMaskColor(int i, int j, TileDrawInfo drawData); - - public static Color ApplyPaint(int paintType, Color color, bool deepPaintOnly = true) - { - if (deepPaintOnly && !IsDeepPaint(paintType)) - return color; - - Color paintCol = WorldGen.paintColor(paintType); - color = color.MultiplyRGB(paintCol); - return color; - } - - private static bool IsDeepPaint(int paintType) - { - return PaintID.DeepRedPaint <= paintType && paintType <= PaintID.DeepPinkPaint; - } } } diff --git a/Tiles/LivingFire/LivingBrimstoneFireBlockTile.cs b/Tiles/LivingFire/LivingBrimstoneFireBlockTile.cs index d47571bd64..ddaee0e086 100644 --- a/Tiles/LivingFire/LivingBrimstoneFireBlockTile.cs +++ b/Tiles/LivingFire/LivingBrimstoneFireBlockTile.cs @@ -1,83 +1,25 @@ -using System.Collections.Generic; -using CalamityMod.Dusts; -using CalamityMod.Items.Placeables.LivingFire; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; -using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ObjectData; + namespace CalamityMod.Tiles.LivingFire { public class LivingBrimstoneFireBlockTile : ModTile { - //Thank you to Seraph for getting living fire blocks to work properly. public override void SetStaticDefaults() { Main.tileLighted[Type] = true; - HitSound = SoundID.Dig; + TileID.Sets.CanPlaceNextToNonSolidTile[Type] = true; + DustType = (int)CalamityDusts.Brimstone; AddMapEntry(new Color(178, 34, 34)); AnimationFrameHeight = 90; - Main.tileSolid[Type] = false; - Main.tileNoAttach[Type] = false; - Main.tileFrameImportant[Type] = false; - TileObjectData.newTile.Width = 1; - TileObjectData.newTile.Height = 1; - TileObjectData.newTile.Origin = new Point16(0, 0); - TileObjectData.newTile.CoordinateHeights = new int[] { 16 }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.HookCheckIfCanPlace = new PlacementHook(CanPlaceAlter, -1, 0, true); - TileObjectData.newTile.UsesCustomCanPlace = true; - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(AfterPlacement, -1, 0, false); - - TileObjectData.addTile(Type); } - public int CanPlaceAlter(int i, int j, int type, int style, int direction, int alternate) => 1; + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => offsetY = 2; - public static int AfterPlacement(int i, int j, int type, int style, int direction, int alternate) - { - if (Main.netMode == NetmodeID.MultiplayerClient) - { - NetMessage.SendTileSquare(Main.myPlayer, i, j, 1, 1); - } - return 1; - } - - public override bool CanPlace(int i, int j) - { - List> around = new List> - { - new List() {i, j-1 }, - new List() {i-1, j }, - new List() {i+1, j }, - new List() {i, j+1 } - }; - //if (Main.tile[i, j]) || tile.type == Type - - //return true; //temporary for testing purposes - - if (Main.tile[i, j].WallType != WallID.None) - { - return true; - } - - for (int k = 0; k < around.Count; ++k) - { - Tile tile = Main.tile[around[k][0], around[k][1]]; - if (tile.HasTile && (Main.tileSolid[tile.TileType] || CalamityLists.livingFireBlockList.Contains(tile.TileType))) - { - return true; - } - } - return false; - } - - public override void AnimateTile(ref int frame, ref int frameCounter) - { - frame = Main.tileFrame[TileID.LivingFire]; - } + public override void AnimateTile(ref int frame, ref int frameCounter) => frame = Main.tileFrame[TileID.LivingFire]; public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { @@ -85,11 +27,5 @@ namespace CalamityMod.Tiles.LivingFire g = 0f; b = 0f; } - - public override bool CreateDust(int i, int j, ref int type) - { - Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, (int)CalamityDusts.Brimstone, 0f, 0f, 1, default, 1f); - return false; - } } } diff --git a/Tiles/LivingFire/LivingGodSlayerFireBlockTile.cs b/Tiles/LivingFire/LivingGodSlayerFireBlockTile.cs index 688e1eef69..2ad8f0f689 100644 --- a/Tiles/LivingFire/LivingGodSlayerFireBlockTile.cs +++ b/Tiles/LivingFire/LivingGodSlayerFireBlockTile.cs @@ -1,12 +1,9 @@ -using System.Collections.Generic; -using CalamityMod.Dusts; -using CalamityMod.Items.Placeables.LivingFire; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; -using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ObjectData; + namespace CalamityMod.Tiles.LivingFire { public class LivingGodSlayerFireBlockTile : ModTile @@ -14,69 +11,15 @@ namespace CalamityMod.Tiles.LivingFire public override void SetStaticDefaults() { Main.tileLighted[Type] = true; - HitSound = SoundID.Dig; + TileID.Sets.CanPlaceNextToNonSolidTile[Type] = true; + DustType = (int)CalamityDusts.PurpleCosmilite; AddMapEntry(new Color(186, 85, 211)); AnimationFrameHeight = 90; - Main.tileSolid[Type] = false; - Main.tileNoAttach[Type] = false; - Main.tileFrameImportant[Type] = false; - TileObjectData.newTile.Width = 1; - TileObjectData.newTile.Height = 1; - TileObjectData.newTile.Origin = new Point16(0, 0); - TileObjectData.newTile.CoordinateHeights = new int[] { 16 }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.HookCheckIfCanPlace = new PlacementHook(CanPlaceAlter, -1, 0, true); - TileObjectData.newTile.UsesCustomCanPlace = true; - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(AfterPlacement, -1, 0, false); - - TileObjectData.addTile(Type); } - public int CanPlaceAlter(int i, int j, int type, int style, int direction, int alternate) => 1; + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => offsetY = 2; - public static int AfterPlacement(int i, int j, int type, int style, int direction, int alternate) - { - if (Main.netMode == NetmodeID.MultiplayerClient) - { - NetMessage.SendTileSquare(Main.myPlayer, i, j, 1, 1); - } - return 1; - } - - public override bool CanPlace(int i, int j) - { - List> around = new List> - { - new List() {i, j-1 }, - new List() {i-1, j }, - new List() {i+1, j }, - new List() {i, j+1 } - }; - //if (Main.tile[i, j]) || tile.type == Type - - //return true; //temporary for testing purposes - - if (Main.tile[i, j].WallType != WallID.None) - { - return true; - } - - for (int k = 0; k < around.Count; ++k) - { - Tile tile = Main.tile[around[k][0], around[k][1]]; - if (tile.HasTile && (Main.tileSolid[tile.TileType] || CalamityLists.livingFireBlockList.Contains(tile.TileType))) - { - return true; - } - } - return false; - } - - public override void AnimateTile(ref int frame, ref int frameCounter) - { - frame = Main.tileFrame[TileID.LivingFire]; - } + public override void AnimateTile(ref int frame, ref int frameCounter) => frame = Main.tileFrame[TileID.LivingFire]; public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { @@ -84,11 +27,5 @@ namespace CalamityMod.Tiles.LivingFire g = 0f; b = 1f; } - - public override bool CreateDust(int i, int j, ref int type) - { - Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 1, default, 1f); - return false; - } } } diff --git a/Tiles/LivingFire/LivingHolyFireBlockTile.cs b/Tiles/LivingFire/LivingHolyFireBlockTile.cs index 82a99923db..51d1319a34 100644 --- a/Tiles/LivingFire/LivingHolyFireBlockTile.cs +++ b/Tiles/LivingFire/LivingHolyFireBlockTile.cs @@ -1,12 +1,9 @@ -using System.Collections.Generic; -using CalamityMod.Dusts; -using CalamityMod.Items.Placeables.LivingFire; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; -using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ObjectData; + namespace CalamityMod.Tiles.LivingFire { public class LivingHolyFireBlockTile : ModTile @@ -14,69 +11,15 @@ namespace CalamityMod.Tiles.LivingFire public override void SetStaticDefaults() { Main.tileLighted[Type] = true; - HitSound = SoundID.Dig; + TileID.Sets.CanPlaceNextToNonSolidTile[Type] = true; + DustType = (int)CalamityDusts.ProfanedFire; AddMapEntry(new Color(255, 215, 0)); AnimationFrameHeight = 90; - Main.tileSolid[Type] = false; - Main.tileNoAttach[Type] = false; - Main.tileFrameImportant[Type] = false; - TileObjectData.newTile.Width = 1; - TileObjectData.newTile.Height = 1; - TileObjectData.newTile.Origin = new Point16(0, 0); - TileObjectData.newTile.CoordinateHeights = new int[] { 16 }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.HookCheckIfCanPlace = new PlacementHook(CanPlaceAlter, -1, 0, true); - TileObjectData.newTile.UsesCustomCanPlace = true; - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(AfterPlacement, -1, 0, false); - - TileObjectData.addTile(Type); } - public int CanPlaceAlter(int i, int j, int type, int style, int direction, int alternate) => 1; + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => offsetY = 2; - public static int AfterPlacement(int i, int j, int type, int style, int direction, int alternate) - { - if (Main.netMode == NetmodeID.MultiplayerClient) - { - NetMessage.SendTileSquare(Main.myPlayer, i, j, 1, 1); - } - return 1; - } - - public override bool CanPlace(int i, int j) - { - List> around = new List> - { - new List() {i, j-1 }, - new List() {i-1, j }, - new List() {i+1, j }, - new List() {i, j+1 } - }; - //if (Main.tile[i, j]) || tile.type == Type - - //return true; //temporary for testing purposes - - if (Main.tile[i, j].WallType != WallID.None) - { - return true; - } - - for (int k = 0; k < around.Count; ++k) - { - Tile tile = Main.tile[around[k][0], around[k][1]]; - if (tile.HasTile && (Main.tileSolid[tile.TileType] || CalamityLists.livingFireBlockList.Contains(tile.TileType))) - { - return true; - } - } - return false; - } - - public override void AnimateTile(ref int frame, ref int frameCounter) - { - frame = Main.tileFrame[TileID.LivingFire]; - } + public override void AnimateTile(ref int frame, ref int frameCounter) => frame = Main.tileFrame[TileID.LivingFire]; public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { @@ -84,11 +27,5 @@ namespace CalamityMod.Tiles.LivingFire g = 1f; b = 0f; } - - public override bool CreateDust(int i, int j, ref int type) - { - Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, (int)CalamityDusts.ProfanedFire, 0f, 0f, 1, default, 1f); - return false; - } } } diff --git a/Tiles/LivingFire/LivingPlagueFireBlockTile.cs b/Tiles/LivingFire/LivingPlagueFireBlockTile.cs index 10f9f299e6..a99e7b7b64 100644 --- a/Tiles/LivingFire/LivingPlagueFireBlockTile.cs +++ b/Tiles/LivingFire/LivingPlagueFireBlockTile.cs @@ -1,82 +1,25 @@ -using System.Collections.Generic; -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; -using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ObjectData; + namespace CalamityMod.Tiles.LivingFire { public class LivingPlagueFireBlockTile : ModTile { - //Thank you to Seraph for getting living fire blocks to work properly. public override void SetStaticDefaults() { Main.tileLighted[Type] = true; - HitSound = SoundID.Dig; + TileID.Sets.CanPlaceNextToNonSolidTile[Type] = true; + DustType = (int)CalamityDusts.Plague; AddMapEntry(new Color(0, 171, 31)); AnimationFrameHeight = 90; - Main.tileSolid[Type] = false; - Main.tileNoAttach[Type] = false; - Main.tileFrameImportant[Type] = false; - TileObjectData.newTile.Width = 1; - TileObjectData.newTile.Height = 1; - TileObjectData.newTile.Origin = new Point16(0, 0); - TileObjectData.newTile.CoordinateHeights = new int[] { 16 }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.HookCheckIfCanPlace = new PlacementHook(CanPlaceAlter, -1, 0, true); - TileObjectData.newTile.UsesCustomCanPlace = true; - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(AfterPlacement, -1, 0, false); - - TileObjectData.addTile(Type); } - public int CanPlaceAlter(int i, int j, int type, int style, int direction, int alternate) => 1; + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => offsetY = 2; - public static int AfterPlacement(int i, int j, int type, int style, int direction, int alternate) - { - if (Main.netMode == NetmodeID.MultiplayerClient) - { - NetMessage.SendTileSquare(Main.myPlayer, i, j, 1, 1); - } - return 1; - } - - public override bool CanPlace(int i, int j) - { - List> around = new List> - { - new List() {i, j-1 }, - new List() {i-1, j }, - new List() {i+1, j }, - new List() {i, j+1 } - }; - //if (Main.tile[i, j]) || tile.type == Type - - //return true; //temporary for testing purposes - - if (Main.tile[i, j].WallType != WallID.None) - { - return true; - } - - for (int k = 0; k < around.Count; ++k) - { - Tile tile = Main.tile[around[k][0], around[k][1]]; - if (tile.HasTile && (Main.tileSolid[tile.TileType] || CalamityLists.livingFireBlockList.Contains(tile.TileType))) - { - return true; - } - } - return false; - } - - public override void AnimateTile(ref int frame, ref int frameCounter) - { - frame = Main.tileFrame[TileID.LivingFire]; - } + public override void AnimateTile(ref int frame, ref int frameCounter) => frame = Main.tileFrame[TileID.LivingFire]; public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { @@ -84,11 +27,5 @@ namespace CalamityMod.Tiles.LivingFire g = 1f; b = 0.2f; } - - public override bool CreateDust(int i, int j, ref int type) - { - Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, (int)CalamityDusts.Plague, 0f, 0f, 1, default, 1f); - return false; - } } } diff --git a/Tiles/MonsterBanner.png b/Tiles/MonsterBanner.png index f833b58f79..45376746f3 100644 Binary files a/Tiles/MonsterBanner.png and b/Tiles/MonsterBanner.png differ diff --git a/Tiles/Ores/AerialiteOre.cs b/Tiles/Ores/AerialiteOre.cs index c22543b639..eb926362b8 100644 --- a/Tiles/Ores/AerialiteOre.cs +++ b/Tiles/Ores/AerialiteOre.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Tiles.Ores xPos += xOffset; Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; - Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 50)); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 50)); if (!tile.IsHalfBlock && tile.Slope == 0) { Main.spriteBatch.Draw(GlowTexture, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); @@ -92,17 +92,5 @@ namespace CalamityMod.Tiles.Ores Main.spriteBatch.Draw(GlowTexture, drawOffset + new Vector2(0f, 8f), new Rectangle?(new Rectangle(xPos, yPos, 18, 8)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } } - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 13 && colType <= 24) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; - } } } diff --git a/Tiles/Rubblemaker/Abyss/AbyssGiantKelp1Echo.cs b/Tiles/Rubblemaker/Abyss/AbyssGiantKelp1Echo.cs index ce14798b14..fcf1baa9b1 100644 --- a/Tiles/Rubblemaker/Abyss/AbyssGiantKelp1Echo.cs +++ b/Tiles/Rubblemaker/Abyss/AbyssGiantKelp1Echo.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Tiles/Rubblemaker/Abyss/AbyssGiantKelp3Echo.cs b/Tiles/Rubblemaker/Abyss/AbyssGiantKelp3Echo.cs index 89c2eee98d..9a4a19759d 100644 --- a/Tiles/Rubblemaker/Abyss/AbyssGiantKelp3Echo.cs +++ b/Tiles/Rubblemaker/Abyss/AbyssGiantKelp3Echo.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Tiles/Rubblemaker/Abyss/AbyssGiantKelp4Echo.cs b/Tiles/Rubblemaker/Abyss/AbyssGiantKelp4Echo.cs index 3ef26c8964..c1229ed58c 100644 --- a/Tiles/Rubblemaker/Abyss/AbyssGiantKelp4Echo.cs +++ b/Tiles/Rubblemaker/Abyss/AbyssGiantKelp4Echo.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Tiles/Rubblemaker/Abyss/BulbTreeEcho.cs b/Tiles/Rubblemaker/Abyss/BulbTreeEcho.cs index 5c15350845..d08fbdacd0 100644 --- a/Tiles/Rubblemaker/Abyss/BulbTreeEcho.cs +++ b/Tiles/Rubblemaker/Abyss/BulbTreeEcho.cs @@ -1,5 +1,5 @@ using CalamityMod.Dusts; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Tiles/Rubblemaker/Abyss/GravelPileEcho.cs b/Tiles/Rubblemaker/Abyss/GravelPileEcho.cs index e7fe4bee22..a9583003bd 100644 --- a/Tiles/Rubblemaker/Abyss/GravelPileEcho.cs +++ b/Tiles/Rubblemaker/Abyss/GravelPileEcho.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Rubblemaker/Abyss/PlantyMushPileEcho.cs b/Tiles/Rubblemaker/Abyss/PlantyMushPileEcho.cs index 59b7e44cfb..1bfa8f1d57 100644 --- a/Tiles/Rubblemaker/Abyss/PlantyMushPileEcho.cs +++ b/Tiles/Rubblemaker/Abyss/PlantyMushPileEcho.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Tiles/Rubblemaker/Abyss/ShaleColumnsEcho.cs b/Tiles/Rubblemaker/Abyss/ShaleColumnsEcho.cs index 57b86fcbbc..e078ae2fd6 100644 --- a/Tiles/Rubblemaker/Abyss/ShaleColumnsEcho.cs +++ b/Tiles/Rubblemaker/Abyss/ShaleColumnsEcho.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Rubblemaker/Abyss/ShalePileEcho.cs b/Tiles/Rubblemaker/Abyss/ShalePileEcho.cs index 99a873c1fa..c167fde74d 100644 --- a/Tiles/Rubblemaker/Abyss/ShalePileEcho.cs +++ b/Tiles/Rubblemaker/Abyss/ShalePileEcho.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Rubblemaker/Abyss/SpiderCoralEcho.cs b/Tiles/Rubblemaker/Abyss/SpiderCoralEcho.cs index af0777adcf..f463aa1ff8 100644 --- a/Tiles/Rubblemaker/Abyss/SpiderCoralEcho.cs +++ b/Tiles/Rubblemaker/Abyss/SpiderCoralEcho.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Tiles/Rubblemaker/Abyss/SulphurPireCoralEcho.cs b/Tiles/Rubblemaker/Abyss/SulphurPireCoralEcho.cs index b4ba9566c8..eb0d6f6388 100644 --- a/Tiles/Rubblemaker/Abyss/SulphurPireCoralEcho.cs +++ b/Tiles/Rubblemaker/Abyss/SulphurPireCoralEcho.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Tiles/Rubblemaker/Abyss/SulphurTubeCoralEcho.cs b/Tiles/Rubblemaker/Abyss/SulphurTubeCoralEcho.cs index e7a066e4af..760b8d08c3 100644 --- a/Tiles/Rubblemaker/Abyss/SulphurTubeCoralEcho.cs +++ b/Tiles/Rubblemaker/Abyss/SulphurTubeCoralEcho.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Rubblemaker/Astral/AstralDesertLargePilesEcho.cs b/Tiles/Rubblemaker/Astral/AstralDesertLargePilesEcho.cs index 606b0eaec4..f9c243dd11 100644 --- a/Tiles/Rubblemaker/Astral/AstralDesertLargePilesEcho.cs +++ b/Tiles/Rubblemaker/Astral/AstralDesertLargePilesEcho.cs @@ -1,5 +1,5 @@ using CalamityMod.Dusts; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Astral; using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent; diff --git a/Tiles/Rubblemaker/Astral/AstralDesertMediumPilesEcho.cs b/Tiles/Rubblemaker/Astral/AstralDesertMediumPilesEcho.cs index d4dfbc4607..62d53452e4 100644 --- a/Tiles/Rubblemaker/Astral/AstralDesertMediumPilesEcho.cs +++ b/Tiles/Rubblemaker/Astral/AstralDesertMediumPilesEcho.cs @@ -1,6 +1,6 @@  using CalamityMod.Dusts; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Astral; using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent; diff --git a/Tiles/Rubblemaker/Astral/AstralDesertSmallPilesEcho.cs b/Tiles/Rubblemaker/Astral/AstralDesertSmallPilesEcho.cs index 5ee77beaec..8d5acdb8bf 100644 --- a/Tiles/Rubblemaker/Astral/AstralDesertSmallPilesEcho.cs +++ b/Tiles/Rubblemaker/Astral/AstralDesertSmallPilesEcho.cs @@ -1,6 +1,6 @@  using CalamityMod.Dusts; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Astral; using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent; diff --git a/Tiles/Rubblemaker/Astral/AstralIceLargePilesEcho.cs b/Tiles/Rubblemaker/Astral/AstralIceLargePilesEcho.cs index c987086466..b77e7d5ae4 100644 --- a/Tiles/Rubblemaker/Astral/AstralIceLargePilesEcho.cs +++ b/Tiles/Rubblemaker/Astral/AstralIceLargePilesEcho.cs @@ -1,6 +1,6 @@  using CalamityMod.Dusts; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Astral; using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent; diff --git a/Tiles/Rubblemaker/Astral/AstralIceMediumPilesEcho.cs b/Tiles/Rubblemaker/Astral/AstralIceMediumPilesEcho.cs index 80a6cf10a7..649f5e4a1a 100644 --- a/Tiles/Rubblemaker/Astral/AstralIceMediumPilesEcho.cs +++ b/Tiles/Rubblemaker/Astral/AstralIceMediumPilesEcho.cs @@ -1,6 +1,6 @@  using CalamityMod.Dusts; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Astral; using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent; diff --git a/Tiles/Rubblemaker/Astral/AstralIceSmallPilesEcho.cs b/Tiles/Rubblemaker/Astral/AstralIceSmallPilesEcho.cs index 0103e9dac0..dab0b83dd6 100644 --- a/Tiles/Rubblemaker/Astral/AstralIceSmallPilesEcho.cs +++ b/Tiles/Rubblemaker/Astral/AstralIceSmallPilesEcho.cs @@ -1,6 +1,6 @@  using CalamityMod.Dusts; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Astral; using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent; diff --git a/Tiles/Rubblemaker/Astral/AstralNormalLargePilesEcho.cs b/Tiles/Rubblemaker/Astral/AstralNormalLargePilesEcho.cs index 5876bc6594..caec037f36 100644 --- a/Tiles/Rubblemaker/Astral/AstralNormalLargePilesEcho.cs +++ b/Tiles/Rubblemaker/Astral/AstralNormalLargePilesEcho.cs @@ -1,5 +1,5 @@ using CalamityMod.Dusts; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Astral; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Rubblemaker/Astral/AstralNormalMediumPilesEcho.cs b/Tiles/Rubblemaker/Astral/AstralNormalMediumPilesEcho.cs index 7f1f7a2cb2..d6632afec2 100644 --- a/Tiles/Rubblemaker/Astral/AstralNormalMediumPilesEcho.cs +++ b/Tiles/Rubblemaker/Astral/AstralNormalMediumPilesEcho.cs @@ -1,5 +1,5 @@ using CalamityMod.Dusts; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Astral; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Rubblemaker/Astral/AstralNormalSmallPilesEcho.cs b/Tiles/Rubblemaker/Astral/AstralNormalSmallPilesEcho.cs index e401c4e2ac..7303eac489 100644 --- a/Tiles/Rubblemaker/Astral/AstralNormalSmallPilesEcho.cs +++ b/Tiles/Rubblemaker/Astral/AstralNormalSmallPilesEcho.cs @@ -1,5 +1,5 @@ using CalamityMod.Dusts; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Astral; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Rubblemaker/Astral/AstralStoneLargePilesEcho.cs b/Tiles/Rubblemaker/Astral/AstralStoneLargePilesEcho.cs new file mode 100644 index 0000000000..8f206eb760 --- /dev/null +++ b/Tiles/Rubblemaker/Astral/AstralStoneLargePilesEcho.cs @@ -0,0 +1,45 @@ +using CalamityMod.Dusts; +using CalamityMod.Items.Placeables.Astral; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Rubblemake.Astral +{ + public class AstralStoneLargePilesEcho : ModTile + { + public override string Texture => "CalamityMod/Tiles/Astral/AstralStoneLargePiles"; + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoFail[Type] = true; + Main.tileObsidianKill[Type] = true; + + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); + TileObjectData.addTile(Type); + + DustType = ModContent.DustType(); + + AddMapEntry(new Color(79, 61, 97)); + + RegisterItemDrop(ModContent.ItemType()); + FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0, 1, 2, 3, 4, 5); + + base.SetStaticDefaults(); + } + + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) + { + offsetY = 2; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 4; + } + } +} diff --git a/Tiles/Rubblemaker/Astral/AstralStoneMediumPilesEcho.cs b/Tiles/Rubblemaker/Astral/AstralStoneMediumPilesEcho.cs new file mode 100644 index 0000000000..70e04a1460 --- /dev/null +++ b/Tiles/Rubblemaker/Astral/AstralStoneMediumPilesEcho.cs @@ -0,0 +1,46 @@ +using CalamityMod.Dusts; +using CalamityMod.Items.Placeables.Astral; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Rubblemake.Astral +{ + public class AstralStoneMediumPilesEcho : ModTile + { + public override string Texture => "CalamityMod/Tiles/Astral/AstralStoneMediumPiles"; + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoFail[Type] = true; + Main.tileObsidianKill[Type] = true; + + TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); + TileObjectData.addTile(Type); + + DustType = ModContent.DustType(); + + AddMapEntry(new Color(79, 61, 97)); + + RegisterItemDrop(ModContent.ItemType()); + FlexibleTileWand.RubblePlacementMedium.AddVariations(ModContent.ItemType(), Type, 0, 1, 2, 3, 4, 5); + + + base.SetStaticDefaults(); + } + + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) + { + offsetY = 2; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 4; + } + } +} diff --git a/Tiles/Rubblemaker/Astral/AstralStoneSmallPilesEcho.cs b/Tiles/Rubblemaker/Astral/AstralStoneSmallPilesEcho.cs new file mode 100644 index 0000000000..9930a15562 --- /dev/null +++ b/Tiles/Rubblemaker/Astral/AstralStoneSmallPilesEcho.cs @@ -0,0 +1,41 @@ +using CalamityMod.Dusts; +using CalamityMod.Items.Placeables.Astral; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Rubblemake.Astral +{ + public class AstralStoneSmallPilesEcho : ModTile + { + public override string Texture => "CalamityMod/Tiles/Astral/AstralStoneSmallPiles"; + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoFail[Type] = true; + Main.tileObsidianKill[Type] = true; + + DustType = ModContent.DustType(); + AddMapEntry(new Color(79, 61, 97)); + + RegisterItemDrop(ModContent.ItemType()); + FlexibleTileWand.RubblePlacementSmall.AddVariations(ModContent.ItemType(), Type, 0, 1, 2, 3, 4, 5); + + + base.SetStaticDefaults(); + } + + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) + { + offsetY = 2; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 4; + } + } +} diff --git a/Tiles/Rubblemaker/SulphurousSea/SulphurousColumnEcho.cs b/Tiles/Rubblemaker/SulphurousSea/SulphurousColumnEcho.cs index 013c4246f6..60c30ebb13 100644 --- a/Tiles/Rubblemaker/SulphurousSea/SulphurousColumnEcho.cs +++ b/Tiles/Rubblemaker/SulphurousSea/SulphurousColumnEcho.cs @@ -1,5 +1,5 @@ using CalamityMod.Dusts; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Abyss; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Rubblemaker/SunkenSea/BrainCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/BrainCoralEcho.cs index 9de2a1b76e..b3da12ec94 100644 --- a/Tiles/Rubblemaker/SunkenSea/BrainCoralEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/BrainCoralEcho.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent; diff --git a/Tiles/Rubblemaker/SunkenSea/FanCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/FanCoralEcho.cs index 73da906b60..85dd31c031 100644 --- a/Tiles/Rubblemaker/SunkenSea/FanCoralEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/FanCoralEcho.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Waters; using Microsoft.Xna.Framework; using Terraria; diff --git a/Tiles/Rubblemaker/SunkenSea/SeaAnemoneEcho.cs b/Tiles/Rubblemaker/SunkenSea/SeaAnemoneEcho.cs index 11948f22aa..119a1db8b2 100644 --- a/Tiles/Rubblemaker/SunkenSea/SeaAnemoneEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/SeaAnemoneEcho.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent; diff --git a/Tiles/Rubblemaker/SunkenSea/SmallBrainCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/SmallBrainCoralEcho.cs index 8eae4a37e7..11c4770866 100644 --- a/Tiles/Rubblemaker/SunkenSea/SmallBrainCoralEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/SmallBrainCoralEcho.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Rubblemaker/SunkenSea/SmallTubeCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/SmallTubeCoralEcho.cs index 74b3418a4f..2924b84bd4 100644 --- a/Tiles/Rubblemaker/SunkenSea/SmallTubeCoralEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/SmallTubeCoralEcho.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent; diff --git a/Tiles/Rubblemaker/SunkenSea/TableCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/TableCoralEcho.cs index d210666410..584db3c713 100644 --- a/Tiles/Rubblemaker/SunkenSea/TableCoralEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/TableCoralEcho.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Rubblemaker/SunkenSea/TubeCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/TubeCoralEcho.cs index 1ca9b428a7..36538fa9f1 100644 --- a/Tiles/Rubblemaker/SunkenSea/TubeCoralEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/TubeCoralEcho.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent; diff --git a/Tiles/SunkenSea/EutrophicGlass.cs b/Tiles/SunkenSea/EutrophicGlass.cs index b7831db43e..a11f188fe4 100644 --- a/Tiles/SunkenSea/EutrophicGlass.cs +++ b/Tiles/SunkenSea/EutrophicGlass.cs @@ -58,20 +58,7 @@ namespace CalamityMod.Tiles.SunkenSea Rectangle frame = new Rectangle(tile.TileFrameX + frameXOffset, tile.TileFrameY + frameYOffset, 16, 16); Color color = Lighting.GetColor(i, j) * transparency; - TileFramingSystem.SlopedGlowmask(in tile, i, j, tex, frame, GetDrawColour(i, j, color), default); - } - - private Color GetDrawColour(int i, int j, Color colour) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType >= 0 && colType <= 30) - { - colour.R = (byte)(paintCol.R / 255f * colour.R); - colour.G = (byte)(paintCol.G / 255f * colour.G); - colour.B = (byte)(paintCol.B / 255f * colour.B); - } - return colour; + TileFramingSystem.SlopedGlowmask(in tile, i, j, tex, frame, CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, color, false), default); } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) diff --git a/Tiles/SunkenSea/SeaPrismCrystals.cs b/Tiles/SunkenSea/SeaPrismCrystals.cs index 45cd6ba00b..dd064e88e7 100644 --- a/Tiles/SunkenSea/SeaPrismCrystals.cs +++ b/Tiles/SunkenSea/SeaPrismCrystals.cs @@ -1,5 +1,5 @@ using System; -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.SunkenSea; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Tiles/UelibloomBrick.cs b/Tiles/UelibloomBrick.cs index ebfa300dfd..92ba0fcfb6 100644 --- a/Tiles/UelibloomBrick.cs +++ b/Tiles/UelibloomBrick.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Tiles { Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; - Color drawColour = GetDrawColour(i, j); + Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Lighting.GetColor(i, j), false); Texture2D leaves = ModContent.Request("CalamityMod/Tiles/UelibloomBrick_Leaves").Value; DrawExtraTop(i, j, leaves, drawOffset, drawColour); @@ -194,27 +194,6 @@ namespace CalamityMod.Tiles return Main.tile[i + x, j - y].TileType == type == equal; } - private Color GetDrawColour(int i, int j) - { - int colType = Main.tile[i, j].TileColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType < 13) - { - paintCol.R = (byte)((paintCol.R / 2f) + 128); - paintCol.G = (byte)((paintCol.G / 2f) + 128); - paintCol.B = (byte)((paintCol.B / 2f) + 128); - } - if (colType == 29) - { - paintCol = Color.Black; - } - Color col = Lighting.GetColor(i, j); - col.R = (byte)(paintCol.R / 255f * col.R); - col.G = (byte)(paintCol.G / 255f * col.G); - col.B = (byte)(paintCol.B / 255f * col.B); - return col; - } - private int GetExtraState(string type) { switch (type) diff --git a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs index 0af121ab93..9791f7ac0b 100644 --- a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs +++ b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs @@ -183,6 +183,9 @@ namespace CalamityMod.UI.CalamitasEnchants cost *= CurrentlyHeldItem.stack; } + // Calamitas' happiness also affects the cost + cost = (int)(cost * Main.LocalPlayer.currentShoppingSettings.PriceAdjustment); + // Make it 20% cheaper if the player has the Discount Card or Greedy Ring if (Main.LocalPlayer.discountAvailable) cost = (int)(cost * 0.8); diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index 86de4cc8d0..391c334539 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -235,14 +235,18 @@ namespace CalamityMod.UI.CalamitasEnchants // Yes, this is a LOT of damage but given the limited range of this thing it needs to be extremely powerful when it does actually hit. var source = player.GetSource_ItemUse(player.ActiveItem()); float taintedRatio = 5f; - int damage = (int)player.GetTotalDamage().ApplyTo(player.ActiveItem().damage * taintedRatio); - int blade = Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI, 0f, player.ActiveItem().type); - if (Main.projectile.IndexInRange(blade)) - Main.projectile[blade].localAI[0] = 0f; + int damage = (int)(player.ActiveItem().damage * taintedRatio); + Projectile blade = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI, 0f, player.ActiveItem().type); + blade.localAI[0] = 0f; + blade.originalDamage = damage; + blade.OriginalArmorPenetration = player.ActiveItem().ArmorPenetration; + blade.OriginalCritChance = player.ActiveItem().crit; - blade = Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI, 1f, player.ActiveItem().type); - if (Main.projectile.IndexInRange(blade)) - Main.projectile[blade].localAI[0] = -80f; + blade = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI, 1f, player.ActiveItem().type); + blade.localAI[0] = -80f; + blade.originalDamage = damage; + blade.OriginalArmorPenetration = player.ActiveItem().ArmorPenetration; + blade.OriginalCritChance = player.ActiveItem().crit; } }, item => item.IsEnchantable() && item.damage > 0 && item.CountsAsClass() && !item.noUseGraphic && item.shoot > ProjectileID.None), diff --git a/Utilities/CollisionUtils.cs b/Utilities/CollisionUtils.cs index 83f827a4c7..bcd80a65c7 100644 --- a/Utilities/CollisionUtils.cs +++ b/Utilities/CollisionUtils.cs @@ -25,6 +25,13 @@ namespace CalamityMod return Collision.CheckAABBvLineCollision(targetTopLeft, targetHitboxDimensions, start, end, entity.width * scale, ref _); } + /// + /// Shortcut used to make projectiles have rotating hitbox collision. + /// + /// The projectile. + /// The rectangle for the target hitbox. + public static bool RotatingHitboxCollision(this Projectile proj, Rectangle targetHitbox) => RotatingHitboxCollision(proj, targetHitbox.TopLeft(), targetHitbox.Size(), (proj.rotation + MathHelper.PiOver2).ToRotationVector2(), proj.scale); + /// /// Determines if a typical hitbox rectangle is intersecting a circular hitbox. /// diff --git a/Utilities/DrawingUtils.cs b/Utilities/DrawingUtils.cs index 092f151764..08bf4b543b 100644 --- a/Utilities/DrawingUtils.cs +++ b/Utilities/DrawingUtils.cs @@ -458,7 +458,7 @@ namespace CalamityMod return new Rectangle(0, item.height * frame, item.width, item.height); } - public static void DrawHook(this Projectile projectile, Texture2D hookTexture, float angleAdditive = 0f) + public static bool DrawHook(this Projectile projectile, Texture2D hookTexture, float angleAdditive = 0f) { Player player = Main.player[projectile.owner]; Vector2 center = projectile.Center; @@ -485,6 +485,7 @@ namespace CalamityMod hookTexture.Size() / 2, 1f, SpriteEffects.None, 0f); } } + return true; } internal static void IterateDisco(ref Color c, ref float aiParam, in byte discoIter = 7) diff --git a/Utilities/GlobalEntityUtils.cs b/Utilities/GlobalEntityUtils.cs index 7e5c2490f3..5376de2c92 100644 --- a/Utilities/GlobalEntityUtils.cs +++ b/Utilities/GlobalEntityUtils.cs @@ -19,22 +19,30 @@ namespace CalamityMod /// true If we successfully get GlobalNPC. otherwise false public static bool TryGetGlobalNPCSafer(this NPC npc, out T globalNPC) where T : GlobalNPC { - if (npc is null) + try + { + if (npc is null) + { + globalNPC = null; + return false; + } + + int slot = ModContent.GetInstance()?.PerEntityIndex ?? -1; + int length = npc.EntityGlobals.Length; + if (slot < 0 || slot >= length) + { + globalNPC = null; + return false; + } + + npc.TryGetGlobalNPC(out globalNPC); + return globalNPC != null; + } + catch { globalNPC = null; return false; } - - int slot = ModContent.GetInstance()?.PerEntityIndex ?? -1; - int length = npc.EntityGlobals.Length; - if (slot < 0 || slot >= length) - { - globalNPC = null; - return false; - } - - npc.TryGetGlobalNPC(out globalNPC); - return globalNPC != null; } } } diff --git a/Utilities/LocalizationUtils.cs b/Utilities/LocalizationUtils.cs index 6ec6e5d93a..e1c875f598 100644 --- a/Utilities/LocalizationUtils.cs +++ b/Utilities/LocalizationUtils.cs @@ -79,5 +79,11 @@ namespace CalamityMod /// NOTE: Modded translations are not loaded until after PostSetupContent.Caching the result is suggested. /// public static string GetTextValueFromModItem(string suffix) where T : ModItem => GetTextFromModItem(ModContent.ItemType(), suffix).ToString(); + + // Double-rounded for proper digit cutoffs + public static string FramesToSeconds(this int frame) => float.Parse((frame / 60f).ToString("N2")).ToString(); + public static string ToRegenPerSecond(this int regen) => float.Parse((regen * 0.5f).ToString("N2")).ToString(); + public static string ToJumpSpeedPercent(this float boost) => float.Parse((boost * 20f).ToString("N2")).ToString(); + public static string ToPercent(this float percent) => float.Parse((percent * 100f).ToString("N4")).ToString(); } } diff --git a/Utilities/MiscUtils.cs b/Utilities/MiscUtils.cs index 27cb806879..2407103f72 100644 --- a/Utilities/MiscUtils.cs +++ b/Utilities/MiscUtils.cs @@ -205,6 +205,7 @@ namespace CalamityMod public static int SecondsToFrames(int seconds) => seconds * 60; public static int SecondsToFrames(float seconds) => (int)(seconds * 60); + public static int MinutesToFrames(int minutes) => minutes * 3600; public static bool WithinBounds(this int index, int cap) => index >= 0 && index < cap; diff --git a/Utilities/PlayerUtils.cs b/Utilities/PlayerUtils.cs index e83ae6bd05..df0c716d35 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -131,20 +131,6 @@ namespace CalamityMod return ret; } - /// - /// Extension method which calculates the player's current multiplicative boost to armor set bonus and accessory damage.
- /// This is currently only used by the Old Fashioned drink. - ///
- /// The player whose armor / accessory damage bonus should be applied. - /// The damage to apply the bonus to. - /// Boosted damage. If no boosts are applicable, returns the damage parameter that was passed in. - public static int ApplyArmorAccDamageBonusesTo(this Player player, float damage) - { - if (!player.Calamity().oldFashioned) - return (int)damage; - return (int)(damage * OldFashioned.AccessoryAndSetBonusDamageMultiplier); - } - public static float GetRangedAmmoCostReduction(this Player player) { // Tally up all possible vanilla effects. @@ -331,11 +317,11 @@ namespace CalamityMod #region Location and Biomes public static bool IsUnderwater(this Player player) => Collision.DrownCollision(player.position, player.width, player.height, player.gravDir); - public static bool InSpace(this Player player) + public static bool ReducedSpaceGravity(this Player player) { float x = Main.maxTilesX / 4200f; x *= x; - float spaceGravityMult = (float)((player.position.Y / 16f - (60f + 10f * x)) / (Main.worldSurface / 6.0)); + float spaceGravityMult = (float)((player.position.Y / 16f - (60f + 10f * x)) / (Main.worldSurface / (Main.remixWorld ? 1.0 : 6.0))); return spaceGravityMult < 1f; } diff --git a/Utilities/TileUtils.cs b/Utilities/TileUtils.cs index 9f9685e2df..50442427ef 100644 --- a/Utilities/TileUtils.cs +++ b/Utilities/TileUtils.cs @@ -21,6 +21,7 @@ using CalamityMod.Tiles.SunkenSea; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; @@ -226,6 +227,83 @@ namespace CalamityMod return uniqueAnimationFrame * animationFrameLength; } + /// + /// Gets the color of a tile/wall after paint is applied + /// + /// The ID of the paint, this can be received from the tile's TileColor or WallColor + /// The base color to apply the paint to + /// Whether or not only deep paints should be included. Typically this should be set to false if this isn't being used for a glowmask + /// The original color with paint applied + public static Color ApplyPaint(int paintType, Color color, bool deepPaintOnly = true) + { + if (paintType == PaintID.None) + return color; + + bool isDeep = IsDeepPaint(paintType); + if (deepPaintOnly && !isDeep) + return color; + + Color paintCol = WorldGen.paintColor(paintType); + + if (paintType < PaintID.DeepRedPaint) + { + paintCol.R = (byte)((paintCol.R / 2f) + 128); + paintCol.G = (byte)((paintCol.G / 2f) + 128); + paintCol.B = (byte)((paintCol.B / 2f) + 128); + } + if (paintType == PaintID.ShadowPaint) + { + paintCol = Color.Black; + } + color = color.MultiplyRGB(paintCol); + + return color; + } + + private static bool IsDeepPaint(int paintType) + { + return PaintID.DeepRedPaint >= paintType && paintType <= PaintID.DeepPinkPaint; + } + + /// + /// Draws placed wall with multiple variants, properly painted. + /// + /// The sprite batch. + /// The type of wall. + /// The x co-ordinate of the wall. + /// The y co-ordinate of the wall. + /// The offset within the spritesheet, similar to TileFrame. + /// Whether or not PreDraw is drawn + public static bool DrawMultiVariantWall(this SpriteBatch spriteBatch, int type, int i, int j, int[] sheetOffset) + { + if (spriteBatch is null) + return true; + + spriteBatch.SafeBegin(SpriteSortMode.Immediate, BatchSetting.AlphaBlend, null, Main.GameViewMatrix.TransformationMatrix, () => + { + Tile tile = Main.tile[i, j]; + Effect tileShader = Main.tileShader; + TreePaintingSettings settings = TreePaintSystemData.GetWallSettings(type); + int paintColor = tile.WallColor; + tileShader.Parameters["leafHueTestOffset"]?.SetValue(settings.HueTestOffset); + tileShader.Parameters["leafMinHue"]?.SetValue(settings.SpecialGroupMinimalHueValue); + tileShader.Parameters["leafMaxHue"]?.SetValue(settings.SpecialGroupMaximumHueValue); + tileShader.Parameters["leafMinSat"]?.SetValue(settings.SpecialGroupMinimumSaturationValue); + tileShader.Parameters["leafMaxSat"]?.SetValue(settings.SpecialGroupMaximumSaturationValue); + tileShader.Parameters["invertSpecialGroupResult"]?.SetValue(settings.InvertSpecialGroupResult); + int index = Main.ConvertPaintIdToTileShaderIndex(paintColor, settings.UseSpecialGroups, settings.UseWallShaderHacks); + tileShader.CurrentTechnique.Passes[index].Apply(); + + Texture2D sprite = TextureAssets.Wall[type].Value; + Vector2 offset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + (Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange)) - Vector2.One * 8f; + Rectangle frame = new Rectangle(sheetOffset[0] + tile.WallFrameX, sheetOffset[1] + tile.WallFrameY, 32, 32); + Color lightColor = Lighting.GetColor(i, j); + + spriteBatch.Draw(sprite, offset, frame, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + }); + return false; + } + public static Tile ParanoidTileRetrieval(int x, int y) { if (!WorldGen.InWorld(x, y)) diff --git a/Walls/AshenSlabWall.cs b/Walls/AshenSlabWall.cs index 78e0d401f6..ba96f5121b 100644 --- a/Walls/AshenSlabWall.cs +++ b/Walls/AshenSlabWall.cs @@ -1,7 +1,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -24,28 +23,7 @@ namespace CalamityMod.Walls public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; - public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) - { - Texture2D sprite = TextureAssets.Wall[Type].Value; - Color lightColor = GetWallColour(i, j); - Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - zero -= new Vector2(8, 8); - Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; - int[] sheetOffset = CreatePattern(i, j); - spriteBatch.Draw - ( - sprite, - drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), - lightColor, - 0, - new Vector2(0f, 0f), - 1, - SpriteEffects.None, - 0f - ); - return false; - } + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => spriteBatch.DrawMultiVariantWall(Type, i, j, CreatePattern(i, j)); private int[] CreatePattern(int i, int j) { @@ -54,26 +32,5 @@ namespace CalamityMod.Walls sheetOffset[1] = sheetOffset[1] * 180; return sheetOffset; } - - private Color GetWallColour(int i, int j) - { - int colType = Main.tile[i, j].WallColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType < 13) - { - paintCol.R = (byte)((paintCol.R / 2f) + 128); - paintCol.G = (byte)((paintCol.G / 2f) + 128); - paintCol.B = (byte)((paintCol.B / 2f) + 128); - } - if (colType == 29) - { - paintCol = Color.Black; - } - Color col = Lighting.GetColor(i, j); - col.R = (byte)(paintCol.R / 255f * col.R); - col.G = (byte)(paintCol.G / 255f * col.G); - col.B = (byte)(paintCol.B / 255f * col.B); - return col; - } } } diff --git a/Walls/AstralMonolithWall.cs b/Walls/AstralMonolithWall.cs index 0495a7115f..4fb6c06ea1 100644 --- a/Walls/AstralMonolithWall.cs +++ b/Walls/AstralMonolithWall.cs @@ -2,7 +2,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.GameContent; using Terraria.ModLoader; namespace CalamityMod.Walls @@ -23,28 +22,7 @@ namespace CalamityMod.Walls public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; - public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) - { - Texture2D sprite = TextureAssets.Wall[Type].Value; - Color lightColor = GetWallColour(i, j); - Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - zero -= new Vector2(8, 8); - Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; - int[] sheetOffset = CreatePattern(i, j); - spriteBatch.Draw - ( - sprite, - drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), - lightColor, - 0, - new Vector2(0f, 0f), - 1, - SpriteEffects.None, - 0f - ); - return false; - } + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => spriteBatch.DrawMultiVariantWall(Type, i, j, CreatePattern(i, j)); private int[] CreatePattern(int i, int j) { @@ -53,26 +31,5 @@ namespace CalamityMod.Walls sheetOffset[1] = sheetOffset[1] * 180; return sheetOffset; } - - private Color GetWallColour(int i, int j) - { - int colType = Main.tile[i, j].WallColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType < 13) - { - paintCol.R = (byte)((paintCol.R / 2f) + 128); - paintCol.G = (byte)((paintCol.G / 2f) + 128); - paintCol.B = (byte)((paintCol.B / 2f) + 128); - } - if (colType == 29) - { - paintCol = Color.Black; - } - Color col = Lighting.GetColor(i, j); - col.R = (byte)(paintCol.R / 255f * col.R); - col.G = (byte)(paintCol.G / 255f * col.G); - col.B = (byte)(paintCol.B / 255f * col.B); - return col; - } } } diff --git a/Walls/BrimstoneSlabWall.cs b/Walls/BrimstoneSlabWall.cs index 7629b8ec01..3c0e87b7a2 100644 --- a/Walls/BrimstoneSlabWall.cs +++ b/Walls/BrimstoneSlabWall.cs @@ -1,7 +1,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -29,28 +28,7 @@ namespace CalamityMod.Walls public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; - public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) - { - Texture2D sprite = TextureAssets.Wall[Type].Value; - Color lightColor = GetWallColour(i, j); - Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - zero -= new Vector2(8, 8); - Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; - int[] sheetOffset = CreatePattern(i, j); - spriteBatch.Draw - ( - sprite, - drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), - lightColor, - 0, - new Vector2(0f, 0f), - 1, - SpriteEffects.None, - 0f - ); - return false; - } + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => spriteBatch.DrawMultiVariantWall(Type, i, j, CreatePattern(i, j)); private int[] CreatePattern(int i, int j) { @@ -59,26 +37,5 @@ namespace CalamityMod.Walls sheetOffset[1] = sheetOffset[1] * 180; return sheetOffset; } - - private Color GetWallColour(int i, int j) - { - int colType = Main.tile[i, j].WallColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType < 13) - { - paintCol.R = (byte)((paintCol.R / 2f) + 128); - paintCol.G = (byte)((paintCol.G / 2f) + 128); - paintCol.B = (byte)((paintCol.B / 2f) + 128); - } - if (colType == 29) - { - paintCol = Color.Black; - } - Color col = Lighting.GetColor(i, j); - col.R = (byte)(paintCol.R / 255f * col.R); - col.G = (byte)(paintCol.G / 255f * col.G); - col.B = (byte)(paintCol.B / 255f * col.B); - return col; - } } } diff --git a/Walls/BrimstoneSlagWall.cs b/Walls/BrimstoneSlagWall.cs index 2e2ea5fcbb..8addfebb53 100644 --- a/Walls/BrimstoneSlagWall.cs +++ b/Walls/BrimstoneSlagWall.cs @@ -1,7 +1,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -24,28 +23,7 @@ namespace CalamityMod.Walls public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; - public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) - { - Texture2D sprite = TextureAssets.Wall[Type].Value; - Color lightColor = GetWallColour(i, j); - Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - zero -= new Vector2(8, 8); - Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; - int[] sheetOffset = CreatePattern(i, j); - spriteBatch.Draw - ( - sprite, - drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), - lightColor, - 0, - new Vector2(0f, 0f), - 1, - SpriteEffects.None, - 0f - ); - return false; - } + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => spriteBatch.DrawMultiVariantWall(Type, i, j, CreatePattern(i, j)); private int[] CreatePattern(int i, int j) { @@ -54,26 +32,5 @@ namespace CalamityMod.Walls sheetOffset[1] = sheetOffset[1] * 180; return sheetOffset; } - - private Color GetWallColour(int i, int j) - { - int colType = Main.tile[i, j].WallColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType < 13) - { - paintCol.R = (byte)((paintCol.R / 2f) + 128); - paintCol.G = (byte)((paintCol.G / 2f) + 128); - paintCol.B = (byte)((paintCol.B / 2f) + 128); - } - if (colType == 29) - { - paintCol = Color.Black; - } - Color col = Lighting.GetColor(i, j); - col.R = (byte)(paintCol.R / 255f * col.R); - col.G = (byte)(paintCol.G / 255f * col.G); - col.B = (byte)(paintCol.B / 255f * col.B); - return col; - } } } diff --git a/Walls/BrimstoneSlagWallUnsafe.cs b/Walls/BrimstoneSlagWallUnsafe.cs index ddfdf24e49..c861ce2802 100644 --- a/Walls/BrimstoneSlagWallUnsafe.cs +++ b/Walls/BrimstoneSlagWallUnsafe.cs @@ -1,7 +1,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -24,28 +23,7 @@ namespace CalamityMod.Walls public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; - public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) - { - Texture2D sprite = TextureAssets.Wall[Type].Value; - Color lightColor = GetWallColour(i, j); - Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - zero -= new Vector2(8, 8); - Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; - int[] sheetOffset = CreatePattern(i, j); - spriteBatch.Draw - ( - sprite, - drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), - lightColor, - 0, - new Vector2(0f, 0f), - 1, - SpriteEffects.None, - 0f - ); - return false; - } + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => spriteBatch.DrawMultiVariantWall(Type, i, j, CreatePattern(i, j)); private int[] CreatePattern(int i, int j) { @@ -54,26 +32,5 @@ namespace CalamityMod.Walls sheetOffset[1] = sheetOffset[1] * 180; return sheetOffset; } - - private Color GetWallColour(int i, int j) - { - int colType = Main.tile[i, j].WallColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType < 13) - { - paintCol.R = (byte)((paintCol.R / 2f) + 128); - paintCol.G = (byte)((paintCol.G / 2f) + 128); - paintCol.B = (byte)((paintCol.B / 2f) + 128); - } - if (colType == 29) - { - paintCol = Color.Black; - } - Color col = Lighting.GetColor(i, j); - col.R = (byte)(paintCol.R / 255f * col.R); - col.G = (byte)(paintCol.G / 255f * col.G); - col.B = (byte)(paintCol.B / 255f * col.B); - return col; - } } } diff --git a/Walls/CryonicBrickWall.cs b/Walls/CryonicBrickWall.cs index bbe3ba48cd..5f2c0ce425 100644 --- a/Walls/CryonicBrickWall.cs +++ b/Walls/CryonicBrickWall.cs @@ -24,28 +24,7 @@ namespace CalamityMod.Walls public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; - public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) - { - Texture2D sprite = TextureAssets.Wall[Type].Value; - Color lightColor = GetWallColour(i, j); - Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - zero -= new Vector2(8, 8); - Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; - int[] sheetOffset = CreatePattern(i, j); - spriteBatch.Draw - ( - sprite, - drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), - lightColor, - 0, - new Vector2(0f, 0f), - 1, - SpriteEffects.None, - 0f - ); - return false; - } + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => spriteBatch.DrawMultiVariantWall(Type, i, j, CreatePattern(i, j)); private int[] CreatePattern(int i, int j) { @@ -93,26 +72,5 @@ namespace CalamityMod.Walls sheetOffset[1] = sheetOffset[1] * 180; return sheetOffset; } - - private Color GetWallColour(int i, int j) - { - int colType = Main.tile[i, j].WallColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType < 13) - { - paintCol.R = (byte)((paintCol.R / 2f) + 128); - paintCol.G = (byte)((paintCol.G / 2f) + 128); - paintCol.B = (byte)((paintCol.B / 2f) + 128); - } - if (colType == 29) - { - paintCol = Color.Black; - } - Color col = Lighting.GetColor(i, j); - col.R = (byte)(paintCol.R / 255f * col.R); - col.G = (byte)(paintCol.G / 255f * col.G); - col.B = (byte)(paintCol.B / 255f * col.B); - return col; - } } } diff --git a/Walls/ExoPrismPanelWall.cs b/Walls/ExoPrismPanelWall.cs index fe15711a5e..e12e5d695c 100644 --- a/Walls/ExoPrismPanelWall.cs +++ b/Walls/ExoPrismPanelWall.cs @@ -24,28 +24,7 @@ namespace CalamityMod.Walls public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; - public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) - { - Texture2D sprite = TextureAssets.Wall[Type].Value; - Color lightColor = GetWallColour(i, j); - Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - zero -= new Vector2(8, 8); - Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; - int[] sheetOffset = CreatePattern(i, j); - spriteBatch.Draw - ( - sprite, - drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), - lightColor, - 0, - new Vector2(0f, 0f), - 1, - SpriteEffects.None, - 0f - ); - return false; - } + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => spriteBatch.DrawMultiVariantWall(Type, i, j, CreatePattern(i, j)); private int[] CreatePattern(int i, int j) { @@ -53,26 +32,5 @@ namespace CalamityMod.Walls sheetOffset[1] = sheetOffset[1] * 180; return sheetOffset; } - - private Color GetWallColour(int i, int j) - { - int colType = Main.tile[i, j].WallColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType < 13) - { - paintCol.R = (byte)((paintCol.R / 2f) + 128); - paintCol.G = (byte)((paintCol.G / 2f) + 128); - paintCol.B = (byte)((paintCol.B / 2f) + 128); - } - if (colType == 29) - { - paintCol = Color.Black; - } - Color col = Lighting.GetColor(i, j); - col.R = (byte)(paintCol.R / 255f * col.R); - col.G = (byte)(paintCol.G / 255f * col.G); - col.B = (byte)(paintCol.B / 255f * col.B); - return col; - } } } diff --git a/Walls/FloralWall.cs b/Walls/FloralWall.cs index 6725d57067..fcd4af4b31 100644 --- a/Walls/FloralWall.cs +++ b/Walls/FloralWall.cs @@ -25,28 +25,7 @@ namespace CalamityMod.Walls public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; - public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) - { - Texture2D sprite = TextureAssets.Wall[Type].Value; - Color lightColor = GetWallColour(i, j); - Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - zero -= new Vector2(8, 8); - Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; - int[] sheetOffset = CreatePattern(i, j); - spriteBatch.Draw - ( - sprite, - drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), - lightColor, - 0, - new Vector2(0f, 0f), - 1, - SpriteEffects.None, - 0f - ); - return false; - } + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => spriteBatch.DrawMultiVariantWall(Type, i, j, CreatePattern(i, j)); private int[] CreatePattern(int i, int j) { @@ -88,26 +67,5 @@ namespace CalamityMod.Walls sheetOffset[1] = sheetOffset[1] * 180; return sheetOffset; } - - private Color GetWallColour(int i, int j) - { - int colType = Main.tile[i, j].WallColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType < 13) - { - paintCol.R = (byte)((paintCol.R / 2f) + 128); - paintCol.G = (byte)((paintCol.G / 2f) + 128); - paintCol.B = (byte)((paintCol.B / 2f) + 128); - } - if (colType == 29) - { - paintCol = Color.Black; - } - Color col = Lighting.GetColor(i, j); - col.R = (byte)(paintCol.R / 255f * col.R); - col.G = (byte)(paintCol.G / 255f * col.G); - col.B = (byte)(paintCol.B / 255f * col.B); - return col; - } } } diff --git a/Walls/PerennialBrickWall.cs b/Walls/PerennialBrickWall.cs index 2b160fc779..8ad57d43b3 100644 --- a/Walls/PerennialBrickWall.cs +++ b/Walls/PerennialBrickWall.cs @@ -25,28 +25,7 @@ namespace CalamityMod.Walls public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; - public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) - { - Texture2D sprite = TextureAssets.Wall[Type].Value; - Color lightColor = GetWallColour(i, j); - Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - zero -= new Vector2(8, 8); - Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; - int[] sheetOffset = CreatePattern(i, j); - spriteBatch.Draw - ( - sprite, - drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), - lightColor, - 0, - new Vector2(0f, 0f), - 1, - SpriteEffects.None, - 0f - ); - return false; - } + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => spriteBatch.DrawMultiVariantWall(Type, i, j, CreatePattern(i, j)); private int[] CreatePattern(int i, int j) { @@ -55,26 +34,5 @@ namespace CalamityMod.Walls sheetOffset[1] = sheetOffset[1] * 180; return sheetOffset; } - - private Color GetWallColour(int i, int j) - { - int colType = Main.tile[i, j].WallColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType < 13) - { - paintCol.R = (byte)((paintCol.R / 2f) + 128); - paintCol.G = (byte)((paintCol.G / 2f) + 128); - paintCol.B = (byte)((paintCol.B / 2f) + 128); - } - if (colType == 29) - { - paintCol = Color.Black; - } - Color col = Lighting.GetColor(i, j); - col.R = (byte)(paintCol.R / 255f * col.R); - col.G = (byte)(paintCol.G / 255f * col.G); - col.B = (byte)(paintCol.B / 255f * col.B); - return col; - } } } diff --git a/Walls/ProfanedSlabWall.cs b/Walls/ProfanedSlabWall.cs index 1f76c71d55..a8ca231d45 100644 --- a/Walls/ProfanedSlabWall.cs +++ b/Walls/ProfanedSlabWall.cs @@ -24,28 +24,7 @@ namespace CalamityMod.Walls public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; - public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) - { - Texture2D sprite = TextureAssets.Wall[Type].Value; - Color lightColor = GetWallColour(i, j); - Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - zero -= new Vector2(8, 8); - Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; - int[] sheetOffset = CreatePattern(i, j); - spriteBatch.Draw - ( - sprite, - drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), - lightColor, - 0, - new Vector2(0f, 0f), - 1, - SpriteEffects.None, - 0f - ); - return false; - } + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => spriteBatch.DrawMultiVariantWall(Type, i, j, CreatePattern(i, j)); private int[] CreatePattern(int i, int j) { @@ -54,26 +33,5 @@ namespace CalamityMod.Walls sheetOffset[1] = sheetOffset[1] * 180; return sheetOffset; } - - private Color GetWallColour(int i, int j) - { - int colType = Main.tile[i, j].WallColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType < 13) - { - paintCol.R = (byte)((paintCol.R / 2f) + 128); - paintCol.G = (byte)((paintCol.G / 2f) + 128); - paintCol.B = (byte)((paintCol.B / 2f) + 128); - } - if (colType == 29) - { - paintCol = Color.Black; - } - Color col = Lighting.GetColor(i, j); - col.R = (byte)(paintCol.R / 255f * col.R); - col.G = (byte)(paintCol.G / 255f * col.G); - col.B = (byte)(paintCol.B / 255f * col.B); - return col; - } } } diff --git a/Walls/RunicProfanedBrickWall.cs b/Walls/RunicProfanedBrickWall.cs index 50f974a98d..abd86eace7 100644 --- a/Walls/RunicProfanedBrickWall.cs +++ b/Walls/RunicProfanedBrickWall.cs @@ -26,28 +26,7 @@ namespace CalamityMod.Walls public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; - public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) - { - Texture2D sprite = TextureAssets.Wall[Type].Value; - Color lightColor = GetWallColour(i, j); - Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - zero -= new Vector2(8, 8); - Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; - int[] sheetOffset = CreatePattern(i, j); - spriteBatch.Draw - ( - sprite, - drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), - lightColor, - 0, - new Vector2(0f, 0f), - 1, - SpriteEffects.None, - 0f - ); - return false; - } + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => spriteBatch.DrawMultiVariantWall(Type, i, j, CreatePattern(i, j)); private int[] CreatePattern(int i, int j) { @@ -56,26 +35,5 @@ namespace CalamityMod.Walls sheetOffset[1] = sheetOffset[1] * 180; return sheetOffset; } - - private Color GetWallColour(int i, int j) - { - int colType = Main.tile[i, j].WallColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType < 13) - { - paintCol.R = (byte)((paintCol.R / 2f) + 128); - paintCol.G = (byte)((paintCol.G / 2f) + 128); - paintCol.B = (byte)((paintCol.B / 2f) + 128); - } - if (colType == 29) - { - paintCol = Color.Black; - } - Color col = Lighting.GetColor(i, j); - col.R = (byte)(paintCol.R / 255f * col.R); - col.G = (byte)(paintCol.G / 255f * col.G); - col.B = (byte)(paintCol.B / 255f * col.B); - return col; - } } } diff --git a/Walls/ScorchedBoneWall.cs b/Walls/ScorchedBoneWall.cs index 53abfc1b31..65d8c1305b 100644 --- a/Walls/ScorchedBoneWall.cs +++ b/Walls/ScorchedBoneWall.cs @@ -18,28 +18,7 @@ namespace CalamityMod.Walls public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; - public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) - { - Texture2D sprite = TextureAssets.Wall[Type].Value; - Color lightColor = GetWallColour(i, j); - Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - zero -= new Vector2(8, 8); - Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; - int[] sheetOffset = CreatePattern(i, j); - spriteBatch.Draw - ( - sprite, - drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), - lightColor, - 0, - new Vector2(0f, 0f), - 1, - SpriteEffects.None, - 0f - ); - return false; - } + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => spriteBatch.DrawMultiVariantWall(Type, i, j, CreatePattern(i, j)); private int[] CreatePattern(int i, int j) { @@ -48,26 +27,5 @@ namespace CalamityMod.Walls sheetOffset[1] = sheetOffset[1] * 180; return sheetOffset; } - - private Color GetWallColour(int i, int j) - { - int colType = Main.tile[i, j].WallColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType < 13) - { - paintCol.R = (byte)((paintCol.R / 2f) + 128); - paintCol.G = (byte)((paintCol.G / 2f) + 128); - paintCol.B = (byte)((paintCol.B / 2f) + 128); - } - if (colType == 29) - { - paintCol = Color.Black; - } - Color col = Lighting.GetColor(i, j); - col.R = (byte)(paintCol.R / 255f * col.R); - col.G = (byte)(paintCol.G / 255f * col.G); - col.B = (byte)(paintCol.B / 255f * col.B); - return col; - } } } diff --git a/Walls/VoidstoneSlabWall.cs b/Walls/VoidstoneSlabWall.cs index ceaf8fcd05..4e8d696829 100644 --- a/Walls/VoidstoneSlabWall.cs +++ b/Walls/VoidstoneSlabWall.cs @@ -24,103 +24,15 @@ namespace CalamityMod.Walls public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; - public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) - { - Texture2D sprite = TextureAssets.Wall[Type].Value; - Color lightColor = GetWallColour(i, j); - Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - zero -= new Vector2(8, 8); - Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; - int[] sheetOffset = CreatePattern(i, j); - spriteBatch.Draw - ( - sprite, - drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), - lightColor, - 0, - new Vector2(0f, 0f), - 1, - SpriteEffects.None, - 0f - ); - return false; - } + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => spriteBatch.DrawMultiVariantWall(Type, i, j, CreatePattern(i, j)); private int[] CreatePattern(int i, int j) { - int[] sheetOffset = new int[2] { i % 3, j % 3 }; int xPos = i % 3; int yPos = j % 3; - switch (yPos) - { - case 0: - switch (xPos) - { - case 0: - sheetOffset = new int[2] { 0, 0 }; - break; - case 1: - sheetOffset = new int[2] { 0, 1 }; - break; - case 2: - sheetOffset = new int[2] { 0, 2 }; - break; - } - break; - case 1: - switch (xPos) - { - case 0: - sheetOffset = new int[2] { 0, 3 }; - break; - case 1: - sheetOffset = new int[2] { 0, 4 }; - break; - case 2: - sheetOffset = new int[2] { 0, 0 }; - break; - } - break; - case 2: - switch (xPos) - { - case 0: - sheetOffset = new int[2] { 0, 1 }; - break; - case 1: - sheetOffset = new int[2] { 0, 2 }; - break; - case 2: - sheetOffset = new int[2] { 0, 3 }; - break; - } - break; - } - sheetOffset[0] = sheetOffset[0] * 468; + int[] sheetOffset = new int[2] { 0, (xPos + yPos * 3) % 5 }; sheetOffset[1] = sheetOffset[1] * 180; return sheetOffset; } - - private Color GetWallColour(int i, int j) - { - int colType = Main.tile[i, j].WallColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType < 13) - { - paintCol.R = (byte)((paintCol.R / 2f) + 128); - paintCol.G = (byte)((paintCol.G / 2f) + 128); - paintCol.B = (byte)((paintCol.B / 2f) + 128); - } - if (colType == 29) - { - paintCol = Color.Black; - } - Color col = Lighting.GetColor(i, j); - col.R = (byte)(paintCol.R / 255f * col.R); - col.G = (byte)(paintCol.G / 255f * col.G); - col.B = (byte)(paintCol.B / 255f * col.B); - return col; - } } } diff --git a/Walls/VoidstoneWall.cs b/Walls/VoidstoneWall.cs index ebacecb708..3f9290c465 100644 --- a/Walls/VoidstoneWall.cs +++ b/Walls/VoidstoneWall.cs @@ -33,59 +33,46 @@ namespace CalamityMod.Walls return false; } - public static void DrawWallGlow(int wallType, int i, int j, SpriteBatch spriteBatch) + public static bool DrawWallGlow(int type, int i, int j, SpriteBatch spriteBatch) { if (GlowMask.Texture is null) - return; + return true; - Tile tile = Main.tile[i, j]; - int xLength = 32; - int xOff = 0; - - int xPos = tile.WallFrameX + xOff; - int yPos = tile.WallFrameY; - - Rectangle frame = new Rectangle(xPos, yPos, xLength, 32); - Color drawcolor; - drawcolor = WorldGen.paintColor(tile.WallColor); - drawcolor.A = 255; - Vector2 zero = new Vector2(Main.offScreenRange, Main.offScreenRange); - - if (Main.drawToScreen) - zero = Vector2.Zero; - - Vector2 pos = new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero; - Color lightColor = Lighting.GetColor(i, j, Color.White); - - spriteBatch.Draw(TextureAssets.Wall[wallType].Value, pos + new Vector2(-8 + xOff, -8), frame, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - - if (GlowMask.HasContentInFramePos(xPos, yPos)) + spriteBatch.SafeBegin(SpriteSortMode.Immediate, BatchSetting.AlphaBlend, null, Main.GameViewMatrix.TransformationMatrix, () => { - float brightness = 1f; - float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.007f; - brightness *= MathF.Sin(i / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes); - brightness *= MathF.Sin(j / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes); - brightness *= MathF.Sin(i * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes); - brightness *= MathF.Sin(j * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes); - drawcolor *= brightness; - Color glowColor = drawcolor * 0.4f; + Tile tile = Main.tile[i, j]; + Effect tileShader = Main.tileShader; + TreePaintingSettings settings = TreePaintSystemData.GetWallSettings(type); + int paintColor = tile.WallColor; + tileShader.Parameters["leafHueTestOffset"]?.SetValue(settings.HueTestOffset); + tileShader.Parameters["leafMinHue"]?.SetValue(settings.SpecialGroupMinimalHueValue); + tileShader.Parameters["leafMaxHue"]?.SetValue(settings.SpecialGroupMaximumHueValue); + tileShader.Parameters["leafMinSat"]?.SetValue(settings.SpecialGroupMinimumSaturationValue); + tileShader.Parameters["leafMaxSat"]?.SetValue(settings.SpecialGroupMaximumSaturationValue); + tileShader.Parameters["invertSpecialGroupResult"]?.SetValue(settings.InvertSpecialGroupResult); + int index = Main.ConvertPaintIdToTileShaderIndex(paintColor, settings.UseSpecialGroups, settings.UseWallShaderHacks); + tileShader.CurrentTechnique.Passes[index].Apply(); - // For now checking for glowing frames greatly reducing the bottleneck - // But maybe we could squeeze bit more by removing the loop - for (int k = 0; k < 3; k++) + Texture2D sprite = TextureAssets.Wall[type].Value; + Vector2 offset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + (Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange)) - Vector2.One * 8f; + int yPos = tile.WallFrameY; + int xPos = tile.WallFrameX; + Rectangle frame = new Rectangle(xPos, yPos, 32, 32); + Color lightColor = Lighting.GetColor(i, j); + + spriteBatch.Draw(sprite, offset, frame, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + + if (GlowMask.HasContentInFramePos(xPos, yPos)) { - Vector2 offset = new Vector2(Main.rand.NextFloat(-1, 1f), Main.rand.NextFloat(-1, 1f)) * 0.2f * k; - spriteBatch.Draw(GlowMask.Texture, pos + offset + new Vector2(-8 + xOff, -8), frame, glowColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + Color glowColor = Color.Lerp(lightColor, Color.White, 0.2f + MathF.Sin(Main.GameUpdateCount * 0.007f) * 0.1f); + spriteBatch.Draw(GlowMask.Texture, offset, frame, glowColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); } - } - } - - public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) - { - DrawWallGlow(Type, i, j, spriteBatch); + }); return false; } + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => DrawWallGlow(Type, i, j, spriteBatch); + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; } } diff --git a/Walls/VoidstoneWallUnsafe.cs b/Walls/VoidstoneWallUnsafe.cs index ecb6dc0a0b..deee028dc4 100644 --- a/Walls/VoidstoneWallUnsafe.cs +++ b/Walls/VoidstoneWallUnsafe.cs @@ -42,59 +42,46 @@ namespace CalamityMod.Walls } } - public static void DrawWallGlow(int wallType, int i, int j, SpriteBatch spriteBatch) + public static bool DrawWallGlow(int type, int i, int j, SpriteBatch spriteBatch) { if (GlowMask.Texture is null) - return; + return true; - Tile tile = Main.tile[i, j]; - int xLength = 32; - int xOff = 0; - - int xPos = tile.WallFrameX + xOff; - int yPos = tile.WallFrameY; - - Rectangle frame = new Rectangle(xPos, yPos, xLength, 32); - Color drawcolor; - drawcolor = WorldGen.paintColor(tile.WallColor); - drawcolor.A = 255; - Vector2 zero = new Vector2(Main.offScreenRange, Main.offScreenRange); - - if (Main.drawToScreen) - zero = Vector2.Zero; - - Vector2 pos = new Vector2((i * 16 - (int)Main.screenPosition.X), (j * 16 - (int)Main.screenPosition.Y)) + zero; - Color lightColor = Lighting.GetColor(i, j, Color.White); - - spriteBatch.Draw(TextureAssets.Wall[wallType].Value, pos + new Vector2(-8 + xOff, -8), frame, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - - if (GlowMask.HasContentInFramePos(xPos, yPos)) + spriteBatch.SafeBegin(SpriteSortMode.Immediate, BatchSetting.AlphaBlend, null, Main.GameViewMatrix.TransformationMatrix, () => { - float brightness = 1f; - float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.007f; - brightness *= MathF.Sin(i / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes); - brightness *= MathF.Sin(j / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes); - brightness *= MathF.Sin(i * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes); - brightness *= MathF.Sin(j * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes); - drawcolor *= brightness; - Color glowColor = drawcolor * 0.4f; + Tile tile = Main.tile[i, j]; + Effect tileShader = Main.tileShader; + TreePaintingSettings settings = TreePaintSystemData.GetWallSettings(type); + int paintColor = tile.WallColor; + tileShader.Parameters["leafHueTestOffset"]?.SetValue(settings.HueTestOffset); + tileShader.Parameters["leafMinHue"]?.SetValue(settings.SpecialGroupMinimalHueValue); + tileShader.Parameters["leafMaxHue"]?.SetValue(settings.SpecialGroupMaximumHueValue); + tileShader.Parameters["leafMinSat"]?.SetValue(settings.SpecialGroupMinimumSaturationValue); + tileShader.Parameters["leafMaxSat"]?.SetValue(settings.SpecialGroupMaximumSaturationValue); + tileShader.Parameters["invertSpecialGroupResult"]?.SetValue(settings.InvertSpecialGroupResult); + int index = Main.ConvertPaintIdToTileShaderIndex(paintColor, settings.UseSpecialGroups, settings.UseWallShaderHacks); + tileShader.CurrentTechnique.Passes[index].Apply(); - // For now checking for glowing frames greatly reducing the bottleneck - // But maybe we could squeeze bit more by removing the loop - for (int k = 0; k < 3; k++) + Texture2D sprite = TextureAssets.Wall[type].Value; + Vector2 offset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + (Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange)) - Vector2.One * 8f; + int yPos = tile.WallFrameY; + int xPos = tile.WallFrameX; + Rectangle frame = new Rectangle(xPos, yPos, 32, 32); + Color lightColor = Lighting.GetColor(i, j); + + spriteBatch.Draw(sprite, offset, frame, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + + if (GlowMask.HasContentInFramePos(xPos, yPos)) { - Vector2 offset = new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-1f, 1f)) * 0.2f * k; - spriteBatch.Draw(GlowMask.Texture, pos + offset + new Vector2(-8 + xOff, -8), frame, glowColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + Color glowColor = Color.Lerp(lightColor, Color.White, 0.2f + MathF.Sin(Main.GameUpdateCount * 0.007f) * 0.1f); + spriteBatch.Draw(GlowMask.Texture, offset, frame, glowColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); } - } - } - - public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) - { - DrawWallGlow(Type, i, j, spriteBatch); + }); return false; } + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => DrawWallGlow(Type, i, j, spriteBatch); + public override void KillWall(int i, int j, ref bool fail) => fail = true; public override bool CanExplode(int i, int j) => false; diff --git a/Walls/WulfrumPlatingWall.cs b/Walls/WulfrumPlatingWall.cs index 39fcfcc9cd..32ed421549 100644 --- a/Walls/WulfrumPlatingWall.cs +++ b/Walls/WulfrumPlatingWall.cs @@ -23,28 +23,7 @@ namespace CalamityMod.Walls public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; - public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) - { - Texture2D sprite = TextureAssets.Wall[Type].Value; - Color lightColor = GetWallColour(i, j); - Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - zero -= new Vector2(8, 8); - Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; - int[] sheetOffset = CreatePattern(i, j); - spriteBatch.Draw - ( - sprite, - drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), - lightColor, - 0, - new Vector2(0f, 0f), - 1, - SpriteEffects.None, - 0f - ); - return false; - } + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => spriteBatch.DrawMultiVariantWall(Type, i, j, CreatePattern(i, j)); private int[] CreatePattern(int i, int j) { @@ -53,26 +32,5 @@ namespace CalamityMod.Walls sheetOffset[1] = sheetOffset[1] * 180; return sheetOffset; } - - private Color GetWallColour(int i, int j) - { - int colType = Main.tile[i, j].WallColor; - Color paintCol = WorldGen.paintColor(colType); - if (colType < 13) - { - paintCol.R = (byte)((paintCol.R / 2f) + 128); - paintCol.G = (byte)((paintCol.G / 2f) + 128); - paintCol.B = (byte)((paintCol.B / 2f) + 128); - } - if (colType == 29) - { - paintCol = Color.Black; - } - Color col = Lighting.GetColor(i, j); - col.R = (byte)(paintCol.R / 255f * col.R); - col.G = (byte)(paintCol.G / 255f * col.G); - col.B = (byte)(paintCol.B / 255f * col.B); - return col; - } } } diff --git a/World/AerialiteOreGen.cs b/World/AerialiteOreGen.cs index 497e2d6017..0df55e7229 100644 --- a/World/AerialiteOreGen.cs +++ b/World/AerialiteOreGen.cs @@ -30,11 +30,11 @@ namespace CalamityMod.World Tile tile = Main.tile[x, y]; // The following conditions must happen in order for aerialite to generate: - // 1. The original tile ID must be that of a cloud. + // 1. The original tile ID must be that of a Cloud, Lesion Block, or Flesh Block. // 2. The original tile must not be empty air. // 3. A random dice-roll must land correctly, to ensure that patches of ore are occasional. // If any of these conditions are not met, this loop iteration is skipped. - if (tile.TileType != TileID.Cloud || !tile.HasTile || !WorldGen.genRand.NextBool(CloudOreConversionChance)) + if (!(tile.TileType == TileID.Cloud || tile.TileType == TileID.LesionBlock || tile.TileType == TileID.FleshBlock) || !tile.HasTile || !WorldGen.genRand.NextBool(CloudOreConversionChance)) continue; int radius = (int)(WorldGen.genRand.Next(3, 5) * WorldGen.genRand.NextFloat(0.74f, 0.82f)); @@ -51,7 +51,7 @@ namespace CalamityMod.World WorldUtils.Gen(new Point(x, y), new ModShapes.All(biggerCircle), Actions.Chain(new GenAction[] { new Actions.ClearTile(), - new Actions.PlaceTile((ushort)TileID.Cloud) + new Actions.PlaceTile(tile.TileType) })); // Circle of ore. diff --git a/World/AstralBiome.cs b/World/AstralBiome.cs index 5b99807bfe..274d345845 100644 --- a/World/AstralBiome.cs +++ b/World/AstralBiome.cs @@ -631,12 +631,14 @@ namespace CalamityMod.World type != ModContent.TileType() && type != ModContent.TileType() && type != ModContent.TileType() && type != ModContent.TileType() && type != ModContent.TileType() && type != ModContent.TileType() && - type != ModContent.TileType() && type != ModContent.TileType() && - type != ModContent.TileType() && type != ModContent.TileType() && + type != ModContent.TileType() && type != ModContent.TileType() && + type != ModContent.TileType() && type != ModContent.TileType() && + type != ModContent.TileType() && type != ModContent.TileType() && type != ModContent.TileType() && type != ModContent.TileType() && - type != ModContent.TileType() && type != ModContent.TileType() && - type != ModContent.TileType() && type != ModContent.TileType() && - type != ModContent.TileType()) + type != ModContent.TileType() && type != ModContent.TileType() && + type != ModContent.TileType() && type != ModContent.TileType() && + type != ModContent.TileType() && type != ModContent.TileType() && + type != ModContent.TileType()) { if (TileID.Sets.Conversion.Grass[type] && !TileID.Sets.GrassSpecial[type]) { @@ -742,8 +744,9 @@ namespace CalamityMod.World case TileID.LargePiles: if (tile.TileFrameX <= 1170) { - RecursiveReplaceToAstral(TileID.LargePiles, (ushort)ModContent.TileType(), x, y, 324, 0, 1170, 0, 18); + RecursiveReplaceToAstral(TileID.LargePiles, (ushort)ModContent.TileType(), x, y, 324, 0, 1170, 0, 18); } + // TODO: Mushroom, replace when Astral Undergrowth is being worked on again if (tile.TileFrameX >= 1728) { RecursiveReplaceToAstral(TileID.LargePiles, (ushort)ModContent.TileType(), x, y, 324, 1728, 1872, 0, 18); @@ -771,10 +774,14 @@ namespace CalamityMod.World { newType = (ushort)ModContent.TileType(); } - else if (tile.TileFrameX <= 558 || (tile.TileFrameX >= 1368 && tile.TileFrameX <= 1458)) + else if (tile.TileFrameX >= 1368 && tile.TileFrameX <= 1458) { newType = (ushort)ModContent.TileType(); } + else if (tile.TileFrameX <= 558) + { + newType = (ushort)ModContent.TileType(); + } else if (tile.TileFrameX >= 900 && tile.TileFrameX <= 1098) { newType = (ushort)ModContent.TileType(); @@ -815,10 +822,15 @@ namespace CalamityMod.World { newType3 = (ushort)ModContent.TileType(); } - else if (tile.TileFrameX <= 486) + else if (tile.TileFrameX >= 110 && tile.TileFrameX <= 198) { newType3 = (ushort)ModContent.TileType(); } + // Intentionally encapsulates everything EXCEPT the above range + else if (tile.TileFrameX <= 486) + { + newType3 = (ushort)ModContent.TileType(); + } else if (tile.TileFrameX >= 648 && tile.TileFrameX <= 846) { newType3 = (ushort)ModContent.TileType(); @@ -847,7 +859,7 @@ namespace CalamityMod.World } else if ((tile.TileFrameX >= 54 && tile.TileFrameX <= 90) || (tile.TileFrameX >= 216 && tile.TileFrameX <= 360)) { - newType2 = (ushort)ModContent.TileType(); + newType2 = (ushort)ModContent.TileType(); } else if (tile.TileFrameX <= 36) { @@ -1063,15 +1075,28 @@ namespace CalamityMod.World { SetTileFromConvert(x, y, convert, ushort.MaxValue, ushort.MaxValue, TileID.HallowedPlants2, TileID.Plants2); } + // TODO: All astral medium pile conversions break said tiles. Large and small piles work fine. else if (type == ModContent.TileType()) { - RecursiveReplaceFromAstral((ushort)type, TileID.LargePiles, x, y, 378, 0); + RecursiveReplaceFromAstral((ushort)type, TileID.LargePiles2, x, y, 540, 0); } else if (type == ModContent.TileType()) { RecursiveReplaceFromAstral((ushort)type, TileID.SmallPiles, x, y, 0, 18); } else if (type == ModContent.TileType()) + { + RecursiveReplaceFromAstral((ushort)type, TileID.SmallPiles, x, y, 110, 0); + } + else if (type == ModContent.TileType()) + { + RecursiveReplaceFromAstral((ushort)type, TileID.LargePiles, x, y, 378, 0); + } + else if (type == ModContent.TileType()) + { + RecursiveReplaceFromAstral((ushort)type, TileID.SmallPiles, x, y, 1368, 18); + } + else if (type == ModContent.TileType()) { RecursiveReplaceFromAstral((ushort)type, TileID.SmallPiles, x, y, 0, 0); } @@ -1099,7 +1124,8 @@ namespace CalamityMod.World { RecursiveReplaceFromAstral((ushort)type, TileID.SmallPiles, x, y, 648, 0); } - else if (type == ModContent.TileType()) + // TODO: All astral stalactite conversions break said tiles + else if (type == ModContent.TileType() || type == ModContent.TileType()) { ushort originType = TileID.Stone; switch (convert) diff --git a/World/CustomTemple.cs b/World/CustomTemple.cs index 007f9721cc..80be98c84b 100644 --- a/World/CustomTemple.cs +++ b/World/CustomTemple.cs @@ -26,18 +26,35 @@ namespace CalamityMod.World int y = WorldGen.genRand.Next((int)Main.rockLayer, Main.maxTilesY - 500); - if (Main.tile[x, y].HasTile && Main.tile[x, y].TileType == 60) + if (Main.remixWorld) { - Rectangle ugDesert = GenVars.UndergroundDesertLocation; - Rectangle InflatedSunkenSeaLocation = new Rectangle(ugDesert.Left - 160, ugDesert.Center.Y - 160, ugDesert.Width + 320, ugDesert.Height / 2 + 320); - Rectangle TempleLocation = new Rectangle(x - 80, y - 80, 160, 160); + while (Main.tile[x, y].HasTile || Main.tile[x, y].WallType > 0 || y > (int)(Main.worldSurface - 5.0)) + { + y--; + } - if (!TempleLocation.Intersects(InflatedSunkenSeaLocation)) + y++; + if (Main.tile[x, y].HasTile && (Main.tile[x, y].TileType == TileID.JungleGrass || Main.tile[x, y].TileType == TileID.Mud)) { success = true; GenNewTemple(x, y); } } + else + { + if (Main.tile[x, y].HasTile && Main.tile[x, y].TileType == TileID.JungleGrass) + { + Rectangle ugDesert = GenVars.UndergroundDesertLocation; + Rectangle InflatedSunkenSeaLocation = new Rectangle(ugDesert.Left - 160, ugDesert.Center.Y - 160, ugDesert.Width + 320, ugDesert.Height / 2 + 320); + Rectangle TempleLocation = new Rectangle(x - 80, y - 80, 160, 160); + + if (!TempleLocation.Intersects(InflatedSunkenSeaLocation)) + { + success = true; + GenNewTemple(x, y); + } + } + } } } diff --git a/World/DraedonStructures.cs b/World/DraedonStructures.cs index 22e924564b..5bb14468dc 100644 --- a/World/DraedonStructures.cs +++ b/World/DraedonStructures.cs @@ -255,12 +255,15 @@ namespace CalamityMod.World do { int underworldTop = Main.UnderworldLayer; - //gen opposite to the brimstone crags - //has more wiggle room in seeds with modified hell gen + // Generates opposite to the Brimstone Crags + // Has more wiggle room in Remix seed due to modified hell gen bool dungeonRight = Main.dungeonX > Main.maxTilesX / 2; - int midLeft = Main.drunkWorld || Main.remixWorld ? 6 : 9; - float midRight = Main.drunkWorld || Main.remixWorld ? 0.6f : 0.82f; + int midLeft = Main.remixWorld ? 6 : 9; + float midRight = Main.remixWorld ? 0.6f : 0.82f; int placementPositionX = dungeonRight ? WorldGen.genRand.Next((int)(Main.maxTilesX / 12), (int)(Main.maxTilesX / midLeft)) : WorldGen.genRand.Next((int)(Main.maxTilesX * midRight), (int)(Main.maxTilesX * 0.925)); + // If in Drunk world but not GFB, Hell lab spawns in the center of the world (Hell gets swapped around) + if (Main.drunkWorld && !Main.remixWorld) + placementPositionX = WorldGen.genRand.Next((int)(Main.maxTilesX * 0.4f), (int)(Main.maxTilesX * 0.6f)); int placementPositionY = WorldGen.genRand.Next(Main.maxTilesY - 150, Main.maxTilesY - 125); placementPoint = new Point(placementPositionX, placementPositionY); @@ -292,7 +295,7 @@ namespace CalamityMod.World break; } } - while (tries <= 20000); + while (tries <= 50000); } #endregion @@ -432,6 +435,11 @@ namespace CalamityMod.World canGenerateInLocation = false; } } + // Snow overlaps a lot with jungle on drunk/gfb worlds so it needs a bit of extra help + if (Main.drunkWorld) + { + iceTilesInArea *= 3; + } if (!canGenerateInLocation || nearbyOtherWorkshop || iceTilesInArea < totalTiles * 0.35f || !structures.CanPlace(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y))) tries++; else diff --git a/World/UndergroundShrines.cs b/World/UndergroundShrines.cs index adda47c705..e844acbb7a 100644 --- a/World/UndergroundShrines.cs +++ b/World/UndergroundShrines.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Mounts; using CalamityMod.Items.Placeables.Furniture; using CalamityMod.Items.Placeables.FurnitureAbyss; +using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Items.Potions; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.SummonItems; @@ -42,8 +43,8 @@ namespace CalamityMod.World { return true; } - if (tile.TileType == TileType() || - tile.TileType == TileType() || + if (tile.TileType == TileType() || + tile.TileType == TileType() || tile.WallType == WallType() || tile.WallType == WallType()) { @@ -243,7 +244,7 @@ namespace CalamityMod.World List contents = new List() { new ChestItem(ItemType(), 1), - new ChestItem(ItemType(), WorldGen.genRand.Next(6, 8 + 1)), + new ChestItem(ItemType(), WorldGen.genRand.Next(6, 8 + 1)), new ChestItem(ItemID.DungeonDesertKey, 1), new ChestItem(ItemID.DesertTorch, WorldGen.genRand.Next(100, 110 + 1)), new ChestItem(ItemID.GoldCoin, WorldGen.genRand.Next(20, 24 + 1)), @@ -256,7 +257,7 @@ namespace CalamityMod.World contents = new List() { new ChestItem(ItemType(), 1), - new ChestItem(ItemType(), WorldGen.genRand.Next(6, 8 + 1)), + new ChestItem(ItemType(), WorldGen.genRand.Next(6, 8 + 1)), new ChestItem(ItemID.DungeonDesertKey, 1), new ChestItem(ItemID.DesertTorch, WorldGen.genRand.Next(100, 110 + 1)), new ChestItem(ItemID.GoldCoin, WorldGen.genRand.Next(20, 24 + 1)), diff --git a/build.txt b/build.txt index cf9028fcf7..ed16d2e562 100644 --- a/build.txt +++ b/build.txt @@ -1,5 +1,5 @@ author = Fabsol and the Dev Team -version = 2.0.4.003 +version = 2.0.4.004 displayName = Calamity Mod modReferences = CalamityModMusic homepage = https://discord.gg/calamity