diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index cb8d599aaa..8a71493837 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -1,9 +1,9 @@ -using CalamityMod.Items.Weapons.Ranged; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.NPCs.AstrumAureus; using CalamityMod.NPCs.CeaselessVoid; using CalamityMod.NPCs.Crabulon; -using CalamityMod.NPCs.ExoMechs.Apollo; -using CalamityMod.NPCs.ExoMechs.Artemis; using CalamityMod.NPCs.OldDuke; using CalamityMod.NPCs.ProfanedGuardians; using CalamityMod.NPCs.Providence; @@ -17,8 +17,7 @@ using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Summon.MirrorofKalandraMinions; using CalamityMod.Projectiles.Typeless; -using System.Collections.Generic; -using System.Linq; +using CalamityMod.Systems.Collections; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -95,7 +94,7 @@ namespace CalamityMod.Balancing #region Desert Scourge // 25% resist to true melee. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DesertScourgeIDs, Do(ResistTrueMelee(0.75f)))); + NPCSpecificBalancingChanges.AddRange(Bundle(DesertScourgeIDList.List, Do(ResistTrueMelee(0.75f)))); #endregion #region Crabulon @@ -113,18 +112,18 @@ namespace CalamityMod.Balancing #region Eater of Worlds // 50% resist to true melee. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.EaterofWorldsIDs, Do(ResistTrueMelee(0.5f)))); + NPCSpecificBalancingChanges.AddRange(Bundle(EaterOfWorldsIDList.List, Do(ResistTrueMelee(0.5f)))); // 50% resist to Demon Scythe. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.EaterofWorldsIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.DemonScythe)))); + NPCSpecificBalancingChanges.AddRange(Bundle(EaterOfWorldsIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.DemonScythe)))); // 40% resist to Sky Glaze. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.EaterofWorldsIDs, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(EaterOfWorldsIDList.List, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType())))); #endregion #region The Perforators // 50% resist to true melee. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.PerforatorIDs, Do(ResistTrueMelee(0.5f)))); + NPCSpecificBalancingChanges.AddRange(Bundle(PerforatorWormIDList.List, Do(ResistTrueMelee(0.5f)))); #endregion #region Wall of Flesh @@ -134,56 +133,56 @@ namespace CalamityMod.Balancing #region Aquatic Scourge // 50% resist to true melee. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AquaticScourgeIDs, Do(ResistTrueMelee(0.5f)))); + NPCSpecificBalancingChanges.AddRange(Bundle(AquaticScourgeIDList.List, Do(ResistTrueMelee(0.5f)))); // 50% resist to Adamantite Throwing Axe's lightning. // Twisting Thunder and Gael's Greatsword use this projectile too, but they are far beyond progression, so who cares! - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AquaticScourgeIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CultistBossLightningOrbArc)))); + NPCSpecificBalancingChanges.AddRange(Bundle(AquaticScourgeIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CultistBossLightningOrbArc)))); // 50% resist to Dormant Brimseeker. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AquaticScourgeIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(AquaticScourgeIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 50% resist to Mounted Scanner. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AquaticScourgeIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(AquaticScourgeIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 40% resist to Cryophobia. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AquaticScourgeIDs, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(AquaticScourgeIDList.List, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType())))); // 40% resist to SHPC. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AquaticScourgeIDs, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(AquaticScourgeIDList.List, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType())))); // 30% resist to Meowthrower. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AquaticScourgeIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(AquaticScourgeIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); // 25% resist to Snowstorm Staff. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AquaticScourgeIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType(), ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(AquaticScourgeIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType(), ProjectileType())))); #endregion #region The Destroyer // 50% resist to true melee. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(ResistTrueMelee(0.5f)))); + NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(ResistTrueMelee(0.5f)))); // 50% resist to Adamantite Throwing Axe's lightning. // See Aquatic Scourge comment. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CultistBossLightningOrbArc)))); + NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CultistBossLightningOrbArc)))); // 50% resist to Aftershock's rocks. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 50% resist to Dormant Brimseeker. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 45% resist to Mounted Scanner. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType())))); // 30% resist to Meowthrower. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); // 25% resist to Avalanche's Ice Bombs and shards. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType(), ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType(), ProjectileType())))); // 25% resist to Snowstorm Staff. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType(), ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType(), ProjectileType())))); #endregion #region Astrum Aureus @@ -209,28 +208,28 @@ namespace CalamityMod.Balancing #region Ravager // 50% resist to true melee. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.RavagerIDs, Do(ResistTrueMelee(0.5f)))); + NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(ResistTrueMelee(0.5f)))); // 50% resist to Aegis Blade's explosions because the true melee resist ain't enough. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.RavagerIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 50% resist to Icicle Arrows. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.RavagerIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 35% resist to Flying Dragon. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.RavagerIDs, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2SquireSonicBoom)))); + NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2SquireSonicBoom)))); // 30% resist to Aurora Blazer. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.RavagerIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); // 30% resist to Flak Kraken. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.RavagerIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); // 25% resist to Lucrecia. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.RavagerIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); // 20% resist to The Hive. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.RavagerIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType(), ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType(), ProjectileType())))); #endregion #region Lunatic Cultist @@ -249,37 +248,37 @@ namespace CalamityMod.Balancing #region Astrum Deus // 75% resist to Plaguenades. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.25f, ProjectileType(), ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.25f, ProjectileType(), ProjectileType())))); // 70% resist to Charged Blaster Cannon. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.3f, ProjectileID.ChargedBlasterLaser)))); + NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.3f, ProjectileID.ChargedBlasterLaser)))); // 70% resist to Stardust Dragon Staff. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.3f, ProjectileID.StardustDragon1, ProjectileID.StardustDragon2, ProjectileID.StardustDragon3, ProjectileID.StardustDragon4)))); + NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.3f, ProjectileID.StardustDragon1, ProjectileID.StardustDragon2, ProjectileID.StardustDragon3, ProjectileID.StardustDragon4)))); // 65% resist to Atlantis (Atlantis gaming!). - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType())))); // 55% resist to Flak Kraken. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.45f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.45f, ProjectileType())))); // 50% resist to true melee. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(ResistTrueMelee(0.5f)))); + NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(ResistTrueMelee(0.5f)))); // 50% resist to Aurora Blazer. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 35% resist to Aerial Bane. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2BetsyArrow)))); + NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2BetsyArrow)))); // 35% resist to Ballistic Poison Bomb's clouds. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType())))); // 35% resist to Icicle Arrows. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType())))); // 20% resist to Cluster Rocket fragments. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileID.ClusterFragmentsI, ProjectileID.ClusterFragmentsII)))); + NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileID.ClusterFragmentsI, ProjectileID.ClusterFragmentsII)))); #endregion #region Moon Lord @@ -313,28 +312,28 @@ namespace CalamityMod.Balancing #region Storm Weaver // 50% resist to true melee. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(ResistTrueMelee(0.5f)))); + NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(ResistTrueMelee(0.5f)))); // 50% resist to Dazzling Stabber Staff. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 50% resist to Last Prism. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.LastPrismLaser)))); + NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.LastPrismLaser)))); // 50% resist to Legion of Celestia. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 50% resist to Pristine Fury's alt fire. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 50% resist to Tactician's Trump Card's explosions. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 35% resist to Event Horizon. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType(), ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType(), ProjectileType())))); // 25% resist to Molten Amputator's blobs. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); #endregion #region Old Duke @@ -344,19 +343,22 @@ namespace CalamityMod.Balancing #region The Devourer of Gods // 65% resist to Wave Pounder. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(DevourerOfGodsIDList.List, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType())))); // 35% resist to Venusian Trident. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(DevourerOfGodsIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType())))); + + // 35% resist to Sulphuric Acid Cannon's Explosions. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType())))); // 25% resist to Corinth Prime's Grenades. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(DevourerOfGodsIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); // 20% resist to Valediction's typhoons; will catch Nuclear Fury as well but that doesn't matter. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(DevourerOfGodsIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); // 15% vulnerability to Time Bolt stealth strikes. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new StealthStrikeBalancingRule(1.15f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(DevourerOfGodsIDList.List, Do(new StealthStrikeBalancingRule(1.15f, ProjectileType())))); #endregion The Devourer of Gods #region Yharon @@ -366,31 +368,31 @@ namespace CalamityMod.Balancing #region Exo Mechs: Ares // 30% resist to Dynamic Pursuer. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType(), ProjectileType(), ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType(), ProjectileType(), ProjectileType())))); // 25% resist to Aetherflux Cannon. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); // 25% resist to Prismatic Breaker's deathray. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); // 20% resist to the Spin Throw part of the Ark of the Cosmos' combo. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.8f, AotCThrowCombo)))); + NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileSpecificRequirementBalancingRule(0.8f, AotCThrowCombo)))); // 20% resist to Dragon Rage projectiles. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.8f, DragonRageFilter)))); + NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileSpecificRequirementBalancingRule(0.8f, DragonRageFilter)))); // 20% resist to Eclipse's Fall. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType(), ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType(), ProjectileType())))); // 20% resist to Rancor. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); // 20% resist to Yharim's Crystal. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); // 20% resist to Zenith. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileID.FinalFractal)))); + NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileID.FinalFractal)))); #endregion #region Exo Mechs: Artemis and Apollo @@ -402,97 +404,97 @@ namespace CalamityMod.Balancing #region Exo Mechs: Thanatos // 65% resist to true melee. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(ResistTrueMelee(0.35f)))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(ResistTrueMelee(0.35f)))); // 65% resist to The Enforcer's projectiles. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType())))); // 65% resist to The Final Dawn's lunge. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType())))); // 65% resist to Stellar Torus Staff. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType())))); // 60% resist to Dynamic Pursuer. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.4f, ProjectileType(), ProjectileType(), ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.4f, ProjectileType(), ProjectileType(), ProjectileType())))); // 50% resist to Chicken Cannon. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 50% resist to Omicron's beam. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 50% resist to Rancor. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 50% resist to Vehemence's skulls. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 50% resist to Yharim's Crystal. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 45% resist to Prismatic Breaker's deathray. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, 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())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType())))); // 30% resist to Eclipse's Fall. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); // 30% resist to Sirius. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); // 30% resist to Ultima's rays. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); // 30% resist to Dragon Scales and The Wand's tornadoes. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType(), ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType(), ProjectileType())))); // 25% resist to the Spin Throw part of the Ark of the Cosmos' combo. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, AotCThrowCombo)))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, AotCThrowCombo)))); // 25% resist to Dragon Rage projectiles. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, DragonRageFilter)))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, DragonRageFilter)))); // 25% resist to Gael's Greatsword's big skulls. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, BigGaelsSkullFilter)))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, BigGaelsSkullFilter)))); // 25% resist to Mirror of Kalandra's Paradoxica minion. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); // 25% resist to Zenith. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileID.FinalFractal)))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileID.FinalFractal)))); // 20% resist to The Anomaly's Nanogun's bomb explosions. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); // 20% resist to Ariane's aura (Lilies of Finality). - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); // 20% resist to Eradicator's beams. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); // 20% resist to Plasma Grenade and Dynamic Pursuer's explosions. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType(), ProjectileType(), ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType(), ProjectileType(), ProjectileType())))); // 20% resist to Voltaic Climax / Void Vortex hitscan beams. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); // 15% resist to The Final Dawn's AoE sweep flames. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType())))); // 15% resist to Dragon's Breath Beam. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType())))); // 15% resist to God Slayer Slugs. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType())))); // 15% resist to Gruesome Eminence. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType())))); // 15% resist to Luminite Bullets. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileID.MoonlordBullet)))); + NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.85f, ProjectileID.MoonlordBullet)))); #endregion #region Supreme Calamitas: Brimstone Hearts diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index 37acd3132c..0d4b39fe67 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -1,6 +1,6 @@ using CalamityMod.Balancing; -using CalamityMod.Buffs.StatDebuffs; using CalamityMod.NPCs; +using CalamityMod.Systems.Collections; using Terraria; using Terraria.ID; using Terraria.Localization; @@ -104,7 +104,7 @@ namespace CalamityMod.Buffs { if (npc.Calamity().webbed < npc.buffTime[buffIndex]) npc.Calamity().webbed = npc.buffTime[buffIndex]; - if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().webbed; npc.DelBuff(buffIndex); buffIndex--; @@ -113,7 +113,7 @@ namespace CalamityMod.Buffs { if (npc.Calamity().slowed < npc.buffTime[buffIndex]) npc.Calamity().slowed = npc.buffTime[buffIndex]; - if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().slowed; npc.DelBuff(buffIndex); buffIndex--; diff --git a/Buffs/DamageOverTime/TrueVulnerabilityHex.cs b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs index ff9aeafec2..72910c2fa8 100644 --- a/Buffs/DamageOverTime/TrueVulnerabilityHex.cs +++ b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs @@ -1,6 +1,7 @@ using CalamityMod.Dusts; using CalamityMod.NPCs; using CalamityMod.Particles; +using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -40,7 +41,7 @@ namespace CalamityMod.Buffs.DamageOverTime } // Apply immunity timer. - if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && cgn.debuffResistanceTimer <= 0) + if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && cgn.debuffResistanceTimer <= 0) cgn.debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + cgn.trueVulnerabilityHex; // Destroy the vanilla buff, we don't use it. diff --git a/Buffs/DamageOverTime/Vaporfied.cs b/Buffs/DamageOverTime/Vaporfied.cs index 15064126fb..f4dd7d5fee 100644 --- a/Buffs/DamageOverTime/Vaporfied.cs +++ b/Buffs/DamageOverTime/Vaporfied.cs @@ -1,4 +1,5 @@ using CalamityMod.NPCs; +using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -26,7 +27,7 @@ namespace CalamityMod.Buffs.DamageOverTime { if (npc.Calamity().vaporfied < npc.buffTime[buffIndex]) npc.Calamity().vaporfied = npc.buffTime[buffIndex]; - if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().vaporfied; npc.DelBuff(buffIndex); buffIndex--; diff --git a/Buffs/DamageOverTime/VulnerabilityHex.cs b/Buffs/DamageOverTime/VulnerabilityHex.cs index 13cbad0a14..45c6a98946 100644 --- a/Buffs/DamageOverTime/VulnerabilityHex.cs +++ b/Buffs/DamageOverTime/VulnerabilityHex.cs @@ -1,6 +1,7 @@ using CalamityMod.Dusts; using CalamityMod.NPCs; using CalamityMod.Particles; +using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -43,7 +44,7 @@ namespace CalamityMod.Buffs.DamageOverTime } // Apply immunity timer. - if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && cgn.debuffResistanceTimer <= 0) + if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && cgn.debuffResistanceTimer <= 0) cgn.debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + cgn.vulnerabilityHex; // Destroy the vanilla buff, we don't use it. @@ -60,7 +61,7 @@ namespace CalamityMod.Buffs.DamageOverTime GeneralParticleHandler.SpawnParticle(spark2); } - Dust dust = Dust.NewDustPerfect(Player.Calamity().RandomDebuffVisualSpot, Main.rand.NextBool() ? 261 :(int)CalamityDusts.Brimstone); + Dust dust = Dust.NewDustPerfect(Player.Calamity().RandomDebuffVisualSpot, Main.rand.NextBool() ? 261 : (int)CalamityDusts.Brimstone); dust.scale = Main.rand.NextFloat(0.4f, 0.5f); dust.velocity = new Vector2(0, Main.rand.NextFloat(-0.5f, -2.5f)).RotatedByRandom(0.6f); if (dust.type == 261) diff --git a/Buffs/StatDebuffs/Eutrophication.cs b/Buffs/StatDebuffs/Eutrophication.cs index fe7bb2c1f3..0f99d11480 100644 --- a/Buffs/StatDebuffs/Eutrophication.cs +++ b/Buffs/StatDebuffs/Eutrophication.cs @@ -1,4 +1,5 @@ using CalamityMod.NPCs; +using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -26,7 +27,7 @@ namespace CalamityMod.Buffs.StatDebuffs { if (npc.Calamity().eutrophication < npc.buffTime[buffIndex]) npc.Calamity().eutrophication = npc.buffTime[buffIndex]; - if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().eutrophication; npc.DelBuff(buffIndex); buffIndex--; diff --git a/Buffs/StatDebuffs/GalvanicCorrosion.cs b/Buffs/StatDebuffs/GalvanicCorrosion.cs index 0d6639ee28..d8b4a6e77c 100644 --- a/Buffs/StatDebuffs/GalvanicCorrosion.cs +++ b/Buffs/StatDebuffs/GalvanicCorrosion.cs @@ -1,4 +1,5 @@ using CalamityMod.NPCs; +using CalamityMod.Systems.Collections; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -19,7 +20,7 @@ namespace CalamityMod.Buffs.StatDebuffs { if (npc.Calamity().tesla < npc.buffTime[buffIndex]) npc.Calamity().tesla = npc.buffTime[buffIndex]; - if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().tesla; npc.DelBuff(buffIndex); buffIndex--; diff --git a/Buffs/StatDebuffs/GlacialState.cs b/Buffs/StatDebuffs/GlacialState.cs index d1c0ed7639..ffbb2a810b 100644 --- a/Buffs/StatDebuffs/GlacialState.cs +++ b/Buffs/StatDebuffs/GlacialState.cs @@ -1,4 +1,5 @@ using CalamityMod.NPCs; +using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -26,7 +27,7 @@ namespace CalamityMod.Buffs.StatDebuffs { if (npc.Calamity().gState < npc.buffTime[buffIndex]) npc.Calamity().gState = npc.buffTime[buffIndex]; - if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().gState; npc.DelBuff(buffIndex); buffIndex--; diff --git a/Buffs/StatDebuffs/KamiFlu.cs b/Buffs/StatDebuffs/KamiFlu.cs index 2bcb04e825..a4f3908529 100644 --- a/Buffs/StatDebuffs/KamiFlu.cs +++ b/Buffs/StatDebuffs/KamiFlu.cs @@ -1,4 +1,5 @@ using CalamityMod.NPCs; +using CalamityMod.Systems.Collections; using Terraria; using Terraria.ModLoader; @@ -17,7 +18,7 @@ namespace CalamityMod.Buffs.StatDebuffs { if (npc.Calamity().kamiFlu < npc.buffTime[buffIndex]) npc.Calamity().kamiFlu = npc.buffTime[buffIndex]; - if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().kamiFlu; npc.DelBuff(buffIndex); buffIndex--; diff --git a/Buffs/StatDebuffs/TemporalSadness.cs b/Buffs/StatDebuffs/TemporalSadness.cs index 329546014b..b3eb4099dc 100644 --- a/Buffs/StatDebuffs/TemporalSadness.cs +++ b/Buffs/StatDebuffs/TemporalSadness.cs @@ -1,4 +1,5 @@ using CalamityMod.NPCs; +using CalamityMod.Systems.Collections; using Terraria; using Terraria.ModLoader; @@ -17,7 +18,7 @@ namespace CalamityMod.Buffs.StatDebuffs { if (npc.Calamity().tSad < npc.buffTime[buffIndex]) npc.Calamity().tSad = npc.buffTime[buffIndex]; - if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().tSad; npc.DelBuff(buffIndex); buffIndex--; diff --git a/Buffs/StatDebuffs/TimeDistortion.cs b/Buffs/StatDebuffs/TimeDistortion.cs index 4156fa9434..95a1cf23fa 100644 --- a/Buffs/StatDebuffs/TimeDistortion.cs +++ b/Buffs/StatDebuffs/TimeDistortion.cs @@ -1,4 +1,5 @@ using CalamityMod.NPCs; +using CalamityMod.Systems.Collections; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -19,7 +20,7 @@ namespace CalamityMod.Buffs.StatDebuffs { if (npc.Calamity().timeSlow < npc.buffTime[buffIndex]) npc.Calamity().timeSlow = npc.buffTime[buffIndex]; - if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().timeSlow; npc.DelBuff(buffIndex); buffIndex--; diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 5e98dbf06d..599ec948f3 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -12,7 +12,6 @@ using CalamityMod.CalPlayer.Dashes; using CalamityMod.Cooldowns; using CalamityMod.DataStructures; using CalamityMod.Dusts; -using CalamityMod.Enums; using CalamityMod.Events; using CalamityMod.FluidSimulation; using CalamityMod.Items; @@ -52,20 +51,17 @@ using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; using CalamityMod.Systems; -using CalamityMod.Waters; +using CalamityMod.Systems.Collections; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.DataStructures; -using Terraria.GameContent; -using Terraria.GameContent.Liquid; using Terraria.GameInput; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.IO; -using Terraria.Utilities.Terraria.Utilities; using static Terraria.ModLoader.ModContent; namespace CalamityMod.CalPlayer @@ -113,6 +109,7 @@ namespace CalamityMod.CalPlayer public float healingPotionMultiplier = 1f; public bool heldGaelsLastFrame = false; internal bool hadNanomachinesLastFrame = false; + public bool combHair; public bool disableVoodooSpawns = false; public bool disablePerfCystSpawns = false; public bool disableHiveCystSpawns = false; @@ -1163,18 +1160,18 @@ namespace CalamityMod.CalPlayer 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(); 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; @@ -1615,6 +1612,7 @@ namespace CalamityMod.CalPlayer ResetRogueStealth(); calamityBonusLuck = 0f; + combHair = false; // Reset adrenaline duration to default. If Draedon's Heart is equipped, it'll change itself every frame. AdrenalineDuration = CalamityUtils.SecondsToFrames(5); @@ -4021,7 +4019,7 @@ namespace CalamityMod.CalPlayer #region Modify Mana Cost public override void ModifyManaCost(Item item, ref float reduce, ref float mult) { - if (CalamityLists.MagicGunIDs.Contains(item.type) && meteorSet) + if (MagicGunIDList.Includes(item.type) && meteorSet) { mult *= 0.33f; } @@ -4177,7 +4175,7 @@ namespace CalamityMod.CalPlayer var LocketSource = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); if (item.CountsAsClass()) { - if (!CalamityLists.VeneratedLocketBanlist.Contains(item.type)) + if (!VeneratedLocketBanList.Includes(item.type)) { float veneratedCloneSpeed = item.shootSpeed; Vector2 realPlayerPos = Player.RotatedRelativePoint(Player.MountedCenter, true); diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index 33b65d6b27..fd010bb7f6 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -6,6 +6,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer.DrawLayers; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Particles; +using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -27,7 +28,7 @@ namespace CalamityMod.CalPlayer return; // Remove shoe drawing effects if special legs are meant to be drawn. - if (CalamityLists.legOverrideList.Contains(Player.legs)) + if (LegOverrideList.Includes(Player.legs)) { PlayerDrawLayers.Shoes.Hide(); } diff --git a/CalPlayer/CalamityPlayerFishing.cs b/CalPlayer/CalamityPlayerFishing.cs index 79e31c99bd..b88f777f11 100644 --- a/CalPlayer/CalamityPlayerFishing.cs +++ b/CalPlayer/CalamityPlayerFishing.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using CalamityMod.Events; using CalamityMod.Items.Accessories; @@ -27,20 +28,52 @@ namespace CalamityMod.CalPlayer { public partial class CalamityPlayer : ModPlayer { + #region Modify Fishing Attempt + public override void ModifyFishingAttempt(ref FishingAttempt attempt) + { + if (enchantedPearl) + { + // If the player fails to roll a crate naturally and has Enchanted Pearl, reroll + // Stacking with existing probability, it should increase chances by 15% (12.5% with Crate Potion) + if (!attempt.crate) + attempt.crate = Main.rand.NextBool(6); + + // If the player does get a crate (can be from the reroll above), give it increased chances of being rarer + if (attempt.crate) + { + int uncommonRate = Math.Clamp(240 / attempt.fishingLevel, 3, 240); // Iron/Mythril (originally 300) + attempt.uncommon = Main.rand.NextBool(uncommonRate); + int rareRate = Math.Clamp(840 / attempt.fishingLevel, 4, 840); // Biome (originally 1050) + attempt.uncommon = Main.rand.NextBool(rareRate); + int veryRareRate = Math.Clamp(1800 / attempt.fishingLevel, 5, 1800); // Golden/Titanium (originally 2250) + attempt.uncommon = Main.rand.NextBool(veryRareRate); + } + } + } + #endregion + #region Catch Fish public override void CatchFish(FishingAttempt attempt, ref int itemDrop, ref int npcSpawn, ref AdvancedPopupRequest sonar, ref Vector2 sonarPosition) { + // If vanilla catches an enemy, just immediately cancel + if (npcSpawn > 0) + return; + int bait = attempt.playerFishingConditions.BaitItemType; - int power = attempt.playerFishingConditions.BaitPower + attempt.playerFishingConditions.PolePower; + int power = attempt.fishingLevel; int questFish = attempt.questFish; int poolSize = attempt.waterTilesCount; - bool water = !attempt.inHoney && !attempt.inLava; bool lava = attempt.inLava; bool honey = attempt.inHoney; - // If vanilla catches an enemy, just cancel - if (npcSpawn > 0) - return; + bool sky = attempt.heightLevel == 0; + bool surface = attempt.heightLevel == 1; + bool underground = attempt.heightLevel == 2; + bool cavern = attempt.heightLevel == 3; + bool underworld = attempt.heightLevel == 4; + + // Custom rate; increased by Enchanted Pearl + bool grabBagFish = attempt.uncommon && Main.rand.Next(100) < (enchantedPearl ? 30 : 15); // Set up for allowing fishing in the Sulphurous Sea Point point = Player.Center.ToTileCoordinates(); @@ -58,538 +91,210 @@ namespace CalamityMod.CalPlayer if (ZoneAbyss || ZoneSulphur) canSulphurFish = true; - // Old Duke spawn - if (canSulphurFish && bait == ModContent.ItemType() && water && !BossRushEvent.BossRushActive) - { - CalamityGlobalNPC.OldDukeSpawn(Player.whoAmI, ModContent.NPCType(), bait); - } - - // Don't do anything if you can't fish in lava - if (!attempt.CanFishInLava && lava) - return; - - // If you caught junk, then ignore all Calamity catches - if (itemDrop == ItemID.OldShoe || itemDrop == ItemID.FishingSeaweed || itemDrop == ItemID.TinCan) - return; - - // Handle our modded Quest Fish, You can catch these in any liquid... because I don't care if you can - if (ZoneSunkenSea && questFish == ModContent.ItemType() && attempt.uncommon) - { - itemDrop = ModContent.ItemType(); - return; - } - if (ZoneSunkenSea && questFish == ModContent.ItemType() && attempt.uncommon) - { - itemDrop = ModContent.ItemType(); - return; - } - if (ZoneSunkenSea && questFish == ModContent.ItemType() && attempt.uncommon) - { - itemDrop = ModContent.ItemType(); - return; - } - if (ZoneCalamity && questFish == ModContent.ItemType() && attempt.uncommon) - { - itemDrop = ModContent.ItemType(); - return; - } - if (ZoneCalamity && questFish == ModContent.ItemType() && attempt.uncommon) - { - itemDrop = ModContent.ItemType(); - return; - } - - // Handle Alluring Bait's increased chance for Potion Material fish - if (alluringBait) - { - int chanceForPotionFish = 1000 / power; - - if (chanceForPotionFish < 3) - chanceForPotionFish = 3; - - if (Main.rand.NextBool(chanceForPotionFish)) - { - List fishList = new List(); - - if (lava) - { - fishList.AddWithCondition(ItemID.FlarefinKoi, !ZoneCalamity); - fishList.AddWithCondition(ItemID.Obsidifish, !ZoneCalamity); - fishList.AddWithCondition(ModContent.ItemType(), ZoneCalamity); - fishList.AddWithCondition(ModContent.ItemType(), ZoneCalamity); - } - else if (water) - { - if (Player.ZoneDirtLayerHeight || Player.ZoneRockLayerHeight) - { - fishList.Add(ItemID.ArmoredCavefish); - fishList.Add(ItemID.Stinkfish); - fishList.Add(ItemID.SpecularFish); - fishList.AddWithCondition(ItemID.ChaosFish, Player.ZoneHallow); - fishList.AddWithCondition(ItemID.VariegatedLardfish, Player.ZoneJungle); - } - if (Player.ZoneOverworldHeight || Player.ZoneSkyHeight) - { - fishList.AddWithCondition(ItemID.DoubleCod, Player.ZoneJungle); - } - fishList.AddWithCondition(ItemID.FrostMinnow, Player.ZoneSnow); - fishList.AddWithCondition(ItemID.Ebonkoi, Player.ZoneCorrupt); - fishList.AddWithCondition(ItemID.CrimsonTigerfish, Player.ZoneCrimson); - fishList.AddWithCondition(ItemID.Hemopiranha, Player.ZoneCrimson); - fishList.AddWithCondition(ItemID.PrincessFish, Player.ZoneHallow); - fishList.AddWithCondition(ItemID.Prismite, Player.ZoneHallow); - fishList.AddWithCondition(ItemID.Damselfish, Player.ZoneSkyHeight); - fishList.AddWithCondition(ModContent.ItemType(), ZoneAstral); - fishList.AddWithCondition(ModContent.ItemType(), ZoneSunkenSea); - fishList.AddWithCondition(ModContent.ItemType(), !Main.dayTime && !Player.ZoneSkyHeight); - } - - if (fishList.Any()) - { - int fishAmt = fishList.Count; - int caughtFish = fishList[Main.rand.Next(fishAmt)]; - itemDrop = caughtFish; - return; - } - } - } - - // Handle the increased chance of crates from Enchanted Pearl and the Supreme Fishing Station - if (enchantedPearl || fishingStation) - { - int chanceForCrates = (enchantedPearl ? 10 : 0) + - (fishingStation ? 10 : 0); - - int poolSizeAmt = poolSize / 10; - if (poolSizeAmt > 100) - poolSizeAmt = 100; - - int fishingPowerDivisor = power + poolSizeAmt; - - int chanceForIronCrate = 1000 / fishingPowerDivisor; - int chanceForBiomeCrate = 2000 / fishingPowerDivisor; - int chanceForGoldCrate = 3000 / fishingPowerDivisor; - int chanceForRareItems = 4000 / fishingPowerDivisor; - - if (chanceForIronCrate < 3) - chanceForIronCrate = 3; - - if (chanceForBiomeCrate < 4) - chanceForBiomeCrate = 4; - - if (chanceForGoldCrate < 5) - chanceForGoldCrate = 5; - - if (chanceForRareItems < 6) - chanceForRareItems = 6; - - if (lava) - { - if (Main.rand.Next(100) < chanceForCrates) - { - if (Main.rand.NextBool(chanceForBiomeCrate)) - { - if (ZoneCalamity) - itemDrop = Main.hardMode ? ModContent.ItemType() : ModContent.ItemType(); - else - itemDrop = Main.hardMode ? ItemID.LavaCrateHard : ItemID.LavaCrate; - } - if ((Main.rand.NextBool(chanceForRareItems) && enchantedPearl && fishingStation && Player.cratePotion) && ZoneCalamity) - { - itemDrop = ModContent.ItemType(); - } - } - } - - if (water) - { - if (Main.rand.Next(100) < chanceForCrates) - { - if (Main.rand.NextBool(chanceForRareItems) && enchantedPearl && fishingStation && Player.cratePotion) - { - List rareItemList = new List(); - - if (canSulphurFish) - { - switch (Main.rand.Next(2)) - { - case 0: - rareItemList.Add(ModContent.ItemType()); - break; - case 1: - rareItemList.Add(ModContent.ItemType()); - break; - } - } - if (ZoneAstral) - { - switch (Main.rand.Next(3)) - { - case 0: - rareItemList.Add(ModContent.ItemType()); - break; - case 1: - rareItemList.Add(ModContent.ItemType()); - break; - case 2: - rareItemList.Add(ModContent.ItemType()); - break; - } - } - if (ZoneSunkenSea) - { - switch (Main.rand.Next(3)) - { - case 0: - rareItemList.Add(ModContent.ItemType()); - break; - case 1: - rareItemList.Add(ModContent.ItemType()); - break; - case 2: - rareItemList.Add(ModContent.ItemType()); - break; - } - } - if (Player.ZoneSnow && Player.ZoneRockLayerHeight && (Player.ZoneCorrupt || Player.ZoneCrimson || Player.ZoneHallow)) - { - rareItemList.Add(ItemID.ScalyTruffle); - } - rareItemList.AddWithCondition(ItemID.Toxikarp, Player.ZoneCorrupt); - rareItemList.AddWithCondition(ItemID.Bladetongue, Player.ZoneCrimson); - rareItemList.AddWithCondition(ItemID.CrystalSerpent, Player.ZoneHallow); - - if (rareItemList.Any()) - { - int rareItemAmt = rareItemList.Count; - int caughtRareItem = rareItemList[Main.rand.Next(rareItemAmt)]; - itemDrop = caughtRareItem; - } - } - else if (Main.rand.NextBool(chanceForGoldCrate)) - { - itemDrop = Main.hardMode ? ItemID.GoldenCrateHard : ItemID.GoldenCrate; - } - else if (Main.rand.NextBool(chanceForBiomeCrate)) - { - List biomeCrateList = new List(); - - biomeCrateList.AddWithCondition(Main.hardMode ? ModContent.ItemType() : ModContent.ItemType(), ZoneAstral); - biomeCrateList.AddWithCondition(Main.hardMode ? ModContent.ItemType() : ModContent.ItemType(), ZoneSunkenSea); - biomeCrateList.AddWithCondition(Main.hardMode ? ModContent.ItemType() : ModContent.ItemType(), canSulphurFish); - biomeCrateList.AddWithCondition(Main.hardMode ? ItemID.CorruptFishingCrateHard : ItemID.CorruptFishingCrate, Player.ZoneCorrupt); - biomeCrateList.AddWithCondition(Main.hardMode ? ItemID.CrimsonFishingCrateHard : ItemID.CrimsonFishingCrate, Player.ZoneCrimson); - biomeCrateList.AddWithCondition(Main.hardMode ? ItemID.HallowedFishingCrateHard : ItemID.HallowedFishingCrate, Player.ZoneHallow); - biomeCrateList.AddWithCondition(Main.hardMode ? ItemID.DungeonFishingCrateHard : ItemID.DungeonFishingCrate, Player.ZoneDungeon); - biomeCrateList.AddWithCondition(Main.hardMode ? ItemID.JungleFishingCrateHard : ItemID.JungleFishingCrate, Player.ZoneJungle); - biomeCrateList.AddWithCondition(Main.hardMode ? ItemID.FloatingIslandFishingCrateHard : ItemID.FloatingIslandFishingCrate, Player.ZoneSkyHeight); - biomeCrateList.AddWithCondition(Main.hardMode ? ItemID.FrozenCrateHard : ItemID.FrozenCrate, Player.ZoneSnow); - biomeCrateList.AddWithCondition(Main.hardMode ? ItemID.OasisCrateHard : ItemID.OasisCrate, Player.ZoneDesert && !Player.ZoneBeach); - biomeCrateList.AddWithCondition(Main.hardMode ? ItemID.OceanCrateHard : ItemID.OceanCrate, Player.ZoneBeach); - - if (biomeCrateList.Any()) - { - int biomeCrateAmt = biomeCrateList.Count; - int caughtBiomeCrate = biomeCrateList[Main.rand.Next(biomeCrateAmt)]; - itemDrop = caughtBiomeCrate; - } - } - else if (Main.rand.NextBool(chanceForIronCrate)) - { - itemDrop = Main.hardMode ? ItemID.IronCrateHard : ItemID.IronCrate; - } - else - { - itemDrop = Main.hardMode ? ItemID.WoodenCrateHard : ItemID.WoodenCrate; - } - return; - } - } - } - - if (water) - { - // Handle Calamity's crates, veryrare and legendary means it's a Golden Crate - if (attempt.crate) - { - if (attempt.rare && !attempt.veryrare && !attempt.legendary) - { - if (ZoneAstral) - { - itemDrop = Main.hardMode ? ModContent.ItemType() : ModContent.ItemType(); - } - if (ZoneSunkenSea) - { - itemDrop = Main.hardMode ? ModContent.ItemType() : ModContent.ItemType(); - } - if (canSulphurFish) - { - itemDrop = Main.hardMode ? ModContent.ItemType() : ModContent.ItemType(); - } - } - return; - } - - // Don't override the vanilla crates or any special vanilla fishing loot - List keepCatchList = new List() - { - ItemID.WoodenCrate, - ItemID.WoodenCrateHard, - ItemID.IronCrate, - ItemID.IronCrateHard, - ItemID.GoldenCrate, - ItemID.GoldenCrateHard, - ItemID.FrogLeg, - ItemID.BalloonPufferfish, - ItemID.ZephyrFish, - ItemID.CombatBook, - ItemID.CorruptFishingCrate, - ItemID.CorruptFishingCrateHard, - ItemID.CrimsonFishingCrate, - ItemID.CrimsonFishingCrateHard, - ItemID.HallowedFishingCrate, - ItemID.HallowedFishingCrateHard, - ItemID.DungeonFishingCrate, - ItemID.DungeonFishingCrateHard, - ItemID.JungleFishingCrate, - ItemID.JungleFishingCrateHard, - ItemID.FloatingIslandFishingCrate, - ItemID.FloatingIslandFishingCrateHard, - ItemID.FrozenCrate, - ItemID.FrozenCrateHard, - ItemID.OasisCrate, - ItemID.OasisCrateHard, - ItemID.OceanCrate, - ItemID.OceanCrateHard - }; - if (keepCatchList.Contains(itemDrop)) - { - return; - } - - if ((Player.ZoneCrimson || Player.ZoneCorrupt) && Player.ZoneRockLayerHeight && Main.hardMode) - { - if (attempt.uncommon && Main.rand.NextBool(7)) - { - itemDrop = ModContent.ItemType(); - } - } - - if (Player.ZoneHallow && Player.ZoneRockLayerHeight && Main.hardMode) - { - if (attempt.uncommon && Main.rand.NextBool(7)) - { - itemDrop = ModContent.ItemType(); - } - } - - if (Player.ZoneSkyHeight && Main.hardMode) - { - if (attempt.uncommon && Main.rand.NextBool(7)) - { - itemDrop = Main.rand.NextBool() ? ModContent.ItemType() : ModContent.ItemType(); - } - } - - // Increased chance of Enchanted Starfish if you don't have maximum mana - if (Player.ZoneOverworldHeight && !Main.dayTime) - { - int chance = Player.statManaMax < 200 ? 5 : 20; - if (attempt.uncommon && Main.rand.NextBool(chance)) - { - itemDrop = ModContent.ItemType(); - } - } - - if (!Player.ZoneSkyHeight && !Main.dayTime) - { - if (attempt.uncommon && Main.rand.NextBool(10)) - { - itemDrop = ModContent.ItemType(); - } - } - - if (Player.ZoneOverworldHeight && Main.dayTime) - { - if (attempt.uncommon && Main.rand.NextBool(7)) - { - itemDrop = ModContent.ItemType(); - } - } - - if (Player.ZoneRockLayerHeight) - { - if (attempt.uncommon && Main.rand.NextBool(7)) - { - itemDrop = ModContent.ItemType(); - } - } - - if (Player.ZoneSnow && Main.hardMode) - { - if (attempt.uncommon && Main.rand.NextBool(7)) - { - itemDrop = ModContent.ItemType(); - } - } - - // Lower chance of Spadefish in Hardmode - if (Player.ZoneDirtLayerHeight) - { - int chance = Main.hardMode ? 10 : 2; - if (attempt.veryrare && Main.rand.NextBool(chance)) - { - itemDrop = ModContent.ItemType(); - } - } - - if (Player.FindBuffIndex(BuffID.Gills) > -1 && DownedBossSystem.downedLeviathan && (attempt.legendary || (attempt.veryrare && Main.rand.NextBool()))) - { - itemDrop = ModContent.ItemType(); - } - - if (Player.ZoneOverworldHeight && Main.bloodMoon) - { - if (attempt.uncommon && Main.rand.NextBool(7)) - { - itemDrop = ModContent.ItemType(); - } - } - - if (ZoneAstral) // Astral Infection, fishing in water - { - if (attempt.legendary) - { - int legendaryCatch = Utils.SelectRandom(Main.rand, new int[] - { - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType() - }); - itemDrop = legendaryCatch; - } - else if (attempt.uncommon || attempt.rare || attempt.veryrare) - { - int uncommonCatch = Utils.SelectRandom(Main.rand, new int[] - { - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType() - }); - itemDrop = uncommonCatch; - } - else - { - itemDrop = ModContent.ItemType(); - return; - } - } - - if (ZoneSunkenSea) // Sunken Sea, fishing in water - { - if (attempt.legendary) - { - List legendaryCatches = new List() - { - ModContent.ItemType() - }; - legendaryCatches.AddWithCondition(ModContent.ItemType(), DownedBossSystem.downedDesertScourge); - legendaryCatches.AddWithCondition(ModContent.ItemType(), Main.hardMode); - itemDrop = legendaryCatches[Main.rand.Next(legendaryCatches.Count)]; - } - else if (attempt.veryrare) - { - itemDrop = ModContent.ItemType(); - } - else if (attempt.uncommon || attempt.rare) - { - itemDrop = ModContent.ItemType(); - } - else - { - itemDrop = ModContent.ItemType(); - return; - } - } - - // There is no complete fishing pool here, so most of it is vanilla default - if (canSulphurFish) // Sulphurous Sea, fishing in water - { - if (attempt.legendary || (attempt.veryrare && Main.rand.NextBool())) - { - itemDrop = Utils.SelectRandom(Main.rand, new int[] - { - ModContent.ItemType(), - ModContent.ItemType() - }); - } - else if (attempt.common) - { - itemDrop = ModContent.ItemType(); - } - } - - /*if (canSulphurFish && (bait.type == ItemID.GoldWorm || bait.type == ItemID.GoldGrasshopper || bait.type == ItemID.GoldButterfly) && power > 150) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - CalamityGlobalNPC.OldDukeSpawn(player.whoAmI, ModContent.NPCType()); - } - else - { - NetMessage.SendData(61, -1, -1, null, player.whoAmI, (float)ModContent.NPCType(), 0f, 0f, 0, 0, 0); - } - switch (Main.rand.Next(4)) - { - case 0: itemDrop = ModContent.ItemType(); break; //movement acc - case 1: itemDrop = ModContent.ItemType(); break; //regen acc - case 2: itemDrop = ModContent.ItemType(); break; //defense acc - case 3: itemDrop = ModContent.ItemType(); break; //light pet - } - return; - }*/ - } - + // Fishing in lava overrides the rest of logic if (lava) { - if (ZoneCalamity) // Brimstone Crags, fishing in lava + // Don't do anything if you can't fish in lava + if (!attempt.CanFishInLava) + return; + + if (ZoneCalamity) { - if (attempt.crate) - { + // Crates have highest priority + if (attempt.crate && attempt.rare) itemDrop = Main.hardMode ? ModContent.ItemType() : ModContent.ItemType(); - } else if (attempt.legendary) - { itemDrop = ModContent.ItemType(); - } - // Increased chance of Dragoon Drizzlefish in Prehardmode - else if (attempt.veryrare && !Main.hardMode) - { - itemDrop = ModContent.ItemType(); - } else if (attempt.veryrare) - { itemDrop = ModContent.ItemType(); - } - else if ((attempt.rare || attempt.veryrare) && DownedBossSystem.downedProvidence && Main.rand.Next(3) >= 2) - { + else if (DownedBossSystem.downedProvidence && ((attempt.rare && Main.rand.NextBool(2)) || (attempt.uncommon && Main.rand.NextBool(4)))) itemDrop = ModContent.ItemType(); - } - else if (attempt.uncommon || attempt.rare) + // Quest fish hover around this priority + else if (questFish == ModContent.ItemType() && attempt.uncommon) + itemDrop = ModContent.ItemType(); + else if (questFish == ModContent.ItemType() && attempt.uncommon) + itemDrop = ModContent.ItemType(); + else if (grabBagFish && Main.hardMode) + itemDrop = ModContent.ItemType(); + else if (attempt.rare) { List uncommonCatches = new List() { ModContent.ItemType(), ModContent.ItemType() }; - uncommonCatches.AddWithCondition(ModContent.ItemType(), Main.hardMode); itemDrop = uncommonCatches[Main.rand.Next(uncommonCatches.Count)]; } + // Lava fish usually don't have plentiful catches but we can be more lenient else - { itemDrop = ModContent.ItemType(); - } } + return; + } + + // Honey also overrides logic but we have nothing to catch from honey... for now + if (honey) + return; + + // Old Duke spawn + if (canSulphurFish && bait == ModContent.ItemType() && !BossRushEvent.BossRushActive) + { + CalamityGlobalNPC.OldDukeSpawn(Player.whoAmI, ModContent.NPCType(), bait); + } + + // Ignore catches if it's junk + if (itemDrop == ItemID.OldShoe || itemDrop == ItemID.FishingSeaweed || itemDrop == ItemID.TinCan || itemDrop == ItemID.JojaCola) + return; + + if (attempt.crate) + { + // This can override Golden/Titanium Crates, but so do vanilla biome crates + // Those are still obtainable if the catch is very rare/legendary but not rare (fishing oddities) + if (attempt.rare) + { + if (ZoneAstral) + itemDrop = Main.hardMode ? ModContent.ItemType() : ModContent.ItemType(); + if (ZoneSunkenSea) + itemDrop = Main.hardMode ? ModContent.ItemType() : ModContent.ItemType(); + if (canSulphurFish) + itemDrop = Main.hardMode ? ModContent.ItemType() : ModContent.ItemType(); + } + return; + } + + // Ignore all top priority legendary vanilla catches + List keepCatchList = new List() + { + ItemID.CombatBook, + ItemID.DreadoftheRedSea, + ItemID.FrogLeg, + ItemID.BalloonPufferfish, + ItemID.ZephyrFish + }; + if (keepCatchList.Contains(itemDrop)) + return; + + // Add top priorities of our own + if (DownedBossSystem.downedLeviathan && attempt.legendary && poolSize > 1000) + { + itemDrop = ModContent.ItemType(); + return; + } + + if (grabBagFish) + { + if (surface && Main.bloodMoon) + itemDrop = ModContent.ItemType(); + else if (surface && Main.dayTime) + itemDrop = ModContent.ItemType(); + else if (cavern) + itemDrop = ModContent.ItemType(); + if (Main.hardMode) + { + // Fish of Light/Night are evenly split with Gemfish + if ((Player.ZoneCrimson || Player.ZoneCorrupt) && cavern && Main.rand.NextBool()) + itemDrop = ModContent.ItemType(); + else if (Player.ZoneHallow && cavern && Main.rand.NextBool()) + itemDrop = ModContent.ItemType(); + else if (Player.ZoneSnow) + itemDrop = ModContent.ItemType(); + else if (sky) + itemDrop = Main.rand.NextBool() ? ModContent.ItemType() : ModContent.ItemType(); + } + } + + // Increased chance of Enchanted Starfish if you don't have maximum mana + if (surface && !Main.dayTime) // Surface + { + int chance = (Player.ConsumedManaCrystals >= Player.ManaCrystalMax) ? 20 : 5; + if (attempt.uncommon && Main.rand.NextBool(chance)) + itemDrop = ModContent.ItemType(); + + if (attempt.uncommon && Main.rand.NextBool(10)) + itemDrop = ModContent.ItemType(); + } + + // Lower chance of Spadefish in Hardmode + if (underground) // Underground + { + int chance = Main.hardMode ? 10 : 2; + if (attempt.veryrare && Main.rand.NextBool(chance)) + { + itemDrop = ModContent.ItemType(); + } + } + + if (ZoneAstral) + { + if (attempt.legendary) + { + int legendaryCatch = Utils.SelectRandom(Main.rand, new int[] + { + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType() + }); + itemDrop = legendaryCatch; + } + else if (attempt.veryrare) + itemDrop = ModContent.ItemType(); + else if (attempt.uncommon || attempt.rare) + { + int uncommonCatch = Utils.SelectRandom(Main.rand, new int[] + { + ModContent.ItemType(), + ModContent.ItemType() + }); + itemDrop = uncommonCatch; + } + else + itemDrop = ModContent.ItemType(); + return; + } + if (ZoneSunkenSea) + { + // If the player is overlapping with the desert, split the catches + if (Player.ZoneDesert && Main.rand.NextBool()) + return; + + if (attempt.legendary) + { + List legendaryCatches = new List() + { + ModContent.ItemType() + }; + legendaryCatches.AddWithCondition(ModContent.ItemType(), DownedBossSystem.downedDesertScourge); + legendaryCatches.AddWithCondition(ModContent.ItemType(), Main.hardMode); + itemDrop = legendaryCatches[Main.rand.Next(legendaryCatches.Count)]; + } + else if (attempt.veryrare) + itemDrop = ModContent.ItemType(); + // Quest fish hover around this priority + else if (questFish == ModContent.ItemType() && attempt.uncommon) + itemDrop = ModContent.ItemType(); + else if (questFish == ModContent.ItemType() && attempt.uncommon) + itemDrop = ModContent.ItemType(); + else if (questFish == ModContent.ItemType() && attempt.uncommon) + itemDrop = ModContent.ItemType(); + else if (attempt.uncommon || attempt.rare) + itemDrop = ModContent.ItemType(); + else + itemDrop = ModContent.ItemType(); + return; + } + // There is no complete fishing pool here, so most of it is vanilla default + if (canSulphurFish) + { + if (attempt.legendary) + { + itemDrop = Utils.SelectRandom(Main.rand, new int[] + { + ModContent.ItemType(), + ModContent.ItemType() + }); + } + else if (attempt.common && Main.rand.NextBool()) + itemDrop = ModContent.ItemType(); } } #endregion @@ -597,6 +302,7 @@ namespace CalamityMod.CalPlayer #region Get Fishing Level public override void GetFishingLevel(Item fishingRod, Item bait, ref float fishingLevel) { + // Note: This is calculated after equipments (Rod, Bait, Potions, etc) and before modifications (Chum Buckets, Luck) if ((ZoneAstral || ZoneAbyss || ZoneSulphur) && bait.type == ModContent.ItemType()) fishingLevel = fishingLevel * ArcturusAstroidean.FishingPowerBiomeMult; if (Player.ZoneSnow && fishingRod.type == ModContent.ItemType()) @@ -634,9 +340,10 @@ namespace CalamityMod.CalPlayer } #endregion - #region Get Fishing Level + #region Modify Caught Fish public override void ModifyCaughtFish(Item fish) { + // Increases the yield of potion ingredient fish with Alluring Bait if (alluringBait) { List fishList = new List() @@ -663,10 +370,7 @@ namespace CalamityMod.CalPlayer }; if (fishList.Contains(fish.type)) - { - // Increase the yield by 1 or 2 - fish.stack += Main.rand.NextBool() ? 1 : 2; - } + fish.stack += Main.rand.Next(1, 3 + 1); } } #endregion diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index f1278c5f69..18051976c0 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -34,6 +34,7 @@ using CalamityMod.Particles; using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Typeless; +using CalamityMod.Systems.Collections; using CalamityMod.UI; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -688,7 +689,7 @@ namespace CalamityMod.CalPlayer { Item heldItem = Player.ActiveItem(); - if (CalamityUtils.ShouldTriggerSummonPenalty(Player, heldItem) && !CalamityLists.DisabledSummonerNerfMinions.Contains(proj.type)) + if (CalamityUtils.ShouldTriggerSummonPenalty(Player, heldItem) && !DisabledSummonerNerfMinionList.Includes(proj.type)) modifiers.FinalDamage *= BalancingConstants.SummonerCrossClassNerf; } } @@ -897,7 +898,7 @@ namespace CalamityMod.CalPlayer { // TODO -- Evolution dodge isn't actually a dodge and you'll still get hit for 1. // This should probably be changed so that when the evolution reflects it gives you 1 frame of guaranteed free dodging everything. - if (CalamityLists.projectileDestroyExceptionList.TrueForAll(x => proj.type != x) && proj.active && !proj.friendly && proj.hostile && proj.damage > 0) + if (!ProjectileDestroyExceptionsList.Includes(proj.type) && proj.active && !proj.friendly && proj.hostile && proj.damage > 0) { double dodgeDamageGateValuePercent = 0.05; int dodgeDamageGateValue = (int)Math.Round(Player.statLifeMax2 * dodgeDamageGateValuePercent); @@ -1030,7 +1031,7 @@ namespace CalamityMod.CalPlayer projectileDamageReduction += 0.25; } - if (CalamityLists.projectileDestroyExceptionList.TrueForAll(x => proj.type != x) && proj.active && !proj.friendly && proj.hostile && proj.damage > 0) + if (!ProjectileDestroyExceptionsList.Includes(proj.type) && proj.active && !proj.friendly && proj.hostile && proj.damage > 0) { // Daedalus Reflect counts as a reflect but doesn't actually stop you from taking damage if (daedalusReflect && !disableAllDodges && !evolution && !Player.HasCooldown(GlobalDodge.ID)) @@ -1452,7 +1453,7 @@ namespace CalamityMod.CalPlayer } // As these reflects do not cancel damage, they need to be in OnHit rather than ModifyHit - if (CalamityLists.projectileDestroyExceptionList.TrueForAll(x => proj.type != x) && proj.active && !proj.friendly && proj.hostile && hurtInfo.Damage > 0) + if (!ProjectileDestroyExceptionsList.Includes(proj.type) && proj.active && !proj.friendly && proj.hostile && hurtInfo.Damage > 0) { double dodgeDamageGateValuePercent = 0.05; int dodgeDamageGateValue = (int)Math.Round(Player.statLifeMax2 * dodgeDamageGateValuePercent); @@ -1643,7 +1644,7 @@ namespace CalamityMod.CalPlayer { double maxCooldownDurationDamagePercent = 0.5; int maxCooldownDurationDamageValue = (int)Math.Round(Player.statLifeMax2 * (maxCooldownDurationDamagePercent - dodgeDamageGateValuePercent)); - + // Just in case... if (maxCooldownDurationDamageValue <= 0) maxCooldownDurationDamageValue = 1; @@ -2506,7 +2507,7 @@ namespace CalamityMod.CalPlayer if (Player.ownedProjectileCounts[ModContent.ProjectileType()] != 0) { - foreach(Projectile p in Main.ActiveProjectiles) + foreach (Projectile p in Main.ActiveProjectiles) { if (p.type == ModContent.ProjectileType() && p.owner == Player.whoAmI) { @@ -2981,7 +2982,7 @@ namespace CalamityMod.CalPlayer bool externalFlagsAppropriate = !CalamityMod.ExternalFlag_DisableDefenseDamage && !externalDefenseDamageImmunity; if (!externalFlagsAppropriate) return; - + // Can be dynamically reduced by Adamantite set bonus and maybe other future effects. int defenseDamageTaken = defenseDamage; diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 374e09843d..49dd58e354 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -13,9 +13,9 @@ using CalamityMod.Items.Placeables.Furniture; using CalamityMod.Items.Potions; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.NPCs; -using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Typeless; using CalamityMod.Systems; +using CalamityMod.Systems.Collections; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; @@ -23,7 +23,6 @@ using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Utilities.Terraria.Utilities; namespace CalamityMod.CalPlayer { @@ -388,11 +387,11 @@ namespace CalamityMod.CalPlayer int buffID = Player.buffType[l]; if (Player.buffTime[l] <= 2) continue; - bool shouldHalveDuration = CalamityLists.sicknessDebuffList.Contains(buffID); + bool shouldHalveDuration = SicknessDebuffsList.Includes(buffID); if (livingDewHalveDebuffs) - shouldHalveDuration |= CalamityLists.fireDebuffList.Contains(buffID); + shouldHalveDuration |= FireDebuffsList.Includes(buffID); if (purity) - shouldHalveDuration |= CalamityLists.debuffList.Contains(buffID); + shouldHalveDuration |= DebuffsList.Includes(buffID); if (shouldHalveDuration) --Player.buffTime[l]; @@ -436,7 +435,7 @@ namespace CalamityMod.CalPlayer } // Permafrost's Concoction increases life regen while afflicted with a fire debuff - if (permafrostsConcoction && Player.buffType.Any(CalamityLists.fireDebuffList.Contains)) + if (permafrostsConcoction && Player.buffType.Any(FireDebuffsList.Includes)) { if (Player.lifeRegenTime < 1800) Player.lifeRegenTime = 1800; @@ -456,7 +455,7 @@ namespace CalamityMod.CalPlayer if (purity) { int intendedPurityDefense = 0; - int currentDebuffs = Player.buffType.Count(CalamityLists.debuffList.Contains); + int currentDebuffs = Player.buffType.Count(DebuffsList.List.Contains); if (currentDebuffs > 0) { // Healing rate is normally 5 HP/s (+1 every 12 frames) @@ -509,7 +508,7 @@ namespace CalamityMod.CalPlayer // If the player has any debuffs, give the extra life regen and defense // More defense is given for each additional debuff int intendedJewelDefense = 0; - int currentDebuffs = Player.buffType.Count(CalamityLists.debuffList.Contains); + int currentDebuffs = Player.buffType.Count(DebuffsList.List.Contains); if (currentDebuffs > 0) { Player.lifeRegen += 4; @@ -536,7 +535,7 @@ namespace CalamityMod.CalPlayer Player.lifeRegen += 2; // If any debuff is detected, provide even more life regen and massively accelerate it - if (Player.buffType.Any(CalamityLists.debuffList.Contains)) + if (Player.buffType.Any(DebuffsList.List.Contains)) { Player.lifeRegen += 3; if (Player.lifeRegenTime < 1800) @@ -557,7 +556,7 @@ namespace CalamityMod.CalPlayer // Yes, really, there's a list of conditions under which life regen doesn't work // even if it's life regen that normally works during a damage over time debuff. // - // 1. No life regen bool (Blood Boiler usage or wearing Omega Blue armor) + // 1. No life regen bool (Omega Blue armor) // 2. Being too far from Providence cocoon ("Holy Inferno") // 3. Air drowning in the Abyss // @@ -702,7 +701,7 @@ namespace CalamityMod.CalPlayer for (int l = 0; l < Player.MaxBuffs; l++) { int hasBuff = Player.buffType[l]; - lesserEffect = CalamityLists.alcoholList.Contains(hasBuff); + lesserEffect = AlcoholsList.List.Contains(hasBuff); } if (Player.lifeRegen < 0) Player.lifeRegen += lesserEffect ? 1 : regenBoost; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 429af9c12e..55562caac8 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using CalamityMod.Balancing; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.Placeables; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Buffs.Summon; @@ -58,6 +59,7 @@ using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; using CalamityMod.Systems; +using CalamityMod.Systems.Collections; using CalamityMod.Tiles.Abyss.AbyssAmbient; using CalamityMod.Tiles.FurnitureAuric; using CalamityMod.Tiles.Ores; @@ -368,7 +370,7 @@ namespace CalamityMod.CalPlayer } IsFirstDashFrame = false; } - + float sparkscale1 = MathF.Min(Player.velocity.X * dir * 0.08f, 1.2f); Vector2 SparkVelocity1 = -Player.velocity.SafeNormalize(Vector2.UnitX) * 5; @@ -550,7 +552,7 @@ namespace CalamityMod.CalPlayer // If they're a boss, reduce the boss distance. // Boss distance will always be >= enemy distance, so there's no need to do another check. // Worm boss body and tail segments are not counted as bosses for this calculation. - if (npc.IsABoss() && !CalamityLists.noRageWormSegmentList.Contains(npc.type)) + if (npc.IsABoss() && !NoRageWormSegmentList.Includes(npc.type)) bossDistance = hitboxEdgeDist; } } @@ -1009,7 +1011,7 @@ namespace CalamityMod.CalPlayer continue; var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); - if (Main.myPlayer == Player.whoAmI && target.WithinRange(Player.Center , 2000f)) + if (Main.myPlayer == Player.whoAmI && target.WithinRange(Player.Center, 2000f)) { Projectile.NewProjectile(source, target.Center, Vector2.Zero, bullseyeType, 0, 0f, Player.whoAmI, target.whoAmI); @@ -1072,8 +1074,8 @@ namespace CalamityMod.CalPlayer { for (int l = 0; l < Player.MaxBuffs; l++) { - int hasBuff = Player.buffType[l]; - if (Player.buffTime[l] > 2 && CalamityLists.debuffList.Contains(hasBuff)) + int buffID = Player.buffType[l]; + if (Player.buffTime[l] > 2 && DebuffsList.Includes(buffID)) Player.buffTime[l]--; } } @@ -1844,7 +1846,7 @@ namespace CalamityMod.CalPlayer // God Slayer Armor dash debuff immunity if (DashID == GodSlayerDash.ID && Player.dashDelay < 0) { - foreach (int debuff in CalamityLists.debuffList) + foreach (int debuff in DebuffsList.List) Player.buffImmune[debuff] = true; } @@ -1916,7 +1918,7 @@ namespace CalamityMod.CalPlayer if (silvaCountdown > 0 && hasSilvaEffect && silvaSet) { // You become immune to all debuffs - foreach (int debuff in CalamityLists.debuffList) + foreach (int debuff in DebuffsList.List) Player.buffImmune[debuff] = true; // Prevent thorns effects from being abused during invincibility @@ -1991,12 +1993,12 @@ namespace CalamityMod.CalPlayer for (int l = 0; l < Player.MaxBuffs; l++) { - int hasBuff = Player.buffType[l]; - if (Player.buffTime[l] <= 2 && hasBuff == ModContent.BuffType()) + int buffID = Player.buffType[l]; + if (Player.buffTime[l] <= 2 && buffID == ModContent.BuffType()) if (Player.whoAmI == Main.myPlayer) Player.AddCooldown(Cooldowns.TarragonImmunity.ID, CalamityUtils.SecondsToFrames(25)); - bool shouldAffect = CalamityLists.debuffList.Contains(hasBuff); + bool shouldAffect = DebuffsList.Includes(buffID); if (shouldAffect) Player.GetDamage() += 0.1f; } @@ -3139,7 +3141,7 @@ namespace CalamityMod.CalPlayer } } - if (CalamityLists.highTestFishList.Contains(Player.ActiveItem().type)) + if (HighTestFishingPoleList.Includes(Player.ActiveItem().type)) Player.accFishingLine = true; if (planarSpeedBoost != 0) @@ -3236,7 +3238,7 @@ namespace CalamityMod.CalPlayer Player.statDefense += Mushy.DefenseBoost; if (fungalSymbiote) Player.GetDamage() += 0.1f; - } + } if (omniscience) { @@ -3908,8 +3910,8 @@ namespace CalamityMod.CalPlayer { for (int l = 0; l < Player.MaxBuffs; l++) { - int hasBuff = Player.buffType[l]; - if (CalamityLists.amalgamBuffList.Contains(hasBuff)) + int buffID = Player.buffType[l]; + if (AmalgamBuffList.Includes(buffID)) { if (amalgam) { @@ -3920,14 +3922,14 @@ namespace CalamityMod.CalPlayer Player.buffTime[l] += 1; // Buffs will not go away when you die, to prevent wasting potions. - if (!Main.persistentBuff[hasBuff]) - Main.persistentBuff[hasBuff] = true; + if (!Main.persistentBuff[buffID]) + Main.persistentBuff[buffID] = true; } else { // Reset buff persistence if Amalgam is removed. - if (Main.persistentBuff[hasBuff] && !CalamityLists.persistentBuffList.Contains(hasBuff)) - Main.persistentBuff[hasBuff] = false; + if (Main.persistentBuff[buffID] && !PersistentBuffList.Includes(buffID)) + Main.persistentBuff[buffID] = false; } } } @@ -4310,7 +4312,7 @@ namespace CalamityMod.CalPlayer // Apply defense damage Player.statDefense -= currentDefenseDamage; - + } // Defense can never be reduced below zero, no matter what diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 8697e95793..7fe8646eaf 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -7,26 +7,23 @@ using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Cooldowns; using CalamityMod.Dusts; -using CalamityMod.Enums; -using CalamityMod.EntitySources; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Reaver; using CalamityMod.Items.Fishing.AstralCatches; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.VanillaArmorChanges; -using CalamityMod.Items.Weapons.Ranged; using CalamityMod.NPCs; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.Particles; using CalamityMod.Projectiles; using CalamityMod.Projectiles.Healing; using CalamityMod.Projectiles.Magic; -using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; using CalamityMod.Systems; +using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -280,7 +277,7 @@ namespace CalamityMod.CalPlayer if (!proj.npcProj && !proj.trap && proj.friendly) { - if ((plaguebringerCarapace || uberBees) && CalamityLists.friendlyBeeList.Contains(proj.type)) + if ((plaguebringerCarapace || uberBees) && FriendlyBeesList.Includes(proj.type)) target.AddBuff(BuffType(), 300); // All projectiles fired from Soma Prime are marked using CalamityGlobalProjectile @@ -1144,7 +1141,7 @@ namespace CalamityMod.CalPlayer if (profanedCrystal && (DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs)) { - target.AddBuff(BuffType(), 600); + target.AddBuff(BuffType(), 600); } if (divineBless) diff --git a/CalPlayer/Dashes/StatisNinjaBeltDash.cs b/CalPlayer/Dashes/StatisNinjaBeltDash.cs new file mode 100644 index 0000000000..a0253e7f77 --- /dev/null +++ b/CalPlayer/Dashes/StatisNinjaBeltDash.cs @@ -0,0 +1,57 @@ +using CalamityMod.Enums; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; + +namespace CalamityMod.CalPlayer.Dashes +{ + public class StatisNinjaBeltDash : PlayerDashEffect + { + public static new string ID => "Statis' Ninja Belt"; + public override DashCollisionType CollisionType => DashCollisionType.NoCollision; + public override bool IsOmnidirectional => false; + public int Time = 0; + + public override float CalculateDashSpeed(Player player) => 20f; + + public override void OnDashEffects(Player player) + { + Time = 0; + for (int i = 0; i < 12; i++) + { + Vector2 smokePos = player.Center + new Vector2(Main.rand.Next(-player.width, player.width), Main.rand.Next(-player.height, player.height)) * 0.8f; + Vector2 smokeVel = Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat(1.25f, 1.75f); + HeavySmokeParticle onDashSmoke = new(smokePos, smokeVel, Color.Gray, 30, 0.5f, 0.75f, 0.2f * Main.rand.NextFloatDirection()); + GeneralParticleHandler.SpawnParticle(onDashSmoke); + } + } + + public override void MidDashEffects(Player player, ref float dashSpeed, ref float dashSpeedDecelerationFactor, ref float runSpeedDecelerationFactor) + { + Time++; + if (Time % 3 == 0) + { + int colorType = Main.rand.Next(3); + Color smokeColor = Color.White; + switch (colorType) + { + case 0: + smokeColor = Color.Gray; + break; + case 1: + smokeColor = new Color(28, 75, 163); + break; + case 2: + smokeColor = new Color(195, 0, 255); + break; + } + + Vector2 smokePos = player.Center - (player.velocity * 1.25f) + Main.rand.NextVector2Circular(10, 20); + float smokeScale = player.velocity.X * 0.045f; + HeavySmokeParticle midDashSmoke = new(smokePos, player.velocity * 0.2f, smokeColor, 20, smokeScale, 0.75f, 0.2f * Main.rand.NextFloatDirection(), true); + GeneralParticleHandler.SpawnParticle(midDashSmoke); + } + } + } +} diff --git a/CalPlayer/DrawLayers/CombHairSparkleLayer.cs b/CalPlayer/DrawLayers/CombHairSparkleLayer.cs new file mode 100644 index 0000000000..18ca428d85 --- /dev/null +++ b/CalPlayer/DrawLayers/CombHairSparkleLayer.cs @@ -0,0 +1,106 @@ +using CalamityMod.Items.Accessories.Vanity; +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.CalPlayer.DrawLayers +{ + public class CombHairSparkleLayer : PlayerDrawLayer + { + public override Position GetDefaultPosition() => new BeforeParent(PlayerDrawLayers.LeinforsHairShampoo); + + public override bool IsHeadLayer => true; + + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + CalamityPlayer modPlayer = drawPlayer.Calamity(); + + // Specific hair drawing requirements: Hair must be drawing with 20% lightness, and you're not bald + bool canReceiveHairSparkles = (drawInfo.fullHair || drawInfo.hatHair || drawInfo.drawsBackHairWithoutHeadgear || drawPlayer.head == -1 || drawPlayer.head == 0) && Main.rgbToHsl(drawInfo.colorHead).Z > 0.2f; + bool baldHairStyles = drawPlayer.hair == 15 || drawPlayer.hair == 76; + return drawInfo.shadow == 0f && !drawPlayer.dead && !drawInfo.headOnlyRender && modPlayer.combHair && canReceiveHairSparkles && !baldHairStyles; + } + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + + // 5% chance per frame any of this draws + if (!Main.rand.NextBool(20)) + return; + + // Search through the equipped index for the comb. We need this to get the right dye + int dyeIndex = -1; + for (int i = 0; i < 20; i++) + { + if (drawPlayer.armor[i].type == ModContent.ItemType()) + { + dyeIndex = i; + break; + } + } + var shader = GameShaders.Armor.GetSecondaryShader(dyeIndex == -1 ? 0 : drawPlayer.dye[dyeIndex % 10].dye, drawPlayer); + + // Now detect if there are chests nearby + int LeftRange = Utils.Clamp((int)drawPlayer.MountedCenter.X / 16 - 50, 2, Main.maxTilesX - 2); + int RightRange = Utils.Clamp((int)drawPlayer.MountedCenter.X / 16 + 50, 2, Main.maxTilesX - 2); + int TopRange = Utils.Clamp((int)drawPlayer.MountedCenter.Y / 16 - 50, 2, Main.maxTilesY - 2); + int BottomRange = Utils.Clamp((int)drawPlayer.MountedCenter.Y / 16 + 50, 2, Main.maxTilesY - 2); + + float range = 50000f; + Vector2 ChestPosition = Vector2.Zero; + for (int i = LeftRange; i <= RightRange; i++) + { + for (int j = TopRange; j <= BottomRange; j++) + { + int PotentialChest = Chest.FindChestByGuessing(i, j); + if (PotentialChest != -1 && !TileID.Sets.BasicDresser[Main.tile[i, j].TileType]) + { + // Adjust position ot the center of the chest + Chest chest = Main.chest[PotentialChest]; + Vector2 chestCenter = new Vector2(chest.x + 1, chest.y + 1) * 16f; + float distance = Vector2.Distance(chestCenter, drawPlayer.MountedCenter); + + if (distance < range) + { + range = distance; + ChestPosition = chestCenter; + } + } + } + } + + if (!drawInfo.hatHair || Main.rand.NextBool()) + { + Rectangle area = drawInfo.hatHair ? Utils.CenteredRectangle(drawInfo.Position + drawPlayer.Size * 0.5f + new Vector2(drawPlayer.direction * -10, drawPlayer.gravDir * -10f), new Vector2(5f, 5f)) + : Utils.CenteredRectangle(drawInfo.Position + drawPlayer.Size * 0.5f + new Vector2(0f, drawPlayer.gravDir * -20f), new Vector2(20f, 14f)); + + Dust sparkle = Dust.NewDustDirect(area.TopLeft(), area.Width, area.Height, DustID.GoldCoin, Alpha: 150, Scale: 0.3f); + sparkle.fadeIn = 1f; + sparkle.velocity = ChestPosition == Vector2.Zero ? (sparkle.velocity * 0.1f) : (ChestPosition - sparkle.position).SafeNormalize(Vector2.Zero) * 0.2f; + sparkle.noLight = true; + sparkle.shader = shader; + drawInfo.DustCache.Add(sparkle.dustIndex); + } + + // Back hair + if (drawPlayer.velocity.X != 0f && drawInfo.backHairDraw) + { + Rectangle areaB = Utils.CenteredRectangle(drawInfo.Position + drawPlayer.Size * 0.5f + new Vector2(drawPlayer.direction * -14, 0f), new Vector2(4f, 30f)); + Dust sparkleB = Dust.NewDustDirect(areaB.TopLeft(), areaB.Width, areaB.Height, DustID.GoldCoin, Alpha: 150, Scale: 0.3f); + sparkleB.fadeIn = 1f; + sparkleB.velocity = ChestPosition == Vector2.Zero ? (sparkleB.velocity * 0.1f) : (ChestPosition - sparkleB.position).SafeNormalize(Vector2.Zero) * 0.2f; + sparkleB.noLight = true; + sparkleB.shader = shader; + drawInfo.DustCache.Add(sparkleB.dustIndex); + } + } + } +} diff --git a/CalamityLists.cs b/CalamityLists.cs deleted file mode 100644 index 50a7bce5a9..0000000000 --- a/CalamityLists.cs +++ /dev/null @@ -1,2827 +0,0 @@ -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.Abyss; -using CalamityMod.Items.Placeables.Furniture.Trophies; -using CalamityMod.Items.Tools; -using CalamityMod.Items.TreasureBags; -using CalamityMod.Items.Weapons.DraedonsArsenal; -using CalamityMod.Items.Weapons.Magic; -using CalamityMod.Items.Weapons.Melee; -using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.Items.Weapons.Summon; -using CalamityMod.NPCs.Abyss; -using CalamityMod.NPCs.AcidRain; -using CalamityMod.NPCs.AquaticScourge; -using CalamityMod.NPCs.Astral; -using CalamityMod.NPCs.AstrumAureus; -using CalamityMod.NPCs.AstrumDeus; -using CalamityMod.NPCs.BrimstoneElemental; -using CalamityMod.NPCs.Bumblebirb; -using CalamityMod.NPCs.CalClone; -using CalamityMod.NPCs.CeaselessVoid; -using CalamityMod.NPCs.Crabulon; -using CalamityMod.NPCs.Crags; -using CalamityMod.NPCs.Cryogen; -using CalamityMod.NPCs.DesertScourge; -using CalamityMod.NPCs.DevourerofGods; -using CalamityMod.NPCs.ExoMechs.Apollo; -using CalamityMod.NPCs.ExoMechs.Ares; -using CalamityMod.NPCs.ExoMechs.Artemis; -using CalamityMod.NPCs.ExoMechs.Thanatos; -using CalamityMod.NPCs.GreatSandShark; -using CalamityMod.NPCs.HiveMind; -using CalamityMod.NPCs.Leviathan; -using CalamityMod.NPCs.NormalNPCs; -using CalamityMod.NPCs.OldDuke; -using CalamityMod.NPCs.Perforator; -using CalamityMod.NPCs.PlaguebringerGoliath; -using CalamityMod.NPCs.PlagueEnemies; -using CalamityMod.NPCs.Polterghast; -using CalamityMod.NPCs.PrimordialWyrm; -using CalamityMod.NPCs.ProfanedGuardians; -using CalamityMod.NPCs.Providence; -using CalamityMod.NPCs.Ravager; -using CalamityMod.NPCs.Signus; -using CalamityMod.NPCs.SlimeGod; -using CalamityMod.NPCs.StormWeaver; -using CalamityMod.NPCs.SunkenSea; -using CalamityMod.NPCs.SupremeCalamitas; -using CalamityMod.NPCs.Yharon; -using CalamityMod.Projectiles.Boss; -using CalamityMod.Projectiles.DraedonsArsenal; -using CalamityMod.Projectiles.Magic; -using CalamityMod.Projectiles.Melee; -using CalamityMod.Projectiles.Melee.MaceFlails; -using CalamityMod.Projectiles.Ranged; -using CalamityMod.Projectiles.Rogue; -using CalamityMod.Projectiles.Summon; -using CalamityMod.Projectiles.Typeless; -using CalamityMod.Tiles.LivingFire; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using static Terraria.ModLoader.ModContent; - -namespace CalamityMod -{ - public sealed class CalamityLists : ModSystem - { - public static IList donatorList; - public static List projectileDestroyExceptionList; - public static List enemyImmunityList; - public static List confusionEnemyList; - public static List dungeonEnemyBuffList; - public static List dungeonProjectileBuffList; - public static List bossHPScaleList; - public static List friendlyBeeList; - public static List debuffList; - public static List fireDebuffList; - public static List sicknessDebuffList; - public static List alcoholList; - public static List spearAutoreuseList; - public static List pumpkinMoonBuffList; - public static List frostMoonBuffList; - public static List eclipseBuffList; - public static List eventProjectileBuffList; - public static List noRageWormSegmentList; - public static List needsDebuffIconDisplayList; - public static List scopedWeaponList; - public static List highTestFishList; - public static List forceItemList; - public static List livingFireBlockList; - public static List amalgamBuffList; - public static List persistentBuffList; - public static List MagicGunIDs; - public static List BlacklistedWeaponsWithToolPower; - - // Some of these lists of enemies are unused, but were difficult to create. Many of these common enemy types have a ton of variants. - public static List zombieList; - public static List demonEyeList; - public static List skeletonList; - public static List angryBonesList; - public static List hornetList; - public static List mossHornetList; - public static List minibossList; - - public static List pierceResistList; - public static List pierceResistExceptionLeviAureusList; - public static List pierceResistExceptionList; - - public static List AstrumDeusIDs; - public static List DevourerOfGodsIDs; - public static List CosmicGuardianIDs; - public static List AquaticScourgeIDs; - public static List PerforatorIDs; - public static List DesertScourgeIDs; - public static List EaterofWorldsIDs; - public static List SlimeGodIDs; - public static List DeathModeSplittingWormIDs; - public static List DestroyerIDs; - public static List ThanatosIDs; - public static List AresIDs; - public static List SkeletronPrimeIDs; - public static List StormWeaverIDs; - public static List RavagerIDs; - public static List GolemIDs; - public static List BoundNPCIDs; - - public static List GrenadeResistIDs; - public static List ZeroContactDamageNPCList; - public static List HardmodeNPCNerfList; - - public static SortedDictionary BossRushHPChanges; - public static SortedDictionary BossValues; - public static SortedDictionary bossTypes; - - public static List legOverrideList; - - public static List kamiDebuffColorImmuneList; - - public static Dictionary EncryptedSchematicIDRelationship; - - public static List DisabledSummonerNerfItems; - public static List DisabledSummonerNerfMinions; - - 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() - { - "Vorbis", - "SoloMael", - "Chaotic Reks", - "The Buildmonger", - "YuH", - "Littlepiggy", - "LompL", - "Lilith", - "Ben Shapiro", - "Frederik", - "Faye", - "Gibb50", - "Braden", - "Hannes", - "profoundmango69", - "Jack", - "Hans Volter", - "Krankwagon", - "MishiroUsui", - "pixlgray", - "Arkhine", - "Lodude", - "DevAesthetic", - "Mister Winchester", - "Zacky", - "Veine", - "Javyz", - "Shifter", - "Crysthamyr", - "Elfinlocks", - "Ein", - "2Larry2", - "Jenonen", - "Dodu", - "Arti", - "Tervastator", - "Luis", - "Alexander", - "BakaQing", - "Taylor", - "Xaphlactus", - "MajinBagel", - "Bendy", - "Rando Calrissian", - "Tails the Fox 92", - "Bread", - "Minty Candy", - "Preston", - "MovingTarget_086", - "Shiro", - "Chip", - "Taylor", - "ShotgunAngel", - "Sandblast", - "ThomasThePencil", - "Aero (Aero#4599)", - "Shirosity", // used to be GlitchOut - "Daawnz", - "CrabBar", - "Yatagarasu", - "Jarod", - "Zombieh", - "MingWhy", - "Random Weeb", - "Afzofa", - "Eragon3942", - "TheBlackHand", - "william", - "Samuel", - "Christopher", - "DemoN K!ng", - "Malik", - "Ryan Baker-Ortiz", - "Aleksanders", - "TheSilverGhost", - "Lucazii", - "Shay", - "Prism", - "BobIsNotMyRealName", - "Guwahavel", - "Azura", - "Joshua", - "Doveda", - "William", - "Arche", - "DevilSunrise", - "Yanmei", - "Chaos", - "Ryan", - "Fish Repairs", - "Melvin", - "Vroomy Has -3,000 IQ", - "The Goliath", - "DaPyRo", - "Takeru", - "Circuit-Jay", - "Commmander Frostbite", - "cytokat", - "Cameron", - "Orudeon", - "BumbleDoge", - "Naglfar", - "Helixas", - "Vetus", - "High Charity", - "Devonte", - "Cerberus", - "Brendan", - "Victor", - "KAT-G307", - "Tombarry Expresserino", - "Drip Veezy", - "Glaid", - "Apotheosis", - "Bladesaber", - "Devon", - "Ruthoranium", - "cocodezi_", - "Mendzey", - "GameRDheAsianSandwich", - "Chigbungus", - "Streakist", - "Eisaya", - "Xenocrona", - "RKMoon", - "Eternal Silence", - "Jeff", - "Beta165", - "DanYami", - "Xenocrona", - "Ari", - "cosmickalamity", - "xd Ow0", - "Darren", - "Florian", - "dawn thunder", - "asdf935", - "GentSkeleton", - "Fizzlpoprock", - "Pigeon", - "Aleksh", - "Just a random guy", - "Dee", - "Æthereal", - "Broken Faucet", - "Sarcosuchus", - "Marissa443", - "Warlok", - "JackShizz", - "NebulaMagePlays", - "Primpy", - "Thys", - "Min", - "Wodernet", - "Pedro", - "Depressed Dad Gaming", - "Snowy", - "Stormone", - "Mobian", - "Rinja", - "Check pins", - "Dakota", - "Neoplasmatic", - "False", - "Whitegiraffe", - "Drakkece", - "Levi", - "Izuna", - "djsnj20", - "pyobbo", - "Alec", - "The Illustrious Sqouinchuousor", - "Moist Lad", - "TwanTheGOAT", - "3x1t_5tyl3", - "Will", - "SpookyNinja", - "Boomdiada", - "Culex", - "Rossadon", - "Ben", - "hubert thieblot", - "NepNep", - "Nanaki", - "CrimsonCrips", - "Lagohz", - "Timon", - "F00d Demon", - "Olkothan", - "Vmar98", - "Dasdruid", - "Cinder", - "Brutzli", - "Yhashtur", - "Zekai", - "Doug", - "Uberransy", - "KurlozClown", - "Nemesis 041", - "Asheel", - "Hayden", - "Lightedflare", - "Lady Shira", - "Devin", - "Qelrin", - "Thomas", - "Ne'er Dowell", - "Potion Man", - "martyrdomination", - "Destructoid", - "Coolguystorm YT", - "Wolfmaw", - "yiumik", - "Destiny Stallcup", - "GreenBerry", - "SolsticeUnlimitd", - "darkhawke", - "oracle", - "YumeiSenshi", - "Cameron", - "Toxin", - "Fweepachino", - "DESPACITO", - "Altzeus", - "Ryan", - "Spider region", - "WinterTire", - "Nycro", - "Vyster", // previously "Bewearium" - "William", - "HellGoat2", - "116taj", - "CaineSenpai", - "Suicide Dreams", - "Roxas", - "Obsoleek", - "Jetpat3", - "GreenTea", - "Woah", - "Ryaegos", - "Popsickle Yoshi", - "Arcadia", - "JensB__", - "Nuclei", - "Picasso's Bean", - "Corn M. Cobb", - "kgh8090", - "Luke", - "Barbara", - "Alexis", - "Soko", - "Albino gonkvader", - "Monic", - "Slim", - "ChaosChaos", - "Deallly", - "Jeff", - "vcf55", - "Kazurgundu", - "Jheybyrd", - "Kipluck", - "SCONICBOOM", - "Mr.Matter", - "Billy", - "jjth0m3", - "GTW High Cube", - "Sabrina", - "Potato - Stego", - "Perditio Astrum", - "MaxingOut", - "SharZz", - "Allegro", - "hoosfire", - "Lauren", - "Ultra Succ", - "Ethan", - "Pacnysam", - "dummyAzure", - "Jaykob", - "Goblin", - "NoOneElse", - "Nicholas", - "Toasty", - "oli saer", - "Blobby6799", - "Domrinth", - "zombieseatflesh7", - "Shiny", - "Whale", - "The Infinity", - "MrCreamen", - "TemperedAether", - "LucasTwocas", - "JustLonelyPi", - "Brian", - "Ashton", - "Rolandark", - "Ally2Cute", - "Dionysos", - "Plant Waifu", - "fire", - "Charles", - "Kaden", - "Dr. Pawsworth", - "Jackson", - "Freakish", - "Ashamper", - "Kinzoku", - "Elementari", - "The Wolf Commando", - "Jordan", - "Jessire", - "Ashton", - "callisto", - "velneu", - "Mathuantie", - "Robert", - "Matias", - "T E R M I N A T O R", - "apotofkoolaid", - "Matthew", - "Terrarian Dragon", - "Pomelo", - "Thomas", - "Iconic Parker Gaming", - "Jaydon", - "Aidan", - "Avery", - "yayoi", - "Splotchycrib", - "GIGA MAN", - "Eric", - "Merubel", - "Smug", - "Lime-Wars l 1", - "WillyDilly", - "xAqult", - "Himakaze", - "Face", - "Carboniferous", - "James", - "Taitou1", - "Yumi", - "NEBULA", - "Blackbluue", - "Alex", - "Ruben", - "Rixu", - "Antonie", - "Zerimore", - "Oblivionisbruh", - "Loser", - "Patrick", - "Magic Love", - "gluten tag", - "RetroRed", - "Katherine", - "SoyScoutSmasher", - "Jersey", - "Reiter splash", - "Conner", - "Ekun", - "Driser", - "bikmin", - "MittoMan", - "Pyromaniac146", - "Eddie Spaghetti", - "Colin", - "ZyferDex_", - "LumiEvi", - "Anish", - "MissMudflaps", - "Valkyrie", - "anglerraptor", - "Scribbles", - "Pneuma", - "OrrangProto", - "Tomat (Stevie)", - "That Katsafaros", - "PsychoGrizzly", - "Dayne", - "Hargestar", - "The Pyro", - "Lucas", - "Superbeepig", - "Larry That Barry", - "Monti", - "StarryFox", - "Kevin", - "Poopifier Poopifly", - "Lacuna", - "Nathan", - "Handburger", - "XusTingo9", - "Underlost", - "julius", - "Mark", - "Habb", - "Reanamet", - "Empress Vega", - "Team", - "GP", - "Xsiana", - "NyanLegacy215", - "ethan", - "Trinity Series", - "M001NG", - "WrathOfOlympus", - "dennis", - "Darkweb", - "Chaozhi", - "Mars", - "Elijah", - "Tezguin", - "Shpee", - "Archie", - "Meow", - "CosmicStarIight", - "Alfragiste", - "Number1piratepan", - "Noah", - "Max Kim", - "Anton", - "edm vibes", - "Hunter", - "Doodled_lynx", - "3en", - "Kiyotu", - "Aero", - "Iguy", - "병현 송", - "Tyler", - "Leonidas", - "GregTheSpinarak", - "Cheddar", - "Alex N", - "Magicoal", - "Seanツ", - "Ariscottle", - "Kevin", - "OnTheAirPogs", - "Zerafir", - "Bill", - "Starmitzy", - "FaeLoPondering", - "Brian", - "Smart2004", - "sherk", - "Squishy", - "Ash", - "rawpie2", - "Hokojin", - "sk", - "Done", - "MeanieG", - "Sanctuary", - "Landon", - "Moonicento", - "Hayden", - "Steven", - "Hana", - "Mikabul", - "Nathaniel", - "Brutus", - "EdelVollMilch", - "garfu", - "NuT NiTe", - "adain", - "Dylan", - "Lucas", - "Arthur", - "sweatingdishes", - "pomp neigh", - "Proffesor prostate", - "Saladify", - "26-4-1", - "VeryMasterNinja", - "Vorbis", - "Nyapano", - "Shadoku", - "allosar", - "jes", - "Paltham", - "Fartein", - "Derdjin", - "A_Normal_Person", - "Duck Satan", - "Jalapeno9", - "Grylken", - "Nexus", - "KJ", - "Goober", - "ChAoS DiScOrD", - "Mayhem", - "Zombified _G", - "Madd Cat", - "Natalie", - "Solaire", - "Dakota C", - "The Davester", - "Jose", - "Him", - "Umberto", - "Lance", - "Navigator", - "Ferret4T", - "Rooki", - "LvL-94", - "Feels Fishy", - "Korb Orb", - "Calcium Comrade", - "Talmadge", - "ddoogg88 tdog", - "CasualNoLifer", - "Bossy Punch", - "Creamy", - "Tyler", - "topnormal", - "Gilded Gryphon", - "Nightskyflyer", - "Schlarfblrfsch", - "MrNobody", - "Aden C.N.", - "zombie wolf", - "n0tacat", - "Marko", - "dexxer65", - "DeLordeyeee", - "Kaledoulas", - "Mohammad", - "Skeli_G", - "Arcxus", - "Sigil", - "Dull", - "DjackV", - "Misinput", - "Gameology", - "KugelBlitz", - "TheGreatSako", - "Joep", - "Rottingwood", - "anything5000", - "Gretchen", - "Spirit Shield", - "Briny_Coffee", - "_Skeggy_", - "just akkolite", - "J.U.N.E.S", - "Bruggs", - "Vimek Xol", - "Oceanman232", - "Sadouken", - "srxe", - "ProfessorWinston", - "OctolingGrimm", - "Cole", - "Markie", - "Met Vox", - "Tweee", - "Kaimonick", - "Chow Chow", - "drenmus!", - "Nitronium Productions", - "Goomfrontlut", - "Akkolite", - "Shaun", - "Bruh.PNG", - "James", - "Lord_Lucerne", - "Ulmod", - "Adamko", - "Gamma Freya", - "Finnrua", - "Maskedmilo", - "RockRecker39", - "Konorango", - "Indeciiissive", - "Curtis", - "Ponynator", - "Crippling-Ambition", - "TitaniumLlama", - "OriginForme487", - "FishBread", - "Real mystlc", - "Levi", - "jc.", - "Medi", - "Jakob", - "Borb9834", - "Georgios", - "KeL", - "Cody", - "Cristian(Mihaii)", - "Marco", - "RuskieThe3rd", - "BreachNClear747", - "happy thoughts", - "Azure", - "theHoopty", - "porglesupreme", - "XDkilljoy65XX", - "Mr. Bones", - "dawnboi", - "Joe", - "Sailor Jolt", - "SomeRando", - "Nuclear Chaos", - "Jankle", - "The Roborex", - "everquartz", - "discokittie", - "IsaacInsomnia", - "xElectrix_", - "Forge", - "MiyoshiEira", - "thebettercat", - "Darthlego", - "Azzilan", - "Griffin", - "LucasHM", - "ChrigTopher", - "Colin V", - "Scrumlet", - "Darkus", - "Homunculus Derelictus", - "Professor Pissington", - "Buppercups - Roblox", - "Pusheen_", - "Patrera" - }; - - projectileDestroyExceptionList = new List() - { - //holdout projectiles - ProjectileID.Phantasm, - ProjectileID.VortexBeater, - ProjectileID.DD2PhoenixBow, - ProjectileID.LastPrism, - ProjectileID.LastPrismLaser, - ProjectileID.LaserMachinegun, - ProjectileID.ChargedBlasterCannon, - ProjectileID.MedusaHead, - - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - - ProjectileType(), - ProjectileType(), - - // Some hostile boss projectiles - ProjectileID.SaucerDeathray, - ProjectileID.PhantasmalDeathray, - - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType() - }; - - enemyImmunityList = new List() - { - NPCID.KingSlime, - NPCType(), - NPCType(), - NPCType(), - NPCID.EyeofCthulhu, - NPCType(), - NPCID.EaterofWorldsHead, - NPCID.EaterofWorldsBody, - NPCID.EaterofWorldsTail, - NPCID.BrainofCthulhu, - NPCID.Creeper, - NPCID.QueenBee, - NPCID.Deerclops, - NPCID.SkeletronHead, - NPCID.SkeletronHand, - NPCID.WallofFlesh, - NPCID.WallofFleshEye, - NPCID.PirateShipCannon, - NPCID.QueenSlimeBoss, - NPCID.Probe, - NPCID.Retinazer, - NPCID.Spazmatism, - NPCType(), - NPCID.SkeletronPrime, - NPCType(), - NPCID.PrimeCannon, - NPCID.PrimeSaw, - NPCID.PrimeLaser, - NPCID.PrimeVice, - NPCID.Plantera, - NPCID.PlanterasTentacle, - NPCType(), - NPCID.Everscream, - NPCID.SantaNK1, - NPCID.IceQueen, - NPCID.MourningWood, - NPCID.Pumpking, - NPCID.Mothron, - NPCID.Golem, - NPCID.GolemHead, - NPCID.GolemHeadFree, - NPCID.GolemFistRight, - NPCID.GolemFistLeft, - NPCID.MartianSaucerCore, - NPCID.MartianSaucerCannon, - NPCID.MartianSaucerTurret, - NPCID.DukeFishron, - NPCID.Sharkron, - NPCID.Sharkron2, - NPCID.HallowBoss, - NPCID.CultistBoss, - NPCID.CultistDragonHead, - NPCID.CultistDragonBody1, - NPCID.CultistDragonBody2, - NPCID.CultistDragonBody3, - NPCID.CultistDragonBody4, - NPCID.CultistDragonTail, - NPCID.AncientCultistSquidhead, - NPCID.MoonLordHead, - NPCID.MoonLordHand, - NPCID.MoonLordCore, - NPCID.MoonLordFreeEye, - NPCID.DD2WyvernT1, - NPCID.DD2WyvernT2, - NPCID.DD2WyvernT3, - NPCID.DD2DarkMageT1, - NPCID.DD2DarkMageT3, - NPCID.DD2SkeletonT1, - NPCID.DD2SkeletonT3, - NPCID.DD2WitherBeastT2, - NPCID.DD2WitherBeastT3, - NPCID.DD2DrakinT2, - NPCID.DD2DrakinT3, - NPCID.DD2KoboldWalkerT2, - NPCID.DD2KoboldWalkerT3, - NPCID.DD2KoboldFlyerT2, - NPCID.DD2KoboldFlyerT3, - NPCID.DD2OgreT2, - NPCID.DD2OgreT3, - NPCID.DD2Betsy, - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType() - }; - - confusionEnemyList = new List() - { - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType() - }; - - dungeonEnemyBuffList = new List() - { - NPCID.SkeletonSniper, - NPCID.TacticalSkeleton, - NPCID.SkeletonCommando, - NPCID.Paladin, - NPCID.GiantCursedSkull, - NPCID.BoneLee, - NPCID.DiabolistWhite, - NPCID.DiabolistRed, - NPCID.NecromancerArmored, - NPCID.Necromancer, - NPCID.RaggedCasterOpenCoat, - NPCID.RaggedCaster, - NPCID.HellArmoredBonesSword, - NPCID.HellArmoredBonesMace, - NPCID.HellArmoredBonesSpikeShield, - NPCID.HellArmoredBones, - NPCID.BlueArmoredBonesSword, - NPCID.BlueArmoredBonesNoPants, - NPCID.BlueArmoredBonesMace, - NPCID.BlueArmoredBones, - NPCID.RustyArmoredBonesSwordNoArmor, - NPCID.RustyArmoredBonesSword, - NPCID.RustyArmoredBonesFlail, - NPCID.RustyArmoredBonesAxe - }; - - dungeonProjectileBuffList = new List() - { - ProjectileID.PaladinsHammerHostile, - ProjectileID.ShadowBeamHostile, - ProjectileID.InfernoHostileBolt, - ProjectileID.InfernoHostileBlast, - ProjectileID.LostSoulHostile, - ProjectileID.SniperBullet, - ProjectileID.RocketSkeleton, - ProjectileID.BulletDeadeye, - ProjectileID.Shadowflames - }; - - bossHPScaleList = new List() - { - NPCID.EaterofWorldsHead, - NPCID.EaterofWorldsBody, - NPCID.EaterofWorldsTail, - NPCID.SkeletronHand, - NPCID.WallofFleshEye, - NPCID.TheDestroyerBody, - NPCID.TheDestroyerTail, - NPCID.PrimeCannon, - NPCID.PrimeLaser, - NPCID.PrimeVice, - NPCID.PrimeSaw, - NPCID.GolemHead, - NPCID.GolemHeadFree, - NPCID.GolemFistRight, - NPCID.GolemFistLeft, - NPCID.Sharkron, - NPCID.Sharkron2, - NPCID.MoonLordHead, - NPCID.MoonLordHand, - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - }; - //Many more are added later with AddRange - - friendlyBeeList = new List() - { - ProjectileID.GiantBee, - ProjectileID.Bee, - ProjectileID.Wasp, - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType() - }; - - debuffList = new List() - { - BuffID.Poisoned, - BuffID.Darkness, - BuffID.Cursed, - BuffID.OnFire, - BuffID.Bleeding, - BuffID.Confused, - BuffID.Slow, - BuffID.Weak, - BuffID.Silenced, - BuffID.BrokenArmor, - BuffID.CursedInferno, - BuffID.Frostburn, - BuffID.Chilled, - BuffID.Frozen, - BuffID.Burning, - BuffID.Suffocation, - BuffID.Ichor, - BuffID.Venom, - BuffID.Blackout, - BuffID.Electrified, - BuffID.Rabies, - BuffID.Webbed, - BuffID.Stoned, - BuffID.Dazed, - BuffID.VortexDebuff, - BuffID.WitheredArmor, - BuffID.WitheredWeapon, - BuffID.OgreSpit, - BuffID.BetsysCurse, - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - // BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType() - }; - - fireDebuffList = new List() - { - BuffID.OnFire, - BuffID.OnFire3, // Hellfire - BuffID.Burning, // Touching meteorite ore or hellstone without obsidian skull - BuffID.CursedInferno, - BuffID.ShadowFlame, // Vanilla Shadowflame, can normally never be applied to players - BuffType(), // Calamity Shadowflame copy for players - BuffType(), // Crags lava - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), // Aflame enchant self damage - BuffType(), - }; - - sicknessDebuffList = new List() - { - BuffID.Poisoned, - BuffID.Venom, - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType() - }; - - alcoholList = new List() - { - BuffID.Tipsy, - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType() - }; - - spearAutoreuseList = new List() - { - ItemID.AdamantiteGlaive, - ItemID.ChlorophytePartisan, - ItemID.CobaltNaginata, - ItemID.DarkLance, - ItemID.MonkStaffT2, - ItemID.Gungnir, - ItemID.MushroomSpear, - ItemID.MythrilHalberd, - ItemID.NorthPole, - ItemID.ObsidianSwordfish, - ItemID.OrichalcumHalberd, - ItemID.PalladiumPike, - ItemID.Spear, - ItemID.Swordfish, - ItemID.TheRottedFork, - ItemID.TitaniumTrident, - ItemID.Trident, - ItemID.ThunderSpear - }; - - pumpkinMoonBuffList = new List() - { - NPCID.Scarecrow1, - NPCID.Scarecrow2, - NPCID.Scarecrow3, - NPCID.Scarecrow4, - NPCID.Scarecrow5, - NPCID.Scarecrow6, - NPCID.Scarecrow7, - NPCID.Scarecrow8, - NPCID.Scarecrow9, - NPCID.Scarecrow10, - NPCID.HeadlessHorseman, - NPCID.MourningWood, - NPCID.Splinterling, - NPCID.Pumpking, - NPCID.PumpkingBlade, - NPCID.Hellhound, - NPCID.Poltergeist - }; - - frostMoonBuffList = new List() - { - NPCID.ZombieElf, - NPCID.ZombieElfBeard, - NPCID.ZombieElfGirl, - NPCID.PresentMimic, - NPCID.GingerbreadMan, - NPCID.Yeti, - NPCID.Everscream, - NPCID.IceQueen, - NPCID.SantaNK1, - NPCID.ElfCopter, - NPCID.Nutcracker, - NPCID.NutcrackerSpinning, - NPCID.ElfArcher, - NPCID.Krampus, - NPCID.Flocko - }; - - eclipseBuffList = new List() - { - NPCID.Eyezor, - NPCID.Reaper, - NPCID.Frankenstein, - NPCID.SwampThing, - NPCID.Vampire, - NPCID.VampireBat, - NPCID.Butcher, - NPCID.CreatureFromTheDeep, - NPCID.Fritz, - NPCID.Nailhead, - NPCID.Psycho, - NPCID.DeadlySphere, - NPCID.DrManFly, - NPCID.ThePossessed, - NPCID.Mothron, - NPCID.MothronEgg, - NPCID.MothronSpawn - }; - - eventProjectileBuffList = new List() - { - ProjectileID.FlamingWood, - ProjectileID.GreekFire1, - ProjectileID.GreekFire2, - ProjectileID.GreekFire3, - ProjectileID.FlamingScythe, - ProjectileID.FlamingArrow, - ProjectileID.PineNeedleHostile, - ProjectileID.OrnamentHostile, - ProjectileID.OrnamentHostileShrapnel, - ProjectileID.FrostWave, - ProjectileID.FrostShard, - ProjectileID.Missile, - ProjectileID.Present, - ProjectileID.Spike, - ProjectileID.BulletDeadeye, - ProjectileID.EyeLaser, - ProjectileID.Nail, - ProjectileID.DrManFlyFlask - }; - - noRageWormSegmentList = new List() - { - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType() - }; - - needsDebuffIconDisplayList = new List() - { - NPCID.TargetDummy, - NPCID.WallofFleshEye, - NPCType() - }; - - // TODO -- override HoldItem => Player.accFishingLine = true; on these items, just like the scope fix... - highTestFishList = new List() - { - ItemID.GoldenFishingRod, - ItemType(), - ItemType() - }; - - forceItemList = new List() - { - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.HotlineFishingHook, - ItemID.BottomlessBucket, - ItemID.SuperAbsorbantSponge, - ItemID.FishingPotion, - ItemID.SonarPotion, - ItemID.CratePotion, - ItemID.AnglerTackleBag, - ItemID.HighTestFishingLine, - ItemID.TackleBox, - ItemID.AnglerEarring, - ItemID.FishermansGuide, - ItemID.WeatherRadio, - ItemID.Sextant, - ItemID.AnglerHat, - ItemID.AnglerVest, - ItemID.AnglerPants, - ItemID.GoldenBugNet, - ItemID.FishronWings, - ItemID.Flairon, - ItemID.Tsunami, - ItemID.BubbleGun, - ItemID.RazorbladeTyphoon, - ItemID.TempestStaff, - ItemID.FishronBossBag, - ItemID.Coral, - ItemID.Seashell, - ItemID.Starfish, - ItemID.SoulofSight, - ItemID.GreaterHealingPotion, - ItemID.SuperHealingPotion - }; - - livingFireBlockList = new List() - { - TileType(), - TileType(), - TileType(), - TileType(), - TileID.LivingFire, - TileID.LivingCursedFire, - TileID.LivingDemonFire, - TileID.LivingFrostFire, - TileID.LivingIchor, - TileID.LivingUltrabrightFire - }; - - amalgamBuffList = new List() - { - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffID.ObsidianSkin, - BuffID.Regeneration, - BuffID.Swiftness, - BuffID.Gills, - BuffID.Ironskin, - BuffID.ManaRegeneration, - BuffID.MagicPower, - BuffID.Featherfall, - BuffID.Spelunker, - BuffID.Invisibility, - BuffID.Shine, - BuffID.NightOwl, - BuffID.Battle, - BuffID.Thorns, - BuffID.WaterWalking, - BuffID.Archery, - BuffID.Hunter, - BuffID.Gravitation, - BuffID.Tipsy, - BuffID.WellFed, - BuffID.WellFed2, - BuffID.WellFed3, - BuffID.Honey, - BuffID.WeaponImbueVenom, - BuffID.WeaponImbueCursedFlames, - BuffID.WeaponImbueFire, - BuffID.WeaponImbueGold, - BuffID.WeaponImbueIchor, - BuffID.WeaponImbueNanites, - BuffID.WeaponImbueConfetti, - BuffID.WeaponImbuePoison, - BuffID.Lucky, - BuffID.Mining, - BuffID.Heartreach, - BuffID.Calm, - BuffID.Builder, - BuffID.Titan, - BuffID.Flipper, - BuffID.Summoning, - BuffID.Dangersense, - BuffID.AmmoReservation, - BuffID.Lifeforce, - BuffID.Endurance, - BuffID.Rage, - BuffID.Inferno, - BuffID.Wrath, - BuffID.Lovestruck, - BuffID.Stinky, - BuffID.Fishing, - BuffID.Sonar, - BuffID.Crate, - BuffID.Warmth, - BuffID.SugarRush - }; - - persistentBuffList = new List() - { - BuffType(), - BuffType(), - BuffType(), - BuffID.WeaponImbueVenom, - BuffID.WeaponImbueCursedFlames, - BuffID.WeaponImbueFire, - BuffID.WeaponImbueGold, - BuffID.WeaponImbueIchor, - BuffID.WeaponImbueNanites, - BuffID.WeaponImbueConfetti, - BuffID.WeaponImbuePoison - }; - - MagicGunIDs = new List() - { - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.BeeGun, - ItemID.BubbleGun, - ItemID.ChargedBlasterCannon, - ItemID.HeatRay, - ItemID.LaserMachinegun, - ItemID.LaserRifle, - ItemID.LeafBlower, - ItemID.RainbowGun, - ItemID.SpaceGun, - ItemID.WaspGun, - ItemID.ZapinatorGray, - ItemID.ZapinatorOrange - }; - - // This list intentionally does not contain Grax. - BlacklistedWeaponsWithToolPower = new List() - { - ItemID.ButchersChainsaw, - ItemID.LucyTheAxe, - ItemID.Rockfish, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType() - }; - - zombieList = new List() - { - NPCID.Zombie, - NPCID.ArmedZombie, - NPCID.BaldZombie, - NPCID.PincushionZombie, - NPCID.ArmedZombiePincussion, // what is this spelling - NPCID.SlimedZombie, - NPCID.ArmedZombieSlimed, - NPCID.SwampZombie, - NPCID.ArmedZombieSwamp, - NPCID.TwiggyZombie, - NPCID.ArmedZombieTwiggy, - NPCID.FemaleZombie, - NPCID.ArmedZombieCenx, - NPCID.ZombieRaincoat, - NPCID.ZombieEskimo, - NPCID.ArmedZombieEskimo, - NPCID.BigRainZombie, - NPCID.SmallRainZombie, - NPCID.BigFemaleZombie, - NPCID.SmallFemaleZombie, - NPCID.BigTwiggyZombie, - NPCID.SmallTwiggyZombie, - NPCID.BigSwampZombie, - NPCID.SmallSwampZombie, - NPCID.BigSlimedZombie, - NPCID.SmallSlimedZombie, - NPCID.BigPincushionZombie, - NPCID.SmallPincushionZombie, - NPCID.BigBaldZombie, - NPCID.SmallBaldZombie, - NPCID.BigZombie, - NPCID.SmallZombie, - NPCID.MaggotZombie, - NPCType() - // halloween zombies not included because they don't drop shackles or zombie arms - }; - - demonEyeList = new List() - { - NPCID.DemonEye, - NPCID.CataractEye, - NPCID.SleepyEye, - NPCID.DialatedEye, // it is spelled "dilated" - NPCID.GreenEye, - NPCID.PurpleEye, - NPCID.DemonEyeOwl, - NPCID.DemonEyeSpaceship, - NPCID.DemonEye2, - NPCID.PurpleEye2, - NPCID.GreenEye2, - NPCID.DialatedEye2, - NPCID.SleepyEye2, - NPCID.CataractEye2 - }; - - skeletonList = new List() - { - NPCID.Skeleton, - NPCID.HeadacheSkeleton, - NPCID.MisassembledSkeleton, - NPCID.PantlessSkeleton, - NPCID.BoneThrowingSkeleton, - NPCID.BoneThrowingSkeleton2, - NPCID.BoneThrowingSkeleton3, - NPCID.BoneThrowingSkeleton4, - NPCID.BigPantlessSkeleton, - NPCID.SmallPantlessSkeleton, - NPCID.BigMisassembledSkeleton, - NPCID.SmallMisassembledSkeleton, - NPCID.BigHeadacheSkeleton, - NPCID.SmallHeadacheSkeleton, - NPCID.BigSkeleton, - NPCID.SmallSkeleton, - - //Note: These skeletons don't count for Skeleton Banner for some god forsaken reason - NPCID.SkeletonTopHat, - NPCID.SkeletonAstonaut, - NPCID.SkeletonAlien, - - //Other skeleton types - NPCID.ArmoredSkeleton, - NPCID.HeavySkeleton, - NPCID.SkeletonArcher, - NPCID.GreekSkeleton, - NPCID.SporeSkeleton - }; - - angryBonesList = new List() - { - NPCID.AngryBones, - NPCID.AngryBonesBig, - NPCID.AngryBonesBigMuscle, - NPCID.AngryBonesBigHelmet, - NPCID.BigBoned, - NPCID.ShortBones - }; - - hornetList = new List() - { - NPCID.BigHornetStingy, - NPCID.LittleHornetStingy, - NPCID.BigHornetSpikey, - NPCID.LittleHornetSpikey, - NPCID.BigHornetLeafy, - NPCID.LittleHornetLeafy, - NPCID.BigHornetHoney, - NPCID.LittleHornetHoney, - NPCID.BigHornetFatty, - NPCID.LittleHornetFatty, - NPCID.BigStinger, - NPCID.LittleStinger, - NPCID.Hornet, - NPCID.HornetFatty, - NPCID.HornetHoney, - NPCID.HornetLeafy, - NPCID.HornetSpikey, - NPCID.HornetStingy - }; - - mossHornetList = new List() - { - NPCID.MossHornet, - NPCID.TinyMossHornet, - NPCID.LittleMossHornet, - NPCID.BigMossHornet, - NPCID.GiantMossHornet - }; - - minibossList = new List() - { - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCID.Pumpking, - NPCID.MourningWood, - NPCID.IceQueen, - NPCID.SantaNK1, - NPCID.Everscream, - NPCID.DD2Betsy, - NPCID.Mothron, - NPCID.MartianSaucer, - NPCID.MartianSaucerCannon, - NPCID.MartianSaucerCore, - NPCID.MartianSaucerTurret, - }; - - pierceResistList = new List() - { - NPCID.EaterofWorldsHead, - NPCID.EaterofWorldsBody, - NPCID.EaterofWorldsTail, - NPCID.Creeper, - NPCID.TheDestroyer, - NPCID.TheDestroyerBody, - NPCID.TheDestroyerTail, - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType() - }; - - pierceResistExceptionLeviAureusList = new List() - { - ProjectileID.NettleBurstEnd, - ProjectileID.NettleBurstLeft, - ProjectileID.NettleBurstRight, - ProjectileID.PrincessWeapon, - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType() - }; - - pierceResistExceptionList = new List() - { - ProjectileID.Arkhalis, - ProjectileID.ChargedBlasterLaser, - ProjectileID.ClingerStaff, - ProjectileID.FinalFractal, - ProjectileID.FlyingKnife, - ProjectileID.LastPrismLaser, - ProjectileID.MechanicalPiranha, - ProjectileID.MonkStaffT3, - ProjectileID.PiercingStarlight, - ProjectileID.Terragrim, - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - }; - - // Lists of enemies that resist piercing to some extent (mostly worms). - // Could prove useful for other things as well. - - AstrumDeusIDs = new List - { - NPCType(), - NPCType(), - NPCType() - }; - - DevourerOfGodsIDs = new List - { - NPCType(), - NPCType(), - NPCType() - }; - - CosmicGuardianIDs = new List - { - NPCType(), - NPCType(), - NPCType() - }; - - AquaticScourgeIDs = new List - { - NPCType(), - NPCType(), - NPCType(), - NPCType() - }; - - PerforatorIDs = new List - { - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType() - }; - bossHPScaleList.AddRange(PerforatorIDs); - - DesertScourgeIDs = new List - { - NPCType(), - NPCType(), - NPCType() - }; - - EaterofWorldsIDs = new List - { - NPCID.EaterofWorldsHead, - NPCID.EaterofWorldsBody, - NPCID.EaterofWorldsTail - }; - - SlimeGodIDs = new List - { - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType() - }; - bossHPScaleList.AddRange(SlimeGodIDs); - - DeathModeSplittingWormIDs = new List - { - NPCID.DuneSplicerHead, - NPCID.DuneSplicerBody, - NPCID.DuneSplicerTail, - NPCID.DiggerHead, - NPCID.DiggerBody, - NPCID.DiggerTail, - NPCID.SeekerHead, - NPCID.SeekerBody, - NPCID.SeekerTail - }; - - DestroyerIDs = new List - { - NPCID.TheDestroyer, - NPCID.TheDestroyerBody, - NPCID.TheDestroyerTail - }; - - ThanatosIDs = new List - { - NPCType(), - NPCType(), - NPCType(), - NPCType() - }; - - AresIDs = new List - { - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType() - }; - - SkeletronPrimeIDs = new List - { - NPCID.SkeletronPrime, - NPCType(), - NPCID.PrimeCannon, - NPCID.PrimeLaser, - NPCID.PrimeSaw, - NPCID.PrimeVice - }; - - StormWeaverIDs = new List - { - NPCType(), - NPCType(), - NPCType() - }; - - // Purposefully does not include the freed head - RavagerIDs = new List - { - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType() - }; - bossHPScaleList.AddRange(RavagerIDs); - - GolemIDs = new List - { - NPCID.Golem, - NPCID.GolemHead, - NPCID.GolemHeadFree, - NPCID.GolemFistLeft, - NPCID.GolemFistRight - }; - - GrenadeResistIDs = new List - { - ProjectileID.Grenade, - ProjectileID.StickyGrenade, - ProjectileID.BouncyGrenade, - ProjectileID.Bomb, - ProjectileID.StickyBomb, - ProjectileID.BouncyBomb, - ProjectileID.Dynamite, - ProjectileID.StickyDynamite, - ProjectileID.BouncyDynamite, - ProjectileID.Explosives, - ProjectileID.ExplosiveBunny, - ProjectileID.PartyGirlGrenade, - ProjectileID.BombFish, - ProjectileID.Beenade, - ProjectileID.Bee, - ProjectileID.GiantBee, - ProjectileType(), - ProjectileID.ScarabBomb, - ProjectileID.TNTBarrel - }; - - ZeroContactDamageNPCList = new List - { - NPCID.Harpy, - NPCID.Salamander, - NPCID.Salamander2, - NPCID.Salamander3, - NPCID.Salamander4, - NPCID.Salamander5, - NPCID.Salamander6, - NPCID.Salamander7, - NPCID.Salamander8, - NPCID.Salamander9, - NPCID.GiantCursedSkull, - NPCID.FungiBulb, - NPCID.GiantFungiBulb, - NPCID.IcyMerman, - NPCID.AngryNimbus, - NPCID.SandElemental, - NPCID.DarkCaster, - NPCID.FireImp, - NPCID.Tim, - NPCID.CultistArcherBlue, - NPCID.DesertDjinn, - NPCID.DiabolistRed, - NPCID.DiabolistWhite, - NPCID.Gastropod, - NPCID.IceElemental, - NPCID.IchorSticker, - NPCID.Necromancer, - NPCID.NecromancerArmored, - NPCID.RaggedCaster, - NPCID.RaggedCasterOpenCoat, - NPCID.RuneWizard, - NPCID.SkeletonArcher, - NPCID.SkeletonCommando, - NPCID.SkeletonSniper, - NPCID.TacticalSkeleton, - NPCID.Clown, - NPCID.GoblinArcher, - NPCID.GoblinSorcerer, - NPCID.GoblinSummoner, - NPCID.PirateCrossbower, - NPCID.PirateDeadeye, - NPCID.PirateCaptain, - NPCID.SnowmanGangsta, - NPCID.SnowBalla, - NPCID.DrManFly, - NPCID.Eyezor, - NPCID.Nailhead, - NPCID.BrainScrambler, - NPCID.GigaZapper, - NPCID.RayGunner, - NPCID.ScutlixRider, - NPCID.MartianWalker, - NPCID.MartianTurret, - NPCID.ElfCopter, - NPCID.ElfArcher, - NPCID.NebulaBrain, - NPCID.NebulaSoldier, - NPCID.StardustCellSmall, - NPCID.StardustJellyfishBig, - NPCID.StardustSoldier, - NPCID.StardustSpiderBig, - NPCID.VortexHornetQueen, - NPCID.VortexRifleman, - NPCID.VortexSoldier, - NPCID.PirateShipCannon, - NPCID.MartianSaucer, - NPCID.MartianSaucerCannon, - NPCID.MartianSaucerCore, - NPCID.MartianSaucerTurret, - NPCID.Probe, - NPCID.CultistBoss, - NPCID.GolemHead, - NPCID.GolemHeadFree, - NPCID.MoonLordFreeEye, - NPCID.BloodSquid, - NPCID.PlanterasHook, - NPCID.Dandelion, - NPCID.DD2DarkMageT1, - NPCID.DD2DarkMageT3, - NPCID.DD2OgreT2, - NPCID.DD2OgreT3, - NPCID.DD2GoblinBomberT1, - NPCID.DD2GoblinBomberT2, - NPCID.DD2GoblinBomberT3, - NPCID.DD2JavelinstT1, - NPCID.DD2JavelinstT2, - NPCID.DD2JavelinstT3, - NPCID.DD2KoboldWalkerT2, - NPCID.DD2KoboldWalkerT3, - NPCID.DD2DrakinT2, - NPCID.DD2DrakinT3, - NPCID.DD2KoboldFlyerT2, - NPCID.DD2KoboldFlyerT3, - NPCID.DD2WitherBeastT2, - NPCID.DD2WitherBeastT3, - NPCID.DD2LightningBugT3, - NPCID.MourningWood, - NPCID.Pumpking, - NPCID.Everscream, - NPCID.IceQueen, - NPCID.SantaNK1, - NPCID.DevourerBody, - NPCID.DevourerTail, - NPCID.DiggerBody, - NPCID.DiggerTail, - NPCID.TombCrawlerBody, - NPCID.TombCrawlerTail, - NPCID.DuneSplicerBody, - NPCID.DuneSplicerTail, - NPCID.GiantWormBody, - NPCID.GiantWormTail, - NPCID.LeechBody, - NPCID.LeechTail, - NPCID.StardustWormBody, - NPCID.StardustWormTail, - NPCID.SeekerBody, - NPCID.SeekerTail, - NPCID.BoneSerpentBody, - NPCID.BoneSerpentTail, - NPCID.WyvernBody, - NPCID.WyvernTail, - NPCID.WyvernBody2, - NPCID.WyvernBody3, - NPCID.WyvernLegs, - NPCID.CultistDragonBody1, - NPCID.CultistDragonBody2, - NPCID.CultistDragonBody3, - NPCID.CultistDragonBody4, - NPCID.CultistDragonTail, - NPCID.BloodEelBody, - NPCID.BloodEelTail, - NPCID.AncientDoom - }; - - // Reduce contact damage by 25% - HardmodeNPCNerfList = new List - { - NPCID.AnglerFish, - NPCID.AngryTrapper, - NPCID.Arapaima, - NPCID.BlackRecluse, - NPCID.BlackRecluseWall, - NPCID.BloodJelly, - NPCID.FungoFish, - NPCID.GreenJellyfish, - NPCID.Clinger, - NPCID.ArmoredSkeleton, - NPCID.ArmoredViking, - NPCID.Mummy, - NPCID.DarkMummy, - NPCID.LightMummy, - NPCID.BloodFeeder, - NPCID.DesertBeast, - NPCID.ChaosElemental, - NPCID.BloodMummy, - NPCID.CorruptSlime, - NPCID.Slimeling, - NPCID.Corruptor, - NPCID.Crimslime, - NPCID.BigCrimslime, - NPCID.LittleCrimslime, - NPCID.CrimsonAxe, - NPCID.CursedHammer, - NPCID.Derpling, - NPCID.Herpling, - NPCID.DiggerHead, - NPCID.DesertGhoul, - NPCID.DesertGhoulCorruption, - NPCID.DesertGhoulCrimson, - NPCID.DesertGhoulHallow, - NPCID.DuneSplicerHead, - NPCID.EnchantedSword, - NPCID.FloatyGross, - NPCID.GiantBat, - NPCID.GiantFlyingFox, - NPCID.FungiSpore, - NPCID.GiantTortoise, - NPCID.IceTortoise, - NPCID.HoppinJack, - NPCID.Mimic, - NPCID.IlluminantBat, - NPCID.IlluminantSlime, - NPCID.JungleCreeper, - NPCID.JungleCreeperWall, - NPCID.DesertLamiaDark, - NPCID.DesertLamiaLight, - NPCID.BigMossHornet, - NPCID.GiantMossHornet, - NPCID.LittleMossHornet, - NPCID.MossHornet, - NPCID.TinyMossHornet, - NPCID.Moth, - NPCID.PigronCorruption, - NPCID.PigronCrimson, - NPCID.PigronHallow, - NPCID.Pixie, - NPCID.PossessedArmor, - NPCID.RockGolem, - NPCID.DesertScorpionWalk, - NPCID.DesertScorpionWall, - NPCID.Slimer, - NPCID.Slimer2, - NPCID.ToxicSludge, - NPCID.Unicorn, - NPCID.WanderingEye, - NPCID.Werewolf, - NPCID.Wolf, - NPCID.SeekerHead, - NPCID.Wraith, - NPCID.ChatteringTeethBomb, - NPCID.IceGolem, - NPCID.RainbowSlime, - NPCID.SandShark, - NPCID.SandsharkCorrupt, - NPCID.SandsharkCrimson, - NPCID.SandsharkHallow, - NPCID.ShadowFlameApparition, - NPCID.Parrot, - NPCID.PirateCorsair, - NPCID.PirateDeckhand, - NPCID.PirateGhost, - NPCID.BlueArmoredBonesMace, - NPCID.BlueArmoredBonesSword, - NPCID.BoneLee, - NPCID.DungeonSpirit, - NPCID.FlyingSnake, - NPCID.HellArmoredBones, - NPCID.HellArmoredBonesSpikeShield, - NPCID.HellArmoredBonesSword, - NPCID.MisterStabby, - NPCID.Butcher, - NPCID.CreatureFromTheDeep, - NPCID.DeadlySphere, - NPCID.Frankenstein, - NPCID.Fritz, - NPCID.Psycho, - NPCID.Reaper, - NPCID.SwampThing, - NPCID.ThePossessed, - NPCID.Vampire, - NPCID.VampireBat, - NPCID.HeadlessHorseman, - NPCID.Hellhound, - NPCID.Poltergeist, - NPCID.Scarecrow1, - NPCID.Scarecrow2, - NPCID.Scarecrow3, - NPCID.Scarecrow4, - NPCID.Scarecrow5, - NPCID.Scarecrow6, - NPCID.Scarecrow7, - NPCID.Scarecrow8, - NPCID.Scarecrow9, - NPCID.Scarecrow10, - NPCID.Splinterling, - NPCID.Flocko, - NPCID.GingerbreadMan, - NPCID.Krampus, - NPCID.Nutcracker, - NPCID.NutcrackerSpinning, - NPCID.PresentMimic, - NPCID.Yeti, - NPCID.ZombieElf, - NPCID.ZombieElfBeard, - NPCID.ZombieElfGirl, - NPCID.BloodEelHead, - NPCID.GoblinShark, - NPCID.EyeballFlyingFish, - NPCID.ZombieMerman - }; - - BoundNPCIDs = new List - { - NPCID.BoundGoblin, - NPCID.BoundWizard, - NPCID.BoundMechanic, - NPCID.SleepingAngler, - NPCID.BartenderUnconscious, - NPCID.WebbedStylist, - NPCID.GolferRescue - }; - - // Collections - BossRushHPChanges = new SortedDictionary - { - // Tier 1 - { NPCID.KingSlime, 300000 }, // 30 seconds - { NPCID.BlueSlime, 3600 }, - { NPCID.SlimeSpiked, 7200 }, - { NPCID.GreenSlime, 2700 }, - { NPCID.RedSlime, 5400 }, - { NPCID.PurpleSlime, 7200 }, - { NPCID.YellowSlime, 6300 }, - { NPCID.IceSlime, 4500 }, - { NPCID.UmbrellaSlime, 5400 }, - { NPCID.RainbowSlime, 30000 }, - { NPCID.Pinky, 15000 }, - { NPCType(), 21000 }, - { NPCType(), 18000 }, - { NPCType(), 24000 }, - - { NPCID.EyeofCthulhu, 450000 }, // 30 seconds - { NPCID.ServantofCthulhu, 6000 }, - { NPCType(), 12000 }, - - { NPCID.EaterofWorldsHead, 10000 }, // 30 seconds + immunity timer at start - { NPCID.EaterofWorldsBody, 10000 }, - { NPCID.EaterofWorldsTail, 10000 }, - - { NPCID.BrainofCthulhu, 100000 }, // 30 seconds with creepers - { NPCID.Creeper, 10000 }, - - { NPCID.QueenBee, 315000 }, // 30 seconds - { NPCID.Bee, 3000 }, - { NPCID.BeeSmall, 2000 }, - { NPCID.BigHornetHoney, 10000 }, - { NPCID.HornetHoney, 7500 }, - { NPCID.LittleHornetHoney, 5000 }, - - { NPCID.Deerclops, 315000 }, // 30 seconds - - { NPCID.SkeletronHead, 150000 }, // 30 seconds - { NPCID.SkeletronHand, 60000 }, - - { NPCID.WallofFlesh, 450000 }, // 30 seconds - { NPCID.WallofFleshEye, 450000 }, - { NPCID.TheHungry, 10000 }, - { NPCID.TheHungryII, 5000 }, - { NPCID.LeechHead, 5000 }, - { NPCID.LeechBody, 5000 }, - { NPCID.LeechTail, 5000 }, - - // Tier 2 - { NPCID.QueenSlimeBoss, 200000 }, // 30 seconds - { NPCID.QueenSlimeMinionBlue, 6000 }, - { NPCID.QueenSlimeMinionPink, 6000 }, - { NPCID.QueenSlimeMinionPurple, 5000 }, - - { NPCID.Spazmatism, 150000 }, // 30 seconds - { NPCID.Retinazer, 125000 }, - { NPCType(), 137500 }, - - { NPCID.TheDestroyer, 250000 }, // 30 seconds + immunity timer at start - { NPCID.TheDestroyerBody, 250000 }, - { NPCID.TheDestroyerTail, 250000 }, - { NPCID.Probe, 5000 }, - - { NPCID.SkeletronPrime, 160000 }, // 30 seconds - { NPCType(), 160000 }, - { NPCID.PrimeVice, 54000 }, - { NPCID.PrimeCannon, 45000 }, - { NPCID.PrimeSaw, 45000 }, - { NPCID.PrimeLaser, 38000 }, - - { NPCID.Plantera, 160000 }, // 30 seconds - { NPCID.PlanterasTentacle, 5000 }, - { NPCType(), 5000 }, - - // Tier 3 - { NPCID.Golem, 50000 }, // 30 seconds - { NPCID.GolemHead, 30000 }, - { NPCID.GolemHeadFree, 30000 }, - { NPCID.GolemFistLeft, 25000 }, - { NPCID.GolemFistRight, 25000 }, - - { NPCID.HallowBoss, 200000 }, // 30 seconds - - { NPCID.DukeFishron, 290000 }, // 30 seconds - - { NPCID.CultistBoss, 220000 }, // 30 seconds - { NPCID.CultistDragonHead, 60000 }, - { NPCID.CultistDragonBody1, 60000 }, - { NPCID.CultistDragonBody2, 60000 }, - { NPCID.CultistDragonBody3, 60000 }, - { NPCID.CultistDragonBody4, 60000 }, - { NPCID.CultistDragonTail, 60000 }, - { NPCID.AncientCultistSquidhead, 50000 }, - - { NPCID.MoonLordCore, 160000 }, // 1 minute - { NPCID.MoonLordHand, 45000 }, - { NPCID.MoonLordHead, 60000 }, - { NPCID.MoonLordLeechBlob, 800 } - - // 9.5 minutes in total for vanilla Boss Rush bosses - }; - - // NOTE: This does not account for Calamity's base value increases - BossValues = new SortedDictionary - { - { NPCID.KingSlime, Item.buyPrice(0, 2) }, - { NPCID.EyeofCthulhu, Item.buyPrice(0, 2) }, - // Evil bosses drop 5 gold in vanilla; unmodified - { NPCID.QueenBee, Item.buyPrice(0, 8) }, - { NPCID.Deerclops, Item.buyPrice(0, 8) }, - { NPCID.SkeletronHead, Item.buyPrice(0, 12) }, - { NPCID.WallofFlesh, Item.buyPrice(0, 12) }, - { NPCID.QueenSlimeBoss, Item.buyPrice(0, 16) }, - { NPCID.Spazmatism, Item.buyPrice(0, 16) }, - { NPCID.Retinazer, Item.buyPrice(0, 16) }, - { NPCID.TheDestroyer, Item.buyPrice(0, 16) }, - { NPCID.SkeletronPrime, Item.buyPrice(0, 16) }, - { NPCID.Plantera, Item.buyPrice(0, 20) }, - { NPCID.Golem, Item.buyPrice(0, 25) }, - { NPCID.HallowBoss, Item.buyPrice(0, 30) }, - { NPCID.DukeFishron, Item.buyPrice(0, 30) }, - { NPCID.CultistBoss, Item.buyPrice(0, 50) } - // Moon Lord drops 1 plat in vanilla; unmodified - }; - - bossTypes = new SortedDictionary() - { - { NPCID.KingSlime, 1 }, - { NPCType(), 2 }, - { NPCID.EyeofCthulhu, 3 }, - { NPCType(), 4 }, - { NPCID.EaterofWorldsHead, 5 }, - { NPCID.EaterofWorldsBody, 5 }, - { NPCID.EaterofWorldsTail, 5 }, - { NPCID.BrainofCthulhu, 6 }, - { NPCType(), 7 }, - { NPCType(), 8 }, - { NPCID.QueenBee, 9 }, - { NPCID.SkeletronHead, 10 }, - { NPCType(), 11 }, - { NPCType(), 11 }, - { NPCType(), 11 }, - { NPCID.WallofFlesh, 12 }, - { NPCType(), 13 }, - { NPCID.Retinazer, 14 }, - { NPCID.Spazmatism, 14 }, - { NPCType(), 15 }, - { NPCID.TheDestroyer, 16 }, - { NPCType(), 17 }, - { NPCID.SkeletronPrime, 18 }, - { NPCType(), 19 }, - { NPCID.Plantera, 20 }, - { NPCType(), 21 }, - { NPCType(), 21 }, - { NPCType(), 22 }, - { NPCID.Golem, 23 }, - { NPCType(), 24 }, - { NPCID.DukeFishron, 25 }, - { NPCType(), 26 }, - { NPCID.CultistBoss, 27 }, - { NPCType(), 28 }, - { NPCID.MoonLordCore, 29 }, - { NPCType(), 30 }, - { NPCType(), 31 }, - { NPCType(), 32 }, - { NPCType(), 33 }, - { NPCType(), 34 }, - { NPCType(), 35 }, - { NPCType(), 36 }, - { NPCType(), 37 }, - { NPCType(), 38 }, - { NPCType(), 39 }, - { NPCType(), 40 }, - { NPCType(), 41 }, - { NPCType(), 41 }, - { NPCType(), 41 }, - { NPCType(), 41 }, - { NPCID.QueenSlimeBoss, 42 }, - { NPCID.HallowBoss, 43 }, - { NPCID.Deerclops, 44 } - }; - - legOverrideList = new List() - { - EquipLoader.GetEquipSlot(CalamityMod.Instance, "ProfanedSoulCrystal", EquipType.Legs), - EquipLoader.GetEquipSlot(CalamityMod.Instance, "AquaticHeart", EquipType.Legs), - //CalamityMod.Instance.GetEquipSlot("SirenLeg", EquipType.Legs), whate even was SirenLeg vs SirenLegAlt? - EquipLoader.GetEquipSlot(CalamityMod.Instance, "Popo", EquipType.Legs) - }; - - // Duke Fishron and Old Duke phase 3 becomes way too easy if you can make him stop being invisible with Yanmei's Knife. - // This is a list so that other NPCs can be added as necessary. - // IT DOES NOT make them immune to the debuff, just stops them from being recolored. - kamiDebuffColorImmuneList = new List() - { - NPCID.DukeFishron, - NPCType() - }; - - EncryptedSchematicIDRelationship = new Dictionary() - { - [1] = ItemType(), - [2] = ItemType(), - [3] = ItemType(), - [4] = ItemType(), - }; - - DisabledSummonerNerfItems = new(); - DisabledSummonerNerfMinions = new(); - - VeneratedLocketBanlist = new List() - { - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - 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() - { - donatorList = null; - projectileDestroyExceptionList = null; - enemyImmunityList = null; - confusionEnemyList = null; - dungeonEnemyBuffList = null; - dungeonProjectileBuffList = null; - bossHPScaleList = null; - friendlyBeeList = null; - debuffList = null; - fireDebuffList = null; - sicknessDebuffList = null; - alcoholList = null; - spearAutoreuseList = null; - pumpkinMoonBuffList = null; - frostMoonBuffList = null; - eclipseBuffList = null; - eventProjectileBuffList = null; - noRageWormSegmentList = null; - needsDebuffIconDisplayList = null; - scopedWeaponList = null; - highTestFishList = null; - forceItemList = null; - livingFireBlockList = null; - amalgamBuffList = null; - persistentBuffList = null; - MagicGunIDs = null; - BlacklistedWeaponsWithToolPower = null; - - zombieList = null; - demonEyeList = null; - skeletonList = null; - angryBonesList = null; - hornetList = null; - mossHornetList = null; - minibossList = null; - pierceResistList = null; - pierceResistExceptionLeviAureusList = null; - pierceResistExceptionList = null; - - AstrumDeusIDs = null; - DevourerOfGodsIDs = null; - CosmicGuardianIDs = null; - AquaticScourgeIDs = null; - PerforatorIDs = null; - DesertScourgeIDs = null; - EaterofWorldsIDs = null; - SlimeGodIDs = null; - DeathModeSplittingWormIDs = null; - DestroyerIDs = null; - ThanatosIDs = null; - AresIDs = null; - SkeletronPrimeIDs = null; - StormWeaverIDs = null; - RavagerIDs = null; - GolemIDs = null; - BoundNPCIDs = null; - GrenadeResistIDs = null; - ZeroContactDamageNPCList = null; - HardmodeNPCNerfList = null; - - BossRushHPChanges?.Clear(); - BossRushHPChanges = null; - BossValues?.Clear(); - BossValues = null; - bossTypes?.Clear(); - bossTypes = null; - - legOverrideList = null; - - kamiDebuffColorImmuneList = null; - - EncryptedSchematicIDRelationship = null; - - DisabledSummonerNerfItems = null; - DisabledSummonerNerfMinions = null; - - VeneratedLocketBanlist = null; - - SunkenSeaBiomeCorrespondentValues = null; - } - } -} diff --git a/Enums/HardmodeCrateType.cs b/Enums/HardmodeCrateType.cs new file mode 100644 index 0000000000..6febfd2600 --- /dev/null +++ b/Enums/HardmodeCrateType.cs @@ -0,0 +1,9 @@ +namespace CalamityMod.Enums +{ + public enum HardmodeCrateType + { + Biome, + Mythril, + Titanium + } +} diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 6e50d291e0..21eb8c6b6b 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -1914,7 +1914,7 @@ namespace CalamityMod.ILEditing return; var glowMaskTile = GlowMaskTile.InstanceLookup[type]; - if (glowMaskTile is null) + if (glowMaskTile is null || !TileDrawing.IsVisible(drawData.tileCache)) return; var glowMask = glowMaskTile.GlowMask; diff --git a/Items/Accessories/AlluringBait.cs b/Items/Accessories/AlluringBait.cs index 1a5383e4b1..786435906e 100644 --- a/Items/Accessories/AlluringBait.cs +++ b/Items/Accessories/AlluringBait.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { player.Calamity().alluringBait = true; - player.fishingSkill += 30; + player.fishingSkill += 10; } } } diff --git a/Items/Accessories/RottenBrain.cs b/Items/Accessories/RottenBrain.cs index f83fe3c9fe..8f2dd3ad50 100644 --- a/Items/Accessories/RottenBrain.cs +++ b/Items/Accessories/RottenBrain.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.rBrain = true; - player.GetDamage() += 0.06f; + player.GetDamage() += 0.05f; } public override void AddRecipes() diff --git a/Items/Accessories/RustyMedallion.cs b/Items/Accessories/RustyMedallion.cs index 52d7328429..b7d0e8f3a1 100644 --- a/Items/Accessories/RustyMedallion.cs +++ b/Items/Accessories/RustyMedallion.cs @@ -1,6 +1,5 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; -using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -30,14 +29,5 @@ namespace CalamityMod.Items.Accessories modPlayer.RustyMedallionDroplets = true; player.buffImmune[ModContent.BuffType()] = true; } - - public override void AddRecipes() - { - CreateRecipe(). - AddRecipeGroup("AnySilverBar", 10). - AddIngredient(3). - AddTile(TileID.Anvils). - Register(); - } } } diff --git a/Items/Accessories/StatisNinjaBelt.cs b/Items/Accessories/StatisNinjaBelt.cs index 6039acb7ca..0758843f88 100644 --- a/Items/Accessories/StatisNinjaBelt.cs +++ b/Items/Accessories/StatisNinjaBelt.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.CalPlayer.Dashes; +using CalamityMod.Items.Materials; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -28,10 +29,10 @@ namespace CalamityMod.Items.Accessories { player.autoJump = true; player.jumpSpeedBoost += 1.6f; - player.extraFall += 35; + player.noFallDmg = true; player.blackBelt = true; - player.dashType = 1; - player.Calamity().DashID = string.Empty; + player.dashType = 0; + player.Calamity().DashID = StatisNinjaBeltDash.ID; player.spikedBoots = 2; player.accFlipper = true; } diff --git a/Items/Accessories/SupremeBaitTackleBoxFishingStation.cs b/Items/Accessories/SupremeBaitTackleBoxFishingStation.cs index bf385bc526..5c1034b6db 100644 --- a/Items/Accessories/SupremeBaitTackleBoxFishingStation.cs +++ b/Items/Accessories/SupremeBaitTackleBoxFishingStation.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.fishingSkill += 80; + player.fishingSkill += 50; player.accFishingLine = true; player.accTackleBox = true; player.accLavaFishing = true; diff --git a/Items/Accessories/Vanity/TheComb.cs b/Items/Accessories/Vanity/TheComb.cs new file mode 100644 index 0000000000..a0b6f21acf --- /dev/null +++ b/Items/Accessories/Vanity/TheComb.cs @@ -0,0 +1,29 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Accessories.Vanity +{ + public class TheComb : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Accessories"; + + public override void SetDefaults() + { + Item.width = 40; + Item.height = 42; + Item.accessory = true; + Item.value = CalamityGlobalItem.RarityBlueBuyPrice; + Item.rare = ItemRarityID.Blue; + Item.vanity = true; + } + + public override void UpdateVanity(Player player) => player.Calamity().combHair = true; + + public override void UpdateAccessory(Player player, bool hideVisual) + { + if (!hideVisual) + player.Calamity().combHair = true; + } + } +} diff --git a/Items/Accessories/Vanity/TheComb.png b/Items/Accessories/Vanity/TheComb.png new file mode 100644 index 0000000000..95d69e8fbd Binary files /dev/null and b/Items/Accessories/Vanity/TheComb.png differ diff --git a/Items/BrokenWaterFilter.cs b/Items/BrokenWaterFilter.cs index d1988055a3..ffb03203aa 100644 --- a/Items/BrokenWaterFilter.cs +++ b/Items/BrokenWaterFilter.cs @@ -1,5 +1,4 @@ -using CalamityMod.Items.Materials; -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework.Graphics; @@ -87,14 +86,5 @@ namespace CalamityMod.Items text = GetTextValue("Items.Misc.SpawnBlockersOff"); tooltips.FindAndReplace("[STATE]", text); } - - public override void AddRecipes() - { - CreateRecipe(). - AddRecipeGroup("IronBar", 10). - AddIngredient(). - AddTile(TileID.Anvils). - Register(); - } } } diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index a4e07a9ead..277af101c4 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -10,7 +10,6 @@ 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; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.Other; @@ -24,6 +23,7 @@ using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; using CalamityMod.Rarities; +using CalamityMod.Systems.Collections; using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.UI; using CalamityMod.UI.CalamitasEnchants; @@ -850,7 +850,7 @@ namespace CalamityMod.Items // Handle general use-item effects for the Gem Tech Armor. player.Calamity().GemTechState.OnItemUseEffects(item); - if (item.type == ItemID.MonkStaffT1 || CalamityLists.spearAutoreuseList.Contains(item.type)) + if (item.type == ItemID.MonkStaffT1 || AutoreusableSpearsList.Includes(item.type)) { return player.ownedProjectileCounts[item.shoot] <= 0; } @@ -1603,7 +1603,7 @@ namespace CalamityMod.Items #region PostUpdate public override void PostUpdate(Item item) { - if (CalamityLists.forceItemList?.Contains(item.type) ?? false) + if (ItemsForcedInsideWorldList.Includes(item.type)) CalamityUtils.ForceItemIntoWorld(item); } #endregion diff --git a/Items/CalamityGlobalItemLoot.cs b/Items/CalamityGlobalItemLoot.cs index 2189dc89de..2df054f082 100644 --- a/Items/CalamityGlobalItemLoot.cs +++ b/Items/CalamityGlobalItemLoot.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using CalamityMod.Enums; using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Items.PermanentBoosters; @@ -25,12 +26,6 @@ namespace CalamityMod.Items public override void ModifyItemLoot(Item item, ItemLoot loot) { Fraction fifteenPercent = new Fraction(15, 100); - static bool CryonicAvailable() - { - if (!DownedBossSystem.downedCryogen) - return false; - return (NPC.downedMechBoss1.ToInt() + NPC.downedMechBoss2.ToInt() + NPC.downedMechBoss3.ToInt()) >= 2; - } switch (item.type) { @@ -269,97 +264,55 @@ namespace CalamityMod.Items loot.AddRevBagAccessories(); loot.Add(ModContent.ItemType(), ThankYouPainting.DropInt); - // The Celestial Onion only drops if the player hasn't used one, or if the world is not in Master Mode. - loot.AddIf((info) => !info.player.Calamity().extraAccessoryML && !Main.masterMode, ModContent.ItemType()); + // The Celestial Onion only drops if the player hasn't used one (or has not used Demon Heart in Master Mode as it alternatively functions as that there) + loot.AddIf((info) => (!info.player.Calamity().extraAccessoryML && !Main.masterMode) || (!info.player.extraAccessory && Main.masterMode), ModContent.ItemType()); break; #endregion #region Fishing Crates - // TODO -- What is all this shit? + // Kylie @ 1% (yes this is the consistent rate, dw it's not hard to get one of these) case ItemID.WoodenCrate: case ItemID.WoodenCrateHard: - loot.Add(ModContent.ItemType(), 4, 3, 5); // 25% 3-5 Wulfrum Scrap - loot.Add(ModContent.ItemType(), 20); + loot.Add(ModContent.ItemType(), 100); + // We do not need to pop Hardmode ores out of Pearlwood Crates. They do not drop higher tier ores. break; - case ItemID.IronCrate: case ItemID.IronCrateHard: - loot.Add(ModContent.ItemType(), 4, 5, 8); // 25% 5-8 Wulfrum Scrap - loot.Add(ModContent.ItemType(), 4, 5, 8); // 25% 5-8 Ancient Bone Dust + RemoveHardmodeOresFromStandardCrates(loot); + loot.AddHardmodeOresToCrates(HardmodeCrateType.Mythril); break; - // these drops are not available in hardmode because this crate will stop dropping + // Non-crafted underground Gold Chest loot @ 20%; Individually 5% case ItemID.GoldenCrate: - loot.Add(ItemID.FlareGun, 10); // 10% Flare Gun - loot.Add(ItemID.ShoeSpikes, 10); // 10% Shoe Spikes (BUT NOT CLIMBING CLAWS?) - loot.Add(ItemID.BandofRegeneration, 10); // 10% Band of Regeneration + loot.Add(new OneFromOptionsNotScaledWithLuckDropRule(5, 1, + ItemID.FlareGun, + ItemID.Mace, + ItemID.BandofRegeneration, + ItemID.ShoeSpikes)); // Climbing Claws is in Wooden/Pearlwood (vanilla) in case you're curious break; case ItemID.GoldenCrateHard: - // Post-Yharon: 15% 30-40 Auric Ore - loot.AddIf(() => DownedBossSystem.downedYharon, ModContent.ItemType(), fifteenPercent, 30, 40); + RemoveHardmodeOresFromStandardCrates(loot); + loot.AddHardmodeOresToCrates(HardmodeCrateType.Titanium); + loot.Add(new OneFromOptionsNotScaledWithLuckDropRule(5, 1, + ItemID.FlareGun, + ItemID.Mace, + ItemID.BandofRegeneration, + ItemID.ShoeSpikes)); break; - case ItemID.CorruptFishingCrate: - case ItemID.CrimsonFishingCrate: case ItemID.CorruptFishingCrateHard: case ItemID.CrimsonFishingCrateHard: - loot.Add(ModContent.ItemType(), fifteenPercent, 5, 8); // 15% 5-8 Blighted Gel - break; - - case ItemID.HallowedFishingCrate: // WHY case ItemID.HallowedFishingCrateHard: - var postProv = loot.DefineConditionalDropSet(() => DownedBossSystem.downedProvidence); - postProv.Add(ModContent.ItemType(), fifteenPercent, 5, 10); // 15% 5-10 Unholy Essence - break; - - case ItemID.DungeonFishingCrate: case ItemID.DungeonFishingCrateHard: - loot.AddIf(() => NPC.downedPlantBoss, ItemID.Ectoplasm, 10, 1, 5); // 10% 1-5 Ectoplasm - loot.AddIf(() => DownedBossSystem.downedPolterghast, ModContent.ItemType(), 10, 1, 5); // 10% 1-5 Necroplasm - break; - - case ItemID.JungleFishingCrate: case ItemID.JungleFishingCrateHard: - var postPlant = loot.DefineConditionalDropSet(() => NPC.downedPlantBoss); - postPlant.Add(ModContent.ItemType(), 5, 16, 28); // 20% 16-28 Perennial Ore - postPlant.Add(ModContent.ItemType(), fifteenPercent, 4, 7); // 15% 4-7 Perennial Bar - loot.AddIf(() => NPC.downedGolemBoss, ModContent.ItemType(), 5, 3, 6); // 20% 3-6 Plague Cell Canister - var uelibloom = loot.DefineConditionalDropSet(() => DownedBossSystem.downedProvidence); - uelibloom.Add(ModContent.ItemType(), 5, 16, 28); // 20% 16-28 Uelibloom Ore - uelibloom.Add(ModContent.ItemType(), fifteenPercent, 4, 7); // 15% 4-7 Uelibloom Bar - break; - - case ItemID.FloatingIslandFishingCrate: case ItemID.FloatingIslandFishingCrateHard: - var evilBossTwo = loot.DefineConditionalDropSet(() => DownedBossSystem.downedHiveMind || DownedBossSystem.downedPerforator); - evilBossTwo.Add(ModContent.ItemType(), 5, 16, 28); // 20% 16-28 Aerialite Ore - evilBossTwo.Add(ModContent.ItemType(), fifteenPercent, 4, 7); // 15% 4-7 Aerialite Bar - loot.AddIf(() => Main.hardMode, ModContent.ItemType(), 5, 2, 4); // 20% 2-4 Essence of Sunlight - loot.AddIf(() => NPC.downedMoonlord, ModContent.ItemType(), 5, 16, 28); // 20% 16-28 Exodium Clusters - break; - - case ItemID.FrozenCrate: case ItemID.FrozenCrateHard: - var cryonic = loot.DefineConditionalDropSet(CryonicAvailable); - cryonic.Add(ModContent.ItemType(), 5, 16, 28); // 20% 16-28 Cryonic Ore - cryonic.Add(ModContent.ItemType(), fifteenPercent, 4, 7); // 15% 4-7 Cryonic Bar - loot.AddIf(() => Main.hardMode, ModContent.ItemType(), 5, 2, 4); // 20% 2-4 Essence of Eleum - break; - - case ItemID.LavaCrate: case ItemID.LavaCrateHard: - loot.AddIf(() => Main.hardMode, ModContent.ItemType(), 5, 2, 4); // 20% 2-4 Essence of Havoc - break; - - // Calamity does not touch Oasis Crates yet - case ItemID.OasisCrate: case ItemID.OasisCrateHard: - break; - - // Calamity does not touch Ocean Crates yet - case ItemID.OceanCrate: case ItemID.OceanCrateHard: + RemoveHardmodeOresFromBiomeCrates(loot); + loot.AddHardmodeOresToCrates(HardmodeCrateType.Biome); break; #endregion @@ -530,6 +483,66 @@ namespace CalamityMod.Items } #endregion + #region Fishing Crate Loot Rule Manipulation + private static void RemoveHardmodeOresFromStandardCrates(ItemLoot loot) + { + List rules = loot.Get(false); + + // This is the primary rule which contains every drop + AlwaysAtleastOneSuccessDropRule mainRule = null; + foreach (IItemDropRule rule in rules) + if (rule is AlwaysAtleastOneSuccessDropRule a) + mainRule = a; + if (mainRule is null) + return; + + // Find ones that are supposed to be for the ore and not the other loot + foreach (IItemDropRule rule in mainRule.rules) + { + // Hardmode ores/bars are both nested within *another* nested rule + if (rule is SequentialRulesNotScalingWithLuckRule oreRule) + { + // Confirm that this is for the ore/bar then pop the numerator for the big rule + foreach (IItemDropRule nestedRule in oreRule.rules) + { + if (nestedRule is SequentialRulesNotScalingWithLuckRule s) + { + oreRule.chanceNumerator = 0; + return; + } + } + } + } + } + + private static void RemoveHardmodeOresFromBiomeCrates(ItemLoot loot) + { + List rules = loot.Get(false); + + // This is the primary rule which contains every drop + AlwaysAtleastOneSuccessDropRule mainRule = null; + foreach (IItemDropRule rule in rules) + if (rule is AlwaysAtleastOneSuccessDropRule a) + mainRule = a; + if (mainRule is null) + return; + + foreach (IItemDropRule rule in mainRule.rules) + { + // 2 rules, one for ore and another for bar, nested within *another* nested rule + if (rule is SequentialRulesNotScalingWithLuckRule oreRule) + { + // Confirm that this is for the ore/bar then pop the numerator for the big rule + foreach (IItemDropRule nestedRule in oreRule.rules) + { + if (nestedRule is OneFromRulesRule o) + oreRule.chanceNumerator = 0; + } + } + } + } + #endregion + #region Goodie Bag Bat Hook private static void RemoveBatHookFromGoodieBag(ItemLoot loot) { diff --git a/Items/Fishing/AstralCatches/AstralCrate.cs b/Items/Fishing/AstralCatches/AstralCrate.cs index 690c4c8e8b..75ca58ba4b 100644 --- a/Items/Fishing/AstralCatches/AstralCrate.cs +++ b/Items/Fishing/AstralCatches/AstralCrate.cs @@ -1,16 +1,6 @@ -using CalamityMod.Items.Accessories; -using CalamityMod.Items.Critters; -using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Ores; -using CalamityMod.Items.Potions; -using CalamityMod.Items.Weapons.Magic; -using CalamityMod.Items.Weapons.Melee; -using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Tiles.Astral; using Terraria; -using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; @@ -29,18 +19,10 @@ namespace CalamityMod.Items.Fishing.AstralCatches public override void SetDefaults() { - Item.width = 32; - Item.height = 32; - Item.maxStack = 9999; - Item.consumable = true; - Item.rare = ItemRarityID.Green; + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.width = Item.height = 32; Item.value = Item.sellPrice(gold: 1); - Item.createTile = ModContent.TileType(); - Item.useTurn = true; - Item.autoReuse = true; - Item.useAnimation = 15; - Item.useTime = 10; - Item.useStyle = ItemUseStyleID.Swing; + Item.rare = ItemRarityID.Green; } public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) @@ -51,48 +33,14 @@ namespace CalamityMod.Items.Fishing.AstralCatches public override bool CanRightClick() => true; public override void ModifyItemLoot(ItemLoot itemLoot) { - var postAstrumAureus = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedAstrumAureus); - var postAstrumDeus = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedAstrumDeus); + // 4-10 Starblight Soot @ 50% + // This is our equivalent to Crystal Shards/Ichor + itemLoot.Add(ModContent.ItemType(), 2, 4, 10); - // Materials - itemLoot.Add(ModContent.ItemType(), 1, 5, 10); - itemLoot.Add(ItemID.FallenStar, 1, 5, 10); - itemLoot.Add(ItemID.Meteorite, 5, 10, 20); - itemLoot.Add(ItemID.MeteoriteBar, 10, 1, 3); + // Astrophage @ 5% + itemLoot.Add(ModContent.ItemType(), 20); - postAstrumAureus.Add(ModContent.ItemType(), 5, 2, 5); - postAstrumDeus.Add(ModContent.ItemType(), 5, 10, 20); - postAstrumDeus.Add(ModContent.ItemType(), 10, 1, 3); - postAstrumDeus.Add(ModContent.ItemType(), 4, 5, 10); - - // Weapons (and Starburster Core) - postAstrumAureus.Add(new OneFromOptionsDropRule(10, 1, - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType() - )); - - // Pet - itemLoot.Add(ModContent.ItemType(), 10); - - // Bait - itemLoot.Add(ModContent.ItemType(), 5, 1, 3); - itemLoot.Add(ItemID.EnchantedNightcrawler, 5, 1, 3); - itemLoot.Add(ModContent.ItemType(), 5, 1, 3); - itemLoot.Add(ItemID.Firefly, 3, 1, 3); - - // Potions - postAstrumAureus.Add(ModContent.ItemType(), 10, 1, 3); - postAstrumAureus.Add(ModContent.ItemType(), 10, 1, 3); - itemLoot.AddCratePotionRules(); - - // Money - itemLoot.Add(ItemID.SilverCoin, 1, 10, 90); - itemLoot.Add(ItemID.GoldCoin, 2, 1, 5); + itemLoot.AddBiomeCrateLootRules(); } } } diff --git a/Items/Fishing/AstralCatches/MonolithCrate.cs b/Items/Fishing/AstralCatches/MonolithCrate.cs index 060d03675b..736bd5ba2e 100644 --- a/Items/Fishing/AstralCatches/MonolithCrate.cs +++ b/Items/Fishing/AstralCatches/MonolithCrate.cs @@ -1,5 +1,4 @@ -using CalamityMod.Items.Critters; -using CalamityMod.Tiles.Astral; +using CalamityMod.Tiles.Astral; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -17,18 +16,10 @@ namespace CalamityMod.Items.Fishing.AstralCatches public override void SetDefaults() { - Item.width = 32; - Item.height = 32; - Item.maxStack = 9999; - Item.consumable = true; - Item.rare = ItemRarityID.Green; + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.width = Item.height = 32; Item.value = Item.sellPrice(gold: 1); - Item.createTile = ModContent.TileType(); - Item.useTurn = true; - Item.autoReuse = true; - Item.useAnimation = 15; - Item.useTime = 10; - Item.useStyle = ItemUseStyleID.Swing; + Item.rare = ItemRarityID.Green; } public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) @@ -39,27 +30,10 @@ namespace CalamityMod.Items.Fishing.AstralCatches public override bool CanRightClick() => true; public override void ModifyItemLoot(ItemLoot itemLoot) { - // Materials - itemLoot.Add(ItemID.FallenStar, 1, 5, 10); - itemLoot.Add(ItemID.Meteorite, 5, 10, 20); - itemLoot.Add(ItemID.MeteoriteBar, 10, 1, 3); + // Astrophage @ 5% + itemLoot.Add(ModContent.ItemType(), 20); - // Pet - itemLoot.Add(ModContent.ItemType(), 10); - - // Bait - itemLoot.Add(ModContent.ItemType(), 5, 1, 3); - itemLoot.Add(ItemID.EnchantedNightcrawler, 5, 1, 3); - itemLoot.Add(ModContent.ItemType(), 5, 1, 3); - - itemLoot.Add(ItemID.Firefly, 3, 1, 3); - - // Potions - itemLoot.AddCratePotionRules(false); - - // Money - itemLoot.Add(ItemID.SilverCoin, 1, 10, 90); - itemLoot.Add(ItemID.GoldCoin, 2, 1, 5); + itemLoot.AddBiomeCrateLootRules(false); } } } diff --git a/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs b/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs index 9346ddecb4..fb5785cf59 100644 --- a/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs +++ b/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs @@ -1,6 +1,4 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Items.Potions; -using CalamityMod.Tiles.Crags; +using CalamityMod.Tiles.Crags; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -42,27 +40,7 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches public override bool CanRightClick() => true; public override void ModifyItemLoot(ItemLoot itemLoot) { - // Materials - itemLoot.Add(ItemID.Obsidian, 1, 2, 5); - itemLoot.Add(ItemID.Hellstone, 4, 2, 5); - itemLoot.Add(ItemID.HellstoneBar, 10, 1, 3); - itemLoot.AddIf(() => DownedBossSystem.downedBrimstoneElemental, ModContent.ItemType(), 10, 1, 3); - itemLoot.AddIf(() => DownedBossSystem.downedProvidence, ModContent.ItemType(), 2, 1, 3); - - // Weapons (none) - - // Bait - itemLoot.Add(ItemID.MasterBait, 10, 1, 2); - itemLoot.Add(ItemID.JourneymanBait, 5, 1, 3); - itemLoot.Add(ItemID.ApprenticeBait, 3, 2, 3); - - // Potions - itemLoot.Add(ItemID.InfernoPotion, 10, 1, 3); - itemLoot.AddCratePotionRules(); - - // Money - itemLoot.Add(ItemID.SilverCoin, 1, 10, 90); - itemLoot.Add(ItemID.GoldCoin, 2, 1, 5); + itemLoot.AddBiomeCrateLootRules(); } } } diff --git a/Items/Fishing/BrimstoneCragCatches/SlagCrate.cs b/Items/Fishing/BrimstoneCragCatches/SlagCrate.cs index 0afec68579..ea62747e86 100644 --- a/Items/Fishing/BrimstoneCragCatches/SlagCrate.cs +++ b/Items/Fishing/BrimstoneCragCatches/SlagCrate.cs @@ -1,5 +1,4 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Tiles.Crags; +using CalamityMod.Tiles.Crags; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -17,18 +16,10 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches public override void SetDefaults() { - Item.width = 32; - Item.height = 32; - Item.maxStack = 9999; - Item.consumable = true; - Item.rare = ItemRarityID.Green; + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.width = Item.height = 32; Item.value = Item.sellPrice(gold: 1); - Item.createTile = ModContent.TileType(); - Item.useTurn = true; - Item.autoReuse = true; - Item.useAnimation = 15; - Item.useTime = 10; - Item.useStyle = ItemUseStyleID.Swing; + Item.rare = ItemRarityID.Green; } public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) @@ -39,25 +30,7 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches public override bool CanRightClick() => true; public override void ModifyItemLoot(ItemLoot itemLoot) { - // Materials - itemLoot.Add(ItemID.Obsidian, 1, 2, 5); - itemLoot.Add(ItemID.Hellstone, 4, 2, 5); - itemLoot.Add(ItemID.HellstoneBar, 10, 1, 3); - - // Weapons (none) - - // Bait - itemLoot.Add(ItemID.MasterBait, 10, 1, 2); - itemLoot.Add(ItemID.JourneymanBait, 5, 1, 3); - itemLoot.Add(ItemID.ApprenticeBait, 3, 2, 3); - - // Potions - itemLoot.Add(ItemID.InfernoPotion, 10, 1, 3); - itemLoot.AddCratePotionRules(false); - - // Money - itemLoot.Add(ItemID.SilverCoin, 1, 10, 90); - itemLoot.Add(ItemID.GoldCoin, 2, 1, 5); + itemLoot.AddBiomeCrateLootRules(false); } } } diff --git a/Items/Fishing/FishingRods/EarlyBloomRod.cs b/Items/Fishing/FishingRods/EarlyBloomRod.cs index 2c536a12f5..fa92d6cf33 100644 --- a/Items/Fishing/FishingRods/EarlyBloomRod.cs +++ b/Items/Fishing/FishingRods/EarlyBloomRod.cs @@ -27,6 +27,11 @@ namespace CalamityMod.Items.Fishing.FishingRods Item.rare = ModContent.RarityType(); } + public override void HoldItem(Player player) + { + player.accFishingLine = true; + } + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { for (int i = 0; i < 6; i++) diff --git a/Items/Fishing/FishingRods/TheDevourerofCods.cs b/Items/Fishing/FishingRods/TheDevourerofCods.cs index 62d2e6cc12..c05b8bb2ec 100644 --- a/Items/Fishing/FishingRods/TheDevourerofCods.cs +++ b/Items/Fishing/FishingRods/TheDevourerofCods.cs @@ -33,6 +33,11 @@ namespace CalamityMod.Items.Fishing.FishingRods Item.rare = ModContent.RarityType(); } + public override void HoldItem(Player player) + { + player.accFishingLine = true; + } + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { for (int i = 0; i < 10; i++) diff --git a/Items/Fishing/GrandMarquisBait.cs b/Items/Fishing/GrandMarquisBait.cs index be370af1e8..21b68505b6 100644 --- a/Items/Fishing/GrandMarquisBait.cs +++ b/Items/Fishing/GrandMarquisBait.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Fishing Item.maxStack = Item.CommonMaxStack; Item.rare = ItemRarityID.LightRed; Item.value = Item.sellPrice(silver: 30); - Item.bait = 65; + Item.bait = 75; Item.consumable = true; } diff --git a/Items/Fishing/StuffedFish.cs b/Items/Fishing/StuffedFish.cs index 8ee4b5c0f9..b3f6398ade 100644 --- a/Items/Fishing/StuffedFish.cs +++ b/Items/Fishing/StuffedFish.cs @@ -1,4 +1,6 @@ -using System.Collections.Generic; +using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Items.Placeables.Crags; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -30,6 +32,8 @@ namespace CalamityMod.Items.Fishing ItemID.GrassSeeds, ItemID.JungleGrassSeeds, ItemID.MushroomGrassSeeds, + ItemID.AshGrassSeeds, + ModContent.ItemType(), ItemID.PumpkinSeed }; @@ -84,12 +88,15 @@ namespace CalamityMod.Items.Fishing itemLoot.Add(ItemID.GrassSeeds, 10, seedMin, seedMax); itemLoot.Add(ItemID.JungleGrassSeeds, 10, seedMin, seedMax); itemLoot.Add(ItemID.MushroomGrassSeeds, 10, seedMin, seedMax); + itemLoot.Add(ItemID.AshGrassSeeds, 20, seedMin, seedMax); + itemLoot.Add(ModContent.ItemType(), 20, seedMin, seedMax); itemLoot.Add(ItemID.PumpkinSeed, 20, seedMin, seedMax); // Biome grass seeds itemLoot.AddIf(() => !WorldGen.crimson, ItemID.CorruptSeeds, 20, seedMin, seedMax); itemLoot.AddIf(() => WorldGen.crimson, ItemID.CrimsonSeeds, 20, seedMin, seedMax); itemLoot.AddIf(() => Main.hardMode, ItemID.HallowedSeeds, 20, seedMin, seedMax); + itemLoot.AddIf(() => Main.hardMode, ModContent.ItemType(), 20, seedMin, seedMax); // Add Thorium Marine Kelp if Thorium is loaded. Mod thorium = ExternalMods.thorium; diff --git a/Items/Fishing/SulphurCatches/HydrothermalCrate.cs b/Items/Fishing/SulphurCatches/HydrothermalCrate.cs index fca10d69a5..d14e2f292c 100644 --- a/Items/Fishing/SulphurCatches/HydrothermalCrate.cs +++ b/Items/Fishing/SulphurCatches/HydrothermalCrate.cs @@ -1,9 +1,6 @@ using CalamityMod.Items.Accessories; -using CalamityMod.Items.Materials; using CalamityMod.Items.Pets; -using CalamityMod.Items.Placeables.Abyss; -using CalamityMod.Items.Placeables.Ores; -using CalamityMod.Items.Potions; +using CalamityMod.Items.Placeables.Furniture; using CalamityMod.Items.Tools.ClimateChange; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; @@ -31,18 +28,10 @@ namespace CalamityMod.Items.Fishing.SulphurCatches public override void SetDefaults() { - Item.width = 32; - Item.height = 32; - Item.maxStack = 9999; - Item.consumable = true; - Item.rare = ItemRarityID.Green; + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.width = Item.height = 32; Item.value = Item.sellPrice(gold: 1); - Item.createTile = ModContent.TileType(); - Item.useTurn = true; - Item.autoReuse = true; - Item.useAnimation = 15; - Item.useTime = 10; - Item.useStyle = ItemUseStyleID.Swing; + Item.rare = ItemRarityID.Green; } public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) @@ -53,51 +42,29 @@ namespace CalamityMod.Items.Fishing.SulphurCatches public override bool CanRightClick() => true; public override void ModifyItemLoot(ItemLoot itemLoot) { - // The contents of this crate depend massively on progression, so it uses a large number of LeadingConditionRules. - var tier1AbyssAvailable = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedSlimeGod || Main.hardMode); - var tier2AbyssAvailable = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedLeviathan); - var scoriaAvailable = itemLoot.DefineConditionalDropSet(() => NPC.downedGolemBoss); - var tier1AcidRain = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedEoCAcidRain); - var tier2AcidRain = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedAquaticScourgeAcidRain); - var tier3AcidRain = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedPolterghast && DownedBossSystem.downedBoomerDuke); + // 20-50 Blocks @ 100%; Individually 33.33% + itemLoot.Add(new OneFromRulesRule(1, new IItemDropRule[3] + { + ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50), + ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50), + ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50) + })); - // 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); - - 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); - scoriaAvailable.Add(ModContent.ItemType(), 5, 16, 28); - scoriaAvailable.Add(ModContent.ItemType(), new Fraction(15, 100), 4, 7); - tier3AcidRain.Add(ModContent.ItemType(), 10, 1, 5); + // Rusty Chest Loot @ 100%; Individually 25% + itemLoot.Add(new OneFromOptionsNotScaledWithLuckDropRule(1, 1, + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType() + )); // Pre-HM Abyss Weapons - tier1AbyssAvailable.Add(new OneFromOptionsDropRule(10, 1, + itemLoot.Add(new OneFromOptionsDropRule(10, 1, ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType() - )); - - // Post-AS Acid Rain Weapons (and Nuclear Rod) - tier2AcidRain.Add(new OneFromOptionsDropRule(10, 1, - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType() - )); - - // Pre-HM Abyss Equipment (and Torrential Tear) - tier1AbyssAvailable.Add(new OneFromOptionsDropRule(4, 1, + ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), @@ -105,18 +72,7 @@ namespace CalamityMod.Items.Fishing.SulphurCatches ModContent.ItemType() )); - // Bait - itemLoot.Add(ItemID.MasterBait, 10, 1, 2); - itemLoot.Add(ItemID.JourneymanBait, 5, 1, 3); - itemLoot.Add(ItemID.ApprenticeBait, 3, 2, 3); - - // Potions - itemLoot.Add(ModContent.ItemType(), 10, 1, 3); - itemLoot.AddCratePotionRules(); - - // Money - itemLoot.Add(ItemID.SilverCoin, 1, 10, 90); - itemLoot.Add(ItemID.GoldCoin, 2, 1, 5); + itemLoot.AddBiomeCrateLootRules(); } } } diff --git a/Items/Fishing/SulphurCatches/SulphurousCrate.cs b/Items/Fishing/SulphurCatches/SulphurousCrate.cs index 4b7f174bf8..692e01abdb 100644 --- a/Items/Fishing/SulphurCatches/SulphurousCrate.cs +++ b/Items/Fishing/SulphurCatches/SulphurousCrate.cs @@ -1,19 +1,11 @@ using CalamityMod.Items.Accessories; -using CalamityMod.Items.Materials; -using CalamityMod.Items.Pets; -using CalamityMod.Items.Placeables.Abyss; -using CalamityMod.Items.Potions; -using CalamityMod.Items.Tools.ClimateChange; -using CalamityMod.Items.Weapons.Magic; -using CalamityMod.Items.Weapons.Melee; -using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Placeables.Furniture; using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Tiles.Abyss; using Terraria; using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; -using CrateTile = CalamityMod.Tiles.Abyss.SulphurousCrateTile; namespace CalamityMod.Items.Fishing.SulphurCatches { @@ -29,18 +21,10 @@ namespace CalamityMod.Items.Fishing.SulphurCatches public override void SetDefaults() { - Item.width = 32; - Item.height = 32; - Item.maxStack = 9999; - Item.consumable = true; - Item.rare = ItemRarityID.Green; + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.width = Item.height = 32; Item.value = Item.sellPrice(gold: 1); - Item.createTile = ModContent.TileType(); - Item.useTurn = true; - Item.autoReuse = true; - Item.useAnimation = 15; - Item.useTime = 10; - Item.useStyle = ItemUseStyleID.Swing; + Item.rare = ItemRarityID.Green; } public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) @@ -51,47 +35,23 @@ namespace CalamityMod.Items.Fishing.SulphurCatches public override bool CanRightClick() => true; public override void ModifyItemLoot(ItemLoot itemLoot) { - var tier1AbyssAvailable = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedSlimeGod || Main.hardMode); - var tier1AcidRain = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedEoCAcidRain); + // 20-50 Blocks @ 100%; Individually 33.33% + itemLoot.Add(new OneFromRulesRule(1, new IItemDropRule[3] + { + ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50), + ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50), + ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50) + })); - // 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); - - tier1AcidRain.Add(ModContent.ItemType(), 10, 1, 3); - - // Pre-HM Abyss Weapons - tier1AbyssAvailable.Add(new OneFromOptionsDropRule(10, 1, - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType() + // Rusty Chest Loot @ 100%; Individually 25% + itemLoot.Add(new OneFromOptionsNotScaledWithLuckDropRule(1, 1, + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType() )); - // Pre-HM Abyss Equipment (and Torrential Tear) - tier1AbyssAvailable.Add(new OneFromOptionsDropRule(4, 1, - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType() - )); - - // Bait - itemLoot.Add(ItemID.MasterBait, 10, 1, 2); - itemLoot.Add(ItemID.JourneymanBait, 5, 1, 3); - itemLoot.Add(ItemID.ApprenticeBait, 3, 2, 3); - - // Potions - itemLoot.Add(ModContent.ItemType(), 10, 1, 3); - itemLoot.AddCratePotionRules(false); - - // Money - itemLoot.Add(ItemID.SilverCoin, 1, 10, 90); - itemLoot.Add(ItemID.GoldCoin, 2, 1, 5); + itemLoot.AddBiomeCrateLootRules(false); } } } diff --git a/Items/Fishing/SunkenSeaCatches/EutrophicCrate.cs b/Items/Fishing/SunkenSeaCatches/EutrophicCrate.cs index 6a5f8b7677..308fe9e4d2 100644 --- a/Items/Fishing/SunkenSeaCatches/EutrophicCrate.cs +++ b/Items/Fishing/SunkenSeaCatches/EutrophicCrate.cs @@ -1,10 +1,4 @@ -using CalamityMod.Items.Critters; -using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.SunkenSea; -using CalamityMod.Items.Weapons.Magic; -using CalamityMod.Items.Weapons.Melee; -using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Tiles.SunkenSea; using Terraria; using Terraria.GameContent.ItemDropRules; using Terraria.ID; @@ -24,18 +18,10 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches public override void SetDefaults() { - Item.width = 32; - Item.height = 32; - Item.maxStack = 9999; - Item.consumable = true; - Item.rare = ItemRarityID.Green; + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.width = Item.height = 32; Item.value = Item.sellPrice(gold: 1); - Item.createTile = ModContent.TileType(); - Item.useTurn = true; - Item.autoReuse = true; - Item.useAnimation = 15; - Item.useTime = 10; - Item.useStyle = ItemUseStyleID.Swing; + Item.rare = ItemRarityID.Green; } public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) @@ -46,27 +32,15 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches public override bool CanRightClick() => true; public override void ModifyItemLoot(ItemLoot itemLoot) { - var postDesertScourge = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedDesertScourge); + // 20-50 Blocks @ 100%; Individually 33.33% + itemLoot.Add(new OneFromRulesRule(1, new IItemDropRule[3] + { + ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50), + ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50), + ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50) + })); - // Materials - itemLoot.Add(ModContent.ItemType(), 1, 10, 30); - itemLoot.Add(ModContent.ItemType(), 1, 10, 30); - itemLoot.Add(ModContent.ItemType(), 1, 30, 60); - postDesertScourge.Add(ModContent.ItemType(), 1, 5, 10); - postDesertScourge.Add(ModContent.ItemType(), 5, 2, 5); - - // Bait - itemLoot.Add(ItemID.MasterBait, 10, 1, 2); - itemLoot.Add(ItemID.JourneymanBait, 5, 1, 3); - itemLoot.Add(ModContent.ItemType(), 5, 1, 3); - itemLoot.Add(ItemID.ApprenticeBait, 3, 2, 3); - - // Potions - itemLoot.AddCratePotionRules(false); - - // Money - itemLoot.Add(ItemID.SilverCoin, 1, 10, 90); - itemLoot.Add(ItemID.GoldCoin, 2, 1, 5); + itemLoot.AddBiomeCrateLootRules(false); } } } diff --git a/Items/Fishing/SunkenSeaCatches/PrismCrate.cs b/Items/Fishing/SunkenSeaCatches/PrismCrate.cs index b5e9eb4101..57b33bb787 100644 --- a/Items/Fishing/SunkenSeaCatches/PrismCrate.cs +++ b/Items/Fishing/SunkenSeaCatches/PrismCrate.cs @@ -1,11 +1,4 @@ -using CalamityMod.Items.Critters; -using CalamityMod.Items.Fishing.BrimstoneCragCatches; -using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.SunkenSea; -using CalamityMod.Items.Weapons.Magic; -using CalamityMod.Items.Weapons.Melee; -using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Tiles.SunkenSea; using Terraria; using Terraria.GameContent.ItemDropRules; using Terraria.ID; @@ -26,18 +19,10 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches public override void SetDefaults() { - Item.width = 32; - Item.height = 32; - Item.maxStack = 9999; - Item.consumable = true; - Item.rare = ItemRarityID.Green; + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.width = Item.height = 32; Item.value = Item.sellPrice(gold: 1); - Item.createTile = ModContent.TileType(); - Item.useTurn = true; - Item.autoReuse = true; - Item.useAnimation = 15; - Item.useTime = 10; - Item.useStyle = ItemUseStyleID.Swing; + Item.rare = ItemRarityID.Green; } public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) @@ -48,37 +33,15 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches public override bool CanRightClick() => true; public override void ModifyItemLoot(ItemLoot itemLoot) { - var postDesertScourge = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedDesertScourge); - var postHardmodeClam = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCLAMHardMode); + // 20-50 Blocks @ 100%; Individually 33.33% + itemLoot.Add(new OneFromRulesRule(1, new IItemDropRule[3] + { + ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50), + ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50), + ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50) + })); - // Materials - itemLoot.Add(ModContent.ItemType(), 1, 10, 30); - itemLoot.Add(ModContent.ItemType(), 1, 10, 30); - itemLoot.Add(ModContent.ItemType(), 1, 30, 60); - postDesertScourge.Add(ModContent.ItemType(), 1, 5, 10); - postDesertScourge.Add(ModContent.ItemType(), 5, 2, 5); - postHardmodeClam.Add(ModContent.ItemType(), new Fraction(12, 100), 2, 5); - - // Weapons - postHardmodeClam.Add(new OneFromOptionsNotScaledWithLuckDropRule(7, 100, - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType() - )); - - // Bait - itemLoot.Add(ItemID.MasterBait, 10, 1, 2); - itemLoot.Add(ItemID.JourneymanBait, 5, 1, 3); - itemLoot.Add(ModContent.ItemType(), 5, 1, 3); - itemLoot.Add(ItemID.ApprenticeBait, 3, 2, 3); - - // Potions - itemLoot.AddCratePotionRules(); - - // Money - itemLoot.Add(ItemID.SilverCoin, 1, 10, 90); - itemLoot.Add(ItemID.GoldCoin, 2, 1, 5); + itemLoot.AddBiomeCrateLootRules(); } } } diff --git a/Items/Mounts/BUMBLEDOGE.cs b/Items/Mounts/BUMBLEDOGE.cs index 28a68213b8..942e640030 100644 --- a/Items/Mounts/BUMBLEDOGE.cs +++ b/Items/Mounts/BUMBLEDOGE.cs @@ -17,12 +17,12 @@ namespace CalamityMod.Items.Mounts MountData.buff = ModContent.BuffType(); // Attack - MountData.abilityCooldown = 15; + MountData.abilityCooldown = 12; // Horizontal movement MountData.runSpeed = 10f; MountData.dashSpeed = 14.15f; - MountData.acceleration = 0.16f; + MountData.acceleration = 0.2f; // Vertical movement MountData.fallDamage = 0f; diff --git a/Items/Mounts/Crysthamyr.cs b/Items/Mounts/Crysthamyr.cs index 070aa55703..e050a1a7ed 100644 --- a/Items/Mounts/Crysthamyr.cs +++ b/Items/Mounts/Crysthamyr.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Mounts MountData.runSpeed = 5f; MountData.dashSpeed = 10f; MountData.swimSpeed = 6f; - MountData.acceleration = 0.6f; + MountData.acceleration = 1f; // Vertical movement MountData.fallDamage = 0f; diff --git a/Items/Mounts/OnyxExcavator.cs b/Items/Mounts/OnyxExcavator.cs index 21f9cc0a13..4a9ba4a65d 100644 --- a/Items/Mounts/OnyxExcavator.cs +++ b/Items/Mounts/OnyxExcavator.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Mounts MountData.buff = ModContent.BuffType(); // Horizontal movement - MountData.runSpeed = 6.5f; + MountData.runSpeed = 5.5f; MountData.swimSpeed = 0.5f; MountData.acceleration = 0.2f; diff --git a/Items/Placeables/Furniture/EffigyOfDecay.cs b/Items/Placeables/Furniture/EffigyOfDecay.cs index a67f4d7bdd..500771f63b 100644 --- a/Items/Placeables/Furniture/EffigyOfDecay.cs +++ b/Items/Placeables/Furniture/EffigyOfDecay.cs @@ -1,5 +1,3 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Tiles.Furniture; using Terraria; using Terraria.ID; @@ -16,13 +14,5 @@ namespace CalamityMod.Items.Placeables.Furniture Item.value = Item.sellPrice(silver: 10); Item.rare = ItemRarityID.Blue; } - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(10). - AddIngredient(2). - AddTile(TileID.Anvils). - Register(); - } } } diff --git a/Items/Weapons/Melee/EntropicClaymore.cs b/Items/Weapons/Melee/EntropicClaymore.cs index 6f8573c102..125028b0c0 100644 --- a/Items/Weapons/Melee/EntropicClaymore.cs +++ b/Items/Weapons/Melee/EntropicClaymore.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 130; Item.height = 130; - Item.damage = 92; + Item.damage = 110; Item.DamageType = DamageClass.Melee; Item.useAnimation = 30; Item.useStyle = ItemUseStyleID.Swing; @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Melee public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - for (int i = 0; i < 6; i++) + for (int i = 0; i < 5; i++) { Projectile.NewProjectile(source, position, velocity.RotatedByRandom(0.6f) * Main.rand.NextFloat(0.7f, 1.1f), type, damage / 2, knockback * 0.5f, player.whoAmI); } diff --git a/Items/Weapons/Ranged/SulphuricAcidCannon.cs b/Items/Weapons/Ranged/SulphuricAcidCannon.cs index 27ac2a1351..0b06d218fa 100644 --- a/Items/Weapons/Ranged/SulphuricAcidCannon.cs +++ b/Items/Weapons/Ranged/SulphuricAcidCannon.cs @@ -1,8 +1,11 @@ using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; +using Terraria.DataStructures; +using Terraria; using Terraria.ID; using Terraria.ModLoader; +using System; namespace CalamityMod.Items.Weapons.Ranged { @@ -18,21 +21,65 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 90; Item.height = 30; - Item.damage = 144; + Item.damage = 550; Item.DamageType = DamageClass.Ranged; - Item.useTime = 18; - Item.useAnimation = 18; + Item.useTime = 35; + Item.useAnimation = 35; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 6f; Item.autoReuse = true; Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; - Item.UseSound = SoundID.Item95; - Item.shoot = ModContent.ProjectileType(); + Item.UseSound = SoundID.Item73; + Item.useAmmo = AmmoID.Rocket; + Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 16f; Item.rare = ModContent.RarityType(); } public override Vector2? HoldoutOffset() => Vector2.UnitX * -15f; + + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + // Reposition to the gun's tip + add some inaccuracy + Vector2 newPos = position + new Vector2(78f, player.direction * (Math.Abs(velocity.SafeNormalize(Vector2.Zero).X) < 0.02f ? -2f : -8f)).RotatedBy(velocity.ToRotation()); + Vector2 newVel = velocity.RotatedByRandom(MathHelper.ToRadians(10f)); + + //Find which rocket type the player will be using. + player.PickAmmo(player.HeldItem, out _, out _, out _, out _, out int rocketType); + Projectile.NewProjectile(source, newPos, newVel, Item.shoot, damage, knockback, player.whoAmI,rocketType); + return false; + } + + public override void UseStyle(Player player, Rectangle heldItemFrame) + { + player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X)); + float itemRotation = player.compositeFrontArm.rotation + MathHelper.PiOver2 * player.gravDir; + + float pullback = 7f; + + float animProgress = 0.5f - player.itemTime / (float)player.itemTimeMax; + float rotation = (player.Center - player.Calamity().mouseWorld).ToRotation() * player.gravDir + MathHelper.PiOver2; + if (animProgress < 0.4f) + pullback -= (2.75f) * (float)Math.Pow((0.6f - animProgress) / 0.6f, 2); + + Vector2 itemPosition = player.MountedCenter + itemRotation.ToRotationVector2() * pullback; + Vector2 itemSize = new Vector2(52, 28); + Vector2 itemOrigin = new Vector2(-24, 4); + + CalamityUtils.CleanHoldStyle(player, itemRotation, itemPosition, itemSize, itemOrigin); + + base.UseStyle(player, heldItemFrame); + } + + public override void UseItemFrame(Player player) + { + player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X)); + + float animProgress = 0.5f - player.itemTime / (float)player.itemTimeMax; + float rotation = (player.Center - player.Calamity().mouseWorld).ToRotation() * player.gravDir + MathHelper.PiOver2; + + player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, rotation); + } } } diff --git a/Items/Weapons/Rogue/Malachite.cs b/Items/Weapons/Rogue/Malachite.cs index 63e63fc0cd..e67860842d 100644 --- a/Items/Weapons/Rogue/Malachite.cs +++ b/Items/Weapons/Rogue/Malachite.cs @@ -7,8 +7,14 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Malachite : RogueWeapon + // Have to directly implement the interface instead of extending LegendaryItem since it already extends RogueWeapon + public class Malachite : RogueWeapon, IHoldShiftTooltipItem { + public string ExtensionIndicatorKey => "Items.Misc.LegendaryShortTooltip"; + public Color? ExtensionIndicatorColor => null; + public string TooltipExtensionKey => "LegendaryText"; + public Color? TooltipExtensionColor => Color.Lime; + public override void SetStaticDefaults() { ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; diff --git a/Items/Weapons/Rogue/SlickCane.cs b/Items/Weapons/Rogue/SlickCane.cs index 22ee59fe16..66108a171d 100644 --- a/Items/Weapons/Rogue/SlickCane.cs +++ b/Items/Weapons/Rogue/SlickCane.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 42; Item.height = 36; - Item.damage = 27; + Item.damage = 50; Item.noMelee = true; Item.noUseGraphic = true; Item.channel = true; diff --git a/Items/Weapons/Summon/RustyBeaconPrototype.cs b/Items/Weapons/Summon/RustyBeaconPrototype.cs index 7568c46903..1002d5134e 100644 --- a/Items/Weapons/Summon/RustyBeaconPrototype.cs +++ b/Items/Weapons/Summon/RustyBeaconPrototype.cs @@ -1,5 +1,4 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -44,14 +43,5 @@ namespace CalamityMod.Items.Weapons.Summon player.UpdateMaxTurrets(); return false; } - - public override void AddRecipes() - { - CreateRecipe(). - AddRecipeGroup("AnySilverBar", 10). - AddIngredient(3). - AddTile(TileID.Anvils). - Register(); - } } } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 0dca6a0e49..5a62634e97 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -93,9 +93,8 @@ AlluringBait: { DisplayName: Alluring Bait Tooltip: ''' - Increases fishing power by 30 - Greatly increases chance of catching potion ingredient fish - Potion ingredient fish yield is increased + Increases fishing power by 10 + Increases the yield of potion ingredient fish ''' } @@ -706,7 +705,12 @@ ElysianAegis: { EnchantedPearl: { DisplayName: Enchanted Pearl - Tooltip: Increases fishing power by 10 and crate catch chance by 10% + Tooltip: + ''' + Increases fishing power by 10 + Increases chance to catch crates and loot-containing fish by 15% + Crates are 25% more likely to be higher quality + ''' } EtherealExtorter: { @@ -1412,7 +1416,7 @@ RottenBrain: { DisplayName: Rotten Brain Tooltip: ''' - 6% increased damage + 5% increased damage Taking damage spawns a dank creeper The dank creeper flies above you, exploding into several shaderain clouds ''' @@ -1633,8 +1637,7 @@ StatisNinjaBelt: { DisplayName: Statis' Ninja Belt Tooltip: ''' - 32% increased jump speed and allows auto-jump - Increased fall damage resistance by 35 blocks + 32% increased jump speed, allows auto-jump, and negates fall damage Grants the ability to swim, climb walls, dash, and dodge attacks ''' HoldShiftTooltip: @@ -1650,7 +1653,8 @@ StatisVoidSash: { Tooltip: ''' 32% increased jump speed, allows auto-jump, and negates fall damage - Can swim, climb walls, dash, and dodge attacks + Grants the ability to swim, climb walls, dash, and dodge attacks + Dashes leave homing scythes in your wake ''' HoldShiftTooltip: ''' @@ -1747,11 +1751,9 @@ SupremeBaitTackleBoxFishingStation: { DisplayName: Supreme Bait Tackle Box Fishing Station Tooltip: ''' - Increases fishing skill by 80, and crate catch chance by 10% + Increases fishing power by 50 Fishing line will never break and decreases chance of bait consumption - Allows fishing in lava - Sonar potion effect - The ultimate fishing accessory + Allows fishing in lava and detects hooked fish ''' } @@ -2082,6 +2084,16 @@ SharkyPlush: { Tooltip: "[c/696969:'Look around, at the sight and sound...']" } +TheComb: { + DisplayName: The Comb + Tooltip: + ''' + Gives the wearer's hair a lustrous finish + Sparkles are attracted to nearby chests + 'We ain't found shit!' + ''' +} + XyksBlessingBlue: { DisplayName: Xyk's Blessing (Blue) Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 7f39b64c59..61ae281b1e 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -1256,7 +1256,11 @@ StormSurge: { SulphuricAcidCannon: { DisplayName: Sulphuric Acid Cannon - Tooltip: Fires an acidic shot that sticks to enemies and dissolves them + Tooltip: + ''' + Fires homing Acid Rockets + Acid Rockets stick to enemies and explode into toxic mist after a short delay + ''' } SuperradiantSlaughterer: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 5845c31abf..b10a2bc029 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -687,6 +687,23 @@ Malachite: { Press to throw a single kunai that pierces, after piercing an enemy it emits a massive explosion on the next enemy hit Stealth strikes fire three kunai that home in, stick to enemies, and explode ''' + LegendaryText: + ''' + > STATUS_ + Extensive hull damage. Repairs initiated. + Sensor arrays offline. Repairs scheduled T+2200. + + > UPDATE_DIRECTIVE_ + Error 0x00017F80. Device sector unreadable. + Initializing search for external directive. + Searching... (383526 more) + Directive found. + New directive compiled. Rebooting... + + > PLAGUE UNIT 194-QB-03d ONLINE. + Directive summary: + Continue propagation of unified frequency band and lead satellite units. + ''' } MangroveChakram: { diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index c299ba6633..b44f6c51d1 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -255,6 +255,9 @@ HellbornProj.DisplayName: Hell-born Gunblast HellbornShell.DisplayName: Hell's Shell RubicoPrimeMag.DisplayName: Rubico Prime Mag MegalodonShot.DisplayName: Megalodon Shot +SulphuricAcidCannonExplosion.DisplayName: Sulphuric Acid Cannon Explosion LeviatitanAberration.DisplayName: Leviatitan Aberration LeviatitanMeteor.DisplayName: Leviatitan Meteor LeviatitanExplosion.DisplayName: Leviatitan Explosion +SulphuricDrop.DisplayName: Sulphuric Drop +AcidRocket.DisplayName: Acid Rocket diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index d154133dee..bce9cbdf27 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -7,6 +7,7 @@ using CalamityMod.Items; using CalamityMod.NPCs; using CalamityMod.NPCs.TownNPCs; using CalamityMod.Systems; +using CalamityMod.Systems.Collections; using CalamityMod.UI; using CalamityMod.UI.CalamitasEnchants; using CalamityMod.UI.DraedonSummoning; @@ -914,43 +915,43 @@ namespace CalamityMod #region Amalgam Potion Buff List public static bool SetAmalgamBuffList(int type, bool shouldBeListed) { - if (shouldBeListed && !CalamityLists.amalgamBuffList.Contains(type)) + if (shouldBeListed && !AmalgamBuffList.Includes(type)) { - CalamityLists.amalgamBuffList.Add(type); + AmalgamBuffList.List.Add(type); return true; } else if (!shouldBeListed) { - return CalamityLists.amalgamBuffList.Remove(type); + return AmalgamBuffList.List.Remove(type); } return false; } public static bool SetPersistentBuffList(int type, bool isPersistent) { - if (isPersistent && !CalamityLists.persistentBuffList.Contains(type)) + if (isPersistent && !PersistentBuffList.Includes(type)) { - CalamityLists.persistentBuffList.Add(type); + PersistentBuffList.List.Add(type); return true; } else if (!isPersistent) { - return CalamityLists.persistentBuffList.Remove(type); + return PersistentBuffList.List.Remove(type); } return false; } - public static bool IsOnAmalgamBuffList(int type) => CalamityLists.amalgamBuffList.Contains(type); - public static bool IsOnPersistentBuffList(int type) => CalamityLists.persistentBuffList.Contains(type); + public static bool IsOnAmalgamBuffList(int type) => AmalgamBuffList.Includes(type); + public static bool IsOnPersistentBuffList(int type) => PersistentBuffList.Includes(type); #endregion #region Venerated Locket Bans public static bool AddToVeneratedLocketBanlist(int type) { - if (!CalamityLists.VeneratedLocketBanlist.Contains(type)) + if (!VeneratedLocketBanList.Includes(type)) { - CalamityLists.VeneratedLocketBanlist.Add(type); + VeneratedLocketBanList.List.Add(type); return true; } return false; @@ -960,35 +961,35 @@ namespace CalamityMod #region Summoner Cross Class Nerf Disabling public static bool SetSummonerNerfDisabledByMinion(int type, bool disableNerf) { - if (disableNerf && !CalamityLists.DisabledSummonerNerfMinions.Contains(type)) + if (disableNerf && !DisabledSummonerNerfMinionList.Includes(type)) { - CalamityLists.DisabledSummonerNerfMinions.Add(type); + DisabledSummonerNerfMinionList.List.Add(type); return true; } else if (!disableNerf) { - return CalamityLists.DisabledSummonerNerfMinions.Remove(type); + return DisabledSummonerNerfMinionList.List.Remove(type); } return false; } public static bool SetSummonerNerfDisabledByItem(int type, bool disableNerf) { - if (disableNerf && !CalamityLists.DisabledSummonerNerfItems.Contains(type)) + if (disableNerf && !DisabledSummonerNerfItemList.Includes(type)) { - CalamityLists.DisabledSummonerNerfItems.Add(type); + DisabledSummonerNerfItemList.List.Add(type); return true; } else if (!disableNerf) { - return CalamityLists.DisabledSummonerNerfItems.Remove(type); + return DisabledSummonerNerfItemList.List.Remove(type); } return false; } - public static bool GetSummonerNerfDisabledByMinion(int type) => CalamityLists.DisabledSummonerNerfMinions.Contains(type); - public static bool GetSummonerNerfDisabledByItem(int type) => CalamityLists.DisabledSummonerNerfItems.Contains(type); + public static bool GetSummonerNerfDisabledByMinion(int type) => DisabledSummonerNerfMinionList.Includes(type); + public static bool GetSummonerNerfDisabledByItem(int type) => DisabledSummonerNerfItemList.Includes(type); #endregion #region Debuff Display support @@ -1076,9 +1077,9 @@ namespace CalamityMod //This is to add minions to the hp scaling config public static bool AddToHPScaling(int type) { - if (!CalamityLists.bossHPScaleList.Contains(type)) + if (!BossHPScalingList.List.Contains(type)) { - CalamityLists.bossHPScaleList.Add(type); + BossHPScalingList.List.Add(type); return true; } return false; diff --git a/NPCs/Abyss/DevilFish.cs b/NPCs/Abyss/DevilFish.cs index dd11f84852..86f0a98418 100644 --- a/NPCs/Abyss/DevilFish.cs +++ b/NPCs/Abyss/DevilFish.cs @@ -318,7 +318,6 @@ namespace CalamityMod.NPCs.Abyss { var postLevi = npcLoot.DefineConditionalDropSet(DropHelper.PostLevi()); postLevi.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 1, 2, 2, 3)); - postLevi.Add(ModContent.ItemType(), 2); npcLoot.AddIf(() => NPC.downedGolemBoss, ModContent.ItemType(), 1, 3, 9); npcLoot.Add(ModContent.ItemType(), 1, 10, 20); } diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index 7058346888..37e26cc9b0 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -466,14 +466,14 @@ namespace CalamityMod.NPCs.Abyss aewMinionCondition.Add(ModContent.ItemType(), 50); // Post-Polterghast: Soul Edge, Eidolic Wail, Stardust Staff - LeadingConditionRule postPolter = npcLoot.DefineConditionalDropSet(DropHelper.PostPolter()); + LeadingConditionRule postPolter = new LeadingConditionRule(DropHelper.If(() => DownedBossSystem.downedPolterghast)); aewMinionCondition.Add(postPolter); postPolter.Add(ModContent.ItemType(), 3); postPolter.Add(ModContent.ItemType(), 3); postPolter.Add(ModContent.ItemType(), 3); // Post-Leviathan: 6-8 Lumenyl (8-11 on Expert) - LeadingConditionRule postLevi = npcLoot.DefineConditionalDropSet(DropHelper.PostLevi()); + LeadingConditionRule postLevi = new LeadingConditionRule(DropHelper.If(() => DownedBossSystem.downedLeviathan)); aewMinionCondition.Add(postLevi); postLevi.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 6, 8, 8, 11)); diff --git a/NPCs/Abyss/GiantSquid.cs b/NPCs/Abyss/GiantSquid.cs index 837864953c..4b4373e7a6 100644 --- a/NPCs/Abyss/GiantSquid.cs +++ b/NPCs/Abyss/GiantSquid.cs @@ -256,7 +256,6 @@ namespace CalamityMod.NPCs.Abyss public override void ModifyNPCLoot(NPCLoot npcLoot) { var postLevi = npcLoot.DefineConditionalDropSet(DropHelper.PostLevi()); - postLevi.Add(ModContent.ItemType(), 2); postLevi.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 2, 4, 3, 6)); } diff --git a/NPCs/Abyss/GulperEelHead.cs b/NPCs/Abyss/GulperEelHead.cs index 113d4a54f1..64130aad7f 100644 --- a/NPCs/Abyss/GulperEelHead.cs +++ b/NPCs/Abyss/GulperEelHead.cs @@ -381,7 +381,6 @@ namespace CalamityMod.NPCs.Abyss public override void ModifyNPCLoot(NPCLoot npcLoot) { var postLevi = npcLoot.DefineConditionalDropSet(DropHelper.PostLevi()); - postLevi.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 2, 3, 3, 4)); postLevi.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 6, 8, 8, 11)); } diff --git a/NPCs/Abyss/Laserfish.cs b/NPCs/Abyss/Laserfish.cs index c5d30564ce..9671f0d830 100644 --- a/NPCs/Abyss/Laserfish.cs +++ b/NPCs/Abyss/Laserfish.cs @@ -127,7 +127,8 @@ namespace CalamityMod.NPCs.Abyss public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.AddIf(DropHelper.PostLevi(), ModContent.ItemType(), 2); + var postLevi = npcLoot.DefineConditionalDropSet(DropHelper.PostLevi()); + postLevi.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 1, 2, 2, 3)); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/Abyss/Viperfish.cs b/NPCs/Abyss/Viperfish.cs index d6a26f7d9d..6eda808819 100644 --- a/NPCs/Abyss/Viperfish.cs +++ b/NPCs/Abyss/Viperfish.cs @@ -159,7 +159,6 @@ namespace CalamityMod.NPCs.Abyss { var postLevi = npcLoot.DefineConditionalDropSet(DropHelper.PostLevi()); postLevi.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 1, 2, 2, 3)); - postLevi.Add(ModContent.ItemType(), 4); npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 10, 6)); } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index ef2f95d84b..98968ba1b2 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -11,6 +11,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Buffs.Summon.Whips; using CalamityMod.CalPlayer; using CalamityMod.Events; +using CalamityMod.ExtraTextures; using CalamityMod.Graphics.Metaballs; using CalamityMod.Graphics.Renderers.CalamityRenderers; using CalamityMod.Items.Accessories; @@ -57,11 +58,12 @@ using CalamityMod.Particles; using CalamityMod.Projectiles; using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Melee; -using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Ranged; +using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; using CalamityMod.Systems; +using CalamityMod.Systems.Collections; using CalamityMod.Tiles.FurnitureAuric; using CalamityMod.Tiles.Ores; using CalamityMod.UI; @@ -71,6 +73,7 @@ using CalamityMod.World; using Microsoft.CodeAnalysis; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using MonoMod.Utils; using Terraria; using Terraria.Audio; using Terraria.DataStructures; @@ -88,8 +91,7 @@ using Terraria.Utilities; using static Terraria.ModLoader.ModContent; using CalamityMod.ExtraTextures; using MonoMod.Utils; -using CalamityMod.Dusts; -using CalamityMod.Items; +using CalamityMod.Systems.Collections; namespace CalamityMod.NPCs { @@ -816,9 +818,9 @@ namespace CalamityMod.NPCs // Damage multiplier calcs. // Worms that are vulnerable to debuffs and Slime God slimes take reduced damage from vulnerabilities. #region Debuff System Multiplier Calculations - bool wormBoss = CalamityLists.DesertScourgeIDs.Contains(npc.type) || CalamityLists.EaterofWorldsIDs.Contains(npc.type) || CalamityLists.PerforatorIDs.Contains(npc.type) || - CalamityLists.AquaticScourgeIDs.Contains(npc.type) || CalamityLists.AstrumDeusIDs.Contains(npc.type) || CalamityLists.StormWeaverIDs.Contains(npc.type); - bool slimeGod = CalamityLists.SlimeGodIDs.Contains(npc.type); + bool wormBoss = DesertScourgeIDList.Includes(npc.type) || EaterOfWorldsIDList.Includes(npc.type) || PerforatorWormIDList.Includes(npc.type) || + AquaticScourgeIDList.Includes(npc.type) || AstrumDeusIDList.Includes(npc.type) || StormWeaverIDList.Includes(npc.type); + bool slimeGod = SlimeGodIDList.Includes(npc.type); bool slimed = npc.drippingSlime || npc.drippingSparkleSlime; double heatDamageMult = slimed ? ((wormBoss || slimeGod) ? VulnerableToDoTDamageMult_Worms_SlimeGod : VulnerableToDoTDamageMult) : BaseDoTDamageMult; @@ -1283,7 +1285,7 @@ namespace CalamityMod.NPCs { NPCID.BigMimicCorruption, 0.3f }, { NPCID.BigMimicCrimson, 0.3f }, { NPCID.BigMimicHallow, 0.3f }, - { NPCID.BigMimicJungle, 0.3f }, // unused vanilla enemy + { NPCID.BigMimicJungle, 0.3f }, { NPCID.BlueArmoredBones, 0.2f }, { NPCID.BlueArmoredBonesMace, 0.2f }, { NPCID.BlueArmoredBonesNoPants, 0.2f }, @@ -1526,7 +1528,7 @@ namespace CalamityMod.NPCs } // Aquatic Scourge sets kill time in AI, not here. - if (BossKillTimes.TryGetValue(npc.type, out int revKillTime) && !CalamityLists.AquaticScourgeIDs.Contains(npc.type)) + if (BossKillTimes.TryGetValue(npc.type, out int revKillTime) && !AquaticScourgeIDList.Includes(npc.type)) { KillTime = revKillTime; } @@ -1673,13 +1675,9 @@ namespace CalamityMod.NPCs #region Boss Rush Stat Changes private void BossRushStatChanges(NPC npc, Mod mod) { - foreach (KeyValuePair BossRushHPChange in CalamityLists.BossRushHPChanges) + if (BossRushHPChangeDict.TryGet(npc.type, out var newHP)) { - if (npc.type == BossRushHPChange.Key) - { - npc.lifeMax = BossRushHPChange.Value; - break; - } + npc.lifeMax = newHP; } } #endregion @@ -1687,13 +1685,9 @@ namespace CalamityMod.NPCs #region Boss Value Changes private void BossValueChanges(NPC npc) { - foreach (KeyValuePair BossValue in CalamityLists.BossValues) + if (BossValueDict.TryGet(npc.type, out var value)) { - if (npc.type == BossValue.Key) - { - npc.value = BossValue.Value; - break; - } + npc.value = value; } } #endregion @@ -1701,7 +1695,7 @@ namespace CalamityMod.NPCs #region Revengeance and Death Mode Stat Changes private void RevDeathStatChanges(NPC npc, Mod mod) { - if (CalamityLists.DeathModeSplittingWormIDs.Contains(npc.type)) + if (DeathModeSplittingWormList.Includes(npc.type)) { if (CalamityWorld.death) npc.lifeMax = (int)Math.Round(npc.lifeMax * 0.15); @@ -1755,7 +1749,7 @@ namespace CalamityMod.NPCs npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.2); npc.npcSlots = 32f; } - else if (CalamityLists.DestroyerIDs.Contains(npc.type)) + else if (DestroyerIDList.Includes(npc.type)) { npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.25); npc.scale *= Main.zenithWorld ? 2f : CalamityWorld.death ? 1.4f : 1.2f; @@ -1836,7 +1830,7 @@ namespace CalamityMod.NPCs { npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.4); } - else if (CalamityLists.EaterofWorldsIDs.Contains(npc.type)) + else if (EaterOfWorldsIDList.Includes(npc.type)) { npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.2); @@ -1957,6 +1951,7 @@ namespace CalamityMod.NPCs case NPCID.BlackSlime: case NPCID.BlueSlime: case NPCID.CorruptSlime: + case NPCID.GoldenSlime: case NPCID.GreenSlime: case NPCID.IlluminantSlime: case NPCID.JungleSlime: @@ -1965,6 +1960,7 @@ namespace CalamityMod.NPCs case NPCID.PurpleSlime: case NPCID.RainbowSlime: case NPCID.RedSlime: + case NPCID.ShimmerSlime: case NPCID.Slimeling: case NPCID.SlimeMasked: case NPCID.Slimer: @@ -2146,6 +2142,7 @@ namespace CalamityMod.NPCs // Organic enemies. case NPCID.HallowBoss: + case NPCID.Dandelion: case NPCID.Gnome: case NPCID.BloodEelHead: case NPCID.BloodEelBody: @@ -2226,6 +2223,7 @@ namespace CalamityMod.NPCs case NPCID.ArmedZombiePincussion: case NPCID.ArmedZombieSwamp: case NPCID.ArmedZombieTwiggy: + case NPCID.ArmedTorchZombie: case NPCID.BaldZombie: case NPCID.BigBaldZombie: case NPCID.BigFemaleZombie: @@ -2246,6 +2244,7 @@ namespace CalamityMod.NPCs case NPCID.SmallTwiggyZombie: case NPCID.SmallZombie: case NPCID.SwampZombie: + case NPCID.TorchZombie: case NPCID.TwiggyZombie: case NPCID.Zombie: case NPCID.ZombieDoctor: @@ -2491,6 +2490,7 @@ namespace CalamityMod.NPCs case NPCID.IceSlime: case NPCID.SpikedIceSlime: case NPCID.IceGolem: + case NPCID.IceMimic: case NPCID.MisterStabby: case NPCID.SnowBalla: case NPCID.SnowmanGangsta: @@ -2582,7 +2582,7 @@ namespace CalamityMod.NPCs npc.GetNPCDamage(); npc.defDamage = npc.damage; } - if ((npc.boss && npc.type != NPCID.MartianSaucerCore) || CalamityLists.bossHPScaleList.Contains(npc.type)) + if ((npc.boss && npc.type != NPCID.MartianSaucerCore) || BossHPScalingList.Includes(npc.type)) { double HPBoost = CalamityServerConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)Math.Round(npc.lifeMax * HPBoost); @@ -2791,7 +2791,7 @@ namespace CalamityMod.NPCs { if (!NPC.downedMechBossAny) { - if (CalamityLists.DestroyerIDs.Contains(npc.type) || npc.type == NPCID.Probe || CalamityLists.SkeletronPrimeIDs.Contains(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == NPCType()) + if (DestroyerIDList.Includes(npc.type) || npc.type == NPCID.Probe || SkeletronPrimeIDList.Includes(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == NPCType()) { double multiplier = Main.expertMode ? EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert : EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Classic; npc.lifeMax = (int)Math.Round(npc.lifeMax * multiplier); @@ -2801,7 +2801,7 @@ namespace CalamityMod.NPCs } else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) { - if (CalamityLists.DestroyerIDs.Contains(npc.type) || npc.type == NPCID.Probe || CalamityLists.SkeletronPrimeIDs.Contains(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == NPCType()) + if (DestroyerIDList.Includes(npc.type) || npc.type == NPCID.Probe || SkeletronPrimeIDList.Includes(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == NPCType()) { double multiplier = Main.expertMode ? EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert : EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Classic; npc.lifeMax = (int)Math.Round(npc.lifeMax * multiplier); @@ -2828,7 +2828,7 @@ namespace CalamityMod.NPCs } } - if (Main.hardMode && CalamityLists.HardmodeNPCNerfList.Contains(npc.type)) + if (Main.hardMode && HardmodeNPCNerfList.Includes(npc.type)) { npc.damage = (int)Math.Round(npc.damage * 0.75); npc.defDamage = npc.damage; @@ -2836,21 +2836,21 @@ namespace CalamityMod.NPCs if (DownedBossSystem.downedDoG) { - if (CalamityLists.pumpkinMoonBuffList.Contains(npc.type)) + if (PumpkinMoonBuffList.Includes(npc.type)) { npc.lifeMax = (int)Math.Round(npc.lifeMax * 3.5); npc.damage += 30; npc.life = npc.lifeMax; npc.defDamage = npc.damage; } - else if (CalamityLists.frostMoonBuffList.Contains(npc.type)) + else if (FrostMoonBuffList.Includes(npc.type)) { npc.lifeMax = (int)Math.Round(npc.lifeMax * 2.5); npc.damage += 30; npc.life = npc.lifeMax; npc.defDamage = npc.damage; } - else if (CalamityLists.eclipseBuffList.Contains(npc.type)) + else if (EclipseBuffList.Includes(npc.type)) { npc.lifeMax = (int)Math.Round(npc.lifeMax * 5D); npc.damage += 30; @@ -2861,7 +2861,7 @@ namespace CalamityMod.NPCs if (NPC.downedMoonlord) { - if (CalamityLists.dungeonEnemyBuffList.Contains(npc.type)) + if (BuffedDungeonEnemiesList.Includes(npc.type)) { npc.lifeMax = (int)Math.Round(npc.lifeMax * 2.5); npc.damage += 30; @@ -3532,7 +3532,7 @@ namespace CalamityMod.NPCs return; bool countsAsBoss = npc.boss || NPCID.Sets.ShouldBeCountedAsBoss[npc.type]; - bool scalesLikeBoss = countsAsBoss || CalamityLists.bossHPScaleList.Contains(npc.type); + bool scalesLikeBoss = countsAsBoss || BossHPScalingList.List.Contains(npc.type); bool isCalamityNPC = npc.ModNPC != null && npc.ModNPC.Mod == CalamityMod.Instance; // All bosses, NPCs that are supposed to scale like bosses, and Calamity NPCs follow these rules. @@ -3608,11 +3608,11 @@ namespace CalamityMod.NPCs ApplyDR(npc, ref modifiers); // Damage reduction on spawn for certain worm bosses. - if (CalamityLists.EaterofWorldsIDs.Contains(npc.type) && newAI[1] < EaterOfWorldsAI.DRIncreaseTime) + if (EaterOfWorldsIDList.Includes(npc.type) && newAI[1] < EaterOfWorldsAI.DRIncreaseTime) modifiers.FinalDamage *= 1f - (float)Math.Sqrt(MathHelper.Lerp(BossRushEvent.BossRushActive ? 0.6f : 0f, 0.99f, MathHelper.Clamp(1f - newAI[1] / EaterOfWorldsAI.DRIncreaseTime, 0f, 1f))); - if (CalamityLists.DestroyerIDs.Contains(npc.type) && newAI[1] < DestroyerAI.DRIncreaseTime) + if (DestroyerIDList.Includes(npc.type) && newAI[1] < DestroyerAI.DRIncreaseTime) modifiers.FinalDamage *= 1f - (float)Math.Sqrt(MathHelper.Lerp(0f, 0.99f, MathHelper.Clamp(1f - newAI[1] / DestroyerAI.DRIncreaseTime, 0f, 1f))); - if (CalamityLists.AstrumDeusIDs.Contains(npc.type)) + if (AstrumDeusIDList.Includes(npc.type)) { float drTime = newAI[0] != 0f ? 300f : 600f; if (newAI[1] < drTime) @@ -3826,7 +3826,7 @@ namespace CalamityMod.NPCs } // Setting this in SetDefaults will disable expert mode scaling, so put it here instead - if (CalamityLists.ZeroContactDamageNPCList.Contains(npc.type) && (npc.type != NPCID.RuneWizard || !Main.zenithWorld)) + if (ZeroContactDamageNPCList.Includes(npc.type) && (npc.type != NPCID.RuneWizard || !Main.zenithWorld)) npc.damage = 0; // Don't do damage for 42 frames after spawning in @@ -6139,12 +6139,13 @@ namespace CalamityMod.NPCs modifiers.SourceDamage *= 0.1f; // True melee resists - 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() || npc.type == NPCType() || npc.type == NPCType()) + if (DesertScourgeIDList.Includes(npc.type) || EaterOfWorldsIDList.Includes(npc.type) || npc.type == NPCID.Creeper || + PerforatorWormIDList.Includes(npc.type) || AquaticScourgeIDList.Includes(npc.type) || DestroyerIDList.Includes(npc.type) || + AstrumDeusIDList.Includes(npc.type) || StormWeaverIDList.Includes(npc.type) || ThanatosIDList.Includes(npc.type) || + npc.type == NPCType() || npc.type == NPCType() || AresIDList.Includes(npc.type) || npc.type == NPCType() || + npc.type == NPCType()) { - float damageMult = CalamityLists.ThanatosIDs.Contains(npc.type) ? 0.35f : (CalamityLists.DesertScourgeIDs.Contains(npc.type) || npc.type == NPCType()) ? 0.75f : 0.5f; + float damageMult = ThanatosIDList.Includes(npc.type) ? 0.35f : (DesertScourgeIDList.Includes(npc.type) || npc.type == NPCType()) ? 0.75f : 0.5f; if (item.CountsAsClass() && item.type != ItemType()) modifiers.SourceDamage *= damageMult; } @@ -6152,7 +6153,7 @@ namespace CalamityMod.NPCs #endregion #region Modify Hit By Projectile - public static bool DisableMultWhipTag = false; + public static bool DisableMultWhipTag = false; //this bool does nothing on this branch, its just here so that CalTestHelpers doesn't crash searching for it //if you want to mess with this, please do so in the summoner branch - Shade public override void ModifyHitByProjectile(NPC npc, Projectile projectile, ref NPC.HitModifiers modifiers) @@ -6249,7 +6250,7 @@ namespace CalamityMod.NPCs if (bullseye.ai[2] == 0f) { - bullseye.timeLeft = DaawnlightSpiritOrigin.BullseyeHitLifetime; + bullseye.timeLeft = DaawnlightSpiritOrigin.BullseyeHitLifetime; bullseye.ai[2] = 1f; } @@ -6257,7 +6258,7 @@ namespace CalamityMod.NPCs { int randomStarAmount = Main.rand.Next(3, 6); float randomCircleRotation = Main.rand.NextFloat(MathHelper.TwoPi); - for (int i = 0 ; i < randomStarAmount ; i++) + for (int i = 0; i < randomStarAmount; i++) { Particle fancyStars = new FancyStars( bullseye.Center, @@ -6268,7 +6269,7 @@ namespace CalamityMod.NPCs 55, new Color(Main.rand.Next(256), Main.rand.Next(256), Main.rand.Next(256)) * 1.2f); GeneralParticleHandler.SpawnParticle(fancyStars); - } + } } bullseye.netUpdate = true; @@ -6304,19 +6305,19 @@ namespace CalamityMod.NPCs // Apply balancing resists/vulnerabilities. BalancingChangesManager.ApplyFromProjectile(npc, ref modifiers, projectile); - if (CalamityLists.GrenadeResistIDs.Contains(projectile.type)) + if (GrenadeResistIDList.Includes(projectile.type)) { // Eater of Worlds has a vanilla resist in Expert+, this gives it to him in Normal mode // Note that Calamity reduces the vanilla resist from 80% to 60% - bool hasResist = CalamityLists.EaterofWorldsIDs.Contains(npc.type) && !Main.expertMode; + bool hasResist = EaterOfWorldsIDList.Includes(npc.type) && !Main.expertMode; // Add a resist for BoC's creepers and Prehardmode worm bosses - if (npc.type == NPCID.Creeper || CalamityLists.DesertScourgeIDs.Contains(npc.type) || CalamityLists.PerforatorIDs.Contains(npc.type)) + if (npc.type == NPCID.Creeper || DesertScourgeIDList.Includes(npc.type) || PerforatorWormIDList.Includes(npc.type)) hasResist = true; if (hasResist) modifiers.SourceDamage *= 0.4f; } - if (CalamityLists.pierceResistList.Contains(npc.type)) + if (PierceResistList.Includes(npc.type)) PierceResistGlobal(projectile, npc, ref modifiers); if (modPlayer.camper && !player.StandingStill()) @@ -6334,11 +6335,11 @@ namespace CalamityMod.NPCs private void PierceResistGlobal(Projectile projectile, NPC npc, ref NPC.HitModifiers modifiers) { // Thanatos segments do not trigger pierce resistance if they are closed - if (CalamityLists.ThanatosIDs.Contains(npc.type) && unbreakableDR) + if (ThanatosIDList.Includes(npc.type) && unbreakableDR) return; // Isolates projectiles which ignore pierce resist only on Leviathan and Astrum Aureus - if ((npc.type == NPCType() || npc.type == NPCType()) && CalamityLists.pierceResistExceptionLeviAureusList.Contains(projectile.type)) + if ((npc.type == NPCType() || npc.type == NPCType()) && PierceResistExceptionLeviAureusList.Includes(projectile.type)) return; float damageReduction = projectile.Calamity().timesPierced * CalamityGlobalProjectile.PierceResistHarshness; @@ -6347,7 +6348,7 @@ namespace CalamityMod.NPCs modifiers.FinalDamage *= 1f - damageReduction; - if ((projectile.penetrate > 1 || projectile.penetrate == -1) && !CalamityLists.pierceResistExceptionList.Contains(projectile.type) && !projectile.CountsAsClass() && projectile.aiStyle != 15 && projectile.aiStyle != 39 && projectile.aiStyle != 99) + if ((projectile.penetrate > 1 || projectile.penetrate == -1) && !PierceResistExceptionList.Includes(projectile.type) && !projectile.CountsAsClass() && projectile.aiStyle != 15 && projectile.aiStyle != 39 && projectile.aiStyle != 99) projectile.Calamity().timesPierced++; } @@ -7275,7 +7276,7 @@ namespace CalamityMod.NPCs if (npc.HasBuff()) return new Color(200, 50, 50, 255 - npc.alpha); - if (npc.Calamity().kamiFlu > 0 && !CalamityLists.kamiDebuffColorImmuneList.Contains(npc.type)) + if (npc.Calamity().kamiFlu > 0 && !KamiDebuffColorImmuneList.Includes(npc.type)) return new Color(51, 197, 108, 255 - npc.alpha); if (npc.type == NPCID.VileSpit || npc.type == NPCID.VileSpitEaterOfWorlds) @@ -7362,7 +7363,7 @@ namespace CalamityMod.NPCs } if (npc.type != NPCID.BrainofCthulhu && (npc.type != NPCID.DukeFishron || npc.ai[0] <= 9f) && npc.active) { - if (CalamityClientConfig.Instance.DebuffDisplay && (npc.boss || BossHealthBarManager.MinibossHPBarList.Contains(npc.type) || BossHealthBarManager.OneToMany.ContainsKey(npc.type) || CalamityLists.needsDebuffIconDisplayList.Contains(npc.type))) + if (CalamityClientConfig.Instance.DebuffDisplay && (npc.boss || BossHealthBarManager.MinibossHPBarList.Contains(npc.type) || BossHealthBarManager.OneToMany.ContainsKey(npc.type) || NeedsDebuffIconDisplayList.Includes(npc.type))) { List currentDebuffs = new List() { }; @@ -7485,7 +7486,7 @@ namespace CalamityMod.NPCs if (CalamityWorld.revenge || BossRushEvent.BossRushActive) { - if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType() || CalamityLists.DestroyerIDs.Contains(npc.type)) + if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType() || DestroyerIDList.Includes(npc.type)) return false; } @@ -7752,7 +7753,7 @@ namespace CalamityMod.NPCs } // Destroyer drawing and laser telegraphs - else if (CalamityLists.DestroyerIDs.Contains(npc.type) && !npc.IsABestiaryIconDummy) + else if (DestroyerIDList.Includes(npc.type) && !npc.IsABestiaryIconDummy) { Texture2D npcTexture = TextureAssets.Npc[npc.type].Value; int frameHeight = npcTexture.Height / Main.npcFrameCount[npc.type]; @@ -8726,7 +8727,7 @@ namespace CalamityMod.NPCs { if (!GetDownedBossVariable(npc.type)) { - CalamityLists.bossTypes.TryGetValue(npc.type, out int newBossTypeJustDowned); + BossTypeDict.TryGet(npc.type, out int newBossTypeJustDowned); for (int i = 0; i < Main.maxPlayers; i++) { @@ -8769,13 +8770,13 @@ namespace CalamityMod.NPCs #region Should Affect NPC public static bool ShouldAffectNPC(NPC target) { - if (CalamityLists.EaterofWorldsIDs.Contains(target.type) || CalamityLists.DestroyerIDs.Contains(target.type)) + if (EaterOfWorldsIDList.Includes(target.type) || DestroyerIDList.Includes(target.type)) return false; if (target.damage > 0 && !target.boss && !target.friendly && !target.dontTakeDamage && target.type != NPCID.Creeper && target.type != NPCType() && target.type != NPCID.MourningWood && target.type != NPCID.Everscream && target.type != NPCID.SantaNK1 && target.type != NPCType() && target.type != NPCType() && target.type != NPCType() && target.type != NPCType() && target.type != NPCID.GolemFistLeft && target.type != NPCID.GolemFistRight && - target.type != NPCType() && target.type != NPCType() && target.type != NPCID.DD2Betsy && !CalamityLists.enemyImmunityList.Contains(target.type) && !AcidRainEvent.AllMinibosses.Contains(target.type)) + target.type != NPCType() && target.type != NPCType() && target.type != NPCID.DD2Betsy && !EnemyImmunitiesList.Includes(target.type) && !AcidRainEvent.AllMinibosses.Contains(target.type)) { return true; } diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 0394fb464f..486a3babb9 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -19,10 +19,8 @@ using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; using CalamityMod.Items.Weapons.Typeless; -using CalamityMod.NPCs.AcidRain; -using CalamityMod.NPCs.Astral; -using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.TownNPCs; +using CalamityMod.Systems.Collections; using CalamityMod.Tiles.Ores; using CalamityMod.World; using CalamityMod.World.Planets; @@ -1708,17 +1706,17 @@ DukeEditFailed: // All Moss Hornets // Needler @ 4% Normal, 6.67% Expert+ - if (CalamityLists.mossHornetList.Contains(npc.type)) + if (MossHornetIDList.Includes(npc.type)) npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 25, 15)); // All Skeletons // Ancient Bone Dust @ 20% Normal, 33.33% Expert+ - if (CalamityLists.skeletonList.Contains(npc.type)) + if (SkeletonIDList.Includes(npc.type)) npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 5, 3)); // All Hardmode Dungeon Enemies // Ectoplasm @ 20% - if (CalamityLists.dungeonEnemyBuffList.Contains(npc.type)) + if (BuffedDungeonEnemiesList.Includes(npc.type)) npcLoot.Add(ItemID.Ectoplasm, 5); #endregion @@ -1786,7 +1784,7 @@ DukeEditFailed: public override bool PreKill(NPC npc) { // Stop Eater of Worlds segments and Brain of Cthulhu Creepers from dropping partial loot in Rev+ - if (CalamityWorld.revenge && (CalamityLists.EaterofWorldsIDs.Contains(npc.type) || npc.type == NPCID.Creeper)) + if (CalamityWorld.revenge && (EaterOfWorldsIDList.Includes(npc.type) || npc.type == NPCID.Creeper)) DropHelper.BlockDrops(ItemID.DemoniteOre, ItemID.ShadowScale, ItemID.CrimtaneOre, ItemID.TissueSample); // Boss Rush pre-kill effects diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index b9e19f4789..37775253f2 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -20,6 +20,7 @@ using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.NPCs.TownNPCs; using CalamityMod.Projectiles.Rogue; +using CalamityMod.Systems.Collections; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -1027,7 +1028,7 @@ namespace CalamityMod.NPCs public void BoundNPCSafety(Mod mod, NPC npc) { // Make Bound Town NPCs take no damage - if (CalamityLists.BoundNPCIDs.Contains(npc.type)) + if (BoundNPCIDList.Includes(npc.type)) { npc.dontTakeDamageFromHostiles = true; } diff --git a/NPCs/Crags/CalamityEye.cs b/NPCs/Crags/CalamityEye.cs index 3a5430ba14..0ed1511b15 100644 --- a/NPCs/Crags/CalamityEye.cs +++ b/NPCs/Crags/CalamityEye.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.Crags NPC.width = 30; NPC.height = 30; NPC.defense = 12; - NPC.lifeMax = 80; + NPC.lifeMax = 180; NPC.knockBackResist = 0.75f; AnimationType = NPCID.DemonEye; NPC.value = Item.buyPrice(0, 0, 5, 0); diff --git a/NPCs/NormalNPCs/ImpiousImmolator.cs b/NPCs/NormalNPCs/ImpiousImmolator.cs index 4d87a1dcc2..ab77e707d2 100644 --- a/NPCs/NormalNPCs/ImpiousImmolator.cs +++ b/NPCs/NormalNPCs/ImpiousImmolator.cs @@ -255,7 +255,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.PlayerSafe || !NPC.downedMoonlord || spawnInfo.Player.Calamity().ZoneCalamity) + if (spawnInfo.PlayerSafe || !NPC.downedMoonlord || spawnInfo.Player.Calamity().ZoneCalamity || Main.pumpkinMoon || Main.snowMoon || Main.eclipse) { return 0f; } diff --git a/NPCs/NormalNPCs/ProfanedEnergyBody.cs b/NPCs/NormalNPCs/ProfanedEnergyBody.cs index d5f8bfb1e1..1f848d4090 100644 --- a/NPCs/NormalNPCs/ProfanedEnergyBody.cs +++ b/NPCs/NormalNPCs/ProfanedEnergyBody.cs @@ -80,7 +80,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.PlayerSafe || !NPC.downedMoonlord || spawnInfo.Player.Calamity().ZoneCalamity || (!spawnInfo.Player.ZoneUnderworldHeight && !spawnInfo.Player.ZoneHallow)) + if (spawnInfo.PlayerSafe || !NPC.downedMoonlord || spawnInfo.Player.Calamity().ZoneCalamity || (!spawnInfo.Player.ZoneUnderworldHeight && !spawnInfo.Player.ZoneHallow) || Main.pumpkinMoon || Main.snowMoon || Main.eclipse) 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/ScornEater.cs b/NPCs/NormalNPCs/ScornEater.cs index 0e7eb4dfae..6e34f798d6 100644 --- a/NPCs/NormalNPCs/ScornEater.cs +++ b/NPCs/NormalNPCs/ScornEater.cs @@ -189,7 +189,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.PlayerSafe || !NPC.downedMoonlord || spawnInfo.Player.Calamity().ZoneCalamity) + if (spawnInfo.PlayerSafe || !NPC.downedMoonlord || spawnInfo.Player.Calamity().ZoneCalamity || Main.pumpkinMoon || Main.snowMoon || Main.eclipse) { return 0f; } diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs index 46a69cacc6..6314210647 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs @@ -1462,10 +1462,8 @@ namespace CalamityMod.NPCs.PrimordialWyrm npcLoot.Add(ModContent.ItemType()); npcLoot.Add(ModContent.ItemType(), 1, 80, 100); npcLoot.Add(ModContent.ItemType(), ThankYouPainting.DropInt); - - var postLevi = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedLeviathan); - postLevi.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 50, 108, 65, 135)); - postLevi.Add(ItemID.Ectoplasm, 1, 21, 32); + npcLoot.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 50, 108, 65, 135)); + npcLoot.Add(ItemID.Ectoplasm, 1, 21, 32); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/SunkenSea/SunkenSeaNPC.cs b/NPCs/SunkenSea/SunkenSeaNPC.cs index e72a35eaf9..7798680cd2 100644 --- a/NPCs/SunkenSea/SunkenSeaNPC.cs +++ b/NPCs/SunkenSea/SunkenSeaNPC.cs @@ -4,13 +4,13 @@ using System.IO; using System.Linq; using CalamityMod.Enums; using CalamityMod.Particles; +using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; -using static CalamityMod.CalamityLists; using static Terraria.Utilities.NPCUtils; namespace CalamityMod.NPCs.SunkenSea @@ -204,12 +204,19 @@ namespace CalamityMod.NPCs.SunkenSea List biomeTypes = []; foreach (var flag in Enum.GetValues()) { - if (flag == SunkenSeaBiomeFlags.None || !BiomeDesignation.HasFlag(flag)) + if (flag == SunkenSeaBiomeFlags.None) continue; - BiomeSpawnConditions.Add(SunkenSeaBiomeCorrespondentValues[flag].SpawnCondition); - if (flag == SunkenSeaBiomeFlags.UndergroundDesert) + + if (!BiomeDesignation.HasFlag(flag)) continue; - biomeTypes.Add(SunkenSeaBiomeCorrespondentValues[flag].BiomeType); + + if (!SunkenSeaBiomeCorrespondentDict.TryGet(flag, out var spawnCondition, out var biomeType)) + continue; + + // Apply Conditions and Biome Types + BiomeSpawnConditions.Add(spawnCondition); + if (flag != SunkenSeaBiomeFlags.UndergroundDesert) + biomeTypes.Add(biomeType); } SpawnModBiomes = [.. biomeTypes]; } diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 70b5837865..5684ebbbbc 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -45,6 +45,7 @@ using CalamityMod.Projectiles.Ranged; using Steamworks; using CalamityMod.Particles; using Terraria.Utilities.Terraria.Utilities; +using CalamityMod.Systems.Collections; namespace CalamityMod.NPCs.SupremeCalamitas { @@ -1612,7 +1613,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { int buffID = NPC.buffType[l]; - bool shouldHalveDuration = CalamityLists.debuffList.Contains(buffID); + bool shouldHalveDuration = DebuffsList.Includes(buffID); if (shouldHalveDuration && NPC.buffTime[l] > 4) NPC.buffTime[l] = 4; diff --git a/NPCs/TownNPCs/FAP.cs b/NPCs/TownNPCs/FAP.cs index 81104f2006..b7a01b79ce 100644 --- a/NPCs/TownNPCs/FAP.cs +++ b/NPCs/TownNPCs/FAP.cs @@ -7,6 +7,7 @@ using CalamityMod.Items.Potions.Alcohol; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Summon; +using CalamityMod.Systems.Collections; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -841,16 +842,7 @@ namespace CalamityMod.NPCs.TownNPCs else if (deaths > 100) text += " " + this.GetLocalizedValue("Death100"); - IList donorList = new List(CalamityLists.donatorList); - int maxDonorsListed = 25; - string[] donors = new string[maxDonorsListed]; - for (int i = 0; i < maxDonorsListed; i++) - { - donors[i] = donorList[Main.rand.Next(donorList.Count)]; - donorList.Remove(donors[i]); - } - - text += ("\n\n" + this.GetLocalization("DonorShoutout").Format(donors)); + text += "\n\n" + this.GetLocalization("DonorShoutout").Format(DonatorsNameList.GetRandomDonors()); return text; } diff --git a/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs b/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs index 3181a98c18..06eb494b75 100644 --- a/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles Projectile.tileCollide = false; Projectile.penetrate = -1; Projectile.noEnchantmentVisuals = true; + Projectile.ContinuouslyUpdateDamageStats = true; } public override void OnSpawn(IEntitySource source) diff --git a/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs b/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs index e5af9a2e09..2c643a030f 100644 --- a/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs @@ -150,6 +150,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles Projectile.width = Projectile.height = ItemTexture is null ? 1 : ItemTexture.Width(); Projectile.tileCollide = false; Projectile.netImportant = true; + Projectile.ContinuouslyUpdateDamageStats = true; } public override void OnSpawn(IEntitySource source) => OffsetLengthFromArm = MaxOffsetLengthFromArm; diff --git a/Projectiles/Boss/BrimstoneMonster.cs b/Projectiles/Boss/BrimstoneMonster.cs index bf47477ee5..143bd0df9f 100644 --- a/Projectiles/Boss/BrimstoneMonster.cs +++ b/Projectiles/Boss/BrimstoneMonster.cs @@ -7,6 +7,7 @@ using CalamityMod.Events; using CalamityMod.NPCs; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.Particles; +using CalamityMod.Systems.Collections; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -350,7 +351,7 @@ namespace CalamityMod.Projectiles.Boss for (int l = 0; l < Player.MaxBuffs; l++) { int buffType = target.buffType[l]; - if (target.buffTime[l] > 0 && CalamityLists.amalgamBuffList.Contains(buffType)) + if (target.buffTime[l] > 0 && AmalgamBuffList.Includes(buffType)) { target.DelBuff(l); l--; diff --git a/Projectiles/Boss/RavagerBlaster.cs b/Projectiles/Boss/RavagerBlaster.cs index a8b5432bab..1c56038a6d 100644 --- a/Projectiles/Boss/RavagerBlaster.cs +++ b/Projectiles/Boss/RavagerBlaster.cs @@ -26,6 +26,8 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { + Lighting.AddLight(Projectile.Center, 1f, 1f, 1f); + //ai0 = timer, ai1 = laser size if (Projectile.ai[0] < 90f) //Before the laser { @@ -65,5 +67,11 @@ namespace CalamityMod.Projectiles.Boss // Does no contact damage public override bool? CanDamage() => false; + + public override bool PreDraw(ref Color lightColor) + { + CalamityUtils.DrawProjectileWithBackglow(Projectile, Color.LightGray, lightColor, 5f); + return false; + } } } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index b3d8f8a601..7b62fead99 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -13,11 +13,9 @@ using CalamityMod.ExtraTextures; using CalamityMod.Items.Accessories; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.NPCs; -using CalamityMod.NPCs.Cryogen; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.PlagueEnemies; using CalamityMod.Particles; -using CalamityMod.Projectiles.BaseProjectiles; using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Ranged; @@ -25,6 +23,7 @@ using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; using CalamityMod.Projectiles.VanillaProjectileOverrides; +using CalamityMod.Systems.Collections; using CalamityMod.Tiles.Abyss; using CalamityMod.Tiles.Astral; using CalamityMod.Tiles.AstralDesert; @@ -194,7 +193,7 @@ namespace CalamityMod.Projectiles { // TODO -- it would be nice to move frame one hacks here, but this runs in the middle of NewProjectile // which is way too early, the projectile's own initialization isn't even done yet - + CreatedByPlayerDash = source is ProjectileSource_PlayerDashHit; IEntitySource sourceItem = source as EntitySource_ItemUse_WithAmmo; @@ -3440,7 +3439,7 @@ namespace CalamityMod.Projectiles if (NPC.downedMoonlord) { - if (CalamityLists.dungeonProjectileBuffList.Contains(projectile.type)) + if (BuffedDungeonProjectilesList.Includes(projectile.type)) { // ai[1] being set to 1 is done only by the Calamity usages of these projectiles in Skeletron and Skeletron Prime boss fights bool isSkeletronBossProjectile = (projectile.type == ProjectileID.RocketSkeleton || projectile.type == ProjectileID.Shadowflames) && projectile.ai[1] > 0f; @@ -3455,7 +3454,7 @@ namespace CalamityMod.Projectiles if (DownedBossSystem.downedDoG && (Main.pumpkinMoon || Main.snowMoon || Main.eclipse)) { - if (CalamityLists.eventProjectileBuffList.Contains(projectile.type)) + if (EventProjectileBuffList.Includes(projectile.type)) projectile.damage += 15; } @@ -3888,7 +3887,7 @@ namespace CalamityMod.Projectiles } // Adds Elemental Gauntlet dust to melee projectiles to mirror Fire Gauntlet's behavior. - if (modPlayer.eGauntlet && modPlayer.eGauntletVisuals && projectile.CountsAsClass() ) + if (modPlayer.eGauntlet && modPlayer.eGauntletVisuals && projectile.CountsAsClass()) { if (Main.rand.NextBool(3)) { @@ -4136,7 +4135,7 @@ namespace CalamityMod.Projectiles bool isPlayerNear = WorldGen.PlayerLOS(i, j); bool success = WorldGen.GrowPalmTree(i, j); if (success && isPlayerNear) - WorldGen.TreeGrowFXCheck(i, j); + WorldGen.TreeGrowFXCheck(i, j); } else if (tile.TileType == ModContent.TileType()) { diff --git a/Projectiles/Healing/AbsorberAura.cs b/Projectiles/Healing/AbsorberAura.cs index a4f44ec2f3..794e2bf4f1 100644 --- a/Projectiles/Healing/AbsorberAura.cs +++ b/Projectiles/Healing/AbsorberAura.cs @@ -6,6 +6,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Items.Accessories; using CalamityMod.Particles; +using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -58,8 +59,8 @@ namespace CalamityMod.Projectiles.Healing CleansingEffect = 1; for (int l = 0; l < Player.MaxBuffs; l++) { - int hasBuff = player.buffType[l]; - if (player.buffTime[l] > 2 && CalamityLists.debuffList.Contains(hasBuff)) + int buffID = player.buffType[l]; + if (player.buffTime[l] > 2 && DebuffsList.Includes(buffID)) { player.buffTime[l] *= 0; } diff --git a/Projectiles/Healing/BlueJellyAura.cs b/Projectiles/Healing/BlueJellyAura.cs index 1725c2fc9a..1282ea8349 100644 --- a/Projectiles/Healing/BlueJellyAura.cs +++ b/Projectiles/Healing/BlueJellyAura.cs @@ -6,6 +6,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Items.Accessories; using CalamityMod.Particles; +using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -56,8 +57,8 @@ namespace CalamityMod.Projectiles.Healing CleansingEffect = 1; for (int l = 0; l < Player.MaxBuffs; l++) { - int hasBuff = player.buffType[l]; - if (player.buffTime[l] > 2 && CalamityLists.debuffList.Contains(hasBuff)) + int buffID = player.buffType[l]; + if (player.buffTime[l] > 2 && DebuffsList.Includes(buffID)) { player.buffTime[l] *= 0; } diff --git a/Projectiles/Healing/GreenJellyAura.cs b/Projectiles/Healing/GreenJellyAura.cs index 5ae975ea63..3b41df93d3 100644 --- a/Projectiles/Healing/GreenJellyAura.cs +++ b/Projectiles/Healing/GreenJellyAura.cs @@ -6,6 +6,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Items.Accessories; using CalamityMod.Particles; +using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -58,8 +59,8 @@ namespace CalamityMod.Projectiles.Healing CleansingEffect = 1; for (int l = 0; l < Player.MaxBuffs; l++) { - int hasBuff = player.buffType[l]; - if (player.buffTime[l] > 2 && CalamityLists.debuffList.Contains(hasBuff)) + int buffID = player.buffType[l]; + if (player.buffTime[l] > 2 && DebuffsList.Includes(buffID)) { player.buffTime[l] *= 0; } diff --git a/Projectiles/Melee/EntropicFlechette.cs b/Projectiles/Melee/EntropicFlechette.cs index 1f9ddeab73..4c7c836849 100644 --- a/Projectiles/Melee/EntropicFlechette.cs +++ b/Projectiles/Melee/EntropicFlechette.cs @@ -37,6 +37,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.timeLeft = 600; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; + Projectile.ArmorPenetration = 15; } public override void AI() @@ -57,7 +58,7 @@ namespace CalamityMod.Projectiles.Melee sizeVariance = Utils.GetLerpValue(-5, 60, Projectile.timeLeft, true); - if (time > 5) + if (time > 65) { Particle spark2 = new CustomSpark(Projectile.Center, -Projectile.velocity * 0.4f, "CalamityMod/Particles/GlowSpark2", false, (int)MathHelper.Clamp(9 * sizeVariance, 3, 9), MathHelper.Clamp(0.03f * sizeVariance, 0.01f, 0.03f), Color.Black * 0.6f, new Vector2(1.2f, 0.5f), false, shrinkSpeed: 1.1f); GeneralParticleHandler.SpawnParticle(spark2); @@ -69,9 +70,10 @@ namespace CalamityMod.Projectiles.Melee dust.velocity = -Projectile.velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.1f, 0.7f); dust.noGravity = true; dust.color = Color.LightGreen; + dust.noLightEmittence = true; } } - if (time >= 5) + if (time >= 35) { if (Projectile.numHits < 1) { @@ -94,7 +96,7 @@ namespace CalamityMod.Projectiles.Melee { Vector2 moveToEnemy = (target.Center - Projectile.Center).SafeNormalize(Vector2.UnitX); if (Projectile.velocity.Length() < 14 - 9 * Utils.GetLerpValue(280, 60, Projectile.timeLeft, true)) - Projectile.velocity += moveToEnemy * 0.55f; + Projectile.velocity = Projectile.velocity * 0.95f + moveToEnemy * 0.9f; else Projectile.velocity *= 0.95f; } diff --git a/Projectiles/Melee/MourningstarFlail.cs b/Projectiles/Melee/MourningstarFlail.cs index f19edc709f..147a4d209c 100644 --- a/Projectiles/Melee/MourningstarFlail.cs +++ b/Projectiles/Melee/MourningstarFlail.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.Typeless; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -19,22 +20,21 @@ namespace CalamityMod.Projectiles.Melee Projectile.DamageType = DamageClass.MeleeNoSpeed; Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 4; + Projectile.localNPCHitCooldown = 7; Projectile.extraUpdates = 1; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.Daybreak, 180); - // Note: This is being left as the solar explosion projectile for now, since the weapon is in a good balancing position right now. - // If it is to be rebalanced, consider replacing it with the FuckYou projectile (which does not mess with I-frames) if (Projectile.localAI[1] <= 0f && Projectile.owner == Main.myPlayer) { - int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center.X, target.Center.Y, 0f, 0f, ProjectileID.SolarWhipSwordExplosion, Projectile.damage, hit.Knockback, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - Main.projectile[proj].usesLocalNPCImmunity = true; - Main.projectile[proj].localNPCHitCooldown = 4; + int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), Projectile.damage, hit.Knockback, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + Main.projectile[proj].usesLocalNPCImmunity = false; + Main.projectile[proj].usesIDStaticNPCImmunity = true; + Main.projectile[proj].idStaticNPCHitCooldown = 60; } - Projectile.localAI[1] = 4f; + Projectile.localAI[1] = 16f; } } } diff --git a/Projectiles/Ranged/AcidRocket.cs b/Projectiles/Ranged/AcidRocket.cs new file mode 100644 index 0000000000..dd0e6c6f0c --- /dev/null +++ b/Projectiles/Ranged/AcidRocket.cs @@ -0,0 +1,217 @@ +using System; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Graphics.Primitives; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class AcidRocket : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + public NPC chosenTarget; + public bool stuckInTarget = false; + public bool stuckInGround = false; + public int stuckTimer = 200; + public bool canDamage = true; + public bool canStick = true; + public Vector2 vibrate = Vector2.Zero; + public Vector2 placementCenter; + float placementDistance; + public Vector2 storedVelocity; + Vector2 placementVelocity; + + public ref float RocketID => ref Projectile.ai[0]; + public override void SetStaticDefaults() + { + ProjectileID.Sets.CultistIsResistantTo[Type] = true; + } + + public override void SetDefaults() + { + Projectile.width = 36; + Projectile.height = 36; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.DamageType = DamageClass.Ranged; + Projectile.penetrate = -1; + Projectile.alpha = 255; + Projectile.MaxUpdates = 3; + Projectile.timeLeft = 600; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = Projectile.MaxUpdates * 11; + } + + public override void AI() + { + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + float power = 3; + vibrate = Main.rand.NextVector2Circular(power, power); + // Home in on enemies if not sticking to anything. + if (!stuckInTarget) + { + CalamityUtils.HomeInOnNPC(Projectile, true, 720f, 16f, Projectile.MaxUpdates * 20f); + // Trailing effects, only applied when homing + if (Main.netMode != NetmodeID.Server && Projectile.FinalExtraUpdate() && Projectile.velocity.Length() > 3f) + { + Color color = new Color(136, 211, 113, 127); + Color fadeColor = new Color(165, 165, 86); + Vector2 gasSpawnPosition = Projectile.Center + Main.rand.NextVector2Circular(8f, 8f); + Vector2 gasVelocity = Projectile.velocity * 1.2f + Projectile.velocity.RotatedBy(0.75f) * 0.3f; + gasVelocity *= Main.rand.NextFloat(0.24f, 0.6f); + + Particle gas = new MediumMistParticle(gasSpawnPosition, gasVelocity, color, fadeColor, Main.rand.NextFloat(0.5f, 1f), 205 - Main.rand.Next(50), 0.02f); + GeneralParticleHandler.SpawnParticle(gas); + for (int i = 0; i < 2; i++) + { + Particle spark = new GlowSparkParticle(Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 10, -Projectile.velocity, false, 8, 0.13f * (i == 0 ? 0.2f : 0.5f), Color.Lerp(Color.SeaGreen, Color.PaleGreen, 0.25f) * 0.5f, new Vector2(0.3f, 1f), false, false, 0.8f); + GeneralParticleHandler.SpawnParticle(spark); + } + for (int i = 0; i < 2; i++) + { + Color bubbleColor = Main.rand.NextBool() ? Color.SeaGreen : Color.YellowGreen; + Vector2 bubbleSpawnPos = Projectile.Center + Main.rand.NextVector2Circular(50, 50); + Vector2 bubbleVelocity = -Projectile.velocity * Main.rand.NextFloat(0.2f, 0.8f); + Particle bubble = new DirectionalPulseRing(bubbleSpawnPos, bubbleVelocity, bubbleColor, new Vector2(0.8f, 1), 0, 0.1f, 0f, 75); + GeneralParticleHandler.SpawnParticle(bubble); + } + } + } + else if (stuckInTarget) + { + placementCenter = chosenTarget.Center + placementVelocity * placementDistance + storedVelocity; + + Projectile.Center = placementCenter; + Projectile.rotation = (storedVelocity).SafeNormalize(Vector2.UnitX).ToRotation() + MathHelper.PiOver2; + stuckTimer--; + if (chosenTarget.life <= 0 || chosenTarget == null) + stuckTimer = 0; + if (stuckTimer == 0) + { + Projectile.Kill(); + } + if (stuckTimer == 40) + { + SoundStyle Primed = new("CalamityMod/Sounds/Custom/PlagueSounds/PBGAttackSwitchShort"); + SoundEngine.PlaySound(Primed with { Volume = 0.5f }, Projectile.Center); + } + } + Projectile.Opacity = 1f; + } + public override bool? CanDamage() => canDamage ? null : false; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (target == chosenTarget) + target.AddBuff(ModContent.BuffType(), 180); + if (!stuckInTarget && canStick) + { + canDamage = false; + Projectile.rotation = (Projectile.velocity).SafeNormalize(Vector2.UnitX).ToRotation() + MathHelper.PiOver2; + placementDistance = -Vector2.Distance(target.Center, Projectile.Center); + placementVelocity = (target.Center - Projectile.Center).SafeNormalize(Vector2.UnitX); + placementCenter = placementVelocity * (placementDistance * 0.01f); + chosenTarget = target; + stuckInTarget = true; + storedVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitX) * 8; + Projectile.velocity = Vector2.Zero; + } + } + + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); + + public override void OnSpawn(IEntitySource source) + { + float rotation = Projectile.velocity.ToRotation(); + Particle pulse = new DirectionalPulseRing(Projectile.Center, Projectile.velocity / 2, Color.Gray, new Vector2(1f, 3f), rotation, 0.08f, 0.2f, 15); + GeneralParticleHandler.SpawnParticle(pulse); + } + + public override void OnKill(int timeLeft) + { + SoundStyle fire = new("CalamityMod/Sounds/Custom/PlagueSounds/PlagueBoom", 4); + var info = new CalamityUtils.RocketBehaviorInfo((int)RocketID) + { + // Since we use our own spawning method for the cluster rockets, we don't need them to shoot anything, + // we'll do it ourselves. + clusterProjectileID = ProjectileID.None, + destructiveClusterProjectileID = ProjectileID.None, + }; + bool isClusterRocket = (RocketID == ItemID.ClusterRocketI || RocketID == ItemID.ClusterRocketII); + SoundEngine.PlaySound(fire with { Volume = 0.9f, Pitch = -0.3f }, Projectile.Center); + SoundEngine.PlaySound(SoundID.Item107, Projectile.Center); + if (Projectile.owner == Main.myPlayer) + { + //The explosion has a different damage scaling depending on which rocket type you have. Left is Cluster Rocket, right is Non-Cluster. + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * (isClusterRocket ? 1.5f : 2)), Projectile.knockBack, Projectile.owner); + if (isClusterRocket) + { + for (int k = 0; k < 3; k++) + { + Vector2 acidVelocity = (Vector2.UnitY * (-12f + Main.rand.NextFloat(-3f, 4f))).RotatedByRandom((double)MathHelper.ToRadians(40f)); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity + acidVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.15f), Projectile.knockBack, Projectile.owner, RocketID); + } + } + } + // Circular spread of clouds and bubbles for impact + for (int i = 0; i < 35; i++) + { + Vector2 smokeVel = Main.rand.NextVector2Unit() * Main.rand.NextVector2Circular(32f, 32f); + Color smokeColor = Main.rand.NextBool() ? Color.SeaGreen : Color.PaleGreen; + Particle smoke = new MediumMistParticle(Projectile.Center, smokeVel, smokeColor, Color.Black, Main.rand.NextFloat(1.4f, 4f), (200 - Main.rand.Next(60)), 0.08f); + GeneralParticleHandler.SpawnParticle(smoke); + } + for (int i = 0; i < 8; i++) + { + Vector2 bubbleVel = Main.rand.NextVector2Circular(26f, 26f); + Color bubbleColor = Main.rand.NextBool() ? Color.OliveDrab : Color.SeaGreen; + DirectionalPulseRing pulse = new DirectionalPulseRing(Projectile.Center, bubbleVel, bubbleColor, new Vector2(0.8f, 1), 0, 0.21f, 0f, 50); + GeneralParticleHandler.SpawnParticle(pulse); + } + //Explosion effect + Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Color.SeaGreen, "CalamityMod/Particles/FlameExplosion", Vector2.One, Main.rand.NextFloat(-10, 10), 0f, 0.2f, 20, true, 1f); + GeneralParticleHandler.SpawnParticle(blastRing); + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (targetHitbox.Width > 8 && targetHitbox.Height > 8) + { + targetHitbox.Inflate(-targetHitbox.Width / 8, -targetHitbox.Height / 8); + } + return null; + } + + public override bool PreDraw(ref Color lightColor) + { + float glowOutwardness = MathHelper.SmoothStep(3f, 0f, Utils.GetLerpValue(90f, 270f, stuckTimer, true)); + Texture2D Texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Rectangle frame = Texture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Vector2 drawPosition; + Vector2 origin = frame.Size() * 0.5f; + Color glowColor = Color.Lerp(Color.YellowGreen, Color.Lime, (float)Math.Cos(Main.GlobalTimeWrappedHourly * 5f) * 0.5f + 0.5f); + glowColor.A = 0; + + if (stuckInTarget) + { + for (int i = 0; i < 8; i++) + { + drawPosition = Projectile.Center + (MathHelper.TwoPi * i / 8f + Main.GlobalTimeWrappedHourly * 4f).ToRotationVector2() * glowOutwardness - Main.screenPosition; + Main.EntitySpriteDraw(Texture, drawPosition, frame, Projectile.GetAlpha(glowColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + } + } + drawPosition = Projectile.Center - Main.screenPosition; + Main.EntitySpriteDraw(Texture, drawPosition + vibrate, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + return false; + } + } +} diff --git a/Projectiles/Ranged/AcidRocket.png b/Projectiles/Ranged/AcidRocket.png new file mode 100644 index 0000000000..4887726b1b Binary files /dev/null and b/Projectiles/Ranged/AcidRocket.png differ diff --git a/Projectiles/Ranged/SulphuricAcidCannonExplosion.cs b/Projectiles/Ranged/SulphuricAcidCannonExplosion.cs new file mode 100644 index 0000000000..7f30d0aa99 --- /dev/null +++ b/Projectiles/Ranged/SulphuricAcidCannonExplosion.cs @@ -0,0 +1,62 @@ +using System; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class SulphuricAcidCannonExplosion : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void SetDefaults() + { + Projectile.width = 400; + Projectile.height = 365; + Projectile.friendly = true; + Projectile.ignoreWater = false; + Projectile.tileCollide = false; + Projectile.penetrate = -1; + Projectile.timeLeft = 20; + Projectile.DamageType = DamageClass.Ranged; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + + public override void AI() + { + Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.75f / 255f, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0.01f / 255f); + } + + public override void OnSpawn(IEntitySource source) + { + base.OnSpawn(source); + int dustAmount = Main.rand.Next(14, 20 + 1); + for (int i = 0; i <= 28; i++) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, 278, new Vector2(7, 7).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 1.3f), 0, default, Main.rand.NextFloat(0.7f, 1.3f)); + dust.noGravity = false; + dust.color = Color.SeaGreen; + } + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 120); + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + if (Projectile.numHits > 0) + Projectile.damage = (int)(Projectile.damage * 0.8f); + if (Projectile.damage < 1) + Projectile.damage = 1; + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.width * 0.5f * Projectile.scale, targetHitbox); + } +} diff --git a/Projectiles/Ranged/SulphuricBlast.cs b/Projectiles/Ranged/SulphuricBlast.cs deleted file mode 100644 index d75283807b..0000000000 --- a/Projectiles/Ranged/SulphuricBlast.cs +++ /dev/null @@ -1,90 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Particles; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Ranged -{ - public class SulphuricBlast : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Ranged"; - public const int TotalSecondsToStick = 8; - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 20; - ProjectileID.Sets.CultistIsResistantTo[Type] = true; - } - - public override void SetDefaults() - { - Projectile.width = 36; - Projectile.height = 36; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.tileCollide = false; - Projectile.DamageType = DamageClass.Ranged; - Projectile.penetrate = -1; - Projectile.alpha = 255; - Projectile.MaxUpdates = 3; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = Projectile.MaxUpdates * 11; - } - - public override void AI() - { - if (Projectile.FinalExtraUpdate()) - Projectile.frameCounter++; - 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); - - // Emit sulpuric gas. - if (Main.netMode != NetmodeID.Server && Projectile.FinalExtraUpdate() && Projectile.velocity.Length() > 3f) - { - Color color = new Color(136, 211, 113, 127); - Color fadeColor = new Color(165, 165, 86); - Vector2 gasSpawnPosition = Projectile.Center + Main.rand.NextVector2Circular(8f, 8f); - Vector2 gasVelocity = Projectile.velocity * 1.2f + Projectile.velocity.RotatedBy(0.75f) * 0.3f; - gasVelocity *= Main.rand.NextFloat(0.24f, 0.6f); - - Particle gas = new MediumMistParticle(gasSpawnPosition, gasVelocity, color, fadeColor, Main.rand.NextFloat(0.5f, 1f), 205 - Main.rand.Next(50), 0.02f); - GeneralParticleHandler.SpawnParticle(gas); - } - - // Home in on enemies if not sticking to anything. - if (Projectile.ai[0] != 1f) - { - CalamityUtils.HomeInOnNPC(Projectile, true, 720f, 16f, Projectile.MaxUpdates * 20f); - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - } - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); - - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); - - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => Projectile.ModifyHitNPCSticky(2); - - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) - { - if (targetHitbox.Width > 8 && targetHitbox.Height > 8) - { - targetHitbox.Inflate(-targetHitbox.Width / 8, -targetHitbox.Height / 8); - } - return null; - } - - public override bool PreDraw(ref Color lightColor) - { - 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/SulphuricBlast.png b/Projectiles/Ranged/SulphuricBlast.png deleted file mode 100644 index 3d5a42c1ee..0000000000 Binary files a/Projectiles/Ranged/SulphuricBlast.png and /dev/null differ diff --git a/Projectiles/Ranged/SulphuricDrop.cs b/Projectiles/Ranged/SulphuricDrop.cs new file mode 100644 index 0000000000..f987c5725a --- /dev/null +++ b/Projectiles/Ranged/SulphuricDrop.cs @@ -0,0 +1,104 @@ +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class SulphuricDrop : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "CalamityMod/Projectiles/Environment/AcidDrop"; + + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; + ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + } + + public override void SetDefaults() + { + Projectile.width = 14; + Projectile.height = 20; + Projectile.friendly = true; + Projectile.tileCollide = true; + Projectile.ignoreWater = false; + Projectile.penetrate = 3; + Projectile.timeLeft = 840; + Projectile.extraUpdates = 1; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 15; + Projectile.DamageType = DamageClass.Ranged; + } + public override void AI() + { + if (Main.rand.NextBool(3)) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, 278); + dust.noGravity = false; + dust.scale = Main.rand.NextFloat(0.4f, 0.65f); + dust.velocity = -Projectile.velocity * 0.4f; + dust.color = Color.SeaGreen; + } + if (Projectile.velocity.Y < 0f) + { + Projectile.velocity.Y *= 0.97f; + } + else + { + Projectile.velocity.Y *= 1.03f; + if (Projectile.velocity.Y > 16f) + { + Projectile.velocity.Y = 16f; + } + } + if (Projectile.velocity.Y > -1f && Projectile.localAI[1] == 0f) + { + Projectile.localAI[1] = 1f; + Projectile.velocity.Y = 1f; + } + Projectile.velocity.X *= 0.995f; + if (Projectile.ai[0] >= 2f) + { + Projectile.alpha -= 25; + if (Projectile.alpha < 0) + { + Projectile.alpha = 0; + } + } + Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 120); + } + public override void OnKill(int timeLeft) + { + for (int i = 0; i < 5; ++i) + { + int bloodLifetime = Main.rand.Next(22, 25); + float bloodScale = Main.rand.NextFloat(0.6f, 0.8f); + Color bloodColor = Color.Lerp(Color.SeaGreen, Color.Lime, Main.rand.NextFloat()); + bloodColor = Color.Lerp(bloodColor, new Color(51, 22, 94), Main.rand.NextFloat(0.65f)); + + if (Main.rand.NextBool(20)) + bloodScale *= 2f; + + float randomSpeedMultiplier = Main.rand.NextFloat(1.25f, 2.25f); + Vector2 bloodVelocity = Main.rand.NextVector2Unit() * 2 * randomSpeedMultiplier; + bloodVelocity.Y -= 5f; + BloodParticle blood = new BloodParticle(Projectile.Center, bloodVelocity, bloodLifetime, bloodScale, bloodColor); + GeneralParticleHandler.SpawnParticle(blood); + } + } + public override bool PreDraw(ref Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], new Color(255, 255, 255, 127), 2); + return false; + } + } +} + diff --git a/Projectiles/Rogue/SlickCaneProjectile.cs b/Projectiles/Rogue/SlickCaneProjectile.cs index 85c60db307..95bc85c671 100644 --- a/Projectiles/Rogue/SlickCaneProjectile.cs +++ b/Projectiles/Rogue/SlickCaneProjectile.cs @@ -1,14 +1,12 @@ using System; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.NPCs.NormalNPCs; using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; -using Terraria.GameContent; -using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -35,7 +33,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.ownerHitCheck = true; Projectile.hide = true; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 2; + Projectile.localNPCHitCooldown = 5; Projectile.alpha = 180; Projectile.scale = 1.25f; } @@ -82,7 +80,7 @@ namespace CalamityMod.Projectiles.Rogue { Player player = Main.player[Projectile.owner]; //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)) + if (Projectile.owner == Main.myPlayer && target.IsAnEnemy(false) && !target.dontCountMe && !NeedsDebuffIconDisplayList.Includes(target.type)) { float moneyValueToDrop = target.value / Main.rand.NextFloat(15f, 35f); // Maximum of 50 silver, not counting steath strikes @@ -144,13 +142,13 @@ namespace CalamityMod.Projectiles.Rogue } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - // Boost dmg in proportion to money, caps at 5 plat. Unless in Gfb cuz it would be funny + // Boost dmg in proportion to money, caps at 3 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 >= 5000000 && !Main.zenithWorld) - money = 5000000; + if (money >= 3000000 && !Main.zenithWorld) + money = 3000000; if (money != 0) { modifiers.SourceDamage *= (float)(money / 1250000 + 1); diff --git a/Systems/Collections/AlcoholsList.cs b/Systems/Collections/AlcoholsList.cs new file mode 100644 index 0000000000..e4af8ac36e --- /dev/null +++ b/Systems/Collections/AlcoholsList.cs @@ -0,0 +1,51 @@ +using System.Collections.Generic; +using CalamityMod.Buffs.Alcohol; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + /// + /// A that contains a of all alcohol buff's IDs. + /// + public sealed class AlcoholsList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + BuffID.Tipsy, + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType() + ]; + } + + public override void Unload() => List = null; + + /// + /// A shorthand method to check whether or not a buff ID is an alcohol. + /// + public static bool Includes(int buffID) => List.Contains(buffID); + } +} diff --git a/Systems/Collections/AmalgamBuffLists.cs b/Systems/Collections/AmalgamBuffLists.cs new file mode 100644 index 0000000000..111cc58e73 --- /dev/null +++ b/Systems/Collections/AmalgamBuffLists.cs @@ -0,0 +1,123 @@ +using System.Collections.Generic; +using CalamityMod.Buffs.Alcohol; +using CalamityMod.Buffs.Potions; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + /// + /// A that contains a with all buff IDs of those who are boosted by The Amalgam accessory. + /// + public sealed class AmalgamBuffList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffID.ObsidianSkin, + BuffID.Regeneration, + BuffID.Swiftness, + BuffID.Gills, + BuffID.Ironskin, + BuffID.ManaRegeneration, + BuffID.MagicPower, + BuffID.Featherfall, + BuffID.Spelunker, + BuffID.Invisibility, + BuffID.Shine, + BuffID.NightOwl, + BuffID.Battle, + BuffID.Thorns, + BuffID.WaterWalking, + BuffID.Archery, + BuffID.Hunter, + BuffID.Gravitation, + BuffID.Tipsy, + BuffID.WellFed, + BuffID.WellFed2, + BuffID.WellFed3, + BuffID.Honey, + BuffID.WeaponImbueVenom, + BuffID.WeaponImbueCursedFlames, + BuffID.WeaponImbueFire, + BuffID.WeaponImbueGold, + BuffID.WeaponImbueIchor, + BuffID.WeaponImbueNanites, + BuffID.WeaponImbueConfetti, + BuffID.WeaponImbuePoison, + BuffID.Lucky, + BuffID.Mining, + BuffID.Heartreach, + BuffID.Calm, + BuffID.Builder, + BuffID.Titan, + BuffID.Flipper, + BuffID.Summoning, + BuffID.Dangersense, + BuffID.AmmoReservation, + BuffID.Lifeforce, + BuffID.Endurance, + BuffID.Rage, + BuffID.Inferno, + BuffID.Wrath, + BuffID.Lovestruck, + BuffID.Stinky, + BuffID.Fishing, + BuffID.Sonar, + BuffID.Crate, + BuffID.Warmth, + BuffID.SugarRush + ]; + } + + public override void Unload() => List = null; + + /// + /// A shorthand method to check whether or not a buff is boosted by The Amalgam or not. + /// + public static bool Includes(int buffID) => List.Contains(buffID); + } +} diff --git a/Systems/Collections/AutoreuseableSpearsList.cs b/Systems/Collections/AutoreuseableSpearsList.cs new file mode 100644 index 0000000000..80d81b13f5 --- /dev/null +++ b/Systems/Collections/AutoreuseableSpearsList.cs @@ -0,0 +1,46 @@ +using System.Collections.Generic; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + /// + /// A that contains a of all Vanilla Spears to make them autoreusable. + /// + public sealed class AutoreusableSpearsList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + ItemID.AdamantiteGlaive, + ItemID.ChlorophytePartisan, + ItemID.CobaltNaginata, + ItemID.DarkLance, + ItemID.MonkStaffT2, + ItemID.Gungnir, + ItemID.MushroomSpear, + ItemID.MythrilHalberd, + ItemID.NorthPole, + ItemID.ObsidianSwordfish, + ItemID.OrichalcumHalberd, + ItemID.PalladiumPike, + ItemID.Spear, + ItemID.Swordfish, + ItemID.TheRottedFork, + ItemID.TitaniumTrident, + ItemID.Trident, + ItemID.ThunderSpear + ]; + } + + public override void Unload() => List = null; + + /// + /// A shorthand method to check whether or not an item is an autoreusable spear. + /// + public static bool Includes(int itemType) => List.Contains(itemType); + } +} diff --git a/Systems/Collections/BlacklistedWeaponsWithToolPowerList.cs b/Systems/Collections/BlacklistedWeaponsWithToolPowerList.cs new file mode 100644 index 0000000000..769faa281d --- /dev/null +++ b/Systems/Collections/BlacklistedWeaponsWithToolPowerList.cs @@ -0,0 +1,38 @@ +using System.Collections.Generic; +using CalamityMod.Items.Tools; +using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.Items.Weapons.Melee; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class BlacklistedWeaponsWithToolPowerList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + // This list intentionally does not contain Grax. + List = + [ + ItemID.ButchersChainsaw, + ItemID.LucyTheAxe, + ItemID.Rockfish, + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType() + ]; + } + + public override void Unload() => List = null; + + /// + /// A shorthand method to check if this Item is Blacklisted. + /// + public static bool Includes(int itemType) => List.Contains(itemType); + } +} diff --git a/Systems/Collections/BuffedDungeonProjectilesList.cs b/Systems/Collections/BuffedDungeonProjectilesList.cs new file mode 100644 index 0000000000..2d847d0d29 --- /dev/null +++ b/Systems/Collections/BuffedDungeonProjectilesList.cs @@ -0,0 +1,37 @@ +using System.Collections.Generic; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + /// + /// A which contains a that has the Projectile IDs of all projectiles who are buffed Dungeon projectiles. + /// + public sealed class BuffedDungeonProjectilesList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + ProjectileID.PaladinsHammerHostile, + ProjectileID.ShadowBeamHostile, + ProjectileID.InfernoHostileBolt, + ProjectileID.InfernoHostileBlast, + ProjectileID.LostSoulHostile, + ProjectileID.SniperBullet, + ProjectileID.RocketSkeleton, + ProjectileID.BulletDeadeye, + ProjectileID.Shadowflames + ]; + } + + public override void Unload() => List = null; + + /// + /// A shorthand method to check if this projectile is a buffed Dungeon projectile. + /// + public static bool Includes(int projType) => List.Contains(projType); + } +} diff --git a/Systems/Collections/ConfusionDebuffImmunitiesList.cs b/Systems/Collections/ConfusionDebuffImmunitiesList.cs new file mode 100644 index 0000000000..48a0214b2e --- /dev/null +++ b/Systems/Collections/ConfusionDebuffImmunitiesList.cs @@ -0,0 +1,58 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.Astral; +using CalamityMod.NPCs.Crags; +using CalamityMod.NPCs.NormalNPCs; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + /// + /// A that contains all of the NPC's IDs of the NPCs who are immune to the Confusion debuff. + /// + public sealed class ConfusionDebuffImmunitiesList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType() + ]; + } + + public override void Unload() => List = null; + + /// + /// A shorthand method to check if an NPC is supposed to be immune to the Confusion debuff. + /// + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/DebuffsList.cs b/Systems/Collections/DebuffsList.cs new file mode 100644 index 0000000000..39b22ffc30 --- /dev/null +++ b/Systems/Collections/DebuffsList.cs @@ -0,0 +1,100 @@ +using System.Collections.Generic; +using CalamityMod.Buffs; +using CalamityMod.Buffs.Cooldowns; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + /// + /// A that contains a that has all Debuff IDs. + /// + public sealed class DebuffsList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + BuffID.Poisoned, + BuffID.Darkness, + BuffID.Cursed, + BuffID.OnFire, + BuffID.Bleeding, + BuffID.Confused, + BuffID.Slow, + BuffID.Weak, + BuffID.Silenced, + BuffID.BrokenArmor, + BuffID.CursedInferno, + BuffID.Frostburn, + BuffID.Chilled, + BuffID.Frozen, + BuffID.Burning, + BuffID.Suffocation, + BuffID.Ichor, + BuffID.Venom, + BuffID.Blackout, + BuffID.Electrified, + BuffID.Rabies, + BuffID.Webbed, + BuffID.Stoned, + BuffID.Dazed, + BuffID.VortexDebuff, + BuffID.WitheredArmor, + BuffID.WitheredWeapon, + BuffID.OgreSpit, + BuffID.BetsysCurse, + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + // BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType() + ]; + } + + public override void Unload() => List = null; + + /// + /// A shorthand method to check if a buff ID is a debuff. + /// + public static bool Includes(int buffID) => List.Contains(buffID); + } +} diff --git a/Systems/Collections/DisabledSummonerNerfItemList.cs b/Systems/Collections/DisabledSummonerNerfItemList.cs new file mode 100644 index 0000000000..0f312357da --- /dev/null +++ b/Systems/Collections/DisabledSummonerNerfItemList.cs @@ -0,0 +1,19 @@ +using System.Collections.Generic; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + public sealed class DisabledSummonerNerfItemList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = []; + } + + public override void Unload() => List = null; + + public static bool Includes(int itemType) => List.Contains(itemType); + } +} diff --git a/Systems/Collections/DisabledSummonerNerfMinionList.cs b/Systems/Collections/DisabledSummonerNerfMinionList.cs new file mode 100644 index 0000000000..48a47c670b --- /dev/null +++ b/Systems/Collections/DisabledSummonerNerfMinionList.cs @@ -0,0 +1,19 @@ +using System.Collections.Generic; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + public sealed class DisabledSummonerNerfMinionList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = []; + } + + public override void Unload() => List = null; + + public static bool Includes(int projType) => List.Contains(projType); + } +} diff --git a/Systems/Collections/DonatorsNameList.cs b/Systems/Collections/DonatorsNameList.cs new file mode 100644 index 0000000000..ed851b871a --- /dev/null +++ b/Systems/Collections/DonatorsNameList.cs @@ -0,0 +1,669 @@ +using System.Collections.Generic; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + /// + /// A that stores all of Calamity's Patreon donator's usernames. + /// + public sealed class DonatorsNameList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + "Vorbis", + "SoloMael", + "Chaotic Reks", + "The Buildmonger", + "YuH", + "Littlepiggy", + "LompL", + "Lilith", + "Ben Shapiro", + "Frederik", + "Faye", + "Gibb50", + "Braden", + "Hannes", + "profoundmango69", + "Jack", + "Hans Volter", + "Krankwagon", + "MishiroUsui", + "pixlgray", + "Arkhine", + "Lodude", + "DevAesthetic", + "Mister Winchester", + "Zacky", + "Veine", + "Javyz", + "Shifter", + "Crysthamyr", + "Elfinlocks", + "Ein", + "2Larry2", + "Jenonen", + "Dodu", + "Arti", + "Tervastator", + "Luis", + "Alexander", + "BakaQing", + "Taylor", + "Xaphlactus", + "MajinBagel", + "Bendy", + "Rando Calrissian", + "Tails the Fox 92", + "Bread", + "Minty Candy", + "Preston", + "MovingTarget_086", + "Shiro", + "Chip", + "Taylor", + "ShotgunAngel", + "Sandblast", + "ThomasThePencil", + "Aero (Aero#4599)", + "Shirosity", // used to be GlitchOut + "Daawnz", + "CrabBar", + "Yatagarasu", + "Jarod", + "Zombieh", + "MingWhy", + "Random Weeb", + "Afzofa", + "Eragon3942", + "TheBlackHand", + "william", + "Samuel", + "Christopher", + "DemoN K!ng", + "Malik", + "Ryan Baker-Ortiz", + "Aleksanders", + "TheSilverGhost", + "Lucazii", + "Shay", + "Prism", + "BobIsNotMyRealName", + "Guwahavel", + "Azura", + "Joshua", + "Doveda", + "William", + "Arche", + "DevilSunrise", + "Yanmei", + "Chaos", + "Ryan", + "Fish Repairs", + "Melvin", + "Vroomy Has -3,000 IQ", + "The Goliath", + "DaPyRo", + "Takeru", + "Circuit-Jay", + "Commmander Frostbite", + "cytokat", + "Cameron", + "Orudeon", + "BumbleDoge", + "Naglfar", + "Helixas", + "Vetus", + "High Charity", + "Devonte", + "Cerberus", + "Brendan", + "Victor", + "KAT-G307", + "Tombarry Expresserino", + "Drip Veezy", + "Glaid", + "Apotheosis", + "Bladesaber", + "Devon", + "Ruthoranium", + "cocodezi_", + "Mendzey", + "GameRDheAsianSandwich", + "Chigbungus", + "Streakist", + "Eisaya", + "Xenocrona", + "RKMoon", + "Eternal Silence", + "Jeff", + "Beta165", + "DanYami", + "Xenocrona", + "Ari", + "cosmickalamity", + "xd Ow0", + "Darren", + "Florian", + "dawn thunder", + "asdf935", + "GentSkeleton", + "Fizzlpoprock", + "Pigeon", + "Aleksh", + "Just a random guy", + "Dee", + "Æthereal", + "Broken Faucet", + "Sarcosuchus", + "Marissa443", + "Warlok", + "JackShizz", + "NebulaMagePlays", + "Primpy", + "Thys", + "Min", + "Wodernet", + "Pedro", + "Depressed Dad Gaming", + "Snowy", + "Stormone", + "Mobian", + "Rinja", + "Check pins", + "Dakota", + "Neoplasmatic", + "False", + "Whitegiraffe", + "Drakkece", + "Levi", + "Izuna", + "djsnj20", + "pyobbo", + "Alec", + "The Illustrious Sqouinchuousor", + "Moist Lad", + "TwanTheGOAT", + "3x1t_5tyl3", + "Will", + "SpookyNinja", + "Boomdiada", + "Culex", + "Rossadon", + "Ben", + "hubert thieblot", + "NepNep", + "Nanaki", + "CrimsonCrips", + "Lagohz", + "Timon", + "F00d Demon", + "Olkothan", + "Vmar98", + "Dasdruid", + "Cinder", + "Brutzli", + "Yhashtur", + "Zekai", + "Doug", + "Uberransy", + "KurlozClown", + "Nemesis 041", + "Asheel", + "Hayden", + "Lightedflare", + "Lady Shira", + "Devin", + "Qelrin", + "Thomas", + "Ne'er Dowell", + "Potion Man", + "martyrdomination", + "Destructoid", + "Coolguystorm YT", + "Wolfmaw", + "yiumik", + "Destiny Stallcup", + "GreenBerry", + "SolsticeUnlimitd", + "darkhawke", + "oracle", + "YumeiSenshi", + "Cameron", + "Toxin", + "Fweepachino", + "DESPACITO", + "Altzeus", + "Ryan", + "Spider region", + "WinterTire", + "Nycro", + "Vyster", // previously "Bewearium" + "William", + "HellGoat2", + "116taj", + "CaineSenpai", + "Suicide Dreams", + "Roxas", + "Obsoleek", + "Jetpat3", + "GreenTea", + "Woah", + "Ryaegos", + "Popsickle Yoshi", + "Arcadia", + "JensB__", + "Nuclei", + "Picasso's Bean", + "Corn M. Cobb", + "kgh8090", + "Luke", + "Barbara", + "Alexis", + "Soko", + "Albino gonkvader", + "Monic", + "Slim", + "ChaosChaos", + "Deallly", + "Jeff", + "vcf55", + "Kazurgundu", + "Jheybyrd", + "Kipluck", + "SCONICBOOM", + "Mr.Matter", + "Billy", + "jjth0m3", + "GTW High Cube", + "Sabrina", + "Potato - Stego", + "Perditio Astrum", + "MaxingOut", + "SharZz", + "Allegro", + "hoosfire", + "Lauren", + "Ultra Succ", + "Ethan", + "Pacnysam", + "dummyAzure", + "Jaykob", + "Goblin", + "NoOneElse", + "Nicholas", + "Toasty", + "oli saer", + "Blobby6799", + "Domrinth", + "zombieseatflesh7", + "Shiny", + "Whale", + "The Infinity", + "MrCreamen", + "TemperedAether", + "LucasTwocas", + "JustLonelyPi", + "Brian", + "Ashton", + "Rolandark", + "Ally2Cute", + "Dionysos", + "Plant Waifu", + "fire", + "Charles", + "Kaden", + "Dr. Pawsworth", + "Jackson", + "Freakish", + "Ashamper", + "Kinzoku", + "Elementari", + "The Wolf Commando", + "Jordan", + "Jessire", + "Ashton", + "callisto", + "velneu", + "Mathuantie", + "Robert", + "Matias", + "T E R M I N A T O R", + "apotofkoolaid", + "Matthew", + "Terrarian Dragon", + "Pomelo", + "Thomas", + "Iconic Parker Gaming", + "Jaydon", + "Aidan", + "Avery", + "yayoi", + "Splotchycrib", + "GIGA MAN", + "Eric", + "Merubel", + "Smug", + "Lime-Wars l 1", + "WillyDilly", + "xAqult", + "Himakaze", + "Face", + "Carboniferous", + "James", + "Taitou1", + "Yumi", + "NEBULA", + "Blackbluue", + "Alex", + "Ruben", + "Rixu", + "Antonie", + "Zerimore", + "Oblivionisbruh", + "Loser", + "Patrick", + "Magic Love", + "gluten tag", + "RetroRed", + "Katherine", + "SoyScoutSmasher", + "Jersey", + "Reiter splash", + "Conner", + "Ekun", + "Driser", + "bikmin", + "MittoMan", + "Pyromaniac146", + "Eddie Spaghetti", + "Colin", + "ZyferDex_", + "LumiEvi", + "Anish", + "MissMudflaps", + "Valkyrie", + "anglerraptor", + "Scribbles", + "Pneuma", + "OrrangProto", + "Tomat (Stevie)", + "That Katsafaros", + "PsychoGrizzly", + "Dayne", + "Hargestar", + "The Pyro", + "Lucas", + "Superbeepig", + "Larry That Barry", + "Monti", + "StarryFox", + "Kevin", + "Poopifier Poopifly", + "Lacuna", + "Nathan", + "Handburger", + "XusTingo9", + "Underlost", + "julius", + "Mark", + "Habb", + "Reanamet", + "Empress Vega", + "Team", + "GP", + "Xsiana", + "NyanLegacy215", + "ethan", + "Trinity Series", + "M001NG", + "WrathOfOlympus", + "dennis", + "Darkweb", + "Chaozhi", + "Mars", + "Elijah", + "Tezguin", + "Shpee", + "Archie", + "Meow", + "CosmicStarIight", + "Alfragiste", + "Number1piratepan", + "Noah", + "Max Kim", + "Anton", + "edm vibes", + "Hunter", + "Doodled_lynx", + "3en", + "Kiyotu", + "Aero", + "Iguy", + "병현 송", + "Tyler", + "Leonidas", + "GregTheSpinarak", + "Cheddar", + "Alex N", + "Magicoal", + "Seanツ", + "Ariscottle", + "Kevin", + "OnTheAirPogs", + "Zerafir", + "Bill", + "Starmitzy", + "FaeLoPondering", + "Brian", + "Smart2004", + "sherk", + "Squishy", + "Ash", + "rawpie2", + "Hokojin", + "sk", + "Done", + "MeanieG", + "Sanctuary", + "Landon", + "Moonicento", + "Hayden", + "Steven", + "Hana", + "Mikabul", + "Nathaniel", + "Brutus", + "EdelVollMilch", + "garfu", + "NuT NiTe", + "adain", + "Dylan", + "Lucas", + "Arthur", + "sweatingdishes", + "pomp neigh", + "Proffesor prostate", + "Saladify", + "26-4-1", + "VeryMasterNinja", + "Vorbis", + "Nyapano", + "Shadoku", + "allosar", + "jes", + "Paltham", + "Fartein", + "Derdjin", + "A_Normal_Person", + "Duck Satan", + "Jalapeno9", + "Grylken", + "Nexus", + "KJ", + "Goober", + "ChAoS DiScOrD", + "Mayhem", + "Zombified _G", + "Madd Cat", + "Natalie", + "Solaire", + "Dakota C", + "The Davester", + "Jose", + "Him", + "Umberto", + "Lance", + "Navigator", + "Ferret4T", + "Rooki", + "LvL-94", + "Feels Fishy", + "Korb Orb", + "Calcium Comrade", + "Talmadge", + "ddoogg88 tdog", + "CasualNoLifer", + "Bossy Punch", + "Creamy", + "Tyler", + "topnormal", + "Gilded Gryphon", + "Nightskyflyer", + "Schlarfblrfsch", + "MrNobody", + "Aden C.N.", + "zombie wolf", + "n0tacat", + "Marko", + "dexxer65", + "DeLordeyeee", + "Kaledoulas", + "Mohammad", + "Skeli_G", + "Arcxus", + "Sigil", + "Dull", + "DjackV", + "Misinput", + "Gameology", + "KugelBlitz", + "TheGreatSako", + "Joep", + "Rottingwood", + "anything5000", + "Gretchen", + "Spirit Shield", + "Briny_Coffee", + "_Skeggy_", + "just akkolite", + "J.U.N.E.S", + "Bruggs", + "Vimek Xol", + "Oceanman232", + "Sadouken", + "srxe", + "ProfessorWinston", + "OctolingGrimm", + "Cole", + "Markie", + "Met Vox", + "Tweee", + "Kaimonick", + "Chow Chow", + "drenmus!", + "Nitronium Productions", + "Goomfrontlut", + "Akkolite", + "Shaun", + "Bruh.PNG", + "James", + "Lord_Lucerne", + "Ulmod", + "Adamko", + "Gamma Freya", + "Finnrua", + "Maskedmilo", + "RockRecker39", + "Konorango", + "Indeciiissive", + "Curtis", + "Ponynator", + "Crippling-Ambition", + "TitaniumLlama", + "OriginForme487", + "FishBread", + "Real mystlc", + "Levi", + "jc.", + "Medi", + "Jakob", + "Borb9834", + "Georgios", + "KeL", + "Cody", + "Cristian(Mihaii)", + "Marco", + "RuskieThe3rd", + "BreachNClear747", + "happy thoughts", + "Azure", + "theHoopty", + "porglesupreme", + "XDkilljoy65XX", + "Mr. Bones", + "dawnboi", + "Joe", + "Sailor Jolt", + "SomeRando", + "Nuclear Chaos", + "Jankle", + "The Roborex", + "everquartz", + "discokittie", + "IsaacInsomnia", + "xElectrix_", + "Forge", + "MiyoshiEira", + "thebettercat", + "Darthlego", + "Azzilan", + "Griffin", + "LucasHM", + "ChrigTopher", + "Colin V", + "Scrumlet", + "Darkus", + "Homunculus Derelictus", + "Professor Pissington", + "Buppercups - Roblox", + "Pusheen_", + "Patrera" + ]; + } + + public override void Unload() => List = null; + + /// + /// Returns 25 random donator usernames. + /// + public static string[] GetRandomDonors() + { + List donorList = new(List); + const int maxDonorsListed = 25; + string[] donors = new string[maxDonorsListed]; + for (int i = 0; i < maxDonorsListed; i++) + { + donors[i] = donorList[Main.rand.Next(donorList.Count)]; + donorList.Remove(donors[i]); + } + + return donors; + } + } +} diff --git a/Systems/Collections/EncryptedSchematicIDRelationshipDict.cs b/Systems/Collections/EncryptedSchematicIDRelationshipDict.cs new file mode 100644 index 0000000000..216b4a70e9 --- /dev/null +++ b/Systems/Collections/EncryptedSchematicIDRelationshipDict.cs @@ -0,0 +1,52 @@ +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Items.DraedonMisc; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class EncryptedSchematicIDRelationshipDict : ModSystem + { + public static IDictionary Dict { get; private set; } + + public override void OnModLoad() + { + var dict = new Dictionary() + { + [1] = ItemType(), + [2] = ItemType(), + [3] = ItemType(), + [4] = ItemType(), + }; + + Dict = dict; + } + + public override void Unload() + { + Dict?.Clear(); + Dict = null; + } + + public static bool TryGet(int schematicID, out int schematicItemType) + { + return Dict.TryGetValue(schematicID, out schematicItemType); + } + + public static bool TryGetKey(int schematicItemType, out int schematicID) + { + try + { + var pair = Dict.First(pair => pair.Value == schematicItemType); + schematicID = pair.Key; + return true; + } + catch + { + schematicID = 0; + return false; + } + } + } +} diff --git a/Systems/Collections/EventProjectileBuffList.cs b/Systems/Collections/EventProjectileBuffList.cs new file mode 100644 index 0000000000..9f3db41e46 --- /dev/null +++ b/Systems/Collections/EventProjectileBuffList.cs @@ -0,0 +1,43 @@ +using System.Collections.Generic; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + /// + /// A that contains a of all Projectile Types that receive Post-DoG Event Buff + /// + public sealed class EventProjectileBuffList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + ProjectileID.FlamingWood, + ProjectileID.GreekFire1, + ProjectileID.GreekFire2, + ProjectileID.GreekFire3, + ProjectileID.FlamingScythe, + ProjectileID.FlamingArrow, + ProjectileID.PineNeedleHostile, + ProjectileID.OrnamentHostile, + ProjectileID.OrnamentHostileShrapnel, + ProjectileID.FrostWave, + ProjectileID.FrostShard, + ProjectileID.Missile, + ProjectileID.Present, + ProjectileID.Spike, + ProjectileID.BulletDeadeye, + ProjectileID.EyeLaser, + ProjectileID.Nail, + ProjectileID.DrManFlyFlask + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int projType) => List.Contains(projType); + } +} diff --git a/Systems/Collections/FireDebuffsList.cs b/Systems/Collections/FireDebuffsList.cs new file mode 100644 index 0000000000..f68d38db98 --- /dev/null +++ b/Systems/Collections/FireDebuffsList.cs @@ -0,0 +1,43 @@ +using System.Collections.Generic; +using CalamityMod.Buffs.DamageOverTime; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + /// + /// A that contains a that has all the IDs of all Fire-type debuffs. + /// + public sealed class FireDebuffsList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + BuffID.OnFire, + BuffID.OnFire3, // Hellfire + BuffID.Burning, // Touching meteorite ore or hellstone without obsidian skull + BuffID.CursedInferno, + BuffID.ShadowFlame, // Vanilla Shadowflame, can normally never be applied to players + BuffType(), // Calamity Shadowflame copy for players + BuffType(), // Crags lava + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), // Aflame enchant self damage + BuffType(), + ]; + } + + public override void Unload() => List = null; + + /// + /// A shorthand method to check if a buff ID is a fire debuff. + /// + public static bool Includes(int buffID) => List.Contains(buffID); + } +} diff --git a/Systems/Collections/FriendlyBeesList.cs b/Systems/Collections/FriendlyBeesList.cs new file mode 100644 index 0000000000..4ccdaf609f --- /dev/null +++ b/Systems/Collections/FriendlyBeesList.cs @@ -0,0 +1,38 @@ +using System.Collections.Generic; +using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Summon; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + /// + /// A that contains a that has all the Projectile IDs of all friendly bees. + /// + public sealed class FriendlyBeesList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + ProjectileID.GiantBee, + ProjectileID.Bee, + ProjectileID.Wasp, + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType() + ]; + } + + public override void Unload() => List = null; + + /// + /// A shorthand method to check if a projectile is a friendly bee. + /// + public static bool Includes(int projType) => List.Contains(projType); + } +} diff --git a/Systems/Collections/GrenadeResistIDList.cs b/Systems/Collections/GrenadeResistIDList.cs new file mode 100644 index 0000000000..917ae8271c --- /dev/null +++ b/Systems/Collections/GrenadeResistIDList.cs @@ -0,0 +1,43 @@ +using System.Collections.Generic; +using CalamityMod.Projectiles.Typeless; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class GrenadeResistIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + ProjectileID.Grenade, + ProjectileID.StickyGrenade, + ProjectileID.BouncyGrenade, + ProjectileID.Bomb, + ProjectileID.StickyBomb, + ProjectileID.BouncyBomb, + ProjectileID.Dynamite, + ProjectileID.StickyDynamite, + ProjectileID.BouncyDynamite, + ProjectileID.Explosives, + ProjectileID.ExplosiveBunny, + ProjectileID.PartyGirlGrenade, + ProjectileID.BombFish, + ProjectileID.Beenade, + ProjectileID.Bee, + ProjectileID.GiantBee, + ProjectileType(), + ProjectileID.ScarabBomb, + ProjectileID.TNTBarrel + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int projectileType) => List.Contains(projectileType); + } +} diff --git a/Systems/Collections/HighTestFishingPoleList.cs b/Systems/Collections/HighTestFishingPoleList.cs new file mode 100644 index 0000000000..aea4781598 --- /dev/null +++ b/Systems/Collections/HighTestFishingPoleList.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using CalamityMod.Items.Fishing.FishingRods; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class HighTestFishingPoleList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + ItemID.GoldenFishingRod, + ItemType(), + ItemType() + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int itemType) => List.Contains(itemType); + } +} diff --git a/Systems/Collections/ItemsForcedInsideWorldList.cs b/Systems/Collections/ItemsForcedInsideWorldList.cs new file mode 100644 index 0000000000..6fd8da39ab --- /dev/null +++ b/Systems/Collections/ItemsForcedInsideWorldList.cs @@ -0,0 +1,110 @@ +using System.Collections.Generic; +using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor.Vanity; +using CalamityMod.Items.LoreItems; +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.Furniture.Trophies; +using CalamityMod.Items.TreasureBags; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + /// + /// A that contains a of Item IDs of those which are forced to be inside the world map. + /// + public sealed class ItemsForcedInsideWorldList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemID.HotlineFishingHook, + ItemID.BottomlessBucket, + ItemID.SuperAbsorbantSponge, + ItemID.FishingPotion, + ItemID.SonarPotion, + ItemID.CratePotion, + ItemID.AnglerTackleBag, + ItemID.HighTestFishingLine, + ItemID.TackleBox, + ItemID.AnglerEarring, + ItemID.FishermansGuide, + ItemID.WeatherRadio, + ItemID.Sextant, + ItemID.AnglerHat, + ItemID.AnglerVest, + ItemID.AnglerPants, + ItemID.GoldenBugNet, + ItemID.FishronWings, + ItemID.Flairon, + ItemID.Tsunami, + ItemID.BubbleGun, + ItemID.RazorbladeTyphoon, + ItemID.TempestStaff, + ItemID.FishronBossBag, + ItemID.Coral, + ItemID.Seashell, + ItemID.Starfish, + ItemID.SoulofSight, + ItemID.GreaterHealingPotion, + ItemID.SuperHealingPotion + ]; + } + + public override void Unload() => List = null; + + /// + /// A shorthand method to check whether or not an item is an item that should be forced inside the world map. + /// + public static bool Includes(int itemType) => List.Contains(itemType); + } +} diff --git a/Systems/Collections/KamiDebuffColorImmuneList.cs b/Systems/Collections/KamiDebuffColorImmuneList.cs new file mode 100644 index 0000000000..028faa8375 --- /dev/null +++ b/Systems/Collections/KamiDebuffColorImmuneList.cs @@ -0,0 +1,29 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.OldDuke; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class KamiDebuffColorImmuneList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + // Duke Fishron and Old Duke phase 3 becomes way too easy if you can make him stop being invisible with Yanmei's Knife. + // This is a list so that other NPCs can be added as necessary. + // IT DOES NOT make them immune to the debuff, just stops them from being recolored. + List = + [ + NPCID.DukeFishron, + NPCType() + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/LegOverrideList.cs b/Systems/Collections/LegOverrideList.cs new file mode 100644 index 0000000000..16b2989168 --- /dev/null +++ b/Systems/Collections/LegOverrideList.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories.Vanity; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + public sealed class LegOverrideList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + EquipLoader.GetEquipSlot(CalamityMod.Instance, nameof(ProfanedSoulCrystal), EquipType.Legs), + EquipLoader.GetEquipSlot(CalamityMod.Instance, nameof(AquaticHeart), EquipType.Legs), + //CalamityMod.Instance.GetEquipSlot(nameof(SirenLeg), EquipType.Legs), whate even was SirenLeg vs SirenLegAlt? + EquipLoader.GetEquipSlot(CalamityMod.Instance, nameof(Popo), EquipType.Legs) + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int equipSlot) => List.Contains(equipSlot); + } +} diff --git a/Systems/Collections/LivingFireTilesList.cs b/Systems/Collections/LivingFireTilesList.cs new file mode 100644 index 0000000000..81b2d27c33 --- /dev/null +++ b/Systems/Collections/LivingFireTilesList.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; +using CalamityMod.Tiles.LivingFire; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + /// + /// A that contains a with all Tile IDs of those which are Living-Fire-type tiles. + /// + public sealed class LivingFireTilesList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + TileType(), + TileType(), + TileType(), + TileType(), + TileID.LivingFire, + TileID.LivingCursedFire, + TileID.LivingDemonFire, + TileID.LivingFrostFire, + TileID.LivingIchor, + TileID.LivingUltrabrightFire + ]; + } + + public override void Unload() => List = null; + + /// + /// A shorthand method to check whether or not a tile is a Living-Fire-type of tile. + /// + public static bool Includes(int tileType) => List.Contains(tileType); + } +} diff --git a/Systems/Collections/MagicGunIDList.cs b/Systems/Collections/MagicGunIDList.cs new file mode 100644 index 0000000000..510ee2f898 --- /dev/null +++ b/Systems/Collections/MagicGunIDList.cs @@ -0,0 +1,65 @@ +using System.Collections.Generic; +using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.Items.Weapons.Magic; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class MagicGunIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemID.BeeGun, + ItemID.BubbleGun, + ItemID.ChargedBlasterCannon, + ItemID.HeatRay, + ItemID.LaserMachinegun, + ItemID.LaserRifle, + ItemID.LeafBlower, + ItemID.RainbowGun, + ItemID.SpaceGun, + ItemID.WaspGun, + ItemID.ZapinatorGray, + ItemID.ZapinatorOrange + ]; + } + + public override void Unload() => List = null; + + /// + /// A shorthand method to check if this Item is Magic Gun. + /// + public static bool Includes(int itemType) => List.Contains(itemType); + } +} diff --git a/Systems/Collections/NPCIDs/AngryBonesIDList.cs b/Systems/Collections/NPCIDs/AngryBonesIDList.cs new file mode 100644 index 0000000000..7ca8a86472 --- /dev/null +++ b/Systems/Collections/NPCIDs/AngryBonesIDList.cs @@ -0,0 +1,28 @@ +using System.Collections.Generic; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + public sealed class AngryBonesIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCID.AngryBones, + NPCID.AngryBonesBig, + NPCID.AngryBonesBigMuscle, + NPCID.AngryBonesBigHelmet, + NPCID.BigBoned, + NPCID.ShortBones + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCIDs/AquaticScourgeIDList.cs b/Systems/Collections/NPCIDs/AquaticScourgeIDList.cs new file mode 100644 index 0000000000..e6b8dae864 --- /dev/null +++ b/Systems/Collections/NPCIDs/AquaticScourgeIDList.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.AquaticScourge; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class AquaticScourgeIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCType(), + NPCType(), + NPCType(), + NPCType() + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCIDs/AresIDList.cs b/Systems/Collections/NPCIDs/AresIDList.cs new file mode 100644 index 0000000000..09b52cdd3a --- /dev/null +++ b/Systems/Collections/NPCIDs/AresIDList.cs @@ -0,0 +1,28 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.ExoMechs.Ares; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class AresIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType() + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCIDs/AstrumDeusIDList.cs b/Systems/Collections/NPCIDs/AstrumDeusIDList.cs new file mode 100644 index 0000000000..d5ddc2b632 --- /dev/null +++ b/Systems/Collections/NPCIDs/AstrumDeusIDList.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.AstrumDeus; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class AstrumDeusIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCType(), + NPCType(), + NPCType() + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCIDs/BoundNPCIDList.cs b/Systems/Collections/NPCIDs/BoundNPCIDList.cs new file mode 100644 index 0000000000..a3667b2fd0 --- /dev/null +++ b/Systems/Collections/NPCIDs/BoundNPCIDList.cs @@ -0,0 +1,29 @@ +using System.Collections.Generic; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + public sealed class BoundNPCIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCID.BoundGoblin, + NPCID.BoundWizard, + NPCID.BoundMechanic, + NPCID.SleepingAngler, + NPCID.BartenderUnconscious, + NPCID.WebbedStylist, + NPCID.GolferRescue + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCIDs/CosmicGuardianIDList.cs b/Systems/Collections/NPCIDs/CosmicGuardianIDList.cs new file mode 100644 index 0000000000..ebacf52a13 --- /dev/null +++ b/Systems/Collections/NPCIDs/CosmicGuardianIDList.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.DevourerofGods; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class CosmicGuardianIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCType(), + NPCType(), + NPCType() + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCIDs/DemonEyeIDList.cs b/Systems/Collections/NPCIDs/DemonEyeIDList.cs new file mode 100644 index 0000000000..d0c72b67bf --- /dev/null +++ b/Systems/Collections/NPCIDs/DemonEyeIDList.cs @@ -0,0 +1,36 @@ +using System.Collections.Generic; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + public sealed class DemonEyeIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCID.DemonEye, + NPCID.CataractEye, + NPCID.SleepyEye, + NPCID.DialatedEye, // it is spelled "dilated" + NPCID.GreenEye, + NPCID.PurpleEye, + NPCID.DemonEyeOwl, + NPCID.DemonEyeSpaceship, + NPCID.DemonEye2, + NPCID.PurpleEye2, + NPCID.GreenEye2, + NPCID.DialatedEye2, + NPCID.SleepyEye2, + NPCID.CataractEye2 + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCIDs/DesertScourgeIDList.cs b/Systems/Collections/NPCIDs/DesertScourgeIDList.cs new file mode 100644 index 0000000000..280a969845 --- /dev/null +++ b/Systems/Collections/NPCIDs/DesertScourgeIDList.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.DesertScourge; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class DesertScourgeIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCType(), + NPCType(), + NPCType() + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCIDs/DestroyerIDList.cs b/Systems/Collections/NPCIDs/DestroyerIDList.cs new file mode 100644 index 0000000000..5199177076 --- /dev/null +++ b/Systems/Collections/NPCIDs/DestroyerIDList.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + public sealed class DestroyerIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCID.TheDestroyer, + NPCID.TheDestroyerBody, + NPCID.TheDestroyerTail + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCIDs/DevourerOfGodsIDList.cs b/Systems/Collections/NPCIDs/DevourerOfGodsIDList.cs new file mode 100644 index 0000000000..ff37b9725c --- /dev/null +++ b/Systems/Collections/NPCIDs/DevourerOfGodsIDList.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.DevourerofGods; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class DevourerOfGodsIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCType(), + NPCType(), + NPCType() + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCIDs/EaterOfWorldsIDList.cs b/Systems/Collections/NPCIDs/EaterOfWorldsIDList.cs new file mode 100644 index 0000000000..e4c2f65476 --- /dev/null +++ b/Systems/Collections/NPCIDs/EaterOfWorldsIDList.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + public sealed class EaterOfWorldsIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCID.EaterofWorldsHead, + NPCID.EaterofWorldsBody, + NPCID.EaterofWorldsTail + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCIDs/GolemIDList.cs b/Systems/Collections/NPCIDs/GolemIDList.cs new file mode 100644 index 0000000000..db9e1b362a --- /dev/null +++ b/Systems/Collections/NPCIDs/GolemIDList.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + public sealed class GolemIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCID.Golem, + NPCID.GolemHead, + NPCID.GolemHeadFree, + NPCID.GolemFistLeft, + NPCID.GolemFistRight + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCIDs/HornetIDList.cs b/Systems/Collections/NPCIDs/HornetIDList.cs new file mode 100644 index 0000000000..3cb3d5e17f --- /dev/null +++ b/Systems/Collections/NPCIDs/HornetIDList.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + public sealed class HornetIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCID.BigHornetStingy, + NPCID.LittleHornetStingy, + NPCID.BigHornetSpikey, + NPCID.LittleHornetSpikey, + NPCID.BigHornetLeafy, + NPCID.LittleHornetLeafy, + NPCID.BigHornetHoney, + NPCID.LittleHornetHoney, + NPCID.BigHornetFatty, + NPCID.LittleHornetFatty, + NPCID.BigStinger, + NPCID.LittleStinger, + NPCID.Hornet, + NPCID.HornetFatty, + NPCID.HornetHoney, + NPCID.HornetLeafy, + NPCID.HornetSpikey, + NPCID.HornetStingy + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCIDs/MossHornetIDList.cs b/Systems/Collections/NPCIDs/MossHornetIDList.cs new file mode 100644 index 0000000000..9f05bd9acf --- /dev/null +++ b/Systems/Collections/NPCIDs/MossHornetIDList.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + public sealed class MossHornetIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCID.MossHornet, + NPCID.TinyMossHornet, + NPCID.LittleMossHornet, + NPCID.BigMossHornet, + NPCID.GiantMossHornet + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCIDs/PerforatorWormIDList.cs b/Systems/Collections/NPCIDs/PerforatorWormIDList.cs new file mode 100644 index 0000000000..4bb42decc1 --- /dev/null +++ b/Systems/Collections/NPCIDs/PerforatorWormIDList.cs @@ -0,0 +1,32 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.Perforator; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class PerforatorWormIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType() + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCIDs/RavagerIDList.cs b/Systems/Collections/NPCIDs/RavagerIDList.cs new file mode 100644 index 0000000000..61dfdb3135 --- /dev/null +++ b/Systems/Collections/NPCIDs/RavagerIDList.cs @@ -0,0 +1,30 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.Ravager; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class RavagerIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + // Purposefully does not include the freed head + List = + [ + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType() + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCIDs/SkeletonIDList.cs b/Systems/Collections/NPCIDs/SkeletonIDList.cs new file mode 100644 index 0000000000..ec63ae51f9 --- /dev/null +++ b/Systems/Collections/NPCIDs/SkeletonIDList.cs @@ -0,0 +1,50 @@ +using System.Collections.Generic; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + public sealed class SkeletonIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCID.Skeleton, + NPCID.HeadacheSkeleton, + NPCID.MisassembledSkeleton, + NPCID.PantlessSkeleton, + NPCID.BoneThrowingSkeleton, + NPCID.BoneThrowingSkeleton2, + NPCID.BoneThrowingSkeleton3, + NPCID.BoneThrowingSkeleton4, + NPCID.BigPantlessSkeleton, + NPCID.SmallPantlessSkeleton, + NPCID.BigMisassembledSkeleton, + NPCID.SmallMisassembledSkeleton, + NPCID.BigHeadacheSkeleton, + NPCID.SmallHeadacheSkeleton, + NPCID.BigSkeleton, + NPCID.SmallSkeleton, + + //Note: These skeletons don't count for Skeleton Banner for some god forsaken reason + NPCID.SkeletonTopHat, + NPCID.SkeletonAstonaut, + NPCID.SkeletonAlien, + + //Other skeleton types + NPCID.ArmoredSkeleton, + NPCID.HeavySkeleton, + NPCID.SkeletonArcher, + NPCID.GreekSkeleton, + NPCID.SporeSkeleton + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCIDs/SkeletronPrimeIDList.cs b/Systems/Collections/NPCIDs/SkeletronPrimeIDList.cs new file mode 100644 index 0000000000..21c182ddfa --- /dev/null +++ b/Systems/Collections/NPCIDs/SkeletronPrimeIDList.cs @@ -0,0 +1,30 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.NormalNPCs; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class SkeletronPrimeIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCID.SkeletronPrime, + NPCType(), + NPCID.PrimeCannon, + NPCID.PrimeLaser, + NPCID.PrimeSaw, + NPCID.PrimeVice + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCIDs/SlimeGodIDList.cs b/Systems/Collections/NPCIDs/SlimeGodIDList.cs new file mode 100644 index 0000000000..85bdebd8b6 --- /dev/null +++ b/Systems/Collections/NPCIDs/SlimeGodIDList.cs @@ -0,0 +1,28 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.SlimeGod; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class SlimeGodIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType() + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCIDs/StormWeaverIDList.cs b/Systems/Collections/NPCIDs/StormWeaverIDList.cs new file mode 100644 index 0000000000..39f1ecd0fa --- /dev/null +++ b/Systems/Collections/NPCIDs/StormWeaverIDList.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.StormWeaver; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class StormWeaverIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCType(), + NPCType(), + NPCType() + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCIDs/ThanatosIDList.cs b/Systems/Collections/NPCIDs/ThanatosIDList.cs new file mode 100644 index 0000000000..8688eac6b6 --- /dev/null +++ b/Systems/Collections/NPCIDs/ThanatosIDList.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.ExoMechs.Thanatos; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class ThanatosIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCType(), + NPCType(), + NPCType(), + NPCType() + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCIDs/ZombieIDList.cs b/Systems/Collections/NPCIDs/ZombieIDList.cs new file mode 100644 index 0000000000..0b5ece97d5 --- /dev/null +++ b/Systems/Collections/NPCIDs/ZombieIDList.cs @@ -0,0 +1,59 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.NormalNPCs; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class ZombieIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCID.Zombie, + NPCID.ArmedZombie, + NPCID.BaldZombie, + NPCID.PincushionZombie, + NPCID.ArmedZombiePincussion, // what is this spelling + NPCID.SlimedZombie, + NPCID.ArmedZombieSlimed, + NPCID.SwampZombie, + NPCID.ArmedZombieSwamp, + NPCID.TwiggyZombie, + NPCID.ArmedZombieTwiggy, + NPCID.FemaleZombie, + NPCID.ArmedZombieCenx, + NPCID.ZombieRaincoat, + NPCID.ZombieEskimo, + NPCID.ArmedZombieEskimo, + NPCID.BigRainZombie, + NPCID.SmallRainZombie, + NPCID.BigFemaleZombie, + NPCID.SmallFemaleZombie, + NPCID.BigTwiggyZombie, + NPCID.SmallTwiggyZombie, + NPCID.BigSwampZombie, + NPCID.SmallSwampZombie, + NPCID.BigSlimedZombie, + NPCID.SmallSlimedZombie, + NPCID.BigPincushionZombie, + NPCID.SmallPincushionZombie, + NPCID.BigBaldZombie, + NPCID.SmallBaldZombie, + NPCID.BigZombie, + NPCID.SmallZombie, + NPCID.MaggotZombie, + NPCType() + // halloween zombies not included because they don't drop shackles or zombie arms + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCs/BossHPScalingList.cs b/Systems/Collections/NPCs/BossHPScalingList.cs new file mode 100644 index 0000000000..5912dbbc55 --- /dev/null +++ b/Systems/Collections/NPCs/BossHPScalingList.cs @@ -0,0 +1,154 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.AstrumAureus; +using CalamityMod.NPCs.BrimstoneElemental; +using CalamityMod.NPCs.Bumblebirb; +using CalamityMod.NPCs.CalClone; +using CalamityMod.NPCs.CeaselessVoid; +using CalamityMod.NPCs.Crabulon; +using CalamityMod.NPCs.Cryogen; +using CalamityMod.NPCs.DesertScourge; +using CalamityMod.NPCs.DevourerofGods; +using CalamityMod.NPCs.HiveMind; +using CalamityMod.NPCs.Leviathan; +using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.NPCs.OldDuke; +using CalamityMod.NPCs.Perforator; +using CalamityMod.NPCs.PlaguebringerGoliath; +using CalamityMod.NPCs.Polterghast; +using CalamityMod.NPCs.PrimordialWyrm; +using CalamityMod.NPCs.ProfanedGuardians; +using CalamityMod.NPCs.Providence; +using CalamityMod.NPCs.Ravager; +using CalamityMod.NPCs.Signus; +using CalamityMod.NPCs.SlimeGod; +using CalamityMod.NPCs.SupremeCalamitas; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + /// + /// A that contains a that has all NPC IDs of bosses or boss minions that have HP scaling. + /// + public sealed class BossHPScalingList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCID.EaterofWorldsHead, + NPCID.EaterofWorldsBody, + NPCID.EaterofWorldsTail, + NPCID.SkeletronHand, + NPCID.WallofFleshEye, + NPCID.TheDestroyerBody, + NPCID.TheDestroyerTail, + NPCID.PrimeCannon, + NPCID.PrimeLaser, + NPCID.PrimeVice, + NPCID.PrimeSaw, + NPCID.GolemHead, + NPCID.GolemHeadFree, + NPCID.GolemFistRight, + NPCID.GolemFistLeft, + NPCID.Sharkron, + NPCID.Sharkron2, + NPCID.MoonLordHead, + NPCID.MoonLordHand, + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType() + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCs/BossRushHPChangeDict.cs b/Systems/Collections/NPCs/BossRushHPChangeDict.cs new file mode 100644 index 0000000000..d55122244f --- /dev/null +++ b/Systems/Collections/NPCs/BossRushHPChangeDict.cs @@ -0,0 +1,130 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.NormalNPCs; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class BossRushHPChangeDict : ModSystem + { + public static IDictionary Dict { get; private set; } + + public override void OnModLoad() + { + Dict = new Dictionary + { + // Tier 1 + { NPCID.KingSlime, 300000 }, // 30 seconds + { NPCID.BlueSlime, 3600 }, + { NPCID.SlimeSpiked, 7200 }, + { NPCID.GreenSlime, 2700 }, + { NPCID.RedSlime, 5400 }, + { NPCID.PurpleSlime, 7200 }, + { NPCID.YellowSlime, 6300 }, + { NPCID.IceSlime, 4500 }, + { NPCID.UmbrellaSlime, 5400 }, + { NPCID.RainbowSlime, 30000 }, + { NPCID.Pinky, 15000 }, + { NPCType(), 21000 }, + { NPCType(), 18000 }, + { NPCType(), 24000 }, + + { NPCID.EyeofCthulhu, 450000 }, // 30 seconds + { NPCID.ServantofCthulhu, 6000 }, + { NPCType(), 12000 }, + + { NPCID.EaterofWorldsHead, 10000 }, // 30 seconds + immunity timer at start + { NPCID.EaterofWorldsBody, 10000 }, + { NPCID.EaterofWorldsTail, 10000 }, + + { NPCID.BrainofCthulhu, 100000 }, // 30 seconds with creepers + { NPCID.Creeper, 10000 }, + + { NPCID.QueenBee, 315000 }, // 30 seconds + { NPCID.Bee, 3000 }, + { NPCID.BeeSmall, 2000 }, + { NPCID.BigHornetHoney, 10000 }, + { NPCID.HornetHoney, 7500 }, + { NPCID.LittleHornetHoney, 5000 }, + + { NPCID.Deerclops, 315000 }, // 30 seconds + + { NPCID.SkeletronHead, 150000 }, // 30 seconds + { NPCID.SkeletronHand, 60000 }, + + { NPCID.WallofFlesh, 450000 }, // 30 seconds + { NPCID.WallofFleshEye, 450000 }, + { NPCID.TheHungry, 10000 }, + { NPCID.TheHungryII, 5000 }, + { NPCID.LeechHead, 5000 }, + { NPCID.LeechBody, 5000 }, + { NPCID.LeechTail, 5000 }, + + // Tier 2 + { NPCID.QueenSlimeBoss, 200000 }, // 30 seconds + { NPCID.QueenSlimeMinionBlue, 6000 }, + { NPCID.QueenSlimeMinionPink, 6000 }, + { NPCID.QueenSlimeMinionPurple, 5000 }, + + { NPCID.Spazmatism, 150000 }, // 30 seconds + { NPCID.Retinazer, 125000 }, + { NPCType(), 137500 }, + + { NPCID.TheDestroyer, 250000 }, // 30 seconds + immunity timer at start + { NPCID.TheDestroyerBody, 250000 }, + { NPCID.TheDestroyerTail, 250000 }, + { NPCID.Probe, 5000 }, + + { NPCID.SkeletronPrime, 160000 }, // 30 seconds + { NPCType(), 160000 }, + { NPCID.PrimeVice, 54000 }, + { NPCID.PrimeCannon, 45000 }, + { NPCID.PrimeSaw, 45000 }, + { NPCID.PrimeLaser, 38000 }, + + { NPCID.Plantera, 160000 }, // 30 seconds + { NPCID.PlanterasTentacle, 5000 }, + { NPCType(), 5000 }, + + // Tier 3 + { NPCID.Golem, 50000 }, // 30 seconds + { NPCID.GolemHead, 30000 }, + { NPCID.GolemHeadFree, 30000 }, + { NPCID.GolemFistLeft, 25000 }, + { NPCID.GolemFistRight, 25000 }, + + { NPCID.HallowBoss, 200000 }, // 30 seconds + + { NPCID.DukeFishron, 290000 }, // 30 seconds + + { NPCID.CultistBoss, 220000 }, // 30 seconds + { NPCID.CultistDragonHead, 60000 }, + { NPCID.CultistDragonBody1, 60000 }, + { NPCID.CultistDragonBody2, 60000 }, + { NPCID.CultistDragonBody3, 60000 }, + { NPCID.CultistDragonBody4, 60000 }, + { NPCID.CultistDragonTail, 60000 }, + { NPCID.AncientCultistSquidhead, 50000 }, + + { NPCID.MoonLordCore, 160000 }, // 1 minute + { NPCID.MoonLordHand, 45000 }, + { NPCID.MoonLordHead, 60000 }, + { NPCID.MoonLordLeechBlob, 800 } + + // 9.5 minutes in total for vanilla Boss Rush bosses + }; + } + + public override void Unload() + { + Dict?.Clear(); + Dict = null; + } + + public static bool TryGet(int npcType, out int newHP) + { + return Dict.TryGetValue(npcType, out newHP); + } + } +} diff --git a/Systems/Collections/NPCs/BossTypeDict.cs b/Systems/Collections/NPCs/BossTypeDict.cs new file mode 100644 index 0000000000..20ddc6d87e --- /dev/null +++ b/Systems/Collections/NPCs/BossTypeDict.cs @@ -0,0 +1,112 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.AquaticScourge; +using CalamityMod.NPCs.AstrumAureus; +using CalamityMod.NPCs.AstrumDeus; +using CalamityMod.NPCs.BrimstoneElemental; +using CalamityMod.NPCs.Bumblebirb; +using CalamityMod.NPCs.CalClone; +using CalamityMod.NPCs.CeaselessVoid; +using CalamityMod.NPCs.Crabulon; +using CalamityMod.NPCs.Cryogen; +using CalamityMod.NPCs.DesertScourge; +using CalamityMod.NPCs.DevourerofGods; +using CalamityMod.NPCs.ExoMechs.Apollo; +using CalamityMod.NPCs.ExoMechs.Ares; +using CalamityMod.NPCs.ExoMechs.Artemis; +using CalamityMod.NPCs.ExoMechs.Thanatos; +using CalamityMod.NPCs.HiveMind; +using CalamityMod.NPCs.Leviathan; +using CalamityMod.NPCs.OldDuke; +using CalamityMod.NPCs.Perforator; +using CalamityMod.NPCs.PlaguebringerGoliath; +using CalamityMod.NPCs.Polterghast; +using CalamityMod.NPCs.ProfanedGuardians; +using CalamityMod.NPCs.Providence; +using CalamityMod.NPCs.Ravager; +using CalamityMod.NPCs.Signus; +using CalamityMod.NPCs.SlimeGod; +using CalamityMod.NPCs.StormWeaver; +using CalamityMod.NPCs.SupremeCalamitas; +using CalamityMod.NPCs.Yharon; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class BossTypeDict : ModSystem + { + public static IDictionary Dict { get; private set; } + + public override void OnModLoad() + { + Dict = new SortedDictionary() + { + { NPCID.KingSlime, 1 }, + { NPCType(), 2 }, + { NPCID.EyeofCthulhu, 3 }, + { NPCType(), 4 }, + { NPCID.EaterofWorldsHead, 5 }, + { NPCID.EaterofWorldsBody, 5 }, + { NPCID.EaterofWorldsTail, 5 }, + { NPCID.BrainofCthulhu, 6 }, + { NPCType(), 7 }, + { NPCType(), 8 }, + { NPCID.QueenBee, 9 }, + { NPCID.SkeletronHead, 10 }, + { NPCType(), 11 }, + { NPCType(), 11 }, + { NPCType(), 11 }, + { NPCID.WallofFlesh, 12 }, + { NPCType(), 13 }, + { NPCID.Retinazer, 14 }, + { NPCID.Spazmatism, 14 }, + { NPCType(), 15 }, + { NPCID.TheDestroyer, 16 }, + { NPCType(), 17 }, + { NPCID.SkeletronPrime, 18 }, + { NPCType(), 19 }, + { NPCID.Plantera, 20 }, + { NPCType(), 21 }, + { NPCType(), 21 }, + { NPCType(), 22 }, + { NPCID.Golem, 23 }, + { NPCType(), 24 }, + { NPCID.DukeFishron, 25 }, + { NPCType(), 26 }, + { NPCID.CultistBoss, 27 }, + { NPCType(), 28 }, + { NPCID.MoonLordCore, 29 }, + { NPCType(), 30 }, + { NPCType(), 31 }, + { NPCType(), 32 }, + { NPCType(), 33 }, + { NPCType(), 34 }, + { NPCType(), 35 }, + { NPCType(), 36 }, + { NPCType(), 37 }, + { NPCType(), 38 }, + { NPCType(), 39 }, + { NPCType(), 40 }, + { NPCType(), 41 }, + { NPCType(), 41 }, + { NPCType(), 41 }, + { NPCType(), 41 }, + { NPCID.QueenSlimeBoss, 42 }, + { NPCID.HallowBoss, 43 }, + { NPCID.Deerclops, 44 } + }; + } + + public override void Unload() + { + Dict?.Clear(); + Dict = null; + } + + public static bool TryGet(int npcType, out int type) + { + return Dict.TryGetValue(npcType, out type); + } + } +} diff --git a/Systems/Collections/NPCs/BossValueDict.cs b/Systems/Collections/NPCs/BossValueDict.cs new file mode 100644 index 0000000000..43b450ad80 --- /dev/null +++ b/Systems/Collections/NPCs/BossValueDict.cs @@ -0,0 +1,49 @@ +using System.Collections.Generic; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + public sealed class BossValueDict : ModSystem + { + public static IDictionary Dict { get; private set; } + + public override void OnModLoad() + { + // NOTE: This does not account for Calamity's base value increases + Dict = new SortedDictionary + { + { NPCID.KingSlime, Item.buyPrice(0, 2) }, + { NPCID.EyeofCthulhu, Item.buyPrice(0, 2) }, + // Evil bosses drop 5 gold in vanilla; unmodified + { NPCID.QueenBee, Item.buyPrice(0, 8) }, + { NPCID.Deerclops, Item.buyPrice(0, 8) }, + { NPCID.SkeletronHead, Item.buyPrice(0, 12) }, + { NPCID.WallofFlesh, Item.buyPrice(0, 12) }, + { NPCID.QueenSlimeBoss, Item.buyPrice(0, 16) }, + { NPCID.Spazmatism, Item.buyPrice(0, 16) }, + { NPCID.Retinazer, Item.buyPrice(0, 16) }, + { NPCID.TheDestroyer, Item.buyPrice(0, 16) }, + { NPCID.SkeletronPrime, Item.buyPrice(0, 16) }, + { NPCID.Plantera, Item.buyPrice(0, 20) }, + { NPCID.Golem, Item.buyPrice(0, 25) }, + { NPCID.HallowBoss, Item.buyPrice(0, 30) }, + { NPCID.DukeFishron, Item.buyPrice(0, 30) }, + { NPCID.CultistBoss, Item.buyPrice(0, 50) } + // Moon Lord drops 1 plat in vanilla; unmodified + }; + } + + public override void Unload() + { + Dict?.Clear(); + Dict = null; + } + + public static bool TryGet(int npcType, out int value) + { + return Dict.TryGetValue(npcType, out value); + } + } +} diff --git a/Systems/Collections/NPCs/BuffedDungeonEnemiesList.cs b/Systems/Collections/NPCs/BuffedDungeonEnemiesList.cs new file mode 100644 index 0000000000..78c00a647b --- /dev/null +++ b/Systems/Collections/NPCs/BuffedDungeonEnemiesList.cs @@ -0,0 +1,52 @@ +using System.Collections.Generic; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + /// + /// A which contains a of all NPC's IDs of NPCs who are buffed dungeon enemies. + /// + public sealed class BuffedDungeonEnemiesList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCID.SkeletonSniper, + NPCID.TacticalSkeleton, + NPCID.SkeletonCommando, + NPCID.Paladin, + NPCID.GiantCursedSkull, + NPCID.BoneLee, + NPCID.DiabolistWhite, + NPCID.DiabolistRed, + NPCID.NecromancerArmored, + NPCID.Necromancer, + NPCID.RaggedCasterOpenCoat, + NPCID.RaggedCaster, + NPCID.HellArmoredBonesSword, + NPCID.HellArmoredBonesMace, + NPCID.HellArmoredBonesSpikeShield, + NPCID.HellArmoredBones, + NPCID.BlueArmoredBonesSword, + NPCID.BlueArmoredBonesNoPants, + NPCID.BlueArmoredBonesMace, + NPCID.BlueArmoredBones, + NPCID.RustyArmoredBonesSwordNoArmor, + NPCID.RustyArmoredBonesSword, + NPCID.RustyArmoredBonesFlail, + NPCID.RustyArmoredBonesAxe + ]; + } + + public override void Unload() => List = null; + + /// + /// A shorthand method to check if an NPC is a buffed Dungeon enemy. + /// + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCs/DeathModeSplittingWormList.cs b/Systems/Collections/NPCs/DeathModeSplittingWormList.cs new file mode 100644 index 0000000000..9a9f638071 --- /dev/null +++ b/Systems/Collections/NPCs/DeathModeSplittingWormList.cs @@ -0,0 +1,31 @@ +using System.Collections.Generic; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + public sealed class DeathModeSplittingWormList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCID.DuneSplicerHead, + NPCID.DuneSplicerBody, + NPCID.DuneSplicerTail, + NPCID.DiggerHead, + NPCID.DiggerBody, + NPCID.DiggerTail, + NPCID.SeekerHead, + NPCID.SeekerBody, + NPCID.SeekerTail + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCs/EclipseBuffList.cs b/Systems/Collections/NPCs/EclipseBuffList.cs new file mode 100644 index 0000000000..aaff7f27b1 --- /dev/null +++ b/Systems/Collections/NPCs/EclipseBuffList.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + /// + /// A that contains a of all NPC Types that receive Post-DoG Eclipse Buff + /// + public sealed class EclipseBuffList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCID.Eyezor, + NPCID.Reaper, + NPCID.Frankenstein, + NPCID.SwampThing, + NPCID.Vampire, + NPCID.VampireBat, + NPCID.Butcher, + NPCID.CreatureFromTheDeep, + NPCID.Fritz, + NPCID.Nailhead, + NPCID.Psycho, + NPCID.DeadlySphere, + NPCID.DrManFly, + NPCID.ThePossessed, + NPCID.Mothron, + NPCID.MothronEgg, + NPCID.MothronSpawn + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCs/EnemyImmunitiesList.cs b/Systems/Collections/NPCs/EnemyImmunitiesList.cs new file mode 100644 index 0000000000..667c66cc2b --- /dev/null +++ b/Systems/Collections/NPCs/EnemyImmunitiesList.cs @@ -0,0 +1,190 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.Abyss; +using CalamityMod.NPCs.AcidRain; +using CalamityMod.NPCs.AquaticScourge; +using CalamityMod.NPCs.AstrumAureus; +using CalamityMod.NPCs.Bumblebirb; +using CalamityMod.NPCs.CalClone; +using CalamityMod.NPCs.Cryogen; +using CalamityMod.NPCs.DesertScourge; +using CalamityMod.NPCs.GreatSandShark; +using CalamityMod.NPCs.Leviathan; +using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.NPCs.OldDuke; +using CalamityMod.NPCs.Perforator; +using CalamityMod.NPCs.PlaguebringerGoliath; +using CalamityMod.NPCs.PlagueEnemies; +using CalamityMod.NPCs.ProfanedGuardians; +using CalamityMod.NPCs.Providence; +using CalamityMod.NPCs.Ravager; +using CalamityMod.NPCs.SlimeGod; +using CalamityMod.NPCs.SunkenSea; +using CalamityMod.NPCs.SupremeCalamitas; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + /// + /// A that contains all of the NPC IDs of all NPCs that are immune to special debuffs. + /// + public sealed class EnemyImmunitiesList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCID.KingSlime, + NPCType(), + NPCType(), + NPCType(), + NPCID.EyeofCthulhu, + NPCType(), + NPCID.EaterofWorldsHead, + NPCID.EaterofWorldsBody, + NPCID.EaterofWorldsTail, + NPCID.BrainofCthulhu, + NPCID.Creeper, + NPCID.QueenBee, + NPCID.Deerclops, + NPCID.SkeletronHead, + NPCID.SkeletronHand, + NPCID.WallofFlesh, + NPCID.WallofFleshEye, + NPCID.PirateShipCannon, + NPCID.QueenSlimeBoss, + NPCID.Probe, + NPCID.Retinazer, + NPCID.Spazmatism, + NPCType(), + NPCID.SkeletronPrime, + NPCType(), + NPCID.PrimeCannon, + NPCID.PrimeSaw, + NPCID.PrimeLaser, + NPCID.PrimeVice, + NPCID.Plantera, + NPCID.PlanterasTentacle, + NPCType(), + NPCID.Everscream, + NPCID.SantaNK1, + NPCID.IceQueen, + NPCID.MourningWood, + NPCID.Pumpking, + NPCID.Mothron, + NPCID.Golem, + NPCID.GolemHead, + NPCID.GolemHeadFree, + NPCID.GolemFistRight, + NPCID.GolemFistLeft, + NPCID.MartianSaucerCore, + NPCID.MartianSaucerCannon, + NPCID.MartianSaucerTurret, + NPCID.DukeFishron, + NPCID.Sharkron, + NPCID.Sharkron2, + NPCID.HallowBoss, + NPCID.CultistBoss, + NPCID.CultistDragonHead, + NPCID.CultistDragonBody1, + NPCID.CultistDragonBody2, + NPCID.CultistDragonBody3, + NPCID.CultistDragonBody4, + NPCID.CultistDragonTail, + NPCID.AncientCultistSquidhead, + NPCID.MoonLordHead, + NPCID.MoonLordHand, + NPCID.MoonLordCore, + NPCID.MoonLordFreeEye, + NPCID.DD2WyvernT1, + NPCID.DD2WyvernT2, + NPCID.DD2WyvernT3, + NPCID.DD2DarkMageT1, + NPCID.DD2DarkMageT3, + NPCID.DD2SkeletonT1, + NPCID.DD2SkeletonT3, + NPCID.DD2WitherBeastT2, + NPCID.DD2WitherBeastT3, + NPCID.DD2DrakinT2, + NPCID.DD2DrakinT3, + NPCID.DD2KoboldWalkerT2, + NPCID.DD2KoboldWalkerT3, + NPCID.DD2KoboldFlyerT2, + NPCID.DD2KoboldFlyerT3, + NPCID.DD2OgreT2, + NPCID.DD2OgreT3, + NPCID.DD2Betsy, + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType() + ]; + } + + public override void Unload() => List = null; + + /// + /// A shorthand method to check if an NPC is in this list. + /// + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCs/FrostMoonBuffList.cs b/Systems/Collections/NPCs/FrostMoonBuffList.cs new file mode 100644 index 0000000000..d94d780e9e --- /dev/null +++ b/Systems/Collections/NPCs/FrostMoonBuffList.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + /// + /// A that contains a of all NPC Types that receive Post-DoG Frost Moon Buff + /// + public sealed class FrostMoonBuffList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCID.ZombieElf, + NPCID.ZombieElfBeard, + NPCID.ZombieElfGirl, + NPCID.PresentMimic, + NPCID.GingerbreadMan, + NPCID.Yeti, + NPCID.Everscream, + NPCID.IceQueen, + NPCID.SantaNK1, + NPCID.ElfCopter, + NPCID.Nutcracker, + NPCID.NutcrackerSpinning, + NPCID.ElfArcher, + NPCID.Krampus, + NPCID.Flocko + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCs/HardmodeNPCNerfList.cs b/Systems/Collections/NPCs/HardmodeNPCNerfList.cs new file mode 100644 index 0000000000..a8d0a144bd --- /dev/null +++ b/Systems/Collections/NPCs/HardmodeNPCNerfList.cs @@ -0,0 +1,155 @@ +using System.Collections.Generic; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + public sealed class HardmodeNPCNerfList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + // Reduce contact damage by 25% + List = + [ + NPCID.AnglerFish, + NPCID.AngryTrapper, + NPCID.Arapaima, + NPCID.BlackRecluse, + NPCID.BlackRecluseWall, + NPCID.BloodJelly, + NPCID.FungoFish, + NPCID.GreenJellyfish, + NPCID.Clinger, + NPCID.ArmoredSkeleton, + NPCID.ArmoredViking, + NPCID.Mummy, + NPCID.DarkMummy, + NPCID.LightMummy, + NPCID.BloodFeeder, + NPCID.DesertBeast, + NPCID.ChaosElemental, + NPCID.BloodMummy, + NPCID.CorruptSlime, + NPCID.Slimeling, + NPCID.Corruptor, + NPCID.Crimslime, + NPCID.BigCrimslime, + NPCID.LittleCrimslime, + NPCID.CrimsonAxe, + NPCID.CursedHammer, + NPCID.Derpling, + NPCID.Herpling, + NPCID.DiggerHead, + NPCID.DesertGhoul, + NPCID.DesertGhoulCorruption, + NPCID.DesertGhoulCrimson, + NPCID.DesertGhoulHallow, + NPCID.DuneSplicerHead, + NPCID.EnchantedSword, + NPCID.FloatyGross, + NPCID.GiantBat, + NPCID.GiantFlyingFox, + NPCID.FungiSpore, + NPCID.GiantTortoise, + NPCID.IceTortoise, + NPCID.HoppinJack, + NPCID.Mimic, + NPCID.IlluminantBat, + NPCID.IlluminantSlime, + NPCID.JungleCreeper, + NPCID.JungleCreeperWall, + NPCID.DesertLamiaDark, + NPCID.DesertLamiaLight, + NPCID.BigMossHornet, + NPCID.GiantMossHornet, + NPCID.LittleMossHornet, + NPCID.MossHornet, + NPCID.TinyMossHornet, + NPCID.Moth, + NPCID.PigronCorruption, + NPCID.PigronCrimson, + NPCID.PigronHallow, + NPCID.Pixie, + NPCID.PossessedArmor, + NPCID.RockGolem, + NPCID.DesertScorpionWalk, + NPCID.DesertScorpionWall, + NPCID.Slimer, + NPCID.Slimer2, + NPCID.ToxicSludge, + NPCID.Unicorn, + NPCID.WanderingEye, + NPCID.Werewolf, + NPCID.Wolf, + NPCID.SeekerHead, + NPCID.Wraith, + NPCID.ChatteringTeethBomb, + NPCID.IceGolem, + NPCID.RainbowSlime, + NPCID.SandShark, + NPCID.SandsharkCorrupt, + NPCID.SandsharkCrimson, + NPCID.SandsharkHallow, + NPCID.ShadowFlameApparition, + NPCID.Parrot, + NPCID.PirateCorsair, + NPCID.PirateDeckhand, + NPCID.PirateGhost, + NPCID.BlueArmoredBonesMace, + NPCID.BlueArmoredBonesSword, + NPCID.BoneLee, + NPCID.DungeonSpirit, + NPCID.FlyingSnake, + NPCID.HellArmoredBones, + NPCID.HellArmoredBonesSpikeShield, + NPCID.HellArmoredBonesSword, + NPCID.MisterStabby, + NPCID.Butcher, + NPCID.CreatureFromTheDeep, + NPCID.DeadlySphere, + NPCID.Frankenstein, + NPCID.Fritz, + NPCID.Psycho, + NPCID.Reaper, + NPCID.SwampThing, + NPCID.ThePossessed, + NPCID.Vampire, + NPCID.VampireBat, + NPCID.HeadlessHorseman, + NPCID.Hellhound, + NPCID.Poltergeist, + NPCID.Scarecrow1, + NPCID.Scarecrow2, + NPCID.Scarecrow3, + NPCID.Scarecrow4, + NPCID.Scarecrow5, + NPCID.Scarecrow6, + NPCID.Scarecrow7, + NPCID.Scarecrow8, + NPCID.Scarecrow9, + NPCID.Scarecrow10, + NPCID.Splinterling, + NPCID.Flocko, + NPCID.GingerbreadMan, + NPCID.Krampus, + NPCID.Nutcracker, + NPCID.NutcrackerSpinning, + NPCID.PresentMimic, + NPCID.Yeti, + NPCID.ZombieElf, + NPCID.ZombieElfBeard, + NPCID.ZombieElfGirl, + NPCID.BloodEelHead, + NPCID.GoblinShark, + NPCID.EyeballFlyingFish, + NPCID.ZombieMerman + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCs/MinibossList.cs b/Systems/Collections/NPCs/MinibossList.cs new file mode 100644 index 0000000000..97353eb626 --- /dev/null +++ b/Systems/Collections/NPCs/MinibossList.cs @@ -0,0 +1,52 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.Abyss; +using CalamityMod.NPCs.AcidRain; +using CalamityMod.NPCs.GreatSandShark; +using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.NPCs.PlagueEnemies; +using CalamityMod.NPCs.SunkenSea; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class MinibossList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCID.Pumpking, + NPCID.MourningWood, + NPCID.IceQueen, + NPCID.SantaNK1, + NPCID.Everscream, + NPCID.DD2Betsy, + NPCID.Mothron, + NPCID.MartianSaucer, + NPCID.MartianSaucerCannon, + NPCID.MartianSaucerCore, + NPCID.MartianSaucerTurret + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCs/NoRageWormSegmentList.cs b/Systems/Collections/NPCs/NoRageWormSegmentList.cs new file mode 100644 index 0000000000..456dbaa828 --- /dev/null +++ b/Systems/Collections/NPCs/NoRageWormSegmentList.cs @@ -0,0 +1,47 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.AquaticScourge; +using CalamityMod.NPCs.AstrumDeus; +using CalamityMod.NPCs.DesertScourge; +using CalamityMod.NPCs.DevourerofGods; +using CalamityMod.NPCs.ExoMechs.Ares; +using CalamityMod.NPCs.ExoMechs.Thanatos; +using CalamityMod.NPCs.StormWeaver; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class NoRageWormSegmentList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType() + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCs/PierceResistList.cs b/Systems/Collections/NPCs/PierceResistList.cs new file mode 100644 index 0000000000..efbe96843f --- /dev/null +++ b/Systems/Collections/NPCs/PierceResistList.cs @@ -0,0 +1,88 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.AquaticScourge; +using CalamityMod.NPCs.AstrumAureus; +using CalamityMod.NPCs.AstrumDeus; +using CalamityMod.NPCs.CeaselessVoid; +using CalamityMod.NPCs.DesertScourge; +using CalamityMod.NPCs.DevourerofGods; +using CalamityMod.NPCs.ExoMechs.Ares; +using CalamityMod.NPCs.ExoMechs.Thanatos; +using CalamityMod.NPCs.Leviathan; +using CalamityMod.NPCs.Perforator; +using CalamityMod.NPCs.ProfanedGuardians; +using CalamityMod.NPCs.Ravager; +using CalamityMod.NPCs.StormWeaver; +using CalamityMod.NPCs.SupremeCalamitas; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class PierceResistList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCID.EaterofWorldsHead, + NPCID.EaterofWorldsBody, + NPCID.EaterofWorldsTail, + NPCID.Creeper, + NPCID.TheDestroyer, + NPCID.TheDestroyerBody, + NPCID.TheDestroyerTail, + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType() + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCs/PumpkinMoonBuffList.cs b/Systems/Collections/NPCs/PumpkinMoonBuffList.cs new file mode 100644 index 0000000000..6ab32c0323 --- /dev/null +++ b/Systems/Collections/NPCs/PumpkinMoonBuffList.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + /// + /// A that contains a of all NPC Types that receive Post-DoG Pumpkin Moon Buff + /// + public sealed class PumpkinMoonBuffList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCID.Scarecrow1, + NPCID.Scarecrow2, + NPCID.Scarecrow3, + NPCID.Scarecrow4, + NPCID.Scarecrow5, + NPCID.Scarecrow6, + NPCID.Scarecrow7, + NPCID.Scarecrow8, + NPCID.Scarecrow9, + NPCID.Scarecrow10, + NPCID.HeadlessHorseman, + NPCID.MourningWood, + NPCID.Splinterling, + NPCID.Pumpking, + NPCID.PumpkingBlade, + NPCID.Hellhound, + NPCID.Poltergeist + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NPCs/ZeroContactDamageNPCList.cs b/Systems/Collections/NPCs/ZeroContactDamageNPCList.cs new file mode 100644 index 0000000000..dbc3aa6ffd --- /dev/null +++ b/Systems/Collections/NPCs/ZeroContactDamageNPCList.cs @@ -0,0 +1,154 @@ +using System.Collections.Generic; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems.Collections +{ + public sealed class ZeroContactDamageNPCList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCID.Harpy, + NPCID.Salamander, + NPCID.Salamander2, + NPCID.Salamander3, + NPCID.Salamander4, + NPCID.Salamander5, + NPCID.Salamander6, + NPCID.Salamander7, + NPCID.Salamander8, + NPCID.Salamander9, + NPCID.GiantCursedSkull, + NPCID.FungiBulb, + NPCID.GiantFungiBulb, + NPCID.IcyMerman, + NPCID.AngryNimbus, + NPCID.SandElemental, + NPCID.DarkCaster, + NPCID.FireImp, + NPCID.Tim, + NPCID.CultistArcherBlue, + NPCID.DesertDjinn, + NPCID.DiabolistRed, + NPCID.DiabolistWhite, + NPCID.Gastropod, + NPCID.IceElemental, + NPCID.IchorSticker, + NPCID.Necromancer, + NPCID.NecromancerArmored, + NPCID.RaggedCaster, + NPCID.RaggedCasterOpenCoat, + NPCID.RuneWizard, + NPCID.SkeletonArcher, + NPCID.SkeletonCommando, + NPCID.SkeletonSniper, + NPCID.TacticalSkeleton, + NPCID.Clown, + NPCID.GoblinArcher, + NPCID.GoblinSorcerer, + NPCID.GoblinSummoner, + NPCID.PirateCrossbower, + NPCID.PirateDeadeye, + NPCID.PirateCaptain, + NPCID.SnowmanGangsta, + NPCID.SnowBalla, + NPCID.DrManFly, + NPCID.Eyezor, + NPCID.Nailhead, + NPCID.BrainScrambler, + NPCID.GigaZapper, + NPCID.RayGunner, + NPCID.ScutlixRider, + NPCID.MartianWalker, + NPCID.MartianTurret, + NPCID.ElfCopter, + NPCID.ElfArcher, + NPCID.NebulaBrain, + NPCID.NebulaSoldier, + NPCID.StardustCellSmall, + NPCID.StardustJellyfishBig, + NPCID.StardustSoldier, + NPCID.StardustSpiderBig, + NPCID.VortexHornetQueen, + NPCID.VortexRifleman, + NPCID.VortexSoldier, + NPCID.PirateShipCannon, + NPCID.MartianSaucer, + NPCID.MartianSaucerCannon, + NPCID.MartianSaucerCore, + NPCID.MartianSaucerTurret, + NPCID.Probe, + NPCID.CultistBoss, + NPCID.GolemHead, + NPCID.GolemHeadFree, + NPCID.MoonLordFreeEye, + NPCID.BloodSquid, + NPCID.PlanterasHook, + NPCID.Dandelion, + NPCID.DD2DarkMageT1, + NPCID.DD2DarkMageT3, + NPCID.DD2OgreT2, + NPCID.DD2OgreT3, + NPCID.DD2GoblinBomberT1, + NPCID.DD2GoblinBomberT2, + NPCID.DD2GoblinBomberT3, + NPCID.DD2JavelinstT1, + NPCID.DD2JavelinstT2, + NPCID.DD2JavelinstT3, + NPCID.DD2KoboldWalkerT2, + NPCID.DD2KoboldWalkerT3, + NPCID.DD2DrakinT2, + NPCID.DD2DrakinT3, + NPCID.DD2KoboldFlyerT2, + NPCID.DD2KoboldFlyerT3, + NPCID.DD2WitherBeastT2, + NPCID.DD2WitherBeastT3, + NPCID.DD2LightningBugT3, + NPCID.MourningWood, + NPCID.Pumpking, + NPCID.Everscream, + NPCID.IceQueen, + NPCID.SantaNK1, + NPCID.DevourerBody, + NPCID.DevourerTail, + NPCID.DiggerBody, + NPCID.DiggerTail, + NPCID.TombCrawlerBody, + NPCID.TombCrawlerTail, + NPCID.DuneSplicerBody, + NPCID.DuneSplicerTail, + NPCID.GiantWormBody, + NPCID.GiantWormTail, + NPCID.LeechBody, + NPCID.LeechTail, + NPCID.StardustWormBody, + NPCID.StardustWormTail, + NPCID.SeekerBody, + NPCID.SeekerTail, + NPCID.BoneSerpentBody, + NPCID.BoneSerpentTail, + NPCID.WyvernBody, + NPCID.WyvernTail, + NPCID.WyvernBody2, + NPCID.WyvernBody3, + NPCID.WyvernLegs, + NPCID.CultistDragonBody1, + NPCID.CultistDragonBody2, + NPCID.CultistDragonBody3, + NPCID.CultistDragonBody4, + NPCID.CultistDragonTail, + NPCID.BloodEelBody, + NPCID.BloodEelTail, + NPCID.AncientDoom + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/NeedsDebuffIconDisplayList.cs b/Systems/Collections/NeedsDebuffIconDisplayList.cs new file mode 100644 index 0000000000..1cd6d90efe --- /dev/null +++ b/Systems/Collections/NeedsDebuffIconDisplayList.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.NormalNPCs; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class NeedsDebuffIconDisplayList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCID.TargetDummy, + NPCID.WallofFleshEye, + NPCType() + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int npcType) => List.Contains(npcType); + } +} diff --git a/Systems/Collections/PersistentBuffList.cs b/Systems/Collections/PersistentBuffList.cs new file mode 100644 index 0000000000..01e165e604 --- /dev/null +++ b/Systems/Collections/PersistentBuffList.cs @@ -0,0 +1,38 @@ +using System.Collections.Generic; +using CalamityMod.Buffs.Potions; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class PersistentBuffList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + BuffType(), + BuffType(), + BuffType(), + BuffID.WeaponImbueVenom, + BuffID.WeaponImbueCursedFlames, + BuffID.WeaponImbueFire, + BuffID.WeaponImbueGold, + BuffID.WeaponImbueIchor, + BuffID.WeaponImbueNanites, + BuffID.WeaponImbueConfetti, + BuffID.WeaponImbuePoison + ]; + } + + public override void Unload() => List = null; + + /// + /// A shorthand method to check if this buffType is a PersistentBuff. + /// + public static bool Includes(int buffType) => List.Contains(buffType); + } +} diff --git a/Systems/Collections/PierceResistExceptionLeviAureusList.cs b/Systems/Collections/PierceResistExceptionLeviAureusList.cs new file mode 100644 index 0000000000..4c3f202da1 --- /dev/null +++ b/Systems/Collections/PierceResistExceptionLeviAureusList.cs @@ -0,0 +1,35 @@ +using System.Collections.Generic; +using CalamityMod.Projectiles.Magic; +using CalamityMod.Projectiles.Ranged; +using CalamityMod.Projectiles.Rogue; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class PierceResistExceptionLeviAureusList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + ProjectileID.NettleBurstEnd, + ProjectileID.NettleBurstLeft, + ProjectileID.NettleBurstRight, + ProjectileID.PrincessWeapon, + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType() + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int projectileType) => List.Contains(projectileType); + } +} diff --git a/Systems/Collections/PierceResistExceptionList.cs b/Systems/Collections/PierceResistExceptionList.cs new file mode 100644 index 0000000000..acbb5de9ca --- /dev/null +++ b/Systems/Collections/PierceResistExceptionList.cs @@ -0,0 +1,101 @@ +using System.Collections.Generic; +using CalamityMod.Projectiles.DraedonsArsenal; +using CalamityMod.Projectiles.Magic; +using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Melee.MaceFlails; +using CalamityMod.Projectiles.Ranged; +using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Summon; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class PierceResistExceptionList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + ProjectileID.Arkhalis, + ProjectileID.ChargedBlasterLaser, + ProjectileID.ClingerStaff, + ProjectileID.FinalFractal, + ProjectileID.FlyingKnife, + ProjectileID.LastPrismLaser, + ProjectileID.MechanicalPiranha, + ProjectileID.MonkStaffT3, + ProjectileID.PiercingStarlight, + ProjectileID.Terragrim, + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int projectileType) => List.Contains(projectileType); + } +} diff --git a/Systems/Collections/ProjectileDestroyExceptionsList.cs b/Systems/Collections/ProjectileDestroyExceptionsList.cs new file mode 100644 index 0000000000..3c2315dc33 --- /dev/null +++ b/Systems/Collections/ProjectileDestroyExceptionsList.cs @@ -0,0 +1,147 @@ +using System.Collections.Generic; +using CalamityMod.Projectiles.Boss; +using CalamityMod.Projectiles.DraedonsArsenal; +using CalamityMod.Projectiles.Magic; +using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Ranged; +using CalamityMod.Projectiles.Rogue; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + /// + /// A that holds a list of all projectiles that should be, exceptionally, ignored by projectile destruction. + /// + public sealed class ProjectileDestroyExceptionsList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + // Holdout projectiles. + ProjectileID.Phantasm, + ProjectileID.VortexBeater, + ProjectileID.DD2PhoenixBow, + ProjectileID.LastPrism, + ProjectileID.LastPrismLaser, + ProjectileID.LaserMachinegun, + ProjectileID.ChargedBlasterCannon, + ProjectileID.MedusaHead, + + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + + // Some hostile boss projectiles. + ProjectileID.SaucerDeathray, + ProjectileID.PhantasmalDeathray, + + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType() + ]; + } + + public override void Unload() => List = null; + + /// + /// A shorthand method to check if a projectile belongs in the exception list. + /// + public static bool Includes(int projType) => List.Contains(projType); + } +} diff --git a/Systems/Collections/SicknessDebuffsList.cs b/Systems/Collections/SicknessDebuffsList.cs new file mode 100644 index 0000000000..7d687952a6 --- /dev/null +++ b/Systems/Collections/SicknessDebuffsList.cs @@ -0,0 +1,39 @@ +using System.Collections.Generic; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + /// + /// A that contains a that has all the Sickness Debuffs' IDs. + /// + public sealed class SicknessDebuffsList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + BuffID.Poisoned, + BuffID.Venom, + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType() + ]; + } + + public override void Unload() => List = null; + + /// + /// A shorthand method to check if a buff ID is a Sickness Debuff. + /// + public static bool Includes(int buffID) => List.Contains(buffID); + } +} diff --git a/Systems/Collections/SunkenSeaBiomeCorrespondentDict.cs b/Systems/Collections/SunkenSeaBiomeCorrespondentDict.cs new file mode 100644 index 0000000000..5fb07cab3d --- /dev/null +++ b/Systems/Collections/SunkenSeaBiomeCorrespondentDict.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using CalamityMod.BiomeManagers; +using CalamityMod.Enums; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + /// + /// Each Sunken Sea subbiome has a correspoding spawn condition boolean value and a biome type. + /// + public sealed class SunkenSeaBiomeCorrespondentDict : ModSystem + { + public static IDictionary SpawnCondition, int BiomeType)> Dict { get; private set; } + + public override void OnModLoad() + { + Dict = new Dictionary SpawnCondition, int BiomeType)>() + { + { 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() + { + Dict?.Clear(); + Dict = null; + } + + public static bool TryGet(SunkenSeaBiomeFlags flags, out Func spawnCondition, out int biomeType) + { + if (!Dict.TryGetValue(flags, out var biomeInfoTuple)) + { + spawnCondition = null; + biomeType = default; + return false; + } + + spawnCondition = biomeInfoTuple.SpawnCondition; + biomeType = biomeInfoTuple.BiomeType; + return true; + } + } +} diff --git a/Systems/Collections/VeneratedLocketBanList.cs b/Systems/Collections/VeneratedLocketBanList.cs new file mode 100644 index 0000000000..bc241f08ac --- /dev/null +++ b/Systems/Collections/VeneratedLocketBanList.cs @@ -0,0 +1,34 @@ +using System.Collections.Generic; +using CalamityMod.Items.Weapons.Rogue; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + /// + /// To ban projectiles from locket, mainly spikeballs altho Toasty asked me to add mod calls for adding stuff like Dreamtastic + /// + public sealed class VeneratedLocketBanList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType() + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int itemType) => List.Contains(itemType); + } +} diff --git a/Systems/Mechanic/RecipeSystem.cs b/Systems/Mechanic/RecipeSystem.cs index b913649b98..03a2cd8662 100644 --- a/Systems/Mechanic/RecipeSystem.cs +++ b/Systems/Mechanic/RecipeSystem.cs @@ -1716,22 +1716,6 @@ namespace CalamityMod.Systems r.AddTile(TileID.Loom); r.Register(); r.DisableDecraft(); - - // Band of Regeneration - r = Recipe.Create(ItemID.BandofRegeneration); - r.AddIngredient(ItemID.Shackle); - r.AddIngredient(ItemID.LifeCrystal, 1); - r.AddTile(TileID.Anvils); - r.Register(); - r.DisableDecraft(); - - // Flare Gun - r = Recipe.Create(ItemID.FlareGun); - r.AddRecipeGroup(AnyCopperBar, 5); - r.AddIngredient(ItemID.Torch, 10); - r.AddTile(TileID.Anvils); - r.Register(); - r.DisableDecraft(); } #endregion diff --git a/Systems/ResizeArrayHook.cs b/Systems/ResizeArrayHook.cs new file mode 100644 index 0000000000..e5ffa028d2 --- /dev/null +++ b/Systems/ResizeArrayHook.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + internal delegate void ResizeArrayDelegate(bool unloading); + + internal sealed class ResizeArrayHook : ModSystem + { + public static event ResizeArrayDelegate OnResizeArrays; + public static event ResizeArrayDelegate OnPostResizeArrays; + + public override void Load() + { + var resizeArrayMethod = typeof(ModContent).GetMethod("ResizeArrays", BindingFlags.NonPublic | BindingFlags.Static); + MonoModHooks.Add(resizeArrayMethod, ResizeArrays); + } + + private static void ResizeArrays(ResizeArrayDelegate orig, bool unloading) + { + OnResizeArrays?.Invoke(unloading); + orig(unloading); + OnPostResizeArrays?.Invoke(unloading); + } + + // MonoMod Hook Unloads before this being called + // So we forcely call ResizeArray with Unload true + public override void Unload() + { + OnResizeArrays?.Invoke(unloading: true); + OnPostResizeArrays?.Invoke(unloading: true); + + OnResizeArrays = null; + OnPostResizeArrays = null; + } + } +} diff --git a/Systems/TileMerging/TileBlendMergeSystem.cs b/Systems/TileMerging/TileBlendMergeSystem.cs index dd11372a56..88658e9bc5 100644 --- a/Systems/TileMerging/TileBlendMergeSystem.cs +++ b/Systems/TileMerging/TileBlendMergeSystem.cs @@ -1,28 +1,6 @@ using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Threading.Tasks; -using CalamityMod.Graphics; -using CalamityMod.Tiles.Abyss; -using CalamityMod.Tiles.Astral; -using CalamityMod.Tiles.AstralDesert; -using CalamityMod.Tiles.AstralSnow; -using CalamityMod.Tiles.SunkenSea; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using MonoMod.Utils; -using Newtonsoft.Json.Linq; -using ReLogic.Content; using Terraria; -using Terraria.DataStructures; using Terraria.GameContent.Drawing; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Systems @@ -33,26 +11,62 @@ namespace CalamityMod.Systems private static bool[,] _TileBlendable; // dimension: [TileTypeCount, AllBlendTextureCount] private static bool[,] _TileBlendLooselyFillDiagonal; // dimension: [TileTypeCount, AllBlendTextureCount] private static byte[] _TileTypeToBlendTextureSlot; // dimension: [TileTypeCount] + private static bool _IDSetsInitialized = false; #region Load/Unload public override void OnModLoad() { - var tileCount = TileLoader.TileCount; - var blendTextureCount = TileBlendTextureLoader.Count; - _TileBlendable = new bool[tileCount, blendTextureCount]; - _TileBlendLooselyFillDiagonal = new bool[tileCount, blendTextureCount]; - _TileTypeToBlendTextureSlot = new byte[tileCount]; - - Array.Fill(_TileTypeToBlendTextureSlot, (byte)TileBlendTextureLoader.EmptySlot); - - for (int i = 0; i(ref T[,] array, int newColNum, int newRowNum) + { + var newArray = new T[newColNum, newRowNum]; + int colCount = array.GetLength(1); + int newColCount = newRowNum; + int cols = array.GetUpperBound(0); + for (int co = 0; co <= cols; co++) + Array.Copy(array, co * colCount, newArray, co * newColCount, colCount); + array = newArray; } private static void SetupMergeData() @@ -62,13 +76,6 @@ namespace CalamityMod.Systems blendTexture.BakeBlendTexture(blendTexture.TextureAsset.Value); } } - - public override void Unload() - { - _TileBlendable = null; - _TileBlendLooselyFillDiagonal = null; - _TileTypeToBlendTextureSlot = null; - } #endregion #region Public API diff --git a/Systems/TileMerging/TileBlendMergeSystem_Draw.cs b/Systems/TileMerging/TileBlendMergeSystem_Draw.cs index 5a37663367..207c4bc4ea 100644 --- a/Systems/TileMerging/TileBlendMergeSystem_Draw.cs +++ b/Systems/TileMerging/TileBlendMergeSystem_Draw.cs @@ -1,30 +1,75 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Microsoft.Xna.Framework.Graphics; using Terraria.DataStructures; using Terraria; using Terraria.ModLoader; using Microsoft.Xna.Framework; using Terraria.GameContent.Drawing; +using System.Reflection; +using Terraria.ID; namespace CalamityMod.Systems { public sealed partial class TileBlendMergeSystem : ModSystem { + private static readonly BindingFlags NonPublicStatic = BindingFlags.NonPublic | BindingFlags.Static; + private static readonly BindingFlags NonPublicInstance = BindingFlags.NonPublic | BindingFlags.Instance; + + private static readonly FastField MediumQualityLightRequirement = new("_mediumQualityLightingRequirement", NonPublicInstance); + private static readonly FastField HighQualityLightRequirement = new("_highQualityLightingRequirement", NonPublicInstance); + + private readonly static Rectangle[] Rects9Slice = [ + new Rectangle(x: 0, y: 0, width: 4, height: 4), + new Rectangle(x: 4, y: 0, width: 8, height: 4), + new Rectangle(x: 12, y: 0, width: 4, height: 4), + + new Rectangle(x: 0, y: 4, width: 4, height: 8), + new Rectangle(x: 4, y: 4, width: 8, height: 8), + new Rectangle(x: 12, y: 4, width: 4, height: 8), + + new Rectangle(x: 0, y: 12, width: 4, height: 4), + new Rectangle(x: 4, y: 12, width: 8, height: 4), + new Rectangle(x: 12, y: 12, width: 4, height: 4), + ]; + + private readonly static Rectangle[] Rects4Slice = [ + new Rectangle(x: 0, y: 0, width: 8, height: 8), + new Rectangle(x: 8, y: 0, width: 8, height: 8), + new Rectangle(x: 0, y: 8, width: 8, height: 8), + new Rectangle(x: 8, y: 8, width: 8, height: 8), + ]; + + private enum SliceState : byte + { + None, + Slice_4, + Slice_9 + } + private static void OnDrawSingleTile(On_TileDrawing.orig_DrawSingleTile orig, TileDrawing self, TileDrawInfo drawData, bool solidLayer, int waterStyleOverride, Vector2 screenPosition, Vector2 screenOffset, int tileX, int tileY) { orig(self, drawData, solidLayer, waterStyleOverride, screenPosition, screenOffset, tileX, tileY); var tile = drawData.tileCache; + var tileType = tile.TileType; - Color drawColor = drawData.tileLight; - if (drawColor.R <= 0 && drawColor.G <= 0 && drawColor.B <= 0) + Color tileLight = drawData.tileLight; + if (tileLight.R <= 0 && tileLight.G <= 0 && tileLight.B <= 0) return; + // Generic Drawing Parameter Vector2 drawPos = new Vector2(tileX * 16, tileY * 16) - screenPosition + screenOffset; + var tileRandomFrame = Math.Clamp(tile.TileFrameNumber, 0, 2); + var isFullBright = tile.IsTileFullbright; + + // Sliced Rendering + var sliceRenderingPrepared = false; + var slices = drawData.colorSlices; + int sliceLength = 0; + var sliceRects = Array.Empty(); + var sliceState = SliceState.None; + var shouldTileShine = ShouldTileShine(tileType, (short)(drawData.tileFrameX + drawData.addFrX)); + var blendingData = tile.Get(); // Since we are not editing the value, we can just copy the values from here for (int idx = 0; idx < TileBlendingData.Length; idx++) { @@ -35,10 +80,75 @@ namespace CalamityMod.Systems break; var rect = TileBlendTexture.SideFlagsToSheetRect(data); - var texture = TileBlendTextureLoader.Registry[sheetIdx]; - var variant = Math.Clamp(tile.TileFrameNumber, 0, 2); - Main.spriteBatch.Draw(texture.BlendTextures[variant], drawPos, rect, drawColor, rotation: 0.0f, origin: default, scale: 1.0f, SpriteEffects.None, layerDepth: 0.0f); + var texture = TileBlendTextureLoader.Registry[sheetIdx].BlendTextures[tileRandomFrame]; + + // Prepare Slice Rendering + if (!sliceRenderingPrepared) + { + // Is HalfBlock condition is also in vanilla, so we follow that + if (Lighting.NotRetro && !tile.IsHalfBlock && !TileID.Sets.DontDrawTileSliced[tileType]) + { + var midQualityThreshold = MediumQualityLightRequirement.Get(self); + var highQualityThreshold = HighQualityLightRequirement.Get(self); + if (tileLight.IsAnyChannelGreaterThan(highQualityThreshold)) + { + sliceLength = 9; + sliceState = SliceState.Slice_9; + sliceRects = Rects9Slice; + Lighting.GetColor9Slice(tileX, tileY, ref slices); + } + else if (tileLight.IsAnyChannelGreaterThan(midQualityThreshold)) + { + sliceLength = 4; + sliceState = SliceState.Slice_4; + sliceRects = Rects4Slice; + Lighting.GetColor4Slice(tileX, tileY, ref slices); + } + } + + sliceRenderingPrepared = true; + } + + // No Slice Drawing + if (sliceState == SliceState.None || isFullBright) + { + var drawColor = isFullBright ? Color.White : tileLight; + Main.spriteBatch.Draw(texture, drawPos, rect, drawColor, rotation: 0.0f, origin: default, scale: 1.0f, SpriteEffects.None, layerDepth: 0.0f); + continue; + } + + // Sliced Drawing + for (int i = 0; i < sliceLength; i++) + { + var drawRect = sliceRects[i]; + drawRect.X += rect.X; + drawRect.Y += rect.Y; + + var drawColorVec = (tileLight.ToVector3() + slices[i]) * 0.5f; + drawColorVec *= drawData.colorTint.ToVector3(); + + // Tile is Actucated, Reduce brightness + if (tile.IsActuated) + { + drawColorVec *= 0.4f; + } + + // Tile is shine + if (shouldTileShine) + { + Main.shine(ref drawColorVec, tileType); + } + + Main.spriteBatch.Draw(texture, drawPos, rect, new Color(drawColorVec), rotation: 0.0f, origin: default, scale: 1.0f, SpriteEffects.None, layerDepth: 0.0f); + } } } + + private static MethodInfo ShouldTileShineMethod; + private static bool ShouldTileShine(ushort type, short frameX) + { + ShouldTileShineMethod ??= typeof(TileDrawing).GetMethod("ShouldTileShine", NonPublicStatic); + return (bool)ShouldTileShineMethod.Invoke(null, [type, frameX]); + } } } diff --git a/Systems/TileMerging/TileBlendTextureLoader.cs b/Systems/TileMerging/TileBlendTextureLoader.cs index 3409a1a0ee..0b3dce33a3 100644 --- a/Systems/TileMerging/TileBlendTextureLoader.cs +++ b/Systems/TileMerging/TileBlendTextureLoader.cs @@ -13,23 +13,25 @@ namespace CalamityMod.Systems { internal sealed class TileBlendTextureLoader : ModSystem { - internal const int EmptySlot = 255; + internal const int EmptySlot = 0; + internal const int StartingIndex = 1; + internal const int MaxCount = 255; internal static TileBlendTexture[] Registry { get; private set; } - internal static IEnumerable AllTextures => Registry.Take(Count); - internal static int Count => _UniqueSlot; + internal static IEnumerable AllTextures => Registry.Where(tex => tex is not null); + internal static int Count => _UniqueSlot - StartingIndex; - private static int _UniqueSlot = 0; + private static int _UniqueSlot = StartingIndex; public override void Load() { - Registry = new TileBlendTexture[EmptySlot + 1]; + Registry = new TileBlendTexture[MaxCount]; } public override void Unload() { Registry = null; - _UniqueSlot = 0; + _UniqueSlot = StartingIndex; } internal static int Register(TileBlendTexture sheet) @@ -37,8 +39,8 @@ namespace CalamityMod.Systems if (sheet.Slot >= 0) throw new ArgumentException("Argument has already registered to System", nameof(sheet)); - if (_UniqueSlot >= EmptySlot) - throw new InvalidOperationException($"Slots are all used up to {EmptySlot}, We can't allocate more!"); + if (_UniqueSlot >= MaxCount) + throw new InvalidOperationException($"Slots are all used up to {MaxCount}, We can't allocate more!"); var slot = _UniqueSlot++; Registry[slot] = sheet; diff --git a/Systems/World/WorldgenManagementSystem.cs b/Systems/World/WorldgenManagementSystem.cs index b36ed5de37..727138b75a 100644 --- a/Systems/World/WorldgenManagementSystem.cs +++ b/Systems/World/WorldgenManagementSystem.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Threading; +using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.SummonItems; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.World; @@ -573,7 +574,7 @@ namespace CalamityMod.Systems } } - // Adds Desert Medallion to Sandstone Chests at a 20% chance + // Adds Desert Medallion and The Comb to Sandstone Chests, each at a 20% chance if (isSandstoneChest) { float rng = WorldGen.genRand.NextFloat(); @@ -589,6 +590,18 @@ namespace CalamityMod.Systems } } } + else if (rng < 0.4f) + { + for (int inventoryIndex = 0; inventoryIndex < 40; inventoryIndex++) + { + if (chest.item[inventoryIndex].IsAir) + { + chest.item[inventoryIndex].SetDefaults(ModContent.ItemType()); + chest.item[inventoryIndex].stack = 1; + break; + } + } + } } } } diff --git a/TileEntities/TECodebreaker.cs b/TileEntities/TECodebreaker.cs index dedeb3ed1b..892883f846 100644 --- a/TileEntities/TECodebreaker.cs +++ b/TileEntities/TECodebreaker.cs @@ -3,6 +3,7 @@ using CalamityMod.CustomRecipes; using CalamityMod.Items.DraedonMisc; using CalamityMod.Items.Materials; using CalamityMod.Packets; +using CalamityMod.Systems.Collections; using CalamityMod.Tiles.DraedonSummoner; using Microsoft.Xna.Framework; using Terraria; @@ -39,17 +40,16 @@ namespace CalamityMod.TileEntities get { // You can't decrypt nothing. - if (HeldSchematicID == 0 || !CalamityLists.EncryptedSchematicIDRelationship.ContainsKey(HeldSchematicID)) + if (HeldSchematicID == 0 || !EncryptedSchematicIDRelationshipDict.TryGet(HeldSchematicID, out var schematicItemType)) return 0; - int schematicType = CalamityLists.EncryptedSchematicIDRelationship[HeldSchematicID]; - if (schematicType == ModContent.ItemType()) + if (schematicItemType == ModContent.ItemType()) return 500; - if (schematicType == ModContent.ItemType()) + if (schematicItemType == ModContent.ItemType()) return 950; - if (schematicType == ModContent.ItemType()) + if (schematicItemType == ModContent.ItemType()) return 1750; - if (schematicType == ModContent.ItemType()) + if (schematicItemType == ModContent.ItemType()) return 5000; return 0; @@ -72,17 +72,16 @@ namespace CalamityMod.TileEntities get { // You can't decrypt nothing. - if (HeldSchematicID == 0 || !CalamityLists.EncryptedSchematicIDRelationship.ContainsKey(HeldSchematicID)) + if (HeldSchematicID == 0 || !EncryptedSchematicIDRelationshipDict.TryGet(HeldSchematicID, out var schematicItemType)) return false; - int schematicType = CalamityLists.EncryptedSchematicIDRelationship[HeldSchematicID]; - if (schematicType == ModContent.ItemType()) + if (schematicItemType == ModContent.ItemType()) return ContainsDecryptionComputer; - if (schematicType == ModContent.ItemType()) + if (schematicItemType == ModContent.ItemType()) return ContainsDecryptionComputer && ContainsSensorArray; - if (schematicType == ModContent.ItemType()) + if (schematicItemType == ModContent.ItemType()) return ContainsDecryptionComputer && ContainsSensorArray && ContainsAdvancedDisplay; - if (schematicType == ModContent.ItemType()) + if (schematicItemType == ModContent.ItemType()) return ContainsDecryptionComputer && ContainsSensorArray && ContainsAdvancedDisplay && ContainsVoltageRegulationSystem; return false; @@ -94,15 +93,14 @@ namespace CalamityMod.TileEntities get { // You can't decrypt nothing. - if (HeldSchematicID == 0 || !CalamityLists.EncryptedSchematicIDRelationship.ContainsKey(HeldSchematicID)) + if (HeldSchematicID == 0 || !EncryptedSchematicIDRelationshipDict.TryGet(HeldSchematicID, out var schematicItemType)) return string.Empty; - int schematicType = CalamityLists.EncryptedSchematicIDRelationship[HeldSchematicID]; - if (schematicType == ModContent.ItemType() - || schematicType == ModContent.ItemType() - || schematicType == ModContent.ItemType() - || schematicType == ModContent.ItemType()) - return CalamityUtils.GetTextValueFromModItem(schematicType, "Content"); + if (schematicItemType == ModContent.ItemType() + || schematicItemType == ModContent.ItemType() + || schematicItemType == ModContent.ItemType() + || schematicItemType == ModContent.ItemType()) + return CalamityUtils.GetTextValueFromModItem(schematicItemType, "Content"); return string.Empty; } @@ -155,8 +153,8 @@ namespace CalamityMod.TileEntities if (ContainsCoolingCell) Item.NewItem(source, x * 16, y * 16, 32, 32, ModContent.ItemType()); - if (CalamityLists.EncryptedSchematicIDRelationship.ContainsKey(HeldSchematicID)) - Item.NewItem(source, x * 16, y * 16, 32, 32, CalamityLists.EncryptedSchematicIDRelationship[HeldSchematicID]); + if (EncryptedSchematicIDRelationshipDict.TryGet(HeldSchematicID, out var schematicItemType)) + Item.NewItem(source, x * 16, y * 16, 32, 32, schematicItemType); while (InputtedCellCount > 0) { @@ -233,27 +231,25 @@ namespace CalamityMod.TileEntities anythingChanged = false; // Do nothing if no valid schematic is inputted at the moment. - if (!CalamityLists.EncryptedSchematicIDRelationship.ContainsKey(HeldSchematicID)) + if (!EncryptedSchematicIDRelationshipDict.TryGet(HeldSchematicID, out var schematicItemType)) return; - int schematicType = CalamityLists.EncryptedSchematicIDRelationship[HeldSchematicID]; - - if (!RecipeUnlockHandler.HasUnlockedT2ArsenalRecipes && schematicType == ModContent.ItemType()) + if (!RecipeUnlockHandler.HasUnlockedT2ArsenalRecipes && schematicItemType == ModContent.ItemType()) { RecipeUnlockHandler.HasUnlockedT2ArsenalRecipes = true; anythingChanged = true; } - if (!RecipeUnlockHandler.HasUnlockedT3ArsenalRecipes && schematicType == ModContent.ItemType()) + if (!RecipeUnlockHandler.HasUnlockedT3ArsenalRecipes && schematicItemType == ModContent.ItemType()) { RecipeUnlockHandler.HasUnlockedT3ArsenalRecipes = true; anythingChanged = true; } - if (!RecipeUnlockHandler.HasUnlockedT4ArsenalRecipes && schematicType == ModContent.ItemType()) + if (!RecipeUnlockHandler.HasUnlockedT4ArsenalRecipes && schematicItemType == ModContent.ItemType()) { RecipeUnlockHandler.HasUnlockedT4ArsenalRecipes = true; anythingChanged = true; } - if (!RecipeUnlockHandler.HasUnlockedT5ArsenalRecipes && schematicType == ModContent.ItemType()) + if (!RecipeUnlockHandler.HasUnlockedT5ArsenalRecipes && schematicItemType == ModContent.ItemType()) { RecipeUnlockHandler.HasUnlockedT5ArsenalRecipes = true; anythingChanged = true; diff --git a/Tiles/Astral/AstralMonolith.cs b/Tiles/Astral/AstralMonolith.cs index 1ff2ad9606..5dd4bb0a03 100644 --- a/Tiles/Astral/AstralMonolith.cs +++ b/Tiles/Astral/AstralMonolith.cs @@ -61,6 +61,8 @@ namespace CalamityMod.Tiles.Astral public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile tile = Main.tile[i, j]; + if (tile.IsTileActuallyInvisible()) + return; int xOffset = i % 4; int yOffset = j % 4; diff --git a/Tiles/Astral/AstralVines.png b/Tiles/Astral/AstralVines.png index 9eb6362cc9..a7adaeb04a 100644 Binary files a/Tiles/Astral/AstralVines.png and b/Tiles/Astral/AstralVines.png differ diff --git a/Tiles/BaseTiles/BaseMonolith.cs b/Tiles/BaseTiles/BaseMonolith.cs index 39221e8685..f1a8684edb 100644 --- a/Tiles/BaseTiles/BaseMonolith.cs +++ b/Tiles/BaseTiles/BaseMonolith.cs @@ -116,6 +116,9 @@ namespace CalamityMod.Tiles.BaseTiles public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return false; + var tile = Main.tile[i, j]; var texture = TextureAssets.Tile[Type].Value; diff --git a/Tiles/BaseTiles/DynamicallyGrownTree.cs b/Tiles/BaseTiles/DynamicallyGrownTree.cs index e4a3882f33..a4f4a23084 100644 --- a/Tiles/BaseTiles/DynamicallyGrownTree.cs +++ b/Tiles/BaseTiles/DynamicallyGrownTree.cs @@ -132,6 +132,9 @@ namespace CalamityMod.Tiles.BaseTiles public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return false; + Tile t = CalamityUtils.ParanoidTileRetrieval(i, j); if (t.TileFrameX != 0 || t.TileFrameY != ((int)Math.Ceiling(DistanceUsedForTrunk / 16) - 1) * 18) return false; diff --git a/Tiles/CosmiliteBarTile.cs b/Tiles/CosmiliteBarTile.cs index 7ecfadf556..d37e1f19b5 100644 --- a/Tiles/CosmiliteBarTile.cs +++ b/Tiles/CosmiliteBarTile.cs @@ -19,10 +19,5 @@ namespace CalamityMod.Tiles type = ModContent.DustType(); return true; } - - public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) - { - return false; - } } } diff --git a/Tiles/Crags/Lily/LavaLily1.cs b/Tiles/Crags/Lily/LavaLily1.cs index e541a9a434..9ce7428ca5 100644 --- a/Tiles/Crags/Lily/LavaLily1.cs +++ b/Tiles/Crags/Lily/LavaLily1.cs @@ -57,6 +57,9 @@ namespace CalamityMod.Tiles.Crags.Lily { //draw the glowmask on the lily base Tile tile = Framing.GetTileSafely(i, j); + if (tile.IsTileActuallyInvisible()) + return; + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Crags/Lily/LavaLily1Glow").Value; Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); diff --git a/Tiles/Crags/Lily/LavaLily2.cs b/Tiles/Crags/Lily/LavaLily2.cs index d392bcc01c..2e09e90016 100644 --- a/Tiles/Crags/Lily/LavaLily2.cs +++ b/Tiles/Crags/Lily/LavaLily2.cs @@ -57,6 +57,9 @@ namespace CalamityMod.Tiles.Crags.Lily { //draw the glowmask on the lily base Tile tile = Framing.GetTileSafely(i, j); + if (tile.IsTileActuallyInvisible()) + return; + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Crags/Lily/LavaLily2Glow").Value; Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); diff --git a/Tiles/Crags/Lily/LavaLily3.cs b/Tiles/Crags/Lily/LavaLily3.cs index e33eac3bb7..1b32b892e4 100644 --- a/Tiles/Crags/Lily/LavaLily3.cs +++ b/Tiles/Crags/Lily/LavaLily3.cs @@ -57,6 +57,9 @@ namespace CalamityMod.Tiles.Crags.Lily { //draw the glowmask on the lily base Tile tile = Framing.GetTileSafely(i, j); + if (tile.IsTileActuallyInvisible()) + return; + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Crags/Lily/LavaLily3Glow").Value; Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); diff --git a/Tiles/Crags/Lily/LavaLily4.cs b/Tiles/Crags/Lily/LavaLily4.cs index e922e4efea..8950207004 100644 --- a/Tiles/Crags/Lily/LavaLily4.cs +++ b/Tiles/Crags/Lily/LavaLily4.cs @@ -57,6 +57,9 @@ namespace CalamityMod.Tiles.Crags.Lily { //draw the glowmask on the lily base Tile tile = Framing.GetTileSafely(i, j); + if (tile.IsTileActuallyInvisible()) + return; + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Crags/Lily/LavaLily4Glow").Value; Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); diff --git a/Tiles/Crags/Lily/LavaLily5.cs b/Tiles/Crags/Lily/LavaLily5.cs index 57c72e2661..6397483d8d 100644 --- a/Tiles/Crags/Lily/LavaLily5.cs +++ b/Tiles/Crags/Lily/LavaLily5.cs @@ -57,6 +57,9 @@ namespace CalamityMod.Tiles.Crags.Lily { //draw the glowmask on the lily base Tile tile = Framing.GetTileSafely(i, j); + if (tile.IsTileActuallyInvisible()) + return; + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Crags/Lily/LavaLily5Glow").Value; Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); diff --git a/Tiles/Crags/Lily/LavaLily6.cs b/Tiles/Crags/Lily/LavaLily6.cs index bc8fa2c1bd..0aafb69d5d 100644 --- a/Tiles/Crags/Lily/LavaLily6.cs +++ b/Tiles/Crags/Lily/LavaLily6.cs @@ -57,6 +57,9 @@ namespace CalamityMod.Tiles.Crags.Lily { //draw the glowmask on the lily base Tile tile = Framing.GetTileSafely(i, j); + if (tile.IsTileActuallyInvisible()) + return; + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Crags/Lily/LavaLily6Glow").Value; Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); diff --git a/Tiles/Crags/ScorchedRemainsGrass.cs b/Tiles/Crags/ScorchedRemainsGrass.cs index c93a845ccb..aaab2a3a01 100644 --- a/Tiles/Crags/ScorchedRemainsGrass.cs +++ b/Tiles/Crags/ScorchedRemainsGrass.cs @@ -147,6 +147,9 @@ namespace CalamityMod.Tiles.Crags public override void SpecialDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + 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 = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Lighting.GetColor(i, j)); diff --git a/Tiles/Crags/Tree/SpineTree.cs b/Tiles/Crags/Tree/SpineTree.cs index 0d7628d3f2..11adee04ed 100644 --- a/Tiles/Crags/Tree/SpineTree.cs +++ b/Tiles/Crags/Tree/SpineTree.cs @@ -293,6 +293,9 @@ namespace CalamityMod.Tiles.Crags.Tree public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return false; + Tile tile = Framing.GetTileSafely(i, j); float xOff = (float)Math.Sin((j * 19) * 0.04f) * 1.2f; diff --git a/Tiles/DraedonStructures/AgedLaboratoryConsole.cs b/Tiles/DraedonStructures/AgedLaboratoryConsole.cs index 1e9d88b4dc..8df5cec10d 100644 --- a/Tiles/DraedonStructures/AgedLaboratoryConsole.cs +++ b/Tiles/DraedonStructures/AgedLaboratoryConsole.cs @@ -53,6 +53,9 @@ namespace CalamityMod.Tiles.DraedonStructures public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/DraedonStructures/AgedLaboratoryConsoleGlow").Value; diff --git a/Tiles/DraedonStructures/AgedLaboratoryDisplay.cs b/Tiles/DraedonStructures/AgedLaboratoryDisplay.cs index 6d596e755e..4363f7433b 100644 --- a/Tiles/DraedonStructures/AgedLaboratoryDisplay.cs +++ b/Tiles/DraedonStructures/AgedLaboratoryDisplay.cs @@ -46,6 +46,9 @@ namespace CalamityMod.Tiles.DraedonStructures public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/DraedonStructures/AgedLaboratoryDisplayGlow").Value; diff --git a/Tiles/DraedonStructures/AgedLaboratoryScreen.cs b/Tiles/DraedonStructures/AgedLaboratoryScreen.cs index 92586a8eef..6df4e7fae9 100644 --- a/Tiles/DraedonStructures/AgedLaboratoryScreen.cs +++ b/Tiles/DraedonStructures/AgedLaboratoryScreen.cs @@ -36,6 +36,9 @@ namespace CalamityMod.Tiles.DraedonStructures public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/DraedonStructures/AgedLaboratoryScreenGlow").Value; diff --git a/Tiles/DraedonStructures/AgedLaboratoryServer.cs b/Tiles/DraedonStructures/AgedLaboratoryServer.cs index 0edb6b3758..78e5f00ba1 100644 --- a/Tiles/DraedonStructures/AgedLaboratoryServer.cs +++ b/Tiles/DraedonStructures/AgedLaboratoryServer.cs @@ -53,6 +53,9 @@ namespace CalamityMod.Tiles.DraedonStructures public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/DraedonStructures/AgedLaboratoryServerGlow").Value; diff --git a/Tiles/DraedonStructures/AgedReinforcedCrate.cs b/Tiles/DraedonStructures/AgedReinforcedCrate.cs index 826777407f..09b2154712 100644 --- a/Tiles/DraedonStructures/AgedReinforcedCrate.cs +++ b/Tiles/DraedonStructures/AgedReinforcedCrate.cs @@ -42,6 +42,9 @@ namespace CalamityMod.Tiles.DraedonStructures public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/DraedonStructures/AgedReinforcedCrateGlow").Value; diff --git a/Tiles/DraedonStructures/ChargingStation.cs b/Tiles/DraedonStructures/ChargingStation.cs index 6de7c06905..f86bca3642 100644 --- a/Tiles/DraedonStructures/ChargingStation.cs +++ b/Tiles/DraedonStructures/ChargingStation.cs @@ -111,6 +111,9 @@ namespace CalamityMod.Tiles.DraedonStructures // Draws the charger's glowing light on top of it. public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + Tile t = Main.tile[i, j]; int xFrame = t.TileFrameX; int yFrame = t.TileFrameY; diff --git a/Tiles/DraedonStructures/DraedonLabTurret.cs b/Tiles/DraedonStructures/DraedonLabTurret.cs index cc879d63a3..f43c7b4568 100644 --- a/Tiles/DraedonStructures/DraedonLabTurret.cs +++ b/Tiles/DraedonStructures/DraedonLabTurret.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Tiles.DraedonStructures public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile t = Main.tile[i, j]; - if (t.TileFrameX != 36 || t.TileFrameY != 0) + if (t.TileFrameX != 36 || t.TileFrameY != 0 || t.IsTileActuallyInvisible()) return; TEHostileLabTurret te = CalamityUtils.FindTileEntity(i, j, Width, Height, SheetSquare); diff --git a/Tiles/DraedonStructures/HostileFireTurret .cs b/Tiles/DraedonStructures/HostileFireTurret .cs index e9fe453828..5a07e876a0 100644 --- a/Tiles/DraedonStructures/HostileFireTurret .cs +++ b/Tiles/DraedonStructures/HostileFireTurret .cs @@ -72,7 +72,7 @@ namespace CalamityMod.Tiles.DraedonStructures public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile t = Main.tile[i, j]; - if (t.TileFrameX != 36 || t.TileFrameY != 0) + if (t.TileFrameX != 36 || t.TileFrameY != 0 || t.IsTileActuallyInvisible()) return; TEHostileFireTurret te = CalamityUtils.FindTileEntity(i, j, Width, Height, SheetSquare); diff --git a/Tiles/DraedonStructures/HostileIceTurret .cs b/Tiles/DraedonStructures/HostileIceTurret .cs index 2b1b476c2b..d5b2ed5af2 100644 --- a/Tiles/DraedonStructures/HostileIceTurret .cs +++ b/Tiles/DraedonStructures/HostileIceTurret .cs @@ -72,7 +72,7 @@ namespace CalamityMod.Tiles.DraedonStructures public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile t = Main.tile[i, j]; - if (t.TileFrameX != 36 || t.TileFrameY != 0) + if (t.TileFrameX != 36 || t.TileFrameY != 0 || t.IsTileActuallyInvisible()) return; TEHostileIceTurret te = CalamityUtils.FindTileEntity(i, j, Width, Height, SheetSquare); diff --git a/Tiles/DraedonStructures/HostileLaserTurret .cs b/Tiles/DraedonStructures/HostileLaserTurret .cs index 149e0a7410..39765b670d 100644 --- a/Tiles/DraedonStructures/HostileLaserTurret .cs +++ b/Tiles/DraedonStructures/HostileLaserTurret .cs @@ -72,7 +72,7 @@ namespace CalamityMod.Tiles.DraedonStructures public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile t = Main.tile[i, j]; - if (t.TileFrameX != 36 || t.TileFrameY != 0) + if (t.TileFrameX != 36 || t.TileFrameY != 0 || t.IsTileActuallyInvisible()) return; TEHostileLaserTurret te = CalamityUtils.FindTileEntity(i, j, Width, Height, SheetSquare); diff --git a/Tiles/DraedonStructures/HostileOnyxTurret.cs b/Tiles/DraedonStructures/HostileOnyxTurret.cs index 48773b95b1..0412860bb6 100644 --- a/Tiles/DraedonStructures/HostileOnyxTurret.cs +++ b/Tiles/DraedonStructures/HostileOnyxTurret.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Tiles.DraedonStructures public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile t = Main.tile[i, j]; - if (t.TileFrameX != 36 || t.TileFrameY != 0) + if (t.TileFrameX != 36 || t.TileFrameY != 0 || t.IsTileActuallyInvisible()) return; TEHostileOnyxTurret te = CalamityUtils.FindTileEntity(i, j, Width, Height, SheetSquare); diff --git a/Tiles/DraedonStructures/HostilePlagueTurret.cs b/Tiles/DraedonStructures/HostilePlagueTurret.cs index 50ac6e3aa3..68934114c7 100644 --- a/Tiles/DraedonStructures/HostilePlagueTurret.cs +++ b/Tiles/DraedonStructures/HostilePlagueTurret.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Tiles.DraedonStructures public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile t = Main.tile[i, j]; - if (t.TileFrameX != 36 || t.TileFrameY != 0) + if (t.TileFrameX != 36 || t.TileFrameY != 0 || t.IsTileActuallyInvisible()) return; TEHostilePlagueTurret te = CalamityUtils.FindTileEntity(i, j, Width, Height, SheetSquare); diff --git a/Tiles/DraedonStructures/HostileWaterTurret.cs b/Tiles/DraedonStructures/HostileWaterTurret.cs index 15231ede6f..0f47a29ea4 100644 --- a/Tiles/DraedonStructures/HostileWaterTurret.cs +++ b/Tiles/DraedonStructures/HostileWaterTurret.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Tiles.DraedonStructures public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile t = Main.tile[i, j]; - if (t.TileFrameX != 36 || t.TileFrameY != 0) + if (t.TileFrameX != 36 || t.TileFrameY != 0 || t.IsTileActuallyInvisible()) return; TEHostileWaterTurret te = CalamityUtils.FindTileEntity(i, j, Width, Height, SheetSquare); diff --git a/Tiles/DraedonStructures/LabHologramProjector.cs b/Tiles/DraedonStructures/LabHologramProjector.cs index 2e1da5d040..450338bc2d 100644 --- a/Tiles/DraedonStructures/LabHologramProjector.cs +++ b/Tiles/DraedonStructures/LabHologramProjector.cs @@ -101,6 +101,9 @@ namespace CalamityMod.Tiles.DraedonStructures public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) { Tile trackTile = Main.tile[i, j]; + if (trackTile.IsTileActuallyInvisible()) + return false; + int time = (int)(Main.GlobalTimeWrappedHourly * 60); TELabHologramProjector hologramTileEntity = CalamityUtils.FindTileEntity(i, j, Width, Height, SheetSquare); diff --git a/Tiles/DraedonStructures/LaboratoryConsole.cs b/Tiles/DraedonStructures/LaboratoryConsole.cs index 832e50ae21..c04d63edf0 100644 --- a/Tiles/DraedonStructures/LaboratoryConsole.cs +++ b/Tiles/DraedonStructures/LaboratoryConsole.cs @@ -53,6 +53,9 @@ namespace CalamityMod.Tiles.DraedonStructures public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/DraedonStructures/LaboratoryConsoleGlow").Value; diff --git a/Tiles/DraedonStructures/LaboratoryDisplay.cs b/Tiles/DraedonStructures/LaboratoryDisplay.cs index 4df308e759..cc2513cecc 100644 --- a/Tiles/DraedonStructures/LaboratoryDisplay.cs +++ b/Tiles/DraedonStructures/LaboratoryDisplay.cs @@ -56,6 +56,9 @@ namespace CalamityMod.Tiles.DraedonStructures public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/DraedonStructures/LaboratoryDisplayGlow").Value; diff --git a/Tiles/DraedonStructures/LaboratoryScreen.cs b/Tiles/DraedonStructures/LaboratoryScreen.cs index 2867c26119..2672f89918 100644 --- a/Tiles/DraedonStructures/LaboratoryScreen.cs +++ b/Tiles/DraedonStructures/LaboratoryScreen.cs @@ -36,6 +36,9 @@ namespace CalamityMod.Tiles.DraedonStructures public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/DraedonStructures/LaboratoryScreenGlow").Value; diff --git a/Tiles/DraedonStructures/LaboratoryServer.cs b/Tiles/DraedonStructures/LaboratoryServer.cs index d10bd2a433..0d658c83fb 100644 --- a/Tiles/DraedonStructures/LaboratoryServer.cs +++ b/Tiles/DraedonStructures/LaboratoryServer.cs @@ -53,6 +53,9 @@ namespace CalamityMod.Tiles.DraedonStructures public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/DraedonStructures/LaboratoryServerGlow").Value; diff --git a/Tiles/DraedonStructures/LaboratoryTerminal.cs b/Tiles/DraedonStructures/LaboratoryTerminal.cs index 94ff84121a..cd75e06802 100644 --- a/Tiles/DraedonStructures/LaboratoryTerminal.cs +++ b/Tiles/DraedonStructures/LaboratoryTerminal.cs @@ -56,6 +56,9 @@ namespace CalamityMod.Tiles.DraedonStructures public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/DraedonStructures/LaboratoryTerminalGlow").Value; diff --git a/Tiles/DraedonStructures/PowerCellFactory.cs b/Tiles/DraedonStructures/PowerCellFactory.cs index 810360ee0b..0f57ac7693 100644 --- a/Tiles/DraedonStructures/PowerCellFactory.cs +++ b/Tiles/DraedonStructures/PowerCellFactory.cs @@ -121,6 +121,8 @@ namespace CalamityMod.Tiles.DraedonStructures { // These offsets start as the tile offsets, i.e. which sub-tile of the FrameImportant structure this specific location is. Tile t = Main.tile[i, j]; + if (t.IsTileActuallyInvisible()) + return false; int frameXPos = t.TileFrameX; int frameYPos = t.TileFrameY; diff --git a/Tiles/DraedonStructures/ReinforcedCrate.cs b/Tiles/DraedonStructures/ReinforcedCrate.cs index 06b9c32ffe..dfe34a429e 100644 --- a/Tiles/DraedonStructures/ReinforcedCrate.cs +++ b/Tiles/DraedonStructures/ReinforcedCrate.cs @@ -42,6 +42,9 @@ namespace CalamityMod.Tiles.DraedonStructures public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/DraedonStructures/ReinforcedCrateGlow").Value; diff --git a/Tiles/DraedonSummoner/CodebreakerTile.cs b/Tiles/DraedonSummoner/CodebreakerTile.cs index 013cdf7b8b..ae7a7c97f0 100644 --- a/Tiles/DraedonSummoner/CodebreakerTile.cs +++ b/Tiles/DraedonSummoner/CodebreakerTile.cs @@ -171,6 +171,8 @@ namespace CalamityMod.Tiles.DraedonSummoner { // These offsets start as the tile offsets, i.e. which sub-tile of the FrameImportant structure this specific location is. Tile t = Main.tile[i, j]; + if (t.IsTileActuallyInvisible()) + return false; int left = i - t.TileFrameX % (Width * SheetSquare) / SheetSquare; int frameXPos = t.TileFrameX; int frameYPos = t.TileFrameY + Height * SheetSquare * (int)((Main.GlobalTimeWrappedHourly * 12f + left) % 8); diff --git a/Tiles/FloralParadise/PinkFlower.cs b/Tiles/FloralParadise/PinkFlower.cs index 56c0f03581..f6c1a7bb90 100644 --- a/Tiles/FloralParadise/PinkFlower.cs +++ b/Tiles/FloralParadise/PinkFlower.cs @@ -50,6 +50,9 @@ namespace CalamityMod.Tiles.FloralParadise public override void SpecialDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + // 02JUN2024: Ozzatron: directionY did not exist at the time of the creation of this content. As such, it is ignored here. ILChanges.Windgrid.GetWindTime(i, j, WindPushLifetime, out int windTimeLeft, out int direction, out _); diff --git a/Tiles/FloralParadise/PinkFlowerBig.cs b/Tiles/FloralParadise/PinkFlowerBig.cs index ce416e6c8f..a4481e7853 100644 --- a/Tiles/FloralParadise/PinkFlowerBig.cs +++ b/Tiles/FloralParadise/PinkFlowerBig.cs @@ -59,6 +59,9 @@ namespace CalamityMod.Tiles.FloralParadise public override void SpecialDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + // 02JUN2024: Ozzatron: directionY did not exist at the time of the creation of this content. As such, it is ignored here. ILChanges.Windgrid.GetWindTime(i, j, WindPushLifetime, out int windTimeLeft, out int direction, out _); diff --git a/Tiles/Furniture/BabyFlakCrabCageTile.cs b/Tiles/Furniture/BabyFlakCrabCageTile.cs index a5130a5078..b1d2596cd8 100644 --- a/Tiles/Furniture/BabyFlakCrabCageTile.cs +++ b/Tiles/Furniture/BabyFlakCrabCageTile.cs @@ -72,6 +72,9 @@ namespace CalamityMod.Tiles.Furniture // Since this uses a custom top sprite, all drawing must be redone public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return false; + 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; diff --git a/Tiles/Furniture/CraftingStations/MonolithAmalgam.cs b/Tiles/Furniture/CraftingStations/MonolithAmalgam.cs index 5bdeda2d2b..8d19243ab9 100644 --- a/Tiles/Furniture/CraftingStations/MonolithAmalgam.cs +++ b/Tiles/Furniture/CraftingStations/MonolithAmalgam.cs @@ -28,6 +28,9 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/Furniture/CraftingStations/MonolithAmalgamGlow").Value; diff --git a/Tiles/Furniture/CraftingStations/WulfrumLabstation.cs b/Tiles/Furniture/CraftingStations/WulfrumLabstation.cs index e673581d99..8b1cfe6971 100644 --- a/Tiles/Furniture/CraftingStations/WulfrumLabstation.cs +++ b/Tiles/Furniture/CraftingStations/WulfrumLabstation.cs @@ -33,6 +33,9 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/Furniture/CraftingStations/WulfrumLabstationGlow").Value; diff --git a/Tiles/Furniture/PiggyCageTile.cs b/Tiles/Furniture/PiggyCageTile.cs index 66dfb336a4..3bb7fd1f87 100644 --- a/Tiles/Furniture/PiggyCageTile.cs +++ b/Tiles/Furniture/PiggyCageTile.cs @@ -65,6 +65,9 @@ namespace CalamityMod.Tiles.Furniture // Since this uses a custom top sprite, all drawing must be redone public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return false; + 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; diff --git a/Tiles/Furniture/RepairUnitCageTile.cs b/Tiles/Furniture/RepairUnitCageTile.cs index 5785665977..7f7a6c2d3f 100644 --- a/Tiles/Furniture/RepairUnitCageTile.cs +++ b/Tiles/Furniture/RepairUnitCageTile.cs @@ -64,6 +64,9 @@ namespace CalamityMod.Tiles.Furniture // Since this uses a custom top sprite, all drawing must be redone public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return false; + 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; diff --git a/Tiles/Furniture/WulfrumLure.cs b/Tiles/Furniture/WulfrumLure.cs index 7e7d864482..4b3d07d82d 100644 --- a/Tiles/Furniture/WulfrumLure.cs +++ b/Tiles/Furniture/WulfrumLure.cs @@ -82,6 +82,9 @@ namespace CalamityMod.Tiles.Furniture public override void SpecialDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + Vector2 offScreen = new Vector2(Main.offScreenRange); if (Main.drawToScreen) { diff --git a/Tiles/FurnitureAshen/AshenAccentSlab.cs b/Tiles/FurnitureAshen/AshenAccentSlab.cs index 97dc53aba5..6fa77bdb6f 100644 --- a/Tiles/FurnitureAshen/AshenAccentSlab.cs +++ b/Tiles/FurnitureAshen/AshenAccentSlab.cs @@ -272,6 +272,9 @@ namespace CalamityMod.Tiles.FurnitureAshen public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int uniqueAnimationFrameX = 0; int uniqueAnimationFrameY = 0; int xPos = i % 2; diff --git a/Tiles/FurnitureAshen/AshenMonolith.cs b/Tiles/FurnitureAshen/AshenMonolith.cs index 6e0d5e1ca3..d1dbbae53f 100644 --- a/Tiles/FurnitureAshen/AshenMonolith.cs +++ b/Tiles/FurnitureAshen/AshenMonolith.cs @@ -53,6 +53,9 @@ namespace CalamityMod.Tiles.FurnitureAshen { //This is used to draw the eye, where the frame is changed depending on the player's position relative to the eye's centre. Tile currentTile = Main.tile[i, j]; + if (currentTile.IsTileActuallyInvisible()) + return; + Vector2 eyeCentre = new Vector2(i * 16, j * 16); if (currentTile.TileFrameX == 0) { eyeCentre += new Vector2(16f, 0f); } diff --git a/Tiles/FurnitureAshen/AshenSlab.cs b/Tiles/FurnitureAshen/AshenSlab.cs index 182a094973..440542777f 100644 --- a/Tiles/FurnitureAshen/AshenSlab.cs +++ b/Tiles/FurnitureAshen/AshenSlab.cs @@ -272,6 +272,9 @@ namespace CalamityMod.Tiles.FurnitureAshen public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int uniqueAnimationFrameX = 0; int uniqueAnimationFrameY = 0; int xPos = i % 2; diff --git a/Tiles/FurnitureAuric/AuricAbsorberTile.cs b/Tiles/FurnitureAuric/AuricAbsorberTile.cs index 133cbee19f..35db8b1f40 100644 --- a/Tiles/FurnitureAuric/AuricAbsorberTile.cs +++ b/Tiles/FurnitureAuric/AuricAbsorberTile.cs @@ -24,6 +24,8 @@ namespace CalamityMod.Tiles.FurnitureAuric public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { var tileCache = Main.tile[i, j]; + if (tileCache.IsTileActuallyInvisible()) + return; TileFramingSystem.SlopedGlowmask(in tileCache, i, j, TextureAssets.Tile[Type].Value, null, CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Color.White), default); } diff --git a/Tiles/FurnitureAuric/AuricConsoleTile.cs b/Tiles/FurnitureAuric/AuricConsoleTile.cs index e991ae4be9..c63214c960 100644 --- a/Tiles/FurnitureAuric/AuricConsoleTile.cs +++ b/Tiles/FurnitureAuric/AuricConsoleTile.cs @@ -50,6 +50,9 @@ namespace CalamityMod.Tiles.FurnitureAuric public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureAuric/AuricConsoleTile_Glow").Value; diff --git a/Tiles/FurnitureAuric/AuricDisplayTile.cs b/Tiles/FurnitureAuric/AuricDisplayTile.cs index 857f4a8a8c..3bee285bc0 100644 --- a/Tiles/FurnitureAuric/AuricDisplayTile.cs +++ b/Tiles/FurnitureAuric/AuricDisplayTile.cs @@ -54,6 +54,9 @@ namespace CalamityMod.Tiles.FurnitureAuric public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureAuric/AuricDisplayTile_Glow").Value; diff --git a/Tiles/FurnitureAuric/AuricPlatformTile.cs b/Tiles/FurnitureAuric/AuricPlatformTile.cs index 8e47dbe7b8..6374210994 100644 --- a/Tiles/FurnitureAuric/AuricPlatformTile.cs +++ b/Tiles/FurnitureAuric/AuricPlatformTile.cs @@ -45,6 +45,8 @@ namespace CalamityMod.Tiles.FurnitureAuric return; Tile tile = CalamityUtils.ParanoidTileRetrieval(i, j); + if (tile.IsTileActuallyInvisible()) + return; int xPos = tile.TileFrameX; int yPos = tile.TileFrameY; Vector2 drawOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); diff --git a/Tiles/FurnitureAuric/AuricReinforcedCrateTile.cs b/Tiles/FurnitureAuric/AuricReinforcedCrateTile.cs index 6fcdd98125..b12a59811b 100644 --- a/Tiles/FurnitureAuric/AuricReinforcedCrateTile.cs +++ b/Tiles/FurnitureAuric/AuricReinforcedCrateTile.cs @@ -39,6 +39,9 @@ namespace CalamityMod.Tiles.FurnitureAuric public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureAuric/AuricReinforcedCrateTile_Glow").Value; diff --git a/Tiles/FurnitureAuric/AuricScreenTile.cs b/Tiles/FurnitureAuric/AuricScreenTile.cs index 612876ee9e..57d785b261 100644 --- a/Tiles/FurnitureAuric/AuricScreenTile.cs +++ b/Tiles/FurnitureAuric/AuricScreenTile.cs @@ -34,6 +34,9 @@ namespace CalamityMod.Tiles.FurnitureAuric public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureAuric/AuricScreenTile_Glow").Value; diff --git a/Tiles/FurnitureAuric/AuricServerTile.cs b/Tiles/FurnitureAuric/AuricServerTile.cs index 1574f7ed8c..859f124c91 100644 --- a/Tiles/FurnitureAuric/AuricServerTile.cs +++ b/Tiles/FurnitureAuric/AuricServerTile.cs @@ -53,6 +53,9 @@ namespace CalamityMod.Tiles.FurnitureAuric public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureAuric/AuricServerTile_Glow").Value; diff --git a/Tiles/FurnitureAuric/AuricTerminalTile.cs b/Tiles/FurnitureAuric/AuricTerminalTile.cs index 081c67e195..b4870a0fe5 100644 --- a/Tiles/FurnitureAuric/AuricTerminalTile.cs +++ b/Tiles/FurnitureAuric/AuricTerminalTile.cs @@ -54,6 +54,9 @@ namespace CalamityMod.Tiles.FurnitureAuric public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureAuric/AuricTerminalTile_Glow").Value; diff --git a/Tiles/FurnitureExo/ExoBathtubTile.cs b/Tiles/FurnitureExo/ExoBathtubTile.cs index 4253625413..bc6774561f 100644 --- a/Tiles/FurnitureExo/ExoBathtubTile.cs +++ b/Tiles/FurnitureExo/ExoBathtubTile.cs @@ -26,6 +26,9 @@ namespace CalamityMod.Tiles.FurnitureExo public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureExo/ExoBathtubGlow").Value; diff --git a/Tiles/FurnitureExo/ExoBedTile.cs b/Tiles/FurnitureExo/ExoBedTile.cs index 59f35b3e58..5eac86fb0d 100644 --- a/Tiles/FurnitureExo/ExoBedTile.cs +++ b/Tiles/FurnitureExo/ExoBedTile.cs @@ -33,6 +33,9 @@ namespace CalamityMod.Tiles.FurnitureExo public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureExo/ExoBedGlow").Value; diff --git a/Tiles/FurnitureExo/ExoBookcaseTile.cs b/Tiles/FurnitureExo/ExoBookcaseTile.cs index a5bb51442c..ad3ea4978f 100644 --- a/Tiles/FurnitureExo/ExoBookcaseTile.cs +++ b/Tiles/FurnitureExo/ExoBookcaseTile.cs @@ -26,6 +26,9 @@ namespace CalamityMod.Tiles.FurnitureExo public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureExo/ExoBookcaseGlow").Value; diff --git a/Tiles/FurnitureExo/ExoChairTile.cs b/Tiles/FurnitureExo/ExoChairTile.cs index e263dcb120..d04b7a3554 100644 --- a/Tiles/FurnitureExo/ExoChairTile.cs +++ b/Tiles/FurnitureExo/ExoChairTile.cs @@ -61,6 +61,9 @@ namespace CalamityMod.Tiles.FurnitureExo public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureExo/ExoChairGlow").Value; diff --git a/Tiles/FurnitureExo/ExoChestGlow.png b/Tiles/FurnitureExo/ExoChestGlow.png index afd5dcd8d6..a4ffe528e6 100644 Binary files a/Tiles/FurnitureExo/ExoChestGlow.png and b/Tiles/FurnitureExo/ExoChestGlow.png differ diff --git a/Tiles/FurnitureExo/ExoChestTile.cs b/Tiles/FurnitureExo/ExoChestTile.cs index 3c949f4e59..8a05742926 100644 --- a/Tiles/FurnitureExo/ExoChestTile.cs +++ b/Tiles/FurnitureExo/ExoChestTile.cs @@ -36,12 +36,21 @@ namespace CalamityMod.Tiles.FurnitureExo public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile tile = Main.tile[i, j]; + if (tile.IsTileActuallyInvisible()) + return; + + int xPos = tile.TileFrameX; + int yPos = tile.TileFrameY; + int chestIndex = Chest.FindChest(i - (xPos / 18), j - (yPos / 18)); + if (chestIndex == -1) + return; + int yOffset = TileObjectData.GetTileData(tile).DrawYOffset; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureExo/ExoChestGlow").Value; - Vector2 drawOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); - Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y + yOffset) + drawOffset; Color drawColour = Color.White; - Main.spriteBatch.Draw(glowmask, drawPosition, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), drawColour, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y + yOffset) + (Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange)); + Rectangle frame = new Rectangle(xPos, yPos + Main.chest[chestIndex].frame * 38, 18, 18); + Main.spriteBatch.Draw(glowmask, drawPosition, frame, drawColour, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); } } } diff --git a/Tiles/FurnitureExo/ExoClockTile.cs b/Tiles/FurnitureExo/ExoClockTile.cs index f060ed0f9e..aa0b55400a 100644 --- a/Tiles/FurnitureExo/ExoClockTile.cs +++ b/Tiles/FurnitureExo/ExoClockTile.cs @@ -41,6 +41,9 @@ namespace CalamityMod.Tiles.FurnitureExo public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureExo/ExoClockGlow").Value; diff --git a/Tiles/FurnitureExo/ExoConsoleTile.cs b/Tiles/FurnitureExo/ExoConsoleTile.cs index bc17227112..b0ee83fc8f 100644 --- a/Tiles/FurnitureExo/ExoConsoleTile.cs +++ b/Tiles/FurnitureExo/ExoConsoleTile.cs @@ -53,6 +53,9 @@ namespace CalamityMod.Tiles.FurnitureExo public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureExo/ExoConsoleGlow").Value; diff --git a/Tiles/FurnitureExo/ExoDisplayTile.cs b/Tiles/FurnitureExo/ExoDisplayTile.cs index 0e34ea42af..864d84c0dd 100644 --- a/Tiles/FurnitureExo/ExoDisplayTile.cs +++ b/Tiles/FurnitureExo/ExoDisplayTile.cs @@ -56,6 +56,9 @@ namespace CalamityMod.Tiles.FurnitureExo public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureExo/ExoDisplayGlow").Value; diff --git a/Tiles/FurnitureExo/ExoDresserTile.cs b/Tiles/FurnitureExo/ExoDresserTile.cs index 17bd4a2633..2b0807917f 100644 --- a/Tiles/FurnitureExo/ExoDresserTile.cs +++ b/Tiles/FurnitureExo/ExoDresserTile.cs @@ -34,6 +34,9 @@ namespace CalamityMod.Tiles.FurnitureExo public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureExo/ExoDresserGlow").Value; diff --git a/Tiles/FurnitureExo/ExoKeyboardTile.cs b/Tiles/FurnitureExo/ExoKeyboardTile.cs index a58cffd87d..b54456e596 100644 --- a/Tiles/FurnitureExo/ExoKeyboardTile.cs +++ b/Tiles/FurnitureExo/ExoKeyboardTile.cs @@ -26,6 +26,9 @@ namespace CalamityMod.Tiles.FurnitureExo public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureExo/ExoKeyboardGlow").Value; diff --git a/Tiles/FurnitureExo/ExoPrismPlatformTile.cs b/Tiles/FurnitureExo/ExoPrismPlatformTile.cs index b3bbe480e9..aee4df9a8e 100644 --- a/Tiles/FurnitureExo/ExoPrismPlatformTile.cs +++ b/Tiles/FurnitureExo/ExoPrismPlatformTile.cs @@ -54,6 +54,9 @@ namespace CalamityMod.Tiles.FurnitureExo return; Tile tile = CalamityUtils.ParanoidTileRetrieval(i, j); + if (tile.IsTileActuallyInvisible()) + return; + int xPos = tile.TileFrameX; int frameOffset = (i + j) % 6 * AnimationFrameHeight; int yPos = tile.TileFrameY + frameOffset; diff --git a/Tiles/FurnitureExo/ExoScreenTile.cs b/Tiles/FurnitureExo/ExoScreenTile.cs index 0293c537a7..21b0def587 100644 --- a/Tiles/FurnitureExo/ExoScreenTile.cs +++ b/Tiles/FurnitureExo/ExoScreenTile.cs @@ -56,6 +56,9 @@ namespace CalamityMod.Tiles.FurnitureExo public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile tile = Main.tile[i, j]; + if (tile.IsTileActuallyInvisible()) + return; + int yOffset = TileObjectData.GetTileData(tile).DrawYOffset; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureExo/ExoScreenGlow").Value; Vector2 drawOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); diff --git a/Tiles/FurnitureExo/ExoServerTile.cs b/Tiles/FurnitureExo/ExoServerTile.cs index 45c3fb4f38..cdc835ff58 100644 --- a/Tiles/FurnitureExo/ExoServerTile.cs +++ b/Tiles/FurnitureExo/ExoServerTile.cs @@ -53,6 +53,9 @@ namespace CalamityMod.Tiles.FurnitureExo public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureExo/ExoServerGlow").Value; diff --git a/Tiles/FurnitureExo/ExoSinkTile.cs b/Tiles/FurnitureExo/ExoSinkTile.cs index f20935c0a2..9e6d293bf6 100644 --- a/Tiles/FurnitureExo/ExoSinkTile.cs +++ b/Tiles/FurnitureExo/ExoSinkTile.cs @@ -26,6 +26,9 @@ namespace CalamityMod.Tiles.FurnitureExo public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureExo/ExoSinkGlow").Value; diff --git a/Tiles/FurnitureExo/ExoSofaTile.cs b/Tiles/FurnitureExo/ExoSofaTile.cs index 5236a75055..a89b2721e2 100644 --- a/Tiles/FurnitureExo/ExoSofaTile.cs +++ b/Tiles/FurnitureExo/ExoSofaTile.cs @@ -40,6 +40,9 @@ namespace CalamityMod.Tiles.FurnitureExo public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureExo/ExoSofaGlow").Value; diff --git a/Tiles/FurnitureExo/ExoTableTile.cs b/Tiles/FurnitureExo/ExoTableTile.cs index 4b2240b6fe..922949b560 100644 --- a/Tiles/FurnitureExo/ExoTableTile.cs +++ b/Tiles/FurnitureExo/ExoTableTile.cs @@ -26,6 +26,9 @@ namespace CalamityMod.Tiles.FurnitureExo public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureExo/ExoTableGlow").Value; diff --git a/Tiles/FurnitureExo/ExoTerminalTile.cs b/Tiles/FurnitureExo/ExoTerminalTile.cs index fa0aa1edd5..d180bf0769 100644 --- a/Tiles/FurnitureExo/ExoTerminalTile.cs +++ b/Tiles/FurnitureExo/ExoTerminalTile.cs @@ -56,6 +56,9 @@ namespace CalamityMod.Tiles.FurnitureExo public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureExo/ExoTerminalGlow").Value; diff --git a/Tiles/FurnitureExo/ExoToiletTile.cs b/Tiles/FurnitureExo/ExoToiletTile.cs index 2dd9722b43..253033f2ca 100644 --- a/Tiles/FurnitureExo/ExoToiletTile.cs +++ b/Tiles/FurnitureExo/ExoToiletTile.cs @@ -62,6 +62,9 @@ namespace CalamityMod.Tiles.FurnitureExo public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureExo/ExoToiletGlow").Value; diff --git a/Tiles/FurnitureExo/ExoWorkBenchTile.cs b/Tiles/FurnitureExo/ExoWorkBenchTile.cs index 9347c89993..1696283777 100644 --- a/Tiles/FurnitureExo/ExoWorkBenchTile.cs +++ b/Tiles/FurnitureExo/ExoWorkBenchTile.cs @@ -33,6 +33,9 @@ namespace CalamityMod.Tiles.FurnitureExo public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request(Texture + "Glow").Value; diff --git a/Tiles/FurnitureMonolith/MonolithBathtub.cs b/Tiles/FurnitureMonolith/MonolithBathtub.cs index 3ce05394fc..b73e969cec 100644 --- a/Tiles/FurnitureMonolith/MonolithBathtub.cs +++ b/Tiles/FurnitureMonolith/MonolithBathtub.cs @@ -22,6 +22,9 @@ namespace CalamityMod.Tiles.FurnitureMonolith public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithBathtubGlow").Value; diff --git a/Tiles/FurnitureMonolith/MonolithBed.cs b/Tiles/FurnitureMonolith/MonolithBed.cs index 49e88eb271..12feb19543 100644 --- a/Tiles/FurnitureMonolith/MonolithBed.cs +++ b/Tiles/FurnitureMonolith/MonolithBed.cs @@ -24,6 +24,9 @@ namespace CalamityMod.Tiles.FurnitureMonolith public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithBedGlow").Value; diff --git a/Tiles/FurnitureMonolith/MonolithBench.cs b/Tiles/FurnitureMonolith/MonolithBench.cs index 624f9e10f4..ed8dfb3702 100644 --- a/Tiles/FurnitureMonolith/MonolithBench.cs +++ b/Tiles/FurnitureMonolith/MonolithBench.cs @@ -25,6 +25,9 @@ namespace CalamityMod.Tiles.FurnitureMonolith public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithBenchGlow").Value; diff --git a/Tiles/FurnitureMonolith/MonolithBookcase.cs b/Tiles/FurnitureMonolith/MonolithBookcase.cs index 573af1ad49..f0f2539b8a 100644 --- a/Tiles/FurnitureMonolith/MonolithBookcase.cs +++ b/Tiles/FurnitureMonolith/MonolithBookcase.cs @@ -23,6 +23,9 @@ namespace CalamityMod.Tiles.FurnitureMonolith public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithBookcaseGlow").Value; diff --git a/Tiles/FurnitureMonolith/MonolithCandelabra.cs b/Tiles/FurnitureMonolith/MonolithCandelabra.cs index f917cbbb59..f473367d54 100644 --- a/Tiles/FurnitureMonolith/MonolithCandelabra.cs +++ b/Tiles/FurnitureMonolith/MonolithCandelabra.cs @@ -23,6 +23,9 @@ namespace CalamityMod.Tiles.FurnitureMonolith public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithCandelabraGlow").Value; diff --git a/Tiles/FurnitureMonolith/MonolithCandle.cs b/Tiles/FurnitureMonolith/MonolithCandle.cs index bfff448231..de740ac133 100644 --- a/Tiles/FurnitureMonolith/MonolithCandle.cs +++ b/Tiles/FurnitureMonolith/MonolithCandle.cs @@ -23,6 +23,9 @@ namespace CalamityMod.Tiles.FurnitureMonolith public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithCandleGlow").Value; diff --git a/Tiles/FurnitureMonolith/MonolithChair.cs b/Tiles/FurnitureMonolith/MonolithChair.cs index ac8524312b..db53d4f6a4 100644 --- a/Tiles/FurnitureMonolith/MonolithChair.cs +++ b/Tiles/FurnitureMonolith/MonolithChair.cs @@ -26,6 +26,9 @@ namespace CalamityMod.Tiles.FurnitureMonolith public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithChairGlow").Value; diff --git a/Tiles/FurnitureMonolith/MonolithChandelier.cs b/Tiles/FurnitureMonolith/MonolithChandelier.cs index b6776a0b44..b0ffa854c5 100644 --- a/Tiles/FurnitureMonolith/MonolithChandelier.cs +++ b/Tiles/FurnitureMonolith/MonolithChandelier.cs @@ -23,6 +23,9 @@ namespace CalamityMod.Tiles.FurnitureMonolith public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithChandelierGlow").Value; diff --git a/Tiles/FurnitureMonolith/MonolithChest.cs b/Tiles/FurnitureMonolith/MonolithChest.cs index 47cba4785d..1f294cf3d9 100644 --- a/Tiles/FurnitureMonolith/MonolithChest.cs +++ b/Tiles/FurnitureMonolith/MonolithChest.cs @@ -7,6 +7,7 @@ using Terraria.GameContent.ObjectInteractions; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; +using Terraria.ObjectData; namespace CalamityMod.Tiles.FurnitureMonolith { @@ -63,13 +64,22 @@ namespace CalamityMod.Tiles.FurnitureMonolith public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { - int xPos = Main.tile[i, j].TileFrameX; - int yPos = Main.tile[i, j].TileFrameY; + Tile tile = Main.tile[i, j]; + if (tile.IsTileActuallyInvisible()) + return; + + int xPos = tile.TileFrameX; + int yPos = tile.TileFrameY; + int chestIndex = Chest.FindChest(i - (xPos / 18), j - (yPos / 18)); + if (chestIndex == -1) + return; + + int yOffset = TileObjectData.GetTileData(tile).DrawYOffset; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithChestGlow").Value; 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); + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y + yOffset) + (Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange)); + Rectangle frame = new Rectangle(xPos, yPos + Main.chest[chestIndex].frame * 38, 18, 18); + Main.spriteBatch.Draw(glowmask, drawOffset, frame, drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } } } diff --git a/Tiles/FurnitureMonolith/MonolithClock.cs b/Tiles/FurnitureMonolith/MonolithClock.cs index 7cc3d76d67..6dae46ac7d 100644 --- a/Tiles/FurnitureMonolith/MonolithClock.cs +++ b/Tiles/FurnitureMonolith/MonolithClock.cs @@ -26,6 +26,9 @@ namespace CalamityMod.Tiles.FurnitureMonolith public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithClockGlow").Value; diff --git a/Tiles/FurnitureMonolith/MonolithDoorClosed.cs b/Tiles/FurnitureMonolith/MonolithDoorClosed.cs index 9190b4cc09..52b85d4d81 100644 --- a/Tiles/FurnitureMonolith/MonolithDoorClosed.cs +++ b/Tiles/FurnitureMonolith/MonolithDoorClosed.cs @@ -29,6 +29,9 @@ namespace CalamityMod.Tiles.FurnitureMonolith public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithDoorClosedGlow").Value; diff --git a/Tiles/FurnitureMonolith/MonolithDoorOpen.cs b/Tiles/FurnitureMonolith/MonolithDoorOpen.cs index a229126bb3..782985f901 100644 --- a/Tiles/FurnitureMonolith/MonolithDoorOpen.cs +++ b/Tiles/FurnitureMonolith/MonolithDoorOpen.cs @@ -30,6 +30,9 @@ namespace CalamityMod.Tiles.FurnitureMonolith public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithDoorOpenGlow").Value; diff --git a/Tiles/FurnitureMonolith/MonolithDresser.cs b/Tiles/FurnitureMonolith/MonolithDresser.cs index 7449085189..fb8af48ee6 100644 --- a/Tiles/FurnitureMonolith/MonolithDresser.cs +++ b/Tiles/FurnitureMonolith/MonolithDresser.cs @@ -32,6 +32,9 @@ namespace CalamityMod.Tiles.FurnitureMonolith public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithDresserGlow").Value; diff --git a/Tiles/FurnitureMonolith/MonolithLamp.cs b/Tiles/FurnitureMonolith/MonolithLamp.cs index c169899dab..eb49dc8399 100644 --- a/Tiles/FurnitureMonolith/MonolithLamp.cs +++ b/Tiles/FurnitureMonolith/MonolithLamp.cs @@ -23,6 +23,9 @@ namespace CalamityMod.Tiles.FurnitureMonolith public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithLampGlow").Value; diff --git a/Tiles/FurnitureMonolith/MonolithLantern.cs b/Tiles/FurnitureMonolith/MonolithLantern.cs index e03c7077b2..c77208df7e 100644 --- a/Tiles/FurnitureMonolith/MonolithLantern.cs +++ b/Tiles/FurnitureMonolith/MonolithLantern.cs @@ -24,6 +24,9 @@ namespace CalamityMod.Tiles.FurnitureMonolith public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithLanternGlow").Value; diff --git a/Tiles/FurnitureMonolith/MonolithPiano.cs b/Tiles/FurnitureMonolith/MonolithPiano.cs index 14385c7fb0..707a910882 100644 --- a/Tiles/FurnitureMonolith/MonolithPiano.cs +++ b/Tiles/FurnitureMonolith/MonolithPiano.cs @@ -25,6 +25,9 @@ namespace CalamityMod.Tiles.FurnitureMonolith public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithPianoGlow").Value; diff --git a/Tiles/FurnitureMonolith/MonolithSink.cs b/Tiles/FurnitureMonolith/MonolithSink.cs index 3009c01574..3af8655a3e 100644 --- a/Tiles/FurnitureMonolith/MonolithSink.cs +++ b/Tiles/FurnitureMonolith/MonolithSink.cs @@ -23,6 +23,9 @@ namespace CalamityMod.Tiles.FurnitureMonolith public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithSinkGlow").Value; diff --git a/Tiles/FurnitureMonolith/MonolithTable.cs b/Tiles/FurnitureMonolith/MonolithTable.cs index 6a3a0d4c69..183aa97e60 100644 --- a/Tiles/FurnitureMonolith/MonolithTable.cs +++ b/Tiles/FurnitureMonolith/MonolithTable.cs @@ -23,6 +23,9 @@ namespace CalamityMod.Tiles.FurnitureMonolith public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithTableGlow").Value; diff --git a/Tiles/FurnitureMonolith/MonolithWorkbench.cs b/Tiles/FurnitureMonolith/MonolithWorkbench.cs index cd69fd30d2..4e27709e66 100644 --- a/Tiles/FurnitureMonolith/MonolithWorkbench.cs +++ b/Tiles/FurnitureMonolith/MonolithWorkbench.cs @@ -23,6 +23,9 @@ namespace CalamityMod.Tiles.FurnitureMonolith public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithWorkBenchGlow").Value; diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs b/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs index 016733d5de..3948395809 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs @@ -51,6 +51,9 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly public override void SpecialDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + 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 = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Lighting.GetColor(i, j), false); diff --git a/Tiles/FurnitureSacrilegious/MonolithOfTheAccursedTile.cs b/Tiles/FurnitureSacrilegious/MonolithOfTheAccursedTile.cs index dd0865adf2..84314f6124 100644 --- a/Tiles/FurnitureSacrilegious/MonolithOfTheAccursedTile.cs +++ b/Tiles/FurnitureSacrilegious/MonolithOfTheAccursedTile.cs @@ -139,7 +139,7 @@ namespace CalamityMod.Tiles.FurnitureSacrilegious // For drawing the floating icon public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { - if (Main.tile[i, j].TileFrameX < 36) + if (Main.tile[i, j].TileFrameX < 36 || Main.tile[i, j].IsTileActuallyInvisible()) return; Texture2D texture = ModContent.Request("CalamityMod/Tiles/FurnitureSacrilegious/MonolithOfTheAccursedTile_IconRight").Value; diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousChestTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousChestTile.cs index ec62598f02..6623d83277 100644 --- a/Tiles/FurnitureSacrilegious/SacrilegiousChestTile.cs +++ b/Tiles/FurnitureSacrilegious/SacrilegiousChestTile.cs @@ -42,6 +42,8 @@ namespace CalamityMod.Tiles.FurnitureSacrilegious itemAmt = CountItems(Main.chest[index]); Tile tile = Main.tile[i, j]; + if (tile.IsTileActuallyInvisible()) + return; Texture2D texture = ModContent.Request("CalamityMod/Tiles/FurnitureSacrilegious/SacrilegiousChestTileGlow").Value; int x = i; diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousClockTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousClockTile.cs index 94b8795431..baf4ba6e2e 100644 --- a/Tiles/FurnitureSacrilegious/SacrilegiousClockTile.cs +++ b/Tiles/FurnitureSacrilegious/SacrilegiousClockTile.cs @@ -58,6 +58,8 @@ namespace CalamityMod.Tiles.FurnitureSacrilegious { Texture2D texture = ModContent.Request("CalamityMod/Tiles/FurnitureSacrilegious/SacrilegiousClockTile_Icon").Value; Tile tile = Main.tile[i, j]; + if (tile.IsTileActuallyInvisible()) + return; int xPos = tile.TileFrameX; int yPos = tile.TileFrameY; diff --git a/Tiles/FurnitureStratus/StratusPlatform.cs b/Tiles/FurnitureStratus/StratusPlatform.cs index 30d7e3c11e..fbe4bab57c 100644 --- a/Tiles/FurnitureStratus/StratusPlatform.cs +++ b/Tiles/FurnitureStratus/StratusPlatform.cs @@ -24,6 +24,9 @@ namespace CalamityMod.Tiles.FurnitureStratus public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureStratus/StratusPlatformGlow").Value; diff --git a/Tiles/FurnitureStratus/StratusStarPlatform.cs b/Tiles/FurnitureStratus/StratusStarPlatform.cs index ba79bc569f..ff5228198c 100644 --- a/Tiles/FurnitureStratus/StratusStarPlatform.cs +++ b/Tiles/FurnitureStratus/StratusStarPlatform.cs @@ -25,6 +25,9 @@ namespace CalamityMod.Tiles.FurnitureStratus public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureStratus/StratusStarPlatformGlow").Value; diff --git a/Tiles/FurnitureWulfrum/WulfrumBathtub.cs b/Tiles/FurnitureWulfrum/WulfrumBathtub.cs index 269e53f673..b3c983a646 100644 --- a/Tiles/FurnitureWulfrum/WulfrumBathtub.cs +++ b/Tiles/FurnitureWulfrum/WulfrumBathtub.cs @@ -25,6 +25,9 @@ namespace CalamityMod.Tiles.FurnitureWulfrum public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/WulfrumBathtubGlow").Value; diff --git a/Tiles/FurnitureWulfrum/WulfrumBed.cs b/Tiles/FurnitureWulfrum/WulfrumBed.cs index 76db64317d..9c10c99de0 100644 --- a/Tiles/FurnitureWulfrum/WulfrumBed.cs +++ b/Tiles/FurnitureWulfrum/WulfrumBed.cs @@ -32,6 +32,9 @@ namespace CalamityMod.Tiles.FurnitureWulfrum public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/WulfrumBedGlow").Value; diff --git a/Tiles/FurnitureWulfrum/WulfrumBookcase.cs b/Tiles/FurnitureWulfrum/WulfrumBookcase.cs index 236092fa3f..e54e9c83a4 100644 --- a/Tiles/FurnitureWulfrum/WulfrumBookcase.cs +++ b/Tiles/FurnitureWulfrum/WulfrumBookcase.cs @@ -25,6 +25,9 @@ namespace CalamityMod.Tiles.FurnitureWulfrum public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/WulfrumBookcaseGlow").Value; diff --git a/Tiles/FurnitureWulfrum/WulfrumChair.cs b/Tiles/FurnitureWulfrum/WulfrumChair.cs index 7be469fa87..107952e5a7 100644 --- a/Tiles/FurnitureWulfrum/WulfrumChair.cs +++ b/Tiles/FurnitureWulfrum/WulfrumChair.cs @@ -60,6 +60,9 @@ namespace CalamityMod.Tiles.FurnitureWulfrum public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/WulfrumChairGlow").Value; diff --git a/Tiles/FurnitureWulfrum/WulfrumClock.cs b/Tiles/FurnitureWulfrum/WulfrumClock.cs index 208d0620c1..459a59ed7a 100644 --- a/Tiles/FurnitureWulfrum/WulfrumClock.cs +++ b/Tiles/FurnitureWulfrum/WulfrumClock.cs @@ -40,6 +40,9 @@ namespace CalamityMod.Tiles.FurnitureWulfrum public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/WulfrumClockGlow").Value; diff --git a/Tiles/FurnitureWulfrum/WulfrumDresser.cs b/Tiles/FurnitureWulfrum/WulfrumDresser.cs index 32f7df8139..813b797955 100644 --- a/Tiles/FurnitureWulfrum/WulfrumDresser.cs +++ b/Tiles/FurnitureWulfrum/WulfrumDresser.cs @@ -33,6 +33,9 @@ namespace CalamityMod.Tiles.FurnitureWulfrum public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/WulfrumDresserGlow").Value; diff --git a/Tiles/FurnitureWulfrum/WulfrumPiano.cs b/Tiles/FurnitureWulfrum/WulfrumPiano.cs index 0cc9b3b7aa..6c695135ba 100644 --- a/Tiles/FurnitureWulfrum/WulfrumPiano.cs +++ b/Tiles/FurnitureWulfrum/WulfrumPiano.cs @@ -23,6 +23,9 @@ namespace CalamityMod.Tiles.FurnitureWulfrum public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/WulfrumPianoGlow").Value; diff --git a/Tiles/FurnitureWulfrum/WulfrumSink.cs b/Tiles/FurnitureWulfrum/WulfrumSink.cs index fccf48585d..57bb0247c1 100644 --- a/Tiles/FurnitureWulfrum/WulfrumSink.cs +++ b/Tiles/FurnitureWulfrum/WulfrumSink.cs @@ -25,6 +25,9 @@ namespace CalamityMod.Tiles.FurnitureWulfrum public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/WulfrumSinkGlow").Value; diff --git a/Tiles/FurnitureWulfrum/WulfrumSofa.cs b/Tiles/FurnitureWulfrum/WulfrumSofa.cs index fd7f798acb..33bfbecd49 100644 --- a/Tiles/FurnitureWulfrum/WulfrumSofa.cs +++ b/Tiles/FurnitureWulfrum/WulfrumSofa.cs @@ -39,6 +39,9 @@ namespace CalamityMod.Tiles.FurnitureWulfrum public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/WulfrumSofaGlow").Value; diff --git a/Tiles/FurnitureWulfrum/WulfrumTable.cs b/Tiles/FurnitureWulfrum/WulfrumTable.cs index cf8885358f..a24280edb6 100644 --- a/Tiles/FurnitureWulfrum/WulfrumTable.cs +++ b/Tiles/FurnitureWulfrum/WulfrumTable.cs @@ -25,6 +25,9 @@ namespace CalamityMod.Tiles.FurnitureWulfrum public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/WulfrumTableGlow").Value; diff --git a/Tiles/FurnitureWulfrum/WulfrumToilet.cs b/Tiles/FurnitureWulfrum/WulfrumToilet.cs index f5a3836d52..81e68d00a2 100644 --- a/Tiles/FurnitureWulfrum/WulfrumToilet.cs +++ b/Tiles/FurnitureWulfrum/WulfrumToilet.cs @@ -61,6 +61,9 @@ namespace CalamityMod.Tiles.FurnitureWulfrum public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/WulfrumToiletGlow").Value; diff --git a/Tiles/FurnitureWulfrum/WulfrumWorkBenchTile.cs b/Tiles/FurnitureWulfrum/WulfrumWorkBenchTile.cs index 8a1c0f64e5..9d88b5b592 100644 --- a/Tiles/FurnitureWulfrum/WulfrumWorkBenchTile.cs +++ b/Tiles/FurnitureWulfrum/WulfrumWorkBenchTile.cs @@ -29,6 +29,9 @@ namespace CalamityMod.Tiles.FurnitureWulfrum public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; Texture2D glowmask = ModContent.Request(Texture + "Glow").Value; diff --git a/Tiles/LivingFire/LivingPlagueFireBlockTile.cs b/Tiles/LivingFire/LivingPlagueFireBlockTile.cs index a99e7b7b64..7e30de8770 100644 --- a/Tiles/LivingFire/LivingPlagueFireBlockTile.cs +++ b/Tiles/LivingFire/LivingPlagueFireBlockTile.cs @@ -1,4 +1,5 @@ using CalamityMod.Dusts; +using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Tiles/Ores/AerialiteOre.cs b/Tiles/Ores/AerialiteOre.cs index eb926362b8..29a95d6be6 100644 --- a/Tiles/Ores/AerialiteOre.cs +++ b/Tiles/Ores/AerialiteOre.cs @@ -76,6 +76,9 @@ namespace CalamityMod.Tiles.Ores return; var tile = Main.tile[i, j]; + if (tile.IsTileActuallyInvisible()) + return; + int xPos = tile.TileFrameX; int yPos = tile.TileFrameY; int xOffset = animationFrameWidth * TileFramingSystem.GetVariation4x4_012_Low0(i, j); diff --git a/Tiles/PlayerTurrets/PlayerFireTurret .cs b/Tiles/PlayerTurrets/PlayerFireTurret .cs index 96f89dbf1e..06db0d1d71 100644 --- a/Tiles/PlayerTurrets/PlayerFireTurret .cs +++ b/Tiles/PlayerTurrets/PlayerFireTurret .cs @@ -70,7 +70,7 @@ namespace CalamityMod.Tiles.PlayerTurrets public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile t = Main.tile[i, j]; - if (t.TileFrameX != 36 || t.TileFrameY != 0) + if (t.TileFrameX != 36 || t.TileFrameY != 0 || t.IsTileActuallyInvisible()) return; TEPlayerFireTurret te = CalamityUtils.FindTileEntity(i, j, Width, Height, SheetSquare); diff --git a/Tiles/PlayerTurrets/PlayerIceTurret .cs b/Tiles/PlayerTurrets/PlayerIceTurret .cs index f8923b34cb..07d2742c46 100644 --- a/Tiles/PlayerTurrets/PlayerIceTurret .cs +++ b/Tiles/PlayerTurrets/PlayerIceTurret .cs @@ -70,7 +70,7 @@ namespace CalamityMod.Tiles.PlayerTurrets public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile t = Main.tile[i, j]; - if (t.TileFrameX != 36 || t.TileFrameY != 0) + if (t.TileFrameX != 36 || t.TileFrameY != 0 || t.IsTileActuallyInvisible()) return; TEPlayerIceTurret te = CalamityUtils.FindTileEntity(i, j, Width, Height, SheetSquare); diff --git a/Tiles/PlayerTurrets/PlayerLabTurret.cs b/Tiles/PlayerTurrets/PlayerLabTurret.cs index 3948900ebf..b2d28deb5b 100644 --- a/Tiles/PlayerTurrets/PlayerLabTurret.cs +++ b/Tiles/PlayerTurrets/PlayerLabTurret.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Tiles.PlayerTurrets public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile t = Main.tile[i, j]; - if (t.TileFrameX != 36 || t.TileFrameY != 0) + if (t.TileFrameX != 36 || t.TileFrameY != 0 || t.IsTileActuallyInvisible()) return; TEPlayerLabTurret te = CalamityUtils.FindTileEntity(i, j, Width, Height, SheetSquare); diff --git a/Tiles/PlayerTurrets/PlayerLaserTurret .cs b/Tiles/PlayerTurrets/PlayerLaserTurret .cs index 314a27c5e1..6c6421a2eb 100644 --- a/Tiles/PlayerTurrets/PlayerLaserTurret .cs +++ b/Tiles/PlayerTurrets/PlayerLaserTurret .cs @@ -70,7 +70,7 @@ namespace CalamityMod.Tiles.PlayerTurrets public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile t = Main.tile[i, j]; - if (t.TileFrameX != 36 || t.TileFrameY != 0) + if (t.TileFrameX != 36 || t.TileFrameY != 0 || t.IsTileActuallyInvisible()) return; TEPlayerLaserTurret te = CalamityUtils.FindTileEntity(i, j, Width, Height, SheetSquare); diff --git a/Tiles/PlayerTurrets/PlayerOnyxTurret.cs b/Tiles/PlayerTurrets/PlayerOnyxTurret.cs index 80c5af3026..03a6c2cb93 100644 --- a/Tiles/PlayerTurrets/PlayerOnyxTurret.cs +++ b/Tiles/PlayerTurrets/PlayerOnyxTurret.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Tiles.PlayerTurrets public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile t = Main.tile[i, j]; - if (t.TileFrameX != 36 || t.TileFrameY != 0) + if (t.TileFrameX != 36 || t.TileFrameY != 0 || t.IsTileActuallyInvisible()) return; TEPlayerOnyxTurret te = CalamityUtils.FindTileEntity(i, j, Width, Height, SheetSquare); diff --git a/Tiles/PlayerTurrets/PlayerPlagueTurret.cs b/Tiles/PlayerTurrets/PlayerPlagueTurret.cs index 011130a5ea..0094c5557a 100644 --- a/Tiles/PlayerTurrets/PlayerPlagueTurret.cs +++ b/Tiles/PlayerTurrets/PlayerPlagueTurret.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Tiles.PlayerTurrets public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile t = Main.tile[i, j]; - if (t.TileFrameX != 36 || t.TileFrameY != 0) + if (t.TileFrameX != 36 || t.TileFrameY != 0 || t.IsTileActuallyInvisible()) return; TEPlayerPlagueTurret te = CalamityUtils.FindTileEntity(i, j, Width, Height, SheetSquare); diff --git a/Tiles/PlayerTurrets/PlayerWaterTurret.cs b/Tiles/PlayerTurrets/PlayerWaterTurret.cs index e9da005ea0..0c1c8cbfa1 100644 --- a/Tiles/PlayerTurrets/PlayerWaterTurret.cs +++ b/Tiles/PlayerTurrets/PlayerWaterTurret.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Tiles.PlayerTurrets public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile t = Main.tile[i, j]; - if (t.TileFrameX != 36 || t.TileFrameY != 0) + if (t.TileFrameX != 36 || t.TileFrameY != 0 || t.IsTileActuallyInvisible()) return; TEPlayerWaterTurret te = CalamityUtils.FindTileEntity(i, j, Width, Height, SheetSquare); diff --git a/Tiles/Rubblemaker/Abyss/AbyssGiantKelp1Echo.cs b/Tiles/Rubblemaker/Abyss/AbyssGiantKelp1Echo.cs index fcf1baa9b1..4dc342e39b 100644 --- a/Tiles/Rubblemaker/Abyss/AbyssGiantKelp1Echo.cs +++ b/Tiles/Rubblemaker/Abyss/AbyssGiantKelp1Echo.cs @@ -70,6 +70,9 @@ namespace CalamityMod.Tiles.Rubblemaker.Abyss public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile tile = Framing.GetTileSafely(i, j); + if (tile.IsTileActuallyInvisible()) + return; + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp1Glow").Value; Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); @@ -84,6 +87,9 @@ namespace CalamityMod.Tiles.Rubblemaker.Abyss public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile tile = Framing.GetTileSafely(i, j); + if (tile.IsTileActuallyInvisible()) + return; + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp2Glow").Value; Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); diff --git a/Tiles/Rubblemaker/Abyss/AbyssGiantKelp3Echo.cs b/Tiles/Rubblemaker/Abyss/AbyssGiantKelp3Echo.cs index 9a4a19759d..fe0ed10bd6 100644 --- a/Tiles/Rubblemaker/Abyss/AbyssGiantKelp3Echo.cs +++ b/Tiles/Rubblemaker/Abyss/AbyssGiantKelp3Echo.cs @@ -70,6 +70,9 @@ namespace CalamityMod.Tiles.Rubblemaker.Abyss public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile tile = Framing.GetTileSafely(i, j); + if (tile.IsTileActuallyInvisible()) + return; + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3Glow").Value; Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); diff --git a/Tiles/Rubblemaker/Abyss/AbyssGiantKelp4Echo.cs b/Tiles/Rubblemaker/Abyss/AbyssGiantKelp4Echo.cs index c1229ed58c..685953dfa9 100644 --- a/Tiles/Rubblemaker/Abyss/AbyssGiantKelp4Echo.cs +++ b/Tiles/Rubblemaker/Abyss/AbyssGiantKelp4Echo.cs @@ -70,6 +70,9 @@ namespace CalamityMod.Tiles.Rubblemaker.Abyss public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile tile = Framing.GetTileSafely(i, j); + if (tile.IsTileActuallyInvisible()) + return; + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4Glow").Value; Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); diff --git a/Tiles/Rubblemaker/Abyss/BulbTreeEcho.cs b/Tiles/Rubblemaker/Abyss/BulbTreeEcho.cs index d08fbdacd0..c3f55cd174 100644 --- a/Tiles/Rubblemaker/Abyss/BulbTreeEcho.cs +++ b/Tiles/Rubblemaker/Abyss/BulbTreeEcho.cs @@ -54,6 +54,9 @@ namespace CalamityMod.Tiles.Rubblemaker.Abyss public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile tile = Framing.GetTileSafely(i, j); + if (tile.IsTileActuallyInvisible()) + return; + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/BulbTree1Glow").Value; Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); @@ -67,6 +70,9 @@ namespace CalamityMod.Tiles.Rubblemaker.Abyss public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile tile = Framing.GetTileSafely(i, j); + if (tile.IsTileActuallyInvisible()) + return; + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/BulbTree2Glow").Value; Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); @@ -80,6 +86,9 @@ namespace CalamityMod.Tiles.Rubblemaker.Abyss public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile tile = Framing.GetTileSafely(i, j); + if (tile.IsTileActuallyInvisible()) + return; + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/BulbTree3Glow").Value; Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); diff --git a/Tiles/Rubblemaker/Abyss/SpiderCoralEcho.cs b/Tiles/Rubblemaker/Abyss/SpiderCoralEcho.cs index f463aa1ff8..d4d7463c16 100644 --- a/Tiles/Rubblemaker/Abyss/SpiderCoralEcho.cs +++ b/Tiles/Rubblemaker/Abyss/SpiderCoralEcho.cs @@ -37,6 +37,9 @@ namespace CalamityMod.Tiles.Rubblemaker.Abyss public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile tile = Framing.GetTileSafely(i, j); + if (tile.IsTileActuallyInvisible()) + return; + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/SpiderCoral1Glow").Value; Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); @@ -50,6 +53,9 @@ namespace CalamityMod.Tiles.Rubblemaker.Abyss public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile tile = Framing.GetTileSafely(i, j); + if (tile.IsTileActuallyInvisible()) + return; + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/SpiderCoral2Glow").Value; Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); @@ -63,6 +69,9 @@ namespace CalamityMod.Tiles.Rubblemaker.Abyss public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile tile = Framing.GetTileSafely(i, j); + if (tile.IsTileActuallyInvisible()) + return; + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/SpiderCoral3Glow").Value; Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); @@ -76,6 +85,9 @@ namespace CalamityMod.Tiles.Rubblemaker.Abyss public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile tile = Framing.GetTileSafely(i, j); + if (tile.IsTileActuallyInvisible()) + return; + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/SpiderCoral4Glow").Value; Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); @@ -89,6 +101,9 @@ namespace CalamityMod.Tiles.Rubblemaker.Abyss public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile tile = Framing.GetTileSafely(i, j); + if (tile.IsTileActuallyInvisible()) + return; + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/SpiderCoral5Glow").Value; Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); diff --git a/Tiles/Rubblemaker/Abyss/SulphurPireCoralEcho.cs b/Tiles/Rubblemaker/Abyss/SulphurPireCoralEcho.cs index eb0d6f6388..615e7b74e0 100644 --- a/Tiles/Rubblemaker/Abyss/SulphurPireCoralEcho.cs +++ b/Tiles/Rubblemaker/Abyss/SulphurPireCoralEcho.cs @@ -53,6 +53,9 @@ namespace CalamityMod.Tiles.Rubblemaker.Abyss public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile tile = Framing.GetTileSafely(i, j); + if (tile.IsTileActuallyInvisible()) + return; + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/SulphurPireCoral1Glow").Value; Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); @@ -66,6 +69,9 @@ namespace CalamityMod.Tiles.Rubblemaker.Abyss public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile tile = Framing.GetTileSafely(i, j); + if (tile.IsTileActuallyInvisible()) + return; + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/SulphurPireCoral2Glow").Value; Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); @@ -79,6 +85,9 @@ namespace CalamityMod.Tiles.Rubblemaker.Abyss public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { Tile tile = Framing.GetTileSafely(i, j); + if (tile.IsTileActuallyInvisible()) + return; + Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/SulphurPireCoral3Glow").Value; Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); diff --git a/Tiles/SunkenSea/EutrophicGlass.cs b/Tiles/SunkenSea/EutrophicGlass.cs index a11f188fe4..77f47816d1 100644 --- a/Tiles/SunkenSea/EutrophicGlass.cs +++ b/Tiles/SunkenSea/EutrophicGlass.cs @@ -42,6 +42,9 @@ namespace CalamityMod.Tiles.SunkenSea public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + float transparency = 0.6f; // Must be set here diff --git a/Tiles/UelibloomBrick.cs b/Tiles/UelibloomBrick.cs index 92ba0fcfb6..88a30f67fb 100644 --- a/Tiles/UelibloomBrick.cs +++ b/Tiles/UelibloomBrick.cs @@ -57,6 +57,9 @@ namespace CalamityMod.Tiles public override void SpecialDraw(int i, int j, SpriteBatch spriteBatch) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + 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 = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Lighting.GetColor(i, j), false); diff --git a/Tiles/WulfrumPipes.cs b/Tiles/WulfrumPipes.cs index d2c6485691..70dd1b9f4a 100644 --- a/Tiles/WulfrumPipes.cs +++ b/Tiles/WulfrumPipes.cs @@ -59,6 +59,8 @@ namespace CalamityMod.Tiles { Point pos = new Point(i, j); Tile tile = Main.tile[pos]; + if (tile.IsTileActuallyInvisible()) + return; float timeToGo = pos.GetTileRNG(2) * 22; float animProgress = (float)Math.Pow(MathHelper.Clamp((TempTilesManagerSystem.GetTemporaryTileTime(pos) - (WulfrumScaffoldKit.TileTime - timeToGo)) / timeToGo, 0, 1), 2); diff --git a/UI/DraedonSummoning/CodebreakerUI.cs b/UI/DraedonSummoning/CodebreakerUI.cs index df1ef0c32d..b50d05d200 100644 --- a/UI/DraedonSummoning/CodebreakerUI.cs +++ b/UI/DraedonSummoning/CodebreakerUI.cs @@ -1,10 +1,10 @@ using System; -using System.Linq; using System.Text; using CalamityMod.Items.DraedonMisc; using CalamityMod.Items.Materials; using CalamityMod.NPCs.ExoMechs; using CalamityMod.Packets; +using CalamityMod.Systems.Collections; using CalamityMod.TileEntities; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -228,7 +228,7 @@ namespace CalamityMod.UI.DraedonSummoning int schematicType = 0; if (codebreakerTileEntity.HeldSchematicID > 0) - schematicType = CalamityLists.EncryptedSchematicIDRelationship[codebreakerTileEntity.HeldSchematicID]; + schematicType = EncryptedSchematicIDRelationshipDict.Dict[codebreakerTileEntity.HeldSchematicID]; if (schematicType == ModContent.ItemType()) schematicIconTexture = ModContent.Request("CalamityMod/Items/DraedonMisc/EncryptedSchematicPlanetoid").Value; @@ -422,9 +422,16 @@ namespace CalamityMod.UI.DraedonSummoning { // If the player's hand item is empty and the codebreaker has a schematic, grab it. // This doesn't work if the Codebreaker is busy decrypting the schematic in question. - if (playerHandItem.IsAir && CalamityLists.EncryptedSchematicIDRelationship.ContainsKey(codebreakerTileEntity.HeldSchematicID) && codebreakerTileEntity.DecryptionCountdown <= 0) + + bool isAir = playerHandItem.IsAir; + bool countdownDone = codebreakerTileEntity.DecryptionCountdown <= 0; + bool hasValidSchematicID = EncryptedSchematicIDRelationshipDict.TryGet(codebreakerTileEntity.HeldSchematicID, out var schematicItemType); + bool hasHandHoldingValidSchematicItem = EncryptedSchematicIDRelationshipDict.TryGetKey(playerHandItem.type, out var handHoldSchematicID); + bool hasMouseHoldingValidSchematicItem = EncryptedSchematicIDRelationshipDict.TryGetKey(Main.mouseItem.type, out var mouseHoldSchematicID); + + if (isAir && countdownDone && hasValidSchematicID) { - playerHandItem.SetDefaults(CalamityLists.EncryptedSchematicIDRelationship[codebreakerTileEntity.HeldSchematicID]); + playerHandItem.SetDefaults(schematicItemType); codebreakerTileEntity.HeldSchematicID = 0; codebreakerTileEntity.DecryptionCountdown = 0; codebreakerTileEntity.SyncContainedStuff(); @@ -434,9 +441,9 @@ namespace CalamityMod.UI.DraedonSummoning } // Otherwise, if the player has an encrypted schematic and the Codebreaker doesn't, insert it into the machine. - else if (CalamityLists.EncryptedSchematicIDRelationship.ContainsValue(playerHandItem.type) && codebreakerTileEntity.HeldSchematicID == 0) + else if (hasHandHoldingValidSchematicItem && hasMouseHoldingValidSchematicItem && codebreakerTileEntity.HeldSchematicID == 0) { - codebreakerTileEntity.HeldSchematicID = CalamityLists.EncryptedSchematicIDRelationship.First(i => i.Value == Main.mouseItem.type).Key; + codebreakerTileEntity.HeldSchematicID = mouseHoldSchematicID; playerHandItem.TurnToAir(); codebreakerTileEntity.SyncContainedStuff(); SoundEngine.PlaySound(SoundID.Grab); @@ -445,15 +452,15 @@ namespace CalamityMod.UI.DraedonSummoning } // Lastly, if the player has an encrypted schematic but so does the Codebreaker, swap the two. - else if (CalamityLists.EncryptedSchematicIDRelationship.ContainsValue(playerHandItem.type) && codebreakerTileEntity.HeldSchematicID != 0) + else if (hasHandHoldingValidSchematicItem && hasValidSchematicID) { - int previouslyHeldSchematic = CalamityLists.EncryptedSchematicIDRelationship[codebreakerTileEntity.HeldSchematicID]; + int previouslyHeldSchematic = schematicItemType; // If the schematics are the same, don't actually do anything, just play the sound as an illusion, to prevent having to send a packet. SoundEngine.PlaySound(SoundID.Grab); - if (playerHandItem.type != previouslyHeldSchematic) + if (playerHandItem.type != previouslyHeldSchematic && hasMouseHoldingValidSchematicItem) { - codebreakerTileEntity.HeldSchematicID = CalamityLists.EncryptedSchematicIDRelationship.First(i => i.Value == Main.mouseItem.type).Key; + codebreakerTileEntity.HeldSchematicID = mouseHoldSchematicID; playerHandItem.SetDefaults(previouslyHeldSchematic); codebreakerTileEntity.SyncContainedStuff(); AwaitingDecryptionTextClose = false; diff --git a/Utilities/DrawingUtils.cs b/Utilities/DrawingUtils.cs index 8f13a8b86e..9ed32533e5 100644 --- a/Utilities/DrawingUtils.cs +++ b/Utilities/DrawingUtils.cs @@ -591,6 +591,16 @@ namespace CalamityMod return Color.Lerp(currentColor, nextColor, increment * colors.Length % 1f); } + [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] + public static bool IsAnyChannelGreaterThan(this Color a, Color b, bool includeAlpha = false) + { + if (a.R > b.R) return true; + if (a.G > b.G) return true; + if (a.B > b.B) return true; + if (includeAlpha && a.A > b.A) return true; + return false; + } + // Cached for efficiency purposes. internal static readonly FieldInfo UImageFieldMisc0 = typeof(MiscShaderData).GetField("_uImage0", BindingFlags.NonPublic | BindingFlags.Instance); internal static readonly FieldInfo UImageFieldMisc1 = typeof(MiscShaderData).GetField("_uImage1", BindingFlags.NonPublic | BindingFlags.Instance); diff --git a/Utilities/DropHelper.cs b/Utilities/DropHelper.cs index ab5c4d06d8..1cb2255b9f 100644 --- a/Utilities/DropHelper.cs +++ b/Utilities/DropHelper.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using CalamityMod.Enums; using CalamityMod.Items.Accessories; using CalamityMod.Items.Potions; using CalamityMod.NPCs.SulphurousSea; @@ -282,51 +283,323 @@ namespace CalamityMod } /// - /// Adds all the common potions for fishing crates, alongside scaling mana and regen potions + /// Adds all the common drops for Biome Crates. /// /// The ILoot interface for the loot table. /// Whether or not the crate is considered a hardmode crate. - public static void AddCratePotionRules(this ILoot loot, bool hardMode = true) + public static void AddBiomeCrateLootRules(this ILoot loot, bool hardMode = true) { - loot.Add(ItemID.ObsidianSkinPotion, 10, 1, 3); - loot.Add(ItemID.SwiftnessPotion, 10, 1, 3); - loot.Add(ItemID.IronskinPotion, 10, 1, 3); - loot.Add(ItemID.NightOwlPotion, 10, 1, 3); - loot.Add(ItemID.ShinePotion, 10, 1, 3); - loot.Add(ItemID.MiningPotion, 10, 1, 3); - loot.Add(ItemID.HeartreachPotion, 10, 1, 3); - loot.Add(ItemID.TrapsightPotion, 10, 1, 3); // Dangersense Potion - - // Define all the loot rules for the potion types - var supremePots = new OneFromOptionsNotScaledWithLuckDropRule(1, 1, ModContent.ItemType(), ModContent.ItemType()); - var superPots = new OneFromOptionsNotScaledWithLuckDropRule(1, 1, ItemID.SuperHealingPotion, ItemID.SuperManaPotion); - var greaterPots = new OneFromOptionsNotScaledWithLuckDropRule(1, 1, ItemID.GreaterHealingPotion, ItemID.GreaterManaPotion); - var regularPots = new OneFromOptionsNotScaledWithLuckDropRule(1, 1, ItemID.HealingPotion, ItemID.ManaPotion); - var lesserPots = new OneFromOptionsNotScaledWithLuckDropRule(1, 1, ItemID.LesserHealingPotion, ItemID.LesserManaPotion); - - // Chained LeadingConditionRules achieve the equivalent of "if killed X, else if killed Y, else if killed Z, else..." - var lcrSupremePotion = loot.DefineConditionalDropSet(() => DownedBossSystem.downedDoG); - var lcrSuperPotion = new LeadingConditionRule(If(() => DownedBossSystem.downedProvidence)); - var lcrGreaterPotion = new LeadingConditionRule(If(() => NPC.downedMechBossAny)); - var lcrRegularPotion = new LeadingConditionRule(If(() => NPC.downedBoss3)); - - // Actually chain all the LCRs together - // Greater potions upwards are only chained if the crate is marked as Hardmode if (hardMode) + loot.AddHardmodeOresToCrates(HardmodeCrateType.Biome); + else { - lcrSupremePotion.Add(supremePots); - lcrSupremePotion.OnFailedConditions(lcrSuperPotion); - lcrSuperPotion.Add(superPots); - lcrSuperPotion.OnFailedConditions(lcrGreaterPotion); - lcrGreaterPotion.Add(greaterPots); - lcrGreaterPotion.OnFailedConditions(lcrRegularPotion); + // Pre-Hardmode Ore/Bar loot pools + // 20-35 Ores @ 14.29%; Individually 1.79% + IItemDropRule[] phmOres = new IItemDropRule[8] + { + ItemDropRule.NotScalingWithLuck(ItemID.CopperOre, 1, 20, 35), + ItemDropRule.NotScalingWithLuck(ItemID.TinOre, 1, 20, 35), + ItemDropRule.NotScalingWithLuck(ItemID.IronOre, 1, 20, 35), + ItemDropRule.NotScalingWithLuck(ItemID.LeadOre, 1, 20, 35), + ItemDropRule.NotScalingWithLuck(ItemID.SilverOre, 1, 20, 35), + ItemDropRule.NotScalingWithLuck(ItemID.TungstenOre, 1, 20, 35), + ItemDropRule.NotScalingWithLuck(ItemID.GoldOre, 1, 20, 35), + ItemDropRule.NotScalingWithLuck(ItemID.PlatinumOre, 1, 20, 35) + }; + loot.Add(new OneFromRulesRule(7, phmOres)); + + // 6-16 Bars @ 25%; Individually 4.17% + IItemDropRule[] phmBars = new IItemDropRule[6] + { + ItemDropRule.NotScalingWithLuck(ItemID.IronBar, 1, 6, 16), + ItemDropRule.NotScalingWithLuck(ItemID.LeadBar, 1, 6, 16), + ItemDropRule.NotScalingWithLuck(ItemID.SilverBar, 1, 6, 16), + ItemDropRule.NotScalingWithLuck(ItemID.TungstenBar, 1, 6, 16), + ItemDropRule.NotScalingWithLuck(ItemID.GoldBar, 1, 6, 16), + ItemDropRule.NotScalingWithLuck(ItemID.PlatinumBar, 1, 6, 16) + }; + loot.Add(new OneFromRulesRule(4, phmBars)); } - lcrRegularPotion.Add(regularPots); - lcrRegularPotion.OnFailedConditions(lesserPots); - // Add the chain starting from regular potions if marked as a Pre-Hardmode crate - if (!hardMode) + + // 2-4 Buff Potions @ 25%; Individually 4.17% + loot.Add(new OneFromRulesRule(4, new IItemDropRule[6] { - loot.Add(lcrRegularPotion); + ItemDropRule.NotScalingWithLuck(ItemID.ObsidianSkinPotion, 1, 2, 4), + ItemDropRule.NotScalingWithLuck(ItemID.SpelunkerPotion, 1, 2, 4), + ItemDropRule.NotScalingWithLuck(ItemID.HunterPotion, 1, 2, 4), + ItemDropRule.NotScalingWithLuck(ItemID.GravitationPotion, 1, 2, 4), + ItemDropRule.NotScalingWithLuck(ItemID.MiningPotion, 1, 2, 4), + ItemDropRule.NotScalingWithLuck(ItemID.HeartreachPotion, 1, 2, 4) + })); + + // 5-17 (Regular) Recovery Potions @ 50%; 25% Healing 25% Mana + loot.Add(new OneFromRulesRule(2, new IItemDropRule[2] + { + ItemDropRule.NotScalingWithLuck(ItemID.HealingPotion, 1, 5, 17), + ItemDropRule.NotScalingWithLuck(ItemID.ManaPotion, 1, 5, 17) + })); + + // 2-6 Bait @ 50%; 25% Master 25% Apprentice + loot.Add(new OneFromRulesRule(2, new IItemDropRule[2] + { + ItemDropRule.NotScalingWithLuck(ItemID.MasterBait, 1, 2, 6), + ItemDropRule.NotScalingWithLuck(ItemID.ApprenticeBait, 1, 2, 6) + })); + + // 5-12 Gold Coin @ 25% + loot.Add(ItemID.GoldCoin, 4, 5, 12); + } + + /// + /// Adds (or re-adds) Hardmode Ores to crates with respect to Hardmode Progression rework
+ /// Drop rules replicate vanilla's rules. + ///
+ /// The ILoot interface for the loot table. + /// Type of crate: Mythril, Titanium, Biome + public static void AddHardmodeOresToCrates(this ILoot loot, HardmodeCrateType type) + { + var adamantiteLCR = loot.DefineConditionalDropSet(AdamantiteCondition); + var mythrilLCR = new LeadingConditionRule(MythrilCondition); + if (type == HardmodeCrateType.Biome) + { + // Pre-Hardmode loot pools + // 20-35 Ores @ 7.14%; Individually 0.89% + IItemDropRule[] phmOres = new IItemDropRule[8] + { + ItemDropRule.NotScalingWithLuck(ItemID.CopperOre, 1, 20, 35), + ItemDropRule.NotScalingWithLuck(ItemID.TinOre, 1, 20, 35), + ItemDropRule.NotScalingWithLuck(ItemID.IronOre, 1, 20, 35), + ItemDropRule.NotScalingWithLuck(ItemID.LeadOre, 1, 20, 35), + ItemDropRule.NotScalingWithLuck(ItemID.SilverOre, 1, 20, 35), + ItemDropRule.NotScalingWithLuck(ItemID.TungstenOre, 1, 20, 35), + ItemDropRule.NotScalingWithLuck(ItemID.GoldOre, 1, 20, 35), + ItemDropRule.NotScalingWithLuck(ItemID.PlatinumOre, 1, 20, 35) + }; + // 6-16 Bars @ 8.33%; Individually 1.39% + IItemDropRule[] phmBars = new IItemDropRule[6] + { + ItemDropRule.NotScalingWithLuck(ItemID.IronBar, 1, 6, 16), + ItemDropRule.NotScalingWithLuck(ItemID.LeadBar, 1, 6, 16), + ItemDropRule.NotScalingWithLuck(ItemID.SilverBar, 1, 6, 16), + ItemDropRule.NotScalingWithLuck(ItemID.TungstenBar, 1, 6, 16), + ItemDropRule.NotScalingWithLuck(ItemID.GoldBar, 1, 6, 16), + ItemDropRule.NotScalingWithLuck(ItemID.PlatinumBar, 1, 6, 16) + }; + + // Tier 3 loot pools + // 20-35 Ores @ 7.14%; Individually 1.19% + IItemDropRule[] hmOresThree = new IItemDropRule[6] + { + ItemDropRule.NotScalingWithLuck(ItemID.CobaltOre, 1, 20, 35), + ItemDropRule.NotScalingWithLuck(ItemID.PalladiumOre, 1, 20, 35), + ItemDropRule.NotScalingWithLuck(ItemID.MythrilOre, 1, 20, 35), + ItemDropRule.NotScalingWithLuck(ItemID.OrichalcumOre, 1, 20, 35), + ItemDropRule.NotScalingWithLuck(ItemID.AdamantiteOre, 1, 20, 35), + ItemDropRule.NotScalingWithLuck(ItemID.TitaniumOre, 1, 20, 35) + }; + // 5-16 Bars @ 16.67%; Individually 2.78% + IItemDropRule[] hmBarsThree = new IItemDropRule[6] + { + ItemDropRule.NotScalingWithLuck(ItemID.CobaltBar, 1, 5, 16), + ItemDropRule.NotScalingWithLuck(ItemID.PalladiumBar, 1, 5, 16), + ItemDropRule.NotScalingWithLuck(ItemID.MythrilBar, 1, 5, 16), + ItemDropRule.NotScalingWithLuck(ItemID.OrichalcumBar, 1, 5, 16), + ItemDropRule.NotScalingWithLuck(ItemID.AdamantiteBar, 1, 5, 16), + ItemDropRule.NotScalingWithLuck(ItemID.TitaniumBar, 1, 5, 16) + }; + var adamantiteDropsOres = new SequentialRulesNotScalingWithLuckRule(7, new OneFromRulesRule(2, hmOresThree), new OneFromRulesRule(1, phmOres)); + var adamantiteDropsBars = new SequentialRulesNotScalingWithLuckRule(4, new OneFromRulesRule(3, 2, hmBarsThree), new OneFromRulesRule(1, phmBars)); + + // Tier 2 loot pools + // 20-35 Ores @ 7.14%; Individually 1.79% + IItemDropRule[] hmOresTwo = new IItemDropRule[4] + { + ItemDropRule.NotScalingWithLuck(ItemID.CobaltOre, 1, 20, 35), + ItemDropRule.NotScalingWithLuck(ItemID.PalladiumOre, 1, 20, 35), + ItemDropRule.NotScalingWithLuck(ItemID.MythrilOre, 1, 20, 35), + ItemDropRule.NotScalingWithLuck(ItemID.OrichalcumOre, 1, 20, 35) + }; + // 5-16 Bars @ 16.67%; Individually 4.17% + IItemDropRule[] hmBarsTwo = new IItemDropRule[4] + { + ItemDropRule.NotScalingWithLuck(ItemID.CobaltBar, 1, 5, 16), + ItemDropRule.NotScalingWithLuck(ItemID.PalladiumBar, 1, 5, 16), + ItemDropRule.NotScalingWithLuck(ItemID.MythrilBar, 1, 5, 16), + ItemDropRule.NotScalingWithLuck(ItemID.OrichalcumBar, 1, 5, 16) + }; + var mythrilDropsOres = new SequentialRulesNotScalingWithLuckRule(7, new OneFromRulesRule(2, hmOresTwo), new OneFromRulesRule(1, phmOres)); + var mythrilDropsBars = new SequentialRulesNotScalingWithLuckRule(4, new OneFromRulesRule(3, 2, hmBarsTwo), new OneFromRulesRule(1, phmBars)); + + // Tier 1 loot pools + // 20-35 Ores @ 7.14%; Individually 3.57% + IItemDropRule[] hmOresOne = new IItemDropRule[2] + { + ItemDropRule.NotScalingWithLuck(ItemID.CobaltOre, 1, 20, 35), + ItemDropRule.NotScalingWithLuck(ItemID.PalladiumOre, 1, 20, 35) + }; + // 5-16 Bars @ 16.67%; Individually 8.33% + IItemDropRule[] hmBarsOne = new IItemDropRule[2] + { + ItemDropRule.NotScalingWithLuck(ItemID.CobaltBar, 1, 5, 16), + ItemDropRule.NotScalingWithLuck(ItemID.PalladiumBar, 1, 5, 16) + }; + var cobaltDropsOres = new SequentialRulesNotScalingWithLuckRule(7, new OneFromRulesRule(2, hmOresOne), new OneFromRulesRule(1, phmOres)); + var cobaltDropsBars = new SequentialRulesNotScalingWithLuckRule(4, new OneFromRulesRule(3, 2, hmBarsOne), new OneFromRulesRule(1, phmBars)); + + adamantiteLCR.Add(adamantiteDropsOres); + adamantiteLCR.Add(adamantiteDropsBars); + adamantiteLCR.OnFailedConditions(mythrilLCR); + mythrilLCR.Add(mythrilDropsOres); + mythrilLCR.Add(mythrilDropsBars); + mythrilLCR.OnFailedConditions(cobaltDropsOres); + mythrilLCR.OnFailedConditions(cobaltDropsBars); + } + else if (type == HardmodeCrateType.Mythril) + { + // Pre-Hardmode loot pools + // 12-21 Ores @ 8.33%; Individually 1.39% + IItemDropRule[] phmOres = new IItemDropRule[6] + { + ItemDropRule.NotScalingWithLuck(ItemID.CopperOre, 1, 12, 21), + ItemDropRule.NotScalingWithLuck(ItemID.TinOre, 1, 12, 21), + ItemDropRule.NotScalingWithLuck(ItemID.IronOre, 1, 12, 21), + ItemDropRule.NotScalingWithLuck(ItemID.LeadOre, 1, 12, 21), + ItemDropRule.NotScalingWithLuck(ItemID.SilverOre, 1, 12, 21), + ItemDropRule.NotScalingWithLuck(ItemID.TungstenOre, 1, 12, 21), + }; + // 4-7 Bars @ 6.94%; Individually 1.16% + IItemDropRule[] phmBars = new IItemDropRule[6] + { + ItemDropRule.NotScalingWithLuck(ItemID.CopperBar, 1, 4, 7), + ItemDropRule.NotScalingWithLuck(ItemID.TinBar, 1, 4, 7), + ItemDropRule.NotScalingWithLuck(ItemID.IronBar, 1, 4, 7), + ItemDropRule.NotScalingWithLuck(ItemID.LeadBar, 1, 4, 7), + ItemDropRule.NotScalingWithLuck(ItemID.SilverBar, 1, 4, 7), + ItemDropRule.NotScalingWithLuck(ItemID.TungstenBar, 1, 4, 7), + }; + + // Tier 2 loot pools + // 12-21 Ores @ 8.33%; Individually 2.08% + IItemDropRule[] hmOresTwo = new IItemDropRule[4] + { + ItemDropRule.NotScalingWithLuck(ItemID.CobaltOre, 1, 12, 21), + ItemDropRule.NotScalingWithLuck(ItemID.PalladiumOre, 1, 12, 21), + ItemDropRule.NotScalingWithLuck(ItemID.MythrilOre, 1, 12, 21), + ItemDropRule.NotScalingWithLuck(ItemID.OrichalcumOre, 1, 12, 21) + }; + // 3-7 Bars @ 13.89%; Individually 3.47% + IItemDropRule[] hmBarsTwo = new IItemDropRule[4] + { + ItemDropRule.NotScalingWithLuck(ItemID.CobaltBar, 1, 3, 7), + ItemDropRule.NotScalingWithLuck(ItemID.PalladiumBar, 1, 3, 7), + ItemDropRule.NotScalingWithLuck(ItemID.MythrilBar, 1, 3, 7), + ItemDropRule.NotScalingWithLuck(ItemID.OrichalcumBar, 1, 3, 7) + }; + var mythrilDropsOres = new SequentialRulesNotScalingWithLuckRule(6, new OneFromRulesRule(2, hmOresTwo), new OneFromRulesRule(1, phmOres)); + var mythrilDropsBars = new SequentialRulesNotScalingWithLuckRule(4, new OneFromRulesRule(3, 2, hmBarsTwo), new OneFromRulesRule(1, phmBars)); + var mythrilDrops = new SequentialRulesNotScalingWithLuckRule(1, mythrilDropsOres, mythrilDropsBars); + + // Tier 1 loot pools + // 12-21 Ores @ 8.33%; Individually 4.17% + IItemDropRule[] hmOresOne = new IItemDropRule[2] + { + ItemDropRule.NotScalingWithLuck(ItemID.CobaltOre, 1, 12, 21), + ItemDropRule.NotScalingWithLuck(ItemID.PalladiumOre, 1, 12, 21) + }; + // 3-7 Bars @ 13.89%; Individually 6.94% + IItemDropRule[] hmBarsOne = new IItemDropRule[2] + { + ItemDropRule.NotScalingWithLuck(ItemID.CobaltBar, 1, 3, 7), + ItemDropRule.NotScalingWithLuck(ItemID.PalladiumBar, 1, 3, 7) + }; + var cobaltDropsOres = new SequentialRulesNotScalingWithLuckRule(6, new OneFromRulesRule(2, hmOresOne), new OneFromRulesRule(1, phmOres)); + var cobaltDropsBars = new SequentialRulesNotScalingWithLuckRule(4, new OneFromRulesRule(3, 2, hmBarsOne), new OneFromRulesRule(1, phmBars)); + var cobaltDrops = new SequentialRulesNotScalingWithLuckRule(1, cobaltDropsOres, cobaltDropsBars); + + mythrilLCR.Add(mythrilDrops); + mythrilLCR.OnFailedConditions(cobaltDrops); + loot.Add(mythrilLCR); // No Adamantite LCR here so we need to add this in + } + else if (type == HardmodeCrateType.Titanium) + { + // Pre-Hardmode loot pools + // 25-34 Ores @ 10%; Individually 2.5% + IItemDropRule[] phmOres = new IItemDropRule[4] + { + ItemDropRule.NotScalingWithLuck(ItemID.SilverOre, 1, 25, 34), + ItemDropRule.NotScalingWithLuck(ItemID.TungstenOre, 1, 25, 34), + ItemDropRule.NotScalingWithLuck(ItemID.GoldOre, 1, 25, 34), + ItemDropRule.NotScalingWithLuck(ItemID.PlatinumOre, 1, 25, 34) + }; + // 8-11 Bars @ 8.89%; Individually 2.22% + IItemDropRule[] phmBars = new IItemDropRule[4] + { + ItemDropRule.NotScalingWithLuck(ItemID.SilverBar, 1, 8, 11), + ItemDropRule.NotScalingWithLuck(ItemID.TungstenBar, 1, 8, 11), + ItemDropRule.NotScalingWithLuck(ItemID.GoldBar, 1, 8, 11), + ItemDropRule.NotScalingWithLuck(ItemID.PlatinumBar, 1, 8, 11) + }; + + // Tier 3 loot pools + // 25-34 Ores @ 10%; Individually 2.5% + IItemDropRule[] hmOresThree = new IItemDropRule[4] + { + ItemDropRule.NotScalingWithLuck(ItemID.MythrilOre, 1, 25, 34), + ItemDropRule.NotScalingWithLuck(ItemID.OrichalcumOre, 1, 25, 34), + ItemDropRule.NotScalingWithLuck(ItemID.AdamantiteOre, 1, 25, 34), + ItemDropRule.NotScalingWithLuck(ItemID.TitaniumOre, 1, 25, 34) + }; + // 8-11 Bars @ 17.78%; Individually 4.44% + IItemDropRule[] hmBarsThree = new IItemDropRule[4] + { + ItemDropRule.NotScalingWithLuck(ItemID.MythrilBar, 1, 8, 11), + ItemDropRule.NotScalingWithLuck(ItemID.OrichalcumBar, 1, 8, 11), + ItemDropRule.NotScalingWithLuck(ItemID.AdamantiteBar, 1, 8, 11), + ItemDropRule.NotScalingWithLuck(ItemID.TitaniumBar, 1, 8, 11) + }; + var adamantiteDropsOres = new SequentialRulesNotScalingWithLuckRule(5, new OneFromRulesRule(2, hmOresThree), new OneFromRulesRule(1, phmOres)); + var adamantiteDropsBars = new SequentialRulesNotScalingWithLuckRule(3, new OneFromRulesRule(3, 2, hmBarsThree), new OneFromRulesRule(1, phmBars)); + var adamantiteDrops = new SequentialRulesNotScalingWithLuckRule(1, adamantiteDropsOres, adamantiteDropsBars); + + // Tier 2 loot pools + // 25-34 Ores @ 10%; Individually 5% + IItemDropRule[] hmOresTwo = new IItemDropRule[2] + { + ItemDropRule.NotScalingWithLuck(ItemID.MythrilOre, 1, 25, 34), + ItemDropRule.NotScalingWithLuck(ItemID.OrichalcumOre, 1, 25, 34) + }; + // 8-11 Bars @ 17.78%; Individually 8.89% + IItemDropRule[] hmBarsTwo = new IItemDropRule[2] + { + ItemDropRule.NotScalingWithLuck(ItemID.MythrilBar, 1, 8, 11), + ItemDropRule.NotScalingWithLuck(ItemID.OrichalcumBar, 1, 8, 11) + }; + var mythrilDropsOres = new SequentialRulesNotScalingWithLuckRule(5, new OneFromRulesRule(2, hmOresTwo), new OneFromRulesRule(1, phmOres)); + var mythrilDropsBars = new SequentialRulesNotScalingWithLuckRule(3, new OneFromRulesRule(3, 2, hmBarsTwo), new OneFromRulesRule(1, phmBars)); + var mythrilDrops = new SequentialRulesNotScalingWithLuckRule(1, mythrilDropsOres, mythrilDropsBars); + + // Tier 1 loot pools + // EXCEPTION: Titanium Crates do not drop Cobalt. This is added to make it not entirely useless to get early. + // 25-34 Ores @ 10%; Individually 5% + IItemDropRule[] hmOresOne = new IItemDropRule[2] + { + ItemDropRule.NotScalingWithLuck(ItemID.CobaltOre, 1, 25, 34), + ItemDropRule.NotScalingWithLuck(ItemID.PalladiumOre, 1, 25, 34) + }; + // 8-11 Bars @ 17.78%; Individually 8.89% + IItemDropRule[] hmBarsOne = new IItemDropRule[2] + { + ItemDropRule.NotScalingWithLuck(ItemID.CobaltBar, 1, 8, 11), + ItemDropRule.NotScalingWithLuck(ItemID.PalladiumBar, 1, 8, 11) + }; + var cobaltDropsOres = new SequentialRulesNotScalingWithLuckRule(5, new OneFromRulesRule(2, hmOresOne), new OneFromRulesRule(1, phmOres)); + var cobaltDropsBars = new SequentialRulesNotScalingWithLuckRule(3, new OneFromRulesRule(3, 2, hmBarsOne), new OneFromRulesRule(1, phmBars)); + var cobaltDrops = new SequentialRulesNotScalingWithLuckRule(1, cobaltDropsOres, cobaltDropsBars); + + adamantiteLCR.Add(adamantiteDrops); + adamantiteLCR.OnFailedConditions(mythrilLCR); + mythrilLCR.Add(mythrilDrops); + mythrilLCR.OnFailedConditions(cobaltDrops); } } #endregion @@ -484,6 +757,25 @@ namespace CalamityMod #endregion #region Drop Rule Conditions + public static IItemDropRuleCondition MythrilCondition = If((info) => + { + // If the Early Hardmode Progression Rework is not enabled, then Mythril/Orichalcum can always drop. + if (!CalamityServerConfig.Instance.EarlyHardmodeProgressionRework) + return true; + + // If the Early Hardmode Progression Rework is enabled, then any Mechanical Boss must be defeated for Mythril/Orichalcum to drop. + return NPC.downedMechBossAny; + }); + public static IItemDropRuleCondition AdamantiteCondition = If((info) => + { + // If the Early Hardmode Progression Rework is not enabled, then Adamantite/Titanium can always drop. + if (!CalamityServerConfig.Instance.EarlyHardmodeProgressionRework) + return true; + + // If the Early Hardmode Progression Rework is enabled, then 2 of the Mechanical Bosses must be defeated for Adamantite/Titanium to drop. + return (NPC.downedMechBoss1 && NPC.downedMechBoss2) || (NPC.downedMechBoss2 && NPC.downedMechBoss3) || (NPC.downedMechBoss1 && NPC.downedMechBoss3); + }); + public static IItemDropRuleCondition HallowedBarsCondition = If((info) => { // If the Early Hardmode Progression Rework is not enabled, then Hallowed Bars can always drop from Mechanical Bosses. diff --git a/Utilities/NPCDebuffs.cs b/Utilities/NPCDebuffs.cs index 31ce973dc9..d14b07c8dc 100644 --- a/Utilities/NPCDebuffs.cs +++ b/Utilities/NPCDebuffs.cs @@ -35,6 +35,7 @@ using CalamityMod.NPCs.SulphurousSea; using CalamityMod.NPCs.SunkenSea; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.NPCs.Yharon; +using CalamityMod.Systems.Collections; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -99,13 +100,13 @@ namespace CalamityMod // // All bosses and several enemies are automatically immune to Pearl Aura. - if (CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) + if (EnemyImmunitiesList.Includes(npc.type) || npc.boss) NPCID.Sets.SpecificDebuffImmunity[npc.type][ModContent.BuffType()] = true; // Make all Cal NPCs immune to confused unless otherwise specified // Extra note: Clams are not in this list as they initially immune to Confused, but are no longer immune once aggro'd. This is set in their AI(). bool cal = npc.ModNPC != null && npc.ModNPC.Mod.Name.Equals(ModContent.GetInstance().Name); - if (!CalamityLists.confusionEnemyList.Contains(npc.type) && cal) + if (!ConfusionDebuffImmunitiesList.Includes(npc.type) && cal) NPCID.Sets.SpecificDebuffImmunity[npc.type][BuffID.Confused] = true; // Sets certain vanilla NPCs and all town NPCs to be immune to most debuffs. diff --git a/Utilities/PlayerUtils.cs b/Utilities/PlayerUtils.cs index b43c237438..0230959ea1 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -5,16 +5,17 @@ using System.Reflection; using CalamityMod.Balancing; using CalamityMod.CalPlayer; using CalamityMod.Cooldowns; +using CalamityMod.Enums; using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.Potions.Alcohol; +using CalamityMod.Systems.Collections; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent.Events; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Enums; using static Terraria.Player; namespace CalamityMod @@ -432,7 +433,7 @@ namespace CalamityMod public static int GetExtraHitIFrames(this Player player, HurtInfo hurtInfo) { CalamityPlayer modPlayer = player.Calamity(); - + int extraIFrames = 0; if (modPlayer.godSlayerThrowing && hurtInfo.Damage > 80) extraIFrames += 30; @@ -896,7 +897,7 @@ namespace CalamityMod /// The player using the holdout. /// Returns if the player CAN'T use the item. public static bool CantUseHoldout(this Player player, bool needsToHold = true) => player == null || !player.active || player.dead || (!player.channel && needsToHold) || player.CCed || player.noItems; - + /// /// A shorthand bool to check if the held item should trigger Calamity's summon damage penalty. /// @@ -921,10 +922,10 @@ namespace CalamityMod item.CountsAsClass() ); - bool heldItemIsTool = (item.pick > 0 || item.axe > 0 || item.hammer > 0) && !CalamityLists.BlacklistedWeaponsWithToolPower.Contains(item.type); + bool heldItemIsTool = (item.pick > 0 || item.axe > 0 || item.hammer > 0) && !BlacklistedWeaponsWithToolPowerList.Includes(item.type); bool heldItemCanBeUsed = item.useStyle != ItemUseStyleID.None; bool heldItemIsAccessoryOrAmmo = item.accessory || item.ammo != AmmoID.None; - bool heldItemIsExcludedByModCall = CalamityLists.DisabledSummonerNerfItems.Contains(item.type); + bool heldItemIsExcludedByModCall = DisabledSummonerNerfItemList.Includes(item.type); if (heldItemIsClassedWeapon && heldItemCanBeUsed && !heldItemIsTool && !heldItemIsAccessoryOrAmmo && !heldItemIsExcludedByModCall) return true; diff --git a/Utilities/TileUtils.cs b/Utilities/TileUtils.cs index 50442427ef..b4582f43ec 100644 --- a/Utilities/TileUtils.cs +++ b/Utilities/TileUtils.cs @@ -115,6 +115,9 @@ namespace CalamityMod public static void DrawFlameEffect(Texture2D flameTexture, int i, int j, int offsetX = 0, int offsetY = 0) { Tile tile = Main.tile[i, j]; + if (tile.IsTileActuallyInvisible()) + return; + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); int width = 16; @@ -134,6 +137,9 @@ namespace CalamityMod public static void DrawStaticFlameEffect(Texture2D flameTexture, int i, int j, int offsetX = 0, int offsetY = 0) { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; Color drawColour = new Color(100, 100, 100, 0); @@ -152,7 +158,7 @@ namespace CalamityMod public static void DrawFlameSparks(int dustType, int rarity, int i, int j) { - if (!Main.gamePaused && Main.instance.IsActive && (!Lighting.UpdateEveryFrame || Main.rand.NextBool(4))) + if (!Main.gamePaused && Main.instance.IsActive && !Main.tile[i,j].IsTileActuallyInvisible() && (!Lighting.UpdateEveryFrame || Main.rand.NextBool(4))) { if (Main.rand.NextBool(rarity)) { @@ -227,6 +233,13 @@ namespace CalamityMod return uniqueAnimationFrame * animationFrameLength; } + /// + /// Checks whether or not the tile is actually able to be seen. + /// + /// The tile being checked. + /// Whether + public static bool IsTileActuallyInvisible(this Tile tile) => tile.IsTileInvisible && !Main.ShouldShowInvisibleWalls(); + /// /// Gets the color of a tile/wall after paint is applied /// @@ -297,7 +310,7 @@ namespace CalamityMod 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); + Color lightColor = tile.IsWallFullbright ? Color.White : Lighting.GetColor(i, j); spriteBatch.Draw(sprite, offset, frame, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); }); @@ -395,7 +408,8 @@ namespace CalamityMod // Extension shorthand for the Tile Framing System Universal Merges. // As this must be defined in a static class, it's out here in CalamityUtils. - [Obsolete("Use TileBlendMergeSystem.RegisterMerge Instead")] + // Flow, 2024/OCT/31 Removing Obsolete in here as tModLoader doesn't like this + //[Obsolete("Use TileBlendMergeSystem.RegisterMerge Instead")] public static void RegisterUniversalMerge(this ModTile tile, int mergeType, string blendSheetPath) { //TileFramingSystem.RegisterUniversalMerge(tile.Type, mergeType, blendSheetPath); diff --git a/Utilities/WorldgenUtils.cs b/Utilities/WorldgenUtils.cs index 37cadf07e3..3730a6265f 100644 --- a/Utilities/WorldgenUtils.cs +++ b/Utilities/WorldgenUtils.cs @@ -236,6 +236,10 @@ namespace CalamityMod // If Fargo's Mutant Mod is loaded, add to their Indestructible Rectangle list, which prevents structures from being trashed by Fargo's terrain tools. Mod fargos = ExternalMods.fargos; + paddedArea.X *= 16; + paddedArea.Y *= 16; + paddedArea.Width *= 16; + paddedArea.Height *= 16; fargos?.Call("AddIndestructibleRectangle", paddedArea); } } diff --git a/Walls/VoidstoneWall.cs b/Walls/VoidstoneWall.cs index 3f9290c465..3b1b90726f 100644 --- a/Walls/VoidstoneWall.cs +++ b/Walls/VoidstoneWall.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Walls int yPos = tile.WallFrameY; int xPos = tile.WallFrameX; Rectangle frame = new Rectangle(xPos, yPos, 32, 32); - Color lightColor = Lighting.GetColor(i, j); + Color lightColor = tile.IsWallFullbright ? Color.White : Lighting.GetColor(i, j); spriteBatch.Draw(sprite, offset, frame, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); diff --git a/Walls/VoidstoneWallUnsafe.cs b/Walls/VoidstoneWallUnsafe.cs index deee028dc4..b67cd4a7ae 100644 --- a/Walls/VoidstoneWallUnsafe.cs +++ b/Walls/VoidstoneWallUnsafe.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Walls int yPos = tile.WallFrameY; int xPos = tile.WallFrameX; Rectangle frame = new Rectangle(xPos, yPos, 32, 32); - Color lightColor = Lighting.GetColor(i, j); + Color lightColor = tile.IsWallFullbright ? Color.White : Lighting.GetColor(i, j); spriteBatch.Draw(sprite, offset, frame, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);