diff --git a/Backgrounds/SunkenSeaBurrowsBG.cs b/Backgrounds/SunkenSeaBurrowsBG.cs index 3f1369eb74..e51c997ffb 100644 --- a/Backgrounds/SunkenSeaBurrowsBG.cs +++ b/Backgrounds/SunkenSeaBurrowsBG.cs @@ -56,6 +56,55 @@ namespace CalamityMod.Backgrounds } } } + if (!Main.dedServ && (Main.LocalPlayer.InModBiome(ModContent.GetInstance()))) + { + int drawLimitX = Main.screenWidth / 16; + int drawLimitY = Main.screenHeight / 16; + Point drawPoint = (Main.screenPosition / 16).ToPoint(); + for (int i = 0; i < drawLimitX; i++) + { + for (int j = 0; j < drawLimitY; j++) + { + Point pos = drawPoint + new Point(i, j); + if (!Main.tile[pos.X, pos.Y].HasTile && + Main.tile[pos.X, pos.Y].WallType == 0 && + Main.tile[pos.X, pos.Y].LiquidAmount == 0) + Lighting.AddLight(pos.X, pos.Y, TorchID.White, 0.2f); + } + } + } + if (!Main.dedServ && (Main.LocalPlayer.InModBiome(ModContent.GetInstance()))) + { + int drawLimitX = Main.screenWidth / 16; + int drawLimitY = Main.screenHeight / 16; + Point drawPoint = (Main.screenPosition / 16).ToPoint(); + for (int i = 0; i < drawLimitX; i++) + { + for (int j = 0; j < drawLimitY; j++) + { + Point pos = drawPoint + new Point(i, j); + if (!Main.tile[pos.X, pos.Y].HasTile && + Main.tile[pos.X, pos.Y].WallType == 0) + Lighting.AddLight(pos.X, pos.Y, TorchID.White, 0.2f); + } + } + } + if (!Main.dedServ && (Main.LocalPlayer.InModBiome(ModContent.GetInstance()))) + { + int drawLimitX = Main.screenWidth / 16; + int drawLimitY = Main.screenHeight / 16; + Point drawPoint = (Main.screenPosition / 16).ToPoint(); + for (int i = 0; i < drawLimitX; i++) + { + for (int j = 0; j < drawLimitY; j++) + { + Point pos = drawPoint + new Point(i, j); + if (!Main.tile[pos.X, pos.Y].HasTile && + Main.tile[pos.X, pos.Y].WallType == 0) + Lighting.AddLight(pos.X, pos.Y, TorchID.White, 0.2f); + } + } + } } private void DrawToTarget(On_Main.orig_CheckMonoliths orig) diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index 9cb5eb02f0..03a1819d1b 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -31,8 +31,8 @@ namespace CalamityMod.Balancing // Balancing changes in this method are sorted based on place in progression, NPC name (from A-Z), and strength of resistance in ascending order, in that level of priority. // For ease of change, changes that are not exclusive to one specific weapon are not bundled into one line if they share the same resistance factor. - // To give an example of this, Thanatos having a 50% resist to Chicken Cannon and Prismatic Breaker should be two distinct lines with a 0.5x factor instead of hamfisting them all - // into one single resist that may have to be split later. + // To give an example of this, Thanatos having a 50% resist to Chicken Cannon and Rancor should be two distinct lines with a 0.5x factor instead of hamfisting them all into + // one single resist that may have to be split later. public override void SetStaticDefaults() { // Dirty shorthand for true melee resists, because they're super common and other class resists aren't. @@ -52,6 +52,9 @@ namespace CalamityMod.Balancing bool HiveBeeFilter(Projectile p) => p.type == ProjectileType() && Main.player[p.owner].ActiveItem().type == ItemType(); + bool EradicatorLaserFilter(Projectile p) => + p.type == ProjectileType() && p.DamageType == RogueDamageClass.Instance; + NPCSpecificBalancingChanges = new List(); #region Crabulon @@ -61,13 +64,13 @@ namespace CalamityMod.Balancing #region Eater of Worlds // 50% resist to Demon Scythe. - NPCSpecificBalancingChanges.AddRange(Bundle(EaterOfWorldsIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.DemonScythe)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.EaterOfWorlds, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.DemonScythe)))); // 40% resist to Sky Glaze. - NPCSpecificBalancingChanges.AddRange(Bundle(EaterOfWorldsIDList.List, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.EaterOfWorlds, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType())))); // 25% resist to true melee. - NPCSpecificBalancingChanges.AddRange(Bundle(EaterOfWorldsIDList.List, Do(ResistTrueMelee(0.75f)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.EaterOfWorlds, Do(ResistTrueMelee(0.75f)))); #endregion #region Brain of Cthulhu: Creepers @@ -80,7 +83,7 @@ namespace CalamityMod.Balancing #region The Perforators // 50% resist to true melee. - NPCSpecificBalancingChanges.AddRange(Bundle(PerforatorWormIDList.List, Do(ResistTrueMelee(0.5f)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Perforators, Do(ResistTrueMelee(0.5f)))); #endregion #region Wall of Flesh @@ -90,50 +93,50 @@ namespace CalamityMod.Balancing #region Aquatic Scourge // 50% resist to true melee. - NPCSpecificBalancingChanges.AddRange(Bundle(AquaticScourgeIDList.List, Do(ResistTrueMelee(0.5f)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AquaticScourge, 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(AquaticScourgeIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CultistBossLightningOrbArc)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AquaticScourge, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CultistBossLightningOrbArc)))); // 50% resist to Dormant Brimseeker. - NPCSpecificBalancingChanges.AddRange(Bundle(AquaticScourgeIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AquaticScourge, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 50% resist to Mounted Scanner. - NPCSpecificBalancingChanges.AddRange(Bundle(AquaticScourgeIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AquaticScourge, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 40% resist to Cryophobia. - NPCSpecificBalancingChanges.AddRange(Bundle(AquaticScourgeIDList.List, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AquaticScourge, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType())))); // 30% resist to Meowthrower. - NPCSpecificBalancingChanges.AddRange(Bundle(AquaticScourgeIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AquaticScourge, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); // 25% resist to Snowstorm Staff. - NPCSpecificBalancingChanges.AddRange(Bundle(AquaticScourgeIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType(), ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AquaticScourge, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType(), ProjectileType())))); #endregion #region The Destroyer // 50% resist to true melee. - NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(ResistTrueMelee(0.5f)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Destroyer, Do(ResistTrueMelee(0.5f)))); // 50% resist to Adamantite Throwing Axe's lightning. // See Aquatic Scourge comment. - NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CultistBossLightningOrbArc)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Destroyer, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CultistBossLightningOrbArc)))); // 50% resist to Dormant Brimseeker. - NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Destroyer, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 45% resist to Mounted Scanner. - NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Destroyer, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType())))); // 30% resist to Meowthrower. - NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Destroyer, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); // 25% resist to Avalanche's Ice Bombs and shards. - NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType(), ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Destroyer, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType(), ProjectileType())))); // 25% resist to Snowstorm Staff. - NPCSpecificBalancingChanges.AddRange(Bundle(DestroyerIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType(), ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Destroyer, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType(), ProjectileType())))); #endregion #region Astrum Aureus @@ -162,25 +165,25 @@ namespace CalamityMod.Balancing #region Ravager // 50% resist to true melee. - NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(ResistTrueMelee(0.5f)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, Do(ResistTrueMelee(0.5f)))); // 50% resist to Aegis Blade's explosions because the true melee resist ain't enough. - NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 40% resist to Icicle Arrows. - NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType())))); // 35% resist to Flying Dragon. - NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2SquireSonicBoom)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2SquireSonicBoom)))); // 25% resist to Lucrecia. - NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); // 20% resist to Aurora Blazer. - NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); // 20% resist to The Hive. - NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType(), ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType(), ProjectileType())))); #endregion #region Lunatic Cultist @@ -199,37 +202,37 @@ namespace CalamityMod.Balancing #region Astrum Deus // 75% resist to Plaguenades. - NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.25f, ProjectileType(), ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.25f, ProjectileType(), ProjectileType())))); // 70% resist to Charged Blaster Cannon. - NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.3f, ProjectileID.ChargedBlasterLaser)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.3f, ProjectileID.ChargedBlasterLaser)))); // 70% resist to Stardust Dragon Staff. - NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.3f, ProjectileID.StardustDragon1, ProjectileID.StardustDragon2, ProjectileID.StardustDragon3, ProjectileID.StardustDragon4)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.3f, ProjectileID.StardustDragon1, ProjectileID.StardustDragon2, ProjectileID.StardustDragon3, ProjectileID.StardustDragon4)))); // 50% resist to true melee. - NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(ResistTrueMelee(0.5f)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(ResistTrueMelee(0.5f)))); // 50% resist to Atlantis (Atlantis gaming!). - NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 35% resist to Aerial Bane. - NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2BetsyArrow)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2BetsyArrow)))); // 35% resist to Icicle Arrows. - NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType())))); // 30% resist to Aurora Blazer. - NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); // 30% resist to Flak Kraken. - NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); // 20% resist to Ballistic Poison Bomb's clouds. - NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); // 20% resist to Cluster Rocket fragments. - NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileID.ClusterFragmentsI, ProjectileID.ClusterFragmentsII)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.8f, ProjectileID.ClusterFragmentsI, ProjectileID.ClusterFragmentsII)))); #endregion #region Moon Lord @@ -263,28 +266,28 @@ namespace CalamityMod.Balancing #region Storm Weaver // 50% resist to true melee. - NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(ResistTrueMelee(0.5f)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(ResistTrueMelee(0.5f)))); // 50% resist to Dazzling Stabber Staff. - NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 50% resist to Last Prism. - NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.LastPrismLaser)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.LastPrismLaser)))); // 50% resist to Legion of Celestia. - NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 50% resist to Pristine Fury's alt fire. - NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 50% resist to Tactician's Trump Card's explosions. - NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 40% resist to Devil's Sunrise's slashes. - NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType())))); // 35% resist to Event Horizon. - NPCSpecificBalancingChanges.AddRange(Bundle(StormWeaverIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType(), ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType(), ProjectileType())))); #endregion #region Old Duke @@ -294,19 +297,19 @@ namespace CalamityMod.Balancing #region The Devourer of Gods // 65% resist to Wave Pounder. - NPCSpecificBalancingChanges.AddRange(Bundle(DevourerOfGodsIDList.List, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType())))); // 35% resist to Sulphuric Acid Cannon's explosions. - NPCSpecificBalancingChanges.AddRange(Bundle(DevourerOfGodsIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType())))); // 25% resist to Corinth Prime's grenades. - NPCSpecificBalancingChanges.AddRange(Bundle(DevourerOfGodsIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, 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(DevourerOfGodsIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); // 15% vulnerability to Time Bolt stealth strikes. - NPCSpecificBalancingChanges.AddRange(Bundle(DevourerOfGodsIDList.List, Do(new StealthStrikeBalancingRule(1.15f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.DevourerOfGods, Do(new StealthStrikeBalancingRule(1.15f, ProjectileType())))); #endregion The Devourer of Gods #region Yharon @@ -319,34 +322,28 @@ namespace CalamityMod.Balancing #region Exo Mechs: Ares // 35% resist to Devil's Devastation's slash. - NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType())))); // 30% resist to Dynamic Pursuer. - NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType(), ProjectileType(), ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType(), ProjectileType(), ProjectileType())))); // 25% resist to Aetherflux Cannon. - NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); - - // 25% resist to Prismatic Breaker's deathray. - NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); // 20% resist to the Spin Throw part of the Ark of the Cosmos' combo. - NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileSpecificRequirementBalancingRule(0.8f, AotCThrowCombo)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileSpecificRequirementBalancingRule(0.8f, AotCThrowCombo)))); // 20% resist to Dragon Rage projectiles. - NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileSpecificRequirementBalancingRule(0.8f, DragonRageFilter)))); - - // 20% resist to Eclipse's Fall. - NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType(), ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileSpecificRequirementBalancingRule(0.8f, DragonRageFilter)))); // 20% resist to Rancor. - NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); // 20% resist to Yharim's Crystal. - NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); // 20% resist to Zenith. - NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileID.FinalFractal)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ares, Do(new ProjectileResistBalancingRule(0.8f, ProjectileID.FinalFractal)))); #endregion #region Exo Mechs: Artemis and Apollo @@ -358,85 +355,73 @@ namespace CalamityMod.Balancing #region Exo Mechs: Thanatos // 65% resist to true melee. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(ResistTrueMelee(0.35f)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(ResistTrueMelee(0.35f)))); // 65% resist to The Final Dawn's lunge. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType())))); // 65% resist to Stellar Torus Staff. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType())))); // 60% resist to Dynamic Pursuer. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.4f, ProjectileType(), ProjectileType(), ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.4f, ProjectileType(), ProjectileType(), ProjectileType())))); // 50% resist to Chicken Cannon. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); - - // 50% resist to Omicron's beam. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 50% resist to Rancor. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 50% resist to Vehemence's skulls. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 50% resist to Yharim's Crystal. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); - - // 45% resist to Prismatic Breaker's deathray. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); // 45% resist to Wrathwing's stealth strike fireballs. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType())))); - // 30% resist to Eclipse's Fall. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + // 40% resist to Omicron's beam. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType())))); - // 30% resist to Sirius. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); - - // 30% resist to Ultima's rays. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + // 35% resist to Prismatic Breaker's deathray. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType())))); // 30% resist to Dragon Scales and The Wand's tornadoes. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType(), ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType(), ProjectileType())))); // 25% resist to the Spin Throw part of the Ark of the Cosmos' combo. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, AotCThrowCombo)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, AotCThrowCombo)))); // 25% resist to Dragon Rage projectiles. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, DragonRageFilter)))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, DragonRageFilter)))); // 25% resist to Gael's Greatsword's big skulls. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, BigGaelsSkullFilter)))); - - // 25% resist to Mirror of Kalandra's Paradoxica minion. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, BigGaelsSkullFilter)))); // 25% resist to Zenith. - 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(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.75f, ProjectileID.FinalFractal)))); // 20% resist to Ariane's aura (Lilies of Finality). - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); // 20% resist to Eradicator's beams. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileSpecificRequirementBalancingRule(0.8f, EradicatorLaserFilter)))); - // 20% resist to Plasma Grenade and Dynamic Pursuer's explosions. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType(), ProjectileType(), ProjectileType())))); + // 20% resist to Mirror of Kalandra's Paradoxica minion. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); // 20% resist to Voltaic Climax / Void Vortex hitscan beams. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); // 15% resist to The Final Dawn's AoE sweep flames. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType())))); // 15% resist to Gruesome Eminence. - NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType())))); + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType())))); + + // 15% resist to Ultima's rays. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Thanatos, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType())))); #endregion #region Supreme Calamitas: Brimstone Hearts @@ -448,9 +433,6 @@ namespace CalamityMod.Balancing // 30% resist to Surge Driver's alt click comets. NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.7f, ProjectileType()))); - - // 20% resist to Executioner's Blade stealth strikes. - NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), new ProjectileResistBalancingRule(0.8f, ProjectileType()))); #endregion #region Supreme Calamitas: Soul Seekers diff --git a/Balancing/BalancingConstants.cs b/Balancing/BalancingConstants.cs index 2322303648..ec3d67b330 100644 --- a/Balancing/BalancingConstants.cs +++ b/Balancing/BalancingConstants.cs @@ -72,8 +72,6 @@ internal static readonly int AmalgamDodgeCooldownMax = 5400; internal static readonly int MirrorDodgeCooldownMin = 1200; internal static readonly int MirrorDodgeCooldownMax = 5400; - internal static readonly int DaedalusReflectCooldownMin = 1200; - internal static readonly int DaedalusReflectCooldownMax = 5400; internal static readonly int EvolutionReflectCooldownMin = 1200; internal static readonly int EvolutionReflectCooldownMax = 5400; #endregion diff --git a/BiomeManagers/BestiaryCategories/AstralCaveDesert.cs b/BiomeManagers/BestiaryCategories/AstralCaveDesert.cs index 8f7d2a9a30..a7d599d6c6 100644 --- a/BiomeManagers/BestiaryCategories/AstralCaveDesert.cs +++ b/BiomeManagers/BestiaryCategories/AstralCaveDesert.cs @@ -7,5 +7,6 @@ namespace CalamityMod.BiomeManagers.BestiaryCategories public override string BestiaryIcon => "CalamityMod/BiomeManagers/AstralCaveDesertIcon"; public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; + public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; } } diff --git a/BiomeManagers/BestiaryCategories/AstralDesert.cs b/BiomeManagers/BestiaryCategories/AstralDesert.cs index 29b0a3f907..12450ebde2 100644 --- a/BiomeManagers/BestiaryCategories/AstralDesert.cs +++ b/BiomeManagers/BestiaryCategories/AstralDesert.cs @@ -7,5 +7,6 @@ namespace CalamityMod.BiomeManagers.BestiaryCategories public override string BestiaryIcon => "CalamityMod/BiomeManagers/AstralDesertIcon"; public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; + public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; } } diff --git a/BiomeManagers/BestiaryCategories/AstralUnderground.cs b/BiomeManagers/BestiaryCategories/AstralUnderground.cs index 42d924fd5b..0b3c7b2090 100644 --- a/BiomeManagers/BestiaryCategories/AstralUnderground.cs +++ b/BiomeManagers/BestiaryCategories/AstralUnderground.cs @@ -7,5 +7,6 @@ namespace CalamityMod.BiomeManagers.BestiaryCategories public override string BestiaryIcon => "CalamityMod/BiomeManagers/UndergroundAstralIcon"; public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; + public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; } } diff --git a/Buffs/Alcohol/CinnamonRollBuff.cs b/Buffs/Alcohol/CinnamonRollBuff.cs index 3d4daff7ea..3b00c5c43a 100644 --- a/Buffs/Alcohol/CinnamonRollBuff.cs +++ b/Buffs/Alcohol/CinnamonRollBuff.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -17,6 +18,7 @@ namespace CalamityMod.Buffs.Alcohol public override void Update(Player player, ref int buffIndex) { player.Calamity().cinnamonRoll = true; + player.Calamity().HeatDebuffMultiplier += 0.5f; } } } diff --git a/Buffs/Alcohol/EvergreenGinBuff.cs b/Buffs/Alcohol/EvergreenGinBuff.cs index 26f9f2d161..78f79db5cb 100644 --- a/Buffs/Alcohol/EvergreenGinBuff.cs +++ b/Buffs/Alcohol/EvergreenGinBuff.cs @@ -17,6 +17,8 @@ namespace CalamityMod.Buffs.Alcohol public override void Update(Player player, ref int buffIndex) { player.Calamity().evergreenGin = true; + player.Calamity().SicknessDebuffMultiplier += 0.25f; + player.Calamity().WaterDebuffMultiplier += 0.25f; } } } diff --git a/Buffs/Alcohol/FireballBuff.cs b/Buffs/Alcohol/FireballBuff.cs index aa2e9e9f96..47f5bfbf06 100644 --- a/Buffs/Alcohol/FireballBuff.cs +++ b/Buffs/Alcohol/FireballBuff.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Buffs.Alcohol public override void Update(Player player, ref int buffIndex) { player.Calamity().fireball = true; + player.Calamity().HeatDebuffMultiplier += 0.25f; } } } diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index c5b9d77af2..28c7af8b79 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -16,14 +16,14 @@ namespace CalamityMod.Buffs { // Globally remove summon tag buff stacking // Other mods need to add to this list because we genuinely don't have any way to tell this - if (SummonTagBuffList.Includes(type) && buffIndex > 0) + if (CalamityBuffSets.IsSummonTagBuff[type] && buffIndex > 0) { for (int i = buffIndex; i >= 0; i--) { if (player.buffTime[i] > 0) { int buffID = player.buffType[i]; - if (SummonTagBuffList.Includes(buffID) && buffID != type) + if (CalamityBuffSets.IsSummonTagBuff[buffID] && buffID != type) { player.DelBuff(i); break; @@ -131,14 +131,14 @@ namespace CalamityMod.Buffs { // Globally remove summon tag debuff stacking, unless allowed in the SummonTag // Other mods need to add to this list because otherwise we can't tell which IsATag buff is actually for whips - if (SummonTagDebuffDict.TryGet(type, out var tag1) && !tag1.AllowsWhipStacking && buffIndex > 0) + if (CalamityBuffSets.SummonTagDebuff.TryGetValue(type, out var tag1) && !tag1.AllowsWhipStacking && buffIndex > 0) { for (int i = buffIndex; i >= 0; i--) { if (npc.buffTime[i] > 0) { int buffID = npc.buffType[i]; - if (SummonTagDebuffDict.TryGet(buffID, out var tag2) && !tag2.AllowsWhipStacking && buffID != type) + if (CalamityBuffSets.SummonTagDebuff.TryGetValue(buffID, out var tag2) && !tag2.AllowsWhipStacking && buffID != type) { npc.DelBuff(i); break; @@ -149,19 +149,13 @@ namespace CalamityMod.Buffs if (type == BuffID.Webbed) { - if (npc.Calamity().webbed < npc.buffTime[buffIndex]) - npc.Calamity().webbed = npc.buffTime[buffIndex]; - if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) - npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().webbed; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().webbed = true; + if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex]; } if (type == BuffID.Electrified) { - if (npc.Calamity().electrified < npc.buffTime[buffIndex]) - npc.Calamity().electrified = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().electrified = true; } } diff --git a/Buffs/DamageOverTime/AstralInfectionDebuff.cs b/Buffs/DamageOverTime/AstralInfectionDebuff.cs index ba0bc276cf..f2245d91aa 100644 --- a/Buffs/DamageOverTime/AstralInfectionDebuff.cs +++ b/Buffs/DamageOverTime/AstralInfectionDebuff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Particles; +using CalamityMod.DataStructures; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,12 +10,18 @@ namespace CalamityMod.Buffs.DamageOverTime { public class AstralInfectionDebuff : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 75, + SicknessDebuffScaling = 1 + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) @@ -24,10 +31,7 @@ namespace CalamityMod.Buffs.DamageOverTime public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().astralInfection < npc.buffTime[buffIndex]) - npc.Calamity().astralInfection = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().astralInfection = true; } internal static void DrawEffects(PlayerDrawSet drawInfo) diff --git a/Buffs/DamageOverTime/AuricRebuke.cs b/Buffs/DamageOverTime/AuricRebuke.cs index 3e465fa7a3..ccd2315908 100644 --- a/Buffs/DamageOverTime/AuricRebuke.cs +++ b/Buffs/DamageOverTime/AuricRebuke.cs @@ -1,4 +1,5 @@ -using CalamityMod.Particles; +using CalamityMod.DataStructures; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,12 +10,18 @@ namespace CalamityMod.Buffs.DamageOverTime { public class AuricRebuke : ModBuff { + public static DebuffData debuffData = new DebuffData(DebuffData.DebuffBehavior.Electric) + { + EnemyLostRegen = 200, + ElectricDebuffScaling = 1 + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) @@ -24,10 +31,7 @@ namespace CalamityMod.Buffs.DamageOverTime public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().auricRebuke < npc.buffTime[buffIndex]) - npc.Calamity().auricRebuke = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().auricRebuke = true; } internal static void DrawEffects(PlayerDrawSet drawInfo) diff --git a/Buffs/DamageOverTime/BanishingFire.cs b/Buffs/DamageOverTime/BanishingFire.cs index 0e01549c42..23daa2a06f 100644 --- a/Buffs/DamageOverTime/BanishingFire.cs +++ b/Buffs/DamageOverTime/BanishingFire.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.DataStructures; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -6,12 +7,24 @@ namespace CalamityMod.Buffs.DamageOverTime { public class BanishingFire : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 4000, //This is the minimum DoT. Banishing Fire scales with max HP + HeatDebuffScaling = 1, //Unused in the method, but kept so other things can know this is a heat debuff + NPCLifeRegenMethod = BanishingFireNPCLifeRegen + }; + public static void BanishingFireNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) + { + int baseBanishingFireDoTValue = (int)npc.Calamity().ActiveHeatDebuffMultiplier.ApplyTo((npc.lifeMax >= 1000000 ? npc.lifeMax / 500 : debuffData.EnemyLostRegen)); + npc.Calamity().ApplyDPSDebuff(baseBanishingFireDoTValue, baseBanishingFireDoTValue / 5, ref npc.lifeRegen, ref damage); + } public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) @@ -21,10 +34,7 @@ namespace CalamityMod.Buffs.DamageOverTime public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().banishingFire < npc.buffTime[buffIndex]) - npc.Calamity().banishingFire = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().banishingFire = true; } } } diff --git a/Buffs/DamageOverTime/BrainRot.cs b/Buffs/DamageOverTime/BrainRot.cs index 6a2069e42b..0ff949281b 100644 --- a/Buffs/DamageOverTime/BrainRot.cs +++ b/Buffs/DamageOverTime/BrainRot.cs @@ -1,4 +1,5 @@ -using CalamityMod.Particles; +using CalamityMod.DataStructures; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,12 +10,18 @@ namespace CalamityMod.Buffs.DamageOverTime { public class BrainRot : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 40, + SicknessDebuffScaling = 1 + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) @@ -24,10 +31,7 @@ namespace CalamityMod.Buffs.DamageOverTime public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().brainRot < npc.buffTime[buffIndex]) - npc.Calamity().brainRot = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().brainRot = true; } internal static void DrawEffects(PlayerDrawSet drawInfo) diff --git a/Buffs/DamageOverTime/BrimstoneFlames.cs b/Buffs/DamageOverTime/BrimstoneFlames.cs index 95a2d128b1..b05c42232b 100644 --- a/Buffs/DamageOverTime/BrimstoneFlames.cs +++ b/Buffs/DamageOverTime/BrimstoneFlames.cs @@ -1,4 +1,5 @@ -using CalamityMod.Dusts; +using CalamityMod.DataStructures; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,25 +10,28 @@ namespace CalamityMod.Buffs.DamageOverTime { public class BrimstoneFlames : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 60, + HeatDebuffScaling = 1 + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) { - player.Calamity().bFlames = true; + player.Calamity().brimstoneFlames = true; } public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().bFlames < npc.buffTime[buffIndex]) - npc.Calamity().bFlames = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().brimstoneFlames = true; } internal static void DrawEffects(PlayerDrawSet drawInfo, bool hasDebuffResistance = false) diff --git a/Buffs/DamageOverTime/BurningBlood.cs b/Buffs/DamageOverTime/BurningBlood.cs index e8d988b9a4..76cf242847 100644 --- a/Buffs/DamageOverTime/BurningBlood.cs +++ b/Buffs/DamageOverTime/BurningBlood.cs @@ -1,4 +1,5 @@ -using CalamityMod.Particles; +using CalamityMod.DataStructures; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,25 +10,28 @@ namespace CalamityMod.Buffs.DamageOverTime { public class BurningBlood : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 40, + SicknessDebuffScaling = 1 + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) { - player.Calamity().bBlood = true; + player.Calamity().burningBlood = true; } public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().bBlood < npc.buffTime[buffIndex]) - npc.Calamity().bBlood = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().burningBlood = true; } internal static void DrawEffects(PlayerDrawSet drawInfo) diff --git a/Buffs/DamageOverTime/CrushDepth.cs b/Buffs/DamageOverTime/CrushDepth.cs index b10bc709aa..63c9fa2ebc 100644 --- a/Buffs/DamageOverTime/CrushDepth.cs +++ b/Buffs/DamageOverTime/CrushDepth.cs @@ -1,4 +1,5 @@ -using CalamityMod.Particles; +using CalamityMod.DataStructures; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,25 +10,28 @@ namespace CalamityMod.Buffs.DamageOverTime { public class CrushDepth : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 100, + WaterDebuffScaling = 1 + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) { - player.Calamity().cDepth = true; + player.Calamity().crushDepth = true; } public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().cDepth < npc.buffTime[buffIndex]) - npc.Calamity().cDepth = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().crushDepth = true; } internal static void DrawEffects(PlayerDrawSet drawInfo) diff --git a/Buffs/DamageOverTime/Daybroken.cs b/Buffs/DamageOverTime/Daybroken.cs index 854ac4e535..81298bf7f4 100644 --- a/Buffs/DamageOverTime/Daybroken.cs +++ b/Buffs/DamageOverTime/Daybroken.cs @@ -1,4 +1,6 @@ -using Terraria; +using CalamityMod.DataStructures; +using CalamityMod.Projectiles.Boss; +using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.Localization; @@ -16,6 +18,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = DebuffData.Daybroken; } public override void Update(Player player, ref int buffIndex) @@ -23,13 +26,13 @@ namespace CalamityMod.Buffs.DamageOverTime player.Calamity().daybroken = true; } - internal static void DrawEffects(PlayerDrawSet drawInfo, bool reducedEffects) + internal static void DrawEffects(PlayerDrawSet drawInfo) { Player Player = drawInfo.drawPlayer; - if (Main.rand.Next(reducedEffects ? 8 : 4) < 3) + if (Main.rand.Next(4) < 3) { - Dust solarDust = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.OrangeTorch, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, reducedEffects ? 175 : 100, default, reducedEffects ? 2f : 3f); + Dust solarDust = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.OrangeTorch, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); solarDust.noGravity = true; solarDust.velocity *= 2.8f; solarDust.velocity.Y -= 0.5f; diff --git a/Buffs/DamageOverTime/DemonicFlames.cs b/Buffs/DamageOverTime/DemonicFlames.cs index 7b35b79c72..b0dd928cf1 100644 --- a/Buffs/DamageOverTime/DemonicFlames.cs +++ b/Buffs/DamageOverTime/DemonicFlames.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.DataStructures; using CalamityMod.Dusts; using CalamityMod.Particles; using CalamityMod.Projectiles.Pets; @@ -12,6 +13,17 @@ namespace CalamityMod.Buffs.DamageOverTime { public class DemonicFlames : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 60, //Unused in the method, this is the amount of DoT from Forbidden Oathblade demon flames + HeatDebuffScaling = 1, //Unused in the method, but kept so other things can know this is a heat debuff + NPCLifeRegenMethod = DemonFlamesNPCLifeRegen + }; + public static void DemonFlamesNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) + { + int baseDemonicFlamesDoTValue = (int)Math.Max(npc.Calamity().ActiveHeatDebuffMultiplier.ApplyTo(npc.Calamity().demonicFlamesBonusDamage), npc.Calamity().demonicFlamesBonusDamage); + npc.Calamity().ApplyDPSDebuff(baseDemonicFlamesDoTValue, baseDemonicFlamesDoTValue / 15, ref npc.lifeRegen, ref damage); + } public override void SetStaticDefaults() { Main.debuff[Type] = true; @@ -27,10 +39,7 @@ namespace CalamityMod.Buffs.DamageOverTime public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().demonicFlames < npc.buffTime[buffIndex]) - npc.Calamity().demonicFlames = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().demonicFlames = true; } internal static void DrawEffects(PlayerDrawSet drawInfo, bool hasDebuffResistance = false) diff --git a/Buffs/DamageOverTime/Dragonfire.cs b/Buffs/DamageOverTime/Dragonfire.cs index 6314a32eef..bc3ff034b3 100644 --- a/Buffs/DamageOverTime/Dragonfire.cs +++ b/Buffs/DamageOverTime/Dragonfire.cs @@ -1,4 +1,5 @@ -using CalamityMod.Particles; +using CalamityMod.DataStructures; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,12 +10,18 @@ namespace CalamityMod.Buffs.DamageOverTime { public class Dragonfire : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 960, + HeatDebuffScaling = 1 + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) @@ -24,10 +31,7 @@ namespace CalamityMod.Buffs.DamageOverTime public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().dragonFire < npc.buffTime[buffIndex]) - npc.Calamity().dragonFire = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().dragonFire = true; } internal static void DrawEffects(PlayerDrawSet drawInfo) diff --git a/Buffs/DamageOverTime/ElementalMix.cs b/Buffs/DamageOverTime/ElementalMix.cs index 6f64dace2c..d53e442b47 100644 --- a/Buffs/DamageOverTime/ElementalMix.cs +++ b/Buffs/DamageOverTime/ElementalMix.cs @@ -1,4 +1,5 @@ -using CalamityMod.Dusts; +using CalamityMod.DataStructures; +using CalamityMod.Dusts; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; @@ -10,12 +11,17 @@ namespace CalamityMod.Buffs.DamageOverTime { public class ElementalMix : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 400 + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) @@ -25,10 +31,7 @@ namespace CalamityMod.Buffs.DamageOverTime public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().elementalMix < npc.buffTime[buffIndex]) - npc.Calamity().elementalMix = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().elementalMix = true; } internal static void DrawEffects(PlayerDrawSet drawInfo) diff --git a/Buffs/DamageOverTime/GodSlayerInferno.cs b/Buffs/DamageOverTime/GodSlayerInferno.cs index 9f892fb2b2..f7d799fafa 100644 --- a/Buffs/DamageOverTime/GodSlayerInferno.cs +++ b/Buffs/DamageOverTime/GodSlayerInferno.cs @@ -1,4 +1,5 @@ -using CalamityMod.Particles; +using CalamityMod.DataStructures; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,25 +10,28 @@ namespace CalamityMod.Buffs.DamageOverTime { public class GodSlayerInferno : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 500, + HeatDebuffScaling = 1 + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) { - player.Calamity().gsInferno = true; + player.Calamity().godSlayerInferno = true; } public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().gsInferno < npc.buffTime[buffIndex]) - npc.Calamity().gsInferno = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().godSlayerInferno = true; } internal static void DrawEffects(PlayerDrawSet drawInfo) diff --git a/Buffs/DamageOverTime/HadopelagicPressure.cs b/Buffs/DamageOverTime/HadopelagicPressure.cs index f4edd97b85..7cde6908ed 100644 --- a/Buffs/DamageOverTime/HadopelagicPressure.cs +++ b/Buffs/DamageOverTime/HadopelagicPressure.cs @@ -1,4 +1,5 @@ -using CalamityMod.Particles; +using CalamityMod.DataStructures; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,25 +10,28 @@ namespace CalamityMod.Buffs.DamageOverTime { public class HadopelagicPressure : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 400, + WaterDebuffScaling = 1 + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) { - player.Calamity().hPressure = true; + player.Calamity().hadopelagicPressure = true; } public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().hPressure < npc.buffTime[buffIndex]) - npc.Calamity().hPressure = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().hadopelagicPressure = true; } internal static void DrawEffects(PlayerDrawSet drawInfo) diff --git a/Buffs/DamageOverTime/HeavyBleeding.cs b/Buffs/DamageOverTime/HeavyBleeding.cs index 340845ce9e..1818a4d299 100644 --- a/Buffs/DamageOverTime/HeavyBleeding.cs +++ b/Buffs/DamageOverTime/HeavyBleeding.cs @@ -1,6 +1,7 @@ -using CalamityMod.Particles; +using System; +using CalamityMod.DataStructures; +using CalamityMod.Particles; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -10,12 +11,17 @@ namespace CalamityMod.Buffs.DamageOverTime { public class HeavyBleeding : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 80 + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) @@ -25,10 +31,7 @@ namespace CalamityMod.Buffs.DamageOverTime public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().heavybleeding < npc.buffTime[buffIndex]) - npc.Calamity().heavybleeding = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().heavyBleeding = true; } internal static void DrawEffects(PlayerDrawSet drawInfo) { diff --git a/Buffs/DamageOverTime/HolyFlames.cs b/Buffs/DamageOverTime/HolyFlames.cs index c4936b2e2a..84a60b5e22 100644 --- a/Buffs/DamageOverTime/HolyFlames.cs +++ b/Buffs/DamageOverTime/HolyFlames.cs @@ -1,4 +1,5 @@ -using CalamityMod.Particles; +using CalamityMod.DataStructures; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,25 +10,28 @@ namespace CalamityMod.Buffs.DamageOverTime { public class HolyFlames : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 300, + HeatDebuffScaling = 1 + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) { - player.Calamity().hFlames = true; + player.Calamity().holyFlames = true; } public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().hFlames < npc.buffTime[buffIndex]) - npc.Calamity().hFlames = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().holyFlames = true; } internal static void DrawEffects(PlayerDrawSet drawInfo) diff --git a/Buffs/DamageOverTime/HolyInferno.cs b/Buffs/DamageOverTime/HolyInferno.cs index 1cf1741ee8..eaf25ad6a1 100644 --- a/Buffs/DamageOverTime/HolyInferno.cs +++ b/Buffs/DamageOverTime/HolyInferno.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.DataStructures; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -6,17 +7,24 @@ namespace CalamityMod.Buffs.DamageOverTime { public class HolyInferno : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 10000, //this is never applied to enemies + HeatDebuffScaling = 1, + GearCanModifyDebuff = false + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) { - player.Calamity().hInferno = true; + player.Calamity().holyInferno = true; } } } diff --git a/Buffs/DamageOverTime/Laceration.cs b/Buffs/DamageOverTime/Laceration.cs index 621b51dfe4..4e81b40d4a 100644 --- a/Buffs/DamageOverTime/Laceration.cs +++ b/Buffs/DamageOverTime/Laceration.cs @@ -1,6 +1,7 @@ -using CalamityMod.Particles; +using System; +using CalamityMod.DataStructures; +using CalamityMod.Particles; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -10,12 +11,17 @@ namespace CalamityMod.Buffs.DamageOverTime { public class Laceration : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 400 + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) @@ -25,10 +31,7 @@ namespace CalamityMod.Buffs.DamageOverTime public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().laceration < npc.buffTime[buffIndex]) - npc.Calamity().laceration = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().laceration = true; } internal static void DrawEffects(PlayerDrawSet drawInfo) { diff --git a/Buffs/DamageOverTime/ManaBurn.cs b/Buffs/DamageOverTime/ManaBurn.cs index c14439fd3b..c3b1cc9dd2 100644 --- a/Buffs/DamageOverTime/ManaBurn.cs +++ b/Buffs/DamageOverTime/ManaBurn.cs @@ -6,47 +6,17 @@ namespace CalamityMod.Buffs.DamageOverTime { public class ManaBurn : ModBuff { + //as of now, this doesn't use the custom debuff system due to the debuff being a front for the actual effects in the Chaos Stone rework public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; + Main.buffNoTimeDisplay[Type] = true; } - - // Mana Burn's actual effects are controlled by CalamityPlayer code. - // However, every frame you have Mana Burn, it automatically scans for and removes Mana Sickness if you somehow have it simultaneously. - // This would only occur if other mods added Mana Burn to the player via esoteric means, as AddBuff is IL edited by Calamity. - // If found, it adds the remaining time of that Mana Sickness to Mana Burn, capping at its usual duration cap. public override void Update(Player player, ref int buffIndex) { player.Calamity().ManaBurn = true; - - int manaSicknessIndex = player.FindBuffIndex(BuffID.ManaSickness); - if (manaSicknessIndex != -1) - { - // Set the remaining duration of Mana Sickness to 1 frame so it disappears either this or the next frame. - // If it would disappear the next frame because it was already iterated over, then add 1 less frame of Mana Burn. - bool extraFrame = manaSicknessIndex < buffIndex; - int timeToAdd = player.buffTime[manaSicknessIndex] - (extraFrame ? 1 : 0); - player.buffTime[manaSicknessIndex] = 1; - - // Add that time to Mana Burn. - int newBuffTime = player.buffTime[buffIndex] + timeToAdd; - if (newBuffTime > Player.manaSickTimeMax) - newBuffTime = Player.manaSickTimeMax; - player.buffTime[buffIndex] = newBuffTime; - } - } - - public override bool ReApply(Player player, int time, int buffIndex) - { - // Logic copy pasted from Mana Sickness - player.buffTime[buffIndex] += time; - if (player.buffTime[buffIndex] > Player.manaSickTimeMax) - player.buffTime[buffIndex] = Player.manaSickTimeMax; - - // Skip vanilla re-apply logic - return true; } } } diff --git a/Buffs/DamageOverTime/MiracleBlight.cs b/Buffs/DamageOverTime/MiracleBlight.cs index df93272cbd..690550c58c 100644 --- a/Buffs/DamageOverTime/MiracleBlight.cs +++ b/Buffs/DamageOverTime/MiracleBlight.cs @@ -1,4 +1,5 @@ -using CalamityMod.Particles; +using CalamityMod.DataStructures; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,12 +10,17 @@ namespace CalamityMod.Buffs.DamageOverTime { public class MiracleBlight : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 3000 + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) @@ -24,10 +30,7 @@ namespace CalamityMod.Buffs.DamageOverTime public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().miracleBlight < npc.buffTime[buffIndex]) - npc.Calamity().miracleBlight = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().miracleBlight = true; } internal static void DrawEffects(PlayerDrawSet drawInfo) diff --git a/Buffs/DamageOverTime/Nightwither.cs b/Buffs/DamageOverTime/Nightwither.cs index a6d24f65c1..dbdbef4d02 100644 --- a/Buffs/DamageOverTime/Nightwither.cs +++ b/Buffs/DamageOverTime/Nightwither.cs @@ -1,4 +1,5 @@ -using CalamityMod.Particles; +using CalamityMod.DataStructures; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,12 +10,18 @@ namespace CalamityMod.Buffs.DamageOverTime { public class Nightwither : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 200, + ColdDebuffScaling = 1 + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) @@ -24,29 +31,26 @@ namespace CalamityMod.Buffs.DamageOverTime public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().nightwither < npc.buffTime[buffIndex]) - npc.Calamity().nightwither = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().nightwither = true; } - internal static void DrawEffects(PlayerDrawSet drawInfo, bool hasDebuffResistance = false) + internal static void DrawEffects(PlayerDrawSet drawInfo) { Player Player = drawInfo.drawPlayer; - if (Main.rand.NextBool(hasDebuffResistance ? 4 : 2)) + if (Main.rand.NextBool(2)) { Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f); - CritSpark spark = new CritSpark(Player.Calamity().RandomDebuffVisualSpot, Vect, Main.rand.NextBool() ? Color.Cyan : Color.Turquoise, Color.PaleTurquoise, (hasDebuffResistance ? 0.4f : 0.8f), 15, 2f, 1.9f); + CritSpark spark = new CritSpark(Player.Calamity().RandomDebuffVisualSpot, Vect, Main.rand.NextBool() ? Color.Cyan : Color.Turquoise, Color.PaleTurquoise, 0.8f, 15, 2f, 1.9f); GeneralParticleHandler.SpawnParticle(spark); } - for (int i = 0; i < (hasDebuffResistance ? 1 : 2); i++) + for (int i = 0; i < 2; i++) { Vector2 dustCorner = Player.position - 2f * Vector2.One; Vector2 dustVel = Player.velocity + new Vector2(0f, Main.rand.NextFloat(-11f, -2f)); Dust moonDust = Dust.NewDustDirect(dustCorner, Player.width + 4, Player.height + 4, Main.rand.NextBool(4) ? 300 : 323, dustVel.X, dustVel.Y); moonDust.noGravity = true; - moonDust.scale = hasDebuffResistance ? Main.rand.NextFloat(0.3f, 0.3f) : Main.rand.NextFloat(0.5f, 0.5f); + moonDust.scale = Main.rand.NextFloat(0.5f, 0.5f); moonDust.alpha = 235; } } diff --git a/Buffs/DamageOverTime/Plague.cs b/Buffs/DamageOverTime/Plague.cs index f776337e36..45875dc587 100644 --- a/Buffs/DamageOverTime/Plague.cs +++ b/Buffs/DamageOverTime/Plague.cs @@ -1,4 +1,5 @@ -using CalamityMod.Particles; +using CalamityMod.DataStructures; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,25 +10,28 @@ namespace CalamityMod.Buffs.DamageOverTime { public class Plague : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 100, + SicknessDebuffScaling = 1 + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) { - player.Calamity().pFlames = true; + player.Calamity().plague = true; } public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().pFlames < npc.buffTime[buffIndex]) - npc.Calamity().pFlames = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().plague = true; } internal static void DrawEffects(PlayerDrawSet drawInfo) diff --git a/Buffs/DamageOverTime/RiptideDebuff.cs b/Buffs/DamageOverTime/RiptideDebuff.cs index 62816f8004..3757d46763 100644 --- a/Buffs/DamageOverTime/RiptideDebuff.cs +++ b/Buffs/DamageOverTime/RiptideDebuff.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.DataStructures; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -8,25 +9,28 @@ namespace CalamityMod.Buffs.DamageOverTime { public class RiptideDebuff : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 30, + WaterDebuffScaling = 1 + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) { - player.Calamity().rTide = true; + player.Calamity().riptide = true; } public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().rTide < npc.buffTime[buffIndex]) - npc.Calamity().rTide = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().riptide = true; } internal static void DrawEffects(PlayerDrawSet drawInfo) diff --git a/Buffs/DamageOverTime/SagePoison.cs b/Buffs/DamageOverTime/SagePoison.cs index 623c95a1a5..0d1b6bddfc 100644 --- a/Buffs/DamageOverTime/SagePoison.cs +++ b/Buffs/DamageOverTime/SagePoison.cs @@ -1,10 +1,24 @@ -using Terraria; +using CalamityMod.DataStructures; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.DamageOverTime { public class SagePoison : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 50, + NPCLifeRegenMethod = SagePoisonPower + }; + public static void SagePoisonPower(NPC npc, int buffType, ref int buffIndex, ref int damage) + { + // The dot ia multipliplied by this before being applied: + // (float)(Math.Pow(totalSageSpirits, 0.9D) + Math.Pow(totalSageSpirits, 1.13D)) * 0.5f; + // See SageNeedle.cs for details + int baseSagePoisonDoTValue = (int)npc.Calamity().ActiveTypelessDebuffMultiplier.ApplyTo(npc.Calamity().sagePoisonDamage); + npc.Calamity().ApplyDPSDebuff(baseSagePoisonDoTValue, baseSagePoisonDoTValue / 5, ref npc.lifeRegen, ref damage); + } public override void SetStaticDefaults() { Main.debuff[Type] = true; @@ -13,10 +27,7 @@ namespace CalamityMod.Buffs.DamageOverTime } public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().sagePoisonTime < npc.buffTime[buffIndex]) - npc.Calamity().sagePoisonTime = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().sagePoison = true; } } } diff --git a/Buffs/DamageOverTime/SearingLava.cs b/Buffs/DamageOverTime/SearingLava.cs index c17fff2bcf..539316df4b 100644 --- a/Buffs/DamageOverTime/SearingLava.cs +++ b/Buffs/DamageOverTime/SearingLava.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.DataStructures; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.DamageOverTime @@ -6,17 +7,23 @@ namespace CalamityMod.Buffs.DamageOverTime [LegacyName("CragsLava")] public class SearingLava : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 1000, //Never infliced on enemies, token value. Really high bc this hurts a lot on players + HeatDebuffScaling = 1 + }; public override void SetStaticDefaults() { Main.buffNoTimeDisplay[Type] = true; Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) { - player.Calamity().cragsLava = true; + player.Calamity().searingLava = true; } } } diff --git a/Buffs/DamageOverTime/Shadowflame.cs b/Buffs/DamageOverTime/Shadowflame.cs index d97c8889ed..3b89427e23 100644 --- a/Buffs/DamageOverTime/Shadowflame.cs +++ b/Buffs/DamageOverTime/Shadowflame.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.DataStructures; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -17,6 +18,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = DebuffData.Shadowflame; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/ShellfishClaps.cs b/Buffs/DamageOverTime/ShellfishClaps.cs index 697a8f241b..00a8c48f9d 100644 --- a/Buffs/DamageOverTime/ShellfishClaps.cs +++ b/Buffs/DamageOverTime/ShellfishClaps.cs @@ -1,23 +1,57 @@ -using Terraria; +using CalamityMod.Balancing; +using CalamityMod.DataStructures; +using CalamityMod.Projectiles.Summon; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.DamageOverTime { public class ShellfishClaps : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 150, //Damage per shellfish + NPCLifeRegenMethod = ShellfishStacking + }; + public static void ShellfishStacking(NPC npc, int buffType, ref int buffIndex, ref int damage) + { + int projectileCount = 0; + int owner = 255; + foreach (Projectile p in Main.ActiveProjectiles) + { + if (p.type == ModContent.ProjectileType() && + p.ai[0] == 1f && p.ai[1] == npc.whoAmI) + { + owner = p.owner; + projectileCount++; + if (projectileCount >= 5) + { + projectileCount = 5; + break; + } + } + } + + Item heldItem = Main.player[owner].ActiveItem(); + int totalDamage = (int)Main.player[owner].GetTotalDamage().ApplyTo(debuffData.EnemyLostRegen); + + if (CalamityUtils.ShouldTriggerSummonPenalty(Main.player[owner], heldItem)) + totalDamage = (int)(totalDamage * BalancingConstants.SummonerCrossClassNerf); + + int totalDisplayedDamage = totalDamage / 5; + npc.Calamity().ApplyDPSDebuff(projectileCount * totalDamage, projectileCount * totalDisplayedDamage, ref npc.lifeRegen, ref damage); + } public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().shellfishVore < npc.buffTime[buffIndex]) - npc.Calamity().shellfishVore = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().shellfishStaffDebuff = true; } } } diff --git a/Buffs/DamageOverTime/Shred.cs b/Buffs/DamageOverTime/Shred.cs index d46d375305..bd168fd492 100644 --- a/Buffs/DamageOverTime/Shred.cs +++ b/Buffs/DamageOverTime/Shred.cs @@ -11,6 +11,8 @@ namespace CalamityMod.Buffs.DamageOverTime { public class Shred : ModBuff { + //This is not ported to the custom debuff system yet due to the complexities of it. + //I didn't want to break it! It will be done in a future PR internal const int StackFalloffFrames = 320; // This deals 600 DPS per stack, is boosted by ranged stats and can supercrit. diff --git a/Buffs/DamageOverTime/SnapClamDebuff.cs b/Buffs/DamageOverTime/SnapClamDebuff.cs index e11f1205a6..83d7f2a580 100644 --- a/Buffs/DamageOverTime/SnapClamDebuff.cs +++ b/Buffs/DamageOverTime/SnapClamDebuff.cs @@ -1,23 +1,47 @@ -using Terraria; +using CalamityMod.Balancing; +using CalamityMod.DataStructures; +using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Summon; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.DamageOverTime { public class SnapClamDebuff : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 15, //Damage per shellfish + NPCLifeRegenMethod = ShellfishStacking + }; + public static void ShellfishStacking(NPC npc, int buffType, ref int buffIndex, ref int damage) + { + + int projectileCount = 0; + foreach (Projectile p in Main.ActiveProjectiles) + { + if (p.ai[0] == 1f && p.ai[1] == npc.whoAmI) + { + if (p.type == ModContent.ProjectileType()) + projectileCount += 2; + if (p.type == ModContent.ProjectileType()) + projectileCount++; + } + } + + npc.Calamity().ApplyDPSDebuff((int)(projectileCount * debuffData.EnemyLostRegen), projectileCount * 3, ref npc.lifeRegen, ref damage); + } public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().clamDebuff < npc.buffTime[buffIndex]) - npc.Calamity().clamDebuff = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().snapClamDebuff = true; } } } diff --git a/Buffs/DamageOverTime/StaticDischarge.cs b/Buffs/DamageOverTime/StaticDischarge.cs index aa7de883cd..53ad81641b 100644 --- a/Buffs/DamageOverTime/StaticDischarge.cs +++ b/Buffs/DamageOverTime/StaticDischarge.cs @@ -1,4 +1,5 @@ -using CalamityMod.Particles; +using CalamityMod.DataStructures; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,12 +10,18 @@ namespace CalamityMod.Buffs.DamageOverTime { public class StaticDischarge : ModBuff { + public static DebuffData debuffData = new DebuffData(DebuffData.DebuffBehavior.Electric) + { + EnemyLostRegen = 5, + ElectricDebuffScaling = 1 + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) @@ -24,10 +31,7 @@ namespace CalamityMod.Buffs.DamageOverTime public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().staticDischarge < npc.buffTime[buffIndex]) - npc.Calamity().staticDischarge = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().staticDischarge = true; } internal static void DrawEffects(PlayerDrawSet drawInfo) diff --git a/Buffs/DamageOverTime/SulphuricPoisoning.cs b/Buffs/DamageOverTime/SulphuricPoisoning.cs index f71550c714..79c6a49b58 100644 --- a/Buffs/DamageOverTime/SulphuricPoisoning.cs +++ b/Buffs/DamageOverTime/SulphuricPoisoning.cs @@ -1,4 +1,5 @@ -using CalamityMod.Particles; +using CalamityMod.DataStructures; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,12 +10,18 @@ namespace CalamityMod.Buffs.DamageOverTime { public class SulphuricPoisoning : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 240, + SicknessDebuffScaling = 1 + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; // Acid Venom immunity is granted automatically if you are immune to Sulphuric Poisoning. BuffID.Sets.GrantImmunityWith[BuffID.Venom].Add(Type); @@ -33,10 +40,7 @@ namespace CalamityMod.Buffs.DamageOverTime public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().sulphurPoison < npc.buffTime[buffIndex]) - npc.Calamity().sulphurPoison = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().sulphurPoison = true; } internal static void DrawEffects(PlayerDrawSet drawInfo) diff --git a/Buffs/DamageOverTime/TrueVulnerabilityHex.cs b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs index 72910c2fa8..dbff53547b 100644 --- a/Buffs/DamageOverTime/TrueVulnerabilityHex.cs +++ b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs @@ -1,4 +1,5 @@ -using CalamityMod.Dusts; +using CalamityMod.DataStructures; +using CalamityMod.Dusts; using CalamityMod.NPCs; using CalamityMod.Particles; using CalamityMod.Systems.Collections; @@ -12,11 +13,13 @@ namespace CalamityMod.Buffs.DamageOverTime { public class TrueVulnerabilityHex : ModBuff { - // The visual number displayed in ticks as the enemy takes damage. - public const int TickNumber = 666; - - // The exact amount True Vulnerability Hex reduces NPC life regen by. - public const int DPS = TickNumber * 6; // -3996 life regen, 1998 DPS + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 3996, //6x the tick size + SicknessDebuffScaling = 1, + MinimumDamageTickSize = 666, //Vhex should always have ticks of 666 + MultiplierDamageTickSize = 0 + }; public override void SetStaticDefaults() { @@ -25,6 +28,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.buffNoSave[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) => player.Calamity().trueVHex = true; @@ -32,21 +36,14 @@ namespace CalamityMod.Buffs.DamageOverTime public override void Update(NPC npc, ref int buffIndex) { CalamityGlobalNPC cgn = npc.Calamity(); - if (cgn.trueVulnerabilityHex < npc.buffTime[buffIndex]) - { - cgn.trueVulnerabilityHex = npc.buffTime[buffIndex]; - // Set the remaining time of the fire drawer to be exactly right. - if (cgn.VulnerabilityHexFireDrawer != null) - cgn.VulnerabilityHexFireDrawer.SetLifetime = cgn.VulnerabilityHexFireDrawer.LocalTimer + cgn.trueVulnerabilityHex; - } + //If this isn't here the drawcode gives an index out of bounds + if (npc.buffTime[buffIndex] > 1) + cgn.trueVulnerabilityHex = true; + if (cgn.VulnerabilityHexFireDrawer != null) + cgn.VulnerabilityHexFireDrawer.SetLifetime = cgn.VulnerabilityHexFireDrawer.LocalTimer + npc.buffTime[buffIndex]; + if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && cgn.debuffResistanceTimer <= 0) + cgn.debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex]; - // Apply immunity timer. - 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. - npc.DelBuff(buffIndex); - buffIndex--; } internal static void DrawEffects(NPC npc, ref Color drawColor) diff --git a/Buffs/DamageOverTime/Vaporfied.cs b/Buffs/DamageOverTime/Vaporfied.cs index f4dd7d5fee..e10223020b 100644 --- a/Buffs/DamageOverTime/Vaporfied.cs +++ b/Buffs/DamageOverTime/Vaporfied.cs @@ -1,4 +1,5 @@ -using CalamityMod.NPCs; +using CalamityMod.DataStructures; +using CalamityMod.NPCs; using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Terraria; @@ -10,12 +11,19 @@ namespace CalamityMod.Buffs.DamageOverTime { public class Vaporfied : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 30, + MinimumDamageTickSize = 6, + MultiplierDamageTickSize = 0 + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) @@ -25,12 +33,9 @@ namespace CalamityMod.Buffs.DamageOverTime public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().vaporfied < npc.buffTime[buffIndex]) - npc.Calamity().vaporfied = npc.buffTime[buffIndex]; - if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) - npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().vaporfied; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().vaporfied = true; + if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin +npc.buffTime[buffIndex]; } internal static void DrawEffects(PlayerDrawSet drawInfo) diff --git a/Buffs/DamageOverTime/VermillionFlux.cs b/Buffs/DamageOverTime/VermillionFlux.cs index f62f39c83c..dcf35efc3e 100644 --- a/Buffs/DamageOverTime/VermillionFlux.cs +++ b/Buffs/DamageOverTime/VermillionFlux.cs @@ -1,4 +1,5 @@ -using CalamityMod.Particles; +using CalamityMod.DataStructures; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,12 +10,18 @@ namespace CalamityMod.Buffs.DamageOverTime { public class VermillionFlux : ModBuff { + public static DebuffData debuffData = new DebuffData(DebuffData.DebuffBehavior.Electric) + { + EnemyLostRegen = 100, + ElectricDebuffScaling = 1 + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) @@ -24,10 +31,7 @@ namespace CalamityMod.Buffs.DamageOverTime public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().vermillionFlux < npc.buffTime[buffIndex]) - npc.Calamity().vermillionFlux = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().vermillionFlux = true; } internal static void DrawEffects(PlayerDrawSet drawInfo) diff --git a/Buffs/DamageOverTime/Voidfrost.cs b/Buffs/DamageOverTime/Voidfrost.cs index 8452f0b9cb..145611890b 100644 --- a/Buffs/DamageOverTime/Voidfrost.cs +++ b/Buffs/DamageOverTime/Voidfrost.cs @@ -1,4 +1,5 @@ -using CalamityMod.Particles; +using CalamityMod.DataStructures; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,12 +10,18 @@ namespace CalamityMod.Buffs.DamageOverTime { public class Voidfrost : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 200, + ColdDebuffScaling = 1 + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) @@ -24,10 +31,7 @@ namespace CalamityMod.Buffs.DamageOverTime public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().voidfrost < npc.buffTime[buffIndex]) - npc.Calamity().voidfrost = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().voidfrost = true; } internal static void DrawEffects(PlayerDrawSet drawInfo, bool hasDebuffResistance = false) diff --git a/Buffs/DamageOverTime/VulnerabilityHex.cs b/Buffs/DamageOverTime/VulnerabilityHex.cs index 45c6a98946..fcde0194fb 100644 --- a/Buffs/DamageOverTime/VulnerabilityHex.cs +++ b/Buffs/DamageOverTime/VulnerabilityHex.cs @@ -1,4 +1,5 @@ -using CalamityMod.Dusts; +using CalamityMod.DataStructures; +using CalamityMod.Dusts; using CalamityMod.NPCs; using CalamityMod.Particles; using CalamityMod.Systems.Collections; @@ -12,11 +13,13 @@ namespace CalamityMod.Buffs.DamageOverTime { public class VulnerabilityHex : ModBuff { - // The visual number displayed in ticks as the enemy takes damage. - public const int TickNumber = 666; - - // The exact amount Vulnerability Hex reduces NPC life regen by. - public const int DPS = TickNumber * 4; // -2664 life regen, 1332 DPS + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 2664, //4x tick size + HeatDebuffScaling = 1, + MinimumDamageTickSize = 666, + MultiplierDamageTickSize = 0 + }; public const int CalamityDuration = 60; public const int AflameDuration = 120; @@ -28,6 +31,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.buffNoSave[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) => player.Calamity().vHex = true; @@ -35,21 +39,17 @@ namespace CalamityMod.Buffs.DamageOverTime public override void Update(NPC npc, ref int buffIndex) { CalamityGlobalNPC cgn = npc.Calamity(); - if (cgn.vulnerabilityHex < npc.buffTime[buffIndex]) - { - cgn.vulnerabilityHex = npc.buffTime[buffIndex]; - // Set the remaining time of the fire drawer to be exactly right. - if (cgn.VulnerabilityHexFireDrawer != null) - cgn.VulnerabilityHexFireDrawer.SetLifetime = cgn.VulnerabilityHexFireDrawer.LocalTimer + cgn.vulnerabilityHex; - } + + //If this isn't here the drawcode gives an index out of bounds + if (npc.buffTime[buffIndex] > 1) + cgn.vulnerabilityHex = true; + // Set the remaining time of the fire drawer to be exactly right. + if (cgn.VulnerabilityHexFireDrawer != null) + cgn.VulnerabilityHexFireDrawer.SetLifetime = cgn.VulnerabilityHexFireDrawer.LocalTimer + npc.buffTime[buffIndex]; // Apply immunity timer. - 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. - npc.DelBuff(buffIndex); - buffIndex--; + if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && cgn.debuffResistanceTimer <= 0) + cgn.debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + +npc.buffTime[buffIndex]; } internal static void DrawEffects(PlayerDrawSet drawInfo) { diff --git a/Buffs/DamageOverTime/WeakBrimstoneFlames.cs b/Buffs/DamageOverTime/WeakBrimstoneFlames.cs index 026531e132..645c418293 100644 --- a/Buffs/DamageOverTime/WeakBrimstoneFlames.cs +++ b/Buffs/DamageOverTime/WeakBrimstoneFlames.cs @@ -1,16 +1,23 @@ -using Terraria; +using CalamityMod.DataStructures; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.DamageOverTime { public class WeakBrimstoneFlames : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 10, //This is never infliced on enemies, this is just a token value + HeatDebuffScaling = 1, + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; Main.buffNoTimeDisplay[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) => player.Calamity().weakBrimstoneFlames = true; diff --git a/Buffs/Pets/ReaverOrbBuff.cs b/Buffs/Pets/ReaverOrbBuff.cs deleted file mode 100644 index 3be4f5a02b..0000000000 --- a/Buffs/Pets/ReaverOrbBuff.cs +++ /dev/null @@ -1,35 +0,0 @@ -using CalamityMod.CalPlayer; -using CalamityMod.Projectiles.Typeless; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Buffs.Pets -{ - public class ReaverOrbBuff : ModBuff - { - public override void SetStaticDefaults() - { - Main.buffNoTimeDisplay[Type] = true; - Main.buffNoSave[Type] = true; - //Main.persistentBuff[Type] = true; - } - - public override void Update(Player player, ref int buffIndex) - { - CalamityPlayer modPlayer = player.Calamity(); - if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) - { - modPlayer.rOrb = true; - } - if (!modPlayer.rOrb) - { - player.DelBuff(buffIndex); - buffIndex--; - } - else - { - player.buffTime[buffIndex] = 18000; - } - } - } -} diff --git a/Buffs/Pets/ReaverOrbBuff.png b/Buffs/Pets/ReaverOrbBuff.png deleted file mode 100644 index 61a7e2e2d2..0000000000 Binary files a/Buffs/Pets/ReaverOrbBuff.png and /dev/null differ diff --git a/Buffs/StatBuffs/AdrenalineMode.cs b/Buffs/StatBuffs/AdrenalineMode.cs index 84d8e687ad..23871659dc 100644 --- a/Buffs/StatBuffs/AdrenalineMode.cs +++ b/Buffs/StatBuffs/AdrenalineMode.cs @@ -21,7 +21,6 @@ namespace CalamityMod.Buffs.StatBuffs public override void Update(Player player, ref int buffIndex) { player.Calamity().adrenalineModeActive = true; - player.Calamity().AdrenalineTrail = true; } public override void ModifyBuffText(ref string buffName, ref string tip, ref int rare) diff --git a/Buffs/StatDebuffs/AbsorberAffliction.cs b/Buffs/StatDebuffs/AbsorberAffliction.cs index f166ee030d..55df57f042 100644 --- a/Buffs/StatDebuffs/AbsorberAffliction.cs +++ b/Buffs/StatDebuffs/AbsorberAffliction.cs @@ -1,4 +1,5 @@ -using CalamityMod.Dusts; +using CalamityMod.DataStructures; +using CalamityMod.Dusts; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; @@ -8,19 +9,24 @@ namespace CalamityMod.Buffs.StatDebuffs { public class AbsorberAffliction : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 400, + SicknessDebuffScaling = 1, + MultiplierDamageTickSize = 1 / 20f + + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().absorberAffliction < npc.buffTime[buffIndex]) - npc.Calamity().absorberAffliction = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().absorberAffliction = true; } internal static void DrawEffects(NPC npc, ref Color drawColor) diff --git a/Buffs/StatDebuffs/ArmorCrunch.cs b/Buffs/StatDebuffs/ArmorCrunch.cs index d01829fdb0..6d8a7c61b3 100644 --- a/Buffs/StatDebuffs/ArmorCrunch.cs +++ b/Buffs/StatDebuffs/ArmorCrunch.cs @@ -22,15 +22,12 @@ namespace CalamityMod.Buffs.StatDebuffs public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().aCrunch < npc.buffTime[buffIndex]) - npc.Calamity().aCrunch = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().armorCrunch = true; } public override void Update(Player player, ref int buffIndex) { - player.Calamity().aCrunch = true; + player.Calamity().armorCrunch = true; } } } diff --git a/Buffs/StatDebuffs/Crumbling.cs b/Buffs/StatDebuffs/Crumbling.cs index 2173cf756b..2539449caf 100644 --- a/Buffs/StatDebuffs/Crumbling.cs +++ b/Buffs/StatDebuffs/Crumbling.cs @@ -22,10 +22,7 @@ namespace CalamityMod.Buffs.StatDebuffs public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().crumble < npc.buffTime[buffIndex]) - npc.Calamity().crumble = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().crumble = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/StatDebuffs/Eutrophication.cs b/Buffs/StatDebuffs/Eutrophication.cs index 0f99d11480..eca32f09f7 100644 --- a/Buffs/StatDebuffs/Eutrophication.cs +++ b/Buffs/StatDebuffs/Eutrophication.cs @@ -25,12 +25,9 @@ namespace CalamityMod.Buffs.StatDebuffs public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().eutrophication < npc.buffTime[buffIndex]) - npc.Calamity().eutrophication = npc.buffTime[buffIndex]; - if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) - npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().eutrophication; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().eutrophication = true; + if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex]; } internal static void DrawEffects(PlayerDrawSet drawInfo) diff --git a/Buffs/StatDebuffs/FrozenLungs.cs b/Buffs/StatDebuffs/FrozenLungs.cs index 4a7e8fb6ca..49d31a21bf 100644 --- a/Buffs/StatDebuffs/FrozenLungs.cs +++ b/Buffs/StatDebuffs/FrozenLungs.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Buffs.StatDebuffs public override void Update(Player player, ref int buffIndex) { - player.Calamity().iCantBreathe = true; + player.Calamity().frozenLungs = true; } } } diff --git a/Buffs/StatDebuffs/GalvanicCorrosion.cs b/Buffs/StatDebuffs/GalvanicCorrosion.cs index d8b4a6e77c..018e738c30 100644 --- a/Buffs/StatDebuffs/GalvanicCorrosion.cs +++ b/Buffs/StatDebuffs/GalvanicCorrosion.cs @@ -18,12 +18,9 @@ namespace CalamityMod.Buffs.StatDebuffs public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().tesla < npc.buffTime[buffIndex]) - npc.Calamity().tesla = npc.buffTime[buffIndex]; - if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) - npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().tesla; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().galvanicCorrosion = true; + if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex]; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/StatDebuffs/GlacialState.cs b/Buffs/StatDebuffs/GlacialState.cs index f87ac9805c..b87a1df91b 100644 --- a/Buffs/StatDebuffs/GlacialState.cs +++ b/Buffs/StatDebuffs/GlacialState.cs @@ -20,10 +20,9 @@ namespace CalamityMod.Buffs.StatDebuffs public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().gState < npc.buffTime[buffIndex]) - npc.Calamity().gState = npc.buffTime[buffIndex]; - if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) - npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().gState; + npc.Calamity().glacialState = true; + if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex]; npc.DelBuff(buffIndex); buffIndex--; } diff --git a/Buffs/StatDebuffs/Irradiated.cs b/Buffs/StatDebuffs/Irradiated.cs index ca52ae932a..8244acd871 100644 --- a/Buffs/StatDebuffs/Irradiated.cs +++ b/Buffs/StatDebuffs/Irradiated.cs @@ -1,4 +1,6 @@ -using Terraria; +using CalamityMod.DataStructures; +using CalamityMod.Projectiles.Magic; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -6,6 +8,44 @@ namespace CalamityMod.Buffs.StatDebuffs { public class Irradiated : ModBuff { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 20, //Base irradiated DOT. This is changed with some application sources. + NPCLifeRegenMethod = IrradiatedNPCLifeRegen + }; + public static void IrradiatedNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) + { + var cnpc = npc.Calamity(); + int projectileCount = 0; + foreach (Projectile p in Main.ActiveProjectiles) + { + if (p.type == ModContent.ProjectileType() && + p.ai[0] == 1f && p.ai[1] == npc.whoAmI) + { + projectileCount++; + } + } + int baseIrradiatedDoTValue = (int)(cnpc.scionsCurioEffected ? (int)(debuffData.EnemyLostRegen * 1.5f) : debuffData.EnemyLostRegen); + if (cnpc.scionsCurioEffected) + { + for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++) + { + Player player = Main.player[playerIndex]; + if (player.active) + { + float playerRangedDamage = player.GetTotalDamage(DamageClass.Ranged).ApplyTo(baseIrradiatedDoTValue * (1 + player.GetTotalCritChance(DamageClass.Ranged) * 0.01f)); + if (playerRangedDamage > baseIrradiatedDoTValue && player.Calamity().scionsCurio) + { + baseIrradiatedDoTValue = (int)playerRangedDamage; + } + } + } + } + if (projectileCount > 0) + cnpc.ApplyDPSDebuff(projectileCount * baseIrradiatedDoTValue, projectileCount * 4, ref npc.lifeRegen, ref damage); + else + cnpc.ApplyDPSDebuff(baseIrradiatedDoTValue, baseIrradiatedDoTValue / 20, ref npc.lifeRegen, ref damage); + } public override void SetStaticDefaults() { Main.debuff[Type] = true; @@ -13,6 +53,7 @@ namespace CalamityMod.Buffs.StatDebuffs Main.buffNoSave[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } public override void Update(Player player, ref int buffIndex) @@ -22,10 +63,7 @@ namespace CalamityMod.Buffs.StatDebuffs public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().irradiated < npc.buffTime[buffIndex]) - npc.Calamity().irradiated = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().irradiated = true; } } } diff --git a/Buffs/StatDebuffs/MarkedforDeath.cs b/Buffs/StatDebuffs/MarkedforDeath.cs index 3a0518630c..ac676ccdc4 100644 --- a/Buffs/StatDebuffs/MarkedforDeath.cs +++ b/Buffs/StatDebuffs/MarkedforDeath.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.DataStructures; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs @@ -16,10 +17,7 @@ namespace CalamityMod.Buffs.StatDebuffs public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().marked < npc.buffTime[buffIndex]) - npc.Calamity().marked = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().markedForDeath = true; } } } diff --git a/Buffs/StatDebuffs/PearlAura.cs b/Buffs/StatDebuffs/PearlAura.cs index ed0232c4b2..2b0d1bf5bc 100644 --- a/Buffs/StatDebuffs/PearlAura.cs +++ b/Buffs/StatDebuffs/PearlAura.cs @@ -16,10 +16,7 @@ namespace CalamityMod.Buffs.StatDebuffs public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().pearlAura < npc.buffTime[buffIndex]) - npc.Calamity().pearlAura = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().pearlAura = true; } internal static void DrawEffects(NPC npc, ref Color drawColor) diff --git a/Buffs/StatDebuffs/ProfanedWeakness.cs b/Buffs/StatDebuffs/ProfanedWeakness.cs index e9d61ddd1a..399deb9bc1 100644 --- a/Buffs/StatDebuffs/ProfanedWeakness.cs +++ b/Buffs/StatDebuffs/ProfanedWeakness.cs @@ -16,10 +16,7 @@ namespace CalamityMod.Buffs.StatDebuffs } public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().relicOfResilienceWeakness < npc.buffTime[buffIndex]) - npc.Calamity().relicOfResilienceWeakness = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().relicOfResilienceWeakness = true; } internal static void DrawEffects(NPC npc, ref Color drawColor) { diff --git a/Buffs/StatDebuffs/TemporalSadness.cs b/Buffs/StatDebuffs/TemporalSadness.cs index b3eb4099dc..943fefca48 100644 --- a/Buffs/StatDebuffs/TemporalSadness.cs +++ b/Buffs/StatDebuffs/TemporalSadness.cs @@ -16,12 +16,9 @@ namespace CalamityMod.Buffs.StatDebuffs public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().tSad < npc.buffTime[buffIndex]) - npc.Calamity().tSad = npc.buffTime[buffIndex]; - if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) - npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().tSad; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().temporalSadness = true; + if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex]; } } } diff --git a/Buffs/StatDebuffs/TimeDistortion.cs b/Buffs/StatDebuffs/TimeDistortion.cs index 95a1cf23fa..3f84b4677e 100644 --- a/Buffs/StatDebuffs/TimeDistortion.cs +++ b/Buffs/StatDebuffs/TimeDistortion.cs @@ -18,12 +18,9 @@ namespace CalamityMod.Buffs.StatDebuffs public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().timeSlow < npc.buffTime[buffIndex]) - npc.Calamity().timeSlow = npc.buffTime[buffIndex]; - if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) - npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().timeSlow; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().timeDistortion = true; + if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex]; } } } diff --git a/Buffs/StatDebuffs/WhisperingDeath.cs b/Buffs/StatDebuffs/WhisperingDeath.cs index b1b0eac60b..218491ff11 100644 --- a/Buffs/StatDebuffs/WhisperingDeath.cs +++ b/Buffs/StatDebuffs/WhisperingDeath.cs @@ -16,15 +16,12 @@ namespace CalamityMod.Buffs.StatDebuffs public override void Update(Player player, ref int buffIndex) { - player.Calamity().wDeath = true; + player.Calamity().whisperingDeath = true; } public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().wDeath < npc.buffTime[buffIndex]) - npc.Calamity().wDeath = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().whisperingDeath = true; } } } diff --git a/Buffs/StatDebuffs/WitherDebuff.cs b/Buffs/StatDebuffs/WitherDebuff.cs index bc161eae70..57042bb708 100644 --- a/Buffs/StatDebuffs/WitherDebuff.cs +++ b/Buffs/StatDebuffs/WitherDebuff.cs @@ -20,10 +20,7 @@ namespace CalamityMod.Buffs.StatDebuffs public override void Update(NPC npc, ref int buffIndex) { - if (npc.Calamity().wither < npc.buffTime[buffIndex]) - npc.Calamity().wither = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; + npc.Calamity().wither = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Summon/BrimstoneWaifu.cs b/Buffs/Summon/BrimstoneElemental.cs similarity index 69% rename from Buffs/Summon/BrimstoneWaifu.cs rename to Buffs/Summon/BrimstoneElemental.cs index f6b12d5477..7f2595443c 100644 --- a/Buffs/Summon/BrimstoneWaifu.cs +++ b/Buffs/Summon/BrimstoneElemental.cs @@ -1,12 +1,12 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Projectiles.Summon; using Terraria.ModLoader; namespace CalamityMod.Buffs.Summon { - public class BrimstoneWaifu : BaseSummonBuff + public class BrimstoneElemental : BaseSummonBuff { protected override int MinionProjectileType => ModContent.ProjectileType(); - protected override ref bool MinionBool => ref BuffModdedOwner.bWaifu; + protected override ref bool MinionBool => ref BuffModdedOwner.brimEleBuff; } } diff --git a/Buffs/Summon/BrimstoneWaifu.png b/Buffs/Summon/BrimstoneElemental.png similarity index 100% rename from Buffs/Summon/BrimstoneWaifu.png rename to Buffs/Summon/BrimstoneElemental.png diff --git a/Buffs/Summon/CloudyWaifu.cs b/Buffs/Summon/CloudElemental.cs similarity index 80% rename from Buffs/Summon/CloudyWaifu.cs rename to Buffs/Summon/CloudElemental.cs index 4b342af8c1..b276cd9b57 100644 --- a/Buffs/Summon/CloudyWaifu.cs +++ b/Buffs/Summon/CloudElemental.cs @@ -3,10 +3,10 @@ using Terraria.ModLoader; namespace CalamityMod.Buffs.Summon { - public class CloudyWaifu : BaseSummonBuff + public class CloudElemental : BaseSummonBuff { protected override int MinionProjectileType => ModContent.ProjectileType(); - protected override ref bool MinionBool => ref BuffModdedOwner.cWaifu; + protected override ref bool MinionBool => ref BuffModdedOwner.cloudEleBuff; } } diff --git a/Buffs/Summon/CloudyWaifu.png b/Buffs/Summon/CloudElemental.png similarity index 100% rename from Buffs/Summon/CloudyWaifu.png rename to Buffs/Summon/CloudElemental.png diff --git a/Buffs/Summon/HotE.cs b/Buffs/Summon/HotE.cs index 99bd030f4d..3e8eae1f10 100644 --- a/Buffs/Summon/HotE.cs +++ b/Buffs/Summon/HotE.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Buffs.Summon { CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.allWaifus) + if (!modPlayer.allElementals) { player.DelBuff(buffIndex); buffIndex--; diff --git a/Buffs/Summon/SandyHealingWaifu.cs b/Buffs/Summon/RareSandElemental.cs similarity index 79% rename from Buffs/Summon/SandyHealingWaifu.cs rename to Buffs/Summon/RareSandElemental.cs index 9d57de49d4..2748620ff6 100644 --- a/Buffs/Summon/SandyHealingWaifu.cs +++ b/Buffs/Summon/RareSandElemental.cs @@ -3,10 +3,10 @@ using Terraria.ModLoader; namespace CalamityMod.Buffs.Summon { - public class SandyHealingWaifu : BaseSummonBuff + public class RareSandElemental : BaseSummonBuff { protected override int MinionProjectileType => ModContent.ProjectileType(); - protected override ref bool MinionBool => ref BuffModdedOwner.dWaifu; + protected override ref bool MinionBool => ref BuffModdedOwner.rareSandEleBuff; } } diff --git a/Buffs/Summon/SandyHealingWaifu.png b/Buffs/Summon/RareSandElemental.png similarity index 100% rename from Buffs/Summon/SandyHealingWaifu.png rename to Buffs/Summon/RareSandElemental.png diff --git a/Buffs/Summon/SandyWaifu.cs b/Buffs/Summon/SandElemental.cs similarity index 81% rename from Buffs/Summon/SandyWaifu.cs rename to Buffs/Summon/SandElemental.cs index 383abea36f..5b9f22d6bc 100644 --- a/Buffs/Summon/SandyWaifu.cs +++ b/Buffs/Summon/SandElemental.cs @@ -3,10 +3,10 @@ using Terraria.ModLoader; namespace CalamityMod.Buffs.Summon { - public class SandyWaifu : BaseSummonBuff + public class SandElemental : BaseSummonBuff { protected override int MinionProjectileType => ModContent.ProjectileType(); - protected override ref bool MinionBool => ref BuffModdedOwner.sWaifu; + protected override ref bool MinionBool => ref BuffModdedOwner.sandEleBuff; } } diff --git a/Buffs/Summon/SandyWaifu.png b/Buffs/Summon/SandElemental.png similarity index 100% rename from Buffs/Summon/SandyWaifu.png rename to Buffs/Summon/SandElemental.png diff --git a/Buffs/Summon/SeaSnailBuff.cs b/Buffs/Summon/SeaSnailBuff.cs index da471bc5ad..0e33241c44 100644 --- a/Buffs/Summon/SeaSnailBuff.cs +++ b/Buffs/Summon/SeaSnailBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Projectiles.Typeless; using Terraria.ModLoader; namespace CalamityMod.Buffs.Summon diff --git a/Buffs/Summon/WaterWaifu.cs b/Buffs/Summon/WaterElemental.cs similarity index 80% rename from Buffs/Summon/WaterWaifu.cs rename to Buffs/Summon/WaterElemental.cs index 413f5de434..75db085d1e 100644 --- a/Buffs/Summon/WaterWaifu.cs +++ b/Buffs/Summon/WaterElemental.cs @@ -3,10 +3,10 @@ using Terraria.ModLoader; namespace CalamityMod.Buffs.Summon { - public class WaterWaifu : BaseSummonBuff + public class WaterElemental : BaseSummonBuff { protected override int MinionProjectileType => ModContent.ProjectileType(); - protected override ref bool MinionBool => ref BuffModdedOwner.slWaifu; + protected override ref bool MinionBool => ref BuffModdedOwner.waterEleBuff; } } diff --git a/Buffs/Summon/WaterWaifu.png b/Buffs/Summon/WaterElemental.png similarity index 100% rename from Buffs/Summon/WaterWaifu.png rename to Buffs/Summon/WaterElemental.png diff --git a/Buffs/Summon/Whips/ForbiddenStealthSummonTagBuff.cs b/Buffs/Summon/Whips/ForbiddenStealthSummonTagBuff.cs new file mode 100644 index 0000000000..fe389e7d6d --- /dev/null +++ b/Buffs/Summon/Whips/ForbiddenStealthSummonTagBuff.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Summon.Whips +{ + public class ForbiddenStealthSummonTagBuff : ModBuff + { + public override string Texture => "CalamityMod/Buffs/Summon/Whips/SentinalLash"; + + public override void SetStaticDefaults() + { + BuffID.Sets.IsATagBuff[Type] = true; + Main.debuff[Type] = true; + Main.buffNoSave[Type] = true; + } + } +} diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index b0baa3fd39..576e57042b 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -6,6 +6,7 @@ using CalamityMod.BiomeManagers; using CalamityMod.Buffs; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer.Dashes; using CalamityMod.Cooldowns; using CalamityMod.DataStructures; @@ -21,20 +22,25 @@ using CalamityMod.Items.Armor.Bloodflare; using CalamityMod.Items.Armor.Brimflame; using CalamityMod.Items.Armor.Daedalus; using CalamityMod.Items.Armor.Demonshade; +using CalamityMod.Items.Armor.DesertProwler; using CalamityMod.Items.Armor.Empyrean; using CalamityMod.Items.Armor.LunicCorps; using CalamityMod.Items.Armor.OmegaBlue; using CalamityMod.Items.Armor.PlagueReaper; using CalamityMod.Items.Armor.Silva; using CalamityMod.Items.Armor.SnowRuffian; +using CalamityMod.Items.Armor.TitanHeart; using CalamityMod.Items.Armor.Victide; +using CalamityMod.Items.Armor.Wulfrum; using CalamityMod.Items.Dyes; +using CalamityMod.Items.Materials; using CalamityMod.Items.Mounts; using CalamityMod.Items.Mounts.Minecarts; using CalamityMod.Items.PermanentBoosters; using CalamityMod.Items.Placeables.Furniture; using CalamityMod.Items.Potions; using CalamityMod.Items.Potions.Alcohol; +using CalamityMod.Items.Tools.ClimateChange; using CalamityMod.Items.TreasureBags.MiscGrabBags; using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.Items.Weapons.DraedonsArsenal; @@ -63,12 +69,16 @@ using Terraria; using Terraria.Audio; using Terraria.DataStructures; using Terraria.GameContent; +using Terraria.GameContent.Creative; +using Terraria.GameContent.NetModules; using Terraria.GameInput; +using Terraria.Graphics.Effects; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.IO; -using Terraria.Graphics.Effects; +using Terraria.Net; +using static Terraria.Main; using static Terraria.ModLoader.ModContent; namespace CalamityMod.CalPlayer @@ -103,10 +113,6 @@ namespace CalamityMod.CalPlayer public static int chaosStateDuration = 900; /// Constant variable used for how long Chaos State is inflicted by Normality Relocator while a boss is alive. public static int chaosStateDuration_NR = 1200; - /// Used by Sky Stabber and Gods' Paranoia to delete spiky balls when using right-click. - public bool killSpikyBalls = false; - public float KameiTrailXScale = 0.1f; - public int KameiBladeUseDelay = 0; /// Stores the positions of the player within the previous 4 frames. Used for drawing trail effects. public Vector2[] OldPositions = new Vector2[4]; public double contactDamageReduction = 0D; @@ -123,8 +129,6 @@ namespace CalamityMod.CalPlayer public bool resetHeightandWidth = false; /// If set to true, completely disables ALL life regeneration effects. Used by Omega Blue armor. public bool noLifeRegen = false; - public bool reducedDaybrokenDamage = false; - public bool reducedNightwitherDamage = false; public float ammoCost = 1f; public float healingPotionMultiplier = 1f; /// @@ -178,6 +182,13 @@ namespace CalamityMod.CalPlayer public float momentumCapacitorBoost = 0f; public bool countsAsAnyWet => (Player.armor[0].type == ItemID.FishBowl || Player.wetCount > 0 || Player.wet || Player.honeyWet || Player.lavaWet); + + public StatModifier TypelessDebuffMultiplier = new(); + public StatModifier HeatDebuffMultiplier = new(); + public StatModifier ColdDebuffMultiplier = new(); + public StatModifier SicknessDebuffMultiplier = new(); + public StatModifier WaterDebuffMultiplier = new(); + public StatModifier ElectricDebuffMultiplier = new(); #endregion #region Speedrun Timer @@ -302,9 +313,9 @@ namespace CalamityMod.CalPlayer public bool despoilerNerf = false; /// Variable used to trigger Molten Amputator's stealth effect on right-click. public int amputatorBuff = 0; - /// Variable used to track the fuel of Pristine Fury right click - public int furyFuelMax = 1800; + /// Variables used to track the fuel of Pristine Fury right click public int furyFuel = 1800; + public const int FuryFuelMax = 1800; public float furyRefuelTimer = 0; /// Variable used to track if Auger can do a big slash public bool buffedAuger = false; @@ -340,10 +351,10 @@ namespace CalamityMod.CalPlayer public int dragonRageHits = 0; /// Cooldown variable for Dragon Rage's fireball spawning to prevent spamming projectiles when hitting multiple enemies simultaneously. public int dragonRageCooldown = 0; - public float aquaticBoostMax = 10000f; + public const float AquaticBoostMax = 10000f; /// /// Counter variable which controls Aquatic Emblem's stat boosts while underwater.
- /// This counter starts at , and is decremented by 2 for every frame the player remains underwater, reaching maximum boosts when it hits 0. + /// This counter starts at , and is decremented by 2 for every frame the player remains underwater, reaching maximum boosts when it hits 0. ///
public float aquaticBoost = 0f; public int galileoCooldown = 0; @@ -386,6 +397,9 @@ namespace CalamityMod.CalPlayer public bool canFireGodSlayerRangedProjectile = false; public bool canFireBloodflareMageProjectile = false; public bool canFireBloodflareRangedProjectile = false; + + public float WeakTimeFreezeUseTimer = 0; + public bool WeakTimeFreezeInUse = false; #endregion #region Sound @@ -409,7 +423,6 @@ namespace CalamityMod.CalPlayer public static readonly SoundStyle RogueStealthSound = new("CalamityMod/Sounds/Custom/RogueStealth"); public static readonly SoundStyle DefenseDamageSound = new("CalamityMod/Sounds/Custom/DefenseDamage"); - public static readonly SoundStyle BloodCritSound = new("CalamityMod/Sounds/Custom/BloodPactCrit"); public static readonly SoundStyle IjiDeathSound = new("CalamityMod/Sounds/Custom/IjiDies"); public static readonly SoundStyle DrownSound = new("CalamityMod/Sounds/Custom/AbyssDrown"); @@ -563,7 +576,6 @@ namespace CalamityMod.CalPlayer } } public bool adrenalineModeActive = false; - public bool AdrenalineTrail = false; /// The player's current Adrenaline level. Expressed as a percentage of maximum Adrenaline. public float adrenaline = 0f; public float adrenalineMax = 100f; // 0 to 100% by default @@ -770,8 +782,6 @@ namespace CalamityMod.CalPlayer public int ascendantInsigniaBuffTime = 0; public int ascendantInsigniaCooldown = 0; public bool ascendantTrail = false; - public bool frozenWingsCold = false; - public bool flameWingsHeat = false; /// Used to toggle dust spawned while swinging, through accessory visibility. public bool magmaStoneVisuals = true; public bool eGauntlet = false; @@ -786,10 +796,6 @@ namespace CalamityMod.CalPlayer public bool eTalisman = false; public bool lastDashWasTabi = false; public bool statisNinjaBelt = false; - /// Used to keep track of how many dashes in the same direction you make to prevent dashing away from bosses forever at max efficency. - public int statisPenaltyTimer = 0; - public int statisAnticheese = 0; - public int statisTimerMax => (int)(Utils.Remap(statisAnticheese, 1, 6, 120, 50, true)); public bool voidSashVisuals = true; public bool statisVoidSash = false; public bool nucleogenesis = false; @@ -806,12 +812,14 @@ namespace CalamityMod.CalPlayer public int transformerCooldown = 0; public int transformerDelay = 0; public int transformerStoredKills = 0; + public int hookPullVisuals = 0; public bool bloomStone = false; public bool bloomStoneHookVisuals = false; - public int bloomStoneHealInc = 0; + public int bloomStoneHealPool = 0; public int bloomStoneTotalHeal = 0; - public int bloomStoneHealTimer = 0; - public int bloomStoneDR = 0; + public float bloomStoneHealTimer = 0; + public float bloomStoneHealRate = 0; + public int bloomStoneBuffedHealRateTimer = 0; public bool hideOfDeus = false; public bool dAmulet = false; public bool rampartOfDeities = false; @@ -880,7 +888,6 @@ namespace CalamityMod.CalPlayer public bool shatteredCommunity = false; public bool fleshTotem = false; public bool bloodPact = false; - public bool bloodPactBoost = false; public bool bloodflareCore = false; public int bloodflareCoreRemainingHealOverTime = 0; @@ -932,15 +939,14 @@ namespace CalamityMod.CalPlayer public bool spiritOrigin = false; public bool spiritOriginVanity = false; public int spiritOriginCritBoost = 0; -/// -/// The amount of bonus crit damage the player has. -/// At 0f, the player has regular crit damage. At 1f, the player has +100% crit damage. -/// + /// + /// The amount of bonus crit damage the player has. + /// At 0f, the player has regular crit damage. At 1f, the player has +100% crit damage. + /// public float critDamage = 0; public bool darkSunRing = false; public bool crawCarapace = false; public bool baroclaw = false; - public bool HasIncreasedDashFirstFrame = false; public bool IsFirstDashFrame = true; public int fallingBootVelCheckTimer = 0; public bool voidOfCalamity = false; @@ -984,16 +990,16 @@ namespace CalamityMod.CalPlayer public bool jellyChargedBattery = false; /// General cooldown for accessories which spawn projectiles on minion hits. public float summonProjCooldown; - public bool sandWaifu = false; - public bool sandWaifuVanity = false; - public bool sandBoobWaifu = false; - public bool sandBoobWaifuVanity = false; - public bool cloudWaifu = false; - public bool cloudWaifuVanity = false; - public bool brimstoneWaifu = false; - public bool brimstoneWaifuVanity = false; - public bool sirenWaifu = false; - public bool sirenWaifuVanity = false; + public bool sandElemental = false; + public bool sandElementalVanity = false; + public bool rareSandElemental = false; + public bool rareSandElementalVanity = false; + public bool cloudElemental = false; + public bool cloudElementalVanity = false; + public bool brimElemental = false; + public bool brimElementalVanity = false; + public bool waterElemental = false; + public bool waterElementalVanity = false; public bool fungalClump = false; public bool fungalClumpVanity = false; public bool howlsHeart = false; @@ -1054,7 +1060,6 @@ namespace CalamityMod.CalPlayer public bool rottenDogTooth = false; public bool angelicAlliance = false; public int angelicActivate = -1; - public bool BloomStoneRegen = false; public bool ChaosStone = false; public bool CryoStone = false; public bool CryoStoneVanity = false; @@ -1090,8 +1095,12 @@ namespace CalamityMod.CalPlayer public bool necroSet = false; /// Calamity's Frost armor set bonus; gives a combined 20% damage boost split between melee and ranged based on distance from the closest enemy. public bool frostSet = false; - public bool victideSet = false; - public bool victideSummoner = false; + public bool victideBarrierSet = false; + public int victideBarrierHeal = 0; + public bool victideBarrierHead = false; + public bool victideBurrowSet = false; + public bool victideBurrowHead = false; + public bool victideSnailSet = false; public bool sulphurSet = false; public bool sulphurJump = false; public int sulphurBubbleCooldown = 0; @@ -1126,7 +1135,6 @@ namespace CalamityMod.CalPlayer public bool godSlayerDashHotKeyPressed = false; public bool SpeedBlasterDashStarted = false; public bool ataxiaBolt = false; - public bool ataxiaFire = false; public bool ataxiaVolley = false; public bool ataxiaBlaze = false; public bool hydrothermalSmoke = false; @@ -1148,7 +1156,6 @@ namespace CalamityMod.CalPlayer public bool titanHeartSet = false; public bool titanHeartMask = false; public bool titanHeartMantle = false; - public bool titanHeartBoots = false; public int titanCooldown = 0; public bool umbraphileSet = false; public bool reaverSpeed = false; @@ -1187,8 +1194,8 @@ namespace CalamityMod.CalPlayer public bool silvaSummon = false; public bool hasSilvaEffect = false; /// Constant variable representing the duration of Silva armor's revive, in frames. - public const int silvaReviveDuration = 300; - public int silvaCountdown = silvaReviveDuration; + public const int SilvaReviveDuration = 300; + public int silvaCountdown = SilvaReviveDuration; public bool auricSet = false; public bool omegaBlueChestplate = false; public bool omegaBlueSet = false; @@ -1251,25 +1258,25 @@ namespace CalamityMod.CalPlayer public bool alcoholPoisoning = false; public bool shadowflame = false; public bool daybroken = false; - public bool wDeath = false; + public bool whisperingDeath = false; public bool dragonFire = false; public bool vermillionFlux = false; public bool auricRebuke = false; public bool staticDischarge = false; public bool miracleBlight = false; - public bool aCrunch = false; + public bool armorCrunch = false; public bool crumble = false; public bool irradiated = false; - public bool bFlames = false; + public bool brimstoneFlames = false; public bool weakBrimstoneFlames = false; public bool demonicFlames = false; - public bool gsInferno = false; + public bool godSlayerInferno = false; public bool astralInfection = false; /// Plague debuff. - public bool pFlames = false; - public bool hFlames = false; - public bool hInferno = false; - public bool bBlood = false; + public bool plague = false; + public bool holyFlames = false; + public bool holyInferno = false; + public bool burningBlood = false; public bool brainRot = false; public bool heavybleeding = false; public bool laceration = false; @@ -1280,9 +1287,9 @@ namespace CalamityMod.CalPlayer public bool trueVHex = false; public bool DoGExtremeGravity = false; public bool warped = false; - public bool cDepth = false; - public bool rTide = false; - public bool hPressure = false; + public bool crushDepth = false; + public bool riptide = false; + public bool hadopelagicPressure = false; public bool fishAlert = false; public bool clamity = false; public bool NOU = false; @@ -1292,9 +1299,9 @@ namespace CalamityMod.CalPlayer public bool voidfrost = false; public bool eutrophication = false; /// Frozen Lungs debuff. - public bool iCantBreathe = false; + public bool frozenLungs = false; /// Searing Lava debuff. - public bool cragsLava = false; + public bool searingLava = false; public bool vaporfied = false; public bool banishingFire = false; public bool wither = false; @@ -1451,21 +1458,21 @@ namespace CalamityMod.CalPlayer /// Enchanted Conch. public bool hCrab = false; /// Heart of the Elements. - public bool allWaifus = false; + public bool allElementals = false; /// Hearts of the Elements; however, the minions will not attack. - public bool allWaifusVanity = false; + public bool allElementalsVanity = false; /// Silva armor's Silva Crystal. public bool sCrystal = false; /// Elemental in a Bottle. - public bool sWaifu = false; + public bool sandEleBuff = false; /// Rare Elemental in a Bottle. - public bool dWaifu = false; + public bool rareSandEleBuff = false; /// Eye of the Storm. - public bool cWaifu = false; + public bool cloudEleBuff = false; /// Rose Stone. - public bool bWaifu = false; + public bool brimEleBuff = false; /// Pearl of Enthrallment. - public bool slWaifu = false; + public bool waterEleBuff = false; public bool fClump = false; /// Demonshade armor's Red Devil. public bool rDevil = false; @@ -1480,8 +1487,6 @@ namespace CalamityMod.CalPlayer public bool victideSnail = false; /// Hydrothermic armor's Vent. public bool cSpirit = false; - /// Reaver armor's Reaver Orb. - public bool rOrb = false; /// Daedalus armor's Daedalus Crystal. public bool dCrystal = false; public bool endoHydra = false; @@ -1682,6 +1687,7 @@ namespace CalamityMod.CalPlayer // This may seem like a scuffed setup, but a simple bool will have ordering issues when it comes to drawing. // Until ModSceneMetrics gets implemented, this works for now. public int BrimstoneLavaFountainCounter = 0; + public FireParticleSet ManaBurnFireDrawer = null; #endregion Draw Effects #region Draedon Summoning @@ -2138,7 +2144,6 @@ namespace CalamityMod.CalPlayer ataxiaBolt = false; ataxiaGeyser = false; - ataxiaFire = false; ataxiaVolley = false; ataxiaBlaze = false; ataxiaMage = false; @@ -2220,8 +2225,6 @@ namespace CalamityMod.CalPlayer cryogenSoul = false; ascendantInsignia = false; ascendantTrail = false; - frozenWingsCold = false; - flameWingsHeat = false; magmaStoneVisuals = true; eGauntlet = false; eGauntletVisuals = true; @@ -2309,14 +2312,11 @@ namespace CalamityMod.CalPlayer scionsCurio = false; rottenDogTooth = false; angelicAlliance = false; - BloomStoneRegen = false; ChaosStone = false; CryoStone = false; CryoStoneVanity = false; voidField = false; copyrightInfringementShield = false; - reducedDaybrokenDamage = false; - reducedNightwitherDamage = false; daedalusReflect = false; daedalusSplit = false; @@ -2377,8 +2377,11 @@ namespace CalamityMod.CalPlayer necroSet = false; frostSet = false; - victideSet = false; - victideSummoner = false; + victideBarrierSet = false; + victideBarrierHead = false; + victideBurrowSet = false; + victideBurrowHead = false; + victideSnailSet = false; sulphurSet = false; @@ -2389,7 +2392,6 @@ namespace CalamityMod.CalPlayer titanHeartSet = false; titanHeartMask = false; titanHeartMantle = false; - titanHeartBoots = false; umbraphileSet = false; plagueReaper = false; plaguebringerPatronSet = false; @@ -2448,26 +2450,26 @@ namespace CalamityMod.CalPlayer alcoholPoisoning = false; shadowflame = false; daybroken = false; - wDeath = false; + whisperingDeath = false; dragonFire = false; vermillionFlux = false; auricRebuke = false; staticDischarge = false; miracleBlight = false; - aCrunch = false; + armorCrunch = false; crumble = false; irradiated = false; - bFlames = false; + brimstoneFlames = false; witheredDebuff = false; absorberAffliction = false; weakBrimstoneFlames = false; demonicFlames = false; - gsInferno = false; + godSlayerInferno = false; astralInfection = false; - pFlames = false; - hFlames = false; - hInferno = false; - bBlood = false; + plague = false; + holyFlames = false; + holyInferno = false; + burningBlood = false; brainRot = false; heavybleeding = false; laceration = false; @@ -2477,9 +2479,9 @@ namespace CalamityMod.CalPlayer trueVHex = false; DoGExtremeGravity = false; warped = false; - cDepth = false; - rTide = false; - hPressure = false; + crushDepth = false; + riptide = false; + hadopelagicPressure = false; fishAlert = false; clamity = false; NOU = false; @@ -2489,13 +2491,20 @@ namespace CalamityMod.CalPlayer nightwither = false; voidfrost = false; eutrophication = false; - iCantBreathe = false; - cragsLava = false; + frozenLungs = false; + searingLava = false; vaporfied = false; banishingFire = false; wither = false; ManaBurn = false; + TypelessDebuffMultiplier = new(); + HeatDebuffMultiplier = new(); + ColdDebuffMultiplier = new(); + SicknessDebuffMultiplier = new(); + WaterDebuffMultiplier = new(); + ElectricDebuffMultiplier = new(); + trinketOfChiBuff = false; sandsWindBuff = false; aeolianEarthBuff = false; @@ -2539,8 +2548,6 @@ namespace CalamityMod.CalPlayer bloodfinBoost = false; divineBless = false; - killSpikyBalls = false; - vodka = false; redWine = false; grapeBeer = false; @@ -2599,11 +2606,11 @@ namespace CalamityMod.CalPlayer pGuy = false; cEnergy = false; pSoulGuardians = false; - sWaifu = false; - dWaifu = false; - cWaifu = false; - bWaifu = false; - slWaifu = false; + sandEleBuff = false; + rareSandEleBuff = false; + cloudEleBuff = false; + brimEleBuff = false; + waterEleBuff = false; fClump = false; rDevil = false; aValkyrie = false; @@ -2614,21 +2621,20 @@ namespace CalamityMod.CalPlayer astralProbe = false; victideSnail = false; cSpirit = false; - rOrb = false; dCrystal = false; MutatedTruffleBool = false; - sandWaifu = false; - sandWaifuVanity = false; - sandBoobWaifu = false; - sandBoobWaifuVanity = false; - cloudWaifu = false; - cloudWaifuVanity = false; - brimstoneWaifu = false; - brimstoneWaifuVanity = false; - sirenWaifu = false; - sirenWaifuVanity = false; - allWaifus = false; - allWaifusVanity = false; + sandElemental = false; + sandElementalVanity = false; + rareSandElemental = false; + rareSandElementalVanity = false; + cloudElemental = false; + cloudElementalVanity = false; + brimElemental = false; + brimElementalVanity = false; + waterElemental = false; + waterElementalVanity = false; + allElementals = false; + allElementalsVanity = false; fungalClump = false; fungalClumpVanity = false; howlsHeart = false; @@ -2729,7 +2735,6 @@ namespace CalamityMod.CalPlayer rageModeActive = false; adrenalineModeActive = false; - AdrenalineTrail = false; RageDuration = BalancingConstants.DefaultRageDuration; RageDamageBoost = BalancingConstants.DefaultRageDamageBoost; @@ -2775,14 +2780,12 @@ namespace CalamityMod.CalPlayer public override void ModifyScreenPosition() { // CIT 08FEB2025: Photosensitivity config also disables screenshake - if (CalamityClientConfig.Instance.ScreenshakePower == 0 || CalamityClientConfig.Instance.Photosensitivity) - return; + bool allowScreenshake = CalamityClientConfig.Instance.ScreenshakePower > 0 && !CalamityClientConfig.Instance.Photosensitivity; - if (GeneralScreenShakePower > 0f) - { + if (GeneralScreenShakePower > 0f && allowScreenshake) Main.screenPosition += Main.rand.NextVector2Circular(GeneralScreenShakePower * CalamityClientConfig.Instance.ScreenshakePower, GeneralScreenShakePower * CalamityClientConfig.Instance.ScreenshakePower); - GeneralScreenShakePower = MathHelper.Clamp(GeneralScreenShakePower - 0.185f, 0f, 20f * CalamityClientConfig.Instance.ScreenshakePower); - } + + GeneralScreenShakePower = MathHelper.Clamp(GeneralScreenShakePower - 0.185f, 0f, 20f * CalamityClientConfig.Instance.ScreenshakePower); } #endregion @@ -2845,10 +2848,10 @@ namespace CalamityMod.CalPlayer auralisAurora = 0; necroReviveCounter = -1; hideOfDeusTimer = 0; - bloomStoneHealInc = 0; + bloomStoneHealPool = 0; bloomStoneTotalHeal = 0; bloomStoneHealTimer = 0; - bloomStoneDR = 0; + bloomStoneHealRate = 0; murasamaHitCooldown = 0; SulphWaterPoisoningLevel = 0f; holyInfernoFadeIntensity = 0f; @@ -2892,11 +2895,9 @@ namespace CalamityMod.CalPlayer jetPackDirection = 0; andromedaCripple = 0; theBeeCooldown = 0; - killSpikyBalls = false; scuttlerCooldown = 0; rogueCrownCooldown = 0; wingProjectileCooldown = 0; - statisPenaltyTimer = -1; hallowedRuneCooldown = 0; sulphurBubbleCooldown = 0; ladHearts = 0; @@ -2907,26 +2908,26 @@ namespace CalamityMod.CalPlayer alcoholPoisoning = false; shadowflame = false; daybroken = false; - wDeath = false; + whisperingDeath = false; dragonFire = false; vermillionFlux = false; auricRebuke = false; staticDischarge = false; miracleBlight = false; - aCrunch = false; + armorCrunch = false; crumble = false; irradiated = false; - bFlames = false; + brimstoneFlames = false; witheredDebuff = false; absorberAffliction = false; weakBrimstoneFlames = false; demonicFlames = false; - gsInferno = false; + godSlayerInferno = false; astralInfection = false; - pFlames = false; - hFlames = false; - hInferno = false; - bBlood = false; + plague = false; + holyFlames = false; + holyInferno = false; + burningBlood = false; brainRot = false; heavybleeding = false; laceration = false; @@ -2936,9 +2937,9 @@ namespace CalamityMod.CalPlayer trueVHex = false; DoGExtremeGravity = false; warped = false; - cDepth = false; - rTide = false; - hPressure = false; + crushDepth = false; + riptide = false; + hadopelagicPressure = false; fishAlert = false; clamity = false; NOU = false; @@ -2948,13 +2949,19 @@ namespace CalamityMod.CalPlayer nightwither = false; voidfrost = false; eutrophication = false; - iCantBreathe = false; - cragsLava = false; + frozenLungs = false; + searingLava = false; vaporfied = false; banishingFire = false; wither = false; PurityHealSlowdownFrames = 0; ImmobilityDebuffImmunityTimer = 0; + TypelessDebuffMultiplier = new(); + HeatDebuffMultiplier = new(); + ColdDebuffMultiplier = new(); + SicknessDebuffMultiplier = new(); + WaterDebuffMultiplier = new(); + ElectricDebuffMultiplier = new(); #endregion #region Rogue @@ -3092,7 +3099,7 @@ namespace CalamityMod.CalPlayer silvaMage = false; silvaSummon = false; hasSilvaEffect = false; - silvaCountdown = silvaReviveDuration; + silvaCountdown = SilvaReviveDuration; auricSet = false; GemTechSet = false; CobaltSet = false; @@ -3124,7 +3131,6 @@ namespace CalamityMod.CalPlayer titanHeartSet = false; titanHeartMask = false; titanHeartMantle = false; - titanHeartBoots = false; titanCooldown = 0; umbraphileSet = false; fathomSwarmer = false; @@ -3142,7 +3148,6 @@ namespace CalamityMod.CalPlayer ataxiaMage = false; ataxiaBolt = false; ataxiaGeyser = false; - ataxiaFire = false; ataxiaVolley = false; ataxiaBlaze = false; hydrothermalSmoke = false; @@ -3156,7 +3161,10 @@ namespace CalamityMod.CalPlayer meteorSet = false; necroSet = false; frostSet = false; - victideSet = false; + victideBarrierSet = false; + victideBarrierHead = false; + victideBurrowSet = false; + victideBurrowHead = false; aeroSet = false; sulphurSet = false; statigelSet = false; @@ -3209,8 +3217,6 @@ namespace CalamityMod.CalPlayer CurrentlyViewedHologramText = string.Empty; #endregion - KameiBladeUseDelay = 0; - AdrenalineTrail = false; ascendantTrail = false; evilSmasherBoost = 0; burningSeaBurnOut = 0; @@ -3525,19 +3531,16 @@ namespace CalamityMod.CalPlayer { PlayerLoader.ArmorSetBonusActivated(Player); - if (CalamityClientConfig.Instance.CalamityArmorSetBonusDoubleTap) + // Activate vanilla set bonuses + if (Player.setVortex && !Player.mount.Active) + Player.vortexStealthActive = !Player.vortexStealthActive; + + if (Player.setForbidden) { - // Activate vanilla set bonuses - if (Player.setVortex && !Player.mount.Active) - Player.vortexStealthActive = !Player.vortexStealthActive; + Player.MinionRestTargetAim(); - if (Player.setForbidden) - { - Player.MinionRestTargetAim(); - - if (!Player.setForbiddenCooldownLocked) - Player.CommandForbiddenStorm(); - } + if (!Player.setForbiddenCooldownLocked) + Player.CommandForbiddenStorm(); } } @@ -3750,25 +3753,49 @@ namespace CalamityMod.CalPlayer public override void ArmorSetBonusActivated() { - // Don't trigger set bonuses if the config is disabled and the double-tap hotkey was triggered - if (!(CalamityKeybinds.ArmorSetBonusHotKey.JustPressed || CalamityClientConfig.Instance.CalamityArmorSetBonusDoubleTap)) - return; - // TODO -- It would be nice if triggerable set bonuses used interfaces instead of having to go through this large if chain. + if (victideBurrowSet) + { + if (cooldowns.TryGetValue(BubblyBurrow.ID, out CooldownInstance cd)) + { + // Return to normal if you have the ability active + if (cd.timeLeft > VictideHeadBurrow.BurrowCooldown) + { + cd.timeLeft = VictideHeadBurrow.BurrowCooldown + 1; + SyncCooldownDictionary(false); + } + } + else if (!Player.tongued && !Player.shimmering) + { + SoundEngine.PlaySound(SoundID.Item154, Player.Center); + if (Player.whoAmI == Main.myPlayer) + { + Player.AddCooldown(BubblyBurrow.ID, VictideHeadBurrow.BurrowCooldown + VictideHeadBurrow.BurrowDuration); + + var source = Player.GetSource_Misc("1"); + Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ProjectileType(), 0, 0f, Player.whoAmI); + } + } + } + if (victideBarrierSet && !Player.HasCooldown(WardingWave.ID)) + { + // Explosion and dash are handled in the VictideBarrier file + if (Player.whoAmI == Main.myPlayer) + Player.AddCooldown(WardingWave.ID, VictideHeadBarrier.BarrierCooldown); + } if (brimflameSet && !Player.HasCooldown(BrimflameFrenzy.ID)) { if (Player.whoAmI == Main.myPlayer) { if (brimflameFrenzy) { - brimflameFrenzy = false; Player.ClearBuff(BuffType()); + Player.AddCooldown(BrimflameFrenzy.ID, BrimflameCowl.FrenzyCooldown); } else { - brimflameFrenzy = true; - Player.AddBuff(BuffType(), 10 * 60, true); - SoundEngine.PlaySound(BrimflameScowl.ActivationSound, Player.Center); + Player.AddBuff(BuffType(), BrimflameCowl.FrenzyDuration, true); + SoundEngine.PlaySound(BrimflameCowl.ActivationSound, Player.Center); for (int i = 0; i < 36; i++) { Dust brimDust = Dust.NewDustDirect(new Vector2(Player.position.X, Player.position.Y + 16f), Player.width, Player.height - 16, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 1f); @@ -3887,12 +3914,12 @@ namespace CalamityMod.CalPlayer if (plagueReaper && !Player.HasCooldown(PlagueBlackout.ID)) { SoundEngine.PlaySound(PlagueReaperMask.ActivationSound, Player.Center); - Player.AddCooldown(PlagueBlackout.ID, 1800); + Player.AddCooldown(PlagueBlackout.ID, PlagueReaperMask.BlackoutDuration + PlagueReaperMask.BlackoutCooldown); } - if (forbiddenCirclet && forbiddenCooldown <= 0) + if (forbiddenCirclet && Player.ownedProjectileCounts[ModContent.ProjectileType()] < 2) { - forbiddenCooldown = 45; - int stormMana = (int)(ForbiddenCirclet.manaCost * Player.manaCost); + forbiddenCooldown = ForbiddenCirclet.StormCooldown; + int stormMana = (int)(ForbiddenCirclet.StormManaCost * Player.manaCost); if (Player.statMana < stormMana) { if (Player.manaFlower) @@ -3902,26 +3929,83 @@ namespace CalamityMod.CalPlayer } if (Player.statMana >= stormMana && !Player.silence) { - var source = Player.GetSource_Misc("1"); + var source = Player.GetSource_ItemUse(ContentSamples.ItemsByType[ItemType()]); Player.manaRegenDelay = (int)Player.maxRegenDelay; Player.statMana -= stormMana; // To compute Forbidden Circlet tornado damage, create a fake stat modifier on the spot which combines both classes. StatModifier forbidden = Player.GetTotalDamage().CombineWith(Player.GetDamage()); - int damage = (int)forbidden.ApplyTo(ForbiddenCirclet.tornadoBaseDmg); + int damage = (int)forbidden.ApplyTo(ForbiddenCirclet.StormDamage); - float kBack = Player.GetTotalKnockback().ApplyTo(ForbiddenCirclet.tornadoBaseKB); + float kBack = Player.GetTotalKnockback().ApplyTo(ForbiddenCirclet.StormKB); if (Player.whoAmI == Main.myPlayer) { - int mark = Projectile.NewProjectile(source, Player.ClampedMouseWorld(), Vector2.Zero, ProjectileType(), damage, kBack, Player.whoAmI); - if (mark.WithinBounds(Main.maxProjectiles)) - Main.projectile[mark].DamageType = DamageClass.Generic; + if (Player.ownedProjectileCounts[ProjectileType()] > 0) + { + foreach (var proj in Main.ActiveProjectiles) + { + if (proj.owner != Player.whoAmI || proj.type != ProjectileType()) + continue; + proj.ai[0] = CircletTornado.Lifetime - CircletTornado.Fadetime + proj.ai[0] % 60f; + proj.netUpdate = true; + } + } + Vector2 tornadoPos = Player.ClampedMouseWorld(); + Projectile.NewProjectile(source, tornadoPos, Vector2.Zero, ProjectileType(), damage, kBack, Player.whoAmI); + + Vector2 diff = tornadoPos - Player.Center; + float distance = diff.Length(); + if (distance > 0f) + { + for (float i = 0f; i < distance; i += 15f) + { + Vector2 dustPos = Player.Center + diff * i / distance; + Dust trail = Dust.NewDustDirect(dustPos, 0, 0, DustID.Sandnado); + trail.position = dustPos; + trail.fadeIn = 0.5f; + trail.scale = 0.7f; + trail.velocity *= 0.4f; + trail.noLight = true; + } + } + for (int j = 0; j < 30; j++) + { + Dust cloud = Dust.NewDustDirect(tornadoPos, 0, 0, DustID.Sandnado); + cloud.position = tornadoPos; + cloud.fadeIn = 1f; + cloud.scale = 0.3f; + cloud.noLight = true; + } } } } if (prismaticSet && !Player.HasCooldown(PrismaticLaser.ID) && prismaticLasers <= 0) prismaticLasers = CalamityUtils.SecondsToFrames(35f); + if (WulfrumHat.HasArmorSet(Player)) + { + //Only activate if no cooldown & available scrap. + if (cooldowns.TryGetValue(WulfrumBastion.ID, out CooldownInstance cd)) + { + // Quick dismount if activated again + if (cd.timeLeft > WulfrumHat.BastionCooldown && cd.timeLeft < WulfrumHat.BastionCooldown + WulfrumHat.BastionTime - 60 * 3) + { + cd.timeLeft = WulfrumHat.BastionCooldown + 1; + SyncCooldownDictionary(false); + } + } + + else if (Player.HasItem(ItemType())) + { + Player.ConsumeItem(ItemType()); + //I Thiiiinnnk there's no need to add mp syncing packets since cooldowns get auto synced right + Player.AddCooldown(WulfrumBastion.ID, WulfrumHat.BastionCooldown + WulfrumHat.BastionTime); + //Though do I need to sync that or is the player inventory auto synced? + WulfrumHat.DummyCannon.SetDefaults(ItemType()); + } + } + if (DesertProwlerHat.HasArmorSet(Player) && !Player.HasCooldown(SandsmokeBomb.ID)) + Player.AddCooldown(SandsmokeBomb.ID, DesertProwlerHat.SmokeCooldown + DesertProwlerHat.SmokeDuration); } #endregion @@ -4253,6 +4337,12 @@ namespace CalamityMod.CalPlayer { Player.ClearBuff(BuffID.WindPushed); } + if (Player.statMana < 0) + { + Player.AddBuff(ModContent.BuffType(), 10); + } else if (Player.HasBuff(ModContent.BuffType())) { + Player.ClearBuff(ModContent.BuffType()); + } } #endregion @@ -4428,13 +4518,55 @@ namespace CalamityMod.CalPlayer #endregion + public override void PostUpdate() + { + #region Managing time control + if (Main.netMode != NetmodeID.Server && Player == Main.LocalPlayer) + { + var power = CreativePowerManager.Instance.GetPower(); + double dayrate = CreativePowerManager.Instance.GetPower().TargetTimeRate; + if (CurrentFrameFlags.SleepingPlayersCount == CurrentFrameFlags.ActivePlayersCount && CurrentFrameFlags.SleepingPlayersCount > 0) + dayrate *= 5; + if (Main.IsFastForwardingTime()) + dayrate = 60; + double tileUpdate = 1; + double eventUpdate = 1; + SystemLoader.ModifyTimeRate(ref dayrate, ref tileUpdate, ref eventUpdate); + if (WeakTimeFreezeInUse) + { + if (!power.Enabled) + WeakTimeFreezeInUse = false; + else + { + if (WeakTimeFreezeUseTimer >= Bakidon.FreezeTime / Bakidon.RechargeMultiplier || Main.bloodMoon || Main.eclipse || Main.pumpkinMoon || Main.snowMoon) + { + + NetPacket packet = NetCreativePowersModule.PreparePacket(power.PowerId, 1); + packet.Writer.Write(false); + NetManager.Instance.SendToServerOrLoopback(packet); + WeakTimeFreezeInUse = false; + } + WeakTimeFreezeUseTimer += 1 * (float)dayrate; + } + } + else + { + if (WeakTimeFreezeUseTimer > 0) + WeakTimeFreezeUseTimer -= 1 * (float)dayrate; + else + WeakTimeFreezeUseTimer = 0; + } + } + #endregion + } public override void PostUpdateRunSpeeds() { #region SpeedBoosts if (!Player.mount.Active) { float runAccMult = 1f + - (lunicCorpsLegs ? 0.1f : 0f) + + (victideBurrowHead ? VictideHeadBurrow.MoveSpeedAccelerationBoost : 0f) + + (lunicCorpsLegs ? LunicCorpsBoots.MoveSpeedAccelerationBoost : 0f) + (shadowSpeed ? 0.5f : 0f) + (stressPills ? 0.05f : 0f) + ((abyssalDivingSuit && Player.IsUnderwater()) ? 0.05f : 0f) + @@ -4455,7 +4587,8 @@ namespace CalamityMod.CalPlayer (hasteLevel * 0.05f); float runSpeedMult = 1f + - (lunicCorpsLegs ? 0.1f : 0f) + + (victideBurrowHead ? VictideHeadBurrow.MoveSpeedAccelerationBoost : 0f) + + (lunicCorpsLegs ? LunicCorpsBoots.MoveSpeedAccelerationBoost : 0f) + (shadowSpeed ? 0.5f : 0f) + (stressPills ? 0.05f : 0f) + ((abyssalDivingSuit && Player.IsUnderwater()) ? 0.05f : 0f) + @@ -4485,6 +4618,12 @@ namespace CalamityMod.CalPlayer else momentumCapacitorBoost = 0f; + if (victideBarrierHead) + { + Player.runAcceleration *= VictideHeadBarrier.RunAccelerationMult; + Player.runSlowdown *= VictideHeadBarrier.RunAccelerationMult; + } + Player.runAcceleration *= runAccMult; Player.maxRunSpeed *= runSpeedMult; } @@ -4509,7 +4648,7 @@ namespace CalamityMod.CalPlayer ModDashMovement(); } #endregion - + Player.oldVelocity = Player.velocity; // Apparently this value is not updated on its own, so we do it } #endregion @@ -4563,20 +4702,11 @@ namespace CalamityMod.CalPlayer if (moscowMule) knockback += MoscowMule.KnockbackBoost; - if (titanHeartMask && rogue) - knockback += 0.05f; - if (titanHeartMantle && rogue) - knockback += 0.05f; - - if (titanHeartBoots && rogue) - knockback += 0.05f; - - if (titanHeartSet && rogue) - knockback += 0.2f; + knockback += TitanHeartMantle.RogueKnockbackBoost; if (titanHeartSet && StealthStrikeAvailable() && rogue) - knockback += 1f; + knockback *= TitanHeartMask.StealthStrikeKnockbackMult; } #endregion @@ -4590,7 +4720,7 @@ namespace CalamityMod.CalPlayer #region Modify Mana Cost public override void ModifyManaCost(Item item, ref float reduce, ref float mult) { - if (MagicGunIDList.Includes(item.type) && meteorSet) + if (CalamityItemSets.MagicGun[item.type] && meteorSet) { mult *= 0.33f; } @@ -4752,10 +4882,10 @@ namespace CalamityMod.CalPlayer if (veneratedLocket) { - var LocketSource = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); + var LocketSource = Player.GetSource_Accessory(FindAccessory(ItemType())); if (item.CountsAsClass()) { - if (!VeneratedLocketBanList.Includes(item.type)) + if (!CalamityItemSets.DisablesVeneratedLocketEffect[item.type]) { float veneratedCloneSpeed = item.shootSpeed; Vector2 realPlayerPos = Player.RotatedRelativePoint(Player.MountedCenter, true); @@ -4900,7 +5030,7 @@ namespace CalamityMod.CalPlayer { if (!Player.mount.Active) { - Player.velocity.Y *= 0.9f; + Player.velocity.Y *= SnowRuffianMask.GlideFallSpeedMult; Player.wingFrame = 3; } Player.noFallDmg = true; @@ -5188,7 +5318,7 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < Player.MaxBuffs; i++) { int buff = Player.buffType[i]; - if (AlcoholsDict.TryGet(buff, out int level)) + if (CalamityBuffSets.AlcoholStrength.TryGetValue(buff, out int level)) Alcohol.Insert(0, new int[] { i, level }); } @@ -5274,8 +5404,8 @@ namespace CalamityMod.CalPlayer bool hasNonWeaponFunction = isPickaxe || isAxe || isHammer || isPlaced || isChannelable; bool playerUsingWeapon = hasDamage && hasHitboxes && !hasNonWeaponFunction; - // The Gem Tech armor's rogue crystal ensures that stealth is not consumed by non-rogue items. - if ((it.IsAir || !it.CountsAsClass()) && GemTechSet && GemTechState.IsRedGemActive) + // The Gem Tech armor's rogue crystal ensures that stealth is not consumed by non-rogue items. Forbidden Circlet does this for summon weapons + if ((it.IsAir || (!it.CountsAsClass()) && GemTechSet && GemTechState.IsRedGemActive) || (it.CountsAsClass() && forbiddenCirclet)) playerUsingWeapon = false; // Molten Amputator consumes stealth in a special way diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index 910944e209..3088a7dd21 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -8,6 +8,7 @@ using CalamityMod.Dusts; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Particles; +using CalamityMod.Projectiles.Typeless; using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -35,7 +36,14 @@ namespace CalamityMod.CalPlayer PlayerDrawLayers.Shoes.Hide(); } - if (drawInfo.drawPlayer.Calamity().andromedaState != AndromedaPlayerState.Inactive) + if (drawInfo.drawPlayer.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + { + foreach (var layer in PlayerDrawLayerLoader.Layers) + { + layer.Hide(); + } + } + else if (drawInfo.drawPlayer.Calamity().andromedaState != AndromedaPlayerState.Inactive) { foreach (var layer in PlayerDrawLayerLoader.Layers) { @@ -110,6 +118,24 @@ namespace CalamityMod.CalPlayer else // This is such a stupid way to reset this but you can't just put it in ResetEffects { calamityPlayer.trippyLevel = 1; + + // Mana Burn VFX disabled when hih + if (Player.statMana < 0) + { + float compactness = Player.width * 0.6f; + if (compactness < 10f) + compactness = 10f; + float power = Player.height / 100f; + if (power > 2.75f) + power = 2.75f; + var color = Color.Blue; + if (ManaBurnFireDrawer is null || ManaBurnFireDrawer.LocalTimer >= ManaBurnFireDrawer.SetLifetime) + ManaBurnFireDrawer = new FireParticleSet(60 - (Player.statMana / 4), 1, color * 1.25f, color, compactness, power); + else + ManaBurnFireDrawer.DrawSet(Player.Bottom - Vector2.UnitY * (12f - Player.gfxOffY)); + } + else + ManaBurnFireDrawer = null; } // TODO -- rogue stealth visuals are an utter catastrophe and should be fully destroyed on next stealth rework @@ -199,10 +225,10 @@ namespace CalamityMod.CalPlayer if (calamityPlayer.auricRebuke && drawInfo.shadow == 0f) AuricRebuke.DrawEffects(drawInfo); - if (calamityPlayer.bBlood && drawInfo.shadow == 0f) + if (calamityPlayer.burningBlood && drawInfo.shadow == 0f) BurningBlood.DrawEffects(drawInfo); - if (calamityPlayer.bFlames && drawInfo.shadow == 0f) + if (calamityPlayer.brimstoneFlames && drawInfo.shadow == 0f) { bool resistsBrimstoneFlames = abaddon; // Looks weaker if you have Abaddon equipped BrimstoneFlames.DrawEffects(drawInfo, resistsBrimstoneFlames); @@ -211,12 +237,11 @@ namespace CalamityMod.CalPlayer if (calamityPlayer.brainRot && drawInfo.shadow == 0f) BrainRot.DrawEffects(drawInfo); - if (calamityPlayer.cDepth && drawInfo.shadow == 0f) + if (calamityPlayer.crushDepth && drawInfo.shadow == 0f) CrushDepth.DrawEffects(drawInfo); - // Daybroken's visual effects are reduced if the player resists it if (calamityPlayer.daybroken && drawInfo.shadow == 0f) - Daybroken.DrawEffects(drawInfo, reducedDaybrokenDamage); + Daybroken.DrawEffects(drawInfo); if (calamityPlayer.demonicFlames && drawInfo.shadow == 0f) DemonicFlames.DrawEffects(drawInfo); @@ -230,17 +255,17 @@ namespace CalamityMod.CalPlayer if (calamityPlayer.eutrophication && drawInfo.shadow == 0f) Eutrophication.DrawEffects(drawInfo); - if (calamityPlayer.gsInferno && drawInfo.shadow == 0f) + if (calamityPlayer.godSlayerInferno && drawInfo.shadow == 0f) GodSlayerInferno.DrawEffects(drawInfo); if (calamityPlayer.heavybleeding && drawInfo.shadow == 0f) HeavyBleeding.DrawEffects(drawInfo); // Holy Flames, Holy Inferno and Banishing Fire share the same visual effects - if (drawInfo.shadow == 0f && (calamityPlayer.hFlames || calamityPlayer.hInferno || calamityPlayer.banishingFire)) + if (drawInfo.shadow == 0f && (calamityPlayer.holyFlames || calamityPlayer.holyInferno || calamityPlayer.banishingFire)) HolyFlames.DrawEffects(drawInfo); - if (calamityPlayer.hPressure && drawInfo.shadow == 0f) + if (calamityPlayer.hadopelagicPressure && drawInfo.shadow == 0f) HadopelagicPressure.DrawEffects(drawInfo); // Icarus' Folly has visual effects but they are mutually exclusive with all Holy Flames variations to prevent visual clutter @@ -257,13 +282,13 @@ namespace CalamityMod.CalPlayer if (calamityPlayer.mushy && drawInfo.shadow == 0f) Mushy.DrawEffects(drawInfo); - if (calamityPlayer.nightwither && drawInfo.shadow == 0f) // Looks weaker if you have Moon Stone equipped - Nightwither.DrawEffects(drawInfo, reducedNightwitherDamage); + if (calamityPlayer.nightwither && drawInfo.shadow == 0f) + Nightwither.DrawEffects(drawInfo); - if (calamityPlayer.pFlames && drawInfo.shadow == 0f) + if (calamityPlayer.plague && drawInfo.shadow == 0f) Plague.DrawEffects(drawInfo); - if (calamityPlayer.rTide && drawInfo.shadow == 0f) + if (calamityPlayer.riptide && drawInfo.shadow == 0f) RiptideDebuff.DrawEffects(drawInfo); if (calamityPlayer.shadowflame && drawInfo.shadow == 0f) @@ -319,7 +344,7 @@ namespace CalamityMod.CalPlayer GeneralParticleHandler.SpawnParticle(Plus); } } - if (calamityPlayer.bloomStoneDR > 0 && drawInfo.shadow == 0f) + if (calamityPlayer.bloomStoneBuffedHealRateTimer > 0 && drawInfo.shadow == 0f) { if (Main.rand.NextBool(10)) { diff --git a/CalPlayer/CalamityPlayerFishing.cs b/CalPlayer/CalamityPlayerFishing.cs index a87dd8a9fb..870e37d592 100644 --- a/CalPlayer/CalamityPlayerFishing.cs +++ b/CalPlayer/CalamityPlayerFishing.cs @@ -169,6 +169,8 @@ namespace CalamityMod.CalPlayer if (canSulphurFish && bait == ModContent.ItemType() && !BossRushEvent.BossRushActive) { CalamityGlobalNPC.OldDukeSpawn(Player.whoAmI, ModContent.NPCType(), bait); + itemDrop = -1; + return; } // Ignore catches if it's junk diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 589ff24bbf..0863df6e58 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using CalamityMod.Balancing; using CalamityMod.Buffs.Cooldowns; @@ -14,9 +14,14 @@ using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Armor.Aerospec; +using CalamityMod.Items.Armor.Daedalus; using CalamityMod.Items.Armor.Demonshade; +using CalamityMod.Items.Armor.Empyrean; using CalamityMod.Items.Armor.LunicCorps; +using CalamityMod.Items.Armor.Reaver; using CalamityMod.Items.Armor.Silva; +using CalamityMod.Items.Armor.Sulphurous; +using CalamityMod.Items.Armor.Victide; using CalamityMod.Items.Armor.Wulfrum; using CalamityMod.Items.Mounts; using CalamityMod.Items.Placeables.Furniture; @@ -245,7 +250,7 @@ namespace CalamityMod.CalPlayer Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType(), Main.zenithWorld ? Main.rand.Next(5000, 50000 + 1) : 0, 0, Player.whoAmI); } - if (hInferno) + if (holyInferno) { foreach (NPC n in Main.ActiveNPCs) { @@ -293,10 +298,10 @@ namespace CalamityMod.CalPlayer if (silvaSet && silvaCountdown > 0) { - if (silvaCountdown == silvaReviveDuration && !hasSilvaEffect) + if (silvaCountdown == SilvaReviveDuration && !hasSilvaEffect) { SoundEngine.PlaySound(SilvaHeadSummon.ActivationSound, Player.Center); - Player.AddBuff(ModContent.BuffType(), silvaReviveDuration); + Player.AddBuff(ModContent.BuffType(), SilvaReviveDuration); } hasSilvaEffect = true; @@ -333,6 +338,8 @@ namespace CalamityMod.CalPlayer Player.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(3f)); Player.statLife = Player.statLifeMax2 * 3 / 10; + if (Player.statMana < 0) + Player.statMana = 0; SoundEngine.PlaySound(SoundID.Item92, Player.Center); @@ -378,7 +385,7 @@ namespace CalamityMod.CalPlayer { damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SearingLava" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name)); } - if (gsInferno) + if (godSlayerInferno) { damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.GodSlayerInferno" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name)); } @@ -409,11 +416,11 @@ namespace CalamityMod.CalPlayer { damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.MiracleBlight" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name)); } - if (hInferno) + if (holyInferno) { damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HolyInferno").ToNetworkText(Player.name)); } - if (hFlames || banishingFire) + if (holyFlames || banishingFire) { damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HolyFlames" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name)); } @@ -425,7 +432,7 @@ namespace CalamityMod.CalPlayer { damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Daybroken").ToNetworkText(Player.name)); } - if (bBlood) + if (burningBlood) { damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BurningBlood" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name)); } @@ -445,23 +452,23 @@ namespace CalamityMod.CalPlayer { damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ElementalMix" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name)); } - if (cDepth) + if (crushDepth) { damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.CrushDepth" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name)); } - if (rTide) + if (riptide) { damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Riptide" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name)); } - if (hPressure) + if (hadopelagicPressure) { damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HadopelagicPressure" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name)); } - if (bFlames || weakBrimstoneFlames || demonicFlames) + if (brimstoneFlames || weakBrimstoneFlames || demonicFlames) { damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BrimstoneFlames" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name)); } - if (pFlames) + if (plague) { damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Plague" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name)); } @@ -704,7 +711,7 @@ namespace CalamityMod.CalPlayer { Item heldItem = Player.ActiveItem(); - if (CalamityUtils.ShouldTriggerSummonPenalty(Player, heldItem) && !DisabledSummonerNerfMinionList.Includes(proj.type)) + if (CalamityUtils.ShouldTriggerSummonPenalty(Player, heldItem) && !CalamityProjectileSets.MinionWhichIgnoresSummonerNerf[proj.type]) modifiers.FinalDamage *= BalancingConstants.SummonerCrossClassNerf; } } @@ -719,7 +726,7 @@ namespace CalamityMod.CalPlayer // Enemies deal less contact damage while sick, due to being weakened. if (npc.poisoned) { - float damageReductionFromPoison = (float)((npc.Calamity().irradiated > 0 ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f); + float damageReductionFromPoison = (float)((npc.Calamity().irradiated ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f); if (npc.Calamity().VulnerableToSickness.HasValue) { if (npc.Calamity().VulnerableToSickness.Value) @@ -734,7 +741,7 @@ namespace CalamityMod.CalPlayer if (npc.venom) { - float damageReductionFromVenom = (float)((npc.Calamity().irradiated > 0 ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f); + float damageReductionFromVenom = (float)((npc.Calamity().irradiated ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f); if (npc.Calamity().VulnerableToSickness.HasValue) { if (npc.Calamity().VulnerableToSickness.Value) @@ -747,9 +754,9 @@ namespace CalamityMod.CalPlayer modifiers.SourceDamage *= damageReductionFromVenom; } - if (npc.Calamity().astralInfection > 0) + if (npc.Calamity().astralInfection) { - float damageReductionFromAstralInfection = (float)((npc.Calamity().irradiated > 0 ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f); + float damageReductionFromAstralInfection = (float)((npc.Calamity().irradiated ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f); if (npc.Calamity().VulnerableToSickness.HasValue) { if (npc.Calamity().VulnerableToSickness.Value) @@ -762,9 +769,9 @@ namespace CalamityMod.CalPlayer modifiers.SourceDamage *= damageReductionFromAstralInfection; } - if (npc.Calamity().pFlames > 0) + if (npc.Calamity().plague) { - float damageReductionFromPlague = (float)((npc.Calamity().irradiated > 0 ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f); + float damageReductionFromPlague = (float)((npc.Calamity().irradiated? npc.Calamity().irradiatedContactBoost : 1) * 0.05f); if (npc.Calamity().VulnerableToSickness.HasValue) { if (npc.Calamity().VulnerableToSickness.Value) @@ -777,9 +784,9 @@ namespace CalamityMod.CalPlayer modifiers.SourceDamage *= damageReductionFromPlague; } - if (npc.Calamity().wDeath > 0) + if (npc.Calamity().whisperingDeath) { - float damageReductionFromWhisperingDeath = (float)((npc.Calamity().irradiated > 0 ? npc.Calamity().irradiatedContactBoost : 1) * 0.1f); + float damageReductionFromWhisperingDeath = (float)((npc.Calamity().irradiated ? npc.Calamity().irradiatedContactBoost : 1) * 0.1f); if (npc.Calamity().VulnerableToSickness.HasValue) { if (npc.Calamity().VulnerableToSickness.Value) @@ -810,7 +817,7 @@ namespace CalamityMod.CalPlayer if (bloodflareMelee && bloodflareFrenzy && !Player.HasCooldown(BloodflareFrenzy.ID)) contactDamageReduction += 0.5; - if (npc.Calamity().tSad > 0) + if (npc.Calamity().temporalSadness) contactDamageReduction += 0.5; if (eskimoSet) @@ -875,7 +882,7 @@ namespace CalamityMod.CalPlayer // 10% is converted to 9%, 25% is converted to 20%, 50% is converted to 33%, 75% is converted to 43%, 100% is converted to 50% if (contactDamageReduction > 0D) { - if (aCrunch) + if (armorCrunch) contactDamageReduction *= (double)ArmorCrunch.MultiplicativeDamageReductionPlayer; if (crumble) contactDamageReduction *= (double)Crumbling.MultiplicativeDamageReductionPlayer; @@ -914,7 +921,7 @@ namespace CalamityMod.CalPlayer #region Modify Hit By Proj public override void ModifyHitByProjectile(Projectile proj, ref Player.HurtModifiers modifiers) { - if (!ProjectileDestroyExceptionsList.Includes(proj.type) && proj.active && !proj.friendly && proj.hostile && proj.damage > 0) + if (!CalamityProjectileSets.ShouldNotBeReflected[proj.type] && proj.active && !proj.friendly && proj.hostile && proj.damage > 0 && !modifiers.PvP) { double dodgeDamageGateValuePercent = 0.05; int dodgeDamageGateValue = (int)Math.Round(Player.statLifeMax2 * dodgeDamageGateValuePercent); @@ -954,6 +961,21 @@ namespace CalamityMod.CalPlayer return; } + else if (daedalusReflect) + { + proj.hostile = false; + proj.friendly = true; + proj.velocity *= -1f; + proj.penetrate = 1; + + // 17APR2024: Ozzatron: The Daedalus Reflect set bonus also functions as a dodge. It uses vanilla dodge iframes and benefits from Cross Necklace. + int daedalusReflectIFrames = Player.ComputeReflectIFrames(); + Player.GiveUniversalIFrames(daedalusReflectIFrames, true); + modifiers.Cancel(); + + int cooldownDuration = (int)MathHelper.Lerp(DaedalusHeadMelee.ReflectCooldownMin, DaedalusHeadMelee.ReflectCooldownMax, cooldownDurationScalar); + Player.AddCooldown(GlobalDodge.ID, cooldownDuration); + } } } @@ -1053,13 +1075,6 @@ namespace CalamityMod.CalPlayer projectileDamageReduction += 0.25; } - 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)) - projectileDamageReduction += 0.5; - } - if (trinketOfChiBuff) projectileDamageReduction += 0.08; @@ -1134,7 +1149,7 @@ namespace CalamityMod.CalPlayer // 10% is converted to 9%, 25% is converted to 20%, 50% is converted to 33%, 75% is converted to 43%, 100% is converted to 50% if (projectileDamageReduction > 0D) { - if (aCrunch) + if (armorCrunch) projectileDamageReduction *= (double)ArmorCrunch.MultiplicativeDamageReductionPlayer; if (crumble) projectileDamageReduction *= (double)Crumbling.MultiplicativeDamageReductionPlayer; @@ -1300,7 +1315,7 @@ namespace CalamityMod.CalPlayer if (Main.npc[proj.Calamity().ParentNPCIndex].active) { if (sulphurSet) - Main.npc[proj.Calamity().ParentNPCIndex].AddBuff(BuffID.Poisoned, 60); + Main.npc[proj.Calamity().ParentNPCIndex].AddBuff(BuffID.Poisoned, SulphurousHelmet.SetBonusPoisonDuration); if (ilSpark) Main.npc[proj.Calamity().ParentNPCIndex].Calamity().shocked = 120; } @@ -1422,40 +1437,6 @@ namespace CalamityMod.CalPlayer } } - // As these reflects do not cancel damage, they need to be in OnHit rather than ModifyHit - 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); - - // Reflects count as dodges. They share the timer and can be disabled by global dodge disabling effects. - if (!disableAllDodges && !Player.HasCooldown(GlobalDodge.ID) && proj.damage >= dodgeDamageGateValue) - { - double maxCooldownDurationDamagePercent = 0.5; - int maxCooldownDurationDamageValue = (int)Math.Round(Player.statLifeMax2 * (maxCooldownDurationDamagePercent - dodgeDamageGateValuePercent)); - - // Just in case... - if (maxCooldownDurationDamageValue <= 0) - maxCooldownDurationDamageValue = 1; - - float cooldownDurationScalar = MathHelper.Clamp((proj.damage - dodgeDamageGateValue) / (float)maxCooldownDurationDamageValue, 0f, 1f); - - if (daedalusReflect && !evolution) - { - proj.hostile = false; - proj.friendly = true; - proj.velocity *= -1f; - proj.penetrate = 1; - - // 17APR2024: Ozzatron: The Daedalus Reflect set bonus also functions as a dodge. It uses vanilla dodge iframes and benefits from Cross Necklace. - int daedalusReflectIFrames = Player.ComputeReflectIFrames(); - Player.GiveUniversalIFrames(daedalusReflectIFrames, true); - - int cooldownDuration = (int)MathHelper.Lerp(BalancingConstants.DaedalusReflectCooldownMin, BalancingConstants.DaedalusReflectCooldownMax, cooldownDurationScalar); - Player.AddCooldown(GlobalDodge.ID, cooldownDuration); - } - } - } if (NPC.AnyNPCs(ModContent.NPCType())) { Player.AddBuff(ModContent.BuffType(), 15, true); @@ -2272,9 +2253,15 @@ namespace CalamityMod.CalPlayer } } - if (daedalusAbsorb && Main.rand.NextBool(10)) + if (victideBarrierSet && !Player.HasCooldown(WardingWave.ID)) { - int healAmt = (int)(hurtInfo.Damage / 2D); + int healAmt = (int)(hurtInfo.Damage * VictideHeadBarrier.BarrierDamageAbsorptionPercent); + victideBarrierHeal += healAmt; + } + + if (daedalusAbsorb && Main.rand.NextBool(DaedalusHeadMagic.AbsorptionChanceDenominator)) + { + int healAmt = (int)(hurtInfo.Damage * DaedalusHeadMagic.DamageAbsorptionPercent); Player.HealPlayer(healAmt); } @@ -2424,11 +2411,11 @@ namespace CalamityMod.CalPlayer } else if (xerocSet) { - Player.AddBuff(ModContent.BuffType(), 180); + Player.AddBuff(ModContent.BuffType(), EmpyreanMask.WrathDuration); } else if (reaverDefense) { - Player.AddBuff(ModContent.BuffType(), 180); + Player.AddBuff(ModContent.BuffType(), ReaverHeadTank.ReaverRageDuration); } if (fBarrier || (aquaticHeart && NPC.downedBoss3)) @@ -2660,21 +2647,18 @@ namespace CalamityMod.CalPlayer } else if (daedalusShard) // Daedalus Ranged helm { - var source = Player.GetSource_Misc("22"); if (hurtInfo.Damage > 0) { SoundEngine.PlaySound(SoundID.Item27, Player.Center); - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(Player.velocity.X, Player.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int sDamage = (int)Player.GetTotalDamage().ApplyTo(60); if (Player.whoAmI == Main.myPlayer) { + var source = Player.GetSource_Misc("22"); + float offset = Main.rand.NextFloat(MathHelper.TwoPi); + int sDamage = (int)Player.GetTotalDamage().ApplyTo(DaedalusHeadRanged.ShardDamage); for (int i = 0; i < 10; i++) { - Vector2 circleVel = (MathHelper.TwoPi * i / 16f).ToRotationVector2() * Main.rand.NextFloat(5f, 8f); + Vector2 circleVel = ((MathHelper.TwoPi * i / 10f) + offset).ToRotationVector2() * Main.rand.NextFloat(5f, 8f); int shard = Projectile.NewProjectile(source, Player.Center, circleVel, ProjectileID.CrystalShard, sDamage, 1f, Player.whoAmI); if (shard.WithinBounds(Main.maxProjectiles)) Main.projectile[shard].DamageType = DamageClass.Generic; @@ -2682,17 +2666,6 @@ namespace CalamityMod.CalPlayer } } } - else if (reaverDefense) //Defense and DR Helm - { - var source = Player.GetSource_Misc("23"); - if (hurtInfo.Damage > 0) - { - int rDamage = (int)Player.GetBestClassDamage().ApplyTo(240); - - if (Player.whoAmI == Main.myPlayer) - Projectile.NewProjectile(source, Player.Center.X, Player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType(), rDamage, 0f, Player.whoAmI, 0f, 0f); - } - } else if (godSlayerDamage) //god slayer melee helm { var source = Player.GetSource_Misc("24"); diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index b4035bdd0e..4949a5322f 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -9,6 +9,7 @@ using CalamityMod.Cooldowns; using CalamityMod.Enums; using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Wings; +using CalamityMod.Items.Armor.Reaver; using CalamityMod.Items.Fishing.BrimstoneCragCatches; using CalamityMod.Items.Placeables.Furniture; using CalamityMod.Items.Potions; @@ -97,41 +98,41 @@ namespace CalamityMod.CalPlayer } // Whispering Death sets positive regen to zero but doesn't actually deal any damage - ApplyDoTDebuff(wDeath, 0, laudanum); + ApplyDoTDebuff(whisperingDeath, 0, laudanum); ApplyDoTDebuff(irradiated, 4, purity); int sulphurDoT = 6 - (sulphurSet ? 2 : 0) - (sulphurskin ? 2 : 0) - (corrosiveSpine ? 2 : 0); ApplyDoTDebuff(sulphurPoison, sulphurDoT, purity); - ApplyDoTDebuff(rTide, 6, purity); + ApplyDoTDebuff(riptide, 6, purity); ApplyDoTDebuff(weakBrimstoneFlames, 7); - ApplyDoTDebuff(bBlood, 8, purity); + ApplyDoTDebuff(burningBlood, 8, purity); ApplyDoTDebuff(brainRot, 8, purity); ApplyDoTDebuff(vaporfied, 8, purity); int staticDoT = ((Player.controlLeft || Player.controlRight) ? 12 : 3) / (eleResist ? 2 : 1); ApplyDoTDebuff(staticDischarge, staticDoT, purity); ApplyDoTDebuff(heavybleeding, 16, purity); - ApplyDoTDebuff(cDepth, 18, purity); + ApplyDoTDebuff(crushDepth, 18, purity); ApplyDoTDebuff(astralInfection, 24, infectedJewel || hideOfDeus || purity); ApplyDoTDebuff(shadowflame, 30, purity); - ApplyDoTDebuff(bFlames, abaddon ? 15 : 30, purity); - ApplyDoTDebuff(pFlames, alchFlask ? 15 : 30, purity); + ApplyDoTDebuff(brimstoneFlames, abaddon ? 15 : 30, purity); + ApplyDoTDebuff(plague, alchFlask ? 15 : 30, purity); ApplyDoTDebuff(vHex, 30); // Has other effects - ApplyDoTDebuff(cragsLava, 30); + ApplyDoTDebuff(searingLava, 30); ApplyDoTDebuff(demonicFlames, 33, purity); // Never inflicted on the player ApplyDoTDebuff(laceration, 36, purity); - ApplyDoTDebuff(daybroken, reducedDaybrokenDamage ? 20 : 40, purity); - ApplyDoTDebuff(nightwither, reducedNightwitherDamage ? 20 : 40, purity); - ApplyDoTDebuff(hFlames, 40, purity); + ApplyDoTDebuff(daybroken, 40, purity); + ApplyDoTDebuff(nightwither, 40, purity); + ApplyDoTDebuff(holyFlames, 40, purity); ApplyDoTDebuff(voidfrost, 40, purity); - ApplyDoTDebuff(hPressure, 40, purity); + ApplyDoTDebuff(hadopelagicPressure, 40, purity); // Profaned Soul Crystal turns you into Providence, a God, and you take more damage from God Slayer Inferno - ApplyDoTDebuff(gsInferno, profanedCrystalBuffs ? 50 : 40); + ApplyDoTDebuff(godSlayerInferno, profanedCrystalBuffs ? 50 : 40); int fluxDoT = ((Player.controlLeft || Player.controlRight) ? 50 : 10) / (eleResist ? 2 : 1); ApplyDoTDebuff(vermillionFlux, fluxDoT); ApplyDoTDebuff(elementalMix, 50, purity); // Never inflicted on the player ApplyDoTDebuff(trueVHex, 50); - int dragonfireDoT = ((Player.name == "JFL" || Player.name == "MrJFL") ? 240 : 50) / (dynamoStemCells ? 2 : 1); + int dragonfireDoT = ((Player.name == "JFL" || Player.name == "MrJFL") ? 200 : 50) / (dynamoStemCells ? 2 : 1); ApplyDoTDebuff(dragonFire, dragonfireDoT); ApplyDoTDebuff(miracleBlight, 60); ApplyDoTDebuff(banishingFire, 60); // Never inflicted on the player @@ -191,7 +192,7 @@ namespace CalamityMod.CalPlayer for (int l = 0; l < Player.MaxBuffs; l++) { int buff = Player.buffType[l]; - if (AlcoholsDict.TryGet(buff, out var level)) + if (CalamityBuffSets.AlcoholStrength.TryGetValue(buff, out int level)) alcoholPoisonLevel += level; } if (vodka) @@ -278,14 +279,9 @@ namespace CalamityMod.CalPlayer else witheredWeaponHoldTime = 0; - if (ManaBurn) + if (Player.statMana < 0) { - int debuffIndex = Player.FindBuffIndex(ModContent.BuffType()); - float debuffIntensity = debuffIndex == -1 ? 0f : Player.buffTime[debuffIndex] / (float)Player.manaSickTimeMax; - - totalNegativeLifeRegen += (int)(Math.Sqrt(debuffIntensity) * Math.Pow(6D, debuffIntensity + 1f)); - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; + totalNegativeLifeRegen -= Player.statMana/10f; } // @@ -294,7 +290,7 @@ namespace CalamityMod.CalPlayer // At the last second, Reaver defense helm reduces DoT debuffs by 20% if (reaverDefense) - totalNegativeLifeRegen = (int)(0.8f * totalNegativeLifeRegen); + totalNegativeLifeRegen -= (int)(totalNegativeLifeRegen * ReaverHeadTank.SetBonusDebuffDamageReduction); Player.lifeRegen -= (int)totalNegativeLifeRegen; @@ -331,11 +327,11 @@ namespace CalamityMod.CalPlayer int buffID = Player.buffType[l]; if (Player.buffTime[l] <= 2) continue; - bool shouldHalveDuration = SicknessDebuffsList.Includes(buffID); + bool shouldHalveDuration = CalamityBuffSets.IsSicknessDebuff[buffID]; if (livingDewHalveDebuffs) - shouldHalveDuration |= FireDebuffsList.Includes(buffID); + shouldHalveDuration |= CalamityBuffSets.IsFireDebuff[buffID]; if (purity) - shouldHalveDuration |= DebuffsList.Includes(buffID); + shouldHalveDuration |= CalamityBuffSets.IsDebuff[buffID]; if (shouldHalveDuration) --Player.buffTime[l]; @@ -379,7 +375,7 @@ namespace CalamityMod.CalPlayer } // Permafrost's Concoction increases life regen while afflicted with a fire debuff - if (permafrostsConcoction && Player.buffType.Any(FireDebuffsList.Includes)) + if (permafrostsConcoction && Player.buffType.Any(l => CalamityBuffSets.IsFireDebuff[l])) { if (Player.lifeRegenTime < 900) Player.lifeRegenTime = 900; @@ -402,7 +398,7 @@ namespace CalamityMod.CalPlayer if (purity) { int intendedPurityDefense = 0; - int currentDebuffs = Player.buffType.Count(DebuffsList.List.Contains); + int currentDebuffs = Player.buffType.Count(i => CalamityBuffSets.IsDebuff[i]); if (currentDebuffs > 0) { // Healing rate is normally 5 HP/s (+1 every 12 frames) @@ -457,7 +453,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(DebuffsList.List.Contains); + int currentDebuffs = Player.buffType.Count(i => CalamityBuffSets.IsDebuff[i]); if (currentDebuffs > 0) { Player.lifeRegen += 4; @@ -484,7 +480,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(DebuffsList.List.Contains)) + if (Player.buffType.Any(i => CalamityBuffSets.IsDebuff[i])) { Player.lifeRegen += 3; if (Player.lifeRegenTime < 900) @@ -525,7 +521,7 @@ namespace CalamityMod.CalPlayer Player.lifeRegenCount = 0; } - if (hInferno) + if (holyInferno) { Player.nebulaLevelLife = 0; @@ -651,7 +647,7 @@ namespace CalamityMod.CalPlayer for (int l = 0; l < Player.MaxBuffs; l++) { int hasBuff = Player.buffType[l]; - lesserEffect = AlcoholsDict.TryGet(hasBuff, out var a); + lesserEffect = CalamityBuffSets.AlcoholStrength.TryGetValue(hasBuff, out var a); } if (Player.lifeRegen < 0) Player.lifeRegen += lesserEffect ? 1 : regenBoost; @@ -696,15 +692,6 @@ namespace CalamityMod.CalPlayer else pinkCandleHealFraction = 0D; - if (BloomStoneRegen) - { - float dayTimeCompletion = !Main.dayTime ? 1f : (float)(Main.time / Main.dayLength); - float regenBenefitFactor = MathHelper.SmoothStep(0.25f, 1f, Utils.GetLerpValue(0f, 0.24f, dayTimeCompletion, true) * Utils.GetLerpValue(1f, 0.76f, dayTimeCompletion, true)); - - Player.lifeRegen += (int)MathHelper.Lerp(2f, 6f, regenBenefitFactor); - Player.lifeRegenTime += (int)MathHelper.Lerp(1f, 3f, regenBenefitFactor); - } - if (manaOverloader) { float manaRatio = Player.statMana / (float)Player.statManaMax2; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 1e805481d4..8e4b68c11b 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -21,9 +21,11 @@ using CalamityMod.Items.Armor.Aerospec; using CalamityMod.Items.Armor.Bloodflare; using CalamityMod.Items.Armor.Brimflame; using CalamityMod.Items.Armor.DesertProwler; +using CalamityMod.Items.Armor.Empyrean; using CalamityMod.Items.Armor.Hydrothermic; using CalamityMod.Items.Armor.LunicCorps; using CalamityMod.Items.Armor.OmegaBlue; +using CalamityMod.Items.Armor.PlagueReaper; using CalamityMod.Items.Armor.Prismatic; using CalamityMod.Items.Armor.Reaver; using CalamityMod.Items.Armor.Silva; @@ -202,12 +204,12 @@ namespace CalamityMod.CalPlayer rage = 0f; } - if (furyFuel < furyFuelMax && furyRefuelTimer >= 0) + if (furyFuel < FuryFuelMax && furyRefuelTimer >= 0) { furyFuel += (int)furyRefuelTimer; furyRefuelTimer = MathHelper.Lerp(furyRefuelTimer, 25, 0.01f); - if (furyFuel > furyFuelMax) - furyFuel = furyFuelMax; + if (furyFuel > FuryFuelMax) + furyFuel = FuryFuelMax; } else if (furyRefuelTimer < 0) furyRefuelTimer++; @@ -222,11 +224,6 @@ namespace CalamityMod.CalPlayer // Apply stealth damage to rogue. Player.GetDamage() += stealthDamage; - //Slow the player down after any other speed modifiers might have been applied. - //Todo - Move this back to the wulfrum set class whenever statmodifiers are implemented for stats other than damage - if (WulfrumHat.PowerModeEngaged(Player, out _)) - Player.moveSpeed *= 0.8f; - if ((XykVisualsBlue || XykVisualsOrange)) { bool Orange = XykVisualsOrange; @@ -295,12 +292,16 @@ namespace CalamityMod.CalPlayer { if (dashStart) { - Player.velocity.X *= 3.5f; + Player.velocity.X *= 2f; lastDashWasTabi = true; } if (Player.dashDelay == -1) { - Player.velocity.X *= 0.9f; + Player.velocity.X *= 0.95f; + if (Player.timeSinceLastDashStarted > 12) + { + Player.velocity.X *= 0.75f; + } } } if ((devilsDevastationKillMode || exaltedKillMode) && !Player.mount.Active) @@ -628,7 +629,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() && !NoRageWormSegmentList.Includes(npc.type)) + if (npc.IsABoss() && !CalamityNPCSets.BossSegmentThatDoesNotGenerateRageFaster[npc.type]) bossDistance = hitboxEdgeDist; } } @@ -915,8 +916,11 @@ namespace CalamityMod.CalPlayer if (target.Calamity().cursorFocus >= CalamityGlobalNPC.cursorFocusMax) { - target.Calamity().trueVulnerabilityHex = target.Calamity().vulnerabilityHex >= 300 ? target.Calamity().vulnerabilityHex : 300; - target.Calamity().vulnerabilityHex = 0; + int vHexDuration = 0; + if (target.HasBuff()) + vHexDuration = target.buffTime[target.FindBuffIndex(ModContent.BuffType())]; + target.AddBuff(ModContent.BuffType(),vHexDuration <= 300 ? vHexDuration : 300); + target.RequestBuffRemoval(ModContent.BuffType()); SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/WeaponEnchant"), target.Center); for (int i = 0; i < 18; i++) @@ -948,8 +952,12 @@ namespace CalamityMod.CalPlayer // Incinerate the target with either Vulnerability Hex or True Vulnerability Hex, depending on current cursor focus. // This adds 8 to the buff duration, which results in a net increase of 3 frames every time damage is dealt, due to damage occurring every 5 frames. - int buffToInflict = target.Calamity().trueVulnerabilityHex > 0 ? ModContent.BuffType() : ModContent.BuffType(); - target.AddBuff(buffToInflict, target.Calamity().trueVulnerabilityHex > 0 ? target.Calamity().trueVulnerabilityHex + 8 : target.Calamity().vulnerabilityHex < VulnerabilityHex.CalamityDuration ? VulnerabilityHex.CalamityDuration : target.Calamity().vulnerabilityHex + 8); + int buffToInflict = target.Calamity().trueVulnerabilityHex? ModContent.BuffType() : ModContent.BuffType(); + if (!target.HasBuff(buffToInflict)) + target.AddBuff(buffToInflict, 52); + target.buffTime[target.FindBuffIndex(buffToInflict)] += 8; + if (target.buffTime[target.FindBuffIndex(buffToInflict)] < VulnerabilityHex.CalamityDuration) + target.buffTime[target.FindBuffIndex(buffToInflict)] = VulnerabilityHex.CalamityDuration; // Make some fancy dust to indicate damage is being done. for (int j = 0; j < 12; j++) @@ -966,6 +974,14 @@ namespace CalamityMod.CalPlayer private void MiscEffects() { + //Mana Burn update + if (ManaBurnFireDrawer != null) + { + ManaBurnFireDrawer.LocalTimer = 0; + ManaBurnFireDrawer.RelativePower = MathHelper.Lerp(0.25f, 0.5f, -Player.statMana / (float)Player.statManaMax2); + ManaBurnFireDrawer.Update(); + } + // Update textures if (!Main.dedServ && Player.whoAmI == Main.myPlayer) { @@ -1143,7 +1159,7 @@ namespace CalamityMod.CalPlayer for (int l = 0; l < Player.MaxBuffs; l++) { int buffID = Player.buffType[l]; - if (Player.buffTime[l] > 2 && DebuffsList.Includes(buffID)) + if (Player.buffTime[l] > 2 && CalamityBuffSets.IsDebuff[buffID]) Player.buffTime[l]--; } } @@ -1157,7 +1173,7 @@ namespace CalamityMod.CalPlayer ProvidenceBurnEffectDrawer.ParticleSpawnRate = int.MaxValue; // If the player has holy inferno, cause the player to ignite into flames. - if (hInferno) + if (holyInferno) ProvidenceBurnEffectDrawer.ParticleSpawnRate = 1; // Otherwise, if the intensity is too weak, but still present, cause the player to release holy cinders. @@ -1178,11 +1194,11 @@ namespace CalamityMod.CalPlayer } ProvidenceBurnEffectDrawer.Update(); - if (hInferno && holyInfernoFadeIntensity < 1f) + if (holyInferno && holyInfernoFadeIntensity < 1f) { holyInfernoFadeIntensity = MathHelper.Clamp(holyInfernoFadeIntensity + 0.015f, 0f, 1f); } - else if (!hInferno && holyInfernoFadeIntensity > 0f) + else if (!holyInferno && holyInfernoFadeIntensity > 0f) { holyInfernoFadeIntensity = MathHelper.Clamp(holyInfernoFadeIntensity - 0.01f, 0f, 1f); } @@ -1204,7 +1220,7 @@ namespace CalamityMod.CalPlayer Player.AddBuff(ModContent.BuffType(), 2, false); } } - if (iCantBreathe) + if (frozenLungs) { if (Player.breath > 0 && Player.miscCounter % 2 == 0) Player.breath--; @@ -1299,13 +1315,11 @@ namespace CalamityMod.CalPlayer Player.maxFallSpeed = 20f; } - if (Player.controlDown && !Player.controlJump && ironBoots) + if (Player.controlDown && !Player.controlJump && (ironBoots || gSabaton) && !gSabatonFalling) { - Player.maxFallSpeed = 23f; // This is slightly faster than slimy saddle (so it can be viable) + Player.maxFallSpeed *= 2; //This ties Slimy Saddle. It is made viable by also allowing the player to move horizontal, unlike Saddle, and curbing existing vertical speed very fast if (Player.gravDir == 1 ? Player.velocity.Y <= 0 : Player.velocity.Y >= 0) Player.velocity.Y *= 0.7f; - else if (Player.gravDir == 1 ? Player.velocity.Y < Player.maxFallSpeed : Player.velocity.Y > Player.maxFallSpeed) - Player.velocity.Y = MathHelper.Lerp(Player.velocity.Y, Player.maxFallSpeed, 0.1f); } if (LungingDown) @@ -1326,10 +1340,6 @@ namespace CalamityMod.CalPlayer if (holdingDown && Player.ControlsEnabled() && notInLiquid && notOnRope && notGrappling && airborne && !Player.Calamity().gSabatonFalling) //Player cannot further increase their ridiculous gravity during a Gravistar Slam { Player.velocity.Y += Player.gravity * Player.gravDir * (BalancingConstants.HoldingDownGravityMultiplier - 1f); - if (Player.Calamity().gSabaton && !Player.gravControl2) - { - Player.maxFallSpeed *= 1.5f; - } if (Player.velocity.Y * Player.gravDir > Player.maxFallSpeed) Player.velocity.Y = Player.maxFallSpeed * Player.gravDir; } @@ -1531,11 +1541,9 @@ namespace CalamityMod.CalPlayer // The fire boots debuff boosts if (hellfireTreads) - bootLevel = 2; + HeatDebuffMultiplier += 0.5f; else if (flameWakerBoots) - bootLevel = 1; - else - bootLevel = 0; + HeatDebuffMultiplier += 0.25f; if (rOfResilienceEffect > 0) rOfResilienceEffect--; @@ -1873,6 +1881,41 @@ namespace CalamityMod.CalPlayer dOfTheDeepTimer++; } } + if (hookPullVisuals > 0) + { + if (bloomStone && Player.Calamity().bloomStoneHookVisuals) // Visual flowers while being pulled + { + Vector2 spawnPos = Player.Center + Main.rand.NextVector2Circular(20f, 20f); + float fade = (float)Math.Pow(Utils.GetLerpValue(0, 30, hookPullVisuals, true), 2); + + Particle trail = new CustomSpark(Player.Center, -Player.velocity.SafeNormalize(Vector2.UnitX) * Main.rand.NextFloat(5f, 8f), + "CalamityMod/Particles/BloomCircle", false, Main.rand.Next(7, 10 + 1), 0.65f, + Color.Lerp(Color.HotPink, Color.Gold, Utils.GetLerpValue(60, 30, hookPullVisuals, true)) * 0.75f * fade, new Vector2(1f, 0.7f), true, shrinkSpeed: 0.6f); + GeneralParticleHandler.SpawnParticle(trail); + + if (Main.rand.NextBool(3)) + { + Particle floweyFromHitGameUndertale = new CustomSpark(spawnPos, -Player.velocity.SafeNormalize(Vector2.UnitX) * Main.rand.NextFloat(5f, 8f), + "CalamityMod/Particles/MiniFlower", false, Main.rand.Next(25, 28 + 1), Main.rand.NextFloat(2.3f, 2.6f) * fade, + Color.Lerp(Color.HotPink, Color.Plum, Main.rand.NextFloat(0, 0.65f)), new Vector2(1f, 1f), true, extraRotation: Main.rand.NextFloat(0, MathHelper.TwoPi)); + GeneralParticleHandler.SpawnParticle(floweyFromHitGameUndertale); + } + if (Main.rand.NextBool()) + { + Dust pollenDust = Dust.NewDustPerfect(Player.Center + Main.rand.NextVector2Circular(20f, 20f), ModContent.DustType()); + pollenDust.noLightEmittence = true; + pollenDust.noGravity = true; + pollenDust.scale = Main.rand.NextFloat(0.9f, 1.4f); + pollenDust.color = Color.Lerp(Color.Gold, Color.HotPink, Utils.GetLerpValue(60, 30, hookPullVisuals, true)); + pollenDust.velocity = -Player.velocity.SafeNormalize(Vector2.UnitX) * Main.rand.NextFloat(2f, 5f); + pollenDust.fadeIn = -0.5f * fade; + } + } + + hookPullVisuals--; + if (Player.velocity.Length() < 6) + hookPullVisuals = 0; + } if (unstableGraniteCore) { @@ -2036,8 +2079,6 @@ namespace CalamityMod.CalPlayer phantomicHeartRegen--; if (phantomicBulwarkCooldown > 0) phantomicBulwarkCooldown--; - if (KameiBladeUseDelay > 0) - KameiBladeUseDelay--; if (galileoCooldown > 0) galileoCooldown--; if (gladiatorTimer > 0) @@ -2079,15 +2120,27 @@ namespace CalamityMod.CalPlayer if (theBeeCooldown > 0) theBeeCooldown--; - if (bloomStoneHealTimer > 0) + if (bloomStoneTotalHeal > 0) { - if (bloomStone && bloomStoneHealTimer % 40 == 0) + float healRateDiv = (Player.statLife >= Player.statLifeMax ? 5 : // 5 times as slow if at max hp already (overheal prevention) + bloomStoneBuffedHealRateTimer > 0 ? Utils.Remap(bloomStoneBuffedHealRateTimer, 90, 0, 0.5f, 1f, true) // 2 times faster if pollen buffed, scales back down to regular speed as the buff fades + : 1); // Regular speed + bloomStoneHealRate = 1 / healRateDiv; + + if (!bloomStone) // If you take it off, all your healing is instantly gone + bloomStoneTotalHeal = 0; + + float secondsOfHealing = 16; // Number of seconds healing occurs over at base, this can be met slower or faster depending on heal rate + if (bloomStoneHealTimer >= 60) // heal the player a portion of their potion every second { - Player.HealPlayer(Math.Min(bloomStoneHealInc, bloomStoneTotalHeal)); + int healAmount = (int)(Math.Max(Math.Min(bloomStoneHealPool, (int)(bloomStoneTotalHeal / secondsOfHealing)), 1)); + Player.HealPlayer(healAmount); + bloomStoneHealPool -= healAmount; // Subtract the amount healed from the pool until it's empty + // Special specifically programmed interaction with Chalice of the Blood God: Healing over time clears bits of the bleedout buffer. if (chaliceOfTheBloodGod && chaliceBleedoutBuffer > 0D) { - float amountOfBleedToClear = ChaliceOfTheBloodGod.HealingPotionRatioForBufferClear * bloomStoneHealInc; + float amountOfBleedToClear = ChaliceOfTheBloodGod.HealingPotionRatioForBufferClear * healAmount; chaliceBleedoutBuffer -= amountOfBleedToClear; // Display text indicating that healing was applied to the bleedout buffer. if (!Main.dedServ) @@ -2098,22 +2151,16 @@ namespace CalamityMod.CalPlayer } } - bloomStoneTotalHeal -= bloomStoneHealInc; - if (bloomStoneTotalHeal < 0) + if (bloomStoneHealPool == 0) // When you're out of healing, reset values + { bloomStoneTotalHeal = 0; + } + bloomStoneHealTimer = 0; } - bloomStoneHealTimer--; - } - else - { - bloomStoneTotalHeal = 0; - bloomStoneHealInc = 0; - } - if (bloomStoneDR > 0) - { - Player.endurance += bloomStoneHealTimer > 0 ? 0.12f : 0.06f; - bloomStoneDR--; + bloomStoneHealTimer += bloomStoneHealRate; } + if (bloomStoneBuffedHealRateTimer > 0) + bloomStoneBuffedHealRateTimer--; if (summonProjCooldown > 0f) summonProjCooldown -= 1f; @@ -2139,13 +2186,6 @@ namespace CalamityMod.CalPlayer if (vortexBoosterStealthDelay == 1 && Player.setVortex) Player.vortexStealthActive = true; } - if (statisPenaltyTimer > 0) - statisPenaltyTimer--; - if (statisPenaltyTimer == 0 && statisAnticheese > 0) - { - statisAnticheese--; - statisPenaltyTimer = statisTimerMax; - } if (hallowedRuneCooldown > 0) hallowedRuneCooldown--; if (sulphurBubbleCooldown > 0) @@ -2199,12 +2239,12 @@ namespace CalamityMod.CalPlayer } } } - if (Player.miscCounter % 20 == 0) + if (Player.miscCounter % HydrothermicHeadRanged.FlareCooldown == 0) canFireAtaxiaRangedProjectile = true; + if (Player.miscCounter % HydrothermicHeadRogue.VolleyCooldown == 0) + canFireAtaxiaRogueProjectile = true; if (Player.miscCounter % 100 == 0) canFireBloodflareMageProjectile = true; - if (Player.miscCounter % 120 == 0) - canFireAtaxiaRogueProjectile = true; if (Player.miscCounter % 150 == 0) { canFireGodSlayerRangedProjectile = true; @@ -2298,8 +2338,10 @@ namespace CalamityMod.CalPlayer // God Slayer Armor dash debuff immunity if (LastUsedDashID == GodslayerArmorDash.ID && Player.dashDelay < 0) { - foreach (int debuff in DebuffsList.List) - Player.buffImmune[debuff] = true; + for (int d = 0; d < Player.buffImmune.Length; d++) + { + Player.buffImmune[d] |= CalamityBuffSets.IsDebuff[d]; + } } // Shield of the High Ruler @@ -2370,8 +2412,11 @@ namespace CalamityMod.CalPlayer if (silvaCountdown > 0 && hasSilvaEffect && silvaSet) { // You become immune to all debuffs - foreach (int debuff in DebuffsList.List) - Player.buffImmune[debuff] = true; + foreach (int debuff in Player.buffType) + { + if (CalamityBuffSets.IsDebuff[debuff]) + Player.buffImmune[debuff] = true; + } // Prevent thorns effects from being abused during invincibility Player.thorns = 0f; @@ -2450,8 +2495,7 @@ namespace CalamityMod.CalPlayer if (Player.whoAmI == Main.myPlayer) Player.AddCooldown(Cooldowns.TarragonImmunity.ID, CalamityUtils.SecondsToFrames(25)); - bool shouldAffect = DebuffsList.Includes(buffID); - if (shouldAffect) + if (CalamityBuffSets.IsDebuff[buffID]) Player.GetDamage() += 0.1f; } } @@ -2500,6 +2544,17 @@ namespace CalamityMod.CalPlayer } } + if (brimflameFrenzy) + { + Player.GetDamage() += BrimflameCowl.FrenzyMagicDamageBoost; + + for (int l = 0; l < Player.MaxBuffs; l++) + { + if (Player.buffTime[l] <= 2 && Player.buffType[l] == ModContent.BuffType() && Player.whoAmI == Main.myPlayer) + Player.AddCooldown(BrimflameFrenzy.ID, BrimflameCowl.FrenzyCooldown); + } + } + // Raider Talisman bonus if (raiderTalisman && !vampiricTalisman && !StealthStrikeAvailable() && raiderCritLifespan > 0f) Player.GetCritChance() += RaidersTalisman.RaiderBonus; @@ -2773,7 +2828,7 @@ namespace CalamityMod.CalPlayer { brimflameFrenzy = false; Player.ClearBuff(ModContent.BuffType()); - Player.AddCooldown(BrimflameFrenzy.ID, BrimflameScowl.CooldownLength); + Player.AddCooldown(BrimflameFrenzy.ID, BrimflameCowl.FrenzyCooldown); } if (!bloodflareMelee && bloodflareFrenzy) { @@ -2810,8 +2865,8 @@ namespace CalamityMod.CalPlayer } bool hasPlagueBlackoutCD = cooldowns.TryGetValue(PlagueBlackout.ID, out CooldownInstance plagueBlackoutCD); - if (!plagueReaper && hasPlagueBlackoutCD && plagueBlackoutCD.timeLeft > 1500) - plagueBlackoutCD.timeLeft = 1500; + if (!plagueReaper && hasPlagueBlackoutCD && plagueBlackoutCD.timeLeft > PlagueReaperMask.BlackoutCooldown) + plagueBlackoutCD.timeLeft = PlagueReaperMask.BlackoutCooldown; if (!prismaticSet && prismaticLasers > 1800) { @@ -2963,7 +3018,7 @@ namespace CalamityMod.CalPlayer (Player.arcticDivingGear ? 5D : 0D) + (aquaticEmblem ? 5D : 0D) + (Player.accMerman ? 8D : 0D) + - (victideSet ? 2D : 0D) + + (victideBurrowHead ? 2D : 0D) + ((aquaticHeart && NPC.downedBoss3) ? 8D : 0D) + (abyssalDivingSuit ? 8D : 0D) + externalBreathTickBoost; @@ -2979,7 +3034,7 @@ namespace CalamityMod.CalPlayer abyssBreathLossRateStat = (float)tick; float resistanceSlowdownFactor = 1f; - if (hPressure) + if (hadopelagicPressure) resistanceSlowdownFactor -= abyssalDivingSuit ? 0.2f : 0.5f; // Reduce breath over ticks (frames) @@ -2992,7 +3047,7 @@ namespace CalamityMod.CalPlayer // Reduce breath if (Player.breath > 0) { - Player.breath -= (int)(cDepth && !depthCharm ? breathLoss + 1D : breathLoss); + Player.breath -= (int)(crushDepth && !depthCharm ? breathLoss + 1D : breathLoss); } } @@ -3042,7 +3097,7 @@ namespace CalamityMod.CalPlayer abyssDeath = false; // Signus headcrab darkness - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) { if (CalamityGlobalNPC.signus != -1) { @@ -3150,17 +3205,17 @@ namespace CalamityMod.CalPlayer else { aquaticBoost += 2f; - if (aquaticBoost > aquaticBoostMax) - aquaticBoost = aquaticBoostMax; + if (aquaticBoost > AquaticBoostMax) + aquaticBoost = AquaticBoostMax; if (Player.mount.Active) - aquaticBoost = aquaticBoostMax; + aquaticBoost = AquaticBoostMax; } Player.statDefense += (int)((1f - aquaticBoost * 0.0001f) * 20f); Player.moveSpeed -= (1f - aquaticBoost * 0.0001f) * 0.1f; } else - aquaticBoost = aquaticBoostMax; + aquaticBoost = AquaticBoostMax; if (Player.ActiveItem().type == ModContent.ItemType() && Player.StandingStill(0.1f)) { @@ -3322,8 +3377,8 @@ namespace CalamityMod.CalPlayer if (xWrath) { - Player.GetDamage() += 0.1f; - Player.GetCritChance() += 5; + Player.GetDamage() += EmpyreanMask.WrathRogueDamageBoost; + Player.GetCritChance() += EmpyreanMask.WrathRogueCritBoost; } if (graxDefense) @@ -3546,7 +3601,7 @@ namespace CalamityMod.CalPlayer } } - if (HighTestFishingPoleList.Includes(Player.ActiveItem().type)) + if (CalamityItemSets.FishingPoleThatNeverBreaks[Player.ActiveItem().type]) Player.accFishingLine = true; if (planarSpeedBoost != 0) @@ -3575,12 +3630,12 @@ namespace CalamityMod.CalPlayer // Flight time boosts double flightTimeMult = 1D + (harpyRing ? 0.2 : 0D) + - (reaverSpeed ? 0.1 : 0D) + + (reaverSpeed ? ReaverHeadMobility.SetBonusFlightBoost : 0D) + (angelTreads ? 0.1 : 0D) + (blueCandle ? WeightlessCandle.WingTimeBoost : 0D) + (soaring ? SoaringPotion.FlightBoost : 0D) + (prismaticGreaves ? 0.1 : 0D) + - (plagueReaper ? 0.05 : 0D) + + (plagueReaper ? PlagueReaperMask.SetBonusFlightTimeBoost : 0D) + (ascendantInsignia ? 0.17 : 0D) + // Added to soaring insignia's flight to get 50% (Player.empressBrooch ? 0.33 : 0D) + externalFlightTimeMultBoost; @@ -3601,7 +3656,7 @@ namespace CalamityMod.CalPlayer // Reaver Tank set nuke flight time if (reaverDefense) - flightTimeMult -= 0.3f; + flightTimeMult -= ReaverHeadTank.SetBonusMobilityReduction; // Increase wing time if (Player.wingTimeMax > 0) @@ -3655,10 +3710,10 @@ namespace CalamityMod.CalPlayer if (tarraSet) Player.lifeMagnet = true; - if (wDeath && !laudanum && !purity) + if (whisperingDeath && !laudanum && !purity) Player.GetDamage() -= 0.2f; - if (aCrunch && !laudanum && !purity) + if (armorCrunch && !laudanum && !purity) { Player.statDefense -= ArmorCrunch.DefenseReduction; Player.endurance *= ArmorCrunch.MultiplicativeDamageReductionPlayer; @@ -3766,7 +3821,7 @@ namespace CalamityMod.CalPlayer if (ataxiaBlaze) { - if (Player.statLife <= (int)(Player.statLifeMax2 * 0.5)) + if (Player.statLife <= (int)(Player.statLifeMax2 * HydrothermicArmor.InfernoHealthThreshold)) Player.AddBuff(BuffID.Inferno, 2); } @@ -3822,11 +3877,12 @@ namespace CalamityMod.CalPlayer } if (Player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - int damage = (int)Player.GetTotalDamage().ApplyTo(600); + int baseDmg = auricSet ? 500 : 380; + int damage = (int)Player.GetTotalDamage().ApplyTo(baseDmg); var p = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, 0f, -1f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, -20f, 0f); if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = 600; + Main.projectile[p].originalDamage = baseDmg; } } @@ -3923,20 +3979,18 @@ namespace CalamityMod.CalPlayer // Inferno potion boost if (ataxiaBlaze && Player.inferno) { - const int FramesPerHit = 30; - // Constantly increment the timer every frame. - hydrothermicInfernoTimer = (hydrothermicInfernoTimer + 1) % FramesPerHit; + hydrothermicInfernoTimer = (hydrothermicInfernoTimer + 1) % HydrothermicArmor.InfernoHitRate; // Only run this code for the client which is wearing the armor. // Brimstone flames is applied every single frame, but direct damage is only dealt twice per second. if (Player.whoAmI == Main.myPlayer) { - int damage = (int)Player.GetBestClassDamage().ApplyTo(50); + int damage = (int)Player.GetBestClassDamage().ApplyTo(HydrothermicArmor.InfernoDamage); // https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list var source = Player.GetSource_FromThis(HydrothermicArmor.InfernoPotionEntitySourceContext); - float range = 300f; + float range = HydrothermicArmor.InfernoRange; foreach (NPC npc in Main.ActiveNPCs) { @@ -4318,7 +4372,7 @@ namespace CalamityMod.CalPlayer for (int l = 0; l < Player.MaxBuffs; l++) { int buffID = Player.buffType[l]; - if (AmalgamBuffList.Includes(buffID)) + if (CalamityBuffSets.BuffedByAmalgam[buffID]) { if (amalgam) { @@ -4335,7 +4389,7 @@ namespace CalamityMod.CalPlayer else { // Reset buff persistence if Amalgam is removed. - if (Main.persistentBuff[buffID] && !PersistentBuffList.Includes(buffID)) + if (Main.persistentBuff[buffID] && !CalamityBuffSets.IsPersistentBuff[buffID]) Main.persistentBuff[buffID] = false; } } @@ -4828,30 +4882,13 @@ namespace CalamityMod.CalPlayer } if (DesertProwlerHat.ShroudedInSmoke(Player, out _)) - Player.statDefense -= (int)(Player.statDefense * 0.75); + Player.statDefense -= (int)(Player.statDefense * DesertProwlerHat.SmokeDefenseMult); } #endregion #region Limits private void Limits() { - // TODO -- what is Forbidden Circlet actually supposed to do? - if (forbiddenCirclet) - { - ref StatModifier summon = ref Player.GetDamage(); - ref StatModifier rogue = ref Player.GetDamage(); - float boostToSummonFromRogue = 0f; - float boostToRogueFromSummon = 0f; - - if (summon.Additive < rogue.Additive) - boostToSummonFromRogue = rogue.Additive - summon.Additive; - if (rogue.Additive < summon.Additive) - boostToRogueFromSummon = summon.Additive - rogue.Additive; - - summon += boostToSummonFromRogue; - rogue += boostToRogueFromSummon; - } - // 10% is converted to 9%, 25% is converted to 20%, 50% is converted to 33%, 75% is converted to 43%, 100% is converted to 50% if (Player.endurance > 0f) Player.endurance = 1f - (1f / (1f + Player.endurance)); diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 27f523ec14..913ce63b59 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -5,10 +5,19 @@ using CalamityMod.Balancing; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.Summon.Whips; using CalamityMod.Cooldowns; using CalamityMod.Dusts; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor; +using CalamityMod.Items.Armor.Astral; +using CalamityMod.Items.Armor.Hydrothermic; +using CalamityMod.Items.Armor.Plaguebringer; using CalamityMod.Items.Armor.Reaver; +using CalamityMod.Items.Armor.SnowRuffian; +using CalamityMod.Items.Armor.Sulphurous; +using CalamityMod.Items.Armor.TitanHeart; +using CalamityMod.Items.Armor.Umbraphile; using CalamityMod.Items.Fishing.AstralCatches; using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.NPCs; @@ -234,25 +243,12 @@ namespace CalamityMod.CalPlayer if (witheringWeaponEnchant) witheringDamageDone += (int)(damageDone * (hit.Crit ? 2D : 1D)); - - cgn.IncreasedColdEffects_EskimoSet = eskimoSet; - cgn.IncreasedColdEffects_CryoStone = CryoStone; - - cgn.IncreasedElectricityEffects_Unused = false; - - cgn.IncreasedHeatEffects_Fireball = fireball; - cgn.IncreasedHeatEffects_CinnamonRoll = cinnamonRoll; - cgn.IncreasedHeatEffects_FireBoots = bootLevel; - - cgn.IncreasedSicknessEffects_ToxicHeart = toxicHeart; - - cgn.IncreasedWaterEffects_Amulet1 = sSpiritAmulet; - cgn.IncreasedWaterEffects_Amulet2 = dOfTheDeep; - - cgn.IncreasedSicknessAndWaterEffects_EvergreenGin = evergreenGin; - cgn.IncreasedSicknessAndWaterEffects_CorrosiveSpine = corrosiveSpine; - - cgn.IncreasedDebuffEffects_Amalgam = amalgam; + cgn.TypelessDebuffMultiplier = TypelessDebuffMultiplier; + cgn.HeatDebuffMultiplier = HeatDebuffMultiplier; + cgn.ColdDebuffMultiplier = ColdDebuffMultiplier; + cgn.SicknessDebuffMultiplier = SicknessDebuffMultiplier; + cgn.WaterDebuffMultiplier = WaterDebuffMultiplier; + cgn.ElectricDebuffMultiplier = ElectricDebuffMultiplier; switch (proj.type) { @@ -413,10 +409,15 @@ namespace CalamityMod.CalPlayer globalProj.arcFlashCooldown = 30; } + if (forbiddenCirclet && globalProj.stealthStrike) + { + target.AddBuff(ModContent.BuffType(), ForbiddenCirclet.TagDuration); + } + if (!proj.npcProj && !proj.trap && proj.friendly) { - if (plaguebringerCarapace && FriendlyBeesList.Includes(proj.type)) - target.AddBuff(BuffType(), 300); + if (plaguebringerPatronSet && CalamityProjectileSets.IsFriendlyBeeProjectile[proj.type]) + target.AddBuff(BuffType(), PlaguebringerVisor.BeePlagueDuration); // All projectiles fired from Soma Prime are marked using CalamityGlobalProjectile CalamityGlobalProjectile cgp = proj.Calamity(); @@ -630,7 +631,7 @@ namespace CalamityMod.CalPlayer } if (astralStarRain && crit && astralStarRainCooldown <= 0) { - astralStarRainCooldown = 60; + astralStarRainCooldown = AstralHelm.StarRainCooldown; for (int n = 0; n < 3; n++) { int projectileType = Utils.SelectRandom(Main.rand, new int[] @@ -641,7 +642,7 @@ namespace CalamityMod.CalPlayer ProjectileID.StarCannonStar }); - int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(120); + int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(AstralHelm.StarDamage); Projectile star = CalamityUtils.ProjectileRain(source, position, 400f, 100f, 500f, 800f, 12f, projectileType, astralStarDamage, 5f, Player.whoAmI); if (star.whoAmI.WithinBounds(Main.maxProjectiles)) @@ -654,12 +655,10 @@ namespace CalamityMod.CalPlayer { if (npcCheck) { - if (ataxiaGeyser && Player.ownedProjectileCounts[ProjectileType()] < 3) + if (ataxiaGeyser && Player.ownedProjectileCounts[ProjectileType()] < HydrothermicHeadMelee.GeyserCountLimit) { - // Ataxia True Melee Geysers: 15%, softcap starts at 300 base damage - int geyserDamage = CalamityUtils.DamageSoftCap(damage * 0.15, 45); - - Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType(), geyserDamage, 2f, Player.whoAmI, 0f, 0f); + int geyserDamage = CalamityUtils.DamageSoftCap(damage * HydrothermicHeadMelee.GeyserDamageRatio, HydrothermicHeadMelee.GeyserDamageSoftcap); + Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType(), geyserDamage, 2f, Player.whoAmI); } if (bloodflareMelee && item.CountsAsClass() && bloodflareMeleeHits < 15 && !bloodflareFrenzy && !Player.HasCooldown(BloodflareFrenzy.ID)) @@ -700,7 +699,7 @@ namespace CalamityMod.CalPlayer { if (astralStarRain && crit && astralStarRainCooldown <= 0) { - astralStarRainCooldown = 60; + astralStarRainCooldown = AstralHelm.StarRainCooldown; for (int n = 0; n < 3; n++) { int projectileType = Utils.SelectRandom(Main.rand, new int[] @@ -711,7 +710,7 @@ namespace CalamityMod.CalPlayer ProjectileID.StarCannonStar }); - int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(120); + int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(AstralHelm.StarDamage); Projectile star = CalamityUtils.ProjectileRain(source, position, 400f, 100f, 500f, 800f, 25f, projectileType, astralStarDamage, 5f, Player.whoAmI); if (star.whoAmI.WithinBounds(Main.maxProjectiles)) @@ -838,10 +837,10 @@ namespace CalamityMod.CalPlayer var source = proj.GetSource_FromThis(); if (ataxiaMage && ataxiaDmg <= 0) { - int orbDamage = (int)(proj.damage * 0.6f); + int orbDamage = (int)(proj.damage * HydrothermicHeadMagic.OrbDamageRatio); CalamityUtils.SpawnOrb(proj, orbDamage, ProjectileType(), 800f, 20f); - int cooldown = (int)(orbDamage * 0.5); + int cooldown = (int)(orbDamage * HydrothermicHeadMagic.OrbDamageCooldownMult); ataxiaDmg += cooldown; } if (tarraMage && crit) @@ -1070,7 +1069,7 @@ namespace CalamityMod.CalPlayer { Vector2 source = new Vector2(position.X + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); Vector2 velocity = (position - source) / 40f; - int damage = (int)Player.GetTotalDamage().ApplyTo(95); + int damage = (int)Player.GetTotalDamage().ApplyTo(110); Projectile.NewProjectile(spawnSource, source, velocity, ProjectileType(), damage, 3f, proj.owner); } } @@ -1111,26 +1110,9 @@ namespace CalamityMod.CalPlayer rogueCrownCooldown = spawnedFeathers ? 15 : 60; } - if (forbiddenCirclet && modProj.stealthStrike && forbiddenCooldown <= 0 && modProj.stealthStrikeHitCount < 3) - { - for (int index2 = 0; index2 < 6; index2++) - { - float xVector = Main.rand.Next(-35, 36) * 0.02f; - float yVector = Main.rand.Next(-35, 36) * 0.02f; - xVector *= 10f; - yVector *= 10f; - int damage = (int)Player.GetTotalDamage().ApplyTo(40); - - int eater = Projectile.NewProjectile(spawnSource, proj.Center.X, proj.Center.Y, xVector, yVector, ProjectileType(), damage, proj.knockBack, proj.owner); - if (eater.WithinBounds(Main.maxProjectiles)) - Main.projectile[eater].DamageType = DamageClass.Generic; - forbiddenCooldown = 15; - } - } - if (titanHeartSet && modProj.stealthStrike && titanCooldown <= 0 && modProj.stealthStrikeHitCount < 3) { - int damage = (int)Player.GetTotalDamage().ApplyTo(40); + int damage = (int)Player.GetTotalDamage().ApplyTo(TitanHeartMask.ExplosionDamage); Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType(), damage, proj.knockBack, proj.owner, 1f, 0f); SoundEngine.PlaySound(SoundID.Item14, proj.Center); @@ -1160,9 +1142,7 @@ namespace CalamityMod.CalPlayer // Umbraphile cannot trigger off of itself. It is guaranteed on stealth strikes and 20% chance otherwise. if (umbraphileSet && ((modProj.stealthStrike && modProj.stealthStrikeHitCount < 3) || Main.rand.NextBool(5))) { - // Umbraphile Rogue Blasts: 20%, softcap starts at 50 base damage - int umbraBlastDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.20, 50); - + int umbraBlastDamage = CalamityUtils.DamageSoftCap(proj.damage * UmbraphileHood.ExplosionDamageRatio, UmbraphileHood.ExplosionDamageSoftcap); Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType(), umbraBlastDamage, 0f, Player.whoAmI); } if (electricianGlove && modProj.stealthStrike && modProj.stealthStrikeHitCount < 3) @@ -1195,10 +1175,6 @@ namespace CalamityMod.CalPlayer { CalamityUtils.Inflict246DebuffsNPC(target, BuffType()); } - if (ataxiaFire) - { - CalamityUtils.Inflict246DebuffsNPC(target, BuffID.OnFire3, 4f); - } } if ((melee || rogue || whip) && !noFlask) { @@ -1243,7 +1219,7 @@ namespace CalamityMod.CalPlayer } if (titanHeartMask) { - target.AddBuff(BuffType(), 120); + target.AddBuff(BuffType(), TitanHeartMask.OnHitDebuffDuration); } } if (summon) @@ -1293,7 +1269,7 @@ namespace CalamityMod.CalPlayer if (omegaBlueChestplate) target.AddBuff(BuffType(), 180); if (sulphurSet) - target.AddBuff(BuffID.Poisoned, 60); + target.AddBuff(BuffID.Poisoned, SulphurousHelmet.SetBonusPoisonDuration); if (ilSpark && Player.Calamity().countsAsAnyWet) { int duration = 60; @@ -1313,7 +1289,7 @@ namespace CalamityMod.CalPlayer } if (snowRuffianSet && ranged && crit) { - target.AddBuff(BuffID.Frostburn, 300, false); + target.AddBuff(BuffID.Frostburn, SnowRuffianMask.SetBonusFrostburnDuration, false); } } #endregion @@ -1370,8 +1346,8 @@ namespace CalamityMod.CalPlayer if (ataxiaMage) { - double healMult = 0.1D - proj.numHits * 0.05D; - Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(damage * healMult), 1.25f); + double healMult = HydrothermicHeadMagic.OrbHealingRatio - proj.numHits * HydrothermicHeadMagic.OrbHealingRatioLossPerPierce; + Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(damage * healMult), HydrothermicHeadMagic.OrbHealingCooldownMult); } } } diff --git a/CalPlayer/Dashes/PlaguebringerArmorDash.cs b/CalPlayer/Dashes/PlaguebringerArmorDash.cs index df2248ff57..bcce9288bc 100644 --- a/CalPlayer/Dashes/PlaguebringerArmorDash.cs +++ b/CalPlayer/Dashes/PlaguebringerArmorDash.cs @@ -1,6 +1,6 @@ using System; using CalamityMod.Enums; -using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor.Plaguebringer; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -61,12 +61,12 @@ namespace CalamityMod.CalPlayer.Dashes if (player.velocity.X != 0f) hitDirection = Math.Sign(player.velocity.X); hitContext.HitDirection = hitDirection; - hitContext.PlayerImmunityFrames = AsgardsValor.ShieldSlamIFrames; + hitContext.PlayerImmunityFrames = PlaguebringerVisor.PlagueDashIFrames; // Define damage parameters. hitContext.damageClass = DamageClass.Summon; - hitContext.BaseDamage = 50; - hitContext.BaseKnockback = 3f; + hitContext.BaseDamage = PlaguebringerVisor.PlagueDashDamage; + hitContext.BaseKnockback = PlaguebringerVisor.PlagueDashKnockback; } } } diff --git a/CalPlayer/Dashes/StatisNinjaBeltDash.cs b/CalPlayer/Dashes/StatisNinjaBeltDash.cs index 30bc2a144d..2f836c3d9a 100644 --- a/CalPlayer/Dashes/StatisNinjaBeltDash.cs +++ b/CalPlayer/Dashes/StatisNinjaBeltDash.cs @@ -15,24 +15,11 @@ namespace CalamityMod.CalPlayer.Dashes public override DashCollisionType CollisionType => DashCollisionType.NoCollision; public override bool IsOmnidirectional => false; public int Time = 0; - public int lastDashDir = 0; - public override float CalculateDashSpeed(Player player) => (55f * player.moveSpeed); + public override float CalculateDashSpeed(Player player) => (48f); public override void OnDashEffects(Player player) { - if (Math.Sign(player.velocity.X) == lastDashDir && lastDashDir != 0) - { - player.Calamity().statisPenaltyTimer = player.Calamity().statisTimerMax; - if (player.Calamity().statisAnticheese < 6) - player.Calamity().statisAnticheese++; - } - else - player.Calamity().statisAnticheese = 0; - if (player.Calamity().statisAnticheese > 1) - player.velocity.X *= Utils.Remap(player.Calamity().statisAnticheese, 1, 6, 0.9f, 0.3f, true); - lastDashDir = Math.Sign(player.velocity.X); - lastDashDir = Math.Sign(player.velocity.X); Time = 0; for (int i = 0; i < 15; i++) @@ -78,7 +65,7 @@ namespace CalamityMod.CalPlayer.Dashes { player.velocity.X = -140; } - if (Time > 6) + if (Time > 8) player.velocity.X *= 0.5f; } } diff --git a/CalPlayer/Dashes/StatisVoidSashDash.cs b/CalPlayer/Dashes/StatisVoidSashDash.cs index 05cb3aaf9e..86fa30e36a 100644 --- a/CalPlayer/Dashes/StatisVoidSashDash.cs +++ b/CalPlayer/Dashes/StatisVoidSashDash.cs @@ -24,23 +24,11 @@ namespace CalamityMod.CalPlayer.Dashes public int Time = 0; public Vector2 aimVel; public bool strongVisuals = true; - public int lastDashDir = 0; - public override float CalculateDashSpeed(Player player) => (70f * player.moveSpeed); + public override float CalculateDashSpeed(Player player) => (64f); public override void OnDashEffects(Player player) { - if (Math.Sign(player.velocity.X) == lastDashDir && lastDashDir != 0) - { - player.Calamity().statisPenaltyTimer = player.Calamity().statisTimerMax; - if (player.Calamity().statisAnticheese < 6) - player.Calamity().statisAnticheese++; - } - else - player.Calamity().statisAnticheese = 0; - if (player.Calamity().statisAnticheese > 1) - player.velocity.X *= Utils.Remap(player.Calamity().statisAnticheese, 1, 6, 0.9f, 0.3f, true); - lastDashDir = Math.Sign(player.velocity.X); strongVisuals = player.Calamity().voidSashVisuals; Time = 0; @@ -52,7 +40,7 @@ namespace CalamityMod.CalPlayer.Dashes SoundEngine.PlaySound(sound with { Volume = 0.7f, Pitch = Main.rand.NextFloat(-0.15f, 0.15f) }, player.Center); for (int i = 0; i < 40; i++) { - Vector2 intenededVel = (MathHelper.TwoPi * i / 40f).ToRotationVector2() * 5.5f; + Vector2 intenededVel = (MathHelper.TwoPi * i / 40f).ToRotationVector2() * 3f; Vector2 fxVel = new Vector2(intenededVel.X, intenededVel.Y * 2.3f).RotatedBy(player.velocity.ToRotation()); Vector2 fxPlace = player.Center + fxVel.RotatedBy(player.velocity.ToRotation()) + player.velocity.SafeNormalize(Vector2.UnitX) * 60; @@ -61,8 +49,8 @@ namespace CalamityMod.CalPlayer.Dashes } for (int i = 0; i < 30; i++) { - Vector2 intenededVel = (MathHelper.TwoPi * i / 30f).ToRotationVector2() * 5.5f; - Vector2 fxVel = new Vector2(intenededVel.X, intenededVel.Y * 2.3f).RotatedBy(player.velocity.ToRotation()); + Vector2 intenededVel = (MathHelper.TwoPi * i / 30f).ToRotationVector2() * 3f; + Vector2 fxVel = new Vector2(intenededVel.X, intenededVel.Y * 2f).RotatedBy(player.velocity.ToRotation()); Vector2 fxPlace = player.Center + fxVel.RotatedBy(player.velocity.ToRotation()) + player.velocity.SafeNormalize(Vector2.UnitX) * 60; Color dustColor = Main.rand.NextBool(3) ? Color.Indigo : Color.DarkOrchid; @@ -109,7 +97,7 @@ namespace CalamityMod.CalPlayer.Dashes SignusMetaball.SpawnParticle(fxPlace, fxVelocity * Main.rand.NextFloat(5, 8), 50f * Main.rand.NextFloat(0.7f, 1f), 8, new Vector2(0.8f, 1.2f), 0.18f, 0); } } - player.velocity.X *= 0.912f; + player.velocity.X *= 0.95f; if (player.velocity.X > 140) { player.velocity.X = 140; @@ -118,7 +106,7 @@ namespace CalamityMod.CalPlayer.Dashes { player.velocity.X = -140; } - if (Time > 8) + if (Time > 10) player.velocity.X *= 0.5f; } } diff --git a/CalPlayer/DrawLayers/ForbiddenSignLayer.cs b/CalPlayer/DrawLayers/ForbiddenSignLayer.cs index 288ee55479..86e2ac60be 100644 --- a/CalPlayer/DrawLayers/ForbiddenSignLayer.cs +++ b/CalPlayer/DrawLayers/ForbiddenSignLayer.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -11,7 +12,7 @@ namespace CalamityMod.CalPlayer.DrawLayers { public class ForbiddenSignLayer : PlayerDrawLayer { - public override Position GetDefaultPosition() => new BeforeParent(PlayerDrawLayers.Skin); + public override Position GetDefaultPosition() => new BeforeParent(PlayerDrawLayers.ForbiddenSetRing); public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) { @@ -23,45 +24,37 @@ namespace CalamityMod.CalPlayer.DrawLayers protected override void Draw(ref PlayerDrawSet drawInfo) { Player drawPlayer = drawInfo.drawPlayer; - SpriteEffects spriteEffects; - if (drawPlayer.direction == 1) - spriteEffects = SpriteEffects.None; - else spriteEffects = SpriteEffects.FlipHorizontally; - - if (drawPlayer.gravDir != 1f) - spriteEffects |= SpriteEffects.FlipVertically; - - int dyeShader = 0; - if (drawPlayer.dye[1] != null) - dyeShader = drawPlayer.dye[1].dye; - - Color baseColor = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int)drawInfo.Center.X / 16, (int)drawInfo.Center.Y / 16, Color.White), drawInfo.shadow); - Color color = Color.Lerp(baseColor, Color.White, 0.7f); + Color color = Color.Lerp(drawInfo.colorArmorBody, Color.White, 0.7f); Texture2D texture = TextureAssets.Extra[ExtrasID.ForbiddenSign].Value; Texture2D glowmask = TextureAssets.GlowMask[GlowMaskID.ForbiddenSign].Value; - float offsetY = (float)Math.Sin(drawPlayer.miscCounter / 300f * MathHelper.TwoPi) * 6f; - float sinusoidalTime = (float)Math.Cos(drawPlayer.miscCounter / 75f * MathHelper.TwoPi); - Color afterimageColor = new Color(80, 70, 40, 0) * (sinusoidalTime * 0.5f + 0.5f) * 0.8f; - float gravCheckOffset = drawPlayer.gravDir != 1f ? -20f : 20f; + int offsetY = (int)(MathF.Sin(drawPlayer.miscCounter / 300f * MathHelper.TwoPi) * 6f); + float shadowMult = MathF.Cos(drawPlayer.miscCounter / 75f * MathHelper.TwoPi) * 4f; + Color afterimageColor = new Color(80, 70, 40, 0) * (shadowMult * 0.125f + 0.5f) * 0.8f; - Vector2 position = new Vector2(drawInfo.Center.X - drawPlayer.bodyFrame.Width / 2 + drawPlayer.width / 2, drawInfo.Center.Y + drawPlayer.height - drawPlayer.bodyFrame.Height + 4f) + drawPlayer.bodyPosition; - position += new Vector2(drawPlayer.bodyFrame.Width / 2, drawPlayer.bodyFrame.Height / 2) + new Vector2(-drawPlayer.direction * 10, offsetY - gravCheckOffset); - position -= Main.screenPosition + drawPlayer.Size * 0.5f; + if (drawPlayer.ownedProjectileCounts[ModContent.ProjectileType()] > 1) + { + offsetY = 0; + shadowMult = 2f; + afterimageColor = new Color(80, 70, 40, 0) * 0.3f; + color = color.MultiplyRGB(new Color(0.5f, 0.5f, 1f)); + } + + Vector2 drawPos = drawInfo.Position + drawPlayer.bodyPosition - Main.screenPosition; + drawPos += new Vector2(drawPlayer.width * 0.5f - drawPlayer.direction * 10f, drawPlayer.height - drawPlayer.bodyFrame.Height * 0.5f + 4f + drawPlayer.gravDir * (offsetY - 20f)); // Draw the original sign. - DrawData drawData = new(texture, position, null, color, drawPlayer.bodyRotation, texture.Size() * 0.5f, 1f, spriteEffects, 0) + DrawData drawData = new(texture, drawPos, null, color, drawPlayer.bodyRotation, texture.Size() * 0.5f, 1f, drawInfo.playerEffect) { - shader = dyeShader + shader = drawInfo.cBody }; drawInfo.DrawDataCache.Add(drawData); // Draw 4 semi-transparent copies. - float timeX4 = sinusoidalTime * 4f; Vector2 origin = texture.Size() * 0.5f; for (float i = 0f; i < 4f; i++) { float angle = MathHelper.PiOver2 * i; - drawData = new(glowmask, position + angle.ToRotationVector2() * timeX4, null, afterimageColor, drawPlayer.bodyRotation, origin, 1f, spriteEffects, 0); + drawData = new(glowmask, drawPos + angle.ToRotationVector2() * shadowMult, null, afterimageColor, drawPlayer.bodyRotation, origin, 1f, drawInfo.playerEffect); drawInfo.DrawDataCache.Add(drawData); } } diff --git a/CalamityConditions.cs b/CalamityConditions.cs index b402f2a872..8fdfb0d11e 100644 --- a/CalamityConditions.cs +++ b/CalamityConditions.cs @@ -21,7 +21,6 @@ namespace CalamityMod public static readonly Condition PlayerHasRogueArmor = Create("HasRogueArmor", () => Main.LocalPlayer.Calamity().rogueStealthMax > 0f && Main.LocalPlayer.Calamity().wearingRogueArmor); public static readonly Condition PlayerHasWings = Create("HasWings", () => Main.LocalPlayer.wingTimeMax > 0); - public static readonly Condition PlayerAlcoholPoisoned = Create("AlcoholPoison", () => Main.LocalPlayer.Calamity().alcoholPoisoning); // // Calamity Event Flag conditions diff --git a/CalamityConfig.cs b/CalamityConfig.cs index 8b9662f7ff..e56acc7a3f 100644 --- a/CalamityConfig.cs +++ b/CalamityConfig.cs @@ -1,6 +1,7 @@ using System.ComponentModel; using System.Reflection; using System.Runtime.Serialization; +using CalamityMod.Enums; using CalamityMod.UI; using CalamityMod.UI.DraedonsArsenal; using CalamityMod.UI.Rippers; @@ -27,24 +28,6 @@ namespace CalamityMod ParticleLimit = (int)Utils.Clamp(ParticleLimit, MinParticleLimit, MaxParticleLimit); } - internal static void SaveConfig() - { - // There is no current way to manually save a mod configuration file in tModLoader. - // The method which saves mod config files is private in ConfigManager, so reflection is used to invoke it. - try - { - MethodInfo saveMethodInfo = typeof(ConfigManager).GetMethod("Save", BindingFlags.Static | BindingFlags.NonPublic); - if (saveMethodInfo is not null) - saveMethodInfo.Invoke(null, [Instance]); - else - CalamityMod.Instance.Logger.Error("TML ConfigManager.Save reflection failed. Method signature has changed. Notify Calamity Devs if you see this in your log."); - } - catch - { - CalamityMod.Instance.Logger.Error("An error occurred while manually saving Calamity mod configuration. This may be due to a complex mod conflict. It is safe to ignore this error."); - } - } - #region Graphics Changes [Header("Graphics")] @@ -287,8 +270,10 @@ namespace CalamityMod public bool FasterFallHotkey { get; set; } [BackgroundColor(192, 54, 64, 192)] - [DefaultValue(true)] - public bool CalamityArmorSetBonusDoubleTap { get; set; } + [SliderColor(224, 165, 56, 128)] + [DrawTicks] + [DefaultValue(SetBonusDoubleTapOptions.Auto)] + public SetBonusDoubleTapOptions SetBonusDoubleTap { get; set; } [BackgroundColor(192, 54, 64, 192)] [DefaultValue(false)] diff --git a/CalamityMod.csproj b/CalamityMod.csproj index 06a7b9a67d..83b5750ac1 100644 --- a/CalamityMod.csproj +++ b/CalamityMod.csproj @@ -1,13 +1,5 @@ - + - - CalamityMod - net8.0 - AnyCPU - latest - - - - + diff --git a/Cooldowns/BubblyBurrow.cs b/Cooldowns/BubblyBurrow.cs new file mode 100644 index 0000000000..0ff4d6f13b --- /dev/null +++ b/Cooldowns/BubblyBurrow.cs @@ -0,0 +1,78 @@ +using System; +using CalamityMod.Items.Armor.Victide; +using CalamityMod.UI; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.Localization; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Cooldowns +{ + public class BubblyBurrow : CooldownHandler + { + public bool PowerActive => instance.timeLeft > VictideHeadBurrow.BurrowCooldown; + public float PowerPercent => (instance.timeLeft - VictideHeadBurrow.BurrowCooldown) / (float)VictideHeadBurrow.BurrowDuration; + + public static new string ID => "BubblyBurrow"; + public override bool ShouldDisplay => true; + public override LocalizedText DisplayName => CalamityUtils.GetText("UI.Cooldowns.BubblyBurrow" + (PowerActive ? "Active" : "Cooldown")); + public override string Texture => PowerActive ? "CalamityMod/Cooldowns/BubblyBurrow" : "CalamityMod/Cooldowns/BubblyBurrowCooldown"; + public override string OutlineTexture => "CalamityMod/Cooldowns/BubblyBurrowOutline"; + public override string OverlayTexture => "CalamityMod/Cooldowns/BubblyBurrowOverlay"; + public override Color OutlineColor => new Color(158, 158, 255); + public override Color CooldownStartColor => PowerActive ? Color.Lerp(new Color(255, 170, 204), new Color(72, 125, 204), PowerPercent) : new Color(72, 125, 204); + public override Color CooldownEndColor => PowerActive ? Color.Lerp(new Color(255, 170, 204), new Color(97, 255, 255), PowerPercent) : new Color(97, 255, 255); + public override SoundStyle? EndSound => SoundID.Item85; + + public override void OnCompleted() + { + Vector2 playerVelocity = instance.player.velocity / 8f; + if (!Main.dedServ) + { + for (int i = 0; i < 16; i++) + { + Vector2 bubblePos = instance.player.MountedCenter + Main.rand.NextVector2Circular(50f, 50f); + Vector2 bubbleSpeed = Main.rand.NextVector2Circular(1f, 1f) + playerVelocity; + Gore bubble = Gore.NewGoreDirect(instance.player.GetSource_Misc("1"), bubblePos, bubbleSpeed, 411, Main.rand.NextFloat(0.8f, 1.6f)); + bubble.timeLeft = 24 + Main.rand.Next(13); + bubble.type = 411; + } + } + } + + //Charge down at first, and then charge back up + private float AdjustedCompletion => CooldownRackUI.DebugFullDisplay ? CooldownRackUI.DebugForceCompletion : PowerActive ? PowerPercent : 1 - (instance.timeLeft / (float)VictideHeadBurrow.BurrowCooldown); + + public override void ApplyBarShaders(float opacity) + { + //Use the adjusted completion + GameShaders.Misc["CalamityMod:CircularBarShader"].UseOpacity(opacity); + GameShaders.Misc["CalamityMod:CircularBarShader"].UseSaturation(AdjustedCompletion); + GameShaders.Misc["CalamityMod:CircularBarShader"].UseColor(CooldownStartColor); + GameShaders.Misc["CalamityMod:CircularBarShader"].UseSecondaryColor(CooldownEndColor); + GameShaders.Misc["CalamityMod:CircularBarShader"].Apply(); + } + + public override void DrawCompact(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) + { + Texture2D sprite = Request(Texture).Value; + Texture2D outline = Request(OutlineTexture).Value; + Texture2D overlay = Request(OverlayTexture).Value; + + //Draw the outline + spriteBatch.Draw(outline, position, null, OutlineColor * opacity, 0, outline.Size() * 0.5f, scale, SpriteEffects.None, 0f); + + //Draw the icon + spriteBatch.Draw(sprite, position, null, Color.White * opacity, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f); + + //Draw the small overlay + int lostHeight = (int)Math.Ceiling(overlay.Height * AdjustedCompletion); + Rectangle crop = new Rectangle(0, lostHeight, overlay.Width, overlay.Height - lostHeight); + spriteBatch.Draw(overlay, position + Vector2.UnitY * lostHeight * scale, crop, OutlineColor * opacity * 0.9f, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f); + } + } +} diff --git a/Cooldowns/BubblyBurrow.png b/Cooldowns/BubblyBurrow.png new file mode 100644 index 0000000000..21b3a91620 Binary files /dev/null and b/Cooldowns/BubblyBurrow.png differ diff --git a/Cooldowns/BubblyBurrowCooldown.png b/Cooldowns/BubblyBurrowCooldown.png new file mode 100644 index 0000000000..2fd459cd2e Binary files /dev/null and b/Cooldowns/BubblyBurrowCooldown.png differ diff --git a/Cooldowns/BubblyBurrowOutline.png b/Cooldowns/BubblyBurrowOutline.png new file mode 100644 index 0000000000..76c2b5b9f7 Binary files /dev/null and b/Cooldowns/BubblyBurrowOutline.png differ diff --git a/Cooldowns/BubblyBurrowOverlay.png b/Cooldowns/BubblyBurrowOverlay.png new file mode 100644 index 0000000000..5327154aa6 Binary files /dev/null and b/Cooldowns/BubblyBurrowOverlay.png differ diff --git a/Cooldowns/WardingWave.cs b/Cooldowns/WardingWave.cs new file mode 100644 index 0000000000..1a52fd7d48 --- /dev/null +++ b/Cooldowns/WardingWave.cs @@ -0,0 +1,21 @@ +using System; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.Localization; + +namespace CalamityMod.Cooldowns +{ + public class WardingWave : CooldownHandler + { + public static new string ID => "WardingWave"; + public override bool ShouldDisplay => true; + public override LocalizedText DisplayName => CalamityUtils.GetText("UI.Cooldowns.WardingWave"); + public override string Texture => "CalamityMod/Cooldowns/WardingWave"; + public override Color OutlineColor => new Color(158, 158, 255); + public override Color CooldownStartColor => new Color(72, 125, 204); + public override Color CooldownEndColor => new Color(97, 200, 255); + public override SoundStyle? EndSound => SoundID.Item85; + } +} diff --git a/Cooldowns/WardingWave.png b/Cooldowns/WardingWave.png new file mode 100644 index 0000000000..6e578a359e Binary files /dev/null and b/Cooldowns/WardingWave.png differ diff --git a/Cooldowns/WardingWaveOutline.png b/Cooldowns/WardingWaveOutline.png new file mode 100644 index 0000000000..558164d44e Binary files /dev/null and b/Cooldowns/WardingWaveOutline.png differ diff --git a/Cooldowns/WardingWaveOverlay.png b/Cooldowns/WardingWaveOverlay.png new file mode 100644 index 0000000000..4bc05e7014 Binary files /dev/null and b/Cooldowns/WardingWaveOverlay.png differ diff --git a/DataStructures/DebuffData.cs b/DataStructures/DebuffData.cs new file mode 100644 index 0000000000..56ba9e5c0a --- /dev/null +++ b/DataStructures/DebuffData.cs @@ -0,0 +1,410 @@ +using System; +using System.Diagnostics; +using System.Security.Cryptography; +using CalamityMod.NPCs; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.DataStructures +{ + [ReinitializeDuringResizeArrays] + public static class BuffDatasets + { + public static DebuffData[] DebuffDataset = BuffID.Sets.Factory.CreateNamedSet("DebuffData") + .Description("Stores DebuffData for a particular debuff") + .RegisterCustomSet(null, + BuffID.OnFire, DebuffData.OnFire, + BuffID.OnFire3, DebuffData.Hellfire, + BuffID.CursedInferno, DebuffData.CursedInferno, + BuffID.ShadowFlame, DebuffData.Shadowflame, + BuffID.Daybreak, DebuffData.Daybroken, + BuffID.Frostburn, DebuffData.Frostburn, + BuffID.Frostburn2, DebuffData.Frostbite, + BuffID.Poisoned, DebuffData.Poisoned, + BuffID.Venom, DebuffData.AcidVenom, + BuffID.Electrified, DebuffData.Electrified + ); + } + public class DebuffData + { + /// + /// Determines the behavior of the debuff. + /// + public enum DebuffBehavior + { + Default, + Electric + } + #region DebuffData data + /// + /// UNIMPLEMENTED. WILL BE DONE IN A FUTURE PR + /// Amount of life regen lost by a player under this debuff + /// For debuffs with unique scaling, this should usually be the "base" amount. + /// Defaults to 0 + /// + public float PlayerLostRegen = 0; + + /// + /// Amount of life regen lost by an enemy under this debuff. + /// For debuffs with unique scaling, this should usually be the "base" amount. + /// Defaults to 0 + /// + public float EnemyLostRegen = 0; + + /// + /// This is used to cancel Vanilla DoT damage on enemies and allow using Calamity's own instead. + /// + public int EnemyVanillaRegenToCancelOut = 0; + + /// + /// The minimum size of damage ticks from this debuff on an enemy. + /// Ticks can be larger than this due to MultiplierDamageTickSize + /// Defaults to 1 + /// + public int MinimumDamageTickSize = 1; + + /// + /// The size of damage ticks from this debuff on an enemy + /// This is based on the applied regen of the debuff, and will cause the tick to scale with amplifiers + /// Ticks can be larger than this due to MinimumDamageTickSize + /// Defaults to 0.25f + /// + public float MultiplierDamageTickSize = 0.25f; + + /// + /// How much this benefits from heat debuff amplifiers. + /// Default is 0, which means it does not benefit. + /// + public float HeatDebuffScaling = 0; + /// + /// How much this benefits from sickness debuff amplifiers. + /// Default is 0, which means it does not benefit. + /// + public float SicknessDebuffScaling = 0; + /// + /// How much this benefits from cold debuff amplifiers. + /// Default is 0, which means it does not benefit. + /// + public float ColdDebuffScaling = 0; + /// + /// How much this benefits from water debuff amplifiers. + /// Default is 0, which means it does not benefit. + /// + public float WaterDebuffScaling = 0; + /// + /// How much this benefits from electric debuff amplifiers. + /// Default is 0, which means it does not benefit. + /// + public float ElectricDebuffScaling = 0; + + /// + /// UNIMPLEMENTED. WILL BE DONE IN A FUTURE PR + /// Whether or not this debuff should draw above inflicted NPCs. + /// Defaults to TRUE + /// + public bool DrawAboveNPC = true; + + /// + /// UNIMPLEMENTED. WILL BE DONE IN A FUTURE PR + /// Whether or not gear can modify the debuff effects such as duration or damage on the player. + /// + public bool GearCanModifyDebuff = true; + + /// + /// UNIMPLEMENTED. WILL BE DONE IN A FUTURE PR + /// How much alcohol this counts as. + /// Default is 0, most alcohol is 1, and Everclear is 2 + /// + public float AlcoholLevel = 0f; + + /// + /// UNIMPLEMENTED. WILL BE DONE IN A FUTURE PR + /// The UpdatePlayerLifeRegen code to run. Defaults to just applying DoT + /// + public UpdatePlayerLifeRegen PlayerUpdateMethod; + + /// + /// The UpdateNPCLifeRegen code to run. Defaults to just applying DoT + /// Parameters of the method should be (NPC npc, int buffType, ref int buffIndex, ref int damage) + /// + public UpdateNPCLifeRegen NPCLifeRegenMethod; + + public DebuffData() + { + PlayerUpdateMethod = DefaultUpdateOnPlayer; + NPCLifeRegenMethod = BaseUpdateNPCLifeRegen; + } + /// + /// Allows using DebuffBehavior to determine preset behavior + /// "electric" causes debuffs to scale 4x when moving + /// Uses default behavior if no known key is inputed + /// + /// This determines the type of behavior of the debuff + public DebuffData(DebuffBehavior behavior) + { + + PlayerUpdateMethod = DefaultUpdateOnPlayer; + if (behavior == DebuffBehavior.Electric) + NPCLifeRegenMethod = ElectricDebuffNPCLifeRegen; + else + NPCLifeRegenMethod = BaseUpdateNPCLifeRegen; + } + + /// + /// UNIMPLEMENTED. WILL BE IN A FUTURE PR + /// This is the code that should be run when updating the buff on a player. + /// Use for DoT damage. Other effects should be in the ModBuff class, or wherever appropriate. + /// + /// + public delegate void UpdatePlayerLifeRegen(Player player, int buffType, ref int buffIndex, ref int damage); + + /// + /// This is the code that should be run when updating life regen on NPC + /// Use for DoT damage. Other effects should be in the ModBuff class, or wherever appropriate. + /// + /// + public delegate void UpdateNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage); + + /// + /// Applies a scaling amount to a StatModifer + /// + /// + /// + /// + public static StatModifier ApplyScalingToStatModifer(StatModifier Modifer, float scaling) + { + StatModifier output = new(); + output += (Modifer.Additive-1) * scaling; + output *= 1 + (Modifer.Multiplicative-1) * scaling; + output.Base = Modifer.Base * scaling; + output.Flat = Modifer.Flat * scaling; + return output; + } + + /// + /// UNIMPLEMENTED. WILL BE IN A FUTURE PR + /// The default debuff DoT functionality on a player + /// + public void DefaultUpdateOnPlayer(Player player, int buffType, ref int buffIndex, ref int damage) + { + + } + + /// + /// The default debuff DoT functionality on enemies. + /// + public void BaseUpdateNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) + { + var cnpc = npc.Calamity(); + float totalDPS = EnemyLostRegen; + StatModifier totalScaling = + HeatDebuffScaling + ColdDebuffScaling + SicknessDebuffScaling + WaterDebuffScaling + ElectricDebuffScaling != 0 + ? + ApplyScalingToStatModifer(cnpc.ActiveHeatDebuffMultiplier, HeatDebuffScaling) + .CombineWith(ApplyScalingToStatModifer(cnpc.ActiveColdDebuffMultiplier, ColdDebuffScaling) + .CombineWith(ApplyScalingToStatModifer(cnpc.ActiveSicknessDebuffMultiplier, SicknessDebuffScaling) + .CombineWith(ApplyScalingToStatModifer(cnpc.ActiveWaterDebuffMultiplier, WaterDebuffScaling) + .CombineWith(ApplyScalingToStatModifer(cnpc.ActiveElectricDebuffMultiplier, ElectricDebuffScaling) + )))) + : + cnpc.ActiveTypelessDebuffMultiplier; + totalDPS = totalScaling.ApplyTo(totalDPS); + var totalDPSAdjusted = totalDPS-EnemyVanillaRegenToCancelOut; + npc.Calamity().ApplyDPSDebuff((int)(totalDPSAdjusted), (int)Math.Max(totalDPS*MultiplierDamageTickSize,MinimumDamageTickSize), ref npc.lifeRegen, ref damage); + } + /// + /// DoT functionality that takes into account Electric debuff's 4x DPS when moving + /// + /// + /// + /// + /// + public void ElectricDebuffNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) + { + var cnpc = npc.Calamity(); + float totalDPS = EnemyLostRegen; + StatModifier totalScaling = + HeatDebuffScaling + ColdDebuffScaling + SicknessDebuffScaling + WaterDebuffScaling + ElectricDebuffScaling != 0 + ? + ApplyScalingToStatModifer(cnpc.ActiveHeatDebuffMultiplier, HeatDebuffScaling) + .CombineWith(ApplyScalingToStatModifer(cnpc.ActiveColdDebuffMultiplier, ColdDebuffScaling) + .CombineWith(ApplyScalingToStatModifer(cnpc.ActiveSicknessDebuffMultiplier, SicknessDebuffScaling) + .CombineWith(ApplyScalingToStatModifer(cnpc.ActiveWaterDebuffMultiplier, WaterDebuffScaling) + .CombineWith(ApplyScalingToStatModifer(cnpc.ActiveElectricDebuffMultiplier, ElectricDebuffScaling) + )))) + : + cnpc.ActiveTypelessDebuffMultiplier; + totalDPS = totalScaling.ApplyTo(totalDPS); + totalDPS *= (npc.velocity.X == 0 ? 1 : 4); + totalDPS -= EnemyVanillaRegenToCancelOut * (npc.velocity.X == 0 ? 1 : 5); //Vanilla Electrified is 5x when moving, not 4x + npc.Calamity().ApplyDPSDebuff((int)(totalDPS), (int)Math.Max(totalDPS * MultiplierDamageTickSize, MinimumDamageTickSize), ref npc.lifeRegen, ref damage); + } + #region Special Regen Functions + /// + /// 18OCT2023: Ozzatron: im not gonna sugarcoat it + /// vanilla debuff damage from Daybreak impales scales linearly up to 8 for 800 DPS + /// instead of allowing this entire 800 DPS to be multiplied by heat weakness + heat DoT bonuses, + /// each Daybreak spear beyond the first is only affected 25% as much by weaknesses or resistances. + /// This also stops Daybreak's DPS from being utterly shafted by heat resistance. + /// As no other weapon can stack Daybroken, this has no effect on other weapons (they count as "1 Daybreak spear") + /// + /// + /// + /// + /// + public static void DaybrokenRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) + { + var cnpc = npc.Calamity(); + int numImpaledSpears = 0; + for (int k = 0; k < Main.maxProjectiles; k++) + { + if (Main.projectile[k].active && Main.projectile[k].type == ProjectileID.Daybreak && Main.projectile[k].ai[0] == 1f && Main.projectile[k].ai[1] == npc.whoAmI) + numImpaledSpears++; + } + + // If there are no Daybreak impaled spears, Daybroken has 1x potency (it was applied some other way) + float daybrokenMultiplier = numImpaledSpears <= 1 ? 1f : (1f + 0.25f * (numImpaledSpears - 1)); + int adjustedSpears = Math.Max(1, numImpaledSpears); + int baseDaybreakDoTValue = (int)(npc.Calamity().ActiveHeatDebuffMultiplier.ApplyTo(Daybroken.EnemyLostRegen * adjustedSpears) + npc.Calamity().ActiveHeatDebuffMultiplier.ApplyTo(Daybroken.EnemyLostRegen * 0.25f * (adjustedSpears - 1))); + var totalDPSAdjusted = baseDaybreakDoTValue - Daybroken.EnemyVanillaRegenToCancelOut*numImpaledSpears; + if (numImpaledSpears == 0) + { + totalDPSAdjusted -= Daybroken.EnemyVanillaRegenToCancelOut; + } + npc.Calamity().ApplyDPSDebuff((int)(totalDPSAdjusted), (int)Math.Max(baseDaybreakDoTValue * Daybroken.MultiplierDamageTickSize, Daybroken.MinimumDamageTickSize), ref npc.lifeRegen, ref damage); + } + /// + /// Apply Oiled DoT. + /// + public static void OiledNPCMethod(NPC npc, int buffType, ref int buffIndex, ref int damage) + { + var cnpc = npc.Calamity(); + double totalDPS = ApplyScalingToStatModifer(cnpc.ActiveHeatDebuffMultiplier,Oiled.HeatDebuffScaling).ApplyTo(Oiled.EnemyLostRegen); + if (totalDPS <= 0) + return; + npc.Calamity().ApplyDPSDebuff((int)(totalDPS), damage+(int)Math.Max(totalDPS * Oiled.MultiplierDamageTickSize, Oiled.MinimumDamageTickSize), ref npc.lifeRegen, ref damage); + } + /// + /// Has Dryad's Bane scale with Calamity's town NPC buffs + /// + public static void DryadsBaneNPCMethod(NPC npc, int buffType, ref int buffIndex, ref int damage) + { + // Buffs match 1:1 with Town NPC buffs + // See CalamityGlobalTownNPC: BuffTownNPC + float buffedDryadsBaneMult = 0f + + (NPC.downedMoonlord ? 0.6f : 0f) + + (DownedBossSystem.downedProvidence ? 0.2f : 0f) + + (DownedBossSystem.downedPolterghast ? 0.2f : 0f) + + (DownedBossSystem.downedDoG ? 0.2f : 0f) + + (DownedBossSystem.downedYharon ? 0.2f : 0f) + + (DownedBossSystem.downedExoMechs ? 0.6f : 0f) + + (DownedBossSystem.downedCalamitas ? 0.6f : 0f); + if (Main.expertMode) + buffedDryadsBaneMult *= Main.GameModeInfo.TownNPCDamageMultiplier; + int buffedDryadsBaneDoTValue = 2 * (int)(4 * buffedDryadsBaneMult); + npc.lifeRegen -= buffedDryadsBaneDoTValue; + + // Scales damage tick if greater than the vanilla amount + float vanillaDryadsBaneMult = 1f + + (NPC.downedBoss1 ? 0.1f : 0f) + + (NPC.downedBoss2 ? 0.1f : 0f) + + (NPC.downedBoss3 ? 0.1f : 0f) + + (NPC.downedQueenBee ? 0.1f : 0f) + + (Main.hardMode ? 0.4f : 0f) + + (NPC.downedMechBoss1 ? 0.15f : 0f) + + (NPC.downedMechBoss1 ? 0.15f : 0f) + + (NPC.downedMechBoss1 ? 0.15f : 0f) + + (NPC.downedPlantBoss ? 0.15f : 0f) + + (NPC.downedGolemBoss ? 0.15f : 0f) + + (NPC.downedAncientCultist ? 0.15f : 0f); + if (Main.expertMode) + vanillaDryadsBaneMult *= Main.GameModeInfo.TownNPCDamageMultiplier; + int totalDryadsBaneDoTValue = 2 * (int)(4 * vanillaDryadsBaneMult) + buffedDryadsBaneDoTValue; + if (damage < totalDryadsBaneDoTValue / 6) + damage = totalDryadsBaneDoTValue / 6; + } + + #endregion + #endregion + + #region Vanilla debuff stats + public static DebuffData OnFire = new DebuffData() + { + EnemyLostRegen = 12, + EnemyVanillaRegenToCancelOut = 12, + HeatDebuffScaling = 1 + }; + public static DebuffData Hellfire = new DebuffData() + { + EnemyLostRegen = 30, + EnemyVanillaRegenToCancelOut = 30, + HeatDebuffScaling = 1 + }; + public static DebuffData CursedInferno = new DebuffData() + { + EnemyLostRegen = 48, + EnemyVanillaRegenToCancelOut = 48, + HeatDebuffScaling = 1 + }; + public static DebuffData Shadowflame = new DebuffData() + { + EnemyLostRegen = 60, + EnemyVanillaRegenToCancelOut = 60, + HeatDebuffScaling = 1 + }; + public static DebuffData Daybroken = new DebuffData() + { + EnemyLostRegen = 200, + EnemyVanillaRegenToCancelOut = 200, + HeatDebuffScaling = 1, + NPCLifeRegenMethod = DaybrokenRegen + }; + public static DebuffData Frostburn = new DebuffData() + { + EnemyLostRegen = 16, + EnemyVanillaRegenToCancelOut = 16, + ColdDebuffScaling = 1 + }; + public static DebuffData Frostbite = new DebuffData() + { + EnemyLostRegen = 50, + EnemyVanillaRegenToCancelOut = 50, + ColdDebuffScaling = 1 + }; + public static DebuffData Poisoned = new DebuffData() + { + EnemyLostRegen = 12, + EnemyVanillaRegenToCancelOut = 12, + SicknessDebuffScaling = 1 + }; + public static DebuffData AcidVenom = new DebuffData() + { + EnemyLostRegen = 60, + EnemyVanillaRegenToCancelOut = 60, + SicknessDebuffScaling = 1 + }; + public static DebuffData Electrified = new DebuffData(DebuffBehavior.Electric) + { + EnemyLostRegen = 21, + EnemyVanillaRegenToCancelOut = 8, + ElectricDebuffScaling = 1 + }; + public static DebuffData Oiled = new DebuffData() + { + EnemyLostRegen = 50, //This is how much DPS Oiled does when applied alongside a valid debuff + EnemyVanillaRegenToCancelOut = 50, + HeatDebuffScaling = 2, //Oiled scales twice as hard with heat debuff scaling to reward debuff builds who use such a rare and difficult to apply debuff. + NPCLifeRegenMethod = OiledNPCMethod + }; + public static DebuffData DryadsBane = new DebuffData() + { + EnemyLostRegen = 8, //This is not used in the method, serves as a token amount for anything that may need to interface in the future. + NPCLifeRegenMethod = DryadsBaneNPCMethod + }; + #endregion + } +} diff --git a/DataStructures/SummonTag.cs b/DataStructures/SummonTag.cs index 61c2540ab0..23343fe0e4 100644 --- a/DataStructures/SummonTag.cs +++ b/DataStructures/SummonTag.cs @@ -113,6 +113,13 @@ namespace CalamityMod.DataStructures critChance += TagCritChance; modifiers.CritDamage += TagCritDamage; } + + /// + /// Blank tag damage functionality + /// + public static void BlankTagModifyHit(Projectile proj, NPC npc, ref NPC.HitModifiers modifiers, ref float tagDamageMult, ref float critChance) + { + } /// /// Due to how Firecracker works, this allows it to work with crit accessories. /// diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index 9325d64cfd..285d9cc62f 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -227,13 +227,16 @@ namespace CalamityMod.Effects internal static Effect UnderwaterRaysShader; #endregion + internal static Asset SunkenSeaMenuLogoWater; + public override void PostSetupContent() { AssetRepository calAss = CalamityMod.Instance.Assets; // Shorthand to load shaders immediately. // Strings provided to LoadShader are the .xnb file paths. - Effect LoadShader(string path) => calAss.Request($"{ShaderPath}{path}", AssetRequestMode.ImmediateLoad).Value; + Effect LoadShader(string path) => LoadShaderAsset(path).Value; + Asset LoadShaderAsset(string path) => calAss.Request($"{ShaderPath}{path}", AssetRequestMode.ImmediateLoad); // // Loading and registering each individual compiled shader for use. @@ -448,6 +451,8 @@ namespace CalamityMod.Effects UnderwaterRaysShader = LoadShader("UnderwaterRaysShader"); RegisterMiscShader(UnderwaterRaysShader, "UnderwaterRayPass", "UnderwaterRays"); #endregion + + SunkenSeaMenuLogoWater = LoadShaderAsset("UI/SunkenSeaMenuLogoWater"); } // Shorthand to register a loaded shader in Terraria's graphics engine diff --git a/Effects/UI/SunkenSeaMenuLogoWater.fxc b/Effects/UI/SunkenSeaMenuLogoWater.fxc new file mode 100644 index 0000000000..917617be13 Binary files /dev/null and b/Effects/UI/SunkenSeaMenuLogoWater.fxc differ diff --git a/Effects/UI/SunkenSeaMenuLogoWater.hlsl b/Effects/UI/SunkenSeaMenuLogoWater.hlsl new file mode 100644 index 0000000000..234d3e0f49 --- /dev/null +++ b/Effects/UI/SunkenSeaMenuLogoWater.hlsl @@ -0,0 +1,76 @@ +/* Originally written for NIGHTSHADE for use as the liquid shader in the orb + * health and mana UIs: + * https://github.com/gold-meridian/nightshade-mod/blob/df037a103cb25dac8d36622515b3793f2b10ac3f/src/Nightshade/Assets/Shaders/UI/OrbFluidFillShader.hlsl + * + * Originally authored by Blockaroz and adapted by Tomat. + */ + +#include "../pixelation.h" + +sampler uImage0 : register(s0); + +texture uTexture0; +sampler tex0 = sampler_state +{ + texture = ; + magfilter = POINT; + minfilter = POINT; + mipfilter = POINT; + AddressU = wrap; + AddressV = wrap; +}; + +texture uBubbleTexture; +sampler bubbleTex = sampler_state +{ + texture = ; + magfilter = POINT; + minfilter = POINT; + mipfilter = POINT; + AddressU = wrap; + AddressV = wrap; +}; + +float2 uImageSize; +float uTime; +float uFillAmount; +float4 uFillColor; +float4 uEdgeColor; +float4 uLineColor; +float uWaveStrength; +float uWaveOffset; +float uSubtract; + +float4 main(float2 uv : TEXCOORD0, float4 baseColor : COLOR0) : COLOR0 +{ + float4 image = tex2D(uImage0, uv); + + uv = normalize_with_pixelation(uv * uImageSize, 2, uImageSize); + float2 center = uv * 2 - 1; + float distFromCenter = length(center); + + float2 uvForNoise = uv * uImageSize / 128; + + float4 bubbles = tex2D(bubbleTex, uvForNoise + float2(uTime / 10, uTime / 6)); + float4 bubbles2 = tex2D(bubbleTex, uvForNoise + float2((bubbles.r - 0.5) * 0.5, uTime / 10)); + float4 noise = tex2D(tex0, uvForNoise + float2(uTime / 6 + (bubbles.r - 0.5) * 0.05, (bubbles2.r - 0.5) * 0.1)); + uv.y = lerp(uv.y, uv.y, 0.15); + + float fillAmount = 1.0f - uFillAmount; + float bumpLine = 0.2f * (smoothstep(0.9f, 1.0f, uFillAmount) - smoothstep(0.1f, 0.0f, uFillAmount)); + float height = uv.y + (sin(3.1415 * ((uv.x * uImageSize.x / 100 + uWaveOffset) * 1.5 - uTime)) + length(bubbles.rgb)) * uWaveStrength / uImageSize.y + bumpLine - (fillAmount + 2.0f / uImageSize.y); + float edgeGlow = pow(distFromCenter * 0.8 + (uv.y + height - 0.33f) * 0.2, (1 + length(noise.rgb)) * uSubtract) * (distFromCenter * 1.5 + 1 - length(noise.rgb)); + + float topCut = smoothstep(-1.5 / uImageSize.y, 0.5 / uImageSize.y, height); + float topLine = smoothstep(1.8 / uImageSize.y, 0, height) * 1.5 * sqrt(1 - distFromCenter) - (bubbles2 - bubbles) * (1 - height) * 0.2; + + return ((lerp(uFillColor - 0.3 * topCut * uSubtract, uEdgeColor * 0.9, clamp(edgeGlow * length(image.rgb) / 2, 0, 1.3)) + topLine * 2 * uLineColor) * topCut) * image; +} + +technique Technique1 +{ + pass WaterShader + { + PixelShader = compile ps_3_0 main(); + } +} \ No newline at end of file diff --git a/Effects/pixelation.h b/Effects/pixelation.h new file mode 100644 index 0000000000..60dae6f5fc --- /dev/null +++ b/Effects/pixelation.h @@ -0,0 +1,40 @@ +#ifndef PIXELATION_HLSL +#define PIXELATION_HLSL + +/** + * Applies pixelation to the given coordinates based on a defined pixel size and + * outputs the normalized coordinates. + * + * @param coords The coordinates within the resolution space. + * @param pixel_size The size of each pixel block. + * @param resolution The resolution with which to normalize the coords by. + * @return The normalized, pixelated texture coordinates. + */ +float2 normalize_with_pixelation(float2 coords, float pixel_size, float2 resolution) +{ + return floor(coords / pixel_size) / (resolution / pixel_size); +} + +float2 pixelate(float2 coords, float pixel_size) +{ + return floor(coords / pixel_size) * pixel_size; +} + +/** + * Quantizes the input color to a given resolution. + * + * @param color The input color. + * @param color_resolution The resolution of quantization. + * @return The quantized color. + */ +float3 quantize_color(float3 color, float3 color_resolution) +{ + return floor(color * color_resolution) / (color_resolution - 1.0f); +} + +float4 quantize_color_with_alpha(float4 color, float4 color_resolution) +{ + return floor(color * color_resolution) / (color_resolution - 1.0f); +} + +#endif // PIXELATION_HLSL \ No newline at end of file diff --git a/Enums/SetBonusDoubleTapOptions.cs b/Enums/SetBonusDoubleTapOptions.cs new file mode 100644 index 0000000000..f71b0e4349 --- /dev/null +++ b/Enums/SetBonusDoubleTapOptions.cs @@ -0,0 +1,14 @@ +using Terraria.ModLoader.Config; + +namespace CalamityMod.Enums +{ + public enum SetBonusDoubleTapOptions + { + [LabelKey("$Mods.CalamityMod.Configs.CalamityClientConfig.SetBonusDoubleTap.Options.On")] + On, + [LabelKey("$Mods.CalamityMod.Configs.CalamityClientConfig.SetBonusDoubleTap.Options.Auto")] + Auto, + [LabelKey("$Mods.CalamityMod.Configs.CalamityClientConfig.SetBonusDoubleTap.Options.Off")] + Off + } +} diff --git a/Events/BossRushEvent.cs b/Events/BossRushEvent.cs index 339dbafa9f..66689a2269 100644 --- a/Events/BossRushEvent.cs +++ b/Events/BossRushEvent.cs @@ -178,7 +178,7 @@ namespace CalamityMod.Events new Boss(NPCID.BrainofCthulhu, permittedNPCs: NPCID.Creeper), - new Boss(ModContent.NPCType(), permittedNPCs: new int[] { ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }), + new Boss(ModContent.NPCType(), permittedNPCs: new int[] { ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }), new Boss(ModContent.NPCType(), permittedNPCs: new int[] { ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), diff --git a/Fonts/Flexure.xnb b/Fonts/Flexure.xnb new file mode 100644 index 0000000000..5aaf31cd8c Binary files /dev/null and b/Fonts/Flexure.xnb differ diff --git a/Fonts/FontAssetSystem.cs b/Fonts/FontAssetSystem.cs new file mode 100644 index 0000000000..b3f056c32e --- /dev/null +++ b/Fonts/FontAssetSystem.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Projectiles.Boss; +using CalamityMod.UI.DraedonSummoning; +using ReLogic.Content; +using ReLogic.Graphics; +using Terraria.GameContent; +using Terraria.ModLoader; + +namespace CalamityMod.Fonts +{ + public class FontAssetSystem : ModSystem + { + public static readonly Dictionary Fonts = new() { + { "MouseText", FontAssets.MouseText.Value }, + { "ItemStack", FontAssets.ItemStack.Value}, + { "DeathText", FontAssets.DeathText.Value }, + { "CombatText", FontAssets.CombatText[0].Value }, + { "CombatTextCrit", FontAssets.CombatText[1].Value } + }; + + public override void OnModLoad() + { + AddFont("Wingdings", CalamityMod.Instance.Assets.Request("Fonts/Wingdings", AssetRequestMode.ImmediateLoad).Value); //Intentionally does not have a fallback due to it already having null checks where it is utilized to prevent them from appearing + AddFont("CodebreakerDialog", CalamityMod.Instance.Assets.Request("Fonts/CodebreakerDialog", AssetRequestMode.ImmediateLoad).Value, FontAssets.MouseText.Value); + AddFont("Impact", CalamityMod.Instance.Assets.Request("Fonts/Impact", AssetRequestMode.ImmediateLoad).Value, FontAssets.CombatText[1].Value); + AddFont("Flexure", CalamityMod.Instance.Assets.Request("Fonts/Flexure", AssetRequestMode.ImmediateLoad).Value, FontAssets.CombatText[1].Value); + } + + private static void AddFont(string key, DynamicSpriteFont font, DynamicSpriteFont fallback = null) + { + if (Environment.OSVersion.Platform == PlatformID.Win32NT) + Fonts.Add(key, font); + else + Fonts.Add(key, fallback); + } + } +} diff --git a/Fonts/Impact.xnb b/Fonts/Impact.xnb new file mode 100644 index 0000000000..862941c829 Binary files /dev/null and b/Fonts/Impact.xnb differ diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 288c10dc1a..aa786126e6 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -66,6 +66,7 @@ namespace CalamityMod.ILEditing IL_Main.UpdateTime += PermitNighttimeTownNPCSpawning; On_Main.UpdateTime_SpawnTownNPCs += AlterTownNPCSpawnRate; IL_NPC.DoDeathEvents += PreventVanillaBossDeathsInBossRush; + On_NPC.NPCLoot += PreventDiabolistLootLogic; IL_Player.CollectTaxes += MakeTaxCollectorUseful; // Mechanics / features @@ -76,6 +77,7 @@ namespace CalamityMod.ILEditing IL_Player.DashMovement += FixAllDashMechanics; On_Player.DashMovement += DashMovementEdits; On_Player.DoCommonDashHandle += ApplyDashKeybind; + On_Player.KeyDoubleTap += DisableDoubleTapOnConfig; IL_Player.GiveImmuneTimeForCollisionAttack += MakeShieldSlamIFramesConsistent; IL_Player.Update_NPCCollision += NerfShieldOfCthulhuBonkSafety; On_WorldGen.OpenDoor += OpenDoor_LabDoorOverride; @@ -95,7 +97,9 @@ namespace CalamityMod.ILEditing On_Player.IsItemSlotUnlockedAndUsable += MasterModeCelestialOnionCheck; // Mana Burn (Chaos Stone) and Chalice of the Blood God - IL_Player.ApplyLifeAndOrMana += ManaSicknessAndChaliceBufferHeal; + IL_Player.ApplyLifeAndOrMana += ChaliceBufferHeal; + On_Player.CheckMana_int_bool_bool += AllowNegativeCheckMana; + On_Player.CheckMana_Item_int_bool_bool += AllowNegativeCheckMana; //LavaStyles if (ExternalMods.biomeLava == null) @@ -194,6 +198,8 @@ namespace CalamityMod.ILEditing On_NPC.SlimeRainSpawns += PreventBossSlimeRainSpawns; On_ShimmerTransforms.IsItemTransformLocked += AdjustShimmerRequirements; On_Projectile.AI_015_Flails += FlailsNoLongerAffectedByPlayerVelocity; + IL_Projectile.AI_061_FishingBobber += WhitelistVictideBobber; + On_Player.ItemCheck_CheckFishingBobbers += PreventVictideBobberFromJamming; IL_Projectile.CanExplodeTile += MakeMeteoriteExplodable; IL_Main.UpdateWindyDayState += MakeWindyDayMusicPlayLessOften; diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 81b88266bb..b181b5b09d 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -6,6 +6,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; using CalamityMod.Cooldowns; using CalamityMod.DataStructures; +using CalamityMod.Enums; using CalamityMod.Events; using CalamityMod.FluidSimulation; using CalamityMod.Items.Accessories; @@ -312,6 +313,20 @@ namespace CalamityMod.ILEditing self.dashTime = 0; } } + + private static void DisableDoubleTapOnConfig(On_Player.orig_KeyDoubleTap orig, Player self, int keyDir) + { + if (self.whoAmI != Main.myPlayer) + { + orig(self, keyDir); + return; + } + + if ((CalamityKeybinds.ArmorSetBonusHotKey.GetAssignedKeys().Count != 0 && CalamityClientConfig.Instance.SetBonusDoubleTap == SetBonusDoubleTapOptions.Auto) || CalamityClientConfig.Instance.SetBonusDoubleTap == SetBonusDoubleTapOptions.Off) + return; + + orig(self, keyDir); + } #endregion #region Prevent Vanilla Bosses From Being Marked as Defeated in Boss Rush @@ -364,6 +379,15 @@ namespace CalamityMod.ILEditing } #endregion + #region Prevent Diabolists from Dropping Stuff in GFB Before Plantera + private static void PreventDiabolistLootLogic(On_NPC.orig_NPCLoot orig, NPC self) + { + if (self.type == NPCID.DiabolistWhite && Main.getGoodWorld && !NPC.downedPlantBoss) + return; + orig(self); + } + #endregion + #region Town NPC Spawning Improvements private static void PermitNighttimeTownNPCSpawning(ILContext il) { @@ -599,7 +623,7 @@ namespace CalamityMod.ILEditing #endregion #region Chaos Stone and Chalice of the Blood God - private static void ManaSicknessAndChaliceBufferHeal(ILContext il) + private static void ChaliceBufferHeal(ILContext il) { ILCursor cursor = new ILCursor(il); @@ -647,31 +671,32 @@ namespace CalamityMod.ILEditing } } }); + } + #endregion - // - // The following section enables Mana Burn for Chaos Stone by conditionally replacing Mana Sickness. - // - - // Start by finding the vanilla code which applies Mana Sickness (buff ID 94). - if (!cursor.TryGotoNext(c => c.MatchLdcI4(BuffID.ManaSickness))) + #region Chaos Stone Mana Burn changes + private static bool AllowNegativeCheckMana(On_Player.orig_CheckMana_int_bool_bool orig,Player self, int amount, bool pay, bool blockQuickMana) { + if (self.Calamity().ChaosStone) { - LogFailure("Conditionally Replace Mana Sickness", "Could not locate the mana sickness buff ID."); - return; + if (pay) + self.statMana -= amount; + if (self.statMana < -self.statManaMax2) + self.statMana = -self.statManaMax2; + return true; } + return orig(self, amount, pay, blockQuickMana); + } - // Remove the constant buff ID. - cursor.Remove(); - - // Load the player onto the stack for use in the following delegate. - cursor.Emit(OpCodes.Ldarg_0); - - // Emit code which checks for the Chaos Stone. If equipped, the player gets Mana Burn instead of Mana Sickness. - cursor.EmitDelegate>(player => + private static bool AllowNegativeCheckMana(On_Player.orig_CheckMana_Item_int_bool_bool orig, Player self, Item item, int amount, bool pay, bool blockQuickMana) { + if (self.Calamity().ChaosStone) { - if (!player.active || !player.Calamity().ChaosStone) - return BuffID.ManaSickness; - return ModContent.BuffType(); - }); + if (pay) + self.statMana -= item.mana; + if (self.statMana < -self.statManaMax2) + self.statMana = -self.statManaMax2; + return true; + } + return orig(self, item, amount, pay, blockQuickMana); } #endregion diff --git a/ILEditing/VanillaStupidityFixingILChanges.cs b/ILEditing/VanillaStupidityFixingILChanges.cs index d9298d7598..83ee5fc55a 100644 --- a/ILEditing/VanillaStupidityFixingILChanges.cs +++ b/ILEditing/VanillaStupidityFixingILChanges.cs @@ -8,6 +8,7 @@ using CalamityMod.Items.TreasureBags.MiscGrabBags; using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.TownNPCs; +using CalamityMod.Projectiles.Typeless; using CalamityMod.Walls; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -333,6 +334,59 @@ namespace CalamityMod.ILEditing } #endregion + #region Allow Victide Bobber to Exist + private static void WhitelistVictideBobber(ILContext il) + { + var cursor = new ILCursor(il); + + // Find the label which skips the "flag = true" that kills the projectile + ILLabel flagStorage = null; + if (!cursor.TryGotoNext(MoveType.After, x => x.MatchBeq(out flagStorage))) + { + LogFailure("Allow Victide Bobber to Exist", "Failed to properly navigate label to direct to"); + return; + } + + // Properly perform the skip if the projectile type is the Victide Bobber + cursor.Emit(OpCodes.Ldarg_0); + cursor.Emit(OpCodes.Ldfld, typeof(Projectile).GetField("type")); + cursor.Emit(OpCodes.Ldc_I4, ModContent.ProjectileType()); + cursor.Emit(OpCodes.Beq_S, flagStorage); + } + #endregion + + #region Prevent Victide Bobber from Jammming + private static bool PreventVictideBobberFromJamming(On_Player.orig_ItemCheck_CheckFishingBobbers orig, Player self, bool canUse) + { + // Run through the original stuff + canUse = orig(self, canUse); + + int bobberCount = 0; + foreach (Projectile proj in Main.ActiveProjectiles) + { + if (proj.active && proj.owner == self.whoAmI && proj.bobber) + { + bobberCount++; + if (proj.type == ModContent.ProjectileType()) + { + // Go back to casting if there's nothing loaded + if (proj.ai[1] == 0f) + proj.ai[0] = 0f; + + // Allow you to still use the fishing rod + canUse = true; + } + } + } + + // Unless.. you have a bobber already that's NOT Victide, then back to disabling + if (canUse && bobberCount > 1) + canUse = false; + + return canUse; + } + #endregion + #region Prevent UFO Mount from Dismounting in Water private static void PreventUFODismountInWater(ILContext il) { diff --git a/Items/Accessories/CorrosiveSpine.cs b/Items/Accessories/CorrosiveSpine.cs index e8da0ddc6e..21b17bf5f6 100644 --- a/Items/Accessories/CorrosiveSpine.cs +++ b/Items/Accessories/CorrosiveSpine.cs @@ -24,6 +24,8 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.corrosiveSpine = true; player.moveSpeed += 0.05f; + modPlayer.WaterDebuffMultiplier += 0.25f; + modPlayer.SicknessDebuffMultiplier += 0.25f; } } } diff --git a/Items/Accessories/CounterScarf.cs b/Items/Accessories/CounterScarf.cs index 1f36cadfd2..e244c74806 100644 --- a/Items/Accessories/CounterScarf.cs +++ b/Items/Accessories/CounterScarf.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 30; Item.height = 38; - Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.value = Item.buyPrice(gold: 20); // Sold by Clothier Item.rare = ItemRarityID.Orange; Item.accessory = true; } diff --git a/Items/Accessories/CryoStone.cs b/Items/Accessories/CryoStone.cs index bf6e2deb08..687768b0c5 100644 --- a/Items/Accessories/CryoStone.cs +++ b/Items/Accessories/CryoStone.cs @@ -23,7 +23,11 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } - public override void UpdateAccessory(Player player, bool hideVisual) => player.Calamity().CryoStone = true; + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.Calamity().CryoStone = true; + player.Calamity().ColdDebuffMultiplier += 0.5f; + } public override void UpdateVanity(Player player) => player.Calamity().CryoStoneVanity = true; } diff --git a/Items/Accessories/DiamondOfTheDeep.cs b/Items/Accessories/DiamondOfTheDeep.cs index e9a835f0cc..189c8484ed 100644 --- a/Items/Accessories/DiamondOfTheDeep.cs +++ b/Items/Accessories/DiamondOfTheDeep.cs @@ -28,6 +28,7 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.dOfTheDeep = true; modPlayer.dOfTheDeepVisual = !hideVisual; + modPlayer.WaterDebuffMultiplier += 0.75f; } public override void AddRecipes() diff --git a/Items/Accessories/DragonScales.cs b/Items/Accessories/DragonScales.cs index cd5f548400..fe3747079d 100644 --- a/Items/Accessories/DragonScales.cs +++ b/Items/Accessories/DragonScales.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 32; Item.height = 34; - Item.value = CalamityGlobalItem.RarityVioletBuyPrice; + Item.value = Item.buyPrice(platinum: 15); // Sold by Bandit Item.rare = ModContent.RarityType(); Item.accessory = true; } diff --git a/Items/Accessories/WifeinaBottle.cs b/Items/Accessories/ElementalinaBottle.cs similarity index 86% rename from Items/Accessories/WifeinaBottle.cs rename to Items/Accessories/ElementalinaBottle.cs index 9a6e0d1919..464ab125f1 100644 --- a/Items/Accessories/WifeinaBottle.cs +++ b/Items/Accessories/ElementalinaBottle.cs @@ -9,7 +9,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class WifeinaBottle : ModItem, ILocalizedModType + [LegacyName("WifeinaBottle")] + public class ElementalinaBottle : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; public const int ElementalDamage = 45; @@ -28,14 +29,14 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.sandWaifu = true; + modPlayer.sandElemental = true; SpawnElemental(player); } public override void UpdateVanity(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.sandWaifuVanity = true; + modPlayer.sandElementalVanity = true; SpawnElemental(player); } @@ -43,9 +44,9 @@ namespace CalamityMod.Items.Accessories { if (player.whoAmI == Main.myPlayer) { - if (player.FindBuffIndex(ModContent.BuffType()) == -1) + if (player.FindBuffIndex(ModContent.BuffType()) == -1) { - player.AddBuff(ModContent.BuffType(), 3600, true); + player.AddBuff(ModContent.BuffType(), 3600, true); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { diff --git a/Items/Accessories/WifeinaBottle.png b/Items/Accessories/ElementalinaBottle.png similarity index 100% rename from Items/Accessories/WifeinaBottle.png rename to Items/Accessories/ElementalinaBottle.png diff --git a/Items/Accessories/EtherealExtorter.cs b/Items/Accessories/EtherealExtorter.cs index c963385ea8..98ee31e460 100644 --- a/Items/Accessories/EtherealExtorter.cs +++ b/Items/Accessories/EtherealExtorter.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories Item.width = 28; Item.height = 32; Item.accessory = true; - Item.value = CalamityGlobalItem.RarityYellowBuyPrice; + Item.value = Item.buyPrice(platinum: 1); // Sold by Bandit Item.rare = ItemRarityID.Yellow; } diff --git a/Items/Accessories/EyeoftheStorm.cs b/Items/Accessories/EyeoftheStorm.cs index d787a45479..f1d7335f2f 100644 --- a/Items/Accessories/EyeoftheStorm.cs +++ b/Items/Accessories/EyeoftheStorm.cs @@ -34,12 +34,12 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.cloudWaifu = true; + modPlayer.cloudElemental = true; if (player.whoAmI == Main.myPlayer) { - if (player.FindBuffIndex(ModContent.BuffType()) == -1) + if (player.FindBuffIndex(ModContent.BuffType()) == -1) { - player.AddBuff(ModContent.BuffType(), 3600, true); + player.AddBuff(ModContent.BuffType(), 3600, true); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { @@ -55,12 +55,12 @@ namespace CalamityMod.Items.Accessories public override void UpdateVanity(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.cloudWaifuVanity = true; + modPlayer.cloudElementalVanity = true; if (player.whoAmI == Main.myPlayer) { - if (player.FindBuffIndex(ModContent.BuffType()) == -1) + if (player.FindBuffIndex(ModContent.BuffType()) == -1) { - player.AddBuff(ModContent.BuffType(), 3600, true); + player.AddBuff(ModContent.BuffType(), 3600, true); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { diff --git a/Items/Accessories/HeartoftheElements.cs b/Items/Accessories/HeartoftheElements.cs index 223d3dc0c0..c52939475a 100644 --- a/Items/Accessories/HeartoftheElements.cs +++ b/Items/Accessories/HeartoftheElements.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Accessories public override bool CanEquipAccessory(Player player, int slot, bool modded) { CalamityPlayer modPlayer = player.Calamity(); - if (modPlayer.brimstoneWaifu || modPlayer.sandWaifu || modPlayer.sandBoobWaifu || modPlayer.cloudWaifu || modPlayer.sirenWaifu) + if (modPlayer.brimElemental || modPlayer.sandElemental || modPlayer.rareSandElemental || modPlayer.cloudElemental || modPlayer.waterElemental) { return false; } @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Accessories Lighting.AddLight((int)player.Center.X / 16, (int)player.Center.Y / 16, Main.DiscoR / 255f, Main.DiscoG / 255f, Main.DiscoB / 255f); CalamityPlayer modPlayer = player.Calamity(); - modPlayer.allWaifus = true; + modPlayer.allElementals = true; modPlayer.elementalHeart = true; int brimmy = ProjectileType(); @@ -113,7 +113,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateVanity(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.allWaifusVanity = true; + modPlayer.allElementalsVanity = true; // modPlayer.elementalHeart = true; int brimmy = ProjectileType(); @@ -178,8 +178,8 @@ namespace CalamityMod.Items.Accessories public override void AddRecipes() { CreateRecipe(). - AddIngredient(). - AddIngredient(). + AddIngredient(). + AddIngredient(). AddIngredient(). AddIngredient(). AddIngredient(). diff --git a/Items/Accessories/HowlsHeart.cs b/Items/Accessories/HowlsHeart.cs index 8fdf7cac32..3ce9519e09 100644 --- a/Items/Accessories/HowlsHeart.cs +++ b/Items/Accessories/HowlsHeart.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Accessories Item.height = 26; Item.accessory = true; - Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; + Item.value = Item.buyPrice(gold: 20); // Sold by Wizard Item.rare = ItemRarityID.LightRed; Item.Calamity().donorItem = true; } diff --git a/Items/Accessories/InkBomb.cs b/Items/Accessories/InkBomb.cs index 955e945460..925f1d5b8a 100644 --- a/Items/Accessories/InkBomb.cs +++ b/Items/Accessories/InkBomb.cs @@ -21,9 +21,8 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.inkBomb = true; - modPlayer.rogueStealthMax += 0.1f; - player.Calamity().stealthGenStandstill += 0.07f; - player.Calamity().stealthGenMoving += 0.07f; + modPlayer.stealthGenStandstill += 0.07f; + modPlayer.stealthGenMoving += 0.07f; } } } diff --git a/Items/Accessories/OldDie.cs b/Items/Accessories/OldDie.cs index 96197e4a51..d2c8cc43f7 100644 --- a/Items/Accessories/OldDie.cs +++ b/Items/Accessories/OldDie.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories Item.width = 24; Item.height = 26; Item.rare = ItemRarityID.Orange; - Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.value = Item.buyPrice(gold: 20); // Sold by Bandit Item.accessory = true; } diff --git a/Items/Accessories/PearlofEnthrallment.cs b/Items/Accessories/PearlofEnthrallment.cs index 53a38c6c5a..3743ab277b 100644 --- a/Items/Accessories/PearlofEnthrallment.cs +++ b/Items/Accessories/PearlofEnthrallment.cs @@ -37,13 +37,13 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.sirenWaifu = true; + modPlayer.waterElemental = true; if (player.whoAmI == Main.myPlayer) { var source = player.GetSource_Accessory(Item); - if (player.FindBuffIndex(ModContent.BuffType()) == -1) + if (player.FindBuffIndex(ModContent.BuffType()) == -1) { - player.AddBuff(ModContent.BuffType(), 3600, true); + player.AddBuff(ModContent.BuffType(), 3600, true); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { @@ -59,13 +59,13 @@ namespace CalamityMod.Items.Accessories public override void UpdateVanity(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.sirenWaifuVanity = true; + modPlayer.waterElementalVanity = true; if (player.whoAmI == Main.myPlayer) { var source = player.GetSource_Accessory(Item); - if (player.FindBuffIndex(ModContent.BuffType()) == -1) + if (player.FindBuffIndex(ModContent.BuffType()) == -1) { - player.AddBuff(ModContent.BuffType(), 3600, true); + player.AddBuff(ModContent.BuffType(), 3600, true); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { diff --git a/Items/Accessories/WifeinaBottlewithBoobs.cs b/Items/Accessories/RareElementalinaBottle.cs similarity index 82% rename from Items/Accessories/WifeinaBottlewithBoobs.cs rename to Items/Accessories/RareElementalinaBottle.cs index 9c07ecc7ef..da23cea112 100644 --- a/Items/Accessories/WifeinaBottlewithBoobs.cs +++ b/Items/Accessories/RareElementalinaBottle.cs @@ -9,7 +9,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class WifeinaBottlewithBoobs : ModItem, ILocalizedModType + [LegacyName("WifeinaBottlewithBoobs")] // Yes, that was the actual name. + public class RareElementalinaBottle : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; @@ -38,12 +39,12 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.sandBoobWaifu = true; + modPlayer.rareSandElemental = true; if (player.whoAmI == Main.myPlayer) { - if (player.FindBuffIndex(ModContent.BuffType()) == -1) + if (player.FindBuffIndex(ModContent.BuffType()) == -1) { - player.AddBuff(ModContent.BuffType(), 3600, true); + player.AddBuff(ModContent.BuffType(), 3600, true); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { @@ -59,12 +60,12 @@ namespace CalamityMod.Items.Accessories public override void UpdateVanity(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.sandBoobWaifuVanity = true; + modPlayer.rareSandElementalVanity = true; if (player.whoAmI == Main.myPlayer) { - if (player.FindBuffIndex(ModContent.BuffType()) == -1) + if (player.FindBuffIndex(ModContent.BuffType()) == -1) { - player.AddBuff(ModContent.BuffType(), 3600, true); + player.AddBuff(ModContent.BuffType(), 3600, true); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { diff --git a/Items/Accessories/WifeinaBottlewithBoobs.png b/Items/Accessories/RareElementalinaBottle.png similarity index 100% rename from Items/Accessories/WifeinaBottlewithBoobs.png rename to Items/Accessories/RareElementalinaBottle.png diff --git a/Items/Accessories/RoseStone.cs b/Items/Accessories/RoseStone.cs index e92c7f11de..02c781c7df 100644 --- a/Items/Accessories/RoseStone.cs +++ b/Items/Accessories/RoseStone.cs @@ -35,13 +35,13 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.brimstoneWaifu = true; + modPlayer.brimElemental = true; if (player.whoAmI == Main.myPlayer) { var source = player.GetSource_Accessory(Item); - if (player.FindBuffIndex(ModContent.BuffType()) == -1) + if (player.FindBuffIndex(ModContent.BuffType()) == -1) { - player.AddBuff(ModContent.BuffType(), 3600, true); + player.AddBuff(ModContent.BuffType(), 3600, true); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { @@ -58,13 +58,13 @@ namespace CalamityMod.Items.Accessories public override void UpdateVanity(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.brimstoneWaifuVanity = true; + modPlayer.brimElementalVanity = true; if (player.whoAmI == Main.myPlayer) { var source = player.GetSource_Accessory(Item); - if (player.FindBuffIndex(ModContent.BuffType()) == -1) + if (player.FindBuffIndex(ModContent.BuffType()) == -1) { - player.AddBuff(ModContent.BuffType(), 3600, true); + player.AddBuff(ModContent.BuffType(), 3600, true); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { diff --git a/Items/Accessories/SeaSpiritAmulet.cs b/Items/Accessories/SeaSpiritAmulet.cs index 74f6b94a0c..675fd8315f 100644 --- a/Items/Accessories/SeaSpiritAmulet.cs +++ b/Items/Accessories/SeaSpiritAmulet.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.sSpiritAmulet = true; modPlayer.sSpiritAmuletVisual = !hideVisual; + modPlayer.WaterDebuffMultiplier += 0.35f; } } } diff --git a/Items/Accessories/TheAmalgam.cs b/Items/Accessories/TheAmalgam.cs index 4755aa2218..6344183f9d 100644 --- a/Items/Accessories/TheAmalgam.cs +++ b/Items/Accessories/TheAmalgam.cs @@ -38,6 +38,11 @@ namespace CalamityMod.Items.Accessories modPlayer.amalgam = true; player.brainOfConfusionItem = Item; player.GetDamage() += 0.1f; + modPlayer.HeatDebuffMultiplier += 2f; + modPlayer.ColdDebuffMultiplier += 2f; + modPlayer.SicknessDebuffMultiplier += 2f; + modPlayer.WaterDebuffMultiplier += 2f; + modPlayer.ElectricDebuffMultiplier += 2f; } public override void AddRecipes() diff --git a/Items/Accessories/ToxicHeart.cs b/Items/Accessories/ToxicHeart.cs index 97daa1e8cb..da800d501b 100644 --- a/Items/Accessories/ToxicHeart.cs +++ b/Items/Accessories/ToxicHeart.cs @@ -28,6 +28,7 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.toxicHeart = true; modPlayer.toxicHeartVisuals = !hideVisual; + modPlayer.SicknessDebuffMultiplier += 0.5f; } } } diff --git a/Items/Accessories/Vanity/Popo.cs b/Items/Accessories/Vanity/Popo.cs index 54b35ec96a..c5e43287af 100644 --- a/Items/Accessories/Vanity/Popo.cs +++ b/Items/Accessories/Vanity/Popo.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Accessories.Vanity Item.width = 36; Item.height = 44; Item.accessory = true; - Item.value = CalamityGlobalItem.RarityPinkBuyPrice; + Item.value = Item.buyPrice(platinum: 5); // Sold by Archmage Item.rare = ItemRarityID.Pink; Item.Calamity().devItem = true; } diff --git a/Items/Accessories/Vanity/PunchCard.cs b/Items/Accessories/Vanity/PunchCard.cs index 23840ecacf..17f7cb92c1 100644 --- a/Items/Accessories/Vanity/PunchCard.cs +++ b/Items/Accessories/Vanity/PunchCard.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Accessories.Vanity Item.width = 42; Item.height = 38; Item.accessory = true; - Item.value = CalamityGlobalItem.RarityGreenBuyPrice; + Item.value = Item.buyPrice(gold: 10); // Sold by Skeleton Merchant named "Sans Undertale" Item.rare = ItemRarityID.Purple; Item.vanity = true; Item.Calamity().devItem = true; diff --git a/Items/Accessories/VeneratedLocket.cs b/Items/Accessories/VeneratedLocket.cs index f1e3766be8..5af7c63a21 100644 --- a/Items/Accessories/VeneratedLocket.cs +++ b/Items/Accessories/VeneratedLocket.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 50; Item.height = 58; - Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; + Item.value = Item.buyPrice(platinum: 10); // Sold by Bandit Item.rare = ModContent.RarityType(); Item.accessory = true; } diff --git a/Items/Accessories/WulfrumAcrobaticsPack.cs b/Items/Accessories/WulfrumAcrobaticsPack.cs index 1f6d1892c3..2395ba53fa 100644 --- a/Items/Accessories/WulfrumAcrobaticsPack.cs +++ b/Items/Accessories/WulfrumAcrobaticsPack.cs @@ -424,7 +424,10 @@ namespace CalamityMod.Items.Accessories bool playerCrossedSides = Math.Sign(Segments[SimulationResolution].oldPosition.X - Segments[0].position.X) != Math.Sign(Segments[SimulationResolution].position.X - Segments[0].position.X); float swingSpeed = (Segments[SimulationResolution].oldPosition - Segments[SimulationResolution].position).Length(); if (swingSpeed > 6f && playerCrossedSides) - SoundEngine.PlaySound(CommonCalamitySounds.LouderSwingWoosh with { Volume = CommonCalamitySounds.LouderSwingWoosh.Volume * (Math.Clamp((swingSpeed - 6f) / 12f, 0, 1)) }, Player.Center); + { + SoundStyle swing = new SoundStyle("CalamityMod/Sounds/Custom/LoudSwingWoosh") with { Volume = Math.Clamp((swingSpeed - 6f) / 12f, 0, 1) }; + SoundEngine.PlaySound(swing, Player.Center); + } } } diff --git a/Items/Armor/Aerospec/AerospecHeadMagic.cs b/Items/Armor/Aerospec/AerospecHeadMagic.cs index 8c1be03252..3c66e85984 100644 --- a/Items/Armor/Aerospec/AerospecHeadMagic.cs +++ b/Items/Armor/Aerospec/AerospecHeadMagic.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Items.Armor.Aerospec { public new string LocalizationCategory => "Items.Armor.PreHardmode"; - public static float MagicDamageBoost = 0.1f; public static int MaxManaBoost = 30; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MagicDamageBoost.ToPercent(), MaxManaBoost); + public static float MagicDamageBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, MagicDamageBoost.ToPercent()); // Set Bonus public static float SetBonusManaCostReduction = 0.08f; diff --git a/Items/Armor/Aerospec/AerospecHeadRogue.cs b/Items/Armor/Aerospec/AerospecHeadRogue.cs index 6cd947827a..5ada7136eb 100644 --- a/Items/Armor/Aerospec/AerospecHeadRogue.cs +++ b/Items/Armor/Aerospec/AerospecHeadRogue.cs @@ -18,9 +18,9 @@ namespace CalamityMod.Items.Armor.Aerospec public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), MoveSpeedBoost.ToPercent()); // Set Bonus + public static float SetBonusRogueStealth = 0.8f; public static float SetBonusMoveSpeedBoost = 0.05f; public static int SetBonusRogueCritBoost = 5; // NOTE: Tooltip shares this number with move speed % as they're equal - public static float SetBonusRogueStealth = 0.8f; public override void SetStaticDefaults() { @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Armor.Aerospec public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMoveSpeedBoost.ToPercent(), SetBonusRogueStealth.ToStealth()) + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), SetBonusMoveSpeedBoost.ToPercent()) + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(AerospecBreastplate.SetBonusHurtDamageThreshold); var modPlayer = player.Calamity(); modPlayer.aeroSet = true; diff --git a/Items/Armor/Aerospec/AerospecHeadSummon.cs b/Items/Armor/Aerospec/AerospecHeadSummon.cs index 54722a5d38..5543fb9945 100644 --- a/Items/Armor/Aerospec/AerospecHeadSummon.cs +++ b/Items/Armor/Aerospec/AerospecHeadSummon.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Items.Armor.Aerospec public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(SummonDamageBoost.ToPercent(), MoveSpeedBoost.ToPercent()); // Set Bonus - public static float SetBonusSummonDamageBoost = 0.11f; public static int SetBonusMinionSlotBoost = 1; + public static float SetBonusSummonDamageBoost = 0.11f; public static int ValkyrieDamage = 20; public override void SetDefaults() @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Armor.Aerospec public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusSummonDamageBoost.ToPercent(), SetBonusMinionSlotBoost) + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusSummonDamageBoost.ToPercent()) + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(AerospecBreastplate.SetBonusHurtDamageThreshold); var modPlayer = player.Calamity(); modPlayer.valkyrie = true; diff --git a/Items/Armor/Astral/AstralBreastplate.cs b/Items/Armor/Astral/AstralBreastplate.cs index d3e12e752d..90efeb9ebf 100644 --- a/Items/Armor/Astral/AstralBreastplate.cs +++ b/Items/Armor/Astral/AstralBreastplate.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Astral @@ -9,6 +10,11 @@ namespace CalamityMod.Items.Armor.Astral public class AstralBreastplate : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static int MaxManaBoost = 80; + public static float DamageBoost = 0.07f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, DamageBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; @@ -20,8 +26,8 @@ namespace CalamityMod.Items.Armor.Astral public override void UpdateEquip(Player player) { - player.statManaMax2 += 80; - player.GetDamage() += 0.07f; + player.statManaMax2 += MaxManaBoost; + player.GetDamage() += DamageBoost; } public override void AddRecipes() diff --git a/Items/Armor/Astral/AstralHelm.cs b/Items/Armor/Astral/AstralHelm.cs index 35c40f89a9..0bb64452ac 100644 --- a/Items/Armor/Astral/AstralHelm.cs +++ b/Items/Armor/Astral/AstralHelm.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Astral @@ -10,6 +11,18 @@ namespace CalamityMod.Items.Armor.Astral public class AstralHelm : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float DamageBoost = 0.05f; + public static int CritBoost = 10; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost); + + // Set Bonus + public static int SetBonusMinionSlotBoost = 3; + public static float SetBonusDamageBoost = 0.1f; + public static int SetBonusCritBoost = 10; // NOTE: Tooltip shares this number with damage % as they're equal + public static int StarRainCooldown = CalamityUtils.SecondsToFrames(1); + public static int StarDamage = 120; + public override void SetDefaults() { Item.width = 18; @@ -31,20 +44,20 @@ namespace CalamityMod.Items.Armor.Astral public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusDamageBoost.ToPercent(), StarRainCooldown.FramesToSeconds()); var modPlayer = player.Calamity(); modPlayer.astralStarRain = true; modPlayer.omniscience = true; - player.GetDamage() += 0.1f; - player.maxMinions += 3; - player.GetCritChance() += 10; + player.maxMinions += SetBonusMinionSlotBoost; + player.GetDamage() += SetBonusDamageBoost; + player.GetCritChance() += SetBonusCritBoost; player.Calamity().wearingRogueArmor = true; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.05f; - player.GetCritChance() += 10; + player.GetDamage() += DamageBoost; + player.GetCritChance() += CritBoost; } public override void AddRecipes() diff --git a/Items/Armor/Astral/AstralLeggings.cs b/Items/Armor/Astral/AstralLeggings.cs index 3a717b7f0c..16c64551ce 100644 --- a/Items/Armor/Astral/AstralLeggings.cs +++ b/Items/Armor/Astral/AstralLeggings.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Astral @@ -9,6 +10,11 @@ namespace CalamityMod.Items.Armor.Astral public class AstralLeggings : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float DamageBoost = 0.05f; + public static float MoveSpeedBoost = 0.15f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; @@ -20,8 +26,8 @@ namespace CalamityMod.Items.Armor.Astral public override void UpdateEquip(Player player) { - player.moveSpeed += 0.15f; - player.GetDamage() += 0.05f; + player.GetDamage() += DamageBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Auric/AuricTeslaHeadMelee.cs b/Items/Armor/Auric/AuricTeslaHeadMelee.cs index bb5430ef7a..a77c7f55cf 100644 --- a/Items/Armor/Auric/AuricTeslaHeadMelee.cs +++ b/Items/Armor/Auric/AuricTeslaHeadMelee.cs @@ -85,7 +85,7 @@ namespace CalamityMod.Items.Armor.Auric { Color[] armorColors = { AuricTeslaBodyArmor.tooltipTarragonColor, AuricTeslaBodyArmor.tooltipBloodflareColor, AuricTeslaBodyArmor.tooltipGodslayerColor }; var LocalizedText = CalamityUtils.GetTextFromModItem(Type, $"SetBonus{setBonusTooltipNumber}"); - line.Text = (setBonusTooltipNumber == 3 ? LocalizedText.Format(CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(), GodslayerArmorDash.GodslayerCooldown) : setBonusTooltipNumber == 2 ? LocalizedText.Format() : LocalizedText.Format(CalamityKeybinds.ArmorSetBonusHotKey.TooltipHotkeyString())); + line.Text = (setBonusTooltipNumber == 3 ? LocalizedText.Format(CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(), GodslayerArmorDash.GodslayerCooldown) : setBonusTooltipNumber == 2 ? LocalizedText.Format() : LocalizedText.Format(CalamityUtils.GetArmorSetBonusKey())); line.OverrideColor = armorColors[setBonusTooltipNumber - 1]; } } diff --git a/Items/Armor/Auric/AuricTeslaHeadRanged.cs b/Items/Armor/Auric/AuricTeslaHeadRanged.cs index 27e6e250ed..f143ce6580 100644 --- a/Items/Armor/Auric/AuricTeslaHeadRanged.cs +++ b/Items/Armor/Auric/AuricTeslaHeadRanged.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Items.Armor.Auric { Color[] armorColors = { AuricTeslaBodyArmor.tooltipTarragonColor, AuricTeslaBodyArmor.tooltipBloodflareColor, AuricTeslaBodyArmor.tooltipGodslayerColor }; var LocalizedText = CalamityUtils.GetTextFromModItem(Type, $"SetBonus{setBonusTooltipNumber}"); - line.Text = (setBonusTooltipNumber == 3 ? LocalizedText.Format(CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(), GodslayerArmorDash.GodslayerCooldown) : setBonusTooltipNumber == 2 ? LocalizedText.Format(CalamityKeybinds.ArmorSetBonusHotKey.TooltipHotkeyString()) : LocalizedText.Format()); + line.Text = (setBonusTooltipNumber == 3 ? LocalizedText.Format(CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(), GodslayerArmorDash.GodslayerCooldown) : setBonusTooltipNumber == 2 ? LocalizedText.Format(CalamityUtils.GetArmorSetBonusKey()) : LocalizedText.Format()); line.OverrideColor = armorColors[setBonusTooltipNumber - 1]; } } diff --git a/Items/Armor/Auric/AuricTeslaHeadRogue.cs b/Items/Armor/Auric/AuricTeslaHeadRogue.cs index bab13f54b6..78fe5227c7 100644 --- a/Items/Armor/Auric/AuricTeslaHeadRogue.cs +++ b/Items/Armor/Auric/AuricTeslaHeadRogue.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Items.Armor.Auric { Color[] armorColors = { AuricTeslaBodyArmor.tooltipTarragonColor, AuricTeslaBodyArmor.tooltipBloodflareColor, AuricTeslaBodyArmor.tooltipGodslayerColor }; var LocalizedText = CalamityUtils.GetTextFromModItem(Type, $"SetBonus{setBonusTooltipNumber}"); - line.Text = (setBonusTooltipNumber == 3 ? LocalizedText.Format(CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(), GodslayerArmorDash.GodslayerCooldown) : setBonusTooltipNumber == 2 ? LocalizedText.Format() : LocalizedText.Format(CalamityKeybinds.ArmorSetBonusHotKey.TooltipHotkeyString())); + line.Text = (setBonusTooltipNumber == 3 ? LocalizedText.Format(CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(), GodslayerArmorDash.GodslayerCooldown) : setBonusTooltipNumber == 2 ? LocalizedText.Format() : LocalizedText.Format()); line.OverrideColor = armorColors[setBonusTooltipNumber - 1]; } } diff --git a/Items/Armor/Bloodflare/BloodflareHeadRanged.cs b/Items/Armor/Bloodflare/BloodflareHeadRanged.cs index b8a9e4f5ef..58e7430499 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadRanged.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadRanged.cs @@ -39,8 +39,7 @@ namespace CalamityMod.Items.Armor.Bloodflare var modPlayer = player.Calamity(); modPlayer.bloodflareSet = true; modPlayer.bloodflareRanged = true; - var hotkey = CalamityKeybinds.ArmorSetBonusHotKey.TooltipHotkeyString(); - player.setBonus = this.GetLocalization("SetBonus").Format(hotkey) + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey()) + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); player.crimsonRegen = true; } diff --git a/Items/Armor/Brimflame/BrimflameBoots.cs b/Items/Armor/Brimflame/BrimflameBoots.cs index e7b55aacd2..76732610d6 100644 --- a/Items/Armor/Brimflame/BrimflameBoots.cs +++ b/Items/Armor/Brimflame/BrimflameBoots.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Brimflame @@ -9,19 +10,24 @@ namespace CalamityMod.Items.Armor.Brimflame public class BrimflameBoots : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float MagicDamageBoost = 0.05f; + public static float MoveSpeedBoost = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MagicDamageBoost.ToPercent(), MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; - Item.defense = 15; + Item.defense = 13; } public override void UpdateEquip(Player player) { - player.moveSpeed += 0.05f; - player.GetDamage() += 0.05f; + player.GetDamage() += MagicDamageBoost; + player.moveSpeed += MoveSpeedBoost; player.fireWalk = true; } diff --git a/Items/Armor/Brimflame/BrimflameCowl.cs b/Items/Armor/Brimflame/BrimflameCowl.cs new file mode 100644 index 0000000000..a2d44ea1d9 --- /dev/null +++ b/Items/Armor/Brimflame/BrimflameCowl.cs @@ -0,0 +1,79 @@ +using System; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.CalPlayer; +using CalamityMod.Cooldowns; +using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor.Brimflame +{ + [AutoloadEquip(EquipType.Head)] + [LegacyName("BrimflameScowl")] + public class BrimflameCowl : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Armor.Hardmode"; + public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Custom/AbilitySounds/BrimflameAbility"); + + public static int MaxManaBoost = 80; + public static float ManaCostReduction = 0.1f; + public static float MagicDamageBoost = 0.1f; + public static int MagicCritBoost = 10; // NOTE: Tooltip shares this number with damage % as they're equal + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, ManaCostReduction.ToPercent(), MagicDamageBoost.ToPercent()); + + // Set Bonus + public static float SetBonusMagicDamageBoost = 0.08f; + public static int SetBonusMagicCritBoost = 8; // NOTE: Tooltip shares this number with damage % as they're equal + public static float FrenzyMagicDamageBoost = 0.4f; + public static int FrenzyDuration = CalamityUtils.SecondsToFrames(10); + public static int FrenzyCooldown = CalamityUtils.SecondsToFrames(30); + + public override void SetDefaults() + { + Item.width = 18; + Item.height = 18; + Item.value = CalamityGlobalItem.RarityLimeBuyPrice; + Item.rare = ItemRarityID.Lime; + Item.defense = 12; + } + + public override void UpdateEquip(Player player) + { + player.GetDamage() += MagicDamageBoost; + player.GetCritChance() += MagicCritBoost; + player.statManaMax2 += MaxManaBoost; + player.manaCost -= ManaCostReduction; + player.buffImmune[ModContent.BuffType()] = true; + player.buffImmune[BuffID.OnFire] = true; + player.buffImmune[BuffID.Frostburn] = true; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); + + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadowSubtle = true; + + public override void UpdateArmorSet(Player player) + { + var modPlayer = player.Calamity(); + modPlayer.brimflameSet = true; + player.GetDamage() += SetBonusMagicDamageBoost; + player.GetCritChance() += SetBonusMagicCritBoost; + Color AbilityBriefColor = Color.Lerp(new Color(250, 202, 140), new Color(227, 79, 79), 0.5f + 0.5f * MathF.Sin(Main.GlobalTimeWrappedHourly * 3f)); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMagicDamageBoost.ToPercent(), AbilityBriefColor.Hex3(), CalamityUtils.GetArmorSetBonusKey(), FrenzyDuration.FramesToSeconds(), FrenzyMagicDamageBoost.ToPercent(), FrenzyCooldown.FramesToSeconds()); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddIngredient(2). + AddTile(TileID.MythrilAnvil). + SortBeforeFirstRecipesOf(ModContent.ItemType()). + Register(); + } + } +} diff --git a/Items/Armor/Brimflame/BrimflameScowl.png b/Items/Armor/Brimflame/BrimflameCowl.png similarity index 100% rename from Items/Armor/Brimflame/BrimflameScowl.png rename to Items/Armor/Brimflame/BrimflameCowl.png diff --git a/Items/Armor/Brimflame/BrimflameScowl_Head.png b/Items/Armor/Brimflame/BrimflameCowl_Head.png similarity index 100% rename from Items/Armor/Brimflame/BrimflameScowl_Head.png rename to Items/Armor/Brimflame/BrimflameCowl_Head.png diff --git a/Items/Armor/Brimflame/BrimflameRobes.cs b/Items/Armor/Brimflame/BrimflameRobes.cs index 8e2ba2b87b..e729bb80ae 100644 --- a/Items/Armor/Brimflame/BrimflameRobes.cs +++ b/Items/Armor/Brimflame/BrimflameRobes.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Brimflame @@ -9,9 +10,13 @@ namespace CalamityMod.Items.Armor.Brimflame public class BrimflameRobes : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float MagicDamageBoost = 0.07f; + public static int MagicCritBoost = 7; // NOTE: Tooltip shares this number with damage % as they're equal + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MagicDamageBoost.ToPercent()); + public override void SetStaticDefaults() { - if (Main.dedServ) return; @@ -27,13 +32,13 @@ namespace CalamityMod.Items.Armor.Brimflame Item.height = 18; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; - Item.defense = 15; + Item.defense = 16; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.05f; - player.GetCritChance() += 5; + player.GetDamage() += MagicDamageBoost; + player.GetCritChance() += MagicCritBoost; } public override void AddRecipes() diff --git a/Items/Armor/Brimflame/BrimflameScowl.cs b/Items/Armor/Brimflame/BrimflameScowl.cs deleted file mode 100644 index d0951197c8..0000000000 --- a/Items/Armor/Brimflame/BrimflameScowl.cs +++ /dev/null @@ -1,94 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.CalPlayer; -using CalamityMod.Cooldowns; -using CalamityMod.Items.Materials; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Armor.Brimflame -{ - [AutoloadEquip(EquipType.Head)] - public class BrimflameScowl : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Armor.Hardmode"; - public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Custom/AbilitySounds/AngelicAllianceActivation"); - - // TODO -- what the fuck is this? this is not how you implement a set bonus - private bool frenzy = false; - public static int CooldownLength = 1800; - - public override void SetDefaults() - { - Item.width = 18; - Item.height = 18; - Item.value = CalamityGlobalItem.RarityLimeBuyPrice; - Item.rare = ItemRarityID.Lime; - Item.defense = 11; - } - - private void UpdateFrenzy(Player player) - { - var modPlayer = player.Calamity(); - if (!frenzy) - { - if (modPlayer.brimflameFrenzy) - frenzy = true; - } - else - { - if (!modPlayer.brimflameFrenzy) - { - frenzy = false; - player.AddCooldown(BrimflameFrenzy.ID, CooldownLength); - } - } - - if (frenzy) - player.GetDamage() += 0.4f; - } - - public override void UpdateEquip(Player player) - { - player.GetDamage() += 0.05f; - player.GetCritChance() += 5; - player.statManaMax2 += 80; - player.manaCost -= 0.1f; - player.buffImmune[ModContent.BuffType()] = true; - player.buffImmune[BuffID.OnFire] = true; - player.buffImmune[BuffID.Frostburn] = true; - UpdateFrenzy(player); - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } - - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadowSubtle = true; - } - - public override void UpdateArmorSet(Player player) - { - var modPlayer = player.Calamity(); - modPlayer.brimflameSet = true; - player.GetDamage() += 0.15f; - player.GetCritChance() += 15; - var hotkey = CalamityKeybinds.ArmorSetBonusHotKey.TooltipHotkeyString(); - player.setBonus = this.GetLocalization("SetBonus").Format(hotkey); - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(4). - AddIngredient(2). - AddTile(TileID.MythrilAnvil). - SortBeforeFirstRecipesOf(ModContent.ItemType()). - Register(); - } - } -} diff --git a/Items/Armor/Daedalus/DaedalusBreastplate.cs b/Items/Armor/Daedalus/DaedalusBreastplate.cs index 9b81c403db..fd2394ccd7 100644 --- a/Items/Armor/Daedalus/DaedalusBreastplate.cs +++ b/Items/Armor/Daedalus/DaedalusBreastplate.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Daedalus @@ -9,6 +10,10 @@ namespace CalamityMod.Items.Armor.Daedalus public class DaedalusBreastplate : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float DamageBoost = 0.08f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent()); + public override void Load() { if (Main.dedServ) @@ -23,14 +28,10 @@ namespace CalamityMod.Items.Armor.Daedalus Item.height = 18; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.defense = 19; //41 + Item.defense = 19; } - public override void UpdateEquip(Player player) - { - player.GetDamage() += 0.03f; - player.GetCritChance() += 3; - } + public override void UpdateEquip(Player player) => player.GetDamage() += DamageBoost; public override void AddRecipes() { diff --git a/Items/Armor/Daedalus/DaedalusHeadMagic.cs b/Items/Armor/Daedalus/DaedalusHeadMagic.cs index 9045e3c7aa..ed72e565ef 100644 --- a/Items/Armor/Daedalus/DaedalusHeadMagic.cs +++ b/Items/Armor/Daedalus/DaedalusHeadMagic.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Daedalus @@ -11,19 +12,27 @@ namespace CalamityMod.Items.Armor.Daedalus public class DaedalusHeadMagic : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static int MaxManaBoost = 80; + public static float ManaCostReduction = 0.1f; + public static float MagicDamageBoost = 0.13f; + public static int MagicCritBoost = 7; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, ManaCostReduction.ToPercent(), MagicDamageBoost.ToPercent(), MagicCritBoost); + + // Set Bonus + public static int AbsorptionChanceDenominator = 10; + public static float DamageAbsorptionPercent = 0.5f; + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.defense = 5; //35 + Item.defense = 5; // 39 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -33,18 +42,17 @@ namespace CalamityMod.Items.Armor.Daedalus public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(AbsorptionChanceDenominator.GetChanceFromDenominator(), DamageAbsorptionPercent.ToPercent()); var modPlayer = player.Calamity(); modPlayer.daedalusAbsorb = true; - player.GetDamage() += 0.05f; } public override void UpdateEquip(Player player) { - player.manaCost -= 0.1f; - player.GetDamage() += 0.13f; - player.GetCritChance() += 7; - player.statManaMax2 += 60; + player.statManaMax2 += MaxManaBoost; + player.manaCost -= ManaCostReduction; + player.GetDamage() += MagicDamageBoost; + player.GetCritChance() += MagicCritBoost; } public override void AddRecipes() diff --git a/Items/Armor/Daedalus/DaedalusHeadMelee.cs b/Items/Armor/Daedalus/DaedalusHeadMelee.cs index 1b63761a78..6649f2b7b0 100644 --- a/Items/Armor/Daedalus/DaedalusHeadMelee.cs +++ b/Items/Armor/Daedalus/DaedalusHeadMelee.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Daedalus @@ -11,19 +12,27 @@ namespace CalamityMod.Items.Armor.Daedalus public class DaedalusHeadMelee : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float MeleeDamageBoost = 0.1f; + public static int MeleeCritBoost = 10; // NOTE: Tooltip shares this number with damage % as they're equal + public static float MeleeSpeedBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MeleeDamageBoost.ToPercent(), MeleeSpeedBoost.ToPercent()); + + // Set Bonus + public static int SetBonusAggroBoost = 500; + public static int ReflectCooldownMin = CalamityUtils.SecondsToFrames(20); + public static int ReflectCooldownMax = CalamityUtils.SecondsToFrames(90); + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.defense = 21; //51 + Item.defense = 21; // 55 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -36,14 +45,14 @@ namespace CalamityMod.Items.Armor.Daedalus player.setBonus = this.GetLocalizedValue("SetBonus"); var modPlayer = player.Calamity(); modPlayer.daedalusReflect = true; - player.GetAttackSpeed() += 0.1f; - player.aggro += 500; + player.aggro += SetBonusAggroBoost; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.15f; - player.GetCritChance() += 10; + player.GetDamage() += MeleeDamageBoost; + player.GetCritChance() += MeleeCritBoost; + player.GetAttackSpeed() += MeleeSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Daedalus/DaedalusHeadRanged.cs b/Items/Armor/Daedalus/DaedalusHeadRanged.cs index bf2f380bd3..27b8fdb48a 100644 --- a/Items/Armor/Daedalus/DaedalusHeadRanged.cs +++ b/Items/Armor/Daedalus/DaedalusHeadRanged.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Daedalus @@ -11,19 +12,25 @@ namespace CalamityMod.Items.Armor.Daedalus public class DaedalusHeadRanged : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float RangedDamageBoost = 0.13f; + public static int RangedCritBoost = 7; + // NOTE: Ammo conservation is a bool so the number is manually added in the tooltip and equip + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), RangedCritBoost); + + // Set Bonus + public static int ShardDamage = 60; + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.defense = 9; //39 + Item.defense = 9; // 43 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -36,14 +43,13 @@ namespace CalamityMod.Items.Armor.Daedalus player.setBonus = this.GetLocalizedValue("SetBonus"); var modPlayer = player.Calamity(); modPlayer.daedalusShard = true; - player.GetDamage() += 0.05f; } public override void UpdateEquip(Player player) { + player.GetDamage() += RangedDamageBoost; + player.GetCritChance() += RangedCritBoost; player.ammoCost80 = true; - player.GetDamage() += 0.13f; - player.GetCritChance() += 7; } public override void AddRecipes() diff --git a/Items/Armor/Daedalus/DaedalusHeadRogue.cs b/Items/Armor/Daedalus/DaedalusHeadRogue.cs index b6324b20b7..67acd42f5e 100644 --- a/Items/Armor/Daedalus/DaedalusHeadRogue.cs +++ b/Items/Armor/Daedalus/DaedalusHeadRogue.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Daedalus @@ -11,19 +12,29 @@ namespace CalamityMod.Items.Armor.Daedalus public class DaedalusHeadRogue : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float RogueDamageBoost = 0.13f; + public static int RogueCritBoost = 5; + public static float RogueVelocityBoost = 0.15f; + public static float MoveSpeedBoost = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), RogueCritBoost, RogueVelocityBoost.ToPercent(), MoveSpeedBoost.ToPercent()); + + // Set Bonus + public static float SetBonusRogueStealth = 1.05f; + public static int ShardCountLimit = 15; + public static double ShardDamageRatio = 0.25D; + public static int ShardDamageSoftcap = 30; + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.defense = 7; //37 + Item.defense = 7; // 41 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -33,20 +44,19 @@ namespace CalamityMod.Items.Armor.Daedalus public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth()); var modPlayer = player.Calamity(); modPlayer.daedalusSplit = true; - modPlayer.rogueStealthMax += 1.05f; - player.GetDamage() += 0.05f; + modPlayer.rogueStealthMax += SetBonusRogueStealth; modPlayer.wearingRogueArmor = true; } public override void UpdateEquip(Player player) { - player.Calamity().rogueVelocity += 0.15f; - player.GetDamage() += 0.13f; - player.GetCritChance() += 7; - player.moveSpeed += 0.05f; + player.GetDamage() += RogueDamageBoost; + player.GetCritChance() += RogueCritBoost; + player.Calamity().rogueVelocity += RogueVelocityBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Daedalus/DaedalusHeadSummon.cs b/Items/Armor/Daedalus/DaedalusHeadSummon.cs index a772d58d53..f3746414e8 100644 --- a/Items/Armor/Daedalus/DaedalusHeadSummon.cs +++ b/Items/Armor/Daedalus/DaedalusHeadSummon.cs @@ -6,6 +6,7 @@ using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Daedalus @@ -15,6 +16,14 @@ namespace CalamityMod.Items.Armor.Daedalus public class DaedalusHeadSummon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static int MinionSlotBoost = 1; + public static float SummonDamageBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent()); + + // Set Bonus + public static int SetBonusMinionSlotBoost = 1; + public static float SetBonusSummonDamageBoost = 0.1f; public static int CrystalDamage = 95; public override void SetDefaults() @@ -23,13 +32,10 @@ namespace CalamityMod.Items.Armor.Daedalus Item.height = 18; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.defense = 3; //33 + Item.defense = 3; // 37 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -39,7 +45,7 @@ namespace CalamityMod.Items.Armor.Daedalus public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusSummonDamageBoost.ToPercent()); var modPlayer = player.Calamity(); modPlayer.daedalusCrystal = true; if (player.whoAmI == Main.myPlayer) @@ -57,13 +63,14 @@ namespace CalamityMod.Items.Armor.Daedalus p.originalDamage = CrystalDamage; } } - player.GetDamage() += 0.2f; - player.maxMinions += 2; + player.maxMinions += SetBonusMinionSlotBoost; + player.GetDamage() += SetBonusSummonDamageBoost; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.05f; + player.maxMinions += MinionSlotBoost; + player.GetDamage() += SummonDamageBoost; } public override void AddRecipes() diff --git a/Items/Armor/Daedalus/DaedalusLeggings.cs b/Items/Armor/Daedalus/DaedalusLeggings.cs index 023629f0c4..0d45fae2e7 100644 --- a/Items/Armor/Daedalus/DaedalusLeggings.cs +++ b/Items/Armor/Daedalus/DaedalusLeggings.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Daedalus @@ -9,19 +10,24 @@ namespace CalamityMod.Items.Armor.Daedalus public class DaedalusLeggings : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static int CritBoost = 8; + public static float MoveSpeedBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritBoost, MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.defense = 15; //41 + Item.defense = 15; } public override void UpdateEquip(Player player) { - player.GetCritChance() += 3; - player.moveSpeed += 0.1f; + player.GetCritChance() += CritBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Demonshade/DemonshadeHelm.cs b/Items/Armor/Demonshade/DemonshadeHelm.cs index 2e854e84d2..b245974237 100644 --- a/Items/Armor/Demonshade/DemonshadeHelm.cs +++ b/Items/Armor/Demonshade/DemonshadeHelm.cs @@ -47,8 +47,7 @@ namespace CalamityMod.Items.Armor.Demonshade public override void UpdateArmorSet(Player player) { - var hotkey = CalamityKeybinds.ArmorSetBonusHotKey.TooltipHotkeyString(); - player.setBonus = this.GetLocalization("SetBonus").Format(hotkey, (1f + MultDamageBoost).Round(), (1D + MultDamageTakenBoost).Round()); + player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey(), (1f + MultDamageBoost).Round(), (1D + MultDamageTakenBoost).Round()); var modPlayer = player.Calamity(); modPlayer.dsSetBonus = true; modPlayer.wearingRogueArmor = true; diff --git a/Items/Armor/DesertProwler/DesertProwlerSet.cs b/Items/Armor/DesertProwler/DesertProwlerSet.cs index 220715407a..650289817d 100644 --- a/Items/Armor/DesertProwler/DesertProwlerSet.cs +++ b/Items/Armor/DesertProwler/DesertProwlerSet.cs @@ -31,11 +31,13 @@ namespace CalamityMod.Items.Armor.DesertProwler public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueCritBoost); // Set Bonus - public static float SetBonusRogueDamageBoost = 0.05f; public static float SetBonusRogueStealth = 0.5f; - public static int SmokeCooldown = 25 * 60; - public static int SmokeDuration = 5 * 60; - public static int LightsOutReset = (int)(1.5f * 60); + public static float SmokeMoveSpeedMult = 1.5f; + public static float SmokeDefenseMult = 0.75f; + public static float SmokeAggroMult = 0.5f; + public static int SmokeCooldown = CalamityUtils.SecondsToFrames(25); + public static int SmokeDuration = CalamityUtils.SecondsToFrames(5); + public static int LightsOutReset = CalamityUtils.SecondsToFrames(2); public static int FreeCrit = 200; public static int BonusDamageCap = 200; @@ -46,32 +48,13 @@ namespace CalamityMod.Items.Armor.DesertProwler return (hasSmokebombCD && cd.timeLeft > SmokeCooldown); } - public override void Load() - { - Terraria.On_Player.KeyDoubleTap += ActivateSetBonus; - } - - private void ActivateSetBonus(Terraria.On_Player.orig_KeyDoubleTap orig, Player player, int keyDir) - { - if (keyDir == (Main.ReversedUpDownArmorSetBonuses ? 1 : 0) && HasArmorSet(player) && !player.mount.Active) - { - // The set bonus can only be activated if the player does not have the cooldown. - if (!player.Calamity().cooldowns.TryGetValue(SandsmokeBomb.ID, out CooldownInstance cd)) - { - player.AddCooldown(SandsmokeBomb.ID, SmokeCooldown + SmokeDuration); - } - } - - orig(player, keyDir); - } - public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; - Item.defense = 1; //6 + Item.defense = 2; // 9 } public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ItemType() && legs.type == ItemType(); @@ -83,10 +66,10 @@ namespace CalamityMod.Items.Armor.DesertProwler public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueDamageBoost.ToPercent(), SetBonusRogueStealth.ToStealth()); //More gets edited in elsewhere + Color AbilityBriefColor = Color.Lerp(new Color(255, 229, 156), new Color(233, 225, 198), 0.5f + 0.5f * MathF.Sin(Main.GlobalTimeWrappedHourly * 3f)); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), AbilityBriefColor.Hex3(), CalamityUtils.GetArmorSetBonusKey(), FreeCrit, BonusDamageCap, LightsOutReset.FramesToSeconds()); //More gets edited in elsewhere player.Calamity().wearingRogueArmor = true; player.Calamity().rogueStealthMax += SetBonusRogueStealth; - player.GetDamage() += SetBonusRogueDamageBoost; DesertProwlerPlayer armorPlayer = player.GetModPlayer(); armorPlayer.desertProwlerSet = true; @@ -96,9 +79,9 @@ namespace CalamityMod.Items.Armor.DesertProwler if (cd.timeLeft == SmokeCooldown + SmokeDuration) armorPlayer.SetBonusStartEffect(); - player.moveSpeed *= 1.5f; + player.moveSpeed *= SmokeMoveSpeedMult; player.invis = true; - player.aggro = (int)(player.aggro * 0.5f); + player.aggro = (int)(player.aggro * SmokeAggroMult); player.noKnockback = true; for (int i = 0; i < 2; i++) @@ -162,32 +145,9 @@ namespace CalamityMod.Items.Armor.DesertProwler dhusvtt.fadeIn = 1f; Vector2 dustVelocity = dustDirection.RotatedBy(MathHelper.PiOver2) * 0.04f * dustDistance; dhusvtt.velocity = dustVelocity; - } } - public static void ModifySetTooltips(ModItem item, List tooltips) - { - if (HasArmorSet(Main.LocalPlayer)) - { - int setBonusIndex = tooltips.FindIndex(x => x.Name == "SetBonus" && x.Mod == "Terraria"); - - if (setBonusIndex != -1) - { - string dir = Language.GetTextValue(Main.ReversedUpDownArmorSetBonuses ? "Key.UP" : "Key.DOWN"); - TooltipLine setBonus1 = new TooltipLine(item.Mod, "CalamityMod:SetBonus1", CalamityUtils.GetTextFromModItem("AbilityBrief").Format(dir)); - setBonus1.OverrideColor = Color.Lerp(new Color(255, 229, 156), new Color(233, 225, 198), 0.5f + 0.5f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 3f)); - tooltips.Insert(setBonusIndex + 1, setBonus1); - - TooltipLine setBonus2 = new TooltipLine(item.Mod, "CalamityMod:SetBonus2", CalamityUtils.GetTextFromModItem("AbilityDescription").Format(FreeCrit, BonusDamageCap, LightsOutReset / 60f)); - setBonus2.OverrideColor = new Color(204, 181, 72); - tooltips.Insert(setBonusIndex + 2, setBonus2); - } - } - } - - public override void ModifyTooltips(List tooltips) => ModifySetTooltips(this, tooltips); - public override void UpdateEquip(Player player) => player.GetCritChance() += RogueCritBoost; public override void AddRecipes() @@ -206,8 +166,8 @@ namespace CalamityMod.Items.Armor.DesertProwler public new string LocalizationCategory => "Items.Armor.PreHardmode"; public string BulkTexture => "CalamityMod/Items/Armor/DesertProwler/DesertProwlerShirt_Bulk"; - public static int RogueCritBoost = 5; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueCritBoost); + public static float RogueDamageBoost = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent()); public override void SetStaticDefaults() { @@ -226,12 +186,10 @@ namespace CalamityMod.Items.Armor.DesertProwler Item.height = 18; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; - Item.defense = 3; + Item.defense = 4; } - public override void ModifyTooltips(List tooltips) => DesertProwlerHat.ModifySetTooltips(this, tooltips); - - public override void UpdateEquip(Player player) => player.GetCritChance() += RogueCritBoost; + public override void UpdateEquip(Player player) => player.GetDamage() += RogueDamageBoost; public override void AddRecipes() { @@ -249,8 +207,8 @@ namespace CalamityMod.Items.Armor.DesertProwler { public new string LocalizationCategory => "Items.Armor.PreHardmode"; - public static float MoveSpeedBoost = 0.1f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedBoost.ToPercent()); + public static int RogueCritBoost = 4; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueCritBoost); public override void SetDefaults() { @@ -258,15 +216,13 @@ namespace CalamityMod.Items.Armor.DesertProwler Item.height = 18; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; - Item.defense = 2; + Item.defense = 3; } - public override void ModifyTooltips(List tooltips) => DesertProwlerHat.ModifySetTooltips(this, tooltips); - public override void UpdateEquip(Player player) { + player.GetCritChance() += RogueCritBoost; player.buffImmune[BuffID.WindPushed] = true; - player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() @@ -281,9 +237,6 @@ namespace CalamityMod.Items.Armor.DesertProwler public class DesertProwlerPlayer : ModPlayer { - public static int BastionShootDamage = 10; - public static float BastionShootSpeed = 18f; - public static int BastionShootTime = 10; internal SlotId SmokeBombSoundSlot; public bool desertProwlerSet = false; diff --git a/Items/Armor/Empyrean/EmpyreanCloak.cs b/Items/Armor/Empyrean/EmpyreanCloak.cs index d776dddcfb..4d16ffe959 100644 --- a/Items/Armor/Empyrean/EmpyreanCloak.cs +++ b/Items/Armor/Empyrean/EmpyreanCloak.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Empyrean @@ -10,6 +11,11 @@ namespace CalamityMod.Items.Armor.Empyrean public class EmpyreanCloak : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float RogueDamageBoost = 0.12f; + public static int RogueCritBoost = 8; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), RogueCritBoost); + public override void Load() { if (!Main.dedServ) @@ -21,7 +27,6 @@ namespace CalamityMod.Items.Armor.Empyrean public override void SetStaticDefaults() { - if (!Main.dedServ) { var equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); @@ -36,13 +41,13 @@ namespace CalamityMod.Items.Armor.Empyrean Item.height = 18; Item.value = CalamityGlobalItem.RarityRedBuyPrice; Item.rare = ItemRarityID.Red; - Item.defense = 27; + Item.defense = 24; } public override void UpdateEquip(Player player) { - player.GetCritChance() += 7; - player.GetDamage() += 0.07f; + player.GetDamage() += RogueDamageBoost; + player.GetCritChance() += RogueCritBoost; } public override void AddRecipes() diff --git a/Items/Armor/Empyrean/EmpyreanCuisses.cs b/Items/Armor/Empyrean/EmpyreanCuisses.cs index 9480df2faf..ff7916ea14 100644 --- a/Items/Armor/Empyrean/EmpyreanCuisses.cs +++ b/Items/Armor/Empyrean/EmpyreanCuisses.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Empyrean @@ -10,20 +11,26 @@ namespace CalamityMod.Items.Armor.Empyrean public class EmpyreanCuisses : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float RogueDamageBoost = 0.08f; + public static int RogueCritBoost = 8; // NOTE: Tooltip shares this number with damage % as they're equal + public static float MoveSpeedBoost = 0.2f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityRedBuyPrice; Item.rare = ItemRarityID.Red; - Item.defense = 24; + Item.defense = 20; } public override void UpdateEquip(Player player) { - player.GetCritChance() += 5; - player.GetDamage() += 0.05f; - player.moveSpeed += 0.15f; + player.GetDamage() += RogueDamageBoost; + player.GetCritChance() += RogueCritBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Empyrean/EmpyreanMask.cs b/Items/Armor/Empyrean/EmpyreanMask.cs index 87b20de371..1bc1475cd6 100644 --- a/Items/Armor/Empyrean/EmpyreanMask.cs +++ b/Items/Armor/Empyrean/EmpyreanMask.cs @@ -1,8 +1,9 @@ -using CalamityMod.Buffs.StatBuffs; +using CalamityMod.Buffs.StatBuffs; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Empyrean @@ -12,6 +13,20 @@ namespace CalamityMod.Items.Armor.Empyrean public class EmpyreanMask : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float RogueDamageBoost = 0.12f; + public static int RogueCritBoost = 7; + public static float RogueVelocityBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), RogueCritBoost, RogueVelocityBoost.ToPercent()); + + // Set Bonus + public static float SetBonusRogueStealth = 1.15f; + public static int WrathDuration = CalamityUtils.SecondsToFrames(3); + public static float PermanentWrathHealthRatio = 0.5f; + public static float WrathRogueDamageBoost = 0.1f; + public static int WrathRogueCritBoost = 5; + // There's 10 or so different magic numbers polluting CalamityPlayerOnHit for each projectile. I'm not adding it. - Iris + public override void Load() { if (!Main.dedServ) @@ -25,7 +40,6 @@ namespace CalamityMod.Items.Armor.Empyrean public override void SetStaticDefaults() { - if (Main.dedServ) return; @@ -45,13 +59,10 @@ namespace CalamityMod.Items.Armor.Empyrean Item.height = 18; Item.value = CalamityGlobalItem.RarityRedBuyPrice; Item.rare = ItemRarityID.Red; - Item.defense = 20; //71 + Item.defense = 16; // 60 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -65,20 +76,18 @@ namespace CalamityMod.Items.Armor.Empyrean { var modPlayer = player.Calamity(); modPlayer.xerocSet = true; - modPlayer.rogueStealthMax += 1.15f; - player.setBonus = this.GetLocalizedValue("SetBonus"); - if (player.statLife <= (int)(player.statLifeMax2 * 0.5)) + modPlayer.rogueStealthMax += SetBonusRogueStealth; + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth()); + if (player.statLife <= (int)(player.statLifeMax2 * PermanentWrathHealthRatio)) player.AddBuff(ModContent.BuffType(), 2); - player.GetDamage() += 0.09f; - modPlayer.rogueVelocity += 0.09f; modPlayer.wearingRogueArmor = true; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.11f; - player.GetCritChance() += 11; - player.moveSpeed += 0.05f; + player.GetDamage() += RogueDamageBoost; + player.GetCritChance() += RogueCritBoost; + player.Calamity().rogueVelocity += RogueVelocityBoost; } public override void AddRecipes() diff --git a/Items/Armor/FathomSwarmer/FathomSwarmerBoots.cs b/Items/Armor/FathomSwarmer/FathomSwarmerBoots.cs index d31a61768d..1727744f85 100644 --- a/Items/Armor/FathomSwarmer/FathomSwarmerBoots.cs +++ b/Items/Armor/FathomSwarmer/FathomSwarmerBoots.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Placeables.Abyss; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.FathomSwarmer @@ -10,6 +11,11 @@ namespace CalamityMod.Items.Armor.FathomSwarmer public class FathomSwarmerBoots : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float SummonDamageBoost = 0.08f; + public static float SubmergedMoveSpeedBoost = 0.4f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(SummonDamageBoost.ToPercent(), SubmergedMoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; @@ -21,19 +27,16 @@ namespace CalamityMod.Items.Armor.FathomSwarmer public override void UpdateEquip(Player player) { - player.GetDamage() += 0.08f; + player.GetDamage() += SummonDamageBoost; if (player.Calamity().countsAsAnyWet) { - player.moveSpeed += 0.4f; + player.moveSpeed += SubmergedMoveSpeedBoost; } player.ignoreWater = true; if (player.wingTime <= 0) //ignore flippers while the player can fly player.accFlipper = true; } - - - public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Armor/FathomSwarmer/FathomSwarmerBreastplate.cs b/Items/Armor/FathomSwarmer/FathomSwarmerBreastplate.cs index 16e6cb4b72..66e7ff78d1 100644 --- a/Items/Armor/FathomSwarmer/FathomSwarmerBreastplate.cs +++ b/Items/Armor/FathomSwarmer/FathomSwarmerBreastplate.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Placeables.Abyss; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.FathomSwarmer @@ -10,9 +11,13 @@ namespace CalamityMod.Items.Armor.FathomSwarmer public class FathomSwarmerBreastplate : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static int MinionSlotBoost = 1; + public static float SummonDamageBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent()); + public override void SetStaticDefaults() { - if (Main.dedServ) return; @@ -33,8 +38,8 @@ namespace CalamityMod.Items.Armor.FathomSwarmer public override void UpdateEquip(Player player) { - player.GetDamage() += 0.1f; - player.maxMinions += 1; + player.maxMinions += MinionSlotBoost; + player.GetDamage() += SummonDamageBoost; player.Calamity().fathomSwarmerBreastplate = true; } diff --git a/Items/Armor/FathomSwarmer/FathomSwarmerVisage.cs b/Items/Armor/FathomSwarmer/FathomSwarmerVisage.cs index 8a3ae47280..59516b2629 100644 --- a/Items/Armor/FathomSwarmer/FathomSwarmerVisage.cs +++ b/Items/Armor/FathomSwarmer/FathomSwarmerVisage.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Abyss; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.FathomSwarmer @@ -11,6 +12,18 @@ namespace CalamityMod.Items.Armor.FathomSwarmer public class FathomSwarmerVisage : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static int MinionSlotBoost = 1; + public static float SummonDamageBoost = 0.08f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent()); + + // Set Bonus + public static int SetBonusMinionSlotBoost = 2; + public static float SetBonusSummonDamageBoost = 0.1f; + public static float SetBonusSubmergedSummonDamageBoost = 0.2f; + public static int SetBonusSubmergedDefenseBoost = 10; + public static int SetBonusSubmergedRegenBoost = 5; + public override void SetDefaults() { Item.width = 18; @@ -20,37 +33,31 @@ namespace CalamityMod.Items.Armor.FathomSwarmer Item.defense = 8; //41 +10 underwater } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void PreUpdateVanitySet(Player player) - { - player.Calamity().fathomSwarmerTail = true; - } + public override void PreUpdateVanitySet(Player player) => player.Calamity().fathomSwarmerTail = true; public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusSummonDamageBoost.ToPercent(), SetBonusSubmergedSummonDamageBoost.ToPercent(), SetBonusSubmergedDefenseBoost, SetBonusSubmergedRegenBoost.ToRegenPerSecond()); var modPlayer = player.Calamity(); modPlayer.fathomSwarmer = true; player.spikedBoots = 2; - player.maxMinions += 2; - player.GetDamage() += 0.1f; + player.maxMinions += SetBonusMinionSlotBoost; + player.GetDamage() += SetBonusSummonDamageBoost; if (modPlayer.countsAsAnyWet) { - player.GetDamage() += 0.2f; - player.statDefense += 10; - player.lifeRegen += 5; + player.GetDamage() += SetBonusSubmergedSummonDamageBoost; + player.statDefense += SetBonusSubmergedDefenseBoost; + player.lifeRegen += SetBonusSubmergedRegenBoost; } } public override void UpdateEquip(Player player) { var modPlayer = player.Calamity(); - player.GetDamage() += 0.08f; - player.maxMinions += 1; + player.maxMinions += MinionSlotBoost; + player.GetDamage() += SummonDamageBoost; if (player.breath <= player.breathMax + 2 && !modPlayer.ZoneAbyss) { player.breath = player.breathMax + 3; diff --git a/Items/Armor/ForbiddenCirclet.cs b/Items/Armor/ForbiddenCirclet.cs index f5566fca6f..b4e1b3c222 100644 --- a/Items/Armor/ForbiddenCirclet.cs +++ b/Items/Armor/ForbiddenCirclet.cs @@ -1,6 +1,11 @@ -using CalamityMod.CalPlayer; +using CalamityMod.Buffs.Summon.Whips; +using CalamityMod.CalPlayer; +using CalamityMod.DataStructures; +using CalamityMod.Projectiles.Summon; +using CalamityMod.Systems.Collections; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor @@ -9,14 +14,50 @@ namespace CalamityMod.Items.Armor public class ForbiddenCirclet : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; - public const int manaCost = 60; - public const int tornadoBaseDmg = 80; - public const float tornadoBaseKB = 1f; + + public static float SummonDamageBoost = 0.1f; + public static float RogueVelocityBoost = 0.15f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(SummonDamageBoost.ToPercent(), RogueVelocityBoost.ToPercent()); + + // Set Bonus + public static float SetBonusRogueStealth = 0.4f; + public static int TagDuration = CalamityUtils.SecondsToFrames(10); + public static int StormManaCost = 60; + public static int StormCooldown = 45; + public static int StormDamage = 60; + public static float StormKB = 1f; + public static int EaterSpawnCount = 6; + public static int EaterSpawnCooldown = 15; + public static int EaterDamage = 40; + + public static SummonTag summonTag = new SummonTag() + { + //These tag damage fields determine the damage of the spawned eater. The resulting number from each is added together + //So, 0.5 multiplicative and 10 flat would make the damage be 50% of the spawning hit's damage, plus 10 more. + //If you want entirely flt, set multiplicative to 0. If you want entirely multiplicative, set flat to 0. + MultiplicativeTagDamage = 0.25f, + FlatTagDamage = 5, + AllowsWhipStacking = true, + TagOnHit = tagOnHit, + TagModifyHitEffects = SummonTag.BlankTagModifyHit, + AutoDrawTooltip = false + }; + + public static void tagOnHit(NPC npc, Projectile projectile, NPC.HitInfo hit, int damageDone) + { + if (Main.rand.NextBool(5)) + { + int damage = (int)Main.player[projectile.owner].GetBestClassDamage().ApplyTo(damageDone * summonTag.MultiplicativeTagDamage) + summonTag.FlatTagDamage; + Projectile.NewProjectile(projectile.GetSource_OnHit(npc), npc.Center, Main.rand.NextVector2Circular(5f, 5f), ModContent.ProjectileType(), damage, 3, projectile.owner); + } + } public override void SetStaticDefaults() { if (!Main.dedServ) ArmorIDs.Head.Sets.DrawFullHair[Item.headSlot] = true; + summonTag.TagItem = Type; + CalamityBuffSets.SummonTagDebuff.Add(ModContent.BuffType(),summonTag); } public override void SetDefaults() @@ -30,10 +71,7 @@ namespace CalamityMod.Items.Armor Item.Calamity().donorItem = true; } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ItemID.AncientBattleArmorShirt && legs.type == ItemID.AncientBattleArmorPants; - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ItemID.AncientBattleArmorShirt && legs.type == ItemID.AncientBattleArmorPants; public override void ArmorSetShadows(Player player) { @@ -43,19 +81,18 @@ namespace CalamityMod.Items.Armor public override void UpdateArmorSet(Player player) { - int stormMana = (int)(manaCost * player.manaCost); - string hotkey = CalamityKeybinds.ArmorSetBonusHotKey.TooltipHotkeyString(); - player.setBonus = this.GetLocalization("SetBonus").Format(hotkey, stormMana); + int stormMana = (int)(StormManaCost * player.manaCost); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), CalamityUtils.GetArmorSetBonusKey(), stormMana); CalamityPlayer modPlayer = player.Calamity(); modPlayer.forbiddenCirclet = true; - modPlayer.rogueStealthMax += 0.4f; + modPlayer.rogueStealthMax += SetBonusRogueStealth; modPlayer.wearingRogueArmor = true; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.1f; - player.Calamity().rogueVelocity += 0.15f; + player.GetDamage() += SummonDamageBoost; + player.Calamity().rogueVelocity += RogueVelocityBoost; } public override void AddRecipes() diff --git a/Items/Armor/Hydrothermic/HydrothermicArmor.cs b/Items/Armor/Hydrothermic/HydrothermicArmor.cs index c2c9737405..63884e2bfd 100644 --- a/Items/Armor/Hydrothermic/HydrothermicArmor.cs +++ b/Items/Armor/Hydrothermic/HydrothermicArmor.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Hydrothermic @@ -13,6 +14,14 @@ namespace CalamityMod.Items.Armor.Hydrothermic internal static string VanitySmokeEntitySourceContext => "SetBonus_Calamity_Hydrothermic_Vanity"; internal static string InfernoPotionEntitySourceContext => "SetBonus_Calamity_Hydrothermic_InfernoPotionBoost"; + public static float DamageBoost = 0.13f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent()); + + public static float InfernoHealthThreshold = 0.5f; + public static int InfernoHitRate = 30; + public static int InfernoDamage = 50; + public static float InfernoRange = 300f; + public override void SetDefaults() { Item.width = 18; @@ -24,8 +33,9 @@ namespace CalamityMod.Items.Armor.Hydrothermic public override void UpdateEquip(Player player) { - player.GetDamage() += 0.08f; - player.GetCritChance() += 4; + player.GetDamage() += DamageBoost; + player.lavaImmune = true; + player.buffImmune[BuffID.OnFire] = true; } public override void AddRecipes() diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs b/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs index de2335fbb7..33899b8191 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Hydrothermic @@ -11,6 +12,20 @@ namespace CalamityMod.Items.Armor.Hydrothermic public class HydrothermicHeadMagic : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static int MaxManaBoost = 100; + public static float ManaCostReduction = 0.15f; + public static float MagicDamageBoost = 0.12f; + public static int MagicCritBoost = 10; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, ManaCostReduction.ToPercent(), MagicDamageBoost.ToPercent(), MagicCritBoost); + + // Set Bonus + public static double OrbDamageRatio = 0.6D; + public static float OrbDamageCooldownMult = 0.5f; + public static double OrbHealingRatio = 0.1D; + public static double OrbHealingRatioLossPerPierce = 0.05D; + public static float OrbHealingCooldownMult = 1.25f; + public override void SetDefaults() { Item.width = 18; @@ -20,10 +35,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic Item.defense = 9; //45 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -33,21 +45,18 @@ namespace CalamityMod.Items.Armor.Hydrothermic public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(HydrothermicArmor.InfernoHealthThreshold.ToPercent()); var modPlayer = player.Calamity(); modPlayer.ataxiaBlaze = true; modPlayer.ataxiaMage = true; - player.GetDamage() += 0.05f; - player.manaCost -= 0.15f; } public override void UpdateEquip(Player player) { - player.statManaMax2 += 100; - player.GetDamage() += 0.12f; - player.GetCritChance() += 10; - player.lavaImmune = true; - player.buffImmune[BuffID.OnFire] = true; + player.statManaMax2 += MaxManaBoost; + player.manaCost -= ManaCostReduction; + player.GetDamage() += MagicDamageBoost; + player.GetCritChance() += MagicCritBoost; } public override void AddRecipes() diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadMelee.cs b/Items/Armor/Hydrothermic/HydrothermicHeadMelee.cs index c72ee844af..b7c9eeb6aa 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadMelee.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadMelee.cs @@ -2,16 +2,28 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Hydrothermic { [AutoloadEquip(EquipType.Head)] [LegacyName("AtaxiaHelm")] - public class HydrothermicHeadMelee : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float MeleeDamageBoost = 0.12f; + public static int MeleeCritBoost = 10; + public static float MeleeSpeedBoost = 0.15f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MeleeDamageBoost.ToPercent(), MeleeCritBoost, MeleeSpeedBoost.ToPercent()); + + // Set Bonus + public static int SetBonusAggroBoost = 700; + public static int GeyserCountLimit = 3; + public static double GeyserDamageRatio = 0.15D; + public static int GeyserDamageSoftcap = 45; + public override void SetDefaults() { Item.width = 18; @@ -21,10 +33,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic Item.defense = 33; //67 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -34,22 +43,18 @@ namespace CalamityMod.Items.Armor.Hydrothermic public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(HydrothermicArmor.InfernoHealthThreshold.ToPercent()); var modPlayer = player.Calamity(); modPlayer.ataxiaBlaze = true; modPlayer.ataxiaGeyser = true; - player.GetAttackSpeed() += 0.15f; - player.aggro += 700; + player.aggro += SetBonusAggroBoost; } public override void UpdateEquip(Player player) { - var modPlayer = player.Calamity(); - modPlayer.ataxiaFire = true; - player.GetDamage() += 0.17f; - player.GetCritChance() += 10; - player.lavaImmune = true; - player.buffImmune[BuffID.OnFire] = true; + player.GetDamage() += MeleeDamageBoost; + player.GetCritChance() += MeleeCritBoost; + player.GetAttackSpeed() += MeleeSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs b/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs index 2a34472a13..7ea70f3c9b 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Hydrothermic @@ -11,6 +12,16 @@ namespace CalamityMod.Items.Armor.Hydrothermic public class HydrothermicHeadRanged : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float RangedDamageBoost = 0.12f; + public static int RangedCritBoost = 10; + // NOTE: Ammo conservation is a bool so the number is manually added in the tooltip and equip + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), RangedCritBoost); + + // Set Bonus + public static int FlareCooldown = CalamityUtils.SecondsToFrames(0.33f); + public static double FlareDamageRatio = 0.25D; + public override void SetDefaults() { Item.width = 18; @@ -20,10 +31,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic Item.defense = 15; //53 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -33,20 +41,17 @@ namespace CalamityMod.Items.Armor.Hydrothermic public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(FlareCooldown.FramesToSeconds()) + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(HydrothermicArmor.InfernoHealthThreshold.ToPercent()); var modPlayer = player.Calamity(); modPlayer.ataxiaBlaze = true; modPlayer.ataxiaBolt = true; - player.GetDamage() += 0.05f; } public override void UpdateEquip(Player player) { + player.GetDamage() += RangedDamageBoost; + player.GetCritChance() += RangedCritBoost; player.ammoCost75 = true; - player.GetDamage() += 0.12f; - player.GetCritChance() += 10; - player.lavaImmune = true; - player.buffImmune[BuffID.OnFire] = true; } public override void AddRecipes() diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadRogue.cs b/Items/Armor/Hydrothermic/HydrothermicHeadRogue.cs index 67b16fb6b9..b5a04d2688 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadRogue.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadRogue.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Hydrothermic @@ -11,6 +12,19 @@ namespace CalamityMod.Items.Armor.Hydrothermic public class HydrothermicHeadRogue : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float RogueDamageBoost = 0.12f; + public static int RogueCritBoost = 10; + public static float MoveSpeedBoost = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), RogueCritBoost, MoveSpeedBoost.ToPercent()); + + // Set Bonus + public static float SetBonusRogueStealth = 1.1f; + public static int VolleyCooldown = CalamityUtils.SecondsToFrames(2); + public static int VolleyDamage = 50; // Damage + (projectile damage) * Damage Ratio + public static double VolleyDamageRatio = 0.15D; + public static int VolleyDamageSoftcap = 90; + public override void SetDefaults() { Item.width = 18; @@ -20,10 +34,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic Item.defense = 12; //49 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -33,22 +44,19 @@ namespace CalamityMod.Items.Armor.Hydrothermic public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), VolleyCooldown.FramesToSeconds()) + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(HydrothermicArmor.InfernoHealthThreshold.ToPercent()); var modPlayer = player.Calamity(); modPlayer.ataxiaBlaze = true; modPlayer.ataxiaVolley = true; - modPlayer.rogueStealthMax += 1.1f; - player.GetDamage() += 0.05f; + modPlayer.rogueStealthMax += SetBonusRogueStealth; modPlayer.wearingRogueArmor = true; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.12f; - player.GetCritChance() += 10; - player.moveSpeed += 0.05f; - player.lavaImmune = true; - player.buffImmune[BuffID.OnFire] = true; + player.GetDamage() += RogueDamageBoost; + player.GetCritChance() += RogueCritBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs b/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs index 8b736ec857..0e0c982103 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs @@ -5,6 +5,7 @@ using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Hydrothermic @@ -14,6 +15,14 @@ namespace CalamityMod.Items.Armor.Hydrothermic public class HydrothermicHeadSummon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static int MinionSlotBoost = 1; + public static float SummonDamageBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent()); + + // Set Bonus + public static int SetBonusMinionSlotBoost = 1; + public static float SetBonusSummonDamageBoost = 0.25f; public static int VentDamage = 190; public override void SetDefaults() @@ -25,10 +34,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic Item.defense = 6; //40 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -38,7 +44,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusSummonDamageBoost.ToPercent()) + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(HydrothermicArmor.InfernoHealthThreshold.ToPercent()); var modPlayer = player.Calamity(); modPlayer.ataxiaBlaze = true; modPlayer.chaosSpirit = true; @@ -58,16 +64,14 @@ namespace CalamityMod.Items.Armor.Hydrothermic Main.projectile[p].originalDamage = VentDamage; } } - player.GetDamage() += 0.4f; - player.maxMinions += 2; + player.maxMinions += SetBonusMinionSlotBoost; + player.GetDamage() += SetBonusSummonDamageBoost; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.05f; - player.GetKnockback() += 1.5f; - player.lavaImmune = true; - player.buffImmune[BuffID.OnFire] = true; + player.maxMinions += MinionSlotBoost; + player.GetDamage() += SummonDamageBoost; } public override void AddRecipes() diff --git a/Items/Armor/Hydrothermic/HydrothermicSubligar.cs b/Items/Armor/Hydrothermic/HydrothermicSubligar.cs index 7fc86d2269..2dcac69f9c 100644 --- a/Items/Armor/Hydrothermic/HydrothermicSubligar.cs +++ b/Items/Armor/Hydrothermic/HydrothermicSubligar.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Hydrothermic @@ -10,6 +11,11 @@ namespace CalamityMod.Items.Armor.Hydrothermic public class HydrothermicSubligar : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static int CritBoost = 9; + public static float MoveSpeedBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritBoost, MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; @@ -21,8 +27,8 @@ namespace CalamityMod.Items.Armor.Hydrothermic public override void UpdateEquip(Player player) { - player.GetCritChance() += 5; - player.moveSpeed += 0.1f; + player.GetCritChance() += CritBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/LunicCorps/LunicCorpsBoots.cs b/Items/Armor/LunicCorps/LunicCorpsBoots.cs index 6844341d52..f80fe1dbed 100644 --- a/Items/Armor/LunicCorps/LunicCorpsBoots.cs +++ b/Items/Armor/LunicCorps/LunicCorpsBoots.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.LunicCorps @@ -9,6 +10,11 @@ namespace CalamityMod.Items.Armor.LunicCorps public class LunicCorpsBoots : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static int RangedCritBoost = 7; + public static float MoveSpeedAccelerationBoost = 0.15f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedCritBoost, MoveSpeedAccelerationBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; @@ -22,8 +28,8 @@ namespace CalamityMod.Items.Armor.LunicCorps public override void UpdateEquip(Player player) { player.Calamity().lunicCorpsLegs = true; - player.moveSpeed += 0.15f; - player.GetCritChance() += 5; + player.GetCritChance() += RangedCritBoost; + player.moveSpeed += MoveSpeedAccelerationBoost; } public override void AddRecipes() diff --git a/Items/Armor/LunicCorps/LunicCorpsHelmet.cs b/Items/Armor/LunicCorps/LunicCorpsHelmet.cs index 8f3b9717c3..911258eb47 100644 --- a/Items/Armor/LunicCorps/LunicCorpsHelmet.cs +++ b/Items/Armor/LunicCorps/LunicCorpsHelmet.cs @@ -10,6 +10,7 @@ using Terraria; using Terraria.Audio; using Terraria.Graphics.Effects; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.LunicCorps @@ -25,8 +26,12 @@ namespace CalamityMod.Items.Armor.LunicCorps public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Custom/RoverDriveActivate") { Volume = 0.85f }; public static readonly SoundStyle BreakSound = new("CalamityMod/Sounds/Custom/RoverDriveBreak") { Volume = 0.75f }; - public static int ShieldDurabilityMax = 50; + public static float NonArrowDamageBoost = 0.15f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(NonArrowDamageBoost.ToPercent()); + // Set Bonus + public static float SetBonusJumpSpeedBoost = 1f; + public static int ShieldDurabilityMax = 50; // The following two values taken directly from Halo 3: // https://www.halopedia.org/Energy_shielding#Gameplay public static int ShieldRechargeDelay = CalamityUtils.SecondsToFrames(5); @@ -72,29 +77,25 @@ namespace CalamityMod.Items.Armor.LunicCorps Item.Calamity().donorItem = true; } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void UpdateArmorSet(Player player) { var modPlayer = player.Calamity(); modPlayer.lunicCorpsSet = true; + Color AbilityBriefColor = Color.Lerp(new Color(240, 207, 60), new Color(70, 205, 251), 0.5f + 0.5f * MathF.Sin(Main.GlobalTimeWrappedHourly * 3f)); // The localization is formatted strangely, but attempting to put the {0} on its own line will leave a blank space if given an empty string string adrenTooltip = CalamityWorld.revenge ? "\n" + this.GetLocalizedValue("ShieldAdren") : ""; - player.setBonus = this.GetLocalization("SetBonus").Format(adrenTooltip); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusJumpSpeedBoost.ToJumpSpeedPercent(), AbilityBriefColor.Hex3(), ShieldDurabilityMax, adrenTooltip, ShieldRechargeDelay.FramesToSeconds(), TotalShieldRechargeTime.FramesToSeconds()); - player.bulletDamage += 0.15f; - player.specialistDamage += 0.15f; - - player.jumpSpeedBoost += 1f; + player.jumpSpeedBoost += SetBonusJumpSpeedBoost; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.15f; + player.bulletDamage += NonArrowDamageBoost; + player.specialistDamage += NonArrowDamageBoost; player.nightVision = true; player.detectCreature = true; } diff --git a/Items/Armor/LunicCorps/LunicCorpsVest.cs b/Items/Armor/LunicCorps/LunicCorpsVest.cs index 0eabd12224..8ec6dfab11 100644 --- a/Items/Armor/LunicCorps/LunicCorpsVest.cs +++ b/Items/Armor/LunicCorps/LunicCorpsVest.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.LunicCorps @@ -10,6 +11,11 @@ namespace CalamityMod.Items.Armor.LunicCorps public class LunicCorpsVest : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float RangedDamageBoost = 0.15f; + public static int RangedCritBoost = 15; // NOTE: Tooltip shares this number with damage % as they're equal + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; @@ -22,8 +28,8 @@ namespace CalamityMod.Items.Armor.LunicCorps public override void UpdateEquip(Player player) { - player.GetDamage() += 0.05f; - player.GetCritChance() += 15; + player.GetDamage() += RangedDamageBoost; + player.GetCritChance() += RangedCritBoost; } public override void AddRecipes() diff --git a/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs b/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs index 1715969c84..ed9c3cea1c 100644 --- a/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs +++ b/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs @@ -39,6 +39,7 @@ namespace CalamityMod.Items.Armor.MarniteArchitect // Set Bonus public static float LiftRaiseSpeed = 2f; public static float MaxLiftHeight = 138f; + public static float LiftHeightOffset = 22f; // Height of the lift itself minus the foot offset; 138 + 22 = 160 (10 tiles) public override void Load() { @@ -91,7 +92,8 @@ namespace CalamityMod.Items.Armor.MarniteArchitect public override void UpdateArmorSet(Player player) { - player.setBonus = "Marnite Lift"; //Replaced below + Color AbilityBriefColor = Color.Lerp(new Color(255, 243, 161), new Color(137, 162, 255), 0.5f + 0.5f * MathF.Sin(Main.GlobalTimeWrappedHourly * 3f)); + player.setBonus = this.GetLocalization("SetBonus").Format(AbilityBriefColor.Hex3(), (MaxLiftHeight + LiftHeightOffset).ToTiles()); player.GetModPlayer().setEquipped = true; } @@ -105,27 +107,6 @@ namespace CalamityMod.Items.Armor.MarniteArchitect } } - public static void ModifySetTooltips(ModItem item, List tooltips) - { - if (HasArmorSet(Main.LocalPlayer)) - { - int setBonusIndex = tooltips.FindIndex(x => x.Name == "SetBonus" && x.Mod == "Terraria"); - - if (setBonusIndex != -1) - { - tooltips[setBonusIndex].Text = CalamityUtils.GetTextValueFromModItem("AbilityBrief"); - tooltips[setBonusIndex].OverrideColor = Color.Lerp(new Color(255, 243, 161), new Color(137, 162, 255), 0.5f + 0.5f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 3f)); - - TooltipLine setBonus1 = new TooltipLine(item.Mod, "CalamityMod:SetBonus1", CalamityUtils.GetTextValueFromModItem("AbilityDescription")); - setBonus1.OverrideColor = new Color(145, 197, 239); - tooltips.Insert(setBonusIndex + 1, setBonus1); - } - - } - } - public override void ModifyTooltips(List tooltips) => ModifySetTooltips(this, tooltips); - - public override void AddRecipes() { CreateRecipe(). @@ -152,12 +133,6 @@ namespace CalamityMod.Items.Armor.MarniteArchitect EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/MarniteArchitect/MarniteArchitectToga_Legs", EquipType.Legs, this); } - public override void SetStaticDefaults() - { - if (Main.dedServ) - return; - } - public override void SetDefaults() { Item.width = 18; @@ -173,9 +148,6 @@ namespace CalamityMod.Items.Armor.MarniteArchitect player.wallSpeed += PlacementSpeedBoost; } - public override void ModifyTooltips(List tooltips) => MarniteArchitectHeadgear.ModifySetTooltips(this, tooltips); - - public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Armor/Mollusk/MolluskShelleggings.cs b/Items/Armor/Mollusk/MolluskShelleggings.cs index 607fdb87d5..1a2fc00f6a 100644 --- a/Items/Armor/Mollusk/MolluskShelleggings.cs +++ b/Items/Armor/Mollusk/MolluskShelleggings.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Placeables.SunkenSea; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Mollusk @@ -10,6 +11,11 @@ namespace CalamityMod.Items.Armor.Mollusk public class MolluskShelleggings : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float DamageBoost = 0.06f; + public static int CritBoost = 4; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost); + public override void SetDefaults() { Item.width = 22; @@ -21,8 +27,8 @@ namespace CalamityMod.Items.Armor.Mollusk public override void UpdateEquip(Player player) { - player.GetDamage() += 0.06f; - player.GetCritChance() += 4; + player.GetDamage() += DamageBoost; + player.GetCritChance() += CritBoost; player.Calamity().molluskLegs = true; } diff --git a/Items/Armor/Mollusk/MolluskShellmet.cs b/Items/Armor/Mollusk/MolluskShellmet.cs index 180be5c2c6..dca4eca8c8 100644 --- a/Items/Armor/Mollusk/MolluskShellmet.cs +++ b/Items/Armor/Mollusk/MolluskShellmet.cs @@ -7,6 +7,7 @@ using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Mollusk @@ -15,6 +16,13 @@ namespace CalamityMod.Items.Armor.Mollusk public class MolluskShellmet : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float DamageBoost = 0.05f; + public static int CritBoost = 4; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost); + + // Set Bonus + public static float SetBonusDR = 0.1f; public static int ShellfishDamage = 140; public override void SetDefaults() @@ -29,8 +37,8 @@ namespace CalamityMod.Items.Armor.Mollusk public override void UpdateEquip(Player player) { player.ignoreWater = true; - player.GetDamage() += 0.05f; - player.GetCritChance() += 4; + player.GetDamage() += DamageBoost; + player.GetCritChance() += CritBoost; player.Calamity().molluskHelmet = true; } @@ -41,8 +49,8 @@ namespace CalamityMod.Items.Armor.Mollusk public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus"); - player.endurance += 0.1f; + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusDR.ToPercent()); + player.endurance += SetBonusDR; player.maxMinions += 4; // These are allocated for the Shellfish minions; there is no net change in minion slots. if (player.whoAmI == Main.myPlayer) { diff --git a/Items/Armor/Mollusk/MolluskShellplate.cs b/Items/Armor/Mollusk/MolluskShellplate.cs index 881bed8097..cd0470e9d7 100644 --- a/Items/Armor/Mollusk/MolluskShellplate.cs +++ b/Items/Armor/Mollusk/MolluskShellplate.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Placeables.SunkenSea; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Mollusk @@ -10,6 +11,11 @@ namespace CalamityMod.Items.Armor.Mollusk public class MolluskShellplate : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float DamageBoost = 0.06f; + public static int CritBoost = 5; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost); + public override void SetDefaults() { Item.width = 30; @@ -21,8 +27,8 @@ namespace CalamityMod.Items.Armor.Mollusk public override void UpdateEquip(Player player) { - player.GetDamage() += 0.06f; - player.GetCritChance() += 5; + player.GetDamage() += DamageBoost; + player.GetCritChance() += CritBoost; player.Calamity().molluskChest = true; } diff --git a/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs b/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs index 9f284fee8e..84b178e4d0 100644 --- a/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs +++ b/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs @@ -66,8 +66,7 @@ namespace CalamityMod.Items.Armor.OmegaBlue public override void UpdateArmorSet(Player player) { - var hotkey = CalamityKeybinds.ArmorSetBonusHotKey.TooltipHotkeyString(); - player.setBonus = this.GetLocalization("SetBonus").Format(hotkey); + player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey()); var mp = player.Calamity(); player.maxMinions += 2; diff --git a/Items/Armor/PlagueReaper/PlagueReaperMask.cs b/Items/Armor/PlagueReaper/PlagueReaperMask.cs index c483c15e15..64837235aa 100644 --- a/Items/Armor/PlagueReaper/PlagueReaperMask.cs +++ b/Items/Armor/PlagueReaper/PlagueReaperMask.cs @@ -1,11 +1,14 @@ -using CalamityMod.CalPlayer; +using System; +using CalamityMod.CalPlayer; using CalamityMod.Cooldowns; using CalamityMod.Items.Materials; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.PlagueReaper @@ -16,41 +19,49 @@ namespace CalamityMod.Items.Armor.PlagueReaper public new string LocalizationCategory => "Items.Armor.Hardmode"; public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Custom/AbilitySounds/PlagueReaperAbility"); + public static float RangedDamageBoost = 0.1f; + public static int RangedCritBoost = 8; + // NOTE: Ammo conservation is a bool so the number is manually added in the tooltip and equip + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), RangedCritBoost); + + // Set Bonus + public static float SetBonusFlightTimeBoost = 0.05f; + public static float SetBonusPlaguedRangedDamageMult = 1.1f; + public static int CinderSpawnInterval = 10; + public static int CinderDamage = 40; + public static float BlackoutRangedDamageBoost = 0.6f; + public static int BlackoutRangedCritBoost = 20; + public static int BlackoutDuration = CalamityUtils.SecondsToFrames(5); + public static int BlackoutCooldown = CalamityUtils.SecondsToFrames(25); + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; - Item.defense = 11; + Item.defense = 11; // 44 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawOutlines = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawOutlines = true; public override void UpdateArmorSet(Player player) { - var hotkey = CalamityKeybinds.ArmorSetBonusHotKey.TooltipHotkeyString(); - player.setBonus = this.GetLocalization("SetBonus").Format(hotkey); + Color AbilityBriefColor = Color.Lerp(new Color(79, 100, 95), new Color(109, 209, 130), 0.5f + 0.5f * MathF.Sin(Main.GlobalTimeWrappedHourly * 3f)); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusFlightTimeBoost.ToPercent(), SetBonusPlaguedRangedDamageMult, AbilityBriefColor.Hex3(), CalamityUtils.GetArmorSetBonusKey(), BlackoutRangedDamageBoost.ToPercent(), BlackoutRangedCritBoost, BlackoutDuration.FramesToSeconds(), BlackoutCooldown.FramesToSeconds()); var modPlayer = player.Calamity(); modPlayer.plagueReaper = true; - player.ammoCost75 = true; var hasPlagueBlackoutCD = modPlayer.cooldowns.TryGetValue(PlagueBlackout.ID, out var cd); - if (hasPlagueBlackoutCD && cd.timeLeft > 1500) + if (hasPlagueBlackoutCD && cd.timeLeft > BlackoutCooldown) { player.blind = true; player.headcovered = true; player.blackout = true; - player.GetDamage() += 0.6f; //60% ranged dmg and 20% crit - player.GetCritChance() += 20; + player.GetDamage() += BlackoutRangedDamageBoost; + player.GetCritChance() += BlackoutRangedCritBoost; } if (player.whoAmI == Main.myPlayer) @@ -58,9 +69,9 @@ namespace CalamityMod.Items.Armor.PlagueReaper var source = player.GetSource_Accessory(Item); if (player.immune) { - if (player.miscCounter % 10 == 0) + if (player.miscCounter % CinderSpawnInterval == 0) { - var damage = (int)player.GetTotalDamage().ApplyTo(40); + var damage = (int)player.GetTotalDamage().ApplyTo(CinderDamage); var cinder = CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), damage, 4f, player.whoAmI); if (cinder.whoAmI.WithinBounds(Main.maxProjectiles)) @@ -72,8 +83,9 @@ namespace CalamityMod.Items.Armor.PlagueReaper public override void UpdateEquip(Player player) { - player.GetDamage() += 0.1f; - player.GetCritChance() += 8; + player.GetDamage() += RangedDamageBoost; + player.GetCritChance() += RangedCritBoost; + player.ammoCost75 = true; } public override void AddRecipes() diff --git a/Items/Armor/PlagueReaper/PlagueReaperStriders.cs b/Items/Armor/PlagueReaper/PlagueReaperStriders.cs index 72f7fb5256..5eab566b5e 100644 --- a/Items/Armor/PlagueReaper/PlagueReaperStriders.cs +++ b/Items/Armor/PlagueReaper/PlagueReaperStriders.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.PlagueReaper @@ -9,6 +10,11 @@ namespace CalamityMod.Items.Armor.PlagueReaper public class PlagueReaperStriders : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static int RangedCritBoost = 8; + public static float MoveSpeedBoost = 0.15f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedCritBoost, MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; @@ -20,8 +26,8 @@ namespace CalamityMod.Items.Armor.PlagueReaper public override void UpdateEquip(Player player) { - player.GetCritChance() += 3; - player.moveSpeed += 0.15f; + player.GetCritChance() += RangedCritBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/PlagueReaper/PlagueReaperVest.cs b/Items/Armor/PlagueReaper/PlagueReaperVest.cs index 1016e203d4..aa15eb9c7c 100644 --- a/Items/Armor/PlagueReaper/PlagueReaperVest.cs +++ b/Items/Armor/PlagueReaper/PlagueReaperVest.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.PlagueReaper @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Armor.PlagueReaper public class PlagueReaperVest : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float RangedDamageBoost = 0.15f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; @@ -21,8 +26,7 @@ namespace CalamityMod.Items.Armor.PlagueReaper public override void UpdateEquip(Player player) { - player.GetDamage() += 0.15f; - player.GetCritChance() += 5; + player.GetDamage() += RangedDamageBoost; player.buffImmune[ModContent.BuffType()] = true; } diff --git a/Items/Armor/Plaguebringer/PlaguebringerCarapace.cs b/Items/Armor/Plaguebringer/PlaguebringerCarapace.cs index dc7245ce1a..612d748fa8 100644 --- a/Items/Armor/Plaguebringer/PlaguebringerCarapace.cs +++ b/Items/Armor/Plaguebringer/PlaguebringerCarapace.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Plaguebringer @@ -11,6 +12,11 @@ namespace CalamityMod.Items.Armor.Plaguebringer public class PlaguebringerCarapace : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static int MinionSlotBoost = 1; + public static float SummonDamageBoost = 0.15f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent()); + public override void SetStaticDefaults() { if (Main.dedServ) @@ -26,7 +32,7 @@ namespace CalamityMod.Items.Armor.Plaguebringer { Item.width = 18; Item.height = 18; - Item.defense = 17; + Item.defense = 13; Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; Item.Calamity().donorItem = true; @@ -35,7 +41,8 @@ namespace CalamityMod.Items.Armor.Plaguebringer public override void UpdateEquip(Player player) { player.Calamity().plaguebringerCarapace = true; - player.GetDamage() += 0.15f; + player.maxMinions += MinionSlotBoost; + player.GetDamage() += SummonDamageBoost; player.buffImmune[ModContent.BuffType()] = true; } diff --git a/Items/Armor/Plaguebringer/PlaguebringerPistons.cs b/Items/Armor/Plaguebringer/PlaguebringerPistons.cs index 488bf88d8c..1ae9a366f0 100644 --- a/Items/Armor/Plaguebringer/PlaguebringerPistons.cs +++ b/Items/Armor/Plaguebringer/PlaguebringerPistons.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Plaguebringer @@ -9,11 +10,17 @@ namespace CalamityMod.Items.Armor.Plaguebringer public class PlaguebringerPistons : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static int MinionSlotBoost = 1; + public static float SummonDamageBoost = 0.15f; + public static float MoveSpeedBoost = 0.15f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent(), MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; Item.height = 18; - Item.defense = 8; + Item.defense = 10; Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; Item.Calamity().donorItem = true; @@ -21,8 +28,9 @@ namespace CalamityMod.Items.Armor.Plaguebringer public override void UpdateEquip(Player player) { - player.GetDamage() += 0.15f; - player.moveSpeed += 0.15f; + player.maxMinions += MinionSlotBoost; + player.GetDamage() += SummonDamageBoost; + player.moveSpeed += MoveSpeedBoost; //Flower Boots code if (player.whoAmI == Main.myPlayer && player.velocity.Y == 0f && player.grappling[0] == -1) diff --git a/Items/Armor/Plaguebringer/PlaguebringerVisor.cs b/Items/Armor/Plaguebringer/PlaguebringerVisor.cs index 97e4d4197b..4a9c6dae23 100644 --- a/Items/Armor/Plaguebringer/PlaguebringerVisor.cs +++ b/Items/Armor/Plaguebringer/PlaguebringerVisor.cs @@ -5,6 +5,7 @@ using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Plaguebringer @@ -13,14 +14,23 @@ namespace CalamityMod.Items.Armor.Plaguebringer public class PlaguebringerVisor : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; - public const int PlagueDashIFrames = 12; + + public static int MinionSlotBoost = 1; + public static float SummonDamageBoost = 0.15f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent()); + + // Set Bonus + public static int PlagueDashDamage = 50; + public static float PlagueDashKnockback = 3f; + public static int PlagueDashIFrames = 12; public static int BeeMinionDamage = 25; + public static int BeePlagueDuration = CalamityUtils.SecondsToFrames(5); public override void SetDefaults() { Item.width = 18; Item.height = 18; - Item.defense = 7; // 32 total + Item.defense = 9; // 32 total Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; Item.Calamity().donorItem = true; @@ -28,18 +38,13 @@ namespace CalamityMod.Items.Armor.Plaguebringer public override void UpdateEquip(Player player) { - player.GetDamage() += 0.15f; + player.maxMinions += MinionSlotBoost; + player.GetDamage() += SummonDamageBoost; } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadow = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadow = true; public override void UpdateArmorSet(Player player) { @@ -48,7 +53,6 @@ namespace CalamityMod.Items.Armor.Plaguebringer player.Calamity().plaguebringerPatronSet = true; player.Calamity().DashID = PlaguebringerArmorDash.ID; player.dashType = 0; - player.maxMinions += 3; if (player.whoAmI == Main.myPlayer) { var source = player.GetSource_ItemUse(Item); diff --git a/Items/Armor/Prismatic/PrismaticHelmet.cs b/Items/Armor/Prismatic/PrismaticHelmet.cs index e0ad7a73e3..5cb45254a2 100644 --- a/Items/Armor/Prismatic/PrismaticHelmet.cs +++ b/Items/Armor/Prismatic/PrismaticHelmet.cs @@ -40,8 +40,7 @@ namespace CalamityMod.Items.Armor.Prismatic player.statManaMax2 += 40; player.manaCost -= 0.15f; player.manaRegenBonus += 8; - var hotkey = CalamityKeybinds.ArmorSetBonusHotKey.TooltipHotkeyString(); - player.setBonus = this.GetLocalization("SetBonus").Format(hotkey); + player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey()); } public override void UpdateEquip(Player player) diff --git a/Items/Armor/Reaver/ReaverCuisses.cs b/Items/Armor/Reaver/ReaverCuisses.cs index 56c540e454..f44835ab63 100644 --- a/Items/Armor/Reaver/ReaverCuisses.cs +++ b/Items/Armor/Reaver/ReaverCuisses.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Reaver @@ -9,20 +10,20 @@ namespace CalamityMod.Items.Armor.Reaver public class ReaverCuisses : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float MoveSpeedBoost = 0.12f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 22; Item.height = 18; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; - Item.defense = 14; + Item.defense = 18; } - public override void UpdateEquip(Player player) - { - player.GetCritChance() += 5; - player.moveSpeed += 0.12f; - } + public override void UpdateEquip(Player player) => player.moveSpeed += MoveSpeedBoost; public override void AddRecipes() { diff --git a/Items/Armor/Reaver/ReaverHeadExplore.cs b/Items/Armor/Reaver/ReaverHeadExplore.cs index 1e99bdc685..7348b90212 100644 --- a/Items/Armor/Reaver/ReaverHeadExplore.cs +++ b/Items/Armor/Reaver/ReaverHeadExplore.cs @@ -5,6 +5,7 @@ using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Reaver @@ -14,19 +15,26 @@ namespace CalamityMod.Items.Armor.Reaver public class ReaverHeadExplore : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float MiningSpeedBoost = 0.2f; + public static float PlacementSpeedBoost = 0.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MiningSpeedBoost.ToPercent(), PlacementSpeedBoost.ToPercent()); + + // Set Bonus + public static int SetBonusAggroReduction = 400; + public static int SetBonusTileRangeBoost = 7; + public static int SetBonusGrabRangeBoost = 246; // (2.625 + 15.375 = 18 tiles) + public override void SetDefaults() { Item.width = 22; Item.height = 22; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; - Item.defense = 7; + Item.defense = 6; // 48 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -36,30 +44,24 @@ namespace CalamityMod.Items.Armor.Reaver public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusTileRangeBoost); var modPlayer = player.Calamity(); modPlayer.reaverExplore = true; modPlayer.wearingRogueArmor = true; player.findTreasure = true; - player.aggro -= 200; + player.aggro -= SetBonusAggroReduction; if (player.Calamity().countsAsAnyWet) player.gills = true; + DelegateMethods.v3_1 = new Vector3(1f, 1f, 1f); + Utils.PlotTileLine(player.Center, player.Center + player.velocity * 6f, 20f, DelegateMethods.CastLightOpen); + Utils.PlotTileLine(player.Left, player.Right, 20f, DelegateMethods.CastLightOpen); + if (player.whoAmI == Main.myPlayer) { - var source = player.GetSource_ItemUse(Item); - if (player.FindBuffIndex(ModContent.BuffType()) == -1) - { - player.AddBuff(ModContent.BuffType(), 3600, true); - } - if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) - { - Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI); - } - // These are static variables. Awesome - Player.tileRangeX += 7; - Player.tileRangeY += 7; + Player.tileRangeX += SetBonusTileRangeBoost; + Player.tileRangeY += SetBonusTileRangeBoost; } } @@ -67,9 +69,9 @@ namespace CalamityMod.Items.Armor.Reaver { player.ignoreWater = true; player.lavaImmune = true; - player.pickSpeed -= 0.2f; - player.tileSpeed += 0.5f; - player.wallSpeed += 0.5f; + player.pickSpeed -= MiningSpeedBoost; + player.tileSpeed += PlacementSpeedBoost; + player.wallSpeed += PlacementSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Reaver/ReaverHeadMobility.cs b/Items/Armor/Reaver/ReaverHeadMobility.cs index f6f861a712..46b0326b58 100644 --- a/Items/Armor/Reaver/ReaverHeadMobility.cs +++ b/Items/Armor/Reaver/ReaverHeadMobility.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Reaver @@ -11,20 +12,25 @@ namespace CalamityMod.Items.Armor.Reaver public class ReaverHeadMobility : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; - //Jump/Flight Boosts and Movement Speed Helm + + public static float MoveSpeedBoost = 0.15f; + public static float JumpSpeedBoost = 0.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedBoost.ToPercent(), JumpSpeedBoost.ToJumpSpeedPercent()); + + public static float SetBonusFlightBoost = 0.1f; + public static float SetBonusHookBoost = 0.5f; + public static int SetBonusDashDelayReductionInterval = 3; + public override void SetDefaults() { Item.width = 24; Item.height = 28; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; - Item.defense = 13; //46 + Item.defense = 13; // 55 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -37,17 +43,17 @@ namespace CalamityMod.Items.Armor.Reaver var modPlayer = player.Calamity(); modPlayer.reaverSpeed = true; modPlayer.wearingRogueArmor = true; - player.setBonus = this.GetLocalizedValue("SetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusFlightBoost.ToPercent(), SetBonusHookBoost.ToPercent(), (1 / (float)SetBonusDashDelayReductionInterval).ToPercent()); player.noFallDmg = true; player.autoJump = true; - if (player.miscCounter % 3 == 2 && player.dashDelay > 0) + if (player.miscCounter % SetBonusDashDelayReductionInterval == 1 && player.dashDelay > 0) player.dashDelay--; } public override void UpdateEquip(Player player) { - player.jumpSpeedBoost += 0.5f; - player.moveSpeed += 0.15f; + player.moveSpeed += MoveSpeedBoost; + player.jumpSpeedBoost += JumpSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Reaver/ReaverHeadTank.cs b/Items/Armor/Reaver/ReaverHeadTank.cs index cfed218502..2048aa9684 100644 --- a/Items/Armor/Reaver/ReaverHeadTank.cs +++ b/Items/Armor/Reaver/ReaverHeadTank.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Reaver @@ -13,23 +14,28 @@ namespace CalamityMod.Items.Armor.Reaver public new string LocalizationCategory => "Items.Armor.Hardmode"; internal static string HealOrbEntitySourceContext => "SetBonus_Calamity_ReaverTank"; + public static int MaxLifeBoost = 50; + public static int RegenBoost = 8; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxLifeBoost, RegenBoost.ToRegenPerSecond()); + + // Set Bonus + public static int SetBonusAggroBoost = 600; + public static float SetBonusDebuffDamageReduction = 0.2f; + public static float SetBonusMobilityReduction = 0.3f; + public static int ReaverRageDuration = CalamityUtils.SecondsToFrames(5); public static int ReaverRageDefenseBoost = 5; public static float ReaverRageDamageBoost = 0.1f; - //Defense and DR Helm public override void SetDefaults() { Item.width = 28; Item.height = 30; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; - Item.defense = 30; //63 => 73 w/ set bonus (+5 w/ Reaver Rage) + Item.defense = 28; // 70 (75 with Reaver Rage) } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -40,21 +46,17 @@ namespace CalamityMod.Items.Armor.Reaver public override void UpdateArmorSet(Player player) { var modPlayer = player.Calamity(); - player.thorns += 0.33f; - player.moveSpeed -= 0.3f; - player.statDefense += 10; - player.lifeRegen += 10; - player.aggro += 600; + player.moveSpeed -= SetBonusMobilityReduction; + player.aggro += SetBonusAggroBoost; modPlayer.reaverDefense = true; modPlayer.wearingRogueArmor = true; - player.setBonus = this.GetLocalizedValue("SetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusDebuffDamageReduction.ToPercent(), SetBonusMobilityReduction.ToPercent(), ReaverRageDuration.FramesToSeconds()); } public override void UpdateEquip(Player player) { - player.GetDamage() -= 0.3f; - player.endurance += 0.15f; - player.statLifeMax2 += 50; + player.statLifeMax2 += MaxLifeBoost; + player.lifeRegen += RegenBoost; } public override void AddRecipes() diff --git a/Items/Armor/Reaver/ReaverScaleMail.cs b/Items/Armor/Reaver/ReaverScaleMail.cs index 7d1f5a9221..90cba4743e 100644 --- a/Items/Armor/Reaver/ReaverScaleMail.cs +++ b/Items/Armor/Reaver/ReaverScaleMail.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Reaver @@ -9,9 +10,12 @@ namespace CalamityMod.Items.Armor.Reaver public class ReaverScaleMail : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float DamageReductionBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageReductionBoost.ToPercent()); + public override void SetStaticDefaults() { - if (Main.dedServ) return; @@ -27,14 +31,10 @@ namespace CalamityMod.Items.Armor.Reaver Item.height = 22; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; - Item.defense = 19; + Item.defense = 24; } - public override void UpdateEquip(Player player) - { - player.GetDamage() += 0.09f; - player.GetCritChance() += 4; - } + public override void UpdateEquip(Player player) => player.endurance += DamageReductionBoost; public override void AddRecipes() { diff --git a/Items/Armor/SnowRuffian/SnowRuffianGreaves.cs b/Items/Armor/SnowRuffian/SnowRuffianGreaves.cs index c60b5ea5f6..8c1bbf66ac 100644 --- a/Items/Armor/SnowRuffian/SnowRuffianGreaves.cs +++ b/Items/Armor/SnowRuffian/SnowRuffianGreaves.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Items.Armor.SnowRuffian { public new string LocalizationCategory => "Items.Armor.PreHardmode"; - public static float MoveSpeedBoost = 0.1f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedBoost.ToPercent()); + public static int RangedCritBoost = 4; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedCritBoost); public override void SetDefaults() { @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Armor.SnowRuffian Item.defense = 4; //12 } - public override void UpdateEquip(Player player) => player.moveSpeed += MoveSpeedBoost; + public override void UpdateEquip(Player player) => player.GetCritChance() += RangedCritBoost; public override void AddRecipes() { diff --git a/Items/Armor/SnowRuffian/SnowRuffianMask.cs b/Items/Armor/SnowRuffian/SnowRuffianMask.cs index c4fb0c3726..7a54d2afea 100644 --- a/Items/Armor/SnowRuffian/SnowRuffianMask.cs +++ b/Items/Armor/SnowRuffian/SnowRuffianMask.cs @@ -10,13 +10,13 @@ namespace CalamityMod.Items.Armor.SnowRuffian public class SnowRuffianMask : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; - private bool shouldBoost = false; - public static float RangedDamageBoost = 0.02f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent()); + public static int RangedCritBoost = 4; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedCritBoost); - public static float SetBonusRangedDamageBoost = 0.04f; - public static int SetBonusRangedCritBoost = 4; // NOTE: Tooltip shares this number with damage % as they're equal + // Set Bonus + public static float GlideFallSpeedMult = 0.9f; + public static int SetBonusFrostburnDuration = CalamityUtils.SecondsToFrames(3); public override void Load() { @@ -32,40 +32,19 @@ namespace CalamityMod.Items.Armor.SnowRuffian Item.height = 18; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; - Item.defense = 3; //12 + Item.defense = 3; // 12 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void UpdateArmorSet(Player player) { var modPlayer = player.Calamity(); modPlayer.snowRuffianSet = true; - player.GetCritChance() += SetBonusRangedCritBoost; - player.GetDamage() += SetBonusRangedDamageBoost; - player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRangedDamageBoost.ToPercent()); - - if (player.controlJump) - { - player.noFallDmg = true; - player.UpdateJumpHeight(); - if (shouldBoost && !player.mount.Active) - { - player.velocity.X *= 1.1f; - shouldBoost = false; - } - - } - else if (!shouldBoost && player.velocity.Y == 0) - { - shouldBoost = true; - } + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusFrostburnDuration.FramesToSeconds()); } - public override void UpdateEquip(Player player) => player.GetDamage() += RangedDamageBoost; + public override void UpdateEquip(Player player) => player.GetCritChance() += RangedCritBoost; public override void AddRecipes() { @@ -78,21 +57,8 @@ namespace CalamityMod.Items.Armor.SnowRuffian Register(); } } + public class SnowRuffianWings : EquipTexture { - public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) - { - ascentWhenFalling = 0.5f; - ascentWhenRising = 0f; - maxCanAscendMultiplier = 0f; - maxAscentMultiplier = 0f; - constantAscend = 0f; - } - - public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) - { - speed = 2f; - acceleration *= 1.25f; - } } } diff --git a/Items/Armor/Statigel/StatigelHeadMagic.cs b/Items/Armor/Statigel/StatigelHeadMagic.cs index 93f2a97fb6..26acf35900 100644 --- a/Items/Armor/Statigel/StatigelHeadMagic.cs +++ b/Items/Armor/Statigel/StatigelHeadMagic.cs @@ -14,11 +14,11 @@ namespace CalamityMod.Items.Armor.Statigel { public new string LocalizationCategory => "Items.Armor.PreHardmode"; - public static float MagicDamageBoost = 0.1f; - public static float ManaCostReduction = 0.1f; - public static int MagicCritBoost = 7; public static int MaxManaBoost = 40; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MagicDamageBoost.ToPercent(), ManaCostReduction.ToPercent(), MagicCritBoost, MaxManaBoost); + public static float ManaCostReduction = 0.1f; + public static float MagicDamageBoost = 0.1f; + public static int MagicCritBoost = 7; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, ManaCostReduction.ToPercent(), MagicDamageBoost.ToPercent(), MagicCritBoost); public override void SetDefaults() { diff --git a/Items/Armor/Statigel/StatigelHeadSummon.cs b/Items/Armor/Statigel/StatigelHeadSummon.cs index d21794d3d6..865e54846e 100644 --- a/Items/Armor/Statigel/StatigelHeadSummon.cs +++ b/Items/Armor/Statigel/StatigelHeadSummon.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Items.Armor.Statigel public static float SummonKBBoost = 1.5f; // Set Bonus - public static float SetBonusSummonDamageBoost = 0.18f; public static int SetBonusMinionSlotBoost = 1; + public static float SetBonusSummonDamageBoost = 0.18f; public static int SlimeDamage = 18; public override void SetDefaults() @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Armor.Statigel public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusSummonDamageBoost.ToPercent(), SetBonusMinionSlotBoost) + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusSummonDamageBoost.ToPercent()) + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(StatigelArmor.SetBonusHurtDamageThreshold, StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); var modPlayer = player.Calamity(); modPlayer.statigelSet = true; diff --git a/Items/Armor/Sulphurous/SulphurousBreastplate.cs b/Items/Armor/Sulphurous/SulphurousBreastplate.cs index 4ea81c11f6..e28b61c5e4 100644 --- a/Items/Armor/Sulphurous/SulphurousBreastplate.cs +++ b/Items/Armor/Sulphurous/SulphurousBreastplate.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.Localization; @@ -14,8 +14,7 @@ namespace CalamityMod.Items.Armor.Sulphurous public new string LocalizationCategory => "Items.Armor.PreHardmode"; public static float RogueDamageBoost = 0.06f; - public static int RogueCritBoost = 4; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), RogueCritBoost); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent()); public override void SetDefaults() { @@ -26,11 +25,7 @@ namespace CalamityMod.Items.Armor.Sulphurous Item.rare = ItemRarityID.Green; } - public override void UpdateEquip(Player player) - { - player.GetDamage() += RogueDamageBoost; - player.GetCritChance() += RogueCritBoost; - } + public override void UpdateEquip(Player player) => player.GetDamage() += RogueDamageBoost; public override void AddRecipes() { diff --git a/Items/Armor/Sulphurous/SulphurousHelmet.cs b/Items/Armor/Sulphurous/SulphurousHelmet.cs index b51341ccb6..d61781b6ea 100644 --- a/Items/Armor/Sulphurous/SulphurousHelmet.cs +++ b/Items/Armor/Sulphurous/SulphurousHelmet.cs @@ -1,7 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.ExtraJumps; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.Localization; @@ -15,11 +15,11 @@ namespace CalamityMod.Items.Armor.Sulphurous { public new string LocalizationCategory => "Items.Armor.PreHardmode"; - public static float RogueDamageBoost = 0.04f; - public static int RogueCritBoost = 2; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), RogueCritBoost); + public static int RogueCritBoost = 6; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueCritBoost); // Set Bonus + public static int SetBonusPoisonDuration = CalamityUtils.SecondsToFrames(1); public static float SetBonusRogueStealth = 0.65f; public static int BubbleDamage = 20; @@ -39,18 +39,16 @@ namespace CalamityMod.Items.Armor.Sulphurous public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth()); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), SetBonusPoisonDuration.FramesToSeconds()); var modPlayer = player.Calamity(); modPlayer.sulphurSet = true; player.GetJumpState().Enable(); modPlayer.rogueStealthMax += SetBonusRogueStealth; modPlayer.wearingRogueArmor = true; - player.ignoreWater = true; } public override void UpdateEquip(Player player) { - player.GetDamage() += RogueDamageBoost; player.GetCritChance() += RogueCritBoost; if (player.Calamity().countsAsAnyWet) player.gills = true; diff --git a/Items/Armor/Sulphurous/SulphurousLeggings.cs b/Items/Armor/Sulphurous/SulphurousLeggings.cs index 3ecac0ae25..b9ed660705 100644 --- a/Items/Armor/Sulphurous/SulphurousLeggings.cs +++ b/Items/Armor/Sulphurous/SulphurousLeggings.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.Localization; @@ -13,9 +13,8 @@ namespace CalamityMod.Items.Armor.Sulphurous { public new string LocalizationCategory => "Items.Armor.PreHardmode"; - public static float MoveSpeedBoost = 0.1f; - public static float SubmergedMoveSpeedBoostBuff = 0.25f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedBoost.ToPercent(), SubmergedMoveSpeedBoostBuff.ToPercent()); + public static float RogueDamageBoost = 0.04f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent()); public override void SetDefaults() { @@ -26,7 +25,7 @@ namespace CalamityMod.Items.Armor.Sulphurous Item.rare = ItemRarityID.Green; } - public override void UpdateEquip(Player player) => player.moveSpeed += MoveSpeedBoost + (player.Calamity().countsAsAnyWet ? SubmergedMoveSpeedBoostBuff : 0f); + public override void UpdateEquip(Player player) => player.GetDamage() += RogueDamageBoost; public override void AddRecipes() { diff --git a/Items/Armor/Tarragon/TarragonHeadMelee.cs b/Items/Armor/Tarragon/TarragonHeadMelee.cs index c8b34346d0..3afaa9f935 100644 --- a/Items/Armor/Tarragon/TarragonHeadMelee.cs +++ b/Items/Armor/Tarragon/TarragonHeadMelee.cs @@ -39,8 +39,7 @@ namespace CalamityMod.Items.Armor.Tarragon modPlayer.tarraMelee = true; player.GetAttackSpeed() += 0.15f; player.aggro += 800; - var hotkey = CalamityKeybinds.ArmorSetBonusHotKey.TooltipHotkeyString(); - player.setBonus = this.GetLocalization("SetBonus").Format(hotkey) + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey()) + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); } public override void UpdateEquip(Player player) diff --git a/Items/Armor/TitanHeart/TitanHeartBoots.cs b/Items/Armor/TitanHeart/TitanHeartBoots.cs index 914d95e5ae..ee6ce3d15d 100644 --- a/Items/Armor/TitanHeart/TitanHeartBoots.cs +++ b/Items/Armor/TitanHeart/TitanHeartBoots.cs @@ -1,7 +1,8 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Items.Placeables.FurnitureMonolith; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.TitanHeart @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Armor.TitanHeart public class TitanHeartBoots : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float RogueDamageBoost = 0.07f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; @@ -19,12 +24,7 @@ namespace CalamityMod.Items.Armor.TitanHeart Item.defense = 10; } - public override void UpdateEquip(Player player) - { - player.Calamity().titanHeartBoots = true; - player.Calamity().rogueVelocity += 0.1f; - player.GetDamage() += 0.04f; - } + public override void UpdateEquip(Player player) => player.GetDamage() += RogueDamageBoost; public override void AddRecipes() { diff --git a/Items/Armor/TitanHeart/TitanHeartMantle.cs b/Items/Armor/TitanHeart/TitanHeartMantle.cs index cb334b1569..8c6546226e 100644 --- a/Items/Armor/TitanHeart/TitanHeartMantle.cs +++ b/Items/Armor/TitanHeart/TitanHeartMantle.cs @@ -1,7 +1,8 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Items.Placeables.FurnitureMonolith; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.TitanHeart @@ -10,6 +11,11 @@ namespace CalamityMod.Items.Armor.TitanHeart public class TitanHeartMantle : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float RogueDamageBoost = 0.1f; + public static float RogueKnockbackBoost = 0.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), RogueKnockbackBoost.ToPercent()); + public override void SetStaticDefaults() { if (Main.dedServ) @@ -33,7 +39,7 @@ namespace CalamityMod.Items.Armor.TitanHeart public override void UpdateEquip(Player player) { player.Calamity().titanHeartMantle = true; - player.GetDamage() += 0.05f; + player.GetDamage() += RogueDamageBoost; } public override void AddRecipes() diff --git a/Items/Armor/TitanHeart/TitanHeartMask.cs b/Items/Armor/TitanHeart/TitanHeartMask.cs index e11981cf6d..9c19cf421c 100644 --- a/Items/Armor/TitanHeart/TitanHeartMask.cs +++ b/Items/Armor/TitanHeart/TitanHeartMask.cs @@ -1,8 +1,9 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Items.Placeables.FurnitureMonolith; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.TitanHeart @@ -11,6 +12,17 @@ namespace CalamityMod.Items.Armor.TitanHeart public class TitanHeartMask : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float RogueDamageBoost = 0.07f; + public static float RogueVelocityBoost = 0.1f; + public static int OnHitDebuffDuration = CalamityUtils.SecondsToFrames(2); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), RogueVelocityBoost.ToPercent()); + + // Set Bonus + public static float SetBonusRogueStealth = 1f; + public static float StealthStrikeKnockbackMult = 2f; + public static int ExplosionDamage = 40; + public override void SetDefaults() { Item.width = 18; @@ -20,18 +32,14 @@ namespace CalamityMod.Items.Armor.TitanHeart Item.defense = 8; // 32 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), StealthStrikeKnockbackMult); var modPlayer = player.Calamity(); modPlayer.titanHeartSet = true; - player.GetDamage() += 0.10f; - modPlayer.rogueStealthMax += 1f; + modPlayer.rogueStealthMax += SetBonusRogueStealth; modPlayer.wearingRogueArmor = true; player.noKnockback = true; } @@ -40,7 +48,8 @@ namespace CalamityMod.Items.Armor.TitanHeart { var modPlayer = player.Calamity(); modPlayer.titanHeartMask = true; - player.GetDamage() += 0.05f; + player.GetDamage() += RogueDamageBoost; + modPlayer.rogueVelocity += RogueVelocityBoost; } public override void AddRecipes() diff --git a/Items/Armor/Umbraphile/UmbraphileBoots.cs b/Items/Armor/Umbraphile/UmbraphileBoots.cs index e48dd4b34e..859cb449dc 100644 --- a/Items/Armor/Umbraphile/UmbraphileBoots.cs +++ b/Items/Armor/Umbraphile/UmbraphileBoots.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Umbraphile @@ -9,6 +10,12 @@ namespace CalamityMod.Items.Armor.Umbraphile public class UmbraphileBoots : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float RogueDamageBoost = 0.09f; + public static int RogueCritBoost = 6; + public static float MoveSpeedBoost = 0.2f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), RogueCritBoost, MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 22; @@ -20,9 +27,9 @@ namespace CalamityMod.Items.Armor.Umbraphile public override void UpdateEquip(Player player) { - player.moveSpeed += 0.2f; - player.GetDamage() += 0.09f; - player.GetCritChance() += 6; + player.GetDamage() += RogueDamageBoost; + player.GetCritChance() += RogueCritBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Umbraphile/UmbraphileHood.cs b/Items/Armor/Umbraphile/UmbraphileHood.cs index 0c5da98a99..ee5322384f 100644 --- a/Items/Armor/Umbraphile/UmbraphileHood.cs +++ b/Items/Armor/Umbraphile/UmbraphileHood.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Umbraphile @@ -10,6 +11,16 @@ namespace CalamityMod.Items.Armor.Umbraphile public class UmbraphileHood : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float RogueDamageBoost = 0.08f; + public static float RogueVelocityBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), RogueVelocityBoost.ToPercent()); + + // Set Bonus + public static float SetBonusRogueStealth = 1.1f; + public static double ExplosionDamageRatio = 0.2D; + public static int ExplosionDamageSoftcap = 50; + public override void SetDefaults() { Item.width = 22; @@ -19,29 +30,23 @@ namespace CalamityMod.Items.Armor.Umbraphile Item.defense = 10; } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadow = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadow = true; public override void UpdateArmorSet(Player player) { var modPlayer = player.Calamity(); modPlayer.umbraphileSet = true; - modPlayer.rogueStealthMax += 1.1f; - player.setBonus = this.GetLocalizedValue("SetBonus"); + modPlayer.rogueStealthMax += SetBonusRogueStealth; + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth()); player.Calamity().wearingRogueArmor = true; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.08f; - player.Calamity().rogueVelocity += 0.1f; + player.GetDamage() += RogueDamageBoost; + player.Calamity().rogueVelocity += RogueVelocityBoost; } public override void AddRecipes() diff --git a/Items/Armor/Umbraphile/UmbraphileRegalia.cs b/Items/Armor/Umbraphile/UmbraphileRegalia.cs index f281752294..46a9661e5e 100644 --- a/Items/Armor/Umbraphile/UmbraphileRegalia.cs +++ b/Items/Armor/Umbraphile/UmbraphileRegalia.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Umbraphile @@ -9,6 +10,11 @@ namespace CalamityMod.Items.Armor.Umbraphile public class UmbraphileRegalia : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float RogueDamageBoost = 0.1f; + public static int RogueCritBoost = 10; // NOTE: Tooltip shares this number with damage % as they're equal + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent()); + public override void SetDefaults() { Item.width = 38; @@ -20,8 +26,8 @@ namespace CalamityMod.Items.Armor.Umbraphile public override void UpdateEquip(Player player) { - player.GetDamage() += 0.1f; - player.GetCritChance() += 10; + player.GetDamage() += RogueDamageBoost; + player.GetCritChance() += RogueCritBoost; } public override void AddRecipes() diff --git a/Items/Armor/Vanity/BrimstoneWaifuMask.cs b/Items/Armor/Vanity/BrimstoneElementalMask.cs similarity index 85% rename from Items/Armor/Vanity/BrimstoneWaifuMask.cs rename to Items/Armor/Vanity/BrimstoneElementalMask.cs index f71c4a3de6..5fd09e0622 100644 --- a/Items/Armor/Vanity/BrimstoneWaifuMask.cs +++ b/Items/Armor/Vanity/BrimstoneElementalMask.cs @@ -5,7 +5,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Vanity { [AutoloadEquip(EquipType.Head)] - public class BrimstoneWaifuMask : ModItem, ILocalizedModType + [LegacyName("BrimstoneWaifuMask")] + public class BrimstoneElementalMask : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Vanity"; public override void SetStaticDefaults() diff --git a/Items/Armor/Vanity/BrimstoneWaifuMask.png b/Items/Armor/Vanity/BrimstoneElementalMask.png similarity index 100% rename from Items/Armor/Vanity/BrimstoneWaifuMask.png rename to Items/Armor/Vanity/BrimstoneElementalMask.png diff --git a/Items/Armor/Vanity/BrimstoneWaifuMask_Head.png b/Items/Armor/Vanity/BrimstoneElementalMask_Head.png similarity index 100% rename from Items/Armor/Vanity/BrimstoneWaifuMask_Head.png rename to Items/Armor/Vanity/BrimstoneElementalMask_Head.png diff --git a/Items/Armor/Vanity/GodSlayerHornedHelm.cs b/Items/Armor/Vanity/GodSlayerHornedHelm.cs index a836fe3c1c..8c0eed2305 100644 --- a/Items/Armor/Vanity/GodSlayerHornedHelm.cs +++ b/Items/Armor/Vanity/GodSlayerHornedHelm.cs @@ -15,18 +15,12 @@ namespace CalamityMod.Items.Armor.Vanity Item.width = 18; Item.height = 18; Item.vanity = true; - Item.value = Item.buyPrice(gold: 8); // Sold by Clothier + Item.value = Item.buyPrice(gold: 10); // Sold by Clothier Item.rare = ItemRarityID.Blue; } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadow = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadow = true; } } diff --git a/Items/Armor/Vanity/GodSlayerVisage.cs b/Items/Armor/Vanity/GodSlayerVisage.cs index c9b7d49835..2f7e24be7f 100644 --- a/Items/Armor/Vanity/GodSlayerVisage.cs +++ b/Items/Armor/Vanity/GodSlayerVisage.cs @@ -15,18 +15,12 @@ namespace CalamityMod.Items.Armor.Vanity Item.width = 18; Item.height = 18; Item.vanity = true; - Item.value = Item.buyPrice(gold: 8); // Sold by Clothier + Item.value = Item.buyPrice(gold: 10); // Sold by Clothier Item.rare = ItemRarityID.Blue; } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadow = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadow = true; } } diff --git a/Items/Armor/Vanity/SilvaHelm.cs b/Items/Armor/Vanity/SilvaHelm.cs index 99539418de..45d38e664e 100644 --- a/Items/Armor/Vanity/SilvaHelm.cs +++ b/Items/Armor/Vanity/SilvaHelm.cs @@ -15,18 +15,12 @@ namespace CalamityMod.Items.Armor.Vanity Item.width = 24; Item.height = 20; Item.vanity = true; - Item.value = Item.buyPrice(gold: 8); // Sold by Clothier + Item.value = Item.buyPrice(gold: 10); // Sold by Clothier Item.rare = ItemRarityID.Blue; } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadow = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadow = true; } } diff --git a/Items/Armor/Vanity/SilvaHornedHelm.cs b/Items/Armor/Vanity/SilvaHornedHelm.cs index 573b5948fd..fa01598ee5 100644 --- a/Items/Armor/Vanity/SilvaHornedHelm.cs +++ b/Items/Armor/Vanity/SilvaHornedHelm.cs @@ -15,18 +15,12 @@ namespace CalamityMod.Items.Armor.Vanity Item.width = 26; Item.height = 24; Item.vanity = true; - Item.value = Item.buyPrice(gold: 8); // Sold by Clothier + Item.value = Item.buyPrice(gold: 10); // Sold by Clothier Item.rare = ItemRarityID.Blue; } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadow = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadow = true; } } diff --git a/Items/Armor/Vanity/SilvaMask.cs b/Items/Armor/Vanity/SilvaMask.cs index 2c61760d43..bfe18a6dfd 100644 --- a/Items/Armor/Vanity/SilvaMask.cs +++ b/Items/Armor/Vanity/SilvaMask.cs @@ -15,18 +15,12 @@ namespace CalamityMod.Items.Armor.Vanity Item.width = 24; Item.height = 26; Item.vanity = true; - Item.value = Item.buyPrice(gold: 8); // Sold by Clothier + Item.value = Item.buyPrice(gold: 10); // Sold by Clothier Item.rare = ItemRarityID.Blue; } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadow = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadow = true; } } diff --git a/Items/Armor/Vanity/VictideCoralTurban.cs b/Items/Armor/Vanity/VictideCoralTurban.cs new file mode 100644 index 0000000000..319b72db0b --- /dev/null +++ b/Items/Armor/Vanity/VictideCoralTurban.cs @@ -0,0 +1,23 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Head)] + [LegacyName("VictideVisage", "VictideHeadRanged")] + public class VictideCoralTurban : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Armor.Vanity"; + public override void SetDefaults() + { + Item.width = 18; + Item.height = 18; + Item.vanity = true; + Item.value = CalamityGlobalItem.RarityGreenBuyPrice; + Item.rare = ItemRarityID.Green; + } + } +} diff --git a/Items/Armor/Victide/VictideHeadRanged.png b/Items/Armor/Vanity/VictideCoralTurban.png similarity index 100% rename from Items/Armor/Victide/VictideHeadRanged.png rename to Items/Armor/Vanity/VictideCoralTurban.png diff --git a/Items/Armor/Victide/VictideHeadRanged_Head.png b/Items/Armor/Vanity/VictideCoralTurban_Head.png similarity index 100% rename from Items/Armor/Victide/VictideHeadRanged_Head.png rename to Items/Armor/Vanity/VictideCoralTurban_Head.png diff --git a/Items/Armor/Vanity/VictideShellmet.cs b/Items/Armor/Vanity/VictideShellmet.cs new file mode 100644 index 0000000000..86460c0dca --- /dev/null +++ b/Items/Armor/Vanity/VictideShellmet.cs @@ -0,0 +1,23 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Head)] + [LegacyName("VictideHelm", "VictideHeadMelee")] + public class VictideShellmet : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Armor.Vanity"; + public override void SetDefaults() + { + Item.width = 18; + Item.height = 18; + Item.vanity = true; + Item.value = CalamityGlobalItem.RarityGreenBuyPrice; + Item.rare = ItemRarityID.Green; + } + } +} diff --git a/Items/Armor/Victide/VictideHeadMelee.png b/Items/Armor/Vanity/VictideShellmet.png similarity index 100% rename from Items/Armor/Victide/VictideHeadMelee.png rename to Items/Armor/Vanity/VictideShellmet.png diff --git a/Items/Armor/Victide/VictideHeadMelee_Head.png b/Items/Armor/Vanity/VictideShellmet_Head.png similarity index 100% rename from Items/Armor/Victide/VictideHeadMelee_Head.png rename to Items/Armor/Vanity/VictideShellmet_Head.png diff --git a/Items/Armor/Victide/VictideBreastplate.cs b/Items/Armor/Victide/VictideBreastplate.cs index 21d2e2b914..5e39ddee61 100644 --- a/Items/Armor/Victide/VictideBreastplate.cs +++ b/Items/Armor/Victide/VictideBreastplate.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Victide @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Armor.Victide public new string LocalizationCategory => "Items.Armor.PreHardmode"; public string BulkTexture => "CalamityMod/Items/Armor/Victide/VictideBreastplate_Bulk"; + public static int RegenBoost = 2; + + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond()); + public override void Load() { if (!Main.dedServ) @@ -22,7 +27,6 @@ namespace CalamityMod.Items.Armor.Victide public override void SetStaticDefaults() { - if (!Main.dedServ) { var equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); @@ -37,18 +41,12 @@ namespace CalamityMod.Items.Armor.Victide Item.height = 18; Item.value = CalamityGlobalItem.RarityGreenBuyPrice; Item.rare = ItemRarityID.Green; - Item.defense = 5; //9 + Item.defense = 5; } public override void UpdateEquip(Player player) { - player.endurance += 0.05f; - player.GetCritChance() += 5; - if (player.Calamity().countsAsAnyWet) - { - player.statDefense += 5; - player.endurance += 0.1f; - } + player.lifeRegen += RegenBoost; } public override void AddRecipes() diff --git a/Items/Armor/Victide/VictideGreaves.cs b/Items/Armor/Victide/VictideGreaves.cs index 395a2e977b..dd8c3b9b22 100644 --- a/Items/Armor/Victide/VictideGreaves.cs +++ b/Items/Armor/Victide/VictideGreaves.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Victide @@ -10,9 +11,13 @@ namespace CalamityMod.Items.Armor.Victide public class VictideGreaves : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float MoveSpeedBoost = 0.1f; + + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedBoost.ToPercent()); + public override void SetStaticDefaults() { - if (!Main.dedServ) { var equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); @@ -26,12 +31,12 @@ namespace CalamityMod.Items.Armor.Victide Item.height = 18; Item.value = CalamityGlobalItem.RarityGreenBuyPrice; Item.rare = ItemRarityID.Green; - Item.defense = 4; //9 + Item.defense = 4; } public override void UpdateEquip(Player player) { - player.moveSpeed += player.Calamity().countsAsAnyWet ? 0.3f : 0.08f; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Victide/VictideHeadBarrier.cs b/Items/Armor/Victide/VictideHeadBarrier.cs new file mode 100644 index 0000000000..0cd59efdd7 --- /dev/null +++ b/Items/Armor/Victide/VictideHeadBarrier.cs @@ -0,0 +1,76 @@ +using System; +using CalamityMod.CalPlayer; +using CalamityMod.Cooldowns; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor.Victide +{ + [AutoloadEquip(EquipType.Head)] + [LegacyName("VictideMask", "VictideHeadMagic")] + public class VictideHeadBarrier : ModItem, ILocalizedModType // Defense/Mobility set + { + public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static int RegenBoost = 2; + public static float RunAccelerationMult = 1.75f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), RunAccelerationMult.Round()); + + // Set Bonus + public static int BarrierCooldown = CalamityUtils.SecondsToFrames(8); + public static int BarrierDefenseBoost = 8; + public static float BarrierDamageAbsorptionPercent = 0.1f; + public static int BarrierDamage = 50; + public static float BarrierExplosionKB = 8f; + + public override void SetDefaults() + { + Item.width = 18; + Item.height = 18; + Item.value = CalamityGlobalItem.RarityGreenBuyPrice; + Item.rare = ItemRarityID.Green; + Item.defense = 7; // 16 + } + + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); + + public override void UpdateArmorSet(Player player) + { + Color AbilityBriefColor = Color.Lerp(new Color(97, 200, 255), new Color(255, 170, 204), 0.5f + 0.5f * MathF.Sin(Main.GlobalTimeWrappedHourly * 3f)); + player.setBonus = this.GetLocalization("SetBonus").Format(AbilityBriefColor.Hex3(), BarrierDefenseBoost, BarrierDamageAbsorptionPercent.ToPercent(), CalamityUtils.GetArmorSetBonusKey(), BarrierCooldown.FramesToSeconds()); + player.Calamity().victideBarrierSet = true; + + if (!player.HasCooldown(WardingWave.ID)) + { + player.statDefense += BarrierDefenseBoost; + + if (player.whoAmI == Main.myPlayer && player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) + { + // Damage will be set once explosion goes off + var source = player.GetSource_ItemUse(Item); + Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI); + } + } + } + + public override void UpdateEquip(Player player) + { + player.lifeRegen += RegenBoost; + player.Calamity().victideBarrierHead = true; + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(3). + AddTile(TileID.Anvils). + SortBeforeFirstRecipesOf(ModContent.ItemType()). + Register(); + } + } +} diff --git a/Items/Armor/Victide/VictideHeadMagic.png b/Items/Armor/Victide/VictideHeadBarrier.png similarity index 100% rename from Items/Armor/Victide/VictideHeadMagic.png rename to Items/Armor/Victide/VictideHeadBarrier.png diff --git a/Items/Armor/Victide/VictideHeadMagic_Head.png b/Items/Armor/Victide/VictideHeadBarrier_Head.png similarity index 100% rename from Items/Armor/Victide/VictideHeadMagic_Head.png rename to Items/Armor/Victide/VictideHeadBarrier_Head.png diff --git a/Items/Armor/Victide/VictideHeadBurrow.cs b/Items/Armor/Victide/VictideHeadBurrow.cs new file mode 100644 index 0000000000..beb9f5767b --- /dev/null +++ b/Items/Armor/Victide/VictideHeadBurrow.cs @@ -0,0 +1,64 @@ +using System; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor.Victide +{ + [AutoloadEquip(EquipType.Head)] + [LegacyName("VictideHeadgear", "VictideHeadRogue")] + public class VictideHeadBurrow : ModItem, ILocalizedModType // Mobility/Utility set + { + public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float MoveSpeedAccelerationBoost = 0.15f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedAccelerationBoost.ToPercent()); + + // Set Bonus + public static float BaseBurrowSpeed = 9f; // 46 mph + public static float SubmergedBurrowSpeed = 12f; // 61 mph + public static float BaseAcceleration = 0.4f; // For reference, base player running acceleration is 0.08 + public static int BurrowDuration = CalamityUtils.SecondsToFrames(8); + public static int BurrowCooldown = CalamityUtils.SecondsToFrames(30); + + public override void SetDefaults() + { + Item.width = 18; + Item.height = 18; + Item.value = CalamityGlobalItem.RarityGreenBuyPrice; + Item.rare = ItemRarityID.Green; + Item.defense = 5; // 14 + } + + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); + + public override void UpdateArmorSet(Player player) + { + Color AbilityBriefColor = Color.Lerp(new Color(97, 200, 255), new Color(255, 170, 204), 0.5f + 0.5f * MathF.Sin(Main.GlobalTimeWrappedHourly * 3f)); + player.setBonus = this.GetLocalization("SetBonus").Format(AbilityBriefColor.Hex3(), CalamityUtils.GetArmorSetBonusKey(), BurrowDuration.FramesToSeconds(), BurrowCooldown.FramesToSeconds()); + player.Calamity().victideBurrowSet = true; + player.ignoreWater = true; + } + + public override void UpdateEquip(Player player) + { + player.Calamity().victideBurrowHead = true; + player.moveSpeed += MoveSpeedAccelerationBoost; + if (player.IsUnderwater()) + player.gills = true; + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(3). + AddTile(TileID.Anvils). + SortBeforeFirstRecipesOf(ModContent.ItemType()). + Register(); + } + } +} diff --git a/Items/Armor/Victide/VictideHeadRogue.png b/Items/Armor/Victide/VictideHeadBurrow.png similarity index 100% rename from Items/Armor/Victide/VictideHeadRogue.png rename to Items/Armor/Victide/VictideHeadBurrow.png diff --git a/Items/Armor/Victide/VictideHeadRogue_Head.png b/Items/Armor/Victide/VictideHeadBurrow_Head.png similarity index 100% rename from Items/Armor/Victide/VictideHeadRogue_Head.png rename to Items/Armor/Victide/VictideHeadBurrow_Head.png diff --git a/Items/Armor/Victide/VictideHeadMagic.cs b/Items/Armor/Victide/VictideHeadMagic.cs deleted file mode 100644 index cd54798dff..0000000000 --- a/Items/Armor/Victide/VictideHeadMagic.cs +++ /dev/null @@ -1,55 +0,0 @@ -using CalamityMod.CalPlayer; -using CalamityMod.Items.Materials; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Armor.Victide -{ - [AutoloadEquip(EquipType.Head)] - [LegacyName("VictideMask")] - public class VictideHeadMagic : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Armor.PreHardmode"; - public override void SetDefaults() - { - Item.width = 18; - Item.height = 18; - Item.value = CalamityGlobalItem.RarityGreenBuyPrice; - Item.rare = ItemRarityID.Green; - Item.defense = 2; //9 - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); - var modPlayer = player.Calamity(); - modPlayer.victideSet = true; - player.ignoreWater = true; - if (player.Calamity().countsAsAnyWet) - { - player.GetDamage() += 0.1f; - player.lifeRegen += 3; - } - } - - public override void UpdateEquip(Player player) - { - player.GetDamage() += 0.05f; - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(3). - AddTile(TileID.Anvils). - SortBeforeFirstRecipesOf(ModContent.ItemType()). - Register(); - } - } -} diff --git a/Items/Armor/Victide/VictideHeadMelee.cs b/Items/Armor/Victide/VictideHeadMelee.cs deleted file mode 100644 index 2ce93d2cfe..0000000000 --- a/Items/Armor/Victide/VictideHeadMelee.cs +++ /dev/null @@ -1,56 +0,0 @@ -using CalamityMod.CalPlayer; -using CalamityMod.Items.Materials; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Armor.Victide -{ - [AutoloadEquip(EquipType.Head)] - [LegacyName("VictideHelm")] - public class VictideHeadMelee : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Armor.PreHardmode"; - public override void SetDefaults() - { - Item.width = 18; - Item.height = 18; - Item.value = CalamityGlobalItem.RarityGreenBuyPrice; - Item.rare = ItemRarityID.Green; - Item.defense = 4; //11 - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); - var modPlayer = player.Calamity(); - modPlayer.victideSet = true; - player.ignoreWater = true; - if (player.Calamity().countsAsAnyWet) - { - player.GetDamage() += 0.1f; - player.lifeRegen += 3; - } - player.aggro += 200; - } - - public override void UpdateEquip(Player player) - { - player.GetDamage() += 0.05f; - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(3). - AddTile(TileID.Anvils). - SortBeforeFirstRecipesOf(ModContent.ItemType()). - Register(); - } - } -} diff --git a/Items/Armor/Victide/VictideHeadRanged.cs b/Items/Armor/Victide/VictideHeadRanged.cs deleted file mode 100644 index 414177b6e0..0000000000 --- a/Items/Armor/Victide/VictideHeadRanged.cs +++ /dev/null @@ -1,55 +0,0 @@ -using CalamityMod.CalPlayer; -using CalamityMod.Items.Materials; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Armor.Victide -{ - [AutoloadEquip(EquipType.Head)] - [LegacyName("VictideVisage")] - public class VictideHeadRanged : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Armor.PreHardmode"; - public override void SetDefaults() - { - Item.width = 18; - Item.height = 18; - Item.value = CalamityGlobalItem.RarityGreenBuyPrice; - Item.rare = ItemRarityID.Green; - Item.defense = 3; //10 - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); - var modPlayer = player.Calamity(); - modPlayer.victideSet = true; - player.ignoreWater = true; - if (player.Calamity().countsAsAnyWet) - { - player.GetDamage() += 0.1f; - player.lifeRegen += 3; - } - } - - public override void UpdateEquip(Player player) - { - player.GetDamage() += 0.05f; - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(3). - AddTile(TileID.Anvils). - SortBeforeFirstRecipesOf(ModContent.ItemType()). - Register(); - } - } -} diff --git a/Items/Armor/Victide/VictideHeadRogue.cs b/Items/Armor/Victide/VictideHeadRogue.cs deleted file mode 100644 index f5a404f1b8..0000000000 --- a/Items/Armor/Victide/VictideHeadRogue.cs +++ /dev/null @@ -1,57 +0,0 @@ -using CalamityMod.CalPlayer; -using CalamityMod.Items.Materials; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Armor.Victide -{ - [AutoloadEquip(EquipType.Head)] - [LegacyName("VictideHeadgear")] - public class VictideHeadRogue : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Armor.PreHardmode"; - public override void SetDefaults() - { - Item.width = 18; - Item.height = 18; - Item.value = CalamityGlobalItem.RarityGreenBuyPrice; - Item.rare = ItemRarityID.Green; - Item.defense = 3; //10 - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); - var modPlayer = player.Calamity(); - modPlayer.victideSet = true; - modPlayer.rogueStealthMax += 0.6f; - modPlayer.wearingRogueArmor = true; - player.ignoreWater = true; - if (player.Calamity().countsAsAnyWet) - { - player.GetDamage() += 0.1f; - player.lifeRegen += 3; - } - } - - public override void UpdateEquip(Player player) - { - player.GetDamage() += 0.05f; - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(3). - AddTile(TileID.Anvils). - SortBeforeFirstRecipesOf(ModContent.ItemType()). - Register(); - } - } -} diff --git a/Items/Armor/Victide/VictideHeadSnail.cs b/Items/Armor/Victide/VictideHeadSnail.cs new file mode 100644 index 0000000000..7b4de4234d --- /dev/null +++ b/Items/Armor/Victide/VictideHeadSnail.cs @@ -0,0 +1,73 @@ +using System; +using CalamityMod.Buffs.Summon; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor.Victide +{ + [AutoloadEquip(EquipType.Head)] + [LegacyName("VictideHelmet", "VictideHeadSummon")] + public class VictideHeadSnail : ModItem, ILocalizedModType // Utility/Fishing set + { + public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static int FishingPowerBoost = 5; + public static int AggroReduction = 200; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(FishingPowerBoost); + + // Set Bonus + public static int SetBonusGrabRangeBoost = 102; // (2.625 + 6.375 = 9 tiles) + + public override void SetDefaults() + { + Item.width = 18; + Item.height = 18; + Item.value = CalamityGlobalItem.RarityGreenBuyPrice; + Item.rare = ItemRarityID.Green; + Item.defense = 1; // 10 + } + + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); + + public override void UpdateArmorSet(Player player) + { + Color AbilityBriefColor = Color.Lerp(new Color(97, 200, 255), new Color(255, 170, 204), 0.5f + 0.5f * MathF.Sin(Main.GlobalTimeWrappedHourly * 3f)); + player.setBonus = this.GetLocalization("SetBonus").Format(AbilityBriefColor.Hex3()); + player.Calamity().victideSnailSet = true; + if (player.whoAmI == Main.myPlayer) + { + if (player.FindBuffIndex(ModContent.BuffType()) == -1) + { + player.AddBuff(ModContent.BuffType(), 3600, true); + } + if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) + { + var source = player.GetSource_ItemUse(Item); + Vector2 position = player.Center + Vector2.UnitY * (player.gfxOffY - 60f) * player.gravDir; + Projectile.NewProjectile(source, position, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI); + } + } + } + + public override void UpdateEquip(Player player) + { + player.fishingSkill += FishingPowerBoost; + player.aggro -= AggroReduction; + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(3). + AddTile(TileID.Anvils). + SortBeforeFirstRecipesOf(ModContent.ItemType()). + Register(); + } + } +} diff --git a/Items/Armor/Victide/VictideHeadSummon.png b/Items/Armor/Victide/VictideHeadSnail.png similarity index 100% rename from Items/Armor/Victide/VictideHeadSummon.png rename to Items/Armor/Victide/VictideHeadSnail.png diff --git a/Items/Armor/Victide/VictideHeadSummon_Head.png b/Items/Armor/Victide/VictideHeadSnail_Head.png similarity index 100% rename from Items/Armor/Victide/VictideHeadSummon_Head.png rename to Items/Armor/Victide/VictideHeadSnail_Head.png diff --git a/Items/Armor/Victide/VictideHeadSummon.cs b/Items/Armor/Victide/VictideHeadSummon.cs deleted file mode 100644 index 36ed6cc02e..0000000000 --- a/Items/Armor/Victide/VictideHeadSummon.cs +++ /dev/null @@ -1,79 +0,0 @@ -using CalamityMod.Buffs.Summon; -using CalamityMod.CalPlayer; -using CalamityMod.Items.Materials; -using CalamityMod.Items.Potions.Alcohol; -using CalamityMod.Projectiles.Summon; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Armor.Victide -{ - [AutoloadEquip(EquipType.Head)] - [LegacyName("VictideHelmet")] - public class VictideHeadSummon : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Armor.PreHardmode"; - public static int SnailDamage = 7; - - public override void SetDefaults() - { - Item.width = 18; - Item.height = 18; - Item.value = CalamityGlobalItem.RarityGreenBuyPrice; - Item.rare = ItemRarityID.Green; - Item.defense = 1; //8 - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); - var modPlayer = player.Calamity(); - modPlayer.victideSet = true; - modPlayer.victideSummoner = true; - player.maxMinions++; - if (player.whoAmI == Main.myPlayer) - { - if (player.FindBuffIndex(ModContent.BuffType()) == -1) - { - player.AddBuff(ModContent.BuffType(), 3600, true); - } - var source = player.GetSource_ItemUse(Item); - if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) - { - int minionDamage = (int)player.GetTotalDamage().ApplyTo(SnailDamage); - - var p = Projectile.NewProjectile(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), minionDamage, 0f, Main.myPlayer, 0f, 0f); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = SnailDamage; - } - } - player.ignoreWater = true; - if (player.Calamity().countsAsAnyWet) - { - player.GetDamage() += 0.1f; - player.lifeRegen += 3; - } - } - - public override void UpdateEquip(Player player) - { - player.GetDamage() += 0.1f; - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(3). - AddTile(TileID.Anvils). - SortBeforeFirstRecipesOf(ModContent.ItemType()). - Register(); - } - } -} diff --git a/Items/Armor/Wulfrum/WulfrumSet.cs b/Items/Armor/Wulfrum/WulfrumSet.cs index 37234b5ce7..f27d55f4a1 100644 --- a/Items/Armor/Wulfrum/WulfrumSet.cs +++ b/Items/Armor/Wulfrum/WulfrumSet.cs @@ -39,13 +39,12 @@ namespace CalamityMod.Items.Armor.Wulfrum public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(SummonDamageBoost.ToPercent()); // Set Bonus - public static int SetBonusMinionSlotBoost = 1; - public static int BastionDefenseBoost = 13; + public static int BastionDefenseBoost = 12; public static float BastionDRBoost = 0.1f; - public static int BastionBuildTime = (int)(0.55f * 60); - public static int BastionTime = 30 * 60; - public static int TimeLostPerHit = 2 * 60; - public static int BastionCooldown = 20 * 60; + public static int BastionBuildTime = CalamityUtils.SecondsToFrames(0.55f); + public static int BastionTime = CalamityUtils.SecondsToFrames(30); + public static int TimeLostPerHit = CalamityUtils.SecondsToFrames(2); + public static int BastionCooldown = CalamityUtils.SecondsToFrames(20); internal static Item DummyCannon = new Item(); //Used for the attack swap. Basically we force the player to hold a fake item. @@ -63,7 +62,6 @@ namespace CalamityMod.Items.Armor.Wulfrum EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/Wulfrum/WulfrumHat_FemaleHead", EquipType.Head, name: "WulfrumHatFemale"); } - On_Player.KeyDoubleTap += ActivateSetBonus; On_Main.DrawPendingMouseText += SpoofMouseItem; } @@ -73,33 +71,6 @@ namespace CalamityMod.Items.Armor.Wulfrum DummyCannon = null; } - private void ActivateSetBonus(On_Player.orig_KeyDoubleTap orig, Player player, int keyDir) - { - if (keyDir == (Main.ReversedUpDownArmorSetBonuses ? 1 : 0) && HasArmorSet(player) && !player.mount.Active) - { - //Only activate if no cooldown & available scrap. - if (player.Calamity().cooldowns.TryGetValue(WulfrumBastion.ID, out CooldownInstance cd)) - { - if (cd.timeLeft > BastionCooldown && cd.timeLeft < BastionCooldown + BastionTime - 60 * 3) - { - cd.timeLeft = BastionCooldown + 1; - player.Calamity().SyncCooldownDictionary(false); - } - } - - else if (player.HasItem(ItemType())) - { - player.ConsumeItem(ItemType()); - //I Thiiiinnnk there's no need to add mp syncing packets since cooldowns get auto synced right - player.AddCooldown(WulfrumBastion.ID, BastionCooldown + BastionTime); - //Though do I need to sync that or is the player inventory auto synced? - DummyCannon.SetDefaults(ItemType()); - } - } - - orig(player, keyDir); - } - //Replaces the tooltip of the armor set with the fusion cannon if the player holds shift private void SpoofMouseItem(On_Main.orig_DrawPendingMouseText orig) { @@ -123,6 +94,7 @@ namespace CalamityMod.Items.Armor.Wulfrum Item.height = 18; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; + Item.defense = 1; } public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ItemType() && legs.type == ItemType(); @@ -138,8 +110,9 @@ namespace CalamityMod.Items.Armor.Wulfrum armorPlayer.wulfrumSet = true; - player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost); //The cooler part of the set bonus happens in modifytooltips because I can't recolor it otherwise. Madge - player.maxMinions += SetBonusMinionSlotBoost; + Color AbilityBriefColor = Color.Lerp(new Color(194, 255, 67), new Color(112, 244, 244), 0.5f + 0.5f * MathF.Sin(Main.GlobalTimeWrappedHourly * 3f)); + player.setBonus = this.GetLocalization("SetBonus").Format(AbilityBriefColor.Hex3(), CalamityUtils.GetArmorSetBonusKey(), BastionTime.FramesToSeconds(), TimeLostPerHit.FramesToSeconds()); + if (PowerModeEngaged(player, out var cd)) { if (cd.timeLeft == BastionCooldown + BastionTime) @@ -228,37 +201,6 @@ namespace CalamityMod.Items.Armor.Wulfrum GeneralParticleHandler.SpawnParticle(gun); } - public static void ModifySetTooltips(ModItem item, List tooltips) - { - if (HasArmorSet(Main.LocalPlayer)) - { - int setBonusIndex = tooltips.FindIndex(x => x.Name == "SetBonus" && x.Mod == "Terraria"); - - if (setBonusIndex != -1) - { - string dir = Language.GetTextValue(Main.ReversedUpDownArmorSetBonuses ? "Key.UP" : "Key.DOWN"); - TooltipLine setBonus1 = new TooltipLine(item.Mod, "CalamityMod:SetBonus1", CalamityUtils.GetTextFromModItem("AbilityBrief").Format(dir)); - setBonus1.OverrideColor = Color.Lerp(new Color(194, 255, 67), new Color(112, 244, 244), 0.5f + 0.5f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 3f)); - tooltips.Insert(setBonusIndex + 1, setBonus1); - - int AmmoItem = ItemType(); - string AmmoDisplay = $"[i:{AmmoItem}] {CalamityUtils.GetItemName(AmmoItem)}"; - TooltipLine setBonus2 = new TooltipLine(item.Mod, "CalamityMod:SetBonus2", CalamityUtils.GetTextFromModItem("AbilityDescription").Format(AmmoDisplay)); - setBonus2.OverrideColor = new Color(110, 192, 93); - tooltips.Insert(setBonusIndex + 2, setBonus2); - - if (!Main.keyState.PressingShift()) - { - TooltipLine itemDisplay = new TooltipLine(item.Mod, "CalamityMod:ArmorItemDisplay", CalamityUtils.GetTextValueFromModItem("ShiftToExpand")); - itemDisplay.OverrideColor = new Color(190, 190, 190); - tooltips.Add(itemDisplay); - } - } - - } - } - public override void ModifyTooltips(List tooltips) => ModifySetTooltips(this, tooltips); - public override void UpdateEquip(Player player) => player.GetDamage() += SummonDamageBoost; public override void AddRecipes() @@ -277,8 +219,8 @@ namespace CalamityMod.Items.Armor.Wulfrum { public new string LocalizationCategory => "Items.Armor.PreHardmode"; - public static float SummonDamageBoost = 0.05f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(SummonDamageBoost.ToPercent()); + public static int MinionSlotBoost = 1; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost); public override void SetStaticDefaults() { @@ -299,9 +241,7 @@ namespace CalamityMod.Items.Armor.Wulfrum Item.defense = 2; } - public override void ModifyTooltips(List tooltips) => WulfrumHat.ModifySetTooltips(this, tooltips); - - public override void UpdateEquip(Player player) => player.GetDamage() += SummonDamageBoost; + public override void UpdateEquip(Player player) => player.maxMinions += MinionSlotBoost; public override void AddRecipes() { @@ -319,8 +259,8 @@ namespace CalamityMod.Items.Armor.Wulfrum { public new string LocalizationCategory => "Items.Armor.PreHardmode"; - public static float MoveSpeedBoost = 0.05f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedBoost.ToPercent()); + public static float SummonDamageBoost = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(SummonDamageBoost.ToPercent()); public override void SetDefaults() { @@ -336,9 +276,8 @@ namespace CalamityMod.Items.Armor.Wulfrum ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlot] = true; } } - public override void ModifyTooltips(List tooltips) => WulfrumHat.ModifySetTooltips(this, tooltips); - public override void UpdateEquip(Player player) => player.moveSpeed += MoveSpeedBoost; + public override void UpdateEquip(Player player) => player.GetDamage() += SummonDamageBoost; public override void AddRecipes() { diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 38d58361c6..cb9a23533c 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -8,6 +8,9 @@ using CalamityMod.Enums; using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.Ammo; +using CalamityMod.Items.Armor.Hydrothermic; +using CalamityMod.Items.Armor.Reaver; +using CalamityMod.Items.Armor.Victide; using CalamityMod.Items.Potions; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.VanillaArmorChanges; @@ -122,11 +125,6 @@ namespace CalamityMod.Items ///
public bool devItem = false; /// - /// If true, this item can fire projectiles with point-blank damage.
- /// Also adds a tooltip line to the bottom of the item's tooltip. - ///
- public bool canFirePointBlankShots = false; - /// /// If set to a value greater than 1, applies a multiplier to the item's grab range.
/// Used by coin items spawned from hitting ricoshot coins. ///
@@ -169,7 +167,6 @@ namespace CalamityMod.Items myClone.revengeanceItem = revengeanceItem; myClone.donorItem = donorItem; myClone.devItem = devItem; - myClone.canFirePointBlankShots = canFirePointBlankShots; myClone.grabRangeMultiplier = grabRangeMultiplier; return myClone; @@ -427,7 +424,7 @@ namespace CalamityMod.Items modPlayer.canFireAtaxiaRangedProjectile = false; if (player.whoAmI == Main.myPlayer) { - int ataxiaFlareDamage = (int)(damage * 0.25f); + int ataxiaFlareDamage = (int)(damage * HydrothermicHeadRanged.FlareDamageRatio); Projectile.NewProjectile(playerSource, position, velocity * 1.25f, ModContent.ProjectileType(), ataxiaFlareDamage, 2f, player.whoAmI); } } @@ -452,9 +449,7 @@ namespace CalamityMod.Items { modPlayer.canFireAtaxiaRogueProjectile = false; int flareID = ModContent.ProjectileType(); - - // Hydrothermic Rogue Flares: 6 x (50 + 15%), soft cap starts at 90 base damage - int flareDamage = CalamityUtils.DamageSoftCap(50 + damage * 0.15, 90); + int flareDamage = CalamityUtils.DamageSoftCap(HydrothermicHeadRogue.VolleyDamage + damage * HydrothermicHeadRogue.VolleyDamageRatio, HydrothermicHeadRogue.VolleyDamageSoftcap); if (player.whoAmI == Main.myPlayer) { @@ -467,21 +462,6 @@ namespace CalamityMod.Items } } } - if (modPlayer.victideSet) - { - if ((item.CountsAsClass() || item.CountsAsClass() || item.CountsAsClass() || - item.CountsAsClass() || item.CountsAsClass()) && - Main.rand.NextBool(10) && !item.channel) - { - if (player.whoAmI == Main.myPlayer) - { - // Victide All-class Seashells: 200%, soft cap starts at 46 base damage - int seashellDamage = CalamityUtils.DamageSoftCap(damage * 2, 46); - - Projectile.NewProjectile(playerSource, position, velocity * 1.25f, ModContent.ProjectileType(), seashellDamage, 1f, player.whoAmI); - } - } - } if (modPlayer.prismaticRegalia) { if (item.CountsAsClass() && Main.rand.NextBool(20) && !item.channel) @@ -583,13 +563,10 @@ namespace CalamityMod.Items tag.Add("charge", Charge); tag.Add("enchantmentID", AppliedEnchantment.HasValue ? AppliedEnchantment.Value.ID : 0); tag.Add("DischargeEnchantExhaustion", DischargeEnchantExhaustion); - tag.Add("canFirePointBlankShots", canFirePointBlankShots); } public override void LoadData(Item item, TagCompound tag) { - canFirePointBlankShots = tag.GetBool("canFirePointBlankShots"); - // Changed charge from int to float. If an old charge int is present, load that instead. if (tag.ContainsKey("Charge")) Charge = tag.GetInt("Charge"); @@ -608,11 +585,6 @@ namespace CalamityMod.Items public override void NetSend(Item item, BinaryWriter writer) { - BitsByte flags = new BitsByte(); - flags[0] = canFirePointBlankShots; - // rip, no other flags. what a byte. - - writer.Write(flags); writer.Write(Charge); writer.Write(AppliedEnchantment.HasValue ? AppliedEnchantment.Value.ID : 0); writer.Write(DischargeEnchantExhaustion); @@ -620,9 +592,6 @@ namespace CalamityMod.Items public override void NetReceive(Item item, BinaryReader reader) { - BitsByte flags = reader.ReadByte(); - canFirePointBlankShots = flags[0]; - Charge = reader.ReadSingle(); Enchantment? savedEnchantment = EnchantmentManager.FindByID(reader.ReadInt32()); @@ -669,6 +638,11 @@ namespace CalamityMod.Items if (item.type != ModContent.ItemType()) player.Calamity().evilSmasherBoost = 0; } + + if (player.Calamity().ChaosStone && item.mana == 0 && !player.ItemTimeIsZero) + { + player.manaRegenDelay = player.maxRegenDelay; + } } public override bool? UseItem(Item item, Player player) @@ -693,11 +667,8 @@ namespace CalamityMod.Items { // Temporarily disable Bloom Stone so that GetHealLife doesn't return 0 modPlayer.bloomStone = false; - modPlayer.bloomStoneTotalHeal = player.GetHealLife(item); + modPlayer.bloomStoneTotalHeal = modPlayer.bloomStoneHealPool = player.GetHealLife(item); modPlayer.bloomStone = true; - - modPlayer.bloomStoneHealInc = modPlayer.bloomStoneTotalHeal / 15; - modPlayer.bloomStoneHealTimer = (int)Math.Ceiling(modPlayer.bloomStoneTotalHeal / (double)modPlayer.bloomStoneHealInc) * 40; } // Staff/Axe of Regrowth growing Calamity grass @@ -721,7 +692,6 @@ namespace CalamityMod.Items return true; } } - return base.UseItem(item, player); } @@ -809,6 +779,10 @@ namespace CalamityMod.Items if (PopupGUIManager.AnyGUIsActive) return false; + // Can't use anything while burrowing + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + return false; + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0 && (item.damage > 0 || item.ammo != AmmoID.None)) { @@ -877,7 +851,7 @@ namespace CalamityMod.Items // Handle general use-item effects for the Gem Tech Armor. player.Calamity().GemTechState.OnItemUseEffects(item); - if (item.type == ItemID.MonkStaffT1 || AutoreusableSpearsList.Includes(item.type)) + if (item.type == ItemID.MonkStaffT1 || CalamityItemSets.AutoreusableSpear[item.type]) { return player.ownedProjectileCounts[item.shoot] <= 0; } @@ -1268,17 +1242,6 @@ namespace CalamityMod.Items player.buffImmune[BuffID.OnFire] = true; } - // Reduced Nightwither and Holy Flames damage. - if (item.type == ItemID.MoonStone) - modPlayer.reducedNightwitherDamage = true; - if (item.type == ItemID.SunStone) - modPlayer.reducedDaybrokenDamage = true; - if (item.type == ItemID.CelestialStone || item.type == ItemID.CelestialShell) - { - modPlayer.reducedDaybrokenDamage = true; - modPlayer.reducedNightwitherDamage = true; - } - if (item.type == ItemID.FairyBoots) modPlayer.fairyBoots = true; @@ -1486,7 +1449,7 @@ namespace CalamityMod.Items float flightSpeedMult = 1f + (modPlayer.soaring ? SoaringPotion.FlightBoost : 0f) + - (modPlayer.reaverSpeed ? 0.1f : 0f) + + (modPlayer.reaverSpeed ? ReaverHeadMobility.SetBonusFlightBoost : 0f) + moveSpeedBoost; float flightAccMult = 1f + moveSpeedBoost; @@ -1536,10 +1499,11 @@ namespace CalamityMod.Items if (grabRangeMultiplier > 1f) grabRange = (int)(grabRangeMultiplier * grabRange); - // Then, if wearing the appropriate Reaver armor, add 246 flat item grab range. (2.625 + 15.375 = 18 tiles) - // For reference, Treasure Magnet adds 150 (2.625 + 9.375 = 12 tiles) + // Then, apply flat grab range boosts. if (player.Calamity().reaverExplore) - grabRange += 246; + grabRange += ReaverHeadExplore.SetBonusGrabRangeBoost; + if (player.Calamity().victideSnailSet) + grabRange += VictideHeadSnail.SetBonusGrabRangeBoost; // Nebula boosters have greater pickup range while using Nebula Mantle. if (player.wingsLogic == (int)VanillaWingID.WingsNebula && ItemID.Sets.NebulaPickup[item.type]) @@ -1639,7 +1603,7 @@ namespace CalamityMod.Items #region PostUpdate public override void PostUpdate(Item item) { - if (ItemsForcedInsideWorldList.Includes(item.type)) + if (CalamityItemSets.ItemForcedInsideWorld[item.type]) CalamityUtils.ForceItemIntoWorld(item); } #endregion @@ -1755,11 +1719,11 @@ namespace CalamityMod.Items private static readonly int Rarity0BuyPrice = Item.buyPrice(0, 0, 50, 0); private static readonly int Rarity1BuyPrice = Item.buyPrice(0, 1, 0, 0); private static readonly int Rarity2BuyPrice = Item.buyPrice(0, 2, 0, 0); - private static readonly int Rarity3BuyPrice = Item.buyPrice(0, 4, 0, 0); - private static readonly int Rarity4BuyPrice = Item.buyPrice(0, 12, 0, 0); - private static readonly int Rarity5BuyPrice = Item.buyPrice(0, 24, 0, 0); - private static readonly int Rarity6BuyPrice = Item.buyPrice(0, 36, 0, 0); - private static readonly int Rarity7BuyPrice = Item.buyPrice(0, 48, 0, 0); + private static readonly int Rarity3BuyPrice = Item.buyPrice(0, 5, 0, 0); + private static readonly int Rarity4BuyPrice = Item.buyPrice(0, 10, 0, 0); + private static readonly int Rarity5BuyPrice = Item.buyPrice(0, 20, 0, 0); + private static readonly int Rarity6BuyPrice = Item.buyPrice(0, 35, 0, 0); + private static readonly int Rarity7BuyPrice = Item.buyPrice(0, 45, 0, 0); private static readonly int Rarity8BuyPrice = Item.buyPrice(0, 60, 0, 0); private static readonly int Rarity9BuyPrice = Item.buyPrice(0, 80, 0, 0); private static readonly int Rarity10BuyPrice = Item.buyPrice(1, 0, 0, 0); // Highest raw rarity used by vanilla items (ML drops) diff --git a/Items/CalamityGlobalItemLoot.cs b/Items/CalamityGlobalItemLoot.cs index c9be425662..77b387816a 100644 --- a/Items/CalamityGlobalItemLoot.cs +++ b/Items/CalamityGlobalItemLoot.cs @@ -31,17 +31,17 @@ namespace CalamityMod.Items { #region Boss Treasure Bags case ItemID.KingSlimeBossBag: - loot.DefineConditionalDropSet(DropHelper.NotRemix).Add(ItemID.Katana, 3); // 33% Katana - loot.DefineConditionalDropSet(DropHelper.Remix).Add(ItemID.Keybrand, 3); // 33% Keybrand in Remix + loot.DefineConditionalDropSet(DropHelper.NotRemix).Add(ItemID.Katana, DropHelper.BagWeaponDropRateInt); // 33% Katana + loot.DefineConditionalDropSet(DropHelper.Remix).Add(ItemID.Keybrand, DropHelper.BagWeaponDropRateInt); // 33% Keybrand in Remix - loot.Add(new CommonDrop(ModContent.ItemType(), 10)); // 10% Crown Jewel + loot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateFraction); // 33% Crown Jewel loot.AddRevBagAccessories(); loot.Add(ModContent.ItemType(), ThankYouPainting.DropInt); break; case ItemID.EyeOfCthulhuBossBag: - loot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateInt); // 33% Deathstare Rod - loot.Add(ModContent.ItemType(), 10); // 10% Teardrop Cleaver + loot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateFraction); // 33% Deathstare Rod + loot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateFraction); // 33% Teardrop Cleaver loot.AddRevBagAccessories(); loot.Add(ModContent.ItemType(), ThankYouPainting.DropInt); break; @@ -93,7 +93,7 @@ namespace CalamityMod.Items ModContent.ItemType(), }; loot.Add(DropHelper.CalamityStyle(DropHelper.BagWeaponDropRateFraction, queenBeeWeapons)); - loot.Add(ModContent.ItemType(), 10); // 10% The Bee + loot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateFraction); // 33% The Bee loot.Add(ItemID.Stinger, 1, 8, 12); // 100% 8-12 Stinger loot.AddRevBagAccessories(); loot.Add(ModContent.ItemType(), ThankYouPainting.DropInt); @@ -145,7 +145,6 @@ namespace CalamityMod.Items case ItemID.TwinsBossBag: loot.Remove(FindHallowedBars(loot)); loot.AddIf(DropHelper.HallowedBarsCondition, ItemID.HallowedBar, 1, 20, 35); - loot.Add(ModContent.ItemType(), 10); // 10% Arbalest loot.AddRevBagAccessories(); loot.Add(ModContent.ItemType(), ThankYouPainting.DropInt); break; diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 1ac0abc245..91f78a86bf 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -145,14 +145,6 @@ namespace CalamityMod.Items // Modify all vanilla tooltips before appending mod mechanics (if any). ModifyVanillaTooltips(item, tooltips); - // Adds "Does extra damage to enemies shot at point-blank range" to weapons capable of it. - if (canFirePointBlankShots) - { - LocalizedText lineText = CalamityUtils.GetText("Misc.PointBlank"); - TooltipLine line = new TooltipLine(Mod, "CalamityMod:PointBlankTooltip", lineText.Value); - tooltips.Insert(++lastTooltipIndex, line); - } - // If an item has an enchantment, show its prefix in the first tooltip line and append its description to the tooltip list. EnchantmentTooltips(item, tooltips); @@ -423,7 +415,7 @@ namespace CalamityMod.Items string CritTagTooltip(float crit) => (CalamityUtils.GetText($"Common.SummonTagCrit").Format((crit * 100).ToString("0.#"))); Dictionary TagByItem = new(); - foreach (SummonTag tag1 in SummonTagDebuffDict.Dict.Values) + foreach (SummonTag tag1 in CalamityBuffSets.SummonTagDebuff.Values) { if (tag1.TagItem > -1) TagByItem.Add(tag1.TagItem, tag1); } @@ -617,6 +609,10 @@ namespace CalamityMod.Items // "Buffed" Step Stool if (item.type == ItemID.PortableStool) EditTooltipByNum(0, (line) => line.Text += AddedTooltip("PortableStool")); + + // Replace the double tap line if double tap dash is overridden + if ((item.type == ItemID.EoCShield || item.type == ItemID.Tabi) && CalamityKeybinds.DashHotkey.GetAssignedKeys().Count != 0) + EditTooltipByNum(1, (line) => line.Text = CalamityUtils.GetText("Vanilla.DashKey").Format(CalamityKeybinds.DashHotkey.TooltipHotkeyString())); #endregion // For boss summon item clarity @@ -783,18 +779,11 @@ namespace CalamityMod.Items if (item.type == ItemID.HandOfCreation) EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "15%")); - // Frozen Turtle Shell rebalance. - if (item.type == ItemID.FrozenTurtleShell) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "15%")); - - if (item.type == ItemID.FrozenShield) - EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("25%", "15%")); - // Ale and Sake rebalance and Alcohol Poisoning. if (item.type == ItemID.Ale || item.type == ItemID.Sake) EditTooltipByNum(0, (line) => line.Text = EditedTooltip("AleSake")); - //Flame Waker Boots buff. + // Flame Waker Boots buff. if (item.type == ItemID.FlameWakerBoots) EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlameWakerBoots")); @@ -806,27 +795,15 @@ namespace CalamityMod.Items if (item.type == ItemID.FairyBoots) EditTooltipByNum(2, (line) => line.Text += AddedTooltip("FairyBoots")); - // Reduced Nightwither and Daybroken damage, and melee speed removal. + // Melee speed removal. if (item.type == ItemID.MoonStone) - { - EditTooltipByNum(2, (line) => line.Text += AddedTooltip("MoonStone")); EditTooltipByNum(1, (line) => line.Text = EditedTooltip("SunMoonStones")); - } if (item.type == ItemID.SunStone) - { - EditTooltipByNum(2, (line) => line.Text += AddedTooltip("SunStone")); EditTooltipByNum(1, (line) => line.Text = EditedTooltip("SunMoonStones")); - } if (item.type == ItemID.CelestialStone) - { - EditTooltipByNum(2, (line) => line.Text += AddedTooltip("CelestialStone")); EditTooltipByNum(0, (line) => line.Text = EditedTooltip("CelestialStoneShell")); - } if (item.type == ItemID.CelestialShell) - { - EditTooltipByNum(4, (line) => line.Text += AddedTooltip("CelestialStone")); EditTooltipByNum(2, (line) => line.Text = EditedTooltip("CelestialStoneShell")); - } // Mana Flower tinker buffs. if (item.type == ItemID.MagnetFlower) @@ -898,7 +875,7 @@ namespace CalamityMod.Items // Magic Power Potion nerf if (item.type == ItemID.MagicPowerPotion) - EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MagicPowerPotion")); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("20%", "10%")); // Featherfall Potion being stupid broken with Aero Stone if (item.type == ItemID.FeatherfallPotion) @@ -982,6 +959,14 @@ namespace CalamityMod.Items // Pre-Hardmode armor tooltip edits #region Pre-Hardmode Armor + // Gladiator + if (item.type == ItemID.GladiatorHelmet) + EditTooltipByName("Defense", (line) => line.Text += "\n" + CalamityUtils.GetText("Common.RogueDamage").Format(GladiatorArmorSetChange.HelmetRogueDamageBoostPercent)); + if (item.type == ItemID.GladiatorBreastplate) + EditTooltipByName("Defense", (line) => line.Text += "\n" + CalamityUtils.GetText("Common.RogueCrit").Format(GladiatorArmorSetChange.ChestplateRogueCritBoostPercent)); + if (item.type == ItemID.GladiatorLeggings) + EditTooltipByName("Defense", (line) => line.Text += "\n" + CalamityUtils.GetText("Common.RogueVelocity").Format(GladiatorArmorSetChange.LeggingRogueVelocityBoostPercent)); + // Jungle if (item.type == ItemID.JungleHat || item.type == ItemID.AncientCobaltHelmet) { @@ -1126,10 +1111,8 @@ namespace CalamityMod.Items // Non-consumable boss summon items #region Vanilla Boss Summon Non-consumable Tooltips - if (item.type == ItemID.SlimeCrown || item.type == ItemID.SuspiciousLookingEye || item.type == ItemID.BloodMoonStarter || item.type == ItemID.GoblinBattleStandard || - item.type == ItemID.WormFood || item.type == ItemID.BloodySpine || item.type == ItemID.Abeemination || item.type == ItemID.DeerThing || item.type == ItemID.QueenSlimeCrystal || - item.type == ItemID.PirateMap || item.type == ItemID.SnowGlobe || item.type == ItemID.MechanicalEye || item.type == ItemID.MechanicalWorm || item.type == ItemID.MechanicalSkull || - item.type == ItemID.NaughtyPresent || item.type == ItemID.PumpkinMoonMedallion || item.type == ItemID.SolarTablet || item.type == ItemID.SolarTablet || item.type == ItemID.CelestialSigil) + if (item.type == ItemID.SlimeCrown || item.type == ItemID.SuspiciousLookingEye || item.type == ItemID.WormFood || item.type == ItemID.BloodySpine || item.type == ItemID.Abeemination || item.type == ItemID.DeerThing + || item.type == ItemID.QueenSlimeCrystal || item.type == ItemID.MechanicalEye || item.type == ItemID.MechanicalWorm || item.type == ItemID.MechanicalSkull || item.type == ItemID.CelestialSigil) EditTooltipByNum(0, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.NotConsumable")); #endregion @@ -1153,18 +1136,14 @@ namespace CalamityMod.Items EditTooltipByName("SetBonus", (line) => VanillaArmorChangeManager.ApplySetBonusTooltipChanges(item, ref line.Text)); - // Gladiator - if (item.type == ItemID.GladiatorHelmet) - EditTooltipByName("Defense", (line) => line.Text += "\n" +CalamityUtils.GetText("Common.RogueDamage").Format(GladiatorArmorSetChange.HelmetRogueDamageBoostPercent)); - if (item.type == ItemID.GladiatorBreastplate) - EditTooltipByName("Defense", (line) => line.Text += "\n" +CalamityUtils.GetText("Common.RogueCrit").Format(GladiatorArmorSetChange.ChestplateRogueCritBoostPercent)); - if (item.type == ItemID.GladiatorLeggings) - EditTooltipByName("Defense", (line) => line.Text += "\n" +CalamityUtils.GetText("Common.RogueVelocity").Format(GladiatorArmorSetChange.LeggingRogueVelocityBoostPercent)); - // Forbidden (UNLESS you are wearing the Circlet, which is Summon/Rogue and does not get this line) if ((item.type == ItemID.AncientBattleArmorHat || item.type == ItemID.AncientBattleArmorShirt || item.type == ItemID.AncientBattleArmorPants) && !Main.LocalPlayer.Calamity().forbiddenCirclet) - EditTooltipByName("SetBonus", (line) => line.Text = CalamityUtils.GetText($"Vanilla.Armor.SetBonus.Forbidden").Format(Language.GetTextValue(Main.ReversedUpDownArmorSetBonuses ? "Key.UP" : "Key.DOWN"))); + EditTooltipByName("SetBonus", (line) => line.Text = CalamityUtils.GetText($"Vanilla.Armor.SetBonus.Forbidden").Format(CalamityUtils.GetArmorSetBonusKey())); + + // Vortex (hotkey spoof) + if (item.type == ItemID.VortexHelmet || item.type == ItemID.VortexBreastplate || item.type == ItemID.VortexLeggings) + EditTooltipByName("SetBonus", (line) => line.Text = CalamityUtils.GetText($"Vanilla.Armor.SetBonus.Vortex").Format(CalamityUtils.GetArmorSetBonusKey())); #endregion // Provide the full stats of every vanilla yoyo diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index ef2d422864..3f20df2b6a 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items // Various shorthands for items which receive very simple changes, or are repeated multiple times. IItemTweak[] trueMelee = Do(TrueMelee); IItemTweak[] trueMeleeNoSpeed = Do(TrueMeleeNoSpeed); - IItemTweak[] pointBlank = Do(PointBlank); IItemTweak[] autoReuse = Do(AutoReuse); IItemTweak[] nonConsumableBossSummon = Do(MaxStack(1), NotConsumable, UseTimeExact(10)); IItemTweak[] phaseblade = Do(AutoReuse, UseTurn, DamageExact(36)); @@ -43,7 +42,7 @@ namespace CalamityMod.Items { #region CATEGORY 1: Weapon Balancing { ItemID.AdamantiteGlaive, Do(AutoReuse, TrueMelee, DamageExact(69), UseExact(7), ShootSpeedExact(18f)) }, - { ItemID.AdamantiteRepeater, Do(PointBlank, UseExact(14)) }, + { ItemID.AdamantiteRepeater, Do(UseExact(14)) }, { ItemID.AdamantiteSword, Do(UseTurn, DamageExact(75), UseExact(7)) }, { ItemID.AmberStaff, Do(UseTimeExact(15), UseAnimationExact(45), ReuseDelayExact(15)) }, { ItemID.AmethystStaff, Do(ManaExact(2)) }, @@ -56,31 +55,31 @@ namespace CalamityMod.Items { ItemID.BeeGun, Do(DamageExact(11), ManaExact(4)) }, { ItemID.BeeKeeper, Do(UseTurn, DamageExact(32)) }, { ItemID.Beenade, Do(DamageExact(11), UseTimeExact(22), ShootSpeedExact(10f)) }, - { ItemID.BeesKnees, Do(PointBlank, DamageExact(21), UseExact(38)) }, + { ItemID.BeesKnees, Do(DamageExact(21), UseExact(38)) }, { ItemID.Bladetongue, Do(UseTurn, UseRatio(0.8f), DamageExact(120)) }, { ItemID.BlizzardStaff, Do(DamageExact(41), ManaExact(7)) }, { ItemID.BloodyMachete, Do(AutoReuse, DamageExact(24)) }, - { ItemID.Blowgun, Do(PointBlank, DamageExact(40), ShootSpeedExact(15f)) }, + { ItemID.Blowgun, Do(DamageExact(40), ShootSpeedExact(15f)) }, { ItemID.BluePhaseblade, phaseblade }, { ItemID.BluePhasesaber, phasesaber }, { ItemID.BoneSword, Do(AutoReuse, UseTurn, DamageExact(25)) }, { ItemID.BookofSkulls, Do(DamageExact(27), ManaExact(13), ShootSpeedExact(5.5f)) }, { ItemID.BookStaff, Do(ManaExact(14)) }, // Tome of Infinite Wisdom - { ItemID.Boomstick, Do(PointBlank, DamageExact(11)) }, + { ItemID.Boomstick, Do(DamageExact(11)) }, { ItemID.BreakerBlade, Do(AutoReuse, UseTurn, DamageExact(140)) }, - { ItemID.CandyCornRifle, Do(PointBlank, DamageExact(66)) }, + { ItemID.CandyCornRifle, Do(DamageExact(66)) }, { ItemID.Cascade, Do(AutoReuse, DamageExact(31)) }, { ItemID.ChainGuillotines, Do(DamageExact(100)) }, - { ItemID.ChainGun, Do(PointBlank, DamageExact(35)) }, + { ItemID.ChainGun, Do(DamageExact(35)) }, { ItemID.ChainKnife, Do(AutoReuse, DamageRatio(1.34f)) }, // Uses ratios due to remix seed { ItemID.ChlorophyteClaymore, Do(UseMeleeSpeed, DamageExact(180), UseExact(45), ShootSpeedExact(22f)) }, { ItemID.ChlorophytePartisan, Do(AutoReuse, UseMeleeSpeed, DamageExact(98)) }, { ItemID.ChlorophyteSaber, Do(UseMeleeSpeed, DamageExact(92), UseExact(10)) }, { ItemID.ChristmasTreeSword, Do(AutoReuse, UseTurn, UseMeleeSpeed, DamageExact(80), UseExact(30)) }, { ItemID.ClingerStaff, Do(DamageExact(63)) }, - { ItemID.ClockworkAssaultRifle, Do(PointBlank, DamageExact(21)) }, + { ItemID.ClockworkAssaultRifle, Do(DamageExact(21)) }, { ItemID.CobaltNaginata, Do(AutoReuse, TrueMelee, DamageExact(55), UseExact(9), ShootSpeedExact(12f)) }, - { ItemID.CobaltRepeater, Do(PointBlank, UseExact(18)) }, + { ItemID.CobaltRepeater, Do(UseExact(18)) }, { ItemID.CobaltSword, Do(UseTurn, DamageExact(60), UseExact(9)) }, { ItemID.Code2, Do(AutoReuse, DamageExact(43)) }, { ItemID.CoinGun, Do(UseExact(12)) }, @@ -96,14 +95,14 @@ namespace CalamityMod.Items { ItemID.DaedalusStormbow, Do(DamageExact(30)) }, { ItemID.DaoofPow, Do(DamageExact(85)) }, { ItemID.DarkLance, Do(AutoReuse, TrueMelee, DamageExact(40)) }, - { ItemID.DartRifle, Do(PointBlank, DamageExact(58)) }, + { ItemID.DartRifle, Do(DamageExact(58)) }, { ItemID.DayBreak, Do(DamageExact(125), UseExact(20)) }, { ItemID.DD2BetsyBow, Do(DamageExact(42)) }, // Aerial Bane's ridiculous multiplier is removed, so this compensates for that { ItemID.DD2SquireBetsySword, Do(UseMeleeSpeed, DamageExact(150)) }, // Flying Dragon { ItemID.DD2SquireDemonSword, Do(DamageExact(110), UseExact(25)) }, // Brand of the Inferno { ItemID.DeadlySphereStaff, Do(AutoReuse, UseExact(20), DamageExact(50)) }, { ItemID.DeathSickle, Do(UseMeleeSpeed, DamageExact(70), ShootSpeedExact(15f)) }, - { ItemID.DemonBow, Do(PointBlank, DamageExact(12), AutoReuse) }, + { ItemID.DemonBow, Do(DamageExact(12), AutoReuse) }, { ItemID.DemonScythe, Do(AutoReuse, DamageExact(28)) }, { ItemID.DyeTradersScimitar, Do(AutoReuse, UseTurn, DamageExact(24)) }, // Exotic Scimitar { ItemID.ElectrosphereLauncher, Do(DamageExact(44)) }, @@ -125,7 +124,7 @@ namespace CalamityMod.Items { ItemID.FlyingKnife, Do(DamageExact(53)) }, { ItemID.Frostbrand, Do(UseMeleeSpeed, DamageExact(88)) }, { ItemID.FrostStaff, Do(DamageExact(160), UseExact(37), ShootSpeedExact(20f)) }, // has 1 extra update - { ItemID.Gatligator, Do(PointBlank, UseExact(6)) }, + { ItemID.Gatligator, Do(UseExact(6)) }, { ItemID.GoldShortsword, Do(AutoReuse, TrueMelee, DamageExact(17)) }, { ItemID.GolemFist, Do(DamageExact(150)) }, { ItemID.Gradient, Do(AutoReuse, DamageExact(39)) }, @@ -133,9 +132,8 @@ namespace CalamityMod.Items { ItemID.GreenPhasesaber, phasesaber }, { ItemID.GrenadeLauncher, Do(DamageExact(105)) }, { ItemID.Gungnir, Do(AutoReuse, TrueMelee, DamageExact(132), ShootSpeedExact(7f)) }, - { ItemID.HallowedRepeater, Do(PointBlank, UseExact(12)) }, - { ItemID.Handgun, Do(PointBlank, UseExact(20)) }, - { ItemID.HellwingBow, Do(PointBlank, DamageExact(16)) }, + { ItemID.HallowedRepeater, Do(UseExact(12)) }, + { ItemID.Handgun, Do(UseExact(20)) }, { ItemID.HighVelocityBullet, Do(DamageExact(13)) }, { ItemID.HiveFive, Do(AutoReuse, DamageExact(27)) }, { ItemID.HornetStaff, Do(AutoReuse, DamageExact(18), UseExact(30)) }, @@ -162,14 +160,14 @@ namespace CalamityMod.Items { ItemID.MagicalHarp, Do(DamageExact(50), ShootSpeedExact(12f)) }, { ItemID.MagicDagger, Do(DamageRatio(1.8f), UseRatio(1.88f), ShootSpeedExact(30)) }, // Uses ratios due to remix seed { ItemID.MagicMissile, Do(DamageExact(23), ManaExact(10), UseAnimationExact(20), UseTimeExact(10)) }, - { ItemID.Marrow, Do(PointBlank, DamageExact(69)) }, + { ItemID.Marrow, Do(DamageExact(69)) }, { ItemID.MedusaHead, Do(ManaExact(6), DamageExact(48)) }, { ItemID.Meowmere, Do(UseMeleeSpeed, DamageExact(240)) }, { ItemID.MeteorStaff, Do(DamageExact(58), ManaExact(7), ShootSpeedExact(13f)) }, { ItemID.MiniNukeI, Do(DamageExact(90)) }, { ItemID.MiniNukeII, Do(DamageExact(90)) }, - { ItemID.Minishark, Do(PointBlank, DamageExact(4)) }, - { ItemID.MoltenFury, Do(PointBlank, UseExact(28), AutoReuse) }, + { ItemID.Minishark, Do(DamageExact(4)) }, + { ItemID.MoltenFury, Do(UseExact(28), AutoReuse) }, { ItemID.MonkStaffT1, Do(TrueMeleeNoSpeed, DamageExact(83)) }, // Sleepy Octopod { ItemID.MonkStaffT2, Do(AutoReuse, TrueMelee, DamageExact(90)) }, // Ghastly Glaive { ItemID.MonkStaffT3, Do(DamageExact(225)) }, // Sky Dragon's Fury @@ -177,9 +175,9 @@ namespace CalamityMod.Items { ItemID.MoonlordTurretStaff, Do(DamageExact(50), UseExact(15)) }, // Lunar Portal Staff { ItemID.Muramasa, Do(CritDelta(+10)) }, { ItemID.MushroomSpear, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(100)) }, - { ItemID.Musket, Do(PointBlank, DamageExact(22)) }, + { ItemID.Musket, Do(DamageExact(22)) }, { ItemID.MythrilHalberd, Do(AutoReuse, TrueMelee, DamageExact(65), UseExact(8), ShootSpeedExact(15f)) }, - { ItemID.MythrilRepeater, Do(PointBlank, UseExact(16)) }, + { ItemID.MythrilRepeater, Do(UseExact(16)) }, { ItemID.MythrilSword, Do(UseTurn, DamageExact(70), UseExact(8)) }, { ItemID.NailGun, Do(DamageExact(77)) }, { ItemID.NettleBurst, Do(ManaExact(10), DamageExact(65)) }, @@ -188,19 +186,18 @@ namespace CalamityMod.Items { ItemID.OrangePhaseblade, phaseblade }, { ItemID.OrangePhasesaber, phasesaber }, { ItemID.OrichalcumHalberd, Do(AutoReuse, TrueMelee, DamageExact(128), ShootSpeedExact(6f)) }, - { ItemID.OrichalcumRepeater, Do(PointBlank, DamageExact(48)) }, + { ItemID.OrichalcumRepeater, Do(DamageExact(48)) }, { ItemID.OrichalcumSword, Do(UseTurn, DamageExact(175)) }, - { ItemID.PainterPaintballGun, Do(PointBlank, DamageExact(8)) }, { ItemID.PaladinsHammer, Do(DamageExact(95), ShootSpeedExact(28)) }, { ItemID.PalladiumPike, Do(AutoReuse, TrueMelee, DamageExact(120), ShootSpeedExact(5.4f)) }, - { ItemID.PalladiumRepeater, Do(PointBlank, DamageExact(45)) }, + { ItemID.PalladiumRepeater, Do(DamageExact(45)) }, { ItemID.PalladiumSword, Do(UseTurn, DamageExact(150)) }, - { ItemID.PearlwoodBow, Do(AutoReuse, PointBlank, DamageExact(32)) }, + { ItemID.PearlwoodBow, Do(AutoReuse, DamageExact(32)) }, { ItemID.PearlwoodSword, Do(UseTurn, DamageExact(45)) }, { ItemID.PewMaticHorn, Do(DamageExact(25), ShootSpeedExact(15)) }, - { ItemID.Phantasm, Do(PointBlank, DamageExact(48)) }, - { ItemID.PhoenixBlaster, Do(AutoReuse, PointBlank, UseExact(20)) }, - { ItemID.PlatinumBow, Do(PointBlank, DamageExact(12)) }, + { ItemID.Phantasm, Do(DamageExact(48)) }, + { ItemID.PhoenixBlaster, Do(AutoReuse, UseExact(20)) }, + { ItemID.PlatinumBow, Do(DamageExact(12)) }, { ItemID.PlatinumShortsword, Do(AutoReuse, TrueMelee, DamageExact(18)) }, { ItemID.PoisonStaff, Do(DamageExact(57)) }, { ItemID.PossessedHatchet, Do(DamageExact(135)) }, @@ -210,7 +207,6 @@ namespace CalamityMod.Items { ItemID.PurplePhaseblade, phaseblade }, { ItemID.PurplePhasesaber, phasesaber }, { ItemID.PygmyStaff, Do(AutoReuse, UseExact(20), DamageExact(63)) }, - { ItemID.QuadBarrelShotgun, Do(PointBlank, DamageExact(11)) }, { ItemID.RainbowGun, Do(DamageExact(60), ManaExact(40)) }, { ItemID.RainbowRod, Do(DamageExact(40), ManaExact(13), KnockbackExact(8f)) }, { ItemID.Rally, Do(AutoReuse, DamageExact(18)) }, @@ -219,26 +215,26 @@ namespace CalamityMod.Items { ItemID.Razorpine, Do(DamageExact(40)) }, { ItemID.RedPhaseblade, phaseblade }, { ItemID.RedPhasesaber, phasesaber }, - { ItemID.RedRyder, Do(PointBlank, DamageExact(24)) }, + { ItemID.RedRyder, Do(DamageExact(24)) }, { ItemID.RedsYoyo, Do(AutoReuse, DamageExact(48)) }, // Red's Throw and Valkyrie Yoyo have the same stats { ItemID.RocketLauncher, Do(DamageExact(60), ShootSpeedExact(9)) }, - { ItemID.Sandgun, Do(PointBlank, DamageExact(22), UseExact(20)) }, + { ItemID.Sandgun, Do(DamageExact(22), UseExact(20)) }, { ItemID.SapphireStaff, Do(DamageExact(25)) }, { ItemID.ScourgeoftheCorruptor, Do(DamageExact(63)) }, { ItemID.Seedler, Do(UseMeleeSpeed, DamageExact(45), ShootSpeedExact(16)) }, { ItemID.ShadowbeamStaff, Do(DamageExact(100)) }, - { ItemID.ShadowFlameBow, Do(PointBlank, DamageExact(55)) }, + { ItemID.ShadowFlameBow, Do(DamageExact(55)) }, { ItemID.ShadowFlameHexDoll, Do(DamageExact(40), ShootSpeedExact(30)) }, { ItemID.ShadowFlameKnife, Do(DamageExact(50)) }, { ItemID.SharpTears, Do(DamageExact(49)) }, // Blood Thorn - { ItemID.Shotgun, Do(PointBlank, DamageExact(36), AutoReuse) }, + { ItemID.Shotgun, Do(DamageExact(36), AutoReuse) }, { ItemID.Shroomerang, Do(ShootSpeedExact(11)) }, { ItemID.SilverBullet, Do(DamageExact(8)) }, { ItemID.SilverShortsword, Do(AutoReuse, TrueMelee, DamageExact(14)) }, { ItemID.SkyFracture, Do(DamageExact(54), ShootSpeedExact(30f)) }, { ItemID.SlapHand, Do(UseTurn, DamageExact(120)) }, { ItemID.Smolstar, Do(DamageExact(9), AutoReuse, UseExact(25)) }, // Blade Staff - { ItemID.SniperRifle, Do(PointBlank, DamageExact(200), UseExact(40)) }, + { ItemID.SniperRifle, Do(DamageExact(200), UseExact(40)) }, { ItemID.SolarEruption, Do(DamageExact(122)) }, { ItemID.SoulDrain, Do(DamageExact(38)) }, // Life Drain { ItemID.SpaceGun, Do(DamageExact(23)) }, @@ -253,9 +249,9 @@ namespace CalamityMod.Items { ItemID.Stynger, Do(DamageExact(75)) }, { ItemID.SuperStarCannon, Do(DamageExact(55)) }, { ItemID.Swordfish, Do(AutoReuse, TrueMelee, DamageExact(24)) }, - { ItemID.TacticalShotgun, Do(PointBlank, DamageExact(34)) }, + { ItemID.TacticalShotgun, Do(DamageExact(34)) }, { ItemID.TaxCollectorsStickOfDoom, Do(AutoReuse, UseTurn, UseRatio(0.8f), DamageExact(70)) }, // Classy Cane - { ItemID.TendonBow, Do(PointBlank, DamageExact(17), AutoReuse) }, + { ItemID.TendonBow, Do(DamageExact(17), AutoReuse) }, { ItemID.TerraBlade, Do(DamageExact(95)) }, { ItemID.Terragrim, Do(TrueMeleeNoSpeed, DamageExact(13)) }, // Vanilla damage 190. After fixing iframes so yoyo and shots can hit simultaneously, @@ -264,10 +260,10 @@ namespace CalamityMod.Items { ItemID.TheEyeOfCthulhu, Do(AutoReuse, DamageExact(80)) }, { ItemID.TheMeatball, Do(DamageExact(24)) }, { ItemID.TheRottedFork, Do(AutoReuse, TrueMelee, DamageExact(20)) }, - { ItemID.TheUndertaker, Do(PointBlank, AutoReuse, DamageExact(15)) }, + { ItemID.TheUndertaker, Do(AutoReuse, DamageExact(15)) }, { ItemID.ThunderSpear, Do(AutoReuse, UseMeleeSpeed) }, // Storm Spear { ItemID.ThunderStaff, Do(DamageExact(18)) }, //Thunder Zapper - { ItemID.TitaniumRepeater, Do(PointBlank, DamageExact(52)) }, + { ItemID.TitaniumRepeater, Do(DamageExact(52)) }, { ItemID.TitaniumSword, Do(UseTurn, DamageExact(192)) }, { ItemID.TitaniumTrident, Do(AutoReuse, TrueMelee, DamageExact(144), ShootSpeedExact(6.5f)) }, { ItemID.TopazStaff, Do(ManaExact(2)) }, @@ -277,12 +273,12 @@ namespace CalamityMod.Items { ItemID.Trimarang, Do(DamageExact(24)) }, { ItemID.TrueExcalibur, Do(TrueMelee, DamageExact(112)) }, { ItemID.TrueNightsEdge, Do(DamageExact(105)) }, - { ItemID.Tsunami, Do(PointBlank, DamageExact(45)) }, + { ItemID.Tsunami, Do(DamageExact(45)) }, { ItemID.TungstenBullet, Do(DamageExact(8)) }, { ItemID.TungstenShortsword, Do(AutoReuse, TrueMelee, DamageExact(15)) }, { ItemID.UnholyArrow, Do(DamageExact(11)) }, { ItemID.UnholyTrident, Do(ManaRatio(0.78f), DamageRatio(0.91f)) }, // Uses ratios due to remix seed - { ItemID.Uzi, Do(PointBlank, UseExact(8)) }, + { ItemID.Uzi, Do(UseExact(8)) }, { ItemID.VampireKnives, Do(DamageExact(38)) }, { ItemID.ValkyrieYoyo, Do(AutoReuse, DamageExact(48)) }, // Red's Throw and Valkyrie Yoyo have the same stats { ItemID.VenomStaff, Do(UseExact(27)) }, @@ -428,41 +424,7 @@ namespace CalamityMod.Items { ItemID.VortexChainsaw, trueMeleeNoSpeed }, #endregion - #region CATEGORY 5: Point Blank support - { ItemID.Blowpipe, pointBlank }, - { ItemID.BorealWoodBow, pointBlank }, - { ItemID.ChlorophyteShotbow, pointBlank }, - { ItemID.CopperBow, pointBlank }, - { ItemID.DartPistol, pointBlank }, - { ItemID.DD2PhoenixBow, pointBlank }, // Phantom Phoenix - { ItemID.EbonwoodBow, pointBlank }, - { ItemID.FairyQueenRangedItem, pointBlank }, //Eventide - { ItemID.FlintlockPistol, pointBlank }, - { ItemID.FlareGun, Do(PointBlank, Value(Item.sellPrice(silver: 10))) }, - { ItemID.GoldBow, pointBlank }, - { ItemID.Harpoon, pointBlank }, - { ItemID.IceBow, pointBlank }, - { ItemID.IronBow, pointBlank }, - { ItemID.LeadBow, pointBlank }, - { ItemID.Megashark, pointBlank }, - { ItemID.OnyxBlaster, pointBlank }, - { ItemID.PalmWoodBow, pointBlank }, - { ItemID.PulseBow, pointBlank }, - { ItemID.Revolver, Do(PointBlank, AutoReuse) }, - { ItemID.RichMahoganyBow, pointBlank }, - { ItemID.SDMG, pointBlank }, - { ItemID.ShadewoodBow, pointBlank }, - { ItemID.SilverBow, pointBlank }, - { ItemID.SnowballCannon, pointBlank }, - { ItemID.StakeLauncher, pointBlank }, - { ItemID.TinBow, pointBlank }, - { ItemID.TungstenBow, pointBlank }, - { ItemID.VenusMagnum, pointBlank }, - { ItemID.VortexBeater, pointBlank }, - { ItemID.WoodenBow, pointBlank }, - #endregion - - #region CATEGORY 6: Summoner Quality of Life + #region CATEGORY 5: Summoner Quality of Life { ItemID.AbigailsFlower, autoReuse }, { ItemID.BabyBirdStaff, Do(AutoReuse, UseExact(35)) }, // Finch Staff { ItemID.BlandWhip, autoReuse }, // Leather Whip @@ -501,7 +463,7 @@ namespace CalamityMod.Items { ItemID.XenoStaff, Do(AutoReuse, UseExact(20)) }, #endregion - #region CATEGORY 7: Other Quality of Life (AutoReuse / UseTurn) + #region CATEGORY 6: Other Quality of Life (AutoReuse / UseTurn) { ItemID.Amarok, autoReuse }, { ItemID.BatBat, autoReuse }, { ItemID.BladeofGrass, Do(AutoReuse, UseTurn) }, @@ -528,6 +490,7 @@ namespace CalamityMod.Items { ItemID.PaperAirplaneA, autoReuse }, { ItemID.PaperAirplaneB, autoReuse }, // White Paper Airplane { ItemID.PlatinumBroadsword, Do(AutoReuse, UseTurn) }, + { ItemID.Revolver, autoReuse }, { ItemID.RichMahoganySword, Do(AutoReuse, UseTurn) }, { ItemID.ShadewoodSword, Do(AutoReuse, UseTurn) }, { ItemID.SilverBroadsword, Do(AutoReuse, UseTurn) }, @@ -547,30 +510,31 @@ namespace CalamityMod.Items { ItemID.ZapinatorOrange, autoReuse }, #endregion - #region CATEGORY 8: Non-consumable Quality of Life + #region CATEGORY 7: Summoning Item Quality of Life { ItemID.Abeemination, nonConsumableBossSummon }, - { ItemID.BloodMoonStarter, nonConsumableBossSummon }, // Bloody Tear + { ItemID.BloodMoonStarter, Do(UseTimeExact(10))}, // Bloody Tear { ItemID.BloodySpine, nonConsumableBossSummon }, { ItemID.CelestialSigil, nonConsumableBossSummon }, { ItemID.DeerThing, nonConsumableBossSummon }, - { ItemID.GoblinBattleStandard, nonConsumableBossSummon }, + { ItemID.GoblinBattleStandard, Do(UseTimeExact(10)) }, { ItemID.MechanicalEye, nonConsumableBossSummon }, { ItemID.MechanicalSkull, nonConsumableBossSummon }, { ItemID.MechanicalWorm, nonConsumableBossSummon }, { ItemID.MechdusaSummon, nonConsumableBossSummon }, // Ocram's Razor - { ItemID.NaughtyPresent, nonConsumableBossSummon }, - { ItemID.PirateMap, nonConsumableBossSummon }, - { ItemID.PumpkinMoonMedallion, nonConsumableBossSummon }, + { ItemID.NaughtyPresent, Do(UseTimeExact(10)) }, + { ItemID.PirateMap, Do(UseTimeExact(10)) }, + { ItemID.PumpkinMoonMedallion, Do(UseTimeExact(10)) }, { ItemID.QueenSlimeCrystal, nonConsumableBossSummon }, // Gelatin Crystal { ItemID.SlimeCrown, nonConsumableBossSummon }, - { ItemID.SnowGlobe, nonConsumableBossSummon }, - { ItemID.SolarTablet, nonConsumableBossSummon }, + { ItemID.SnowGlobe, Do(UseTimeExact(10)) }, + { ItemID.SolarTablet, Do(UseTimeExact(10)) }, { ItemID.SuspiciousLookingEye, nonConsumableBossSummon }, { ItemID.WormFood, nonConsumableBossSummon }, #endregion - #region CATEGORY 9: Sell Prices + #region CATEGORY 8: Sell Prices { ItemID.EncumberingStone, Do(Worthless) }, + { ItemID.FlareGun, Do(Value(Item.sellPrice(silver: 10))) }, { ItemID.GlowingMushroom, Do(Worthless) }, { ItemID.Mushroom, Do(Worthless) }, { ItemID.PortableStool, Do(Value(Item.sellPrice(copper: 20))) }, // Step Stool @@ -998,15 +962,6 @@ namespace CalamityMod.Items internal static IItemTweak PickPower(int p) => new PickPowerRule(p); #endregion - #region Point Blank - internal class PointBlankRule : IItemTweak - { - public bool AppliesTo(Item it) => true; - public void ApplyTweak(Item it) => it.Calamity().canFirePointBlankShots = true; - } - internal static IItemTweak PointBlank => new PointBlankRule(); - #endregion - #region Scale (True Melee) internal class ScaleDeltaRule : IItemTweak { diff --git a/Items/Dyes/HairDye/AdrenalineHairDye.cs b/Items/Dyes/HairDye/AdrenalineHairDye.cs index 3e4b4da9c3..7b780b8e3c 100644 --- a/Items/Dyes/HairDye/AdrenalineHairDye.cs +++ b/Items/Dyes/HairDye/AdrenalineHairDye.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Dyes.HairDye Item.consumable = true; Item.maxStack = Item.CommonMaxStack; - Item.value = Item.buyPrice(gold: 7, silver: 50); // Sold by Stylist + Item.value = Item.buyPrice(gold: 5); // Sold by Stylist Item.rare = ItemRarityID.Green; } } diff --git a/Items/Dyes/HairDye/RageHairDye.cs b/Items/Dyes/HairDye/RageHairDye.cs index 54df4cc38b..4266039761 100644 --- a/Items/Dyes/HairDye/RageHairDye.cs +++ b/Items/Dyes/HairDye/RageHairDye.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Dyes.HairDye Item.consumable = true; Item.maxStack = Item.CommonMaxStack; - Item.value = Item.buyPrice(gold: 7, silver: 50); // Sold by Stylist + Item.value = Item.buyPrice(gold: 5); // Sold by Stylist Item.rare = ItemRarityID.Green; } } diff --git a/Items/Dyes/HairDye/WingTimeHairDye.cs b/Items/Dyes/HairDye/WingTimeHairDye.cs index 272b2b41f0..45f444b2bd 100644 --- a/Items/Dyes/HairDye/WingTimeHairDye.cs +++ b/Items/Dyes/HairDye/WingTimeHairDye.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Dyes.HairDye Item.consumable = true; Item.maxStack = Item.CommonMaxStack; - Item.value = Item.buyPrice(gold: 7, silver: 50); // Sold by Stylist + Item.value = Item.buyPrice(gold: 5); // Sold by Stylist Item.rare = ItemRarityID.Green; } } diff --git a/Items/Fishing/AstralCatches/UrsaSergeant.cs b/Items/Fishing/AstralCatches/UrsaSergeant.cs index 343875047f..96808d3399 100644 --- a/Items/Fishing/AstralCatches/UrsaSergeant.cs +++ b/Items/Fishing/AstralCatches/UrsaSergeant.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Items.Fishing.AstralCatches { Item.width = 36; Item.height = 26; - Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; - Item.rare = ItemRarityID.LightRed; + Item.value = CalamityGlobalItem.RarityPinkBuyPrice; + Item.rare = ItemRarityID.Pink; Item.accessory = true; } diff --git a/Items/Fishing/SunkenSeaCatches/EutrophicCrate.cs b/Items/Fishing/SunkenSeaCatches/EutrophicCrate.cs index 308fe9e4d2..53b7ba2c8b 100644 --- a/Items/Fishing/SunkenSeaCatches/EutrophicCrate.cs +++ b/Items/Fishing/SunkenSeaCatches/EutrophicCrate.cs @@ -1,4 +1,4 @@ -using CalamityMod.Tiles.SunkenSea; +using CalamityMod.Tiles.SunkenSea; using Terraria; using Terraria.GameContent.ItemDropRules; using Terraria.ID; @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches { ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50), ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50), - ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50) + ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50) })); itemLoot.AddBiomeCrateLootRules(false); diff --git a/Items/Fishing/SunkenSeaCatches/PrismCrate.cs b/Items/Fishing/SunkenSeaCatches/PrismCrate.cs index 57b33bb787..d6cffdeb00 100644 --- a/Items/Fishing/SunkenSeaCatches/PrismCrate.cs +++ b/Items/Fishing/SunkenSeaCatches/PrismCrate.cs @@ -1,4 +1,4 @@ -using CalamityMod.Tiles.SunkenSea; +using CalamityMod.Tiles.SunkenSea; using Terraria; using Terraria.GameContent.ItemDropRules; using Terraria.ID; @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches { ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50), ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50), - ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50) + ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50) })); itemLoot.AddBiomeCrateLootRules(); diff --git a/Items/Materials/BloodOrb.cs b/Items/Materials/BloodOrb.cs index 35716b0f34..d5daec913e 100644 --- a/Items/Materials/BloodOrb.cs +++ b/Items/Materials/BloodOrb.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Materials Item.height = 28; Item.maxStack = Item.CommonMaxStack; Item.value = Item.sellPrice(copper: 40); - Item.rare = ItemRarityID.Blue; + Item.rare = ItemRarityID.Green; } public override void Update(ref float gravity, ref float maxFallSpeed) diff --git a/Items/Materials/CosmiliteBar.cs b/Items/Materials/CosmiliteBar.cs index 65a85a7e88..b76d623ee8 100644 --- a/Items/Materials/CosmiliteBar.cs +++ b/Items/Materials/CosmiliteBar.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Materials public override void SetDefaults() { Item.DefaultToPlaceableTile(ModContent.TileType()); - Item.value = Item.sellPrice(gold: 3); + Item.value = Item.sellPrice(gold: 2); Item.rare = ModContent.RarityType(); } diff --git a/Items/MomentumCapacitor.cs b/Items/MomentumCapacitor.cs index b5bf27973e..0cc3a4abc8 100644 --- a/Items/MomentumCapacitor.cs +++ b/Items/MomentumCapacitor.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items { Item.width = 28; Item.height = 32; - Item.value = CalamityGlobalItem.RarityPinkBuyPrice; + Item.value = Item.buyPrice(gold: 50); // Sold by Bandit Item.rare = ItemRarityID.Pink; Item.useStyle = ItemUseStyleID.HoldUp; diff --git a/Items/Placeables/Furniture/CraftingStations/CosmicAnvilItem.cs b/Items/Placeables/Furniture/CraftingStations/CosmicAnvilItem.cs index d1b80fa264..55da90cc1e 100644 --- a/Items/Placeables/Furniture/CraftingStations/CosmicAnvilItem.cs +++ b/Items/Placeables/Furniture/CraftingStations/CosmicAnvilItem.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations public override void SetDefaults() { Item.DefaultToPlaceableTile(ModContent.TileType()); - Item.value = Item.sellPrice(gold: 60); + Item.value = Item.sellPrice(gold: 50); Item.rare = ModContent.RarityType(); } diff --git a/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs b/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs index 372f45c854..7082ae07af 100644 --- a/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs +++ b/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs @@ -153,6 +153,7 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "Lompl Allimath", "Lucille Karma", "MarieArk", + "Mihaii", "Minecat", "Mrrp", "Nao", diff --git a/Items/Placeables/Furniture/Monoliths/AstralProjector.cs b/Items/Placeables/Furniture/Monoliths/AstralProjector.cs index 7029bff471..b36d59a964 100644 --- a/Items/Placeables/Furniture/Monoliths/AstralProjector.cs +++ b/Items/Placeables/Furniture/Monoliths/AstralProjector.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Items.Placeables.FurnitureMonolith; using CalamityMod.Tiles.Furniture.Monoliths; using Terraria; using Terraria.ID; diff --git a/Items/Placeables/Furniture/Monoliths/BlueDistortedMonolith.cs b/Items/Placeables/Furniture/Monoliths/BlueDistortedMonolith.cs index c74e0940e0..6637a54478 100644 --- a/Items/Placeables/Furniture/Monoliths/BlueDistortedMonolith.cs +++ b/Items/Placeables/Furniture/Monoliths/BlueDistortedMonolith.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Monoliths public override void SetDefaults() { Item.DefaultToPlaceableTile(ModContent.TileType()); - Item.value = Item.sellPrice(gold: 45); + Item.value = Item.sellPrice(gold: 30); Item.rare = ModContent.RarityType(); Item.accessory = true; Item.vanity = true; diff --git a/Items/Placeables/Furniture/Monoliths/PurpleDistortedMonolith.cs b/Items/Placeables/Furniture/Monoliths/PurpleDistortedMonolith.cs index e074b01fce..204e9ce38c 100644 --- a/Items/Placeables/Furniture/Monoliths/PurpleDistortedMonolith.cs +++ b/Items/Placeables/Furniture/Monoliths/PurpleDistortedMonolith.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Monoliths public override void SetDefaults() { Item.DefaultToPlaceableTile(ModContent.TileType()); - Item.value = Item.sellPrice(gold: 45); + Item.value = Item.sellPrice(gold: 30); Item.rare = ModContent.RarityType(); Item.accessory = true; Item.vanity = true; diff --git a/Items/Placeables/Abyss/Acidwood.cs b/Items/Placeables/FurnitureAcidwood/Acidwood.cs similarity index 92% rename from Items/Placeables/Abyss/Acidwood.cs rename to Items/Placeables/FurnitureAcidwood/Acidwood.cs index 629a1cdfe9..64399f45f5 100644 --- a/Items/Placeables/Abyss/Acidwood.cs +++ b/Items/Placeables/FurnitureAcidwood/Acidwood.cs @@ -3,8 +3,9 @@ using CalamityMod.Items.Placeables.Walls; using CalamityMod.Tiles.Abyss; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Tiles.FurnitureAcidwood; -namespace CalamityMod.Items.Placeables.Abyss +namespace CalamityMod.Items.Placeables.FurnitureAcidwood { public class Acidwood : ModItem, ILocalizedModType { diff --git a/Items/Placeables/Abyss/Acidwood.png b/Items/Placeables/FurnitureAcidwood/Acidwood.png similarity index 100% rename from Items/Placeables/Abyss/Acidwood.png rename to Items/Placeables/FurnitureAcidwood/Acidwood.png diff --git a/Items/Placeables/FurnitureBasalt/BasaltSlab.cs b/Items/Placeables/FurnitureBasalt/BasaltSlab.cs new file mode 100644 index 0000000000..c8f4ee7ad8 --- /dev/null +++ b/Items/Placeables/FurnitureBasalt/BasaltSlab.cs @@ -0,0 +1,31 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureBasalt +{ + public class BasaltSlab : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 200; + } + + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(1). + AddTile(TileID.WorkBenches). + DisableDecraft(). + Register(); + } + + } +} diff --git a/Items/Placeables/FurnitureBasalt/BasaltSlab.png b/Items/Placeables/FurnitureBasalt/BasaltSlab.png new file mode 100644 index 0000000000..a40c5e3054 Binary files /dev/null and b/Items/Placeables/FurnitureBasalt/BasaltSlab.png differ diff --git a/Items/Placeables/SunkenSea/Driftwood.cs b/Items/Placeables/FurnitureDriftwood/Driftwood.cs similarity index 87% rename from Items/Placeables/SunkenSea/Driftwood.cs rename to Items/Placeables/FurnitureDriftwood/Driftwood.cs index d870b66fb5..0c707086a7 100644 --- a/Items/Placeables/SunkenSea/Driftwood.cs +++ b/Items/Placeables/FurnitureDriftwood/Driftwood.cs @@ -1,7 +1,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.SunkenSea +namespace CalamityMod.Items.Placeables.FurnitureDriftwood { public class Driftwood : ModItem, ILocalizedModType { @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Placeables.SunkenSea ItemID.Sets.ShimmerTransformToItem[Type] = ItemID.Wood; } - public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) { diff --git a/Items/Placeables/SunkenSea/Driftwood.png b/Items/Placeables/FurnitureDriftwood/Driftwood.png similarity index 100% rename from Items/Placeables/SunkenSea/Driftwood.png rename to Items/Placeables/FurnitureDriftwood/Driftwood.png diff --git a/Items/Placeables/Astral/AstralMonolith.cs b/Items/Placeables/FurnitureMonolith/AstralMonolith.cs similarity index 86% rename from Items/Placeables/Astral/AstralMonolith.cs rename to Items/Placeables/FurnitureMonolith/AstralMonolith.cs index df2a693ba4..58f088114a 100644 --- a/Items/Placeables/Astral/AstralMonolith.cs +++ b/Items/Placeables/FurnitureMonolith/AstralMonolith.cs @@ -1,9 +1,9 @@ -using CalamityMod.Items.Placeables.FurnitureMonolith; +using CalamityMod.Items.Placeables.Astral; using CalamityMod.Items.Placeables.Walls; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.Astral +namespace CalamityMod.Items.Placeables.FurnitureMonolith { public class AstralMonolith : ModItem, ILocalizedModType { @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Placeables.Astral ItemID.Sets.ShimmerTransformToItem[Type] = ItemID.Wood; } - public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) { diff --git a/Items/Placeables/Astral/AstralMonolith.png b/Items/Placeables/FurnitureMonolith/AstralMonolith.png similarity index 100% rename from Items/Placeables/Astral/AstralMonolith.png rename to Items/Placeables/FurnitureMonolith/AstralMonolith.png diff --git a/Items/Placeables/SunkenSea/PolishedNavystoneBrick.cs b/Items/Placeables/FurnitureNavystone/PolishedNavystoneBrick.cs similarity index 75% rename from Items/Placeables/SunkenSea/PolishedNavystoneBrick.cs rename to Items/Placeables/FurnitureNavystone/PolishedNavystoneBrick.cs index e0aa52e928..e78073a46b 100644 --- a/Items/Placeables/SunkenSea/PolishedNavystoneBrick.cs +++ b/Items/Placeables/FurnitureNavystone/PolishedNavystoneBrick.cs @@ -1,7 +1,8 @@ using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Items.Placeables.SunkenSea; -namespace CalamityMod.Items.Placeables.SunkenSea +namespace CalamityMod.Items.Placeables.FurnitureNavystone { public class PolishedNavystoneBrick : ModItem, ILocalizedModType { @@ -11,7 +12,7 @@ namespace CalamityMod.Items.Placeables.SunkenSea Item.ResearchUnlockCount = 100; } - public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); public override void AddRecipes() { diff --git a/Items/Placeables/SunkenSea/PolishedNavystoneBrick.png b/Items/Placeables/FurnitureNavystone/PolishedNavystoneBrick.png similarity index 100% rename from Items/Placeables/SunkenSea/PolishedNavystoneBrick.png rename to Items/Placeables/FurnitureNavystone/PolishedNavystoneBrick.png diff --git a/Items/Placeables/FurnitureRunestone/RunestoneTerracotta.cs b/Items/Placeables/FurnitureRunestone/RunestoneTerracotta.cs new file mode 100644 index 0000000000..31ae7192a0 --- /dev/null +++ b/Items/Placeables/FurnitureRunestone/RunestoneTerracotta.cs @@ -0,0 +1,30 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Walls; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureRunestone +{ + public class RunestoneTerracotta : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 200; + } + + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + + //public override void AddRecipes() + //{ + // CreateRecipe(). + // AddIngredient(4). + // AddTile(TileID.WorkBenches). + // DisableDecraft(). + // Register(); + //} + + } +} diff --git a/Items/Placeables/FurnitureRunestone/RunestoneTerracotta.png b/Items/Placeables/FurnitureRunestone/RunestoneTerracotta.png new file mode 100644 index 0000000000..32329b4f68 Binary files /dev/null and b/Items/Placeables/FurnitureRunestone/RunestoneTerracotta.png differ diff --git a/Items/Placeables/FurnitureShellstone/ShellTrimBrick.cs b/Items/Placeables/FurnitureShellstone/ShellTrimBrick.cs new file mode 100644 index 0000000000..b891c8dce0 --- /dev/null +++ b/Items/Placeables/FurnitureShellstone/ShellTrimBrick.cs @@ -0,0 +1,30 @@ +using CalamityMod.Items.Placeables.Walls; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items.Placeables.SunkenSea; +namespace CalamityMod.Items.Placeables.FurnitureShellstone +{ + public class ShellTrimBrick : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 100; + } + + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + + //public override void AddRecipes() + //{ + // CreateRecipe(). + // AddIngredient(). + // AddTile(TileID.HeavyWorkBench). + // Register(); + // CreateRecipe(). + // AddIngredient(4). + // AddTile(TileID.WorkBenches). + // DisableDecraft(). + // Register(); + //} + } +} diff --git a/Items/Placeables/FurnitureShellstone/ShellTrimBrick.png b/Items/Placeables/FurnitureShellstone/ShellTrimBrick.png new file mode 100644 index 0000000000..532dc11562 Binary files /dev/null and b/Items/Placeables/FurnitureShellstone/ShellTrimBrick.png differ diff --git a/Items/Placeables/SunkenSea/ShellstoneSlab.cs b/Items/Placeables/FurnitureShellstone/ShellstoneSlab.cs similarity index 81% rename from Items/Placeables/SunkenSea/ShellstoneSlab.cs rename to Items/Placeables/FurnitureShellstone/ShellstoneSlab.cs index 2e3be721f4..294482fc1d 100644 --- a/Items/Placeables/SunkenSea/ShellstoneSlab.cs +++ b/Items/Placeables/FurnitureShellstone/ShellstoneSlab.cs @@ -1,8 +1,8 @@ using CalamityMod.Items.Placeables.Walls; using Terraria.ID; using Terraria.ModLoader; - -namespace CalamityMod.Items.Placeables.SunkenSea +using CalamityMod.Items.Placeables.SunkenSea; +namespace CalamityMod.Items.Placeables.FurnitureShellstone { public class ShellstoneSlab : ModItem, ILocalizedModType { @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Placeables.SunkenSea Item.ResearchUnlockCount = 100; } - public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); public override void AddRecipes() { diff --git a/Items/Placeables/SunkenSea/ShellstoneSlab.png b/Items/Placeables/FurnitureShellstone/ShellstoneSlab.png similarity index 100% rename from Items/Placeables/SunkenSea/ShellstoneSlab.png rename to Items/Placeables/FurnitureShellstone/ShellstoneSlab.png diff --git a/Items/Placeables/Ores/AuricOre.cs b/Items/Placeables/Ores/AuricOre.cs index 2fcf606930..0d313efc82 100644 --- a/Items/Placeables/Ores/AuricOre.cs +++ b/Items/Placeables/Ores/AuricOre.cs @@ -18,13 +18,13 @@ namespace CalamityMod.Items.Placeables.Ores public override void SetDefaults() { Item.DefaultToPlaceableTile(ModContent.TileType()); - Item.value = Item.sellPrice(silver: 50); + Item.value = Item.sellPrice(silver: 60); Item.rare = ModContent.RarityType(); } public override void AddRecipes() { - CreateRecipe(30). + CreateRecipe(10). AddIngredient(). AddCondition(Condition.NearShimmer). Register(); diff --git a/Items/Placeables/SunkenSea/AridSoil.cs b/Items/Placeables/SunkenSea/AridSoil.cs new file mode 100644 index 0000000000..7979aeda66 --- /dev/null +++ b/Items/Placeables/SunkenSea/AridSoil.cs @@ -0,0 +1,18 @@ +using CalamityMod.Tiles.SunkenSea; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.SunkenSea +{ + public class AridSoil : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 100; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } + + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + } +} diff --git a/Items/Placeables/SunkenSea/AridSoil.png b/Items/Placeables/SunkenSea/AridSoil.png new file mode 100644 index 0000000000..040ca55e28 Binary files /dev/null and b/Items/Placeables/SunkenSea/AridSoil.png differ diff --git a/Items/Placeables/Walls/AcidwoodWallItem.cs b/Items/Placeables/Walls/AcidwoodWallItem.cs index 51968f9e81..4d6d6f3b77 100644 --- a/Items/Placeables/Walls/AcidwoodWallItem.cs +++ b/Items/Placeables/Walls/AcidwoodWallItem.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; diff --git a/Items/Placeables/Walls/AstralMonolithWall.cs b/Items/Placeables/Walls/AstralMonolithWall.cs index 0066082c69..a82474c496 100644 --- a/Items/Placeables/Walls/AstralMonolithWall.cs +++ b/Items/Placeables/Walls/AstralMonolithWall.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Items.Placeables.FurnitureMonolith; using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; diff --git a/Items/Placeables/Walls/DriftwoodWall.cs b/Items/Placeables/Walls/DriftwoodWall.cs index 6f4217b604..dad7d4bf22 100644 --- a/Items/Placeables/Walls/DriftwoodWall.cs +++ b/Items/Placeables/Walls/DriftwoodWall.cs @@ -1,7 +1,7 @@ using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; using Terraria.ID; -using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Items.Placeables.FurnitureDriftwood; namespace CalamityMod.Items.Placeables.Walls { diff --git a/Items/Placeables/Walls/ShellTrimBrickWall.cs b/Items/Placeables/Walls/ShellTrimBrickWall.cs new file mode 100644 index 0000000000..d319d780ea --- /dev/null +++ b/Items/Placeables/Walls/ShellTrimBrickWall.cs @@ -0,0 +1,26 @@ +using Terraria.ModLoader; +using WallTiles = CalamityMod.Walls; +using Terraria.ID; +using CalamityMod.Items.Placeables.FurnitureShellstone; + +namespace CalamityMod.Items.Placeables.Walls +{ + public class ShellTrimBrickWall : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 400; + } + + public override void SetDefaults() => Item.DefaultToPlaceableWall(ModContent.WallType()); + + public override void AddRecipes() + { + CreateRecipe(4). + AddIngredient(). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/Walls/ShellTrimBrickWall.png b/Items/Placeables/Walls/ShellTrimBrickWall.png new file mode 100644 index 0000000000..6659b189f6 Binary files /dev/null and b/Items/Placeables/Walls/ShellTrimBrickWall.png differ diff --git a/Items/Placeables/Walls/ShellstoneSlabWall.cs b/Items/Placeables/Walls/ShellstoneSlabWall.cs index 71a1f34779..556af95bbd 100644 --- a/Items/Placeables/Walls/ShellstoneSlabWall.cs +++ b/Items/Placeables/Walls/ShellstoneSlabWall.cs @@ -1,7 +1,7 @@ using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; using Terraria.ID; -using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Items.Placeables.FurnitureShellstone; namespace CalamityMod.Items.Placeables.Walls { diff --git a/Items/SummonItems/DeathWhistle.cs b/Items/SummonItems/DeathWhistle.cs index 7fa4d05df6..4fe11d26ce 100644 --- a/Items/SummonItems/DeathWhistle.cs +++ b/Items/SummonItems/DeathWhistle.cs @@ -54,13 +54,6 @@ namespace CalamityMod.Items.SummonItems AddIngredient(ItemID.LihzahrdBrick, 25). AddTile(TileID.DemonAltar). Register(); - - - CreateRecipe(). - AddIngredient(ItemID.LunarTabletFragment, 15). - AddIngredient(ItemID.LihzahrdBrick, 25). - AddTile(TileID.LihzahrdAltar). - Register(); } } } diff --git a/Items/SummonItems/DecapoditaSprout.cs b/Items/SummonItems/DecapoditaSprout.cs index 23ada1d63c..5011a26b64 100644 --- a/Items/SummonItems/DecapoditaSprout.cs +++ b/Items/SummonItems/DecapoditaSprout.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.SummonItems public override bool CanUseItem(Player player) { - return player.ZoneGlowshroom && !NPC.AnyNPCs(ModContent.NPCType()) && !BossRushEvent.BossRushActive; + return player.ZoneGlowshroom && (player.position.Y / 16f) > Main.worldSurface && !NPC.AnyNPCs(ModContent.NPCType()) && !BossRushEvent.BossRushActive; } public override bool? UseItem(Player player) diff --git a/Items/SummonItems/EyeofDesolation.cs b/Items/SummonItems/EyeofDesolation.cs index 8168d6aae7..185af601f1 100644 --- a/Items/SummonItems/EyeofDesolation.cs +++ b/Items/SummonItems/EyeofDesolation.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.SummonItems public override bool CanUseItem(Player player) { - return !Main.IsItDay() && !NPC.AnyNPCs(ModContent.NPCType()) && !BossRushEvent.BossRushActive; + return !NPC.AnyNPCs(ModContent.NPCType()) && !BossRushEvent.BossRushActive; } public override bool? UseItem(Player player) diff --git a/Items/SummonItems/Invasion/CausticTear.cs b/Items/SummonItems/Invasion/CausticTear.cs index 75deb7d52b..0663d7c312 100644 --- a/Items/SummonItems/Invasion/CausticTear.cs +++ b/Items/SummonItems/Invasion/CausticTear.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Items.SummonItems.Invasion public new string LocalizationCategory => "Items.SummonItems"; public override void SetStaticDefaults() { + Item.ResearchUnlockCount = 3; ItemID.Sets.SortingPriorityBossSpawns[Type] = 4; // Goblin Battle Standard } @@ -18,12 +19,11 @@ namespace CalamityMod.Items.SummonItems.Invasion { Item.width = 16; Item.height = 28; - Item.maxStack = 1; - Item.rare = ItemRarityID.Green; - Item.useAnimation = 10; - Item.useTime = 10; + Item.consumable = true; + Item.maxStack = Item.CommonMaxStack; + Item.useAnimation = Item.useTime = 10; Item.useStyle = ItemUseStyleID.HoldUp; - Item.consumable = false; + Item.rare = ItemRarityID.Green; } public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) @@ -51,7 +51,7 @@ namespace CalamityMod.Items.SummonItems.Invasion public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(). AddCondition(Condition.NearWater). Register(); } diff --git a/Items/SummonItems/Invasion/MartianDistressRemote.cs b/Items/SummonItems/Invasion/MartianDistressRemote.cs index 880a169570..73140ce6ff 100644 --- a/Items/SummonItems/Invasion/MartianDistressRemote.cs +++ b/Items/SummonItems/Invasion/MartianDistressRemote.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.SummonItems.Invasion public int frame = 0; public override void SetStaticDefaults() { + Item.ResearchUnlockCount = 3; ItemID.Sets.SortingPriorityBossSpawns[Type] = 17; // Solar Tablet (1 above Lihzahrd Power Cell) } @@ -22,13 +23,13 @@ namespace CalamityMod.Items.SummonItems.Invasion { Item.width = 26; Item.height = 52; - Item.maxStack = 1; - Item.rare = ItemRarityID.Yellow; - Item.useAnimation = 10; - Item.useTime = 10; - Item.useStyle = ItemUseStyleID.HoldUp; - Item.consumable = false; + Item.consumable = true; + Item.maxStack = Item.CommonMaxStack; + Item.useAnimation = Item.useTime = 10; Item.UseSound = SoundID.Zombie67; + Item.useStyle = ItemUseStyleID.HoldUp; + Item.value = Item.buyPrice(gold: 50); // Sold by Cyborg + Item.rare = ItemRarityID.Yellow; } public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) diff --git a/Items/SummonItems/NaiadsWarhorn.cs b/Items/SummonItems/NaiadsWarhorn.cs index ff3e494d4f..cfc28464db 100644 --- a/Items/SummonItems/NaiadsWarhorn.cs +++ b/Items/SummonItems/NaiadsWarhorn.cs @@ -1,7 +1,7 @@ using CalamityMod.Events; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Abyss; -using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Items.Placeables.FurnitureDriftwood; using CalamityMod.NPCs.Leviathan; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; diff --git a/Items/Tools/AcidwoodHammer.cs b/Items/Tools/AcidwoodHammer.cs index 78f5eeb610..31653ac752 100644 --- a/Items/Tools/AcidwoodHammer.cs +++ b/Items/Tools/AcidwoodHammer.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Tools/ClimateChange/Bakidon.cs b/Items/Tools/ClimateChange/Bakidon.cs new file mode 100644 index 0000000000..5372e4491e --- /dev/null +++ b/Items/Tools/ClimateChange/Bakidon.cs @@ -0,0 +1,87 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.GameContent.Creative; +using Terraria.GameContent.NetModules; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Net; + +namespace CalamityMod.Items.Tools.ClimateChange +{ + [LegacyName("Moonlight")] + public class Bakidon : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Tools"; + + public static int FreezeTime => CalamityUtils.MinutesToFrames(10); + public static float RechargeMultiplier => 1; + + public override void SetDefaults() + { + Item.width = 20; + Item.height = 20; + Item.rare = ItemRarityID.LightRed; + Item.useAnimation = 9; + Item.useTime = 9; + Item.autoReuse = false; // Explicitly not autofire, since it can be used quickly now + Item.useStyle = ItemUseStyleID.HoldUp; + Item.UseSound = SoundID.Item60; + Item.consumable = false; + } + + public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) + { + itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.ToolsOther; + } + + public override bool? UseItem(Player player) + { + player.Calamity().WeakTimeFreezeInUse = !player.Calamity().WeakTimeFreezeInUse; + if (Main.netMode != NetmodeID.Server && player == Main.LocalPlayer) + { + var power = CreativePowerManager.Instance.GetPower(); + NetPacket packet = NetCreativePowersModule.PreparePacket(power.PowerId, 1); + packet.Writer.Write(player.Calamity().WeakTimeFreezeInUse); + NetManager.Instance.SendToServerOrLoopback(packet); + } + return true; + } + + public override void PostDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) + { + var cplayer = Main.LocalPlayer.Calamity(); + float fill = 1 - cplayer.WeakTimeFreezeUseTimer / (float)(FreezeTime / RechargeMultiplier); + if (fill >= 1) + return; + + float barScale = 1.1f; + + var barBG = ModContent.Request("CalamityMod/UI/MiscTextures/GenericBarBack").Value; + var barFG = ModContent.Request("CalamityMod/UI/MiscTextures/GenericBarFront").Value; + + Vector2 barOrigin = barBG.Size() * 0.5f; + float yOffset = 7.5f; + Vector2 drawPos = position + Vector2.UnitY * scale * (frame.Height - yOffset); + Rectangle frameCrop = new Rectangle(0, 0, (int)((fill) * barFG.Width), barFG.Height); + Color colorBG = Color.DarkViolet * 0.5f; + Color colorFG = Color.Lerp(Color.Orange, Color.Green, fill); + + spriteBatch.Draw(barBG, drawPos, null, colorBG, 0f, barOrigin, scale * barScale, 0f, 0f); + spriteBatch.Draw(barFG, drawPos, frameCrop, colorFG, 0f, barOrigin, scale * barScale, 0f, 0f); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(ItemID.FallenStar, 10). + AddIngredient(ItemID.SoulofLight, 7). + AddIngredient(ItemID.SoulofNight, 7). + AddIngredient(5). + AddTile(TileID.DemonAltar). + Register(); + } + } +} diff --git a/Items/Tools/ClimateChange/Bakidon.png b/Items/Tools/ClimateChange/Bakidon.png new file mode 100644 index 0000000000..e48b63f744 Binary files /dev/null and b/Items/Tools/ClimateChange/Bakidon.png differ diff --git a/Items/Tools/ClimateChange/Cosmolight.cs b/Items/Tools/ClimateChange/Cosmolight.cs index b380c4f384..4f65a2ecb2 100644 --- a/Items/Tools/ClimateChange/Cosmolight.cs +++ b/Items/Tools/ClimateChange/Cosmolight.cs @@ -1,18 +1,20 @@ -using CalamityMod.CalPlayer; +using System.Linq; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Ores; +using CalamityMod.World; using Terraria; +using Terraria.GameContent.Creative; +using Terraria.GameContent.NetModules; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Net; namespace CalamityMod.Items.Tools.ClimateChange { public class Cosmolight : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Tools"; - // Hardcoded times set by the vanilla Journey Mode buttons. - // These are "halfway through day" and "halfway through night" respectively. - private const int NoonCutoff = 27000; - private const int MidnightCutoff = 16200; public override void SetDefaults() { @@ -21,10 +23,11 @@ namespace CalamityMod.Items.Tools.ClimateChange Item.rare = ItemRarityID.LightRed; Item.useAnimation = 9; Item.useTime = 9; - Item.autoReuse = false; // Explicitly not autofire, since it can be used quickly now + Item.autoReuse = false; Item.useStyle = ItemUseStyleID.HoldUp; Item.UseSound = SoundID.Item60; Item.consumable = false; + Item.channel = true; } public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) @@ -32,42 +35,51 @@ namespace CalamityMod.Items.Tools.ClimateChange itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.ToolsOther; } - public override bool CanUseItem(Player player) => !CalamityPlayer.areThereAnyDamnBosses; + public override bool AltFunctionUse(Player player) + { + return true; + } public override bool? UseItem(Player player) { - //Only SinglePlayer or DedServ should change time to prevent unwanted race condition - if (Main.netMode == NetmodeID.MultiplayerClient) - return true; - - // Early Morning -> Noon - if (Main.dayTime && Main.time < NoonCutoff) - Main.SkipToTime(NoonCutoff, true); - - // Afternoon -> Dusk - else if (Main.dayTime) - Main.SkipToTime(0, false); - - // Early Night -> Midnight - else if (!Main.dayTime && Main.time < MidnightCutoff) - Main.SkipToTime(MidnightCutoff, false); - - // Late Night -> Dawn - else if (!Main.dayTime) - Main.SkipToTime(0, true); - + if (Main.netMode != NetmodeID.Server && player == Main.LocalPlayer && (player.altFunctionUse == 2 || (CreativePowerManager.Instance.GetPower().Enabled))) + { + var power = CreativePowerManager.Instance.GetPower(); + NetPacket packet = NetCreativePowersModule.PreparePacket(power.PowerId, 1); + packet.Writer.Write(!power.Enabled); + NetManager.Instance.SendToServerOrLoopback(packet); + } return true; } public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.FallenStar, 10). - AddIngredient(ItemID.SoulofLight, 7). - AddIngredient(ItemID.SoulofNight, 7). - AddIngredient(5). - AddTile(TileID.Anvils). + AddIngredient(). + AddIngredient(ItemID.Sundial). + AddIngredient(3). + AddIngredient(ItemID.FragmentSolar, 15). + AddTile(TileID.DemonAltar). + Register(); + + CreateRecipe(). + AddIngredient(). + AddIngredient(ItemID.Moondial). + AddIngredient(3). + AddIngredient(ItemID.FragmentSolar, 15). + AddTile(TileID.DemonAltar). Register(); } } + + public class CosmolightTimeRateChange : ModSystem + { + public override void ModifyTimeRate(ref double timeRate, ref double tileUpdateRate, ref double eventUpdateRate) + { + if (Main.player.Any(x => x.active && x.channel && x.altFunctionUse != 2 && x.HeldItem.type == ModContent.ItemType())) + { + timeRate *= 120; + } + } + } } diff --git a/Items/Tools/DriftwoodHammer.cs b/Items/Tools/DriftwoodHammer.cs index 2a1917c2e2..caf2f47cb7 100644 --- a/Items/Tools/DriftwoodHammer.cs +++ b/Items/Tools/DriftwoodHammer.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Items.Placeables.FurnitureDriftwood; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/Tools/MonolithHammer.cs b/Items/Tools/MonolithHammer.cs index 4c30aa8ccb..0280dc5695 100644 --- a/Items/Tools/MonolithHammer.cs +++ b/Items/Tools/MonolithHammer.cs @@ -1,5 +1,5 @@ using CalamityMod.Dusts; -using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Items.Placeables.FurnitureMonolith; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/TreasureBags/BrimstoneWaifuBag.cs b/Items/TreasureBags/BrimstoneElementalBag.cs similarity index 94% rename from Items/TreasureBags/BrimstoneWaifuBag.cs rename to Items/TreasureBags/BrimstoneElementalBag.cs index 4b68c1a252..b56c93b350 100644 --- a/Items/TreasureBags/BrimstoneWaifuBag.cs +++ b/Items/TreasureBags/BrimstoneElementalBag.cs @@ -19,7 +19,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.TreasureBags { - public class BrimstoneWaifuBag : ModItem, ILocalizedModType + [LegacyName("BrimstoneWaifuBag")] + public class BrimstoneElementalBag : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.TreasureBags"; public override void SetStaticDefaults() @@ -80,7 +81,7 @@ namespace CalamityMod.Items.TreasureBags itemLoot.AddRevBagAccessories(); // Vanity - itemLoot.Add(ModContent.ItemType(), 7); + itemLoot.Add(ModContent.ItemType(), 7); itemLoot.Add(ModContent.ItemType(), ThankYouPainting.DropInt); itemLoot.AddIf(() => CalamityWorld.revenge, ModContent.ItemType()); } diff --git a/Items/TreasureBags/BrimstoneWaifuBag.png b/Items/TreasureBags/BrimstoneElementalBag.png similarity index 100% rename from Items/TreasureBags/BrimstoneWaifuBag.png rename to Items/TreasureBags/BrimstoneElementalBag.png diff --git a/Items/TreasureBags/CalamitasCloneBag.cs b/Items/TreasureBags/CalamitasCloneBag.cs index 29a16a9229..492019a90b 100644 --- a/Items/TreasureBags/CalamitasCloneBag.cs +++ b/Items/TreasureBags/CalamitasCloneBag.cs @@ -72,8 +72,8 @@ namespace CalamityMod.Items.TreasureBags // Equipment itemLoot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateFraction); + itemLoot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateFraction); itemLoot.Add(ModContent.ItemType()); - itemLoot.Add(ModContent.ItemType(), 10); itemLoot.AddRevBagAccessories(); // Vanity diff --git a/Items/TreasureBags/DevourerofGodsBag.cs b/Items/TreasureBags/DevourerofGodsBag.cs index 3a2e4aefee..b4cd2b50d9 100644 --- a/Items/TreasureBags/DevourerofGodsBag.cs +++ b/Items/TreasureBags/DevourerofGodsBag.cs @@ -84,7 +84,6 @@ namespace CalamityMod.Items.TreasureBags ModContent.ItemType() })); itemLoot.Add(ModContent.ItemType(), 10); - itemLoot.Add(ModContent.ItemType(), 10); // Equipment itemLoot.Add(ModContent.ItemType()); diff --git a/Items/TreasureBags/DragonfollyBag.cs b/Items/TreasureBags/DragonfollyBag.cs index ac6f05ebad..8a516b2381 100644 --- a/Items/TreasureBags/DragonfollyBag.cs +++ b/Items/TreasureBags/DragonfollyBag.cs @@ -69,7 +69,6 @@ namespace CalamityMod.Items.TreasureBags ModContent.ItemType(), ModContent.ItemType() })); - itemLoot.Add(ModContent.ItemType(), 10); // Equipment itemLoot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateFraction); diff --git a/Items/TreasureBags/MiscGrabBags/StarterBag.cs b/Items/TreasureBags/MiscGrabBags/StarterBag.cs index 84fe1334f6..e121905f8a 100644 --- a/Items/TreasureBags/MiscGrabBags/StarterBag.cs +++ b/Items/TreasureBags/MiscGrabBags/StarterBag.cs @@ -49,19 +49,15 @@ namespace CalamityMod.Items.TreasureBags.MiscGrabBags // Tools and Utility Items tin.Add(ItemID.TinHammer); tin.OnFailedConditions(new CommonDrop(ItemID.CopperHammer, 1)); - itemLoot.Add(ItemID.Bomb, 1, 10, 10); itemLoot.Add(ItemID.Rope, 1, 50, 50); // Potions LeadingConditionRule multiplayer = itemLoot.DefineConditionalDropSet(() => Main.netMode == NetmodeID.MultiplayerClient); - itemLoot.Add(ItemID.MiningPotion, 1, 3, 3); - itemLoot.Add(ItemID.SpelunkerPotion, 1, 3, 3); itemLoot.Add(ItemID.RecallPotion, 1, 3, 3); multiplayer.Add(ItemID.WormholePotion, 1, 3, 3); // Tiles itemLoot.Add(ItemID.Torch, 1, 25, 25); - itemLoot.Add(ItemID.Chest, 1, 3, 3); // Calamity title theme music box (if music mod is enabled) Mod musicMod = ExternalMods.musicMod; diff --git a/Items/TreasureBags/PlaguebringerGoliathBag.cs b/Items/TreasureBags/PlaguebringerGoliathBag.cs index 45f42511a1..c4f16b5b5c 100644 --- a/Items/TreasureBags/PlaguebringerGoliathBag.cs +++ b/Items/TreasureBags/PlaguebringerGoliathBag.cs @@ -67,8 +67,8 @@ namespace CalamityMod.Items.TreasureBags itemLoot.Add(DropHelper.CalamityStyle(DropHelper.BagWeaponDropRateFraction, new int[] { ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), diff --git a/Items/VanillaArmorChanges/EskimoArmorSetChange.cs b/Items/VanillaArmorChanges/EskimoArmorSetChange.cs index 57fb279073..2226f8afe5 100644 --- a/Items/VanillaArmorChanges/EskimoArmorSetChange.cs +++ b/Items/VanillaArmorChanges/EskimoArmorSetChange.cs @@ -30,6 +30,7 @@ namespace CalamityMod.Items.VanillaArmorChanges public override void ApplyArmorSetBonus(Player player) { player.Calamity().eskimoSet = true; + player.Calamity().ColdDebuffMultiplier += 0.25f; player.buffImmune[BuffID.Frostburn] = true; } diff --git a/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs b/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs index cd86a01810..97d941da05 100644 --- a/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs +++ b/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.width = 22; Item.height = 28; - Item.damage = 950; + Item.damage = 860; Item.noMelee = true; Item.noUseGraphic = true; Item.consumable = false; @@ -45,10 +45,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal modItem.UsesCharge = true; modItem.MaxCharge = 250f; - modItem.ChargePerUse = 0.25f; + modItem.ChargePerUse = 0.2f; } - public override float StealthDamageMultiplier => 0.90f; public override float StealthVelocityMultiplier => 1.2f; public override float StealthKnockbackMultiplier => 1.5f; diff --git a/Items/Weapons/DraedonsArsenal/PoleWarper.cs b/Items/Weapons/DraedonsArsenal/PoleWarper.cs index 8a64ec9c5b..20059b8056 100644 --- a/Items/Weapons/DraedonsArsenal/PoleWarper.cs +++ b/Items/Weapons/DraedonsArsenal/PoleWarper.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.width = 38; Item.height = 24; Item.shootSpeed = 10f; - Item.damage = 310; + Item.damage = 207; Item.mana = 12; Item.useAnimation = Item.useTime = 9; Item.useStyle = ItemUseStyleID.HoldUp; @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal modItem.UsesCharge = true; modItem.MaxCharge = 250f; - modItem.ChargePerUse = 1.25f; + modItem.ChargePerUse = 1f; modItem.ChargePerAltUse = 0f; } diff --git a/Items/Weapons/DraedonsArsenal/PulseRifle.cs b/Items/Weapons/DraedonsArsenal/PulseRifle.cs index 202ced18ce..c094d022d0 100644 --- a/Items/Weapons/DraedonsArsenal/PulseRifle.cs +++ b/Items/Weapons/DraedonsArsenal/PulseRifle.cs @@ -23,12 +23,10 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void SetDefaults() { - CalamityGlobalItem modItem = Item.Calamity(); - Item.width = 100; Item.height = 32; Item.DamageType = DamageClass.Ranged; - Item.damage = 720; + Item.damage = 530; Item.useAnimation = Item.useTime = 55; Item.knockBack = 0.25f; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs index e8c399d95f..97c516d6de 100644 --- a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs +++ b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs @@ -26,10 +26,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.width = 78; Item.height = 28; Item.DamageType = DamageClass.Magic; - Item.damage = 1220; + Item.damage = 1200; Item.knockBack = 10f; - Item.useTime = 90; - Item.useAnimation = 90; + Item.useTime = Item.useAnimation = 90; Item.autoReuse = true; Item.mana = 60; @@ -45,7 +44,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal modItem.UsesCharge = true; modItem.MaxCharge = 250f; - modItem.ChargePerUse = 0.75f; + modItem.ChargePerUse = 0.7f; } public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) diff --git a/Items/Weapons/DraedonsArsenal/TheAnomalysNanogun.cs b/Items/Weapons/DraedonsArsenal/TheAnomalysNanogun.cs index d739d964f7..951f3372b0 100644 --- a/Items/Weapons/DraedonsArsenal/TheAnomalysNanogun.cs +++ b/Items/Weapons/DraedonsArsenal/TheAnomalysNanogun.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.width = 102; Item.height = 44; - Item.damage = 1675; + Item.damage = 1600; Item.knockBack = 4.5f; Item.useAnimation = Item.useTime = AnomalysNanogunHoldout.PlasmaFireTimer; Item.shootSpeed = 5f; diff --git a/Items/Weapons/Magic/AcidGun.cs b/Items/Weapons/Magic/AcidGun.cs index fea1b480a5..002238f231 100644 --- a/Items/Weapons/Magic/AcidGun.cs +++ b/Items/Weapons/Magic/AcidGun.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Magic/FaceMelter.cs b/Items/Weapons/Magic/FaceMelter.cs index fd2a7bd48b..bff3fc20e7 100644 --- a/Items/Weapons/Magic/FaceMelter.cs +++ b/Items/Weapons/Magic/FaceMelter.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 56; Item.height = 50; - Item.damage = 165; + Item.damage = 130; Item.DamageType = DamageClass.Magic; Item.mana = 10; Item.useTime = 5; diff --git a/Items/Weapons/Magic/IceBarrage.cs b/Items/Weapons/Magic/IceBarrage.cs index 6f414a611d..6b23620bef 100644 --- a/Items/Weapons/Magic/IceBarrage.cs +++ b/Items/Weapons/Magic/IceBarrage.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; - Item.damage = 2300; + Item.damage = 2250; Item.knockBack = 6f; Item.useAnimation = Item.useTime = 300; Item.reuseDelay = 60; diff --git a/Items/Weapons/Magic/LightGodsBrilliance.cs b/Items/Weapons/Magic/LightGodsBrilliance.cs index 04b8be0ba8..46c1df127f 100644 --- a/Items/Weapons/Magic/LightGodsBrilliance.cs +++ b/Items/Weapons/Magic/LightGodsBrilliance.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 111; Item.DamageType = DamageClass.Magic; Item.mana = 6; - Item.useAnimation = Item.useTime = 4; + Item.useAnimation = Item.useTime = 6; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 3f; diff --git a/Items/Weapons/Magic/ManaRose.cs b/Items/Weapons/Magic/ManaRose.cs index be441ecf19..26d4da54d5 100644 --- a/Items/Weapons/Magic/ManaRose.cs +++ b/Items/Weapons/Magic/ManaRose.cs @@ -26,8 +26,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 3.25f; - Item.value = CalamityGlobalItem.RarityGreenBuyPrice; - Item.rare = ItemRarityID.Green; + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.rare = ItemRarityID.Orange; Item.UseSound = SoundID.Item109; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Magic/NebulousCataclysm.cs b/Items/Weapons/Magic/NebulousCataclysm.cs index cb55c2f942..00b99ac405 100644 --- a/Items/Weapons/Magic/NebulousCataclysm.cs +++ b/Items/Weapons/Magic/NebulousCataclysm.cs @@ -18,11 +18,10 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 120; Item.height = 124; - Item.damage = 510; + Item.damage = 530; Item.DamageType = DamageClass.Magic; - Item.mana = 60; - Item.useTime = 30; - Item.useAnimation = 30; + Item.mana = 70; + Item.useTime = Item.useAnimation = 30; Item.useStyle = ItemUseStyleID.Shoot; Item.UseSound = null; Item.noMelee = true; @@ -33,13 +32,11 @@ namespace CalamityMod.Items.Weapons.Magic Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 3f; + Item.shootSpeed = 5f; } public override void OnConsumeMana(Player player, int manaConsumed) => player.statMana += manaConsumed; - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); diff --git a/Items/Weapons/Magic/Omicron.cs b/Items/Weapons/Magic/Omicron.cs index a2ad1e66c9..aea9835886 100644 --- a/Items/Weapons/Magic/Omicron.cs +++ b/Items/Weapons/Magic/Omicron.cs @@ -24,9 +24,9 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 122; Item.height = 54; - Item.damage = 82; + Item.damage = 80; Item.DamageType = DamageClass.Magic; - Item.mana = 8; + Item.mana = 10; Item.useAnimation = Item.useTime = 4; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; diff --git a/Items/Weapons/Magic/ParasiticSceptor.cs b/Items/Weapons/Magic/ParasiticSceptor.cs index 52190729cf..ecae376a81 100644 --- a/Items/Weapons/Magic/ParasiticSceptor.cs +++ b/Items/Weapons/Magic/ParasiticSceptor.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Magic/PlasmaRod.cs b/Items/Weapons/Magic/PlasmaRod.cs index 904896c5ae..92bdf798c3 100644 --- a/Items/Weapons/Magic/PlasmaRod.cs +++ b/Items/Weapons/Magic/PlasmaRod.cs @@ -26,8 +26,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 2.5f; - Item.value = CalamityGlobalItem.RarityBlueBuyPrice; - Item.rare = ItemRarityID.Blue; + Item.value = CalamityGlobalItem.RarityGreenBuyPrice; + Item.rare = ItemRarityID.Green; Item.UseSound = SoundID.Item109; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Magic/PrimordialAncient.cs b/Items/Weapons/Magic/PrimordialAncient.cs index ba48da9d4b..016e0e5e2a 100644 --- a/Items/Weapons/Magic/PrimordialAncient.cs +++ b/Items/Weapons/Magic/PrimordialAncient.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 40; Item.height = 56; - Item.damage = 4500; + Item.damage = 4350; Item.DamageType = DamageClass.Magic; Item.mana = 95; Item.useTime = 78; @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.velocity.Length() <= 16) - player.velocity += -velocity.SafeNormalize(Vector2.UnitX) * 7.5f; + player.velocity += -velocity.SafeNormalize(Vector2.UnitX) * 7f; bool MaxMana = player.statMana >= (player.statManaMax2 - ((int)(Item.mana * player.manaCost))) && !player.HasBuff(BuffID.ManaSickness); for (int i = -2; i <= 2; i++) diff --git a/Items/Weapons/Magic/SkyGlaze.cs b/Items/Weapons/Magic/SkyGlaze.cs index a9bc168915..cc5d6061da 100644 --- a/Items/Weapons/Magic/SkyGlaze.cs +++ b/Items/Weapons/Magic/SkyGlaze.cs @@ -28,8 +28,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 3.5f; - Item.value = CalamityGlobalItem.RarityBlueBuyPrice; - Item.rare = ItemRarityID.Blue; + Item.value = CalamityGlobalItem.RarityGreenBuyPrice; + Item.rare = ItemRarityID.Green; Item.UseSound = SoundID.Item102; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Magic/SoulPiercer.cs b/Items/Weapons/Magic/SoulPiercer.cs index 5b897e00e0..52b15901ca 100644 --- a/Items/Weapons/Magic/SoulPiercer.cs +++ b/Items/Weapons/Magic/SoulPiercer.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 64; Item.height = 64; - Item.damage = 310; + Item.damage = 235; Item.DamageType = DamageClass.Magic; Item.mana = 19; Item.useAnimation = Item.useTime = 25; diff --git a/Items/Weapons/Magic/VoltaicClimax.cs b/Items/Weapons/Magic/VoltaicClimax.cs index 7cc6371ec6..2f20bd1f80 100644 --- a/Items/Weapons/Magic/VoltaicClimax.cs +++ b/Items/Weapons/Magic/VoltaicClimax.cs @@ -24,11 +24,10 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 78; Item.height = 78; - Item.damage = 235; + Item.damage = 215; Item.DamageType = DamageClass.Magic; Item.mana = 32; - Item.useTime = 29; - Item.useAnimation = 29; + Item.useTime = Item.useAnimation = 34; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5f; diff --git a/Items/Weapons/Melee/AcidwoodSword.cs b/Items/Weapons/Melee/AcidwoodSword.cs index e66fd94976..518cd066c9 100644 --- a/Items/Weapons/Melee/AcidwoodSword.cs +++ b/Items/Weapons/Melee/AcidwoodSword.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Weapons/Melee/Basher.cs b/Items/Weapons/Melee/Basher.cs index a880589f9f..1a7398acf0 100644 --- a/Items/Weapons/Melee/Basher.cs +++ b/Items/Weapons/Melee/Basher.cs @@ -2,7 +2,7 @@ using CalamityMod.Items.BaseItems; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using CalamityMod.Projectiles.Melee; using Terraria; using Terraria.ID; diff --git a/Items/Weapons/Melee/CelestialClaymore.cs b/Items/Weapons/Melee/CelestialClaymore.cs index be2b5e936f..e3274de9e0 100644 --- a/Items/Weapons/Melee/CelestialClaymore.cs +++ b/Items/Weapons/Melee/CelestialClaymore.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Items.Weapons.Melee Item.knockBack = 5.25f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; - Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; - Item.rare = ItemRarityID.LightRed; + Item.value = CalamityGlobalItem.RarityPinkBuyPrice; + Item.rare = ItemRarityID.Pink; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 0.1f; } diff --git a/Items/Weapons/Melee/CosmicDischarge.cs b/Items/Weapons/Melee/CosmicDischarge.cs index 937b7f4615..b9a87ab485 100644 --- a/Items/Weapons/Melee/CosmicDischarge.cs +++ b/Items/Weapons/Melee/CosmicDischarge.cs @@ -15,14 +15,13 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 50; Item.height = 52; - Item.damage = 400; + Item.damage = 450; Item.noMelee = true; Item.noUseGraphic = true; Item.channel = true; Item.autoReuse = true; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.useAnimation = 15; - Item.useTime = 15; + Item.useTime = Item.useAnimation = 15; Item.useStyle = ItemUseStyleID.Shoot; Item.knockBack = 0.5f; Item.UseSound = SoundID.Item122; diff --git a/Items/Weapons/Melee/CosmicShiv.cs b/Items/Weapons/Melee/CosmicShiv.cs index 507e91f4a2..b910c11097 100644 --- a/Items/Weapons/Melee/CosmicShiv.cs +++ b/Items/Weapons/Melee/CosmicShiv.cs @@ -20,9 +20,9 @@ namespace CalamityMod.Items.Weapons.Melee Item.noUseGraphic = true; Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Rapier; - Item.damage = 270; + Item.damage = 155; Item.DamageType = DamageClass.Melee; - Item.useAnimation = Item.useTime = 40; + Item.useAnimation = Item.useTime = 30; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 2.4f; Item.knockBack = 9f; @@ -43,4 +43,4 @@ namespace CalamityMod.Items.Weapons.Melee Register(); } } -} \ No newline at end of file +} diff --git a/Items/Weapons/Melee/DepthCrusher.cs b/Items/Weapons/Melee/DepthCrusher.cs index 86f994eb02..06a4a2dca9 100644 --- a/Items/Weapons/Melee/DepthCrusher.cs +++ b/Items/Weapons/Melee/DepthCrusher.cs @@ -30,8 +30,8 @@ namespace CalamityMod.Items.Weapons.Melee Item.UseSound = null; Item.autoReuse = true; - Item.value = CalamityGlobalItem.RarityGreenBuyPrice; - Item.rare = ItemRarityID.Green; + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.rare = ItemRarityID.Orange; } } } diff --git a/Items/Weapons/Melee/DevilsDevastation.cs b/Items/Weapons/Melee/DevilsDevastation.cs index 2086ec42c8..9c6b075d7c 100644 --- a/Items/Weapons/Melee/DevilsDevastation.cs +++ b/Items/Weapons/Melee/DevilsDevastation.cs @@ -26,7 +26,8 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 118; Item.height = 118; - Item.damage = 400; + Item.damage = 333; + Item.crit = 41; Item.useAnimation = Item.useTime = 45; Item.useStyle = ItemUseStyleID.Shoot; @@ -44,7 +45,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ModContent.RarityType(); } public override bool MeleePrefix() => true; - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 41; public override bool CanUseItem(Player player) => player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0 && !player.Calamity().mouseRight; public override void HoldItem(Player player) { @@ -76,7 +76,7 @@ namespace CalamityMod.Items.Weapons.Melee } if (player.Calamity().demonSwordKillMode && player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0 && player.Calamity().killModeCooldown == KillMode.cooldownMax + KillMode.buffMax) { - Projectile blade = Projectile.NewProjectileDirect(player.GetSource_FromThis(), player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), Item.damage * 15, Item.knockBack, player.whoAmI, 0, throwCount); //This used to be 30x damage. + Projectile.NewProjectile(player.GetSource_ItemUse(Item), player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), Item.damage * 15, Item.knockBack, player.whoAmI, 0, throwCount); //This used to be 30x damage. } } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Melee/DriftwoodSword.cs b/Items/Weapons/Melee/DriftwoodSword.cs index 92ea5b1ac9..dfa2d06a56 100644 --- a/Items/Weapons/Melee/DriftwoodSword.cs +++ b/Items/Weapons/Melee/DriftwoodSword.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Items.Placeables.FurnitureDriftwood; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/Weapons/Melee/EssenceFlayer.cs b/Items/Weapons/Melee/EssenceFlayer.cs index 8a1a1303fa..7d6a21fa2c 100644 --- a/Items/Weapons/Melee/EssenceFlayer.cs +++ b/Items/Weapons/Melee/EssenceFlayer.cs @@ -19,11 +19,10 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 100; Item.height = 78; - Item.damage = 225; + Item.damage = 220; Item.DamageType = DamageClass.Melee; - Item.useAnimation = 19; + Item.useTime = Item.useAnimation = 19; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 19; Item.useTurn = true; Item.knockBack = 8f; Item.UseSound = SoundID.Item71; diff --git a/Items/Weapons/Melee/Excelsus.cs b/Items/Weapons/Melee/Excelsus.cs index 33959b6463..28f35fe250 100644 --- a/Items/Weapons/Melee/Excelsus.cs +++ b/Items/Weapons/Melee/Excelsus.cs @@ -21,11 +21,10 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 78; Item.height = 94; - Item.damage = 250; + Item.damage = 206; Item.DamageType = DamageClass.Melee; - Item.useAnimation = 15; + Item.useTime = Item.useAnimation = 15; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 15; Item.useTurn = true; Item.knockBack = 8f; Item.UseSound = SoundID.Item1; @@ -63,17 +62,5 @@ namespace CalamityMod.Items.Weapons.Melee } return false; } - - public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) - { - var source = player.GetSource_ItemUse(Item); - Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0, player.whoAmI); - } - - public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) - { - var source = player.GetSource_ItemUse(Item); - Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0, player.whoAmI); - } } } diff --git a/Items/Weapons/Melee/GalaxySmasher.cs b/Items/Weapons/Melee/GalaxySmasher.cs index 02ba2e6b70..eba0964390 100644 --- a/Items/Weapons/Melee/GalaxySmasher.cs +++ b/Items/Weapons/Melee/GalaxySmasher.cs @@ -21,10 +21,9 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 86; Item.height = 72; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 1300; + Item.damage = 1180; Item.knockBack = 14f; - Item.useAnimation = 48; - Item.useTime = 48; + Item.useTime = Item.useAnimation = 48; Item.autoReuse = true; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/GildedProboscis.cs b/Items/Weapons/Melee/GildedProboscis.cs index 88189f95cd..c51ec4f628 100644 --- a/Items/Weapons/Melee/GildedProboscis.cs +++ b/Items/Weapons/Melee/GildedProboscis.cs @@ -1,42 +1,49 @@ -using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.Melee; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Melee.Spears; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class GildedProboscis : ModItem, ILocalizedModType + public class GildedProboscis : BaseSwordHoldoutItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + + public override int ProjectileType => ModContent.ProjectileType(); + public override void SetStaticDefaults() { - ItemID.Sets.Spears[Type] = true; ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + base.SetStaticDefaults(); } public override void SetDefaults() { Item.width = 66; Item.height = 66; - Item.damage = 315; + Item.damage = 4000; Item.DamageType = TrueMeleeDamageClass.Instance; - Item.noMelee = true; - Item.useTurn = true; - Item.noUseGraphic = true; - Item.useAnimation = 19; + Item.useAnimation = Item.useTime = 65; Item.useStyle = ItemUseStyleID.Shoot; - Item.useTime = 19; - Item.knockBack = 8.75f; - Item.UseSound = SoundID.Item1; + Item.knockBack = 15f; Item.autoReuse = true; Item.value = CalamityGlobalItem.RarityPurpleBuyPrice; Item.rare = ItemRarityID.Purple; - Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 13f; + Item.channel = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; + base.SetDefaults(); } - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; + public override bool AltFunctionUse(Player player) + { + return true; + } } } diff --git a/Items/Weapons/Melee/MonolithSword.cs b/Items/Weapons/Melee/MonolithSword.cs index 79100057a1..911473b62a 100644 --- a/Items/Weapons/Melee/MonolithSword.cs +++ b/Items/Weapons/Melee/MonolithSword.cs @@ -1,5 +1,5 @@ using CalamityMod.Dusts; -using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Items.Placeables.FurnitureMonolith; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Melee/Murasama.cs b/Items/Weapons/Melee/Murasama.cs index d1e93094a9..8faa8dac75 100644 --- a/Items/Weapons/Melee/Murasama.cs +++ b/Items/Weapons/Melee/Murasama.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 90; Item.height = 134; - Item.damage = 2222; + Item.damage = 2000; Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/Orderbringer.cs b/Items/Weapons/Melee/Orderbringer.cs index 2a05c47c20..657b17ab47 100644 --- a/Items/Weapons/Melee/Orderbringer.cs +++ b/Items/Weapons/Melee/Orderbringer.cs @@ -40,8 +40,8 @@ namespace CalamityMod.Items.Weapons.Melee Item.useTurn = true; Item.knockBack = 8f; Item.autoReuse = true; - Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - Item.rare = ModContent.RarityType(); + Item.value = CalamityGlobalItem.RarityVioletBuyPrice; + Item.rare = ModContent.RarityType(); Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 5.5f; } diff --git a/Items/Weapons/Melee/PrismaticBreaker.cs b/Items/Weapons/Melee/PrismaticBreaker.cs index 48811ff007..72aaab14ce 100644 --- a/Items/Weapons/Melee/PrismaticBreaker.cs +++ b/Items/Weapons/Melee/PrismaticBreaker.cs @@ -17,34 +17,13 @@ namespace CalamityMod.Items.Weapons.Melee public class PrismaticBreaker : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; - internal static readonly Color[] colors = new Color[] - { - new Color(255, 0, 0, 50), //Red - new Color(255, 128, 0, 50), //Orange - new Color(255, 255, 0, 50), //Yellow - new Color(128, 255, 0, 50), //Lime - new Color(0, 255, 0, 50), //Green - new Color(0, 255, 128, 50), //Turquoise - new Color(0, 255, 255, 50), //Cyan - new Color(0, 128, 255, 50), //Light Blue - new Color(0, 0, 255, 50), //Blue - new Color(128, 0, 255, 50), //Purple - new Color(255, 0, 255, 50), //Fuschia - new Color(255, 0, 128, 50) //Hot Pink - }; - - public override void SetStaticDefaults() - { - Item.staff[Type] = true; - - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; - } + public override void SetStaticDefaults() => Item.staff[Type] = true; public override void SetDefaults() { Item.width = 50; Item.height = 50; - Item.damage = 490; + Item.damage = 425; Item.useStyle = ItemUseStyleID.Shoot; Item.useAnimation = Item.useTime = 13; Item.reuseDelay = 30; diff --git a/Items/Weapons/Melee/ScourgeoftheCosmos.cs b/Items/Weapons/Melee/ScourgeoftheCosmos.cs index 8976d32019..a94b2dfeaa 100644 --- a/Items/Weapons/Melee/ScourgeoftheCosmos.cs +++ b/Items/Weapons/Melee/ScourgeoftheCosmos.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { Item.width = Item.height = 64; - Item.damage = 478; + Item.damage = 380; Item.DamageType = DamageClass.MeleeNoSpeed; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/StreamGouge.cs b/Items/Weapons/Melee/StreamGouge.cs index 1fca1c976e..759d565a3d 100644 --- a/Items/Weapons/Melee/StreamGouge.cs +++ b/Items/Weapons/Melee/StreamGouge.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 100; Item.height = 100; - Item.damage = 500; + Item.damage = 470; Item.DamageType = DamageClass.Melee; Item.noMelee = true; Item.useTurn = true; diff --git a/Items/Weapons/Melee/Swordsplosion.cs b/Items/Weapons/Melee/Swordsplosion.cs index ad10265c3a..be38aa1993 100644 --- a/Items/Weapons/Melee/Swordsplosion.cs +++ b/Items/Weapons/Melee/Swordsplosion.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; @@ -95,5 +96,14 @@ namespace CalamityMod.Items.Weapons.Melee Main.dust[swingDust].noGravity = true; } } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(10). + AddIngredient(15). + AddTile(TileID.MythrilAnvil). + Register(); + } } } diff --git a/Items/Weapons/Melee/TaintedBlade.cs b/Items/Weapons/Melee/TaintedBlade.cs index 32159fd38c..d48de63d99 100644 --- a/Items/Weapons/Melee/TaintedBlade.cs +++ b/Items/Weapons/Melee/TaintedBlade.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Weapons.Melee Item.knockBack = 5f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; - Item.value = CalamityGlobalItem.RarityGreenBuyPrice; - Item.rare = ItemRarityID.Green; + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.rare = ItemRarityID.Orange; } public override void MeleeEffects(Player player, Rectangle hitbox) diff --git a/Items/Weapons/Melee/TheMutilator.cs b/Items/Weapons/Melee/TheMutilator.cs index f1b8d996c2..86693c9d87 100644 --- a/Items/Weapons/Melee/TheMutilator.cs +++ b/Items/Weapons/Melee/TheMutilator.cs @@ -31,7 +31,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.useStyle = ItemUseStyleID.Swing; Item.useTime = 30; Item.knockBack = 8f; - Item.UseSound = SoundID.Item1; Item.shootSpeed = 10f; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; diff --git a/Items/Weapons/Melee/TheObliterator.cs b/Items/Weapons/Melee/TheObliterator.cs index ab59e6f12f..7033254faf 100644 --- a/Items/Weapons/Melee/TheObliterator.cs +++ b/Items/Weapons/Melee/TheObliterator.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 42; Item.height = 40; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 222; + Item.damage = 200; Item.knockBack = 7.5f; Item.useTime = 20; Item.useAnimation = 20; diff --git a/Items/Weapons/Melee/Virulence.cs b/Items/Weapons/Melee/Virulence.cs index df28227dba..b9320c46fd 100644 --- a/Items/Weapons/Melee/Virulence.cs +++ b/Items/Weapons/Melee/Virulence.cs @@ -1,6 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; @@ -15,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetStaticDefaults() { - ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() { diff --git a/Items/Weapons/Melee/YateveoBloom.cs b/Items/Weapons/Melee/YateveoBloom.cs index 0cb321f18f..9a88f1eec0 100644 --- a/Items/Weapons/Melee/YateveoBloom.cs +++ b/Items/Weapons/Melee/YateveoBloom.cs @@ -38,8 +38,8 @@ namespace CalamityMod.Items.Weapons.Melee Item.useStyle = ItemUseStyleID.Shoot; Item.UseSound = SoundID.Item1; - Item.value = CalamityGlobalItem.RarityGreenBuyPrice; - Item.rare = ItemRarityID.Green; + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.rare = ItemRarityID.Orange; Item.Calamity().donorItem = true; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Ranged/AcidwoodBow.cs b/Items/Weapons/Ranged/AcidwoodBow.cs index 37af5aa1ea..a2cd8b7c50 100644 --- a/Items/Weapons/Ranged/AcidwoodBow.cs +++ b/Items/Weapons/Ranged/AcidwoodBow.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -26,7 +26,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.WoodenArrowFriendly; Item.shootSpeed = 6.6f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override void AddRecipes() diff --git a/Items/Weapons/Ranged/Alluvion.cs b/Items/Weapons/Ranged/Alluvion.cs index ce16dc0604..a7a96fec75 100644 --- a/Items/Weapons/Ranged/Alluvion.cs +++ b/Items/Weapons/Ranged/Alluvion.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 62; Item.height = 90; - Item.damage = 91; + Item.damage = 96; Item.DamageType = DamageClass.Ranged; Item.useTime = 15; Item.useAnimation = 30; @@ -32,7 +32,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Arrow; Item.rare = ModContent.RarityType(); - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo spawnSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback) @@ -69,12 +68,9 @@ namespace CalamityMod.Items.Weapons.Ranged newType = ModContent.ProjectileType(); break; } - int proj = Projectile.NewProjectile(spawnSource, source.X + offset.X, source.Y + offset.Y, velocity.X, velocity.Y, newType, (int)(damage * 2.3f), knockback, player.whoAmI); + int proj = Projectile.NewProjectile(spawnSource, source.X + offset.X, source.Y + offset.Y, velocity.X, velocity.Y, newType, (int)(damage * 1.35f), knockback, player.whoAmI); if (proj.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[proj].arrow = true; Main.projectile[proj].extraUpdates += 1; - } } else { diff --git a/Items/Weapons/Ranged/AngelicShotgun.cs b/Items/Weapons/Ranged/AngelicShotgun.cs index 3f2a2b21ce..6fbb3fa2e2 100644 --- a/Items/Weapons/Ranged/AngelicShotgun.cs +++ b/Items/Weapons/Ranged/AngelicShotgun.cs @@ -38,7 +38,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/Animosity.cs b/Items/Weapons/Ranged/Animosity.cs index a2aee3a66e..8c11300b71 100644 --- a/Items/Weapons/Ranged/Animosity.cs +++ b/Items/Weapons/Ranged/Animosity.cs @@ -50,7 +50,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 6.5f; Item.useAmmo = AmmoID.Bullet; Item.crit = 8; - Item.Calamity().canFirePointBlankShots = true; } public override void UpdateInventory(Player player) @@ -175,7 +174,7 @@ namespace CalamityMod.Items.Weapons.Ranged if (!Main.dedServ) { string goreType = Main.rand.NextBool() ? "EmptyAnimosityShell" : "EmptyAnimosityShell2"; - Gore.NewGore(source, position, velocity.RotatedBy(2f * -player.direction) * Main.rand.NextFloat(0.6f, 0.7f), Mod.Find(goreType).Type); + Gore.NewGore(source, position, velocity.RotatedBy(2f * -player.direction) * Main.rand.NextFloat(0.6f, 0.7f), Mod.Find(goreType).Type, 0.75f); } return false; } diff --git a/Items/Weapons/Ranged/AntiMaterielRifle.cs b/Items/Weapons/Ranged/AntiMaterielRifle.cs index 37a94ce794..8ed530291d 100644 --- a/Items/Weapons/Ranged/AntiMaterielRifle.cs +++ b/Items/Weapons/Ranged/AntiMaterielRifle.cs @@ -18,10 +18,9 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 154; Item.height = 40; - Item.damage = 1860; + Item.damage = 1818; Item.DamageType = DamageClass.Ranged; - Item.useTime = 60; - Item.useAnimation = 60; + Item.useTime = Item.useAnimation = 60; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 9.5f; @@ -32,7 +31,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Bullet; Item.rare = ModContent.RarityType(); - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-30, 0); diff --git a/Items/Weapons/Ranged/AquashardShotgun.cs b/Items/Weapons/Ranged/AquashardShotgun.cs index c388ec1d2e..e2a590fafb 100644 --- a/Items/Weapons/Ranged/AquashardShotgun.cs +++ b/Items/Weapons/Ranged/AquashardShotgun.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 30f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/Arbalest.cs b/Items/Weapons/Ranged/Arbalest.cs index 3ee4b56f48..bacb49e7ed 100644 --- a/Items/Weapons/Ranged/Arbalest.cs +++ b/Items/Weapons/Ranged/Arbalest.cs @@ -33,12 +33,8 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.PurificationPowder; Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { SoundEngine.PlaySound(SoundID.Item5, player.Center); @@ -70,5 +66,15 @@ namespace CalamityMod.Items.Weapons.Ranged return false; } + + public override void AddRecipes() + { + CreateRecipe(). + AddRecipeGroup("AnyMythrilBar", 10). + AddIngredient(ItemID.Cog, 15). + AddIngredient(ItemID.SoulofSight, 10). + AddTile(TileID.MythrilAnvil). + Register(); + } } } diff --git a/Items/Weapons/Ranged/ArcNovaDiffuser.cs b/Items/Weapons/Ranged/ArcNovaDiffuser.cs index 737ffe8a93..489bc4baea 100644 --- a/Items/Weapons/Ranged/ArcNovaDiffuser.cs +++ b/Items/Weapons/Ranged/ArcNovaDiffuser.cs @@ -46,7 +46,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.autoReuse = false; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 12f; - Item.Calamity().canFirePointBlankShots = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Ranged/Archerfish.cs b/Items/Weapons/Ranged/Archerfish.cs index 52ae3be18f..041243c5bd 100644 --- a/Items/Weapons/Ranged/Archerfish.cs +++ b/Items/Weapons/Ranged/Archerfish.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 11f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-10, -5); diff --git a/Items/Weapons/Ranged/Arietes41.cs b/Items/Weapons/Ranged/Arietes41.cs index 8a163ed1b4..e711d0b85b 100644 --- a/Items/Weapons/Ranged/Arietes41.cs +++ b/Items/Weapons/Ranged/Arietes41.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 13f; Item.shoot = ProjectileID.PurificationPowder; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Ranged/AstralBlaster.cs b/Items/Weapons/Ranged/AstralBlaster.cs index 621e409326..e6c0803a7a 100644 --- a/Items/Weapons/Ranged/AstralBlaster.cs +++ b/Items/Weapons/Ranged/AstralBlaster.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/AstrealDefeat.cs b/Items/Weapons/Ranged/AstrealDefeat.cs index 0c957b8304..08eb0c16d4 100644 --- a/Items/Weapons/Ranged/AstrealDefeat.cs +++ b/Items/Weapons/Ranged/AstrealDefeat.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 4f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/Auralis.cs b/Items/Weapons/Ranged/Auralis.cs index 8de3d051de..23985319f3 100644 --- a/Items/Weapons/Ranged/Auralis.cs +++ b/Items/Weapons/Ranged/Auralis.cs @@ -2,10 +2,10 @@ using CalamityMod.Items.Potions; using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; -using CalamityMod.Sounds; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -33,11 +33,10 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; - Item.UseSound = CommonCalamitySounds.PlasmaBlastSound; + Item.UseSound = new SoundStyle("CalamityMod/Sounds/Item/PlasmaBlast"); Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; - Item.Calamity().canFirePointBlankShots = true; } public override void ModifyWeaponDamage(Player player, ref StatModifier damage) diff --git a/Items/Weapons/Ranged/Barinade.cs b/Items/Weapons/Ranged/Barinade.cs index ed8ba5560f..acd1cd5aa3 100644 --- a/Items/Weapons/Ranged/Barinade.cs +++ b/Items/Weapons/Ranged/Barinade.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 15f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(0, 4); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/Barinautical.cs b/Items/Weapons/Ranged/Barinautical.cs index f3b401d895..a3b381d0b9 100644 --- a/Items/Weapons/Ranged/Barinautical.cs +++ b/Items/Weapons/Ranged/Barinautical.cs @@ -37,7 +37,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 15f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/BladedgeRailbow.cs b/Items/Weapons/Ranged/BladedgeRailbow.cs index 8aa526363c..65eb24364c 100644 --- a/Items/Weapons/Ranged/BladedgeRailbow.cs +++ b/Items/Weapons/Ranged/BladedgeRailbow.cs @@ -110,7 +110,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.PurificationPowder; Item.shootSpeed = 14f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-10, 0); diff --git a/Items/Weapons/Ranged/BlightSpewer.cs b/Items/Weapons/Ranged/BlightSpewer.cs index 0fa6b0f31b..c9696beced 100644 --- a/Items/Weapons/Ranged/BlightSpewer.cs +++ b/Items/Weapons/Ranged/BlightSpewer.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; @@ -14,10 +15,6 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public static readonly SoundStyle Nanomachines = new("CalamityMod/Sounds/Item/NanoSwarm") { PitchVariance = 0.45f, Volume = 0.4f }; - public override void SetStaticDefaults() - { - ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); - } public override void SetDefaults() { Item.width = 76; @@ -47,5 +44,15 @@ namespace CalamityMod.Items.Weapons.Ranged { return new Vector2(-10, 0); } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(). + AddIngredient(5). + AddIngredient(10). + AddTile(TileID.MythrilAnvil). + Register(); + } } } diff --git a/Items/Weapons/Ranged/BlossomFlux.cs b/Items/Weapons/Ranged/BlossomFlux.cs index 81a591dcb8..fb099727e2 100644 --- a/Items/Weapons/Ranged/BlossomFlux.cs +++ b/Items/Weapons/Ranged/BlossomFlux.cs @@ -35,7 +35,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; - Item.Calamity().canFirePointBlankShots = true; } public override bool AltFunctionUse(Player player) diff --git a/Items/Weapons/Ranged/BrimstoneFury.cs b/Items/Weapons/Ranged/BrimstoneFury.cs index 634cb0cef9..c4d586c689 100644 --- a/Items/Weapons/Ranged/BrimstoneFury.cs +++ b/Items/Weapons/Ranged/BrimstoneFury.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 13f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/BulletFilledShotgun.cs b/Items/Weapons/Ranged/BulletFilledShotgun.cs index eda730ce49..428aac80cd 100644 --- a/Items/Weapons/Ranged/BulletFilledShotgun.cs +++ b/Items/Weapons/Ranged/BulletFilledShotgun.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; Item.Calamity().donorItem = true; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-7, 0); diff --git a/Items/Weapons/Ranged/Buzzkill.cs b/Items/Weapons/Ranged/Buzzkill.cs index b5a9e54ea7..cfeef85b6b 100644 --- a/Items/Weapons/Ranged/Buzzkill.cs +++ b/Items/Weapons/Ranged/Buzzkill.cs @@ -26,8 +26,8 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useAnimation = 30; Item.useStyle = ItemUseStyleID.Shoot; Item.knockBack = 1f; - Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; - Item.rare = ItemRarityID.LightRed; + Item.value = CalamityGlobalItem.RarityPinkBuyPrice; + Item.rare = ItemRarityID.Pink; Item.noMelee = true; Item.noUseGraphic = true; Item.DamageType = DamageClass.Ranged; @@ -35,7 +35,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 20f; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/ClamorRifle.cs b/Items/Weapons/Ranged/ClamorRifle.cs index b51d12896b..83d1c7daac 100644 --- a/Items/Weapons/Ranged/ClamorRifle.cs +++ b/Items/Weapons/Ranged/ClamorRifle.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 15f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-5, 0); diff --git a/Items/Weapons/Ranged/CleansingBlaze.cs b/Items/Weapons/Ranged/CleansingBlaze.cs index 02a82cb3a7..80a3ed689c 100644 --- a/Items/Weapons/Ranged/CleansingBlaze.cs +++ b/Items/Weapons/Ranged/CleansingBlaze.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 104; Item.height = 62; - Item.damage = 290; + Item.damage = 275; Item.DamageType = DamageClass.Ranged; Item.useTime = 3; Item.useAnimation = 24; diff --git a/Items/Weapons/Ranged/Condemnation.cs b/Items/Weapons/Ranged/Condemnation.cs index c80a369ecc..4588b6b709 100644 --- a/Items/Weapons/Ranged/Condemnation.cs +++ b/Items/Weapons/Ranged/Condemnation.cs @@ -38,7 +38,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 16f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-50f, 0f); diff --git a/Items/Weapons/Ranged/Contagion.cs b/Items/Weapons/Ranged/Contagion.cs index c878c4894e..1f941bd2dc 100644 --- a/Items/Weapons/Ranged/Contagion.cs +++ b/Items/Weapons/Ranged/Contagion.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityHotPinkBuyPrice; Item.rare = ModContent.RarityType(); Item.Calamity().devItem = true; - Item.Calamity().canFirePointBlankShots = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Ranged/ContinentalGreatbow.cs b/Items/Weapons/Ranged/ContinentalGreatbow.cs index 6e63b9f837..e82feae262 100644 --- a/Items/Weapons/Ranged/ContinentalGreatbow.cs +++ b/Items/Weapons/Ranged/ContinentalGreatbow.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 18; Item.height = 36; - Item.damage = 34; + Item.damage = 38; Item.DamageType = DamageClass.Ranged; Item.useTime = 24; Item.useAnimation = 24; @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.WoodenArrowFriendly; Item.shootSpeed = 17f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo spawnSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/CorinthPrime.cs b/Items/Weapons/Ranged/CorinthPrime.cs index 77b516c7f8..abc000862a 100644 --- a/Items/Weapons/Ranged/CorinthPrime.cs +++ b/Items/Weapons/Ranged/CorinthPrime.cs @@ -37,7 +37,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Bullet; Item.shoot = ModContent.ProjectileType(); - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-20, 5); diff --git a/Items/Weapons/Ranged/CorrodedCaustibow.cs b/Items/Weapons/Ranged/CorrodedCaustibow.cs index 8a79b82295..2c4d7fcd6e 100644 --- a/Items/Weapons/Ranged/CorrodedCaustibow.cs +++ b/Items/Weapons/Ranged/CorrodedCaustibow.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 5f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/CrackshotColt.cs b/Items/Weapons/Ranged/CrackshotColt.cs index 964b561572..6d80394bf6 100644 --- a/Items/Weapons/Ranged/CrackshotColt.cs +++ b/Items/Weapons/Ranged/CrackshotColt.cs @@ -26,14 +26,13 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 2.25f; - Item.value = CalamityGlobalItem.RarityBlueBuyPrice; - Item.rare = ItemRarityID.Blue; + Item.value = CalamityGlobalItem.RarityGreenBuyPrice; + Item.rare = ItemRarityID.Green; Item.UseSound = ShootSound; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.useAmmo = AmmoID.Bullet; Item.shootSpeed = 14f; - Item.Calamity().canFirePointBlankShots = true; } // This item has a right click. diff --git a/Items/Weapons/Ranged/DaemonsFlame.cs b/Items/Weapons/Ranged/DaemonsFlame.cs index f42eb94dd5..ab347b043c 100644 --- a/Items/Weapons/Ranged/DaemonsFlame.cs +++ b/Items/Weapons/Ranged/DaemonsFlame.cs @@ -39,7 +39,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; Item.rare = ModContent.RarityType(); - Item.Calamity().canFirePointBlankShots = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Ranged/DarkechoGreatbow.cs b/Items/Weapons/Ranged/DarkechoGreatbow.cs index 960f51a999..7516999dd8 100644 --- a/Items/Weapons/Ranged/DarkechoGreatbow.cs +++ b/Items/Weapons/Ranged/DarkechoGreatbow.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.PurificationPowder; Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/Deathwind.cs b/Items/Weapons/Ranged/Deathwind.cs index 73fc040b5b..99603e8425 100644 --- a/Items/Weapons/Ranged/Deathwind.cs +++ b/Items/Weapons/Ranged/Deathwind.cs @@ -22,10 +22,9 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 40; Item.height = 82; - Item.damage = 154; + Item.damage = 125; Item.DamageType = DamageClass.Ranged; - Item.useTime = 14; - Item.useAnimation = 14; + Item.useTime = Item.useAnimation = 14; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5f; @@ -36,7 +35,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 20f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) @@ -52,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Ranged float SpeedY = velocity.Y + Main.rand.Next(-20, 21) * 0.05f; if (CalamityUtils.CheckWoodenAmmo(type, player)) { - Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), (int)(damage * 2), knockback, player.whoAmI); + Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), (int)(damage * 1.5f), knockback, player.whoAmI); } else { diff --git a/Items/Weapons/Ranged/DeepcoreGK2.cs b/Items/Weapons/Ranged/DeepcoreGK2.cs index cd98650a7f..d5266a1a8c 100644 --- a/Items/Weapons/Ranged/DeepcoreGK2.cs +++ b/Items/Weapons/Ranged/DeepcoreGK2.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 20f; Item.useAmmo = AmmoID.Bullet; Item.Calamity().donorItem = true; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-20, 0); diff --git a/Items/Weapons/Ranged/DriftwoodBow.cs b/Items/Weapons/Ranged/DriftwoodBow.cs index 66322c7e39..ca84ae4483 100644 --- a/Items/Weapons/Ranged/DriftwoodBow.cs +++ b/Items/Weapons/Ranged/DriftwoodBow.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Items.Placeables.FurnitureDriftwood; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -28,7 +28,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.WoodenArrowFriendly; Item.shootSpeed = 6.6f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) diff --git a/Items/Weapons/Ranged/EternalBlizzard.cs b/Items/Weapons/Ranged/EternalBlizzard.cs index 988223ece0..6fa526b7e7 100644 --- a/Items/Weapons/Ranged/EternalBlizzard.cs +++ b/Items/Weapons/Ranged/EternalBlizzard.cs @@ -32,7 +32,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 11f; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/Eviscerator.cs b/Items/Weapons/Ranged/Eviscerator.cs index ecbb2126b4..420161a8c4 100644 --- a/Items/Weapons/Ranged/Eviscerator.cs +++ b/Items/Weapons/Ranged/Eviscerator.cs @@ -35,7 +35,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 22f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/FirestormCannon.cs b/Items/Weapons/Ranged/FirestormCannon.cs index 5dd7c75d29..1a7daf469b 100644 --- a/Items/Weapons/Ranged/FirestormCannon.cs +++ b/Items/Weapons/Ranged/FirestormCannon.cs @@ -33,8 +33,8 @@ namespace CalamityMod.Items.Weapons.Ranged Item.noUseGraphic = true; Item.autoReuse = true; - Item.value = CalamityGlobalItem.RarityGreenBuyPrice; - Item.rare = ItemRarityID.Green; + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.rare = ItemRarityID.Orange; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 5.5f; Item.useAmmo = AmmoID.Flare; diff --git a/Items/Weapons/Ranged/FlarewingBow.cs b/Items/Weapons/Ranged/FlarewingBow.cs index a1f6d32d26..b5320a069d 100644 --- a/Items/Weapons/Ranged/FlarewingBow.cs +++ b/Items/Weapons/Ranged/FlarewingBow.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.WoodenArrowFriendly; Item.shootSpeed = 18f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/FlurrystormCannon.cs b/Items/Weapons/Ranged/FlurrystormCannon.cs index fb1b12d224..18fe6f9193 100644 --- a/Items/Weapons/Ranged/FlurrystormCannon.cs +++ b/Items/Weapons/Ranged/FlurrystormCannon.cs @@ -33,7 +33,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.useAmmo = AmmoID.Snowball; Item.shootSpeed = 18f; - Item.Calamity().canFirePointBlankShots = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Ranged/FrostbiteBlaster.cs b/Items/Weapons/Ranged/FrostbiteBlaster.cs index 38f5f1dca7..9712968aa5 100644 --- a/Items/Weapons/Ranged/FrostbiteBlaster.cs +++ b/Items/Weapons/Ranged/FrostbiteBlaster.cs @@ -31,7 +31,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.autoReuse = true; Item.shoot = ProjectileID.Blizzard; Item.shootSpeed = 9f; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-14, 0); diff --git a/Items/Weapons/Ranged/Fungicide.cs b/Items/Weapons/Ranged/Fungicide.cs index 656cdd1b20..9515420395 100644 --- a/Items/Weapons/Ranged/Fungicide.cs +++ b/Items/Weapons/Ranged/Fungicide.cs @@ -33,7 +33,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 14f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/Galeforce.cs b/Items/Weapons/Ranged/Galeforce.cs index 0f943388fb..e6d5027ac3 100644 --- a/Items/Weapons/Ranged/Galeforce.cs +++ b/Items/Weapons/Ranged/Galeforce.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.WoodenArrowFriendly; Item.shootSpeed = 20f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/GoldenEagle.cs b/Items/Weapons/Ranged/GoldenEagle.cs index 0188b657ce..c0611fc259 100644 --- a/Items/Weapons/Ranged/GoldenEagle.cs +++ b/Items/Weapons/Ranged/GoldenEagle.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.Bullet; Item.shootSpeed = 20f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-5, 0); diff --git a/Items/Weapons/Ranged/Goobow.cs b/Items/Weapons/Ranged/Goobow.cs index b2d20525cf..dd909d62fe 100644 --- a/Items/Weapons/Ranged/Goobow.cs +++ b/Items/Weapons/Ranged/Goobow.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.WoodenArrowFriendly; Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo spawnSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/GunkShot.cs b/Items/Weapons/Ranged/GunkShot.cs index 9f68640f98..b63a4cacdc 100644 --- a/Items/Weapons/Ranged/GunkShot.cs +++ b/Items/Weapons/Ranged/GunkShot.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.PurificationPowder; Item.shootSpeed = 5f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/HalibutCannon.cs b/Items/Weapons/Ranged/HalibutCannon.cs index 7dc5bc4243..61983896f5 100644 --- a/Items/Weapons/Ranged/HalibutCannon.cs +++ b/Items/Weapons/Ranged/HalibutCannon.cs @@ -32,7 +32,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.Bullet; Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-15, 0); diff --git a/Items/Weapons/Ranged/HeavenlyGale.cs b/Items/Weapons/Ranged/HeavenlyGale.cs index 57c046422b..428804c436 100644 --- a/Items/Weapons/Ranged/HeavenlyGale.cs +++ b/Items/Weapons/Ranged/HeavenlyGale.cs @@ -55,7 +55,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useTurn = true; Item.rare = ModContent.RarityType(); Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.Calamity().canFirePointBlankShots = true; } // Shoot via the projectile only diff --git a/Items/Weapons/Ranged/Helstorm.cs b/Items/Weapons/Ranged/Helstorm.cs index dfb6c5bb78..759c3af8c5 100644 --- a/Items/Weapons/Ranged/Helstorm.cs +++ b/Items/Weapons/Ranged/Helstorm.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.PurificationPowder; Item.shootSpeed = 11.5f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/HoarfrostBow.cs b/Items/Weapons/Ranged/HoarfrostBow.cs index 8bad1545c0..03947cc5eb 100644 --- a/Items/Weapons/Ranged/HoarfrostBow.cs +++ b/Items/Weapons/Ranged/HoarfrostBow.cs @@ -35,7 +35,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/Infinity.cs b/Items/Weapons/Ranged/Infinity.cs index f2f5ffe8ec..cf5737a4f1 100644 --- a/Items/Weapons/Ranged/Infinity.cs +++ b/Items/Weapons/Ranged/Infinity.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 56; Item.height = 24; - Item.damage = 95; + Item.damage = 75; Item.DamageType = DamageClass.Ranged; Item.useTime = 1; Item.useAnimation = 4; @@ -39,22 +39,14 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.PurificationPowder; Item.shootSpeed = 6f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } - public override Vector2? HoldoutOffset() - { - return new Vector2(-5, 0); - } - - public override bool AltFunctionUse(Player player) - { - return true; - } + public override Vector2? HoldoutOffset() => new Vector2(-5, 0); + public override bool AltFunctionUse(Player player) => true; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int shotType = (player.altFunctionUse == 2 ? type : ModContent.ProjectileType()); + int shotType = player.altFunctionUse == 2 ? type : ModContent.ProjectileType(); // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction position = position + (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.UnitX) * 65; @@ -62,10 +54,11 @@ namespace CalamityMod.Items.Weapons.Ranged SineCounter++; if (SineCounter % 4 == 0) { - Vector2 helixVel1 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(sine)); - Vector2 helixVel2 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(-sine)); - int shot1 = Projectile.NewProjectile(source, position.X, position.Y, helixVel1.X, helixVel1.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 1 : 0); - int shot2 = Projectile.NewProjectile(source, position.X, position.Y, helixVel2.X, helixVel2.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 1 : 0); + for (int i = -1; i <= 1; i += 2) + { + Vector2 helixVel = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(i * sine)); + Projectile.NewProjectile(source, position, helixVel, shotType, damage, knockback, player.whoAmI, 0, 0, player.altFunctionUse != 2 ? 1 : 0); + } } else if (player.altFunctionUse != 2) { diff --git a/Items/Weapons/Ranged/Leviatitan.cs b/Items/Weapons/Ranged/Leviatitan.cs index 90464eefc7..50f41fa042 100644 --- a/Items/Weapons/Ranged/Leviatitan.cs +++ b/Items/Weapons/Ranged/Leviatitan.cs @@ -43,7 +43,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 13f; Item.useStyle = ItemUseStyleID.Shoot; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-10, 0); diff --git a/Items/Weapons/Ranged/LunarianBow.cs b/Items/Weapons/Ranged/LunarianBow.cs index ea46bd671f..c4cbe5856e 100644 --- a/Items/Weapons/Ranged/LunarianBow.cs +++ b/Items/Weapons/Ranged/LunarianBow.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 8f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo spawnSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/MagnaCannon.cs b/Items/Weapons/Ranged/MagnaCannon.cs index 891cb67dd6..0ec26d25e0 100644 --- a/Items/Weapons/Ranged/MagnaCannon.cs +++ b/Items/Weapons/Ranged/MagnaCannon.cs @@ -42,7 +42,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.autoReuse = false; Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); - Item.Calamity().canFirePointBlankShots = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Ranged/Malevolence.cs b/Items/Weapons/Ranged/Malevolence.cs index c02c95234f..e37f4b5964 100644 --- a/Items/Weapons/Ranged/Malevolence.cs +++ b/Items/Weapons/Ranged/Malevolence.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Magic; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; @@ -12,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class Malevolence : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 36; @@ -30,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) @@ -50,15 +53,5 @@ namespace CalamityMod.Items.Weapons.Ranged } return false; } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.BeesKnees). - AddIngredient(5). - AddIngredient(10). - AddTile(TileID.MythrilAnvil). - Register(); - } } } diff --git a/Items/Weapons/Ranged/MarksmanBow.cs b/Items/Weapons/Ranged/MarksmanBow.cs index 0508a50472..04583dd290 100644 --- a/Items/Weapons/Ranged/MarksmanBow.cs +++ b/Items/Weapons/Ranged/MarksmanBow.cs @@ -31,7 +31,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; Item.Calamity().donorItem = true; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/Megalodon.cs b/Items/Weapons/Ranged/Megalodon.cs index 28ff3ad12f..deaea9191e 100644 --- a/Items/Weapons/Ranged/Megalodon.cs +++ b/Items/Weapons/Ranged/Megalodon.cs @@ -33,7 +33,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 16f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-5, 0); diff --git a/Items/Weapons/Ranged/MidasPrime.cs b/Items/Weapons/Ranged/MidasPrime.cs index 80ec7fb0ed..ee3a74f18d 100644 --- a/Items/Weapons/Ranged/MidasPrime.cs +++ b/Items/Weapons/Ranged/MidasPrime.cs @@ -43,7 +43,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.useAmmo = AmmoID.Bullet; Item.shootSpeed = 14f; - Item.Calamity().canFirePointBlankShots = true; } // This item has a right click. diff --git a/Items/Weapons/Ranged/MonolithBow.cs b/Items/Weapons/Ranged/MonolithBow.cs index fa8b2ea872..be48baab00 100644 --- a/Items/Weapons/Ranged/MonolithBow.cs +++ b/Items/Weapons/Ranged/MonolithBow.cs @@ -1,5 +1,5 @@ using CalamityMod.Dusts; -using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Items.Placeables.FurnitureMonolith; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -31,7 +31,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 9f; Item.useAmmo = AmmoID.Arrow; Item.consumeAmmoOnFirstShotOnly = true; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/Monsoon.cs b/Items/Weapons/Ranged/Monsoon.cs index 803457a30d..2404be7c1b 100644 --- a/Items/Weapons/Ranged/Monsoon.cs +++ b/Items/Weapons/Ranged/Monsoon.cs @@ -31,7 +31,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.WoodenArrowFriendly; Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo spawnSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback) @@ -67,10 +66,7 @@ namespace CalamityMod.Items.Weapons.Ranged } int proj = Projectile.NewProjectile(spawnSource, source.X + offset.X, source.Y + offset.Y, velocity.X, velocity.Y, newType, (int)(damage * 1.1), knockback, player.whoAmI); if (proj.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[proj].arrow = true; Main.projectile[proj].extraUpdates += 1; - } } else { diff --git a/Items/Weapons/Ranged/NettlevineGreatbow.cs b/Items/Weapons/Ranged/NettlevineGreatbow.cs index 683f4a03bd..486f5f7cf7 100644 --- a/Items/Weapons/Ranged/NettlevineGreatbow.cs +++ b/Items/Weapons/Ranged/NettlevineGreatbow.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.PurificationPowder; Item.shootSpeed = 16f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/NitroExpressRifle.cs b/Items/Weapons/Ranged/NitroExpressRifle.cs index 021467e500..e4515a024e 100644 --- a/Items/Weapons/Ranged/NitroExpressRifle.cs +++ b/Items/Weapons/Ranged/NitroExpressRifle.cs @@ -35,7 +35,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Bullet; Item.rare = ItemRarityID.LightRed; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-10, 8); @@ -80,30 +79,6 @@ namespace CalamityMod.Items.Weapons.Ranged Vector2 itemSize = new Vector2(Item.width, Item.height); Vector2 itemOrigin = new Vector2(-5, 6); - - //Sniper's horizontal recoil; can be a bit subtle but it is noticeable - if (player.altFunctionUse == 2) - { - //Recoil: - int anim = 0; - for (int r = 0; r < Item.useAnimation; ++r) - { - if (anim == 10 && r < Item.useAnimation / 2) //animates every 10 frames so that the player notices a recoil because this happens way too fast - { - itemPosition.X -= player.direction * 0.025f; - itemPosition.Y -= player.direction * 0.025f; - anim = 0; - } - else if (anim == 10 && r > Item.useAnimation / 2) - { - itemPosition.X += player.direction * 0.025f; - itemPosition.Y += player.direction * 0.025f; - anim = 0; - } - ++anim; - } - } - CalamityUtils.CleanHoldStyle(player, itemRotation, itemPosition, itemSize, itemOrigin); base.UseStyle(player, heldItemFrame); } @@ -116,7 +91,7 @@ namespace CalamityMod.Items.Weapons.Ranged float animProgress = 1 - player.itemTime / (float)player.itemTimeMax; float rotation = (player.Center - player.Calamity().mouseWorld).ToRotation() * player.gravDir + MathHelper.PiOver2; if (animProgress < 0.5) - rotation += (player.altFunctionUse == 2 ? -1f : -0.45f) * (float)Math.Pow((0.5f - animProgress) / 0.5f, 2) * player.direction; + rotation += -0.45f * (float)Math.Pow((0.5f - animProgress) / 0.5f, 2) * player.direction; player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, rotation); //must be here otherwise it will vibrate diff --git a/Items/Weapons/Ranged/Norfleet.cs b/Items/Weapons/Ranged/Norfleet.cs index 46d0fbe03a..9d2effc04d 100644 --- a/Items/Weapons/Ranged/Norfleet.cs +++ b/Items/Weapons/Ranged/Norfleet.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -23,32 +25,32 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 140; Item.height = 42; - Item.damage = 7777; + Item.damage = 5678; + Item.DamageType = DamageClass.Ranged; + Item.crit = 16; + Item.useTime = Item.useAnimation = 70; Item.knockBack = 15f; Item.shootSpeed = 30f; + Item.useStyle = ItemUseStyleID.Shoot; - Item.useAnimation = 70; - Item.useTime = 70; Item.UseSound = null; Item.shoot = ModContent.ProjectileType(); Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; Item.rare = ModContent.RarityType(); Item.noMelee = true; Item.noUseGraphic = true; - Item.DamageType = DamageClass.Ranged; Item.channel = true; Item.autoReuse = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; - // Makes the rotation of the mouse around the player sync in multiplayer. public override void HoldItem(Player player) => player.Calamity().mouseRotationListener = true; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { // Funny punishment for trying to cheeese with Norfleet - bool cheater = (player.Calamity().NorfleetCounter >= 3 && player.Calamity().NorfleetCounter < 1000); + bool cheater = player.Calamity().NorfleetCounter >= 3 && player.Calamity().NorfleetCounter < 1000; if (player.Calamity().NorfleetCounter >= 1000) loadedShots = 1; @@ -66,12 +68,19 @@ namespace CalamityMod.Items.Weapons.Ranged player.Calamity().NorfleetCounter++; loadedShots--; - if (loadedShots <= 0) - { loadedShots = 3; - } return false; } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(). + AddIngredient(8). + AddIngredient(20). + AddTile(). + Register(); + } } } diff --git a/Items/Weapons/Ranged/OnyxChainBlaster.cs b/Items/Weapons/Ranged/OnyxChainBlaster.cs index e0ec40a167..d1a3d83b57 100644 --- a/Items/Weapons/Ranged/OnyxChainBlaster.cs +++ b/Items/Weapons/Ranged/OnyxChainBlaster.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.BlackBolt; Item.shootSpeed = 24f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() @@ -38,8 +37,8 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { // Fire the Onyx Shard that is characteristic of the Onyx Blaster - // The shard deals 250% damage and double knockback - int shardDamage = (int)(2.5f * damage); + // The shard deals 200% damage and double knockback + int shardDamage = 2 * damage; float shardKB = 2f * knockback; Vector2 offset = new Vector2(Main.rand.Next(-25, 26) * 0.05f, Main.rand.Next(-25, 26) * 0.05f); Projectile shard = Projectile.NewProjectileDirect(source, position, velocity + offset, ProjectileID.BlackBolt, shardDamage, shardKB, player.whoAmI); diff --git a/Items/Weapons/Ranged/Onyxia.cs b/Items/Weapons/Ranged/Onyxia.cs index f24d83f173..f3beca5561 100644 --- a/Items/Weapons/Ranged/Onyxia.cs +++ b/Items/Weapons/Ranged/Onyxia.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 84; Item.height = 34; - Item.damage = 100; + Item.damage = 90; Item.DamageType = DamageClass.Ranged; Item.useAnimation = Item.useTime = 10; Item.useStyle = ItemUseStyleID.Shoot; @@ -31,7 +31,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.BlackBolt; Item.shootSpeed = 28f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/OpalStriker.cs b/Items/Weapons/Ranged/OpalStriker.cs index e923ec174b..74b412be00 100644 --- a/Items/Weapons/Ranged/OpalStriker.cs +++ b/Items/Weapons/Ranged/OpalStriker.cs @@ -41,7 +41,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.channel = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 12f; - Item.Calamity().canFirePointBlankShots = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Ranged/P90.cs b/Items/Weapons/Ranged/P90.cs index 6a810bba8d..5d24b598cf 100644 --- a/Items/Weapons/Ranged/P90.cs +++ b/Items/Weapons/Ranged/P90.cs @@ -24,20 +24,16 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 1.5f; - Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; + Item.value = Item.buyPrice(gold: 35); // Sold by Arms Dealer Item.rare = ItemRarityID.LightRed; Item.UseSound = SoundID.Item11 with { Volume = 0.6f }; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 9f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } - public override Vector2? HoldoutOffset() - { - return new Vector2(-14, -1); - } + public override Vector2? HoldoutOffset() => new Vector2(-14, -1); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Ranged/PearlGod.cs b/Items/Weapons/Ranged/PearlGod.cs index 60f8d757f1..6e3a075207 100644 --- a/Items/Weapons/Ranged/PearlGod.cs +++ b/Items/Weapons/Ranged/PearlGod.cs @@ -39,7 +39,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 14f; Item.shoot = ProjectileID.PurificationPowder; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/PestilentDefiler.cs b/Items/Weapons/Ranged/PestilentDefiler.cs index 395795456d..93e90c6d72 100644 --- a/Items/Weapons/Ranged/PestilentDefiler.cs +++ b/Items/Weapons/Ranged/PestilentDefiler.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/PlagueTaintedSMG.cs b/Items/Weapons/Ranged/PlagueTaintedSMG.cs index c5c81448e0..92c9b28190 100644 --- a/Items/Weapons/Ranged/PlagueTaintedSMG.cs +++ b/Items/Weapons/Ranged/PlagueTaintedSMG.cs @@ -42,7 +42,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Bullet; Item.shoot = ModContent.ProjectileType(); - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-20, 5); diff --git a/Items/Weapons/Ranged/PridefulHuntersPlanarRipper.cs b/Items/Weapons/Ranged/PridefulHuntersPlanarRipper.cs index baefda8bf8..7a1cc73742 100644 --- a/Items/Weapons/Ranged/PridefulHuntersPlanarRipper.cs +++ b/Items/Weapons/Ranged/PridefulHuntersPlanarRipper.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityPurpleBuyPrice; Item.rare = ItemRarityID.Purple; Item.Calamity().donorItem = true; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-12, -6); diff --git a/Items/Weapons/Ranged/PristineFury.cs b/Items/Weapons/Ranged/PristineFury.cs index 73019a111a..2e438e997a 100644 --- a/Items/Weapons/Ranged/PristineFury.cs +++ b/Items/Weapons/Ranged/PristineFury.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override float UseTimeMultiplier(Player player) => player.altFunctionUse == 2 ? 0.5f : 1f; public override void HoldItem(Player player) { - int max = player.Calamity().furyFuelMax; + int max = CalamityPlayer.FuryFuelMax; if (player.Calamity().cooldowns.TryGetValue(FuryFuel.ID, out var cooldown)) { cooldown.timeLeft = max - player.Calamity().furyFuel; diff --git a/Items/Weapons/Ranged/Pumpler.cs b/Items/Weapons/Ranged/Pumpler.cs index 36aeaafe38..b5625dec07 100644 --- a/Items/Weapons/Ranged/Pumpler.cs +++ b/Items/Weapons/Ranged/Pumpler.cs @@ -36,7 +36,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.channel = true; Item.shoot = ProjectileID.PurificationPowder; Item.shootSpeed = 11f; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-30f, 0f); diff --git a/Items/Weapons/Ranged/RealmRavager.cs b/Items/Weapons/Ranged/RealmRavager.cs index 16b499d389..6846184c84 100644 --- a/Items/Weapons/Ranged/RealmRavager.cs +++ b/Items/Weapons/Ranged/RealmRavager.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 30f; Item.shoot = ModContent.ProjectileType(); Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-10, 0); diff --git a/Items/Weapons/Ranged/Riftburst.cs b/Items/Weapons/Ranged/Riftburst.cs index bbd5ba795b..ba72722721 100644 --- a/Items/Weapons/Ranged/Riftburst.cs +++ b/Items/Weapons/Ranged/Riftburst.cs @@ -19,9 +19,8 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 48; Item.height = 82; - Item.damage = 122; - Item.useTime = 12; - Item.useAnimation = 12; + Item.damage = 91; + Item.useTime = Item.useAnimation = 12; Item.useStyle = ItemUseStyleID.Shoot; Item.knockBack = 3f; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; @@ -35,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 20f; Item.useAmmo = AmmoID.Arrow; Item.rare = ModContent.RarityType(); - Item.Calamity().canFirePointBlankShots = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Ranged/RubicoPrime.cs b/Items/Weapons/Ranged/RubicoPrime.cs index 2042afd288..ed48b70019 100644 --- a/Items/Weapons/Ranged/RubicoPrime.cs +++ b/Items/Weapons/Ranged/RubicoPrime.cs @@ -42,7 +42,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; Item.Calamity().donorItem = true; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/SDFMG.cs b/Items/Weapons/Ranged/SDFMG.cs index b5568938c2..0d7273664d 100644 --- a/Items/Weapons/Ranged/SDFMG.cs +++ b/Items/Weapons/Ranged/SDFMG.cs @@ -14,14 +14,15 @@ namespace CalamityMod.Items.Weapons.Ranged public class SDFMG : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + + private int ShotCounter = 0; public override void SetDefaults() { Item.width = 74; Item.height = 34; - Item.damage = 115; + Item.damage = 118; Item.DamageType = DamageClass.Ranged; - Item.useTime = 2; - Item.useAnimation = 2; + Item.useTime = Item.useAnimation = 3; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 2.75f; @@ -32,20 +33,20 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 16f; Item.useAmmo = AmmoID.Bullet; Item.rare = ModContent.RarityType(); - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 15; - public override Vector2? HoldoutOffset() => new Vector2(-10, 0); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - float SpeedX = velocity.X + Main.rand.Next(-5, 6) * 0.05f; - float SpeedY = velocity.Y + Main.rand.Next(-5, 6) * 0.05f; - if (Main.rand.NextBool(5)) + float SpeedX = velocity.X + Main.rand.NextFloat(-0.25f, 0.25f); + float SpeedY = velocity.Y + Main.rand.NextFloat(-0.25f, 0.25f); + ShotCounter++; + if (ShotCounter >= 7) { + ShotCounter = 0; Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), damage, knockback, player.whoAmI); } Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI); diff --git a/Items/Weapons/Ranged/Sandblaster.cs b/Items/Weapons/Ranged/Sandblaster.cs index 4a309f2dd4..34396470c2 100644 --- a/Items/Weapons/Ranged/Sandblaster.cs +++ b/Items/Weapons/Ranged/Sandblaster.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); Item.useAmmo = AmmoID.Sand; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-10, 0); diff --git a/Items/Weapons/Ranged/ScorchedEarth.cs b/Items/Weapons/Ranged/ScorchedEarth.cs index e5645f4876..f41004aca0 100644 --- a/Items/Weapons/Ranged/ScorchedEarth.cs +++ b/Items/Weapons/Ranged/ScorchedEarth.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 104; Item.height = 44; - Item.damage = 500; + Item.damage = 485; Item.DamageType = DamageClass.Ranged; Item.useTime = 8; Item.useAnimation = 32; // 4 shots in just over half a second diff --git a/Items/Weapons/Ranged/Seadragon.cs b/Items/Weapons/Ranged/Seadragon.cs index 39ca453361..60d2fadde4 100644 --- a/Items/Weapons/Ranged/Seadragon.cs +++ b/Items/Weapons/Ranged/Seadragon.cs @@ -38,7 +38,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 16f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-10, 0); diff --git a/Items/Weapons/Ranged/Shellshooter.cs b/Items/Weapons/Ranged/Shellshooter.cs index 45d07acc99..e39b9b4e76 100644 --- a/Items/Weapons/Ranged/Shellshooter.cs +++ b/Items/Weapons/Ranged/Shellshooter.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 2.5f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/Shredder.cs b/Items/Weapons/Ranged/Shredder.cs index a31575ec1d..3eef641cf6 100644 --- a/Items/Weapons/Ranged/Shredder.cs +++ b/Items/Weapons/Ranged/Shredder.cs @@ -37,7 +37,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.Bullet; Item.shootSpeed = 5f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-5, 0); diff --git a/Items/Weapons/Ranged/Shroomer.cs b/Items/Weapons/Ranged/Shroomer.cs index 4d103f929b..2b619ab787 100644 --- a/Items/Weapons/Ranged/Shroomer.cs +++ b/Items/Weapons/Ranged/Shroomer.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.Bullet; Item.shootSpeed = 10f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/SlagMagnum.cs b/Items/Weapons/Ranged/SlagMagnum.cs index e3a71d7dfb..6c3656b312 100644 --- a/Items/Weapons/Ranged/SlagMagnum.cs +++ b/Items/Weapons/Ranged/SlagMagnum.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/SomaPrime.cs b/Items/Weapons/Ranged/SomaPrime.cs index fb63f652a9..228cff54b3 100644 --- a/Items/Weapons/Ranged/SomaPrime.cs +++ b/Items/Weapons/Ranged/SomaPrime.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityHotPinkBuyPrice; Item.rare = ModContent.RarityType(); Item.Calamity().devItem = true; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/SpeedBlaster.cs b/Items/Weapons/Ranged/SpeedBlaster.cs index 91eb648f97..7992b482e5 100644 --- a/Items/Weapons/Ranged/SpeedBlaster.cs +++ b/Items/Weapons/Ranged/SpeedBlaster.cs @@ -50,7 +50,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.autoReuse = true; Item.shootSpeed = 20f; Item.shoot = ModContent.ProjectileType(); - Item.Calamity().canFirePointBlankShots = true; } public override bool AltFunctionUse(Player player) => true; public override bool CanUseItem(Player player) diff --git a/Items/Weapons/Ranged/Starmada.cs b/Items/Weapons/Ranged/Starmada.cs index 2db3e341ec..fd88973360 100644 --- a/Items/Weapons/Ranged/Starmada.cs +++ b/Items/Weapons/Ranged/Starmada.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Ores; using CalamityMod.Projectiles.Ranged; +using CalamityMod.Projectiles.Typeless; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; @@ -19,37 +20,43 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 122; Item.height = 50; - Item.damage = 135; - Item.knockBack = 15f; - Item.shootSpeed = 16f; - Item.useStyle = ItemUseStyleID.Shoot; - Item.useAnimation = Item.useTime = 27; - Item.UseSound = SoundID.Item92; - Item.shoot = ModContent.ProjectileType(); - Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - Item.noMelee = true; - Item.noUseGraphic = true; + Item.damage = 150; Item.DamageType = DamageClass.Ranged; - Item.channel = true; - Item.useTurn = false; - Item.useAmmo = AmmoID.FallenStar; + Item.useAnimation = Item.useTime = 15; + Item.knockBack = 15f; + Item.useStyle = ItemUseStyleID.Shoot; + Item.UseSound = SoundID.Item92; Item.autoReuse = true; + Item.noMelee = true; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 16f; + Item.useAmmo = AmmoID.FallenStar; Item.rare = ModContent.RarityType(); + Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; } - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; - - // Spawning the holdout cannot consume ammo - public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.NextBool(3) && player.ownedProjectileCounts[Item.shoot] > 0; - - public override Vector2? HoldoutOffset() - { - return new Vector2(-10, 0); - } + public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.NextBool(3); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), 0, 0f, player.whoAmI); + for (int i = 0; i < 5; i++) + { + int starType = Utils.SelectRandom(Main.rand, + [ + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ProjectileID.StarCannonStar, + ProjectileID.Starfury + ]); + int star = Projectile.NewProjectile(source, position + Main.rand.NextVector2Circular(21f, 21f), velocity * Main.rand.NextFloat(0.8f, 1.2f), starType, damage, knockback, player.whoAmI); + if (star.WithinBounds(Main.maxProjectiles)) + { + Main.projectile[star].penetrate = 1; + Main.projectile[star].timeLeft = 300; + Main.projectile[star].DamageType = DamageClass.Ranged; + Main.projectile[star].netUpdate = true; + } + } return false; } diff --git a/Items/Weapons/Ranged/Starmageddon.cs b/Items/Weapons/Ranged/Starmageddon.cs index 0d1bbf25ea..941526a75c 100644 --- a/Items/Weapons/Ranged/Starmageddon.cs +++ b/Items/Weapons/Ranged/Starmageddon.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 166; Item.height = 62; - Item.damage = 100; + Item.damage = 138; Item.knockBack = 4f; Item.shootSpeed = 16f; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/Ranged/SuperradiantSlaughterer.cs b/Items/Weapons/Ranged/SuperradiantSlaughterer.cs index 37e84fff5d..027e1acbab 100644 --- a/Items/Weapons/Ranged/SuperradiantSlaughterer.cs +++ b/Items/Weapons/Ranged/SuperradiantSlaughterer.cs @@ -73,7 +73,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = ShootSpeed; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/Svantechnical.cs b/Items/Weapons/Ranged/Svantechnical.cs index d8f1d3de75..8815647088 100644 --- a/Items/Weapons/Ranged/Svantechnical.cs +++ b/Items/Weapons/Ranged/Svantechnical.cs @@ -41,7 +41,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 6f; Item.shoot = ProjectileID.PurificationPowder; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-5, 0); @@ -62,12 +61,12 @@ namespace CalamityMod.Items.Weapons.Ranged SineCounter++; if (SineCounter % 4 == 0) { - Vector2 helixVel1 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(sine)); - Vector2 helixVel2 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(-sine)); - Vector2 helixVel3 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(sine2)); - int shot1 = Projectile.NewProjectile(source, position.X, position.Y, helixVel1.X, helixVel1.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 2f : 0); - int shot2 = Projectile.NewProjectile(source, position.X, position.Y, helixVel2.X, helixVel2.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 4f : 0); - int shot3 = Projectile.NewProjectile(source, position.X, position.Y, helixVel3.X, helixVel3.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 3f : 0); + Vector2 helixVel1 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(sine)); + Vector2 helixVel2 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(-sine)); + Vector2 helixVel3 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(sine2)); + Projectile.NewProjectile(source, position.X, position.Y, helixVel1.X, helixVel1.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 2f : 0); + Projectile.NewProjectile(source, position.X, position.Y, helixVel2.X, helixVel2.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 4f : 0); + Projectile.NewProjectile(source, position.X, position.Y, helixVel3.X, helixVel3.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 3f : 0); } else if (player.altFunctionUse != 2) { diff --git a/Items/Weapons/Ranged/TelluricGlare.cs b/Items/Weapons/Ranged/TelluricGlare.cs index bdf5de94a8..56277e2258 100644 --- a/Items/Weapons/Ranged/TelluricGlare.cs +++ b/Items/Weapons/Ranged/TelluricGlare.cs @@ -45,7 +45,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 18f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-14f, 0f); public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.NextFloat() < 0.25f; diff --git a/Items/Weapons/Ranged/TheBallista.cs b/Items/Weapons/Ranged/TheBallista.cs index 4cea38a174..17cf943732 100644 --- a/Items/Weapons/Ranged/TheBallista.cs +++ b/Items/Weapons/Ranged/TheBallista.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 20f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/TheHive.cs b/Items/Weapons/Ranged/TheHive.cs index cdf9b6d41d..cc2a7042ba 100644 --- a/Items/Weapons/Ranged/TheHive.cs +++ b/Items/Weapons/Ranged/TheHive.cs @@ -1,6 +1,4 @@ -using CalamityMod.Items.Weapons.Magic; -using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -20,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public static int OriginalUseTime = 34; public override void SetStaticDefaults() { - ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() { diff --git a/Items/Weapons/Ranged/TheMaelstrom.cs b/Items/Weapons/Ranged/TheMaelstrom.cs index 5a2e736fee..d84ae38408 100644 --- a/Items/Weapons/Ranged/TheMaelstrom.cs +++ b/Items/Weapons/Ranged/TheMaelstrom.cs @@ -32,7 +32,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 20f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; Item.Calamity().donorItem = true; } diff --git a/Items/Weapons/Ranged/ThePack.cs b/Items/Weapons/Ranged/ThePack.cs index 138350b602..9bafa9238f 100644 --- a/Items/Weapons/Ranged/ThePack.cs +++ b/Items/Weapons/Ranged/ThePack.cs @@ -19,8 +19,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 46; Item.damage = 1000; Item.DamageType = DamageClass.Ranged; - Item.useTime = 52; - Item.useAnimation = 52; + Item.useTime = Item.useAnimation = 53; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 7.5f; diff --git a/Items/Weapons/Ranged/ThermoclineBlaster.cs b/Items/Weapons/Ranged/ThermoclineBlaster.cs index cb2a56540f..f71a133430 100644 --- a/Items/Weapons/Ranged/ThermoclineBlaster.cs +++ b/Items/Weapons/Ranged/ThermoclineBlaster.cs @@ -36,7 +36,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.shoot = ProjectileID.PurificationPowder; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Ranged/Toxibow.cs b/Items/Weapons/Ranged/Toxibow.cs index 87580560b6..66c1fe65b0 100644 --- a/Items/Weapons/Ranged/Toxibow.cs +++ b/Items/Weapons/Ranged/Toxibow.cs @@ -1,6 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; @@ -30,7 +30,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.PurificationPowder; Item.shootSpeed = 15f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/TyrannysEnd.cs b/Items/Weapons/Ranged/TyrannysEnd.cs index 3625172b9f..86672a1208 100644 --- a/Items/Weapons/Ranged/TyrannysEnd.cs +++ b/Items/Weapons/Ranged/TyrannysEnd.cs @@ -33,7 +33,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/Ultima.cs b/Items/Weapons/Ranged/Ultima.cs index b3cb9c5e31..7f00ee3db8 100644 --- a/Items/Weapons/Ranged/Ultima.cs +++ b/Items/Weapons/Ranged/Ultima.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 44; Item.height = 58; - Item.damage = 150; + Item.damage = 115; Item.DamageType = DamageClass.Ranged; Item.useAnimation = Item.useTime = 8; Item.useStyle = ItemUseStyleID.Shoot; @@ -37,7 +37,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/UniversalGenesis.cs b/Items/Weapons/Ranged/UniversalGenesis.cs index 289d0d026f..86d1b1acd3 100644 --- a/Items/Weapons/Ranged/UniversalGenesis.cs +++ b/Items/Weapons/Ranged/UniversalGenesis.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 158; Item.height = 60; - Item.damage = 192; + Item.damage = 180; Item.DamageType = DamageClass.Ranged; Item.useAnimation = Item.useTime = 26; Item.knockBack = 6.5f; @@ -27,7 +27,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.Bullet; Item.shootSpeed = 20f; Item.autoReuse = true; - Item.Calamity().canFirePointBlankShots = true; Item.noMelee = true; Item.UseSound = SoundID.Item38; @@ -35,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-50f, -8f); @@ -57,33 +55,23 @@ namespace CalamityMod.Items.Weapons.Ranged // Stars from above float speed = Item.shootSpeed; - Vector2 spawnPos = player.RotatedRelativePoint(player.MountedCenter, true); - int starAmt = 6; - int starDmg = (int)(damage * 0.4); + int starAmt = 5; + int starDmg = (int)(damage * 0.5f); for (int i = 0; i < starAmt; i++) { - spawnPos = new Vector2(player.Center.X + (Main.rand.Next(201) * -(float)player.direction) + (Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); + Vector2 spawnPos = new Vector2(player.Center.X + (Main.rand.Next(201) * -player.direction) + (Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); spawnPos.X = (spawnPos.X + player.Center.X) / 2f + Main.rand.Next(-200, 201); spawnPos.Y -= 100 + i; - float xDist = Main.mouseX + Main.screenPosition.X - spawnPos.X; - float yDist = Main.mouseY + Main.screenPosition.Y - spawnPos.Y; - if (yDist < 0f) - { - yDist *= -1f; - } - if (yDist < 20f) - { - yDist = 20f; - } - float travelDist = (float)Math.Sqrt(xDist * xDist + yDist * yDist); - travelDist = speed / travelDist; - xDist *= travelDist; - yDist *= travelDist; - float xVel = xDist + Main.rand.NextFloat(-0.6f, 0.6f); - float yVel = yDist + Main.rand.NextFloat(-0.6f, 0.6f); - int star = Projectile.NewProjectile(source, spawnPos.X, spawnPos.Y, xVel, yVel, ModContent.ProjectileType(), starDmg, knockback, player.whoAmI, i, 1f); + + Vector2 vel = new Vector2(Main.mouseX + Main.screenPosition.X - spawnPos.X, MathF.Abs(Main.mouseY + Main.screenPosition.Y - spawnPos.Y)); + if (vel.Y < 20f) + vel.Y = 20f; + vel = vel.SafeNormalize(Vector2.UnitY) * speed; + vel.X += Main.rand.NextFloat(-0.6f, 0.6f); + vel.Y += Main.rand.NextFloat(-0.6f, 0.6f); + + int star = Projectile.NewProjectile(source, spawnPos, vel, ModContent.ProjectileType(), starDmg, knockback, player.whoAmI, i, 1f); Main.projectile[star].extraUpdates = 2; - Main.projectile[star].localNPCHitCooldown = 30; } return false; } diff --git a/Items/Weapons/Ranged/VernalBolter.cs b/Items/Weapons/Ranged/VernalBolter.cs index 2f22ba25bf..f105614251 100644 --- a/Items/Weapons/Ranged/VernalBolter.cs +++ b/Items/Weapons/Ranged/VernalBolter.cs @@ -31,7 +31,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) diff --git a/Items/Weapons/Ranged/Voidragon.cs b/Items/Weapons/Ranged/Voidragon.cs index 2cd4c67f92..b02785a578 100644 --- a/Items/Weapons/Ranged/Voidragon.cs +++ b/Items/Weapons/Ranged/Voidragon.cs @@ -41,7 +41,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityHotPinkBuyPrice; Item.rare = ModContent.RarityType(); Item.Calamity().devItem = true; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/WulfrumBlunderbuss.cs b/Items/Weapons/Ranged/WulfrumBlunderbuss.cs index caa91297a0..1ba16b3a15 100644 --- a/Items/Weapons/Ranged/WulfrumBlunderbuss.cs +++ b/Items/Weapons/Ranged/WulfrumBlunderbuss.cs @@ -53,7 +53,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.autoReuse = false; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 15f; - Item.Calamity().canFirePointBlankShots = true; } public override void HoldItem(Player player) diff --git a/Items/Weapons/Rogue/BouncingEyeball.cs b/Items/Weapons/Rogue/BouncingEyeball.cs index 0da66baf7a..1d99ee20b9 100644 --- a/Items/Weapons/Rogue/BouncingEyeball.cs +++ b/Items/Weapons/Rogue/BouncingEyeball.cs @@ -9,9 +9,6 @@ namespace CalamityMod.Items.Weapons.Rogue { public class BouncingEyeball : RogueWeapon { - public override void SetStaticDefaults() - { - } public override void SetDefaults() { Item.width = 26; @@ -21,8 +18,8 @@ namespace CalamityMod.Items.Weapons.Rogue Item.useAnimation = 23; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 3.5f; - Item.rare = ItemRarityID.Green; - Item.value = CalamityGlobalItem.RarityGreenBuyPrice; + Item.rare = ItemRarityID.Orange; + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.DamageType = RogueDamageClass.Instance; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Rogue/CelestialReaper.cs b/Items/Weapons/Rogue/CelestialReaper.cs index 946d0cf61e..5ca003824f 100644 --- a/Items/Weapons/Rogue/CelestialReaper.cs +++ b/Items/Weapons/Rogue/CelestialReaper.cs @@ -9,7 +9,6 @@ namespace CalamityMod.Items.Weapons.Rogue { public class CelestialReaper : RogueWeapon { - public override void SetDefaults() { Item.width = 66; @@ -24,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.rare = ItemRarityID.Purple; Item.UseSound = SoundID.Item71; Item.autoReuse = true; - Item.value = CalamityGlobalItem.RarityPurpleBuyPrice; + Item.value = Item.buyPrice(platinum: 3); // Sold by Bandit Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 20f; Item.DamageType = RogueDamageClass.Instance; diff --git a/Items/Weapons/Rogue/Cinquedea.cs b/Items/Weapons/Rogue/Cinquedea.cs index 888ab52af2..9ef1e82297 100644 --- a/Items/Weapons/Rogue/Cinquedea.cs +++ b/Items/Weapons/Rogue/Cinquedea.cs @@ -9,7 +9,6 @@ namespace CalamityMod.Items.Weapons.Rogue { public class Cinquedea : RogueWeapon { - public override void SetDefaults() { Item.width = 32; @@ -26,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.noUseGraphic = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; - Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.value = Item.buyPrice(gold: 10); // Sold by Bandit Item.DamageType = RogueDamageClass.Instance; } diff --git a/Items/Weapons/Rogue/EclipsesFall.cs b/Items/Weapons/Rogue/EclipsesFall.cs index 556ee58087..3718a981cf 100644 --- a/Items/Weapons/Rogue/EclipsesFall.cs +++ b/Items/Weapons/Rogue/EclipsesFall.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.height = 88; Item.damage = 500; Item.knockBack = 3.5f; - Item.useAnimation = Item.useTime = 22; + Item.useAnimation = Item.useTime = 24; Item.autoReuse = true; Item.DamageType = RogueDamageClass.Instance; Item.shootSpeed = 15f; diff --git a/Items/Weapons/Rogue/EnchantedAxe.cs b/Items/Weapons/Rogue/EnchantedAxe.cs index 187a61f645..266a1b1862 100644 --- a/Items/Weapons/Rogue/EnchantedAxe.cs +++ b/Items/Weapons/Rogue/EnchantedAxe.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.UseSound = SoundID.Item1; Item.autoReuse = true; Item.maxStack = 1; - Item.value = 1000; Item.rare = ItemRarityID.Orange; Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Rogue/Eradicator.cs b/Items/Weapons/Rogue/Eradicator.cs index ef9768f94a..bf74a45769 100644 --- a/Items/Weapons/Rogue/Eradicator.cs +++ b/Items/Weapons/Rogue/Eradicator.cs @@ -21,23 +21,22 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 62; Item.height = 58; - Item.damage = 620; + Item.damage = 540; + Item.DamageType = RogueDamageClass.Instance; + Item.useTime = Item.useAnimation = 24; + Item.knockBack = 7f; Item.noMelee = true; Item.noUseGraphic = true; Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 33; - Item.useAnimation = 33; - Item.knockBack = 7f; Item.UseSound = SoundID.Item1; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; Item.rare = ModContent.RarityType(); Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = Speed; - Item.DamageType = RogueDamageClass.Instance; } - public override float StealthDamageMultiplier => 0.6f; + public override float StealthDamageMultiplier => 0.75f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Rogue/ExecutionersBlade.cs b/Items/Weapons/Rogue/ExecutionersBlade.cs index 2ca189198f..72d6da8198 100644 --- a/Items/Weapons/Rogue/ExecutionersBlade.cs +++ b/Items/Weapons/Rogue/ExecutionersBlade.cs @@ -17,12 +17,11 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 64; Item.height = 64; - Item.damage = 195; + Item.damage = 165; Item.noMelee = true; Item.noUseGraphic = true; Item.useTime = 3; Item.useAnimation = 9; - Item.reuseDelay = 1; Item.useLimitPerAnimation = 3; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 6.75f; diff --git a/Items/Weapons/Rogue/Exorcism.cs b/Items/Weapons/Rogue/Exorcism.cs index 115a31a492..4f412f2c09 100644 --- a/Items/Weapons/Rogue/Exorcism.cs +++ b/Items/Weapons/Rogue/Exorcism.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Weapons.Rogue Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 12f; Item.autoReuse = true; - Item.value = CalamityGlobalItem.RarityPinkBuyPrice; - Item.rare = ItemRarityID.Pink; + Item.value = CalamityGlobalItem.RarityLightPurpleBuyPrice; + Item.rare = ItemRarityID.LightPurple; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 6f; Item.DamageType = RogueDamageClass.Instance; diff --git a/Items/Weapons/Rogue/GacruxianMollusk.cs b/Items/Weapons/Rogue/GacruxianMollusk.cs index eefd917f1f..8ea216e1a8 100644 --- a/Items/Weapons/Rogue/GacruxianMollusk.cs +++ b/Items/Weapons/Rogue/GacruxianMollusk.cs @@ -28,8 +28,8 @@ namespace CalamityMod.Items.Weapons.Rogue Item.noUseGraphic = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = Speed; - Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; - Item.rare = ItemRarityID.LightRed; + Item.value = CalamityGlobalItem.RarityPinkBuyPrice; + Item.rare = ItemRarityID.Pink; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Rogue/Glaive.cs b/Items/Weapons/Rogue/Glaive.cs index 91097539e0..d303ab8633 100644 --- a/Items/Weapons/Rogue/Glaive.cs +++ b/Items/Weapons/Rogue/Glaive.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.useAnimation = 15; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 3; - Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.value = Item.buyPrice(gold: 10); // Sold by Bandit Item.rare = ItemRarityID.Orange; Item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/GodsParanoia.cs b/Items/Weapons/Rogue/GodsParanoia.cs index 35a5e65a3c..4e80bce431 100644 --- a/Items/Weapons/Rogue/GodsParanoia.cs +++ b/Items/Weapons/Rogue/GodsParanoia.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 20; Item.height = 20; - Item.damage = 210; + Item.damage = 163; Item.DamageType = RogueDamageClass.Instance; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Rogue/HeavenfallenStardisk.cs b/Items/Weapons/Rogue/HeavenfallenStardisk.cs index 6d7330fa64..81315aedd6 100644 --- a/Items/Weapons/Rogue/HeavenfallenStardisk.cs +++ b/Items/Weapons/Rogue/HeavenfallenStardisk.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Items.Weapons.Rogue Item.knockBack = 8f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; - Item.value = CalamityGlobalItem.RarityLimeBuyPrice; - Item.rare = ItemRarityID.Lime; + Item.value = CalamityGlobalItem.RarityYellowBuyPrice; + Item.rare = ItemRarityID.Yellow; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; Item.DamageType = RogueDamageClass.Instance; diff --git a/Items/Weapons/Rogue/Hypothermia.cs b/Items/Weapons/Rogue/Hypothermia.cs index 5cb23c0ae9..31043a2f4e 100644 --- a/Items/Weapons/Rogue/Hypothermia.cs +++ b/Items/Weapons/Rogue/Hypothermia.cs @@ -19,31 +19,29 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 46; Item.height = 32; + Item.damage = 148; + Item.DamageType = RogueDamageClass.Instance; + Item.useTime = 4; + Item.useAnimation = 12; + Item.reuseDelay = 1; + Item.useLimitPerAnimation = 3; + Item.knockBack = 3f; + Item.autoReuse = true; Item.noUseGraphic = true; Item.noMelee = true; Item.useStyle = ItemUseStyleID.Swing; Item.UseSound = SoundID.Item7; - Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - - Item.damage = 200; - Item.useTime = 3; - Item.useAnimation = 21; - Item.reuseDelay = 1; - Item.useLimitPerAnimation = 7; - Item.knockBack = 3f; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 8f; Item.rare = ModContent.RarityType(); - Item.DamageType = RogueDamageClass.Instance; + Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; } // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 16; - public override float StealthDamageMultiplier => 1.1f; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) @@ -66,10 +64,9 @@ namespace CalamityMod.Items.Weapons.Rogue for (int i = 0; i < projAmt; ++i) { - float SpeedX = velocity.X + Main.rand.NextFloat(-2f, 2f); - float SpeedY = velocity.Y + Main.rand.NextFloat(-2f, 2f); + Vector2 shardVel = velocity.RotatedByRandom(MathHelper.Pi / 30f) * Main.rand.NextFloat(0.9f, 1.1f); int texID = Main.rand.Next(4); - Projectile.NewProjectile(source, position, new Vector2(SpeedX, SpeedY), type, damage, knockback, player.whoAmI, texID, 0f); + Projectile.NewProjectile(source, position, shardVel, type, damage, knockback, player.whoAmI, texID); } return false; diff --git a/Items/Weapons/Rogue/IceStar.cs b/Items/Weapons/Rogue/IceStar.cs index d7cf231cb7..9d025acef4 100644 --- a/Items/Weapons/Rogue/IceStar.cs +++ b/Items/Weapons/Rogue/IceStar.cs @@ -9,11 +9,6 @@ namespace CalamityMod.Items.Weapons.Rogue { public class IceStar : RogueWeapon { - public override void SetStaticDefaults() - { - Item.ResearchUnlockCount = 99; - } - public override void SetDefaults() { Item.width = Item.height = 66; @@ -26,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.knockBack = 2.5f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; - Item.value = Item.buyPrice(0, 0, 5, 0); + Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 14f; diff --git a/Items/Weapons/Rogue/Penumbra.cs b/Items/Weapons/Rogue/Penumbra.cs index 97da26e19b..bf62bd5875 100644 --- a/Items/Weapons/Rogue/Penumbra.cs +++ b/Items/Weapons/Rogue/Penumbra.cs @@ -24,9 +24,9 @@ namespace CalamityMod.Items.Weapons.Rogue Item.UseSound = SoundID.Item103; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - Item.damage = 830; - Item.useAnimation = 40; - Item.useTime = 40; + Item.damage = 725; + Item.crit = 16; + Item.useTime = Item.useAnimation = 35; Item.knockBack = 8f; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 9f; @@ -35,31 +35,27 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 16; - - public override float StealthDamageMultiplier => 0.85f; + public override float StealthDamageMultiplier => 0.9f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) { Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true); - float mouseXDist = Main.mouseX + Main.screenPosition.X - realPlayerPos.X; - float mouseYDist = Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y; - if (player.gravDir == -1f) - { - mouseYDist = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - realPlayerPos.Y; - } + float mouseXDist = Main.screenPosition.X + Main.mouseX - realPlayerPos.X; + float mouseYDist = Main.screenPosition.Y + (player.gravDir == -1 ? Main.screenHeight - Main.mouseY : Main.mouseY) - realPlayerPos.Y; if ((float.IsNaN(mouseXDist) && float.IsNaN(mouseYDist)) || (mouseXDist == 0f && mouseYDist == 0f)) { mouseXDist = player.direction; mouseYDist = 0f; } realPlayerPos += new Vector2(mouseXDist, mouseYDist); - int proj = Projectile.NewProjectile(source, realPlayerPos, new Vector2(0f, -0.5f), ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 1f); + int proj = Projectile.NewProjectile(source, realPlayerPos, -Vector2.UnitY * 0.25f, ModContent.ProjectileType(), damage, knockback, player.whoAmI); if (proj.WithinBounds(Main.maxProjectiles)) + { Main.projectile[proj].Calamity().stealthStrike = true; + Main.projectile[proj].timeLeft = 450; + } return false; } return true; diff --git a/Items/Weapons/Rogue/ProfanedPartisan.cs b/Items/Weapons/Rogue/ProfanedPartisan.cs index 51b0207b43..9c04347e38 100644 --- a/Items/Weapons/Rogue/ProfanedPartisan.cs +++ b/Items/Weapons/Rogue/ProfanedPartisan.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Items.Weapons.Rogue { public override void SetDefaults() { - Item.width = 56; - Item.height = 56; + Item.width = 68; + Item.height = 68; Item.damage = 222; Item.knockBack = 8f; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Rogue/ProfanedPartisan.png b/Items/Weapons/Rogue/ProfanedPartisan.png index defd077056..24b45d1ccc 100644 Binary files a/Items/Weapons/Rogue/ProfanedPartisan.png and b/Items/Weapons/Rogue/ProfanedPartisan.png differ diff --git a/Items/Weapons/Rogue/SlickCane.cs b/Items/Weapons/Rogue/SlickCane.cs index 66108a171d..60f192551e 100644 --- a/Items/Weapons/Rogue/SlickCane.cs +++ b/Items/Weapons/Rogue/SlickCane.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.knockBack = 6f; Item.UseSound = SoundID.DD2_GhastlyGlaivePierce; Item.autoReuse = true; - Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.value = Item.buyPrice(gold: 35); // Sold by Bandit Item.rare = ItemRarityID.Orange; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 16f; diff --git a/Items/Weapons/Rogue/TerrorTalons.cs b/Items/Weapons/Rogue/TerrorTalons.cs index d1aa786d2e..c70d0fd3bc 100644 --- a/Items/Weapons/Rogue/TerrorTalons.cs +++ b/Items/Weapons/Rogue/TerrorTalons.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Weapons.Rogue Item.knockBack = 3f; Item.UseSound = SoundID.Item39; Item.autoReuse = true; - Item.value = CalamityGlobalItem.RarityLightPurpleBuyPrice; - Item.rare = ItemRarityID.LightPurple; + Item.value = CalamityGlobalItem.RarityLimeBuyPrice; + Item.rare = ItemRarityID.Lime; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 12f; Item.DamageType = RogueDamageClass.Instance; diff --git a/Items/Weapons/Rogue/ThrowingBrick.cs b/Items/Weapons/Rogue/ThrowingBrick.cs index a34ec66c13..d290fbacab 100644 --- a/Items/Weapons/Rogue/ThrowingBrick.cs +++ b/Items/Weapons/Rogue/ThrowingBrick.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 5f; - Item.value = Item.sellPrice(0, 0, 0, 4); + Item.value = Item.sellPrice(copper: 4); Item.rare = ItemRarityID.White; Item.maxStack = Item.CommonMaxStack; Item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/WulfrumKnife.cs b/Items/Weapons/Rogue/WulfrumKnife.cs index 6852ff4bf0..3a3f689635 100644 --- a/Items/Weapons/Rogue/WulfrumKnife.cs +++ b/Items/Weapons/Rogue/WulfrumKnife.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.knockBack = 1f; Item.UseSound = Throw3Sound; Item.autoReuse = true; - Item.value = Item.sellPrice(0, 0, 0, 5); + Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 4f; diff --git a/Items/Weapons/Summon/AbandonedSlimeStaff.cs b/Items/Weapons/Summon/AbandonedSlimeStaff.cs index f29d97c52a..45fe58a160 100644 --- a/Items/Weapons/Summon/AbandonedSlimeStaff.cs +++ b/Items/Weapons/Summon/AbandonedSlimeStaff.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.Summon; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -25,8 +26,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.damage = 56; Item.knockBack = 3f; Item.useAnimation = Item.useTime = 20; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; @@ -48,21 +49,16 @@ namespace CalamityMod.Items.Weapons.Summon slimeSlots = (int)(player.maxMinions - minionCount); } - public override bool CanUseItem(Player player) - { - return slimeSlots >= 1; - } + public override bool CanUseItem(Player player) => slimeSlots >= 1; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(true, type, player); float damageMult = ((float)Math.Log(slimeSlots, 8f)) + 1f; - position = player.ClampedMouseWorld(); - velocity.X = 0; - velocity.Y = 0; - int slime = Projectile.NewProjectile(source, position, velocity, type, (int)(damage * damageMult), knockback, player.whoAmI); - Main.projectile[slime].originalDamage = (int)(Item.damage * damageMult); - Main.projectile[slime].minionSlots = slimeSlots; + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, (int)(damage * damageMult), knockback, player.whoAmI); + minion.originalDamage = (int)(Item.damage * damageMult); + minion.minionSlots = slimeSlots; return false; } } diff --git a/Items/Weapons/Summon/AncientIceChunk.cs b/Items/Weapons/Summon/AncientIceChunk.cs index 00bfcf39ee..3e00d8eb98 100644 --- a/Items/Weapons/Summon/AncientIceChunk.cs +++ b/Items/Weapons/Summon/AncientIceChunk.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -35,6 +36,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 50; Item.damage = 25; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.knockBack = 2f; @@ -50,7 +52,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, player.ClampedMouseWorld(), Main.rand.NextVector2Circular(1f, 1f), type, damage, knockback, player.whoAmI); + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Main.rand.NextVector2Circular(1f, 1f), type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/BelladonnaSpiritStaff.cs b/Items/Weapons/Summon/BelladonnaSpiritStaff.cs index 44890bd7ff..542ee216fd 100644 --- a/Items/Weapons/Summon/BelladonnaSpiritStaff.cs +++ b/Items/Weapons/Summon/BelladonnaSpiritStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -32,22 +33,23 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 1f; Item.mana = 10; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.useAnimation = Item.useTime = 35; Item.DamageType = DamageClass.Summon; Item.useStyle = ItemUseStyleID.Swing; Item.UseSound = SoundID.Item44; - Item.rare = ItemRarityID.Blue; - Item.value = CalamityGlobalItem.RarityBlueBuyPrice; + Item.rare = ItemRarityID.Orange; + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.noMelee = true; Item.autoReuse = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int belladonna = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(belladonna)) - Main.projectile[belladonna].originalDamage = Item.damage; + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } public override void AddRecipes() diff --git a/Items/Weapons/Summon/BlackHawkRemote.cs b/Items/Weapons/Summon/BlackHawkRemote.cs index 330d2f3e95..aff29efd63 100644 --- a/Items/Weapons/Summon/BlackHawkRemote.cs +++ b/Items/Weapons/Summon/BlackHawkRemote.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -23,6 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.UseSound = SoundID.Item15; //phaseblade sound effect Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 6f; // Affects bullet speed Item.DamageType = DamageClass.Summon; @@ -31,15 +33,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - if (player.whoAmI == Main.myPlayer) - { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0f, 1f); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0f, 1f); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/BrittleStarStaff.cs b/Items/Weapons/Summon/BrittleStarStaff.cs index 4e39fe3f72..b6c15f5dd2 100644 --- a/Items/Weapons/Summon/BrittleStarStaff.cs +++ b/Items/Weapons/Summon/BrittleStarStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; @@ -30,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Green; Item.UseSound = SoundID.Item44 with { Pitch = 0.5f }; Item.autoReuse = true; - Item.shootSpeed = 5; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.DamageType = DamageClass.Summon; } @@ -45,12 +46,9 @@ namespace CalamityMod.Items.Weapons.Summon if (player.altFunctionUse != 2) { Item.noUseGraphic = false; - position = player.ClampedMouseWorld(); - velocity = Vector2.Zero; int SummonNumber = player.ownedProjectileCounts[type]; - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0, 0, SummonNumber); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, SummonNumber); + minion.originalDamage = Item.damage; } if (player.altFunctionUse == 2) { diff --git a/Items/Weapons/Summon/CalamarisLament.cs b/Items/Weapons/Summon/CalamarisLament.cs index 8123714305..8aefe8f92c 100644 --- a/Items/Weapons/Summon/CalamarisLament.cs +++ b/Items/Weapons/Summon/CalamarisLament.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using CalamityMod.Buffs.Summon; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -45,6 +46,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 10; Item.useAnimation = Item.useTime = 10; Item.knockBack = 0.25f; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 1f; // This does nothing, it's just here so it's able to act like a staff. @@ -59,7 +61,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, player.ClampedMouseWorld(), velocity, type, damage, knockback, player.whoAmI); + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), velocity, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/CausticStaff.cs b/Items/Weapons/Summon/CausticStaff.cs index 88a22bfafb..87a955b692 100644 --- a/Items/Weapons/Summon/CausticStaff.cs +++ b/Items/Weapons/Summon/CausticStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 10; Item.damage = 15; Item.useStyle = ItemUseStyleID.Swing; - Item.shootSpeed = 10f; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.UseSound = SoundID.Item77; Item.useAnimation = Item.useTime = 25; @@ -34,12 +35,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0f, 1f); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0f, 1f); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/CinderBlossomStaff.cs b/Items/Weapons/Summon/CinderBlossomStaff.cs index f048621794..335309e1eb 100644 --- a/Items/Weapons/Summon/CinderBlossomStaff.cs +++ b/Items/Weapons/Summon/CinderBlossomStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -17,6 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.damage = 16; Item.knockBack = 2f; Item.mana = 10; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.useAnimation = Item.useTime = 30; @@ -32,10 +34,10 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(true, type, player); - int p = Projectile.NewProjectile(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/CorroslimeStaff.cs b/Items/Weapons/Summon/CorroslimeStaff.cs index de17dde940..edd2f9d35f 100644 --- a/Items/Weapons/Summon/CorroslimeStaff.cs +++ b/Items/Weapons/Summon/CorroslimeStaff.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -29,22 +29,16 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.LightRed; Item.UseSound = SoundID.Item44; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - position = player.ClampedMouseWorld(); - velocity.X = 0; - velocity.Y = 0; - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/CorvidHarbringerStaff.cs b/Items/Weapons/Summon/CorvidHarbringerStaff.cs index 7445a85016..0926ff4cc5 100644 --- a/Items/Weapons/Summon/CorvidHarbringerStaff.cs +++ b/Items/Weapons/Summon/CorvidHarbringerStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; @@ -17,17 +18,18 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 54; Item.height = 52; + Item.damage = 99; + Item.DamageType = DamageClass.Summon; + Item.useAnimation = Item.useTime = 10; + Item.mana = 10; + Item.knockBack = 2f; + Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.UseSound = SoundID.DD2_BetsyFlyingCircleAttack; - Item.DamageType = DamageClass.Summon; - Item.mana = 10; - Item.damage = 114; - Item.knockBack = 2f; Item.autoReuse = true; - Item.useAnimation = Item.useTime = 10; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 13f; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; Item.rare = ModContent.RarityType(); @@ -35,12 +37,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/CosmicImmaterializer.cs b/Items/Weapons/Summon/CosmicImmaterializer.cs index 3209dce26f..2a311d9066 100644 --- a/Items/Weapons/Summon/CosmicImmaterializer.cs +++ b/Items/Weapons/Summon/CosmicImmaterializer.cs @@ -1,4 +1,5 @@ -using CalamityMod.CalPlayer; +using CalamityMod.Buffs.Summon; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; @@ -27,8 +28,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 10; Item.useAnimation = Item.useTime = 10; Item.knockBack = 0.25f; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.UseSound = SoundID.Item60; Item.useStyle = ItemUseStyleID.Swing; @@ -42,10 +43,10 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(true, type, player); - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/CosmicViperEngine.cs b/Items/Weapons/Summon/CosmicViperEngine.cs index 522c320cfe..21fc2f864d 100644 --- a/Items/Weapons/Summon/CosmicViperEngine.cs +++ b/Items/Weapons/Summon/CosmicViperEngine.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.Summon; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Ores; using CalamityMod.Projectiles.Summon; @@ -19,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 46; Item.height = 28; - Item.damage = 321; + Item.damage = 255; Item.mana = 10; Item.useAnimation = Item.useTime = 9; Item.useStyle = ItemUseStyleID.HoldUp; @@ -27,6 +28,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 6f; Item.UseSound = SoundID.Item15; //phaseblade sound effect Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; // Affects bullet speed Item.DamageType = DamageClass.Summon; @@ -37,37 +39,18 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - float speed = Item.shootSpeed; - Vector2 spawnPos = player.RotatedRelativePoint(player.MountedCenter, true); - float xPos = (float)Main.mouseX + Main.screenPosition.X - spawnPos.X; - float yPos = (float)Main.mouseY + Main.screenPosition.Y - spawnPos.Y; - if (player.gravDir == -1f) - { - yPos = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - spawnPos.Y; - } - Vector2 vel = new Vector2(xPos, yPos); - float dist = vel.Length(); - if ((float.IsNaN(vel.X) && float.IsNaN(vel.Y)) || (vel.X == 0f && vel.Y == 0f)) - { - vel.X = (float)player.direction; - vel.Y = 0f; - dist = speed; - } - else - { - dist = speed / dist; - } - vel.X *= dist; - vel.Y *= dist; - spawnPos.X = (float)Main.mouseX + Main.screenPosition.X; - spawnPos.Y = (float)Main.mouseY + Main.screenPosition.Y; - vel = vel.RotatedBy(MathHelper.PiOver2, default); - int p = Projectile.NewProjectile(source, spawnPos + vel, vel, type, damage, knockback, player.whoAmI, 0f, 1f); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + + float speed = Item.shootSpeed; + Vector2 spawnPos = player.RotatedRelativePoint(player.MountedCenter, true); + float xPos = Main.screenPosition.X + Main.mouseX - spawnPos.X; + float yPos = Main.screenPosition.Y + (player.gravDir == -1 ? Main.screenHeight - Main.mouseY : Main.mouseY) - spawnPos.Y; + Vector2 vel = new Vector2(xPos, yPos).SafeNormalize(Vector2.UnitX * player.direction) * speed; + + spawnPos = player.ClampedMouseWorld(); + vel = vel.RotatedBy(MathHelper.PiOver2); + var minion = Projectile.NewProjectileDirect(source, spawnPos + vel, vel, type, damage, knockback, player.whoAmI, 0f, 1f); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/Cosmilamp.cs b/Items/Weapons/Summon/Cosmilamp.cs index b4c43ed83f..3a6cd6413e 100644 --- a/Items/Weapons/Summon/Cosmilamp.cs +++ b/Items/Weapons/Summon/Cosmilamp.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -40,8 +41,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ModContent.RarityType(); Item.UseSound = SoundID.Item44; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } @@ -49,26 +50,22 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - // Reset the timer for all lamps, to re-align the formation. - foreach (Projectile pro in Main.ActiveProjectiles) - { - if (pro.type == type && pro.owner == player.whoAmI) - { - pro.ModProjectile().Timer = 0f; - pro.netUpdate = true; - } - } + player.AddBuff(Item.buffType, 2); - int existingLamps = player.ownedProjectileCounts[type]; - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) + // Reset the timer for all lamps, to re-align the formation. + foreach (Projectile pro in Main.ActiveProjectiles) + { + if (pro.type == type && pro.owner == player.whoAmI) { - Main.projectile[p].originalDamage = Item.damage; - Main.projectile[p].ai[0] = existingLamps; + pro.ModProjectile().Timer = 0f; + pro.netUpdate = true; } } + + int existingLamps = player.ownedProjectileCounts[type]; + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; + minion.ai[0] = existingLamps; return false; } } diff --git a/Items/Weapons/Summon/CrimslimeStaff.cs b/Items/Weapons/Summon/CrimslimeStaff.cs index 3e7129a037..467eaf14e4 100644 --- a/Items/Weapons/Summon/CrimslimeStaff.cs +++ b/Items/Weapons/Summon/CrimslimeStaff.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -30,22 +30,16 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.LightRed; Item.UseSound = SoundID.Item44; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - position = player.ClampedMouseWorld(); - velocity.X = 0; - velocity.Y = 0; - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/DaedalusGolemStaff.cs b/Items/Weapons/Summon/DaedalusGolemStaff.cs index ec0b92d270..9f0761011b 100644 --- a/Items/Weapons/Summon/DaedalusGolemStaff.cs +++ b/Items/Weapons/Summon/DaedalusGolemStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -11,10 +12,6 @@ namespace CalamityMod.Items.Weapons.Summon public class DaedalusGolemStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; - public override void SetStaticDefaults() - { - // Funny Hollow Knight reference. - } public override void SetDefaults() { @@ -27,8 +24,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 3f; Item.UseSound = SoundID.Item67; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; @@ -36,13 +33,13 @@ namespace CalamityMod.Items.Weapons.Summon } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); Vector2 mouse = player.ClampedMouseWorld(); Point mouseTileCoords = mouse.ToTileCoordinates(); if (!CalamityUtils.ParanoidTileRetrieval(mouseTileCoords.X, mouseTileCoords.Y).IsTileSolidGround()) { - int p = Projectile.NewProjectile(source, mouse, Vector2.UnitY * 4f, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, mouse, Vector2.UnitY * 4f, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; } return false; } diff --git a/Items/Weapons/Summon/DankStaff.cs b/Items/Weapons/Summon/DankStaff.cs index d67006f38b..f996dae50c 100644 --- a/Items/Weapons/Summon/DankStaff.cs +++ b/Items/Weapons/Summon/DankStaff.cs @@ -1,5 +1,4 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Buffs.Summon; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; @@ -31,22 +30,16 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Orange; Item.UseSound = SoundID.Item44; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - position = player.ClampedMouseWorld(); - velocity.X = 0; - velocity.Y = 0; - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/DazzlingStabberStaff.cs b/Items/Weapons/Summon/DazzlingStabberStaff.cs index 93cff97797..b36a388f5b 100644 --- a/Items/Weapons/Summon/DazzlingStabberStaff.cs +++ b/Items/Weapons/Summon/DazzlingStabberStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -31,8 +32,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 2f; Item.autoReuse = true; Item.useAnimation = Item.useTime = 15; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 13f; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); @@ -43,14 +44,12 @@ namespace CalamityMod.Items.Weapons.Summon } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) + player.AddBuff(Item.buffType, 2); + + for (int i = 0; i < 3; i++) { - for (int i = 0; i < 3; i++) - { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, i + 1); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, i + 1); + minion.originalDamage = Item.damage; } float angleMax = MathHelper.ToRadians(360f); if (CalamityUtils.CountOwnedProjectiles(type, player.whoAmI) == 1) diff --git a/Items/Weapons/Summon/DeathstareRod.cs b/Items/Weapons/Summon/DeathstareRod.cs index 8bd0029774..0eaba9f552 100644 --- a/Items/Weapons/Summon/DeathstareRod.cs +++ b/Items/Weapons/Summon/DeathstareRod.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -22,17 +23,17 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityGreenBuyPrice; Item.rare = ItemRarityID.Green; Item.UseSound = SoundID.NPCHit8; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(true, type, player); - int p = Projectile.NewProjectile(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/DeepseaStaff.cs b/Items/Weapons/Summon/DeepseaStaff.cs index 07c7018c5d..f65d3f9ae6 100644 --- a/Items/Weapons/Summon/DeepseaStaff.cs +++ b/Items/Weapons/Summon/DeepseaStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -28,20 +29,16 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Pink; Item.UseSound = SoundID.Item44; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - position = player.ClampedMouseWorld(); - velocity = Vector2.Zero; - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/DragonbloodDisgorger.cs b/Items/Weapons/Summon/DragonbloodDisgorger.cs index c27c8fb840..b2429d03fa 100644 --- a/Items/Weapons/Summon/DragonbloodDisgorger.cs +++ b/Items/Weapons/Summon/DragonbloodDisgorger.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -28,16 +29,16 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); Item.UseSound = SoundID.DD2_SkeletonDeath; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/EnchantedConch.cs b/Items/Weapons/Summon/EnchantedConch.cs index 768ffed01d..c5d5a015f9 100644 --- a/Items/Weapons/Summon/EnchantedConch.cs +++ b/Items/Weapons/Summon/EnchantedConch.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -18,6 +19,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 26; Item.damage = 20; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.knockBack = 2f; @@ -33,7 +35,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, player.ClampedMouseWorld(), Main.rand.NextVector2CircularEdge(5f, 5f), type, damage, knockback, player.whoAmI); + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Main.rand.NextVector2CircularEdge(5f, 5f), type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/EndoHydraStaff.cs b/Items/Weapons/Summon/EndoHydraStaff.cs index 393642dfbb..2d28fe5010 100644 --- a/Items/Weapons/Summon/EndoHydraStaff.cs +++ b/Items/Weapons/Summon/EndoHydraStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; @@ -17,17 +18,18 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 58; Item.height = 60; + Item.damage = 190; + Item.DamageType = DamageClass.Summon; + Item.useAnimation = Item.useTime = 10; + Item.mana = 10; + Item.knockBack = 3f; + Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.UseSound = SoundID.Item60; - Item.DamageType = DamageClass.Summon; - Item.mana = 10; - Item.damage = 232; - Item.knockBack = 3f; Item.autoReuse = true; - Item.useAnimation = Item.useTime = 10; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; Item.rare = ModContent.RarityType(); @@ -35,41 +37,38 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) + player.AddBuff(Item.buffType, 2); + + bool bodyExists = false; + int bodyIndex = -1; + foreach (Projectile p in Main.ActiveProjectiles) { - bool bodyExists = false; - int bodyIndex = -1; - foreach (Projectile p in Main.ActiveProjectiles) + if (p.type == type && p.owner == player.whoAmI) { - if (p.type == type && p.owner == player.whoAmI) - { - bodyIndex = p.whoAmI; - bodyExists = true; - break; - } + bodyIndex = p.whoAmI; + bodyExists = true; + break; } - if (bodyExists) + } + if (bodyExists) + { + var head = Projectile.NewProjectileDirect(source, player.Center, Main.rand.NextVector2Unit(), ModContent.ProjectileType(), damage, knockback, player.whoAmI, bodyIndex); + head.originalDamage = Item.damage; + } + else + { + bodyIndex = Projectile.NewProjectile(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); + if (Main.projectile.IndexInRange(bodyIndex)) + Main.projectile[bodyIndex].originalDamage = Item.damage; + var head = Projectile.NewProjectileDirect(source, player.Center, Main.rand.NextVector2Unit(), ModContent.ProjectileType(), damage, knockback, player.whoAmI, bodyIndex); + head.originalDamage = Item.damage; + for (int i = 0; i < 72; i++) { - int p = Projectile.NewProjectile(source, player.Center, Main.rand.NextVector2Unit(), ModContent.ProjectileType(), damage, knockback, player.whoAmI, bodyIndex); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } - else - { - bodyIndex = Projectile.NewProjectile(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); - int head = Projectile.NewProjectile(source, player.Center, Main.rand.NextVector2Unit(), ModContent.ProjectileType(), damage, knockback, player.whoAmI, bodyIndex); - if (Main.projectile.IndexInRange(bodyIndex)) - Main.projectile[bodyIndex].originalDamage = Item.damage; - if (Main.projectile.IndexInRange(head)) - Main.projectile[head].originalDamage = Item.damage; - for (int i = 0; i < 72; i++) - { - Dust dust = Dust.NewDustPerfect(Main.projectile[bodyIndex].Center, 113); - dust.velocity = (MathHelper.TwoPi * Vector2.Dot((i / 72f * MathHelper.TwoPi).ToRotationVector2(), player.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(i / 72f * -MathHelper.TwoPi))).ToRotationVector2(); - dust.velocity = dust.velocity.RotatedBy(i / 36f * MathHelper.TwoPi) * 8f; - dust.noGravity = true; - dust.scale = 1.9f; - } + Dust dust = Dust.NewDustPerfect(Main.projectile[bodyIndex].Center, 113); + dust.velocity = (MathHelper.TwoPi * Vector2.Dot((i / 72f * MathHelper.TwoPi).ToRotationVector2(), player.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(i / 72f * -MathHelper.TwoPi))).ToRotationVector2(); + dust.velocity = dust.velocity.RotatedBy(i / 36f * MathHelper.TwoPi) * 8f; + dust.noGravity = true; + dust.scale = 1.9f; } } return false; diff --git a/Items/Weapons/Summon/Endogenesis.cs b/Items/Weapons/Summon/Endogenesis.cs index 97942a9175..a9a41e73d4 100644 --- a/Items/Weapons/Summon/Endogenesis.cs +++ b/Items/Weapons/Summon/Endogenesis.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; @@ -33,8 +34,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 4f; Item.autoReuse = true; Item.useAnimation = Item.useTime = 10; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.value = CalamityGlobalItem.RarityHotPinkBuyPrice; Item.rare = ModContent.RarityType(); @@ -45,21 +46,19 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) + CalamityUtils.KillShootProjectileMany(player, new int[] { - CalamityUtils.KillShootProjectileMany(player, new int[] - { - type, - ModContent.ProjectileType(), - ModContent.ProjectileType() - }); + type, + ModContent.ProjectileType(), + ModContent.ProjectileType() + }); - SummonEndoCooper(source, AttackMode, player.ClampedMouseWorld(), damage, Item.damage, knockback, player, out _, out _); + player.AddBuff(Item.buffType, 2); + SummonEndoCooper(source, AttackMode, player.ClampedMouseWorld(), damage, Item.damage, knockback, player, out _, out _); - AttackMode++; - if (AttackMode > 3) - AttackMode = 0; - } + AttackMode++; + if (AttackMode > 3) + AttackMode = 0; return false; } diff --git a/Items/Weapons/Summon/EntropysVigil.cs b/Items/Weapons/Summon/EntropysVigil.cs index 286efcaa94..6b74919eb6 100644 --- a/Items/Weapons/Summon/EntropysVigil.cs +++ b/Items/Weapons/Summon/EntropysVigil.cs @@ -1,5 +1,5 @@ -using CalamityMod.Items.Weapons.Melee; -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -27,6 +27,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 52; Item.damage = 42; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.knockBack = 2f; @@ -45,6 +46,8 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); + Vector2 mouse = player.ClampedMouseWorld(); float randomAngleOffset = Main.rand.NextFloat(MathHelper.TwoPi); for (int i = 0; i < 3; i++) @@ -55,15 +58,18 @@ namespace CalamityMod.Items.Weapons.Summon switch (i) { case 0: - Projectile.NewProjectile(source, mouse, spawnVelocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + type = ModContent.ProjectileType(); break; case 1: - Projectile.NewProjectile(source, mouse, spawnVelocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + type = ModContent.ProjectileType(); break; case 2: - Projectile.NewProjectile(source, mouse, spawnVelocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + type = ModContent.ProjectileType(); break; } + + var minion = Projectile.NewProjectileDirect(source, mouse, spawnVelocity, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; } return false; diff --git a/Items/Weapons/Summon/EtherealSubjugator.cs b/Items/Weapons/Summon/EtherealSubjugator.cs index 9edd09c593..66dbca0b57 100644 --- a/Items/Weapons/Summon/EtherealSubjugator.cs +++ b/Items/Weapons/Summon/EtherealSubjugator.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -23,6 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 70; Item.damage = 200; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.knockBack = 1f; @@ -42,7 +44,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, player.ClampedMouseWorld(), Main.rand.NextVector2CircularEdge(5f, 5f), type, damage, knockback, player.whoAmI); + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Main.rand.NextVector2CircularEdge(5f, 5f), type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/EyeOfNight.cs b/Items/Weapons/Summon/EyeOfNight.cs index 4dae0ecdb7..829421eadb 100644 --- a/Items/Weapons/Summon/EyeOfNight.cs +++ b/Items/Weapons/Summon/EyeOfNight.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -25,19 +26,16 @@ namespace CalamityMod.Items.Weapons.Summon Item.UseSound = SoundID.NPCHit1; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.UnitY * -3f, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.UnitY * -3f, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/FlarebatStaff.cs b/Items/Weapons/Summon/FlarebatStaff.cs index 4ee88f1d16..91f6eb0365 100644 --- a/Items/Weapons/Summon/FlarebatStaff.cs +++ b/Items/Weapons/Summon/FlarebatStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -15,6 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.damage = 20; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.knockBack = 1f; @@ -31,7 +33,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/FleshOfInfidelity.cs b/Items/Weapons/Summon/FleshOfInfidelity.cs index 671bec1cae..638e048448 100644 --- a/Items/Weapons/Summon/FleshOfInfidelity.cs +++ b/Items/Weapons/Summon/FleshOfInfidelity.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; @@ -22,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 42; Item.damage = 20; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.knockBack = 1f; @@ -37,7 +38,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.UnitY * -1f, type, damage, knockback, player.whoAmI); + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.UnitY * -1f, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/FlowersOfMortality.cs b/Items/Weapons/Summon/FlowersOfMortality.cs index ee43914ad1..247ab82b77 100644 --- a/Items/Weapons/Summon/FlowersOfMortality.cs +++ b/Items/Weapons/Summon/FlowersOfMortality.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -28,6 +29,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityPurpleBuyPrice; Item.rare = ItemRarityID.Purple; Item.UseSound = SoundID.Item44; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; } @@ -36,6 +38,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(false, type, player); for (int i = 0; i < 5; i++) { diff --git a/Items/Weapons/Summon/ForgottenApexWand.cs b/Items/Weapons/Summon/ForgottenApexWand.cs index 4fb966f134..ba73a0b486 100644 --- a/Items/Weapons/Summon/ForgottenApexWand.cs +++ b/Items/Weapons/Summon/ForgottenApexWand.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -26,21 +27,15 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 10; Item.damage = 28; Item.useAnimation = Item.useTime = 25; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 12f; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - vector2.X = Main.mouseX + Main.screenPosition.X; - vector2.Y = Main.mouseY + Main.screenPosition.Y; - int p = Projectile.NewProjectile(source, vector2, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/FrostBlossomStaff.cs b/Items/Weapons/Summon/FrostBlossomStaff.cs index 852b6cd188..026da729b3 100644 --- a/Items/Weapons/Summon/FrostBlossomStaff.cs +++ b/Items/Weapons/Summon/FrostBlossomStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -23,17 +24,17 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; Item.UseSound = SoundID.Item28; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(true, type, player); - int p = Projectile.NewProjectile(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } public override void AddRecipes() diff --git a/Items/Weapons/Summon/FrostbatStaff.cs b/Items/Weapons/Summon/FrostbatStaff.cs index ade55ae2aa..a8148b1e5b 100644 --- a/Items/Weapons/Summon/FrostbatStaff.cs +++ b/Items/Weapons/Summon/FrostbatStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -15,6 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.damage = 22; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.knockBack = 1f; @@ -31,7 +33,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/GammaHeart.cs b/Items/Weapons/Summon/GammaHeart.cs index 6ab12f05c7..b563bb8704 100644 --- a/Items/Weapons/Summon/GammaHeart.cs +++ b/Items/Weapons/Summon/GammaHeart.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -24,20 +25,17 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 3f; Item.autoReuse = true; Item.useAnimation = Item.useTime = 14; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; Item.rare = ModContent.RarityType(); } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/GastricBelcherStaff.cs b/Items/Weapons/Summon/GastricBelcherStaff.cs index 0d23ca4774..7e7233f8cf 100644 --- a/Items/Weapons/Summon/GastricBelcherStaff.cs +++ b/Items/Weapons/Summon/GastricBelcherStaff.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.Summon; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; @@ -29,44 +30,17 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; Item.UseSound = SoundID.Item76; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; Item.autoReuse = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - Vector2 playerPos = player.RotatedRelativePoint(player.MountedCenter, true); - float directionX = Main.mouseX + Main.screenPosition.X - playerPos.X; - float directionY = Main.mouseY + Main.screenPosition.Y - playerPos.Y; - if (player.gravDir == -1f) - { - directionY = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - playerPos.Y; - } - Vector2 spinningpoint = new Vector2(directionX, directionY); - float dist = spinningpoint.Length(); - if ((float.IsNaN(spinningpoint.X) && float.IsNaN(spinningpoint.Y)) || (spinningpoint.X == 0f && spinningpoint.Y == 0f)) - { - spinningpoint.X = player.direction; - spinningpoint.Y = 0f; - dist = Item.shootSpeed; - } - else - { - dist = Item.shootSpeed / dist; - } - spinningpoint.X *= dist; - spinningpoint.Y *= dist; - playerPos.X = Main.mouseX + Main.screenPosition.X; - playerPos.Y = Main.mouseY + Main.screenPosition.Y; - spinningpoint = spinningpoint.RotatedBy(Math.PI / 2D, default); - int p = Projectile.NewProjectile(source, playerPos + spinningpoint, spinningpoint, type, damage, knockback, player.whoAmI, 0f, 1f); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Main.rand.NextVector2Circular(5f, 5f), type, damage, knockback, player.whoAmI, 0f, 1f); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/GlacialEmbrace.cs b/Items/Weapons/Summon/GlacialEmbrace.cs index 00fc0f2f75..7f2827b342 100644 --- a/Items/Weapons/Summon/GlacialEmbrace.cs +++ b/Items/Weapons/Summon/GlacialEmbrace.cs @@ -24,6 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 4.5f; Item.UseSound = SoundID.Item30; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; @@ -44,11 +45,10 @@ namespace CalamityMod.Items.Weapons.Summon } if (player.altFunctionUse != 2 && totalMinionSlots < player.maxMinions) { - player.AddBuff(ModContent.BuffType(), 120, true); + player.AddBuff(Item.buffType, 2); position = player.ClampedMouseWorld(); - int p = Projectile.NewProjectile(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; int pointyThingCount = 0; foreach (Projectile pro in Main.ActiveProjectiles) { diff --git a/Items/Weapons/Summon/HauntedScroll.cs b/Items/Weapons/Summon/HauntedScroll.cs index 5ac5707364..001eafa166 100644 --- a/Items/Weapons/Summon/HauntedScroll.cs +++ b/Items/Weapons/Summon/HauntedScroll.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -30,23 +31,17 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.LightRed; Item.UseSound = SoundID.Item60; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - position = player.ClampedMouseWorld(); - velocity.X = 0; - velocity.Y = 0; - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 30f); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - //projectile.ai[1] is attack cooldown. Setting it here prevents immediate attacks - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0f, 30f); + minion.originalDamage = Item.damage; + //projectile.ai[1] is attack cooldown. Setting it here prevents immediate attacks return false; } diff --git a/Items/Weapons/Summon/HerringStaff.cs b/Items/Weapons/Summon/HerringStaff.cs index 33f8bd5fbe..045c7353c3 100644 --- a/Items/Weapons/Summon/HerringStaff.cs +++ b/Items/Weapons/Summon/HerringStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -17,6 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 1.25f; Item.mana = 10; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.useAnimation = Item.useTime = 30; Item.DamageType = DamageClass.Summon; @@ -30,12 +32,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/IgneousExaltation.cs b/Items/Weapons/Summon/IgneousExaltation.cs index e91c75a2c7..86d6a3d058 100644 --- a/Items/Weapons/Summon/IgneousExaltation.cs +++ b/Items/Weapons/Summon/IgneousExaltation.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -53,15 +54,14 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Pink; Item.UseSound = SoundID.Item71; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } - public override bool AltFunctionUse(Player player) - { - return player.ownedProjectileCounts[Item.shoot] > 0; - } + public override bool AltFunctionUse(Player player) => player.ownedProjectileCounts[Item.shoot] > 0; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.altFunctionUse == 2) @@ -77,12 +77,9 @@ namespace CalamityMod.Items.Weapons.Summon } else { - - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 1f); - if (Main.projectile.IndexInRange(p)) - { - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 1f); + minion.originalDamage = Item.damage; int bladeIndex = 0; foreach (Projectile pro in Main.ActiveProjectiles) diff --git a/Items/Weapons/Summon/InfectedRemote.cs b/Items/Weapons/Summon/InfectedRemote.cs index a5391fa820..7410951304 100644 --- a/Items/Weapons/Summon/InfectedRemote.cs +++ b/Items/Weapons/Summon/InfectedRemote.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -37,8 +38,7 @@ namespace CalamityMod.Items.Weapons.Summon { ItemID.Sets.StaffMinionSlotsRequired[Type] = 3f; ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); - - } + } public override void SetDefaults() { @@ -51,8 +51,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.noMelee = true; Item.knockBack = 5f; Item.UseSound = SoundID.Item15; //phaseblade sound effect + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; Item.value = CalamityGlobalItem.RarityYellowBuyPrice; @@ -64,11 +64,10 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(true, type, player); - - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/KingofConstellationsTenryu.cs b/Items/Weapons/Summon/KingofConstellationsTenryu.cs index f8c677a7a7..e25f41c11f 100644 --- a/Items/Weapons/Summon/KingofConstellationsTenryu.cs +++ b/Items/Weapons/Summon/KingofConstellationsTenryu.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; @@ -23,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 10; Item.damage = 187; Item.useStyle = ItemUseStyleID.HoldUp; - Item.shootSpeed = 10f; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.UseSound = Flare.FlareSound; Item.useAnimation = Item.useTime = 25; @@ -38,10 +39,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.autoReuse = true; } - public override Vector2? HoldoutOffset() - { - return new Vector2(-20, 0); - } + public override Vector2? HoldoutOffset() => new Vector2(-20, 0); public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0 && player.maxMinions >= 4; @@ -49,20 +47,23 @@ namespace CalamityMod.Items.Weapons.Summon { Vector2 spawnPos = new Vector2(player.position.X - 200, player.position.Y - 200); Vector2 spawnPos2 = new Vector2(player.position.X + 200, player.position.Y - 200); - SpawnDragon(ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), spawnPos2, player, source, damage, knockback); - SpawnDragon(ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), spawnPos, player, source, damage, knockback); + player.AddBuff(Item.buffType, 2); + SpawnDragon(ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), spawnPos2, player, source, damage, Item.damage, knockback); + SpawnDragon(ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), spawnPos, player, source, damage, Item.damage, knockback); return false; } - public static void SpawnDragon(int head, int body, int tail, Vector2 spawnPos, Player player, EntitySource_ItemUse_WithAmmo source, int damage, float knockback) + public static void SpawnDragon(int headType, int bodyType, int tailType, Vector2 spawnPos, Player player, EntitySource_ItemUse_WithAmmo source, int damage, int originalDamage, float knockback) { // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction - Projectile.NewProjectile(source, spawnPos, player.DirectionTo(Main.MouseWorld) * 3, head, damage, knockback, player.whoAmI); - // okay but seriously why are you multiplying zero by three - Projectile.NewProjectile(source, spawnPos, Vector2.Zero * 3, tail, damage, knockback, player.whoAmI); + var head = Projectile.NewProjectileDirect(source, spawnPos, player.DirectionTo(Main.MouseWorld) * 3, headType, damage, knockback, player.whoAmI); + head.originalDamage = originalDamage; + var tail = Projectile.NewProjectileDirect(source, spawnPos, Vector2.Zero, tailType, damage, knockback, player.whoAmI); + tail.originalDamage = originalDamage; for (var i = 0; i < 20; i++) { - Projectile.NewProjectile(source, spawnPos, Vector2.Zero * 3, body, damage, knockback, player.whoAmI); + var body = Projectile.NewProjectileDirect(source, spawnPos, Vector2.Zero, bodyType, damage, knockback, player.whoAmI); + body.originalDamage = originalDamage; } } diff --git a/Items/Weapons/Summon/LegionofCelestia.cs b/Items/Weapons/Summon/LegionofCelestia.cs index 4e49f639e6..4978eebfd0 100644 --- a/Items/Weapons/Summon/LegionofCelestia.cs +++ b/Items/Weapons/Summon/LegionofCelestia.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -28,8 +29,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Purple; Item.UseSound = SoundID.Item44; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; } public override void UseStyle(Player player, Rectangle heldItemFrame) @@ -39,15 +40,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - position = player.ClampedMouseWorld(); - velocity.X = 0; - velocity.Y = 0; - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/LiliesOfFinality.cs b/Items/Weapons/Summon/LiliesOfFinality.cs index 968e79bbe8..8c78d3b917 100644 --- a/Items/Weapons/Summon/LiliesOfFinality.cs +++ b/Items/Weapons/Summon/LiliesOfFinality.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -40,6 +41,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.damage = 512; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ProjectileType(); Item.knockBack = 5f; @@ -58,9 +60,12 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); Vector2 mouse = player.ClampedMouseWorld(); - Projectile.NewProjectile(source, mouse, new Vector2(-1f, -1f) * 3f, type, damage, knockback, player.whoAmI); - Projectile.NewProjectile(source, mouse, new Vector2(1f, -1f) * 3f, ProjectileType(), damage, knockback, player.whoAmI); + var elster = Projectile.NewProjectileDirect(source, mouse, new Vector2(-1f, -1f) * 3f, type, damage, knockback, player.whoAmI); + elster.originalDamage = Item.damage; + var ariane = Projectile.NewProjectileDirect(source, mouse, new Vector2(1f, -1f) * 3f, ProjectileType(), damage, knockback, player.whoAmI); + ariane.originalDamage = Item.damage; if (Main.dedServ) return false; diff --git a/Items/Weapons/Summon/Metastasis.cs b/Items/Weapons/Summon/Metastasis.cs index dce121d6b1..51fa3ef810 100644 --- a/Items/Weapons/Summon/Metastasis.cs +++ b/Items/Weapons/Summon/Metastasis.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -31,8 +32,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.rare = ModContent.RarityType(); Item.UseSound = SoundID.DD2_BetsySummon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } @@ -40,9 +41,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), -Vector2.UnitY * 5f, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), -Vector2.UnitY * 5f, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/MirrorofKalandra.cs b/Items/Weapons/Summon/MirrorofKalandra.cs index d4c7b5947f..bdf70f8296 100644 --- a/Items/Weapons/Summon/MirrorofKalandra.cs +++ b/Items/Weapons/Summon/MirrorofKalandra.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon.MirrorofKalandraMinions; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -20,19 +21,19 @@ namespace CalamityMod.Items.Weapons.Summon public static float Axe_MinRamSpeed = 30f; public static float Axe_MaxRamSpeed = 50f; - public static int Axe_IFrames = 15; + public static int Axe_IFrames = 20; public static float Axe_SpinSpeed = 25f; // In degrees per frame. public static float Purple_MinRamSpeed = 40f; public static float Purple_MaxRamSpeed = 60f; - public static int Purple_IFrames = 23; - public static float Purple_BlastDMGModifier = 2.25f; + public static int Purple_IFrames = 28; + public static float Purple_BlastDMGModifier = 2f; public static float Purple_BlastFireRate = 240f; // In frames. public static int Purple_BlastSize = 300; public static int Purple_BlastChargeTime = 10; public static float Purple_SpinSpeed = 25f; // In degrees per frame. - public static int Scimitar_IFrames = 36; // Note that the effective iframes are half of this number, since the weapon is given an extra update while attacking. + public static int Scimitar_IFrames = 40; // Note that the effective iframes are half of this number, since the weapon is given an extra update while attacking. public static int Wind_BowChargeTime = 5; // Therefore, the higher the time, the slower the fire rate will be, and viceversa. public static float Wind_ArrowSpeed = 5f; @@ -49,10 +50,11 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 58; Item.height = 50; - Item.damage = 317; + Item.damage = 256; Item.useAnimation = Item.useTime = 30; Item.knockBack = 4f; Item.mana = 10; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.autoReuse = true; @@ -71,6 +73,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); if (player.ownedProjectileCounts[ModContent.ProjectileType()] == 1) { type = ModContent.ProjectileType(); @@ -82,9 +85,9 @@ namespace CalamityMod.Items.Weapons.Summon type = ModContent.ProjectileType(); } - int minion = Projectile.NewProjectile(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(minion)) - Main.projectile[minion].rotation = -MathHelper.PiOver2; + var minion = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.rotation = -MathHelper.PiOver2; + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/MutatedTruffle.cs b/Items/Weapons/Summon/MutatedTruffle.cs index be68bf83a5..5b577b75d8 100644 --- a/Items/Weapons/Summon/MutatedTruffle.cs +++ b/Items/Weapons/Summon/MutatedTruffle.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -42,6 +43,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 26; Item.damage = 275; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.knockBack = 5f; @@ -54,12 +56,15 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; } + // Only one can be summoned. + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] < 1 && player.maxMinions >= 3; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - // Only one can be summoned. - if (player.ownedProjectileCounts[type] < 1 && player.maxMinions >= 3) - Projectile.NewProjectile(source, player.ClampedMouseWorld(), Main.rand.NextVector2Circular(2f, 2f), type, damage, knockback, player.whoAmI); - + player.AddBuff(Item.buffType, 2); + CalamityUtils.KillShootProjectiles(true, type, player); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Main.rand.NextVector2Circular(2f, 2f), type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/Perdition.cs b/Items/Weapons/Summon/Perdition.cs index af0f2d7571..338f86fb93 100644 --- a/Items/Weapons/Summon/Perdition.cs +++ b/Items/Weapons/Summon/Perdition.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -16,7 +16,6 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetStaticDefaults() { - ItemID.Sets.StaffMinionSlotsRequired[Type] = 5f; ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } @@ -25,7 +24,9 @@ namespace CalamityMod.Items.Weapons.Summon Item.width = Item.height = 56; Item.damage = 375; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); + Item.sentry = true; Item.knockBack = 4f; Item.useAnimation = Item.useTime = 10; // 9 because of useStyle 1. @@ -38,19 +39,15 @@ namespace CalamityMod.Items.Weapons.Summon Item.UseSound = SoundID.DD2_EtherianPortalOpen; } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] < 1; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - if (player.ownedProjectileCounts[type] < 1) - Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - } - else - { - // Play some demonic noises prior to a target being selected. - SoundEngine.PlaySound(SoundID.Zombie93, player.Center); - SoundEngine.PlaySound(SoundID.Item119, player.Center); - } + player.AddBuff(Item.buffType, 2); + CalamityUtils.KillShootProjectiles(true, type, player); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; + player.UpdateMaxTurrets(); return false; } } diff --git a/Items/Weapons/Summon/PlantationStaff.cs b/Items/Weapons/Summon/PlantationStaff.cs index f7ab0903ef..b967ef9731 100644 --- a/Items/Weapons/Summon/PlantationStaff.cs +++ b/Items/Weapons/Summon/PlantationStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -41,6 +42,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 50; Item.damage = 58; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.knockBack = 1f; @@ -57,7 +59,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, player.ClampedMouseWorld(), Main.rand.NextVector2Circular(2f, 2f), type, damage, knockback, player.whoAmI); + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Main.rand.NextVector2Circular(2f, 2f), type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/PuffShroom.cs b/Items/Weapons/Summon/PuffShroom.cs index 99690d4f50..d12ee0ac1e 100644 --- a/Items/Weapons/Summon/PuffShroom.cs +++ b/Items/Weapons/Summon/PuffShroom.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -29,19 +30,16 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Green; Item.UseSound = SoundID.Item42; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int puffGuy = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(puffGuy)) - Main.projectile[puffGuy].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/ResurrectionButterfly.cs b/Items/Weapons/Summon/ResurrectionButterfly.cs index 98ff76631a..d99b51f0a3 100644 --- a/Items/Weapons/Summon/ResurrectionButterfly.cs +++ b/Items/Weapons/Summon/ResurrectionButterfly.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.Summon; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; @@ -29,22 +30,21 @@ namespace CalamityMod.Items.Weapons.Summon Item.UseSound = SoundID.Item44; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); Vector2 clampedMouse = player.ClampedMouseWorld(); - Vector2 mouseDirection = Vector2.Normalize(clampedMouse - player.Center) * Item.shootSpeed; + Vector2 mouseDirection = Vector2.Normalize(clampedMouse - player.Center) * 10f; - int p = Projectile.NewProjectile(source, clampedMouse, mouseDirection.RotatedBy(MathHelper.PiOver2), ModContent.ProjectileType(), damage, knockback, Main.myPlayer, 0f, 0f); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - p = Projectile.NewProjectile(source, clampedMouse, mouseDirection.RotatedBy(-MathHelper.PiOver2), ModContent.ProjectileType(), damage, knockback, Main.myPlayer, 0f, 0f); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var pink = Projectile.NewProjectileDirect(source, clampedMouse, mouseDirection.RotatedBy(MathHelper.PiOver2), ModContent.ProjectileType(), damage, knockback, Main.myPlayer, 0f, 0f); + pink.originalDamage = Item.damage; + var purple = Projectile.NewProjectileDirect(source, clampedMouse, mouseDirection.RotatedBy(-MathHelper.PiOver2), ModContent.ProjectileType(), damage, knockback, Main.myPlayer, 0f, 0f); + purple.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/SandSharknadoStaff.cs b/Items/Weapons/Summon/SandSharknadoStaff.cs index 262bb00eb2..beba2cc6f2 100644 --- a/Items/Weapons/Summon/SandSharknadoStaff.cs +++ b/Items/Weapons/Summon/SandSharknadoStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -22,6 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 2f; Item.mana = 10; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.useAnimation = Item.useTime = 20; Item.DamageType = DamageClass.Summon; @@ -35,12 +37,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int sandnado = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(sandnado)) - Main.projectile[sandnado].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/SarosPossession.cs b/Items/Weapons/Summon/SarosPossession.cs index e70b846278..0e143371a0 100644 --- a/Items/Weapons/Summon/SarosPossession.cs +++ b/Items/Weapons/Summon/SarosPossession.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; @@ -23,6 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 4f; Item.mana = 10; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.useAnimation = Item.useTime = 10; Item.DamageType = DamageClass.Summon; @@ -37,10 +39,10 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(true, type, player); - int p = Projectile.NewProjectile(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/ScabRipper.cs b/Items/Weapons/Summon/ScabRipper.cs index 9ddc38325c..2bee629707 100644 --- a/Items/Weapons/Summon/ScabRipper.cs +++ b/Items/Weapons/Summon/ScabRipper.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -27,6 +28,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Green; Item.UseSound = SoundID.Item83; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.DamageType = DamageClass.Summon; @@ -36,15 +38,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - position = player.ClampedMouseWorld(); - velocity.X = 0; - velocity.Y = 0; - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/SeashineHilt.cs b/Items/Weapons/Summon/SeashineHilt.cs index 8168f5fff6..6ec21393a9 100644 --- a/Items/Weapons/Summon/SeashineHilt.cs +++ b/Items/Weapons/Summon/SeashineHilt.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.Summon; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.SunkenSea; @@ -38,6 +39,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.shootSpeed = 12f; Item.mana = 10; Item.rare = ItemRarityID.Green; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); } public override bool AltFunctionUse(Player player) => true; @@ -90,11 +92,11 @@ namespace CalamityMod.Items.Weapons.Summon } else // Toss out the summon { + player.AddBuff(Item.buffType, 2); SoundEngine.PlaySound(SoundID.Item1, player.Center); - int pr = Projectile.NewProjectile(source, player.Center, velocity, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(pr)) - Main.projectile[pr].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, player.Center, velocity, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; float angleMax = MathHelper.ToRadians(360f); if (CalamityUtils.CountProjectiles(type) == 1) diff --git a/Items/Weapons/Summon/ShellfishStaff.cs b/Items/Weapons/Summon/ShellfishStaff.cs index acfa24fee7..01c8c17b73 100644 --- a/Items/Weapons/Summon/ShellfishStaff.cs +++ b/Items/Weapons/Summon/ShellfishStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -27,19 +28,16 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Pink; Item.UseSound = SoundID.Item44; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/Sirius.cs b/Items/Weapons/Summon/Sirius.cs index 4c39a7837c..305abfe88a 100644 --- a/Items/Weapons/Summon/Sirius.cs +++ b/Items/Weapons/Summon/Sirius.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Ores; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; @@ -23,6 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.useAnimation = Item.useTime = 10; Item.mana = 10; Item.knockBack = 10f; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.DamageType = DamageClass.Summon; Item.useStyle = ItemUseStyleID.Swing; @@ -36,10 +38,10 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(true, type, player); - int p = Projectile.NewProjectile(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/StaffOfNecrosteocytes.cs b/Items/Weapons/Summon/StaffOfNecrosteocytes.cs index 9bd042de78..607bbbe62d 100644 --- a/Items/Weapons/Summon/StaffOfNecrosteocytes.cs +++ b/Items/Weapons/Summon/StaffOfNecrosteocytes.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -24,22 +25,19 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Orange; Item.UseSound = SoundID.Item44; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Point mouseTileCoords = position.ToTileCoordinates(); + player.AddBuff(Item.buffType, 2); + Point mouseTileCoords = player.ClampedMouseWorld().ToTileCoordinates(); if (WorldGen.SolidTile(mouseTileCoords.X, mouseTileCoords.Y)) return false; - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/StaffoftheMechworm.cs b/Items/Weapons/Summon/StaffoftheMechworm.cs index 15ab023121..83e6d27796 100644 --- a/Items/Weapons/Summon/StaffoftheMechworm.cs +++ b/Items/Weapons/Summon/StaffoftheMechworm.cs @@ -1,4 +1,5 @@ using System.Linq; +using CalamityMod.Buffs.Summon; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; @@ -21,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 68; Item.height = 68; - Item.damage = 100; + Item.damage = 110; Item.mana = 10; Item.useAnimation = Item.useTime = 10; // 9 because of useStyle 1 Item.useStyle = ItemUseStyleID.Swing; @@ -31,8 +32,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ModContent.RarityType(); Item.UseSound = SoundID.Item113; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } @@ -104,6 +105,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); int head = -1; int tail = -1; foreach (Projectile p in Main.ActiveProjectiles) diff --git a/Items/Weapons/Summon/StarspawnHelixStaff.cs b/Items/Weapons/Summon/StarspawnHelixStaff.cs index e687d10378..48701eb7dc 100644 --- a/Items/Weapons/Summon/StarspawnHelixStaff.cs +++ b/Items/Weapons/Summon/StarspawnHelixStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -24,6 +25,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 1.25f; Item.mana = 10; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.useAnimation = Item.useTime = 20; Item.DamageType = DamageClass.Summon; @@ -37,24 +39,19 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), velocity, type, damage, knockback, player.whoAmI, 0f, 1f); - if (Main.projectile.IndexInRange(p)) - { - Main.projectile[p].originalDamage = Item.damage; - Main.projectile[p].ModProjectile().ProbeIndex = player.ownedProjectileCounts[type]; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0f, 1f); + minion.originalDamage = Item.damage; + minion.ModProjectile().ProbeIndex = player.ownedProjectileCounts[type]; - int bladeIndex = 0; - foreach (Projectile pro in Main.ActiveProjectiles) + int bladeIndex = 0; + foreach (Projectile pro in Main.ActiveProjectiles) + { + if (pro.type == type && pro.owner == player.whoAmI) { - if (pro.type == type && pro.owner == player.whoAmI) - { - pro.ModProjectile().ProbeIndex = bladeIndex++; - pro.ModProjectile().AITimer = 0f; - pro.netUpdate = true; - } + pro.ModProjectile().ProbeIndex = bladeIndex++; + pro.ModProjectile().AITimer = 0f; + pro.netUpdate = true; } } diff --git a/Items/Weapons/Summon/StellarTorusStaff.cs b/Items/Weapons/Summon/StellarTorusStaff.cs index 23e2df9b9d..05344b0db5 100644 --- a/Items/Weapons/Summon/StellarTorusStaff.cs +++ b/Items/Weapons/Summon/StellarTorusStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -29,6 +30,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.useAnimation = Item.useTime = 20; Item.knockBack = 4f; Item.mana = 10; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.noMelee = true; @@ -43,11 +45,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int minion = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Main.rand.NextVector2Circular(2f, 2f), ModContent.ProjectileType(), damage, knockback, player.whoAmI); - - if (Main.projectile.IndexInRange(minion)) - Main.projectile[minion].originalDamage = Item.OriginalDamage; - + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Main.rand.NextVector2Circular(2f, 2f), ModContent.ProjectileType(), damage, knockback, player.whoAmI); + minion.originalDamage = Item.OriginalDamage; return false; } diff --git a/Items/Weapons/Summon/StormjawStaff.cs b/Items/Weapons/Summon/StormjawStaff.cs index 53c47e8b77..2780625a88 100644 --- a/Items/Weapons/Summon/StormjawStaff.cs +++ b/Items/Weapons/Summon/StormjawStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.Buffs.Summon; +using CalamityMod.NPCs.NormalNPCs; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -25,19 +26,16 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Green; Item.UseSound = Stormlion.DeathSound; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/SunSpiritStaff.cs b/Items/Weapons/Summon/SunSpiritStaff.cs index fa04a52417..61403820f0 100644 --- a/Items/Weapons/Summon/SunSpiritStaff.cs +++ b/Items/Weapons/Summon/SunSpiritStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -24,6 +25,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; Item.UseSound = SoundID.Item44; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.DamageType = DamageClass.Summon; } @@ -32,10 +34,10 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(true, type, player); - int p = Projectile.NewProjectile(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/TacticalPlagueEngine.cs b/Items/Weapons/Summon/TacticalPlagueEngine.cs index 2a672d25f5..bbdbb624a9 100644 --- a/Items/Weapons/Summon/TacticalPlagueEngine.cs +++ b/Items/Weapons/Summon/TacticalPlagueEngine.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -27,18 +28,16 @@ namespace CalamityMod.Items.Weapons.Summon Item.UseSound = SoundID.Item14; Item.autoReuse = true; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 7f; // Affects bullet speed } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 1f); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 1f); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/TemporalUmbrella.cs b/Items/Weapons/Summon/TemporalUmbrella.cs index 592dea16b1..04b56eee01 100644 --- a/Items/Weapons/Summon/TemporalUmbrella.cs +++ b/Items/Weapons/Summon/TemporalUmbrella.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon.Umbrella; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; @@ -26,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 99; Item.useAnimation = Item.useTime = 10; Item.DamageType = DamageClass.Summon; - Item.shootSpeed = 0f; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.useStyle = ItemUseStyleID.Swing; @@ -41,10 +42,10 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectileMany(player, type, ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType()); - int p = Projectile.NewProjectile(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/TundraFlameBlossomsStaff.cs b/Items/Weapons/Summon/TundraFlameBlossomsStaff.cs index dcf2926b9a..c3879ce76f 100644 --- a/Items/Weapons/Summon/TundraFlameBlossomsStaff.cs +++ b/Items/Weapons/Summon/TundraFlameBlossomsStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -23,6 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; Item.UseSound = SoundID.Item46; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.DamageType = DamageClass.Summon; } @@ -31,6 +33,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(false, type, player); for (int i = 0; i < 3; i++) { diff --git a/Items/Weapons/Summon/VengefulSunStaff.cs b/Items/Weapons/Summon/VengefulSunStaff.cs index fc5250bf6d..6a6e9735c3 100644 --- a/Items/Weapons/Summon/VengefulSunStaff.cs +++ b/Items/Weapons/Summon/VengefulSunStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -25,6 +26,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityLightPurpleBuyPrice; Item.rare = ItemRarityID.LightPurple; Item.UseSound = SoundID.Item44; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.DamageType = DamageClass.Summon; } @@ -33,10 +35,10 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(true, type, player); - int p = Projectile.NewProjectile(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/Vigilance.cs b/Items/Weapons/Summon/Vigilance.cs index 5b731630f0..bd8f7d453a 100644 --- a/Items/Weapons/Summon/Vigilance.cs +++ b/Items/Weapons/Summon/Vigilance.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -27,8 +28,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 4f; Item.UseSound = SoundID.DD2_BetsySummon; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; @@ -37,17 +38,12 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) + if (player.maxMinions - player.slotsMinions >= 1f) { - if (player.maxMinions - player.slotsMinions >= 1f) - { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - { - Main.projectile[p].ai[0] = player.ownedProjectileCounts[type]; - Main.projectile[p].originalDamage = Item.damage; - } - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.ai[0] = player.ownedProjectileCounts[type]; + minion.originalDamage = Item.damage; } return false; } diff --git a/Items/Weapons/Summon/VileFeeder.cs b/Items/Weapons/Summon/VileFeeder.cs index db16a86ab9..9f7e9472ac 100644 --- a/Items/Weapons/Summon/VileFeeder.cs +++ b/Items/Weapons/Summon/VileFeeder.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -19,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 36; Item.damage = 15; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.knockBack = 0.5f; @@ -37,7 +39,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, player.ClampedMouseWorld(), Main.rand.NextVector2CircularEdge(5f, 5f), type, damage, knockback, player.whoAmI); + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Main.rand.NextVector2CircularEdge(5f, 5f), type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/ViralSprout.cs b/Items/Weapons/Summon/ViralSprout.cs index 1c6f7c5669..a3cb6ee511 100644 --- a/Items/Weapons/Summon/ViralSprout.cs +++ b/Items/Weapons/Summon/ViralSprout.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -25,29 +26,26 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Lime; Item.UseSound = SoundID.Item44; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; + + int minionCount = 0; + foreach (Projectile pro in Main.ActiveProjectiles) { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + if (pro.type != type || pro.owner != player.whoAmI) + continue; - int minionCount = 0; - foreach (Projectile pro in Main.ActiveProjectiles) - { - if (pro.type != type || pro.owner != player.whoAmI) - continue; - - pro.localAI[0] = minionCount; - pro.netUpdate = true; - minionCount++; - } + pro.localAI[0] = minionCount; + pro.netUpdate = true; + minionCount++; } return false; } diff --git a/Items/Weapons/Summon/ViridVanguard.cs b/Items/Weapons/Summon/ViridVanguard.cs index affd241fee..6c1376707e 100644 --- a/Items/Weapons/Summon/ViridVanguard.cs +++ b/Items/Weapons/Summon/ViridVanguard.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -47,33 +48,28 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Red; Item.UseSound = SoundID.Item71; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.rare = ModContent.RarityType(); } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 1f); - if (Main.projectile.IndexInRange(p)) - { - Main.projectile[p].originalDamage = Item.damage; - Main.projectile[p].ModProjectile().BladeIndex = player.ownedProjectileCounts[type]; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 1f); + minion.originalDamage = Item.damage; + minion.ModProjectile().BladeIndex = player.ownedProjectileCounts[type]; - int bladeIndex = 0; - foreach (Projectile pro in Main.ActiveProjectiles) + int bladeIndex = 0; + foreach (Projectile pro in Main.ActiveProjectiles) + { + if (pro.type == type && pro.owner == player.whoAmI) { - if (pro.type == type && pro.owner == player.whoAmI) - { - pro.ModProjectile().BladeIndex = bladeIndex++; - pro.ModProjectile().AITimer = 0f; - pro.netUpdate = true; - } + pro.ModProjectile().BladeIndex = bladeIndex++; + pro.ModProjectile().AITimer = 0f; + pro.netUpdate = true; } } - return false; } public override void AddRecipes() diff --git a/Items/Weapons/Summon/VoidConcentrationStaff.cs b/Items/Weapons/Summon/VoidConcentrationStaff.cs index 38ce3b2db3..e9263db742 100644 --- a/Items/Weapons/Summon/VoidConcentrationStaff.cs +++ b/Items/Weapons/Summon/VoidConcentrationStaff.cs @@ -33,8 +33,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.damage = 105; Item.knockBack = 4f; Item.useAnimation = Item.useTime = 15; // 14 because of useStyle 1 + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); } @@ -50,10 +50,9 @@ namespace CalamityMod.Items.Weapons.Summon { if (player.altFunctionUse != 2) { - int p = Projectile.NewProjectile(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - player.AddBuff(ModContent.BuffType(), 120); + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; } return false; } diff --git a/Items/Weapons/Summon/WarloksMoonFist.cs b/Items/Weapons/Summon/WarloksMoonFist.cs index edc2b0338b..b06e055294 100644 --- a/Items/Weapons/Summon/WarloksMoonFist.cs +++ b/Items/Weapons/Summon/WarloksMoonFist.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Ores; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; @@ -35,24 +36,19 @@ namespace CalamityMod.Items.Weapons.Summon Item.UseSound = SoundID.Item104; Item.autoReuse = true; Item.noUseGraphic = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; Item.Calamity().donorItem = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int existingFists = player.ownedProjectileCounts[type]; - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - { - Main.projectile[p].originalDamage = Item.damage; - Main.projectile[p].ai[0] = existingFists; - } - } + player.AddBuff(Item.buffType, 2); + int existingFists = player.ownedProjectileCounts[type]; + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; + minion.ai[0] = existingFists; return false; } diff --git a/Items/Weapons/Summon/WitherBlossomsStaff.cs b/Items/Weapons/Summon/WitherBlossomsStaff.cs index e4ff0d39fd..4bd1b77d8d 100644 --- a/Items/Weapons/Summon/WitherBlossomsStaff.cs +++ b/Items/Weapons/Summon/WitherBlossomsStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -27,8 +28,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; Item.UseSound = SoundID.Item46; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } @@ -36,6 +37,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(false, type, player); for (int i = 0; i < 4; i++) { diff --git a/Items/Weapons/Summon/WulfrumController.cs b/Items/Weapons/Summon/WulfrumController.cs index 9dff85b70b..4c3c3541a9 100644 --- a/Items/Weapons/Summon/WulfrumController.cs +++ b/Items/Weapons/Summon/WulfrumController.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.Summon; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; @@ -27,8 +28,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Blue; Item.UseSound = SoundID.Item15; //phaseblade sound effect Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } @@ -40,15 +41,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - position = player.ClampedMouseWorld(); - velocity.X = 0; - velocity.Y = 0; - int droid = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 1f); - if (Main.projectile.IndexInRange(droid)) - Main.projectile[droid].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0f, 1f); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/YharonsKindleStaff.cs b/Items/Weapons/Summon/YharonsKindleStaff.cs index cffe7f5fb8..724f7a5e09 100644 --- a/Items/Weapons/Summon/YharonsKindleStaff.cs +++ b/Items/Weapons/Summon/YharonsKindleStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using CalamityMod.Sounds; @@ -36,20 +37,16 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ModContent.RarityType(); Item.UseSound = CommonCalamitySounds.FlareSound; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - position = player.ClampedMouseWorld(); - int dragon = Projectile.NewProjectile(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(dragon)) - Main.projectile[dragon].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Typeless/LunicEye.cs b/Items/Weapons/Typeless/LunicEye.cs index 872d2e4d6a..bfc0f7aa08 100644 --- a/Items/Weapons/Typeless/LunicEye.cs +++ b/Items/Weapons/Typeless/LunicEye.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Typeless { public new string LocalizationCategory => "Items.Weapons.Typeless"; - public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Item/LunicShot", 2) { PitchVariance = 0.1f }; + public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Item/LunicShot", 2) { Volume = 0.8f, PitchVariance = 0.1f }; public static readonly SoundStyle ImpactSound = new("CalamityMod/Sounds/Item/LunicImpact") { PitchVariance = 0.1f }; public override void SetDefaults() diff --git a/Items/Weapons/Typeless/Skynamite.cs b/Items/Weapons/Typeless/Skynamite.cs index 4b58acd186..9addfab877 100644 --- a/Items/Weapons/Typeless/Skynamite.cs +++ b/Items/Weapons/Typeless/Skynamite.cs @@ -34,8 +34,8 @@ namespace CalamityMod.Items.Weapons.Typeless Item.noMelee = true; Item.noUseGraphic = true; Item.UseSound = SoundID.Item1; - Item.value = CalamityGlobalItem.RarityOrangeBuyPrice / 10; // Crafted 10 at a time - Item.rare = ItemRarityID.Orange; + Item.value = Item.sellPrice(silver: 4); // Identical to Dynamite + Item.rare = ItemRarityID.Blue; } public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) diff --git a/Items/Weapons/Typeless/StarStruckWater.cs b/Items/Weapons/Typeless/StarStruckWater.cs index 13499cb0f5..b2e8980739 100644 --- a/Items/Weapons/Typeless/StarStruckWater.cs +++ b/Items/Weapons/Typeless/StarStruckWater.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Typeless Item.useTime = 15; Item.noUseGraphic = true; Item.noMelee = true; - Item.value = 200; + Item.value = Item.sellPrice(copper: 40); // Identical to Holy Water } public override void AddRecipes() diff --git a/Localization/en-US/Mods.CalamityMod.Bestiary.hjson b/Localization/en-US/Mods.CalamityMod.Bestiary.hjson index 7d5a7a6af1..21b32dc38b 100644 --- a/Localization/en-US/Mods.CalamityMod.Bestiary.hjson +++ b/Localization/en-US/Mods.CalamityMod.Bestiary.hjson @@ -86,7 +86,7 @@ MantisShrimp: Though a variety of answers are given when one asks adventurers ab OverloadedSoldier: A body given life again, overflowing with the souls of warriors that perished during the Crusade who were unable to find peace. Their ravenous hunger for battle has been reignited due to sensing godly essences in the land once more. PerennialSlime: These slimes have seized a small amount of the Goddess of Life's essence. Despite her reimprisonment in the deepest depths of the Abyss, the tendrils of her influence now stretch far into the world beyond. PhantomSpirit: The spirits within the Dungeon only vaguely recall their lives, and yet there is one thing each and all clearly remember, that drives them to chaos: the man responsible for locking them in these cursed walls, and his overwhelming power– power that they have been reminded of, due to one ever growing in strength roaming their halls. -Piggy: These little swines waddle their little legs across these lands with little purpose, but they are happy with just that. Yet, little is known about how their little stomach carries a not-so-little amount of coins. +Piggy: These little swines waddle their little legs across these lands with little purpose, but they are happy with just that. Yet, little is known about how their little stomach carries a not-so-little amount of fat and muscle. ProfanedEnergyBody: Those most devout to Her travel the world, being planted into societies and acting as spies and assassins. Among their duties is constructing shrines in Her honor infused with Her divine power, that She might bless pagans blinded by darkness with visions of Her new age of light. Rimehound: These hounds were bred and trained to survive in the tundra's hostile conditions by Yharim's forces, so that they may act as scouts. Most were simply abandoned by their masters out of either necessity or choice, and were resigned to roam forever without purpose. Rotdog: Fast and furious, these hounds prowl the night, hunting prey with their razor sharp teeth. They are similar in nature to the demon eyes, both being spawned from the same vile mire, yet these creatures are tailored made to end those who have proven themselves a threat to it. diff --git a/Localization/en-US/Mods.CalamityMod.BossChecklistIntegration.hjson b/Localization/en-US/Mods.CalamityMod.BossChecklistIntegration.hjson index 1887130660..8e6b15daba 100644 --- a/Localization/en-US/Mods.CalamityMod.BossChecklistIntegration.hjson +++ b/Localization/en-US/Mods.CalamityMod.BossChecklistIntegration.hjson @@ -20,7 +20,7 @@ AquaticScourge: { } AstrumAureus: { - SpawnInfo: Use an [i:CalamityMod/AstralChunk] at night in the Astral Infection. + SpawnInfo: Use an [i:CalamityMod/AstralChunk] in the Astral Infection. DespawnMessage: "[c/FFD700:Aureus has neutralized all threats. Resume prior reconnaissance.]" } @@ -47,7 +47,7 @@ Calamitas: { } CalamitasClone: { - SpawnInfo: Use an [i:CalamityMod/EyeofDesolation] at night. + SpawnInfo: Use an [i:CalamityMod/EyeofDesolation]. DespawnMessage: "[c/FFA500:The clone spits a bit of blood in disgust and vanishes.]" } @@ -58,7 +58,7 @@ CeaselessVoid: { } Crabulon: { - SpawnInfo: Use a [i:CalamityMod/DecapoditaSprout] in a Glowing Mushroom biome. + SpawnInfo: Use a [i:CalamityMod/DecapoditaSprout] in an underground Glowing Mushroom biome. DespawnMessage: "[c/6495ED:The monstrous mycelial crab shuffles away…]" } diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index 0184d2fdb9..ed14a54750 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -479,11 +479,6 @@ RadiatorBuff: { Description: Radioactive but adorable } -ReaverOrbBuff: { - DisplayName: Reaver Orb - Description: The reaver orb will light your way -} - SparksBuff: { DisplayName: Sparks Description: Eats butterflies @@ -1113,7 +1108,7 @@ BrimseekerBuff: { Description: Does it want something from you? } -BrimstoneWaifu: { +BrimstoneElemental: { DisplayName: Brimstone Elemental Description: The Brimstone Elemental will protect you } @@ -1138,16 +1133,11 @@ CinderBlossomBuff: { Description: A hot, searing flower is floating uncomfortably close to you } -CloudyWaifu: { +CloudElemental: { DisplayName: Cloud Elemental Description: The Cloud Elemental will protect you } -GlacialEmbraceBuff: { - DisplayName: Glacial Embrace - Description: The magic of the ancient ice castle will aid you -} - Corroslime: { DisplayName: Corroslime Description: The corroslime will protect you @@ -1203,11 +1193,6 @@ DemonshadeSetDevilBuff: { Description: The red devil will protect you } -LegionofCelestiaBuff: { - DisplayName: Celestial Axe - Description: If only it was this good at chopping trees... -} - EndoCooperBuff: { DisplayName: Endo Cooper Description: The ascened Cooper will protect you @@ -1278,6 +1263,11 @@ GastricAberrationBuff: { Description: The aquatic aberration will protect you } +GlacialEmbraceBuff: { + DisplayName: Glacial Embrace + Description: The magic of the ancient ice castle will aid you +} + HauntedDishesBuff: { DisplayName: Haunted Dishes Description: The haunted dishes will protect you @@ -1328,6 +1318,11 @@ KingofConstellationsBuff: { Description: The celestial dragons will protect you } +LegionofCelestiaBuff: { + DisplayName: Celestial Axe + Description: If only it was this good at chopping trees... +} + LiliesOfFinalityBuff: { DisplayName: Finality Description: Remember our promise @@ -1419,6 +1414,11 @@ PuffWarriorBuff: { Description: It confidently and excitedly protects you } +RareSandElemental: { + DisplayName: Rare Sand Elemental + Description: The Sand Elemental will heal you +} + ResurrectionButterflyBuff: { DisplayName: Resurrection Butterfly Description: Sleep beneath the Cherry Blossoms, Red-White Butterfly @@ -1434,12 +1434,7 @@ Sandnado: { Description: The sandnado will protect you } -SandyHealingWaifu: { - DisplayName: Rare Sand Elemental - Description: The Sand Elemental will heal you -} - -SandyWaifu: { +SandElemental: { DisplayName: Sand Elemental Description: The Sand Elemental will protect you } @@ -1554,7 +1549,7 @@ VoidConcentrationBuff: { Description: The infinite void yearns for more... } -WaterWaifu: { +WaterElemental: { DisplayName: Anahita Description: Anahita will protect you } @@ -1590,3 +1585,8 @@ PopoNoselessBuff: { DisplayName: Noseless Popo Description: Your nose has been stolen! } + +ForbiddenStealthSummonTagBuff: { + DisplayName: Forbidden Stealth Summon Tag Buff + Description: If you're seeing this, something went horribly wrong +} diff --git a/Localization/en-US/Mods.CalamityMod.Common.hjson b/Localization/en-US/Mods.CalamityMod.Common.hjson index ff8b7cf963..de36dce08e 100644 --- a/Localization/en-US/Mods.CalamityMod.Common.hjson +++ b/Localization/en-US/Mods.CalamityMod.Common.hjson @@ -1,3 +1,18 @@ +// Plain stat boosts +RogueDamage: "{0}% increased rogue damage" +RogueCrit: "{0}% increased rogue critical strike chance" +RogueDamageCrit: "{0}% increased rogue damage and critical strike chance" +RogueVelocity: "{0}% increased rogue velocity" +RogueStealth: +{0} maximum stealth +// Armor Set Bonus key states +BothArmorSetBonusKeys: Press {0} or Double tap {1} +NoArmorSetBonusKey: Press the Armor Set Bonus key +ArmorSetBonusKey: Press {0} +DoubleTapDown: Double tap {0} +// Miscellaneous stats/info +AggroBoost: Enemies are more likely to target you +AggroReduction: Enemies are less likely to target you +KnockbackImmunity: Grants immunity to knockback AbyssLightLevel1: Provides a small amount of light in the abyss AbyssLightLevel2: Provides a moderate amount of light in the abyss AbyssLightLevel3: Provides a large amount of light in the abyss @@ -8,9 +23,6 @@ AlcoholWarning: Drinking more than 3 different alcohols might not end well with ArmorPenetration: Ignores {0} points of enemy Defense CanMineUelibloom: Can mine Uelibloom Ore NotConsumable: Not consumable -RogueDamage: "{0}% increased rogue damage" -RogueCrit: "{0}% increased rogue critical strike chance" -RogueVelocity: "{0}% increased rogue velocity" SummonTagDamageFlat: "{0} summon tag damage" SummonTagDamageMult: "{0}x summon tag damage" SummonTagCrit: "{0}% summon tag critical strike chance" diff --git a/Localization/en-US/Mods.CalamityMod.Condition.hjson b/Localization/en-US/Mods.CalamityMod.Condition.hjson index 44ad6c1cc4..d99892c2dd 100644 --- a/Localization/en-US/Mods.CalamityMod.Condition.hjson +++ b/Localization/en-US/Mods.CalamityMod.Condition.hjson @@ -50,7 +50,6 @@ Drops: { } // Other conditions -PotionConfig: While the Town NPC Potion Selling configuration option is enabled HasFlareGun: While holding a Flare Gun upgrade LacewingBestiary: When at least 40% of the Bestiary has been completed HasRogueArmor: While wearing rogue armor @@ -61,9 +60,3 @@ InSulph: In the Sulphurous Sea InSunken: In the Sunken Sea InRev: In Revengeance Mode InRevOrMM: In Revengeance Mode or in Master Mode -PostCal: After defeating Calamitas Clone -PostAureus: After defeating Astrum Aureus -PostPolter: After defeating Polterghast -PostOD: After defeating the Old Duke -PostDoG: After defeating the Devourer of Gods -PostYharon: After defeating Yharon diff --git a/Localization/en-US/Mods.CalamityMod.Configs.hjson b/Localization/en-US/Mods.CalamityMod.Configs.hjson index 4e198237fe..a86ca1bd36 100644 --- a/Localization/en-US/Mods.CalamityMod.Configs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Configs.hjson @@ -50,15 +50,6 @@ CalamityClientConfig: { ''' } - CalamityArmorSetBonusDoubleTap: { - Label: "[i:CalamityMod/DesertProwlerHat] Calamity Armor Set Bonuses Can Use Vanilla Hotkey" - Tooltip: - ''' - Allows Calamity armor set bonuses to be triggered by the vanilla double-tap {$Key.DOWN} hotkey (or {$Key.UP} depending on your settings). - Also allows vanilla armor set bonuses to be triggered by Calamity's armor set bonus hotkey. - ''' - } - ChargeMeter: { Label: "[i:CalamityMod/DraedonPowerCell] Display Charge Meter" Tooltip: @@ -253,6 +244,21 @@ CalamityClientConfig: { ''' } + SetBonusDoubleTap: { + Label: "[i:VortexHelmet] Allow Double Tap for Armor Set Bonuses" + Tooltip: + ''' + Allows all armor set bonuses to be triggered by the vanilla double-tap {$Key.DOWN} hotkey (or {$Key.UP} depending on your settings). + Set to Auto to automatically turn off double-tap as long as Calamity's {$Keybinds.ArmorSetBonus.DisplayName} hotkey is bound. + ''' + + Options: { + On: Always On + Auto: Auto + Off: Always Off + } + } + ShopNewAlert: { Label: "[i:GoldChest] New Shop Inventory Alerts" Tooltip: Adds an icon that appears over Town NPCs when they have new items in their shops. @@ -551,3 +557,5 @@ CalamityServerConfig: { ''' } } + +SetBonusDoubleTapOptions.Tooltip: "" diff --git a/Localization/en-US/Mods.CalamityMod.GameTips.hjson b/Localization/en-US/Mods.CalamityMod.GameTips.hjson index 3d5faa25c4..d847050349 100644 --- a/Localization/en-US/Mods.CalamityMod.GameTips.hjson +++ b/Localization/en-US/Mods.CalamityMod.GameTips.hjson @@ -9,7 +9,6 @@ AmidiasBlessingTip: The Sea King can provide a bubble to aid with breathing unde ArchmageTip: The Archmage can be freed if you manage to destroy the cell he was imprisoned in. BrimstoneWitchTip: The Brimstone Witch can enchant your items to grant them new powers. TitanHeartTip: Titan Hearts can be used as an offering at a Beacon found in the Astral Infection. -NightProvTip: Summoning the Profaned Goddess under the light of the moon massively empowers her strength and endurance. DayEoLTip: Summoning the fae monarch under the light of day will start a vicious and persistent battle. BossEnemyTip: Killing the most harmless of enemies can awaken the wrath of a much stronger monster. Slay them at your own risk! RoDAbyssTip: Use the Rod of Discord in the Abyss at your own risk. The light left behind may attract the attention of unwanted foes. @@ -21,7 +20,6 @@ FactoryChargingTip: Power Cell Factories and Charging Stations can be looted fro StealthTip: Wearing any rogue class armor lets you build stealth! SummonNerfTip: Holding a non-summoner weapon reduces the damage of your minions. DefenseDamageTip: Certain attacks will chip away at your defense, but it will quickly regenerate afterward. -PointBlankTip: Ranged weapons fired at point blank will do a lot more damage. RevengeanceTip: Need a challenge beyond Expert Mode? Try Revengeance Mode! BloodOrbTip: Blood Orbs collected during the Blood Moon can craft almost any potion. KeybindsTip: Modded controls can be bound in Settings. diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index b8a60edf5e..059e73fc28 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -288,7 +288,7 @@ BatholithBangle: { Tooltip: ''' Magic enemy hits create a powerful granite flash that always critically strikes - This effect has a 10 second cooldown, but is halved if the flash kills an enemy + This effect has a 10 second cooldown Visual and audio effects are reduced if visibility is disabled [c/0189D7:'The solid granite radiates energy throughout your body'] ''' @@ -361,8 +361,8 @@ BloomStone: { ''' Healing Potions are 50% more effective, but provide their healing over time Grappling hooks retract and pull the player 50% faster, and grow a flower at hookpoints - Touching a flower makes it burst into pollen which gives a temporary 6% damage reduction boost - The damage reduction boost increases to 12% while receiving healing over time + Touching a flower makes it burst into pollen which gives a temporary boost to potion healing over time + Potion healing slows drastically when at full health 'One of the ancient relics' ''' } @@ -414,10 +414,13 @@ ChaosStone: { DisplayName: Chaos Stone Tooltip: ''' - Mana Sickness from drinking mana potions is replaced by Mana Burn - Mana Burn deals damage over time relative to the intensity of the debuff - This debuff does not reduce your magic damage - 'One of the ancient relics' + Disables automatic potion consumption + Items that consume mana can be used even without the required mana amount + Mana usage can overflow into negative mana, causing you to receive [Mana Burn] + The lower your mana, the more intense the manafire burns + Attacks while you have [Mana Burn] inflict [Mana Burn] on enemies + Every 50 negative mana increases [Mana Burn] by 1% of the attack's damage + Negative Mana is capped at your maximum mana amount ''' } @@ -720,6 +723,11 @@ ElementalGauntlet: { ''' } +ElementalinaBottle: { + DisplayName: Elemental in a Bottle + Tooltip: Summons a sand elemental to fight for you +} + ElysianAegis: { DisplayName: Elysian Aegis Tooltip: @@ -1019,7 +1027,6 @@ InkBomb: { DisplayName: Ink Bomb Tooltip: ''' - +10 maximum stealth Stealth generates 7% faster Throws several ink bombs when hit that explode into ink and confuse enemies Gain a lot of stealth when struck @@ -1391,7 +1398,7 @@ ProtolithBangle: { Tooltip: ''' Ranged enemy hits create a marble flash that always critically strikes and can hit multiple enemies - This effect has a 7 second cooldown, but is halved if the flash kills the first enemy it hits + This effect has a 7 second cooldown Visual and audio effects are reduced if visibility is disabled [c/C5B965:'The cold marble against your wrist puts your mind at ease'] ''' @@ -1455,11 +1462,20 @@ RampartofDeities: { This effect scales from 10 frames at full HP to 40 frames at 25% or less HP Being struck for over 200 damage grants 30 additional invincibility frames Grants immunity to knockback - Puts a shell around the owner when below 50% life that reduces damage taken + Puts a shell around the owner when below 50% life that reduces damage by 25% Absorbs 25% of damage done to players on your team when above 25% life ''' } +RareElementalinaBottle: { + DisplayName: Rare Elemental in a Bottle + Tooltip: + ''' + Summons a sand elemental to heal you + ;D + ''' +} + ReaperToothNecklace: { DisplayName: Reaper Tooth Necklace Tooltip: @@ -1737,11 +1753,10 @@ StatisNinjaBelt: { DisplayName: Statis' Ninja Belt Tooltip: ''' - Provides a high-speed dash that scales with your movement speed + Provides a high-speed dash 10% increased movement speed, 32% increased jump speed, allows auto-jump, and negates fall damage Increases movement acceleration and deceleration by 1.6x Grants the ability to swim, climb walls, and dodge attacks - Consecutive dashes in the same direction reduce dash speed ''' HoldShiftTooltip: "{$Common.DodgeInformation}" } @@ -1750,12 +1765,11 @@ StatisVoidSash: { DisplayName: Statis' Void Sash Tooltip: ''' - Provides a high-speed dash that scales with your movement speed + Provides a high-speed dash 20% increased movement speed, 32% increased jump speed, allows auto-jump, and negates fall damage Increases movement acceleration and deceleration by 1.85x Grants the ability to swim, climb walls, and dodge attacks Visual effects are reduced if visibility is disabled - Consecutive dashes in the same direction reduce dash speed ''' HoldShiftTooltip: "{$Common.DodgeInformation}" } @@ -2085,20 +2099,6 @@ WarbanneroftheRighteous: { ''' } -WifeinaBottle: { - DisplayName: Elemental in a Bottle - Tooltip: Summons a sand elemental to fight for you -} - -WifeinaBottlewithBoobs: { - DisplayName: Rare Elemental in a Bottle - Tooltip: - ''' - Summons a sand elemental to heal you - ;D - ''' -} - WulfrumAcrobaticsPack: { DisplayName: Wulfrum Acrobatics Pack Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson index bb836899e3..a3095af245 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson @@ -2,21 +2,21 @@ AstralBreastplate: { DisplayName: Astral Breastplate Tooltip: ''' - 7% increased damage - +80 max mana + {$CommonItemTooltip.IncreasesMaxManaBy} + {$CommonItemTooltip.PercentIncreasedDamage@1} ''' } AstralHelm: { DisplayName: Astral Helm - Tooltip: 5% increased damage and 10% increased critical strike chance + Tooltip: "{$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1}" SetBonus: ''' - +3 max minions - 10% increased damage and critical strike chance + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedDamageCritChance@1} Detects nearby creatures, enemy projectiles, danger sources, and treasure Whenever you crit an enemy, a barrage of stars will rain down - This effect has a 1 second cooldown before it can trigger again + This effect has a {2} {^2:second;seconds} cooldown before it can trigger again ''' } @@ -24,8 +24,8 @@ AstralLeggings: { DisplayName: Astral Leggings Tooltip: ''' - 5% increased damage - 15% increased movement speed + {$CommonItemTooltip.PercentIncreasedDamage} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@1} ''' } @@ -33,67 +33,59 @@ BrimflameBoots: { DisplayName: Brimflame Boots Tooltip: ''' - 5% increased magic damage - 5% increased movement speed + {$CommonItemTooltip.PercentIncreasedMagicDamage} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@1} + ''' +} + +BrimflameCowl: { + DisplayName: Brimflame Cowl + Tooltip: + ''' + {$CommonItemTooltip.IncreasesMaxManaBy} and {$CommonItemTooltip.PercentReducedManaCost@1} + {$CommonItemTooltip.PercentIncreasedMagicDamageCritChance@2} + Immunity to On Fire!, Brimstone Flames and Frostburn + ''' + SetBonus: + ''' + {$CommonItemTooltip.PercentIncreasedMagicDamageCritChance} + [c/{1}:Brimflame Frenzy - {2} for {3} {^3:second;seconds} of {$CommonItemTooltip.PercentIncreasedMagicDamage@4}] + [c/FF9173:However, this inflicts rapid life loss and disables mana regeneration and mana potions] + [c/FF9173:This effect can be toggled off and has a cooldown of {5} {^5:second;seconds}] ''' } BrimflameRobes: { DisplayName: Brimflame Robes - Tooltip: 5% increased magic damage and critical strike chance -} - -BrimflameScowl: { - DisplayName: Brimflame Cowl - Tooltip: - ''' - 5% increased magic damage and critical strike chance - Increases maximum mana by 80 and reduces mana usage by 10% - Immunity to On Fire!, Brimstone Flames and Frostburn - ''' - SetBonus: - ''' - Grants an additional 15% increased magic damage and critical strike chance - Press {0} to trigger a brimflame frenzy effect - While under this effect, you get an additional 40% increase to magic damage - However, this inflicts rapid life loss and disables mana regeneration and mana potions - This can be toggled off, however, brimflame frenzy has a 30 second cooldown - ''' + Tooltip: "{$CommonItemTooltip.PercentIncreasedMagicDamageCritChance}" } DaedalusBreastplate: { DisplayName: Daedalus Breastplate - Tooltip: 3% increased damage and critical strike chance + Tooltip: "{$CommonItemTooltip.PercentIncreasedDamage}" } DaedalusHeadMagic: { DisplayName: Daedalus Hood Tooltip: ''' - 13% increased magic damage and 7% increased magic critical strike chance - 10% reduced mana usage and +60 max mana - ''' - SetBonus: - ''' - 5% increased magic damage - You have a 10% chance to absorb physical attacks and projectiles when hit - If you absorb an attack you are healed for 1/2 of that attack's damage + {$CommonItemTooltip.IncreasesMaxManaBy} and {$CommonItemTooltip.PercentReducedManaCost@1} + {$CommonItemTooltip.PercentIncreasedMagicDamage@2} and {$CommonItemTooltip.PercentIncreasedMagicCritChance@3} ''' + SetBonus: You have a {0}% chance to heal back {1}% of taken damage } DaedalusHeadMelee: { DisplayName: Daedalus Helm Tooltip: ''' - 15% increased melee damage - 10% increased melee critical strike chance + {$CommonItemTooltip.PercentIncreasedMeleeDamageCritChance} + {$CommonItemTooltip.PercentIncreasedMeleeSpeed@1} ''' SetBonus: ''' - 10% increased melee speed - Enemies are more likely to target you - You reflect projectiles back at enemies - Reflected projectiles deal 50% less damage to you + {$Common.AggroBoost} + You reflect projectiles back at enemies, negating their damage {$Common.ReflectInformation} ''' } @@ -102,37 +94,37 @@ DaedalusHeadRanged: { DisplayName: Daedalus Headgear Tooltip: ''' - 13% increased ranged damage and 7% increased ranged critical strike chance - Reduces ammo usage by 20% - ''' - SetBonus: - ''' - 5% increased ranged damage - Getting hit causes you to emit a blast of crystal shards + {$CommonItemTooltip.PercentIncreasedRangedDamage} and {$CommonItemTooltip.PercentIncreasedRangedCritChance@1} + 20% chance to save ammo ''' + SetBonus: Getting hit causes you to emit a blast of crystal shards } DaedalusHeadRogue: { DisplayName: Daedalus Facemask Tooltip: ''' - 13% increased rogue damage and 7% increased rogue critical strike chance - 15% increased rogue velocity and 5% increased movement speed + {$Common.RogueDamage} and {$Common.RogueCrit@1} + {$Common.RogueVelocity@2} and {$CommonItemTooltip.PercentIncreasedMovementSpeed@3} ''' SetBonus: ''' - 5% increased rogue damage - +105 maximum stealth + {$Common.RogueStealth} Rogue projectiles throw out crystal shards as they travel ''' } DaedalusHeadSummon: { DisplayName: Daedalus Mask - Tooltip: 5% increased summon damage + Tooltip: + ''' + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} + ''' SetBonus: ''' - 20% increased summon damage and +2 max minions + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} A daedalus crystal floats above you to protect you ''' } @@ -141,8 +133,8 @@ DaedalusLeggings: { DisplayName: Daedalus Leggings Tooltip: ''' - 3% increased critical strike chance - 10% increased movement speed + {$CommonItemTooltip.PercentIncreasedCritChance} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@1} ''' } @@ -150,9 +142,9 @@ FathomSwarmerBoots: { DisplayName: Fathom Swarmer Greaves Tooltip: ''' - 8% increased summon damage + {$CommonItemTooltip.PercentIncreasedSummonDamage} Grants the ability to swim - Movement speed increased by 40% while submerged in liquid + {$CommonItemTooltip.PercentIncreasedMovementSpeed@1} while submerged in liquid ''' } @@ -160,8 +152,8 @@ FathomSwarmerBreastplate: { DisplayName: Fathom Swarmer Breastplate Tooltip: ''' - Increases your max number of minions by 1 - 10% increased summon damage + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} Reduces defense loss within the Abyss ''' } @@ -170,39 +162,44 @@ FathomSwarmerVisage: { DisplayName: Fathom Swarmer Visage Tooltip: ''' - Increases your max number of minions by 1 - 8% increased summon damage + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} Provides breathing and light underwater ''' SetBonus: ''' - 10% increased summon damage and +2 max minions + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} Grants the ability to climb walls - 20% increased summon damage, +10 defense and +2.5 HP/s life regen while underwater + {$CommonItemTooltip.PercentIncreasedSummonDamage@2}, +{3} defense and +{4} HP/s life regen while underwater Provides a moderate amount of light and moderately reduces breath loss in the abyss ''' } ForbiddenCirclet: { DisplayName: Forbidden Circlet - Tooltip: 10% increased summon damage and 15% increased rogue velocity + Tooltip: "{$CommonItemTooltip.PercentIncreasedSummonDamage} and {$Common.RogueVelocity@1}" SetBonus: ''' - +40 maximum stealth - Press {0} to call an ancient storm to the cursor location - The ancient storm costs {1} mana and benefits from both summon and rogue bonuses - Rogue stealth strikes spawn homing eaters on enemy hits - Rogue and summon attacks will scale off of the stat with a higher boost + {$Common.RogueStealth} + {1} to call an ancient storm to the cursor location + The ancient storm costs {2} mana and benefits from both summon and rogue bonuses + Rogue stealth strikes will tag enemies, causing summons to spawn homing eaters on hit + Using summon weapons no longer reset your stealth Minions no longer deal less damage while wielding rogue weapons ''' } HydrothermicArmor: { DisplayName: Hydrothermic Armor - Tooltip: 8% increased damage and 4% increased critical strike chance + Tooltip: + ''' + {$CommonItemTooltip.PercentIncreasedDamage} + Grants immunity to fire and lava + ''' CommonSetBonus: ''' - Inferno effect when below 50% life + Inferno effect when below {0}% life You emit a blazing explosion when you are hit ''' } @@ -211,28 +208,22 @@ HydrothermicHeadMagic: { DisplayName: Hydrothermic Mask Tooltip: ''' - 12% increased magic damage, +100 max mana, and 10% increased magic critical strike chance - Grants immunity to fire and lava - ''' - SetBonus: - ''' - 5% increased magic damage and 15% reduced mana usage - Magic attacks summon damaging and healing flare orbs on hit + {$CommonItemTooltip.IncreasesMaxManaBy} and {$CommonItemTooltip.PercentReducedManaCost@1} + {$CommonItemTooltip.PercentIncreasedMagicDamage@2} and {$CommonItemTooltip.PercentIncreasedMagicCritChance@3} ''' + SetBonus: Magic attacks summon damaging and healing flare orbs on hit } HydrothermicHeadMelee: { DisplayName: Hydrothermic Helm Tooltip: ''' - 17% increased melee damage and 10% increased melee critical strike chance - Melee attacks and melee projectiles inflict on fire - Grants immunity to fire and lava + {$CommonItemTooltip.PercentIncreasedMeleeDamage} and {$CommonItemTooltip.PercentIncreasedMeleeCritChance@1} + {$CommonItemTooltip.PercentIncreasedMeleeSpeed@2} ''' SetBonus: ''' - 15% increased melee speed - Enemies are more likely to target you + {$Common.AggroBoost} Melee attacks and projectiles cause chaos flames to erupt on enemy hits ''' } @@ -241,30 +232,23 @@ HydrothermicHeadRanged: { DisplayName: Hydrothermic Headgear Tooltip: ''' - 12% increased ranged damage and 10% increased ranged critical strike chance - Reduces ammo usage by 25% - Grants immunity to fire and lava - ''' - SetBonus: - ''' - 5% increased ranged damage - You fire a homing chaos flare when using ranged weapons every 0.33 seconds + {$CommonItemTooltip.PercentIncreasedRangedDamage} and {$CommonItemTooltip.PercentIncreasedRangedCritChance@1} + 25% chance to save ammo ''' + SetBonus: You fire a homing chaos flare when using ranged weapons every {0} seconds } HydrothermicHeadRogue: { DisplayName: Hydrothermic Hood Tooltip: ''' - 12% increased rogue damage and 10% increased rogue critical strike chance - 5% increased movement speed - Grants immunity to fire and lava + {$Common.RogueDamage} and {$Common.RogueCrit@1} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@2} ''' SetBonus: ''' - 5% increased rogue damage - +110 maximum stealth - Rogue weapons unleash a volley of homing chaos flames around the player every 2 seconds + {$Common.RogueStealth} + Rogue weapons unleash a volley of homing chaos flames around the player every {1} seconds ''' } @@ -272,12 +256,13 @@ HydrothermicHeadSummon: { DisplayName: Hydrothermic Helmet Tooltip: ''' - 5% increased summon damage and increased minion knockback - Grants immunity to fire and lava + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} ''' SetBonus: ''' - 40% increased summon damage and +2 max minions + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} Summons a hydrothermic vent to protect you ''' } @@ -286,8 +271,8 @@ HydrothermicSubligar: { DisplayName: Hydrothermic Subligar Tooltip: ''' - 5% increased critical strike chance - 10% increased movement speed + {$CommonItemTooltip.PercentIncreasedCritChance} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@1} ''' } @@ -295,9 +280,8 @@ LunicCorpsBoots: { DisplayName: Lunic Corps Boots Tooltip: ''' - 15% increased movement speed - 5% increased ranged critical strike chance - 10% increased max movement speed and acceleration + {$CommonItemTooltip.PercentIncreasedRangedCritChance} + {1}% increased movement speed and acceleration ''' } @@ -305,38 +289,31 @@ LunicCorpsHelmet: { DisplayName: Lunic Corps Helmet Tooltip: ''' - 15% increased ranged damage - Night vision and creature detect + Increases non-bow damage by {0}% + Improves vision and shows the location of enemies ''' SetBonus: ''' - 'Finish the fight' - Projects a bubble shield that absorbs up to 50 damage {0} - The shield starts recharging 5 seconds after being hit - Recharging from zero to full charge takes 2 seconds - Being hit again while recharging restarts the charge timer - 15% increased bullet damage - 15% increased specialist ranged damage - These are launchers, dartguns, or anything else that doesn't shoot arrows/bullets - 20% increased jump speed + {0}% increased jump speed + [c/{1}:MJOLNIR Shield - Projects a bubble shield that absorbs up to {2} damage]{3} + [c/52CBDE:The shield starts recharging {4} {^4:second;seconds} after being hit] + [c/52CBDE:Recharging from zero to full charge takes {5} {^5:second;seconds}] + [c/52CBDE:Being hit again while recharging restarts the charge timer] + [c/9EA67F:'Finish the fight'] ''' - ShieldAdren: Halves Adrenaline lost on hit if the shield fully absorbs the hit + ShieldAdren: "[c/52CBDE:Halves Adrenaline lost on hit if the shield fully absorbs the hit]" } LunicCorpsVest: { DisplayName: Lunic Corps Vest - Tooltip: - ''' - 5% increased ranged damage - 15% increased ranged critical strike chance - ''' + Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedDamageCritChance}" } MolluskShelleggings: { DisplayName: Mollusk Shelleggings Tooltip: ''' - 6% increased damage and 4% increased critical strike chance + {$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1} Your horizontal movement is slowed ''' } @@ -345,14 +322,14 @@ MolluskShellmet: { DisplayName: Mollusk Shellmet Tooltip: ''' - 5% increased damage and 4% increased critical strike chance + {$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1} You can move freely through liquids Your horizontal movement is slowed ''' SetBonus: ''' + {0}% increased damage reduction Two shellfishes aid you in combat - 10% increased damage reduction ''' } @@ -360,7 +337,7 @@ MolluskShellplate: { DisplayName: Mollusk Shellplate Tooltip: ''' - 6% increased damage and 5% increased critical strike chance + {$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1} Your horizontal movement is slowed ''' } @@ -369,9 +346,9 @@ PlaguebringerCarapace: { DisplayName: Plaguebringer Carapace Tooltip: ''' + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} Grants immunity to the Plague - 15% increased summon damage - Friendly bees inflict the plague ''' } @@ -379,32 +356,42 @@ PlaguebringerPistons: { DisplayName: Plaguebringer Pistons Tooltip: ''' - 15% increased summon damage and 15% increased movement speed - You grow flowers on the grass beneath you, chance to grow very random dye plants on grassless dirt + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} and {$CommonItemTooltip.PercentIncreasedMovementSpeed@2} + Flowers grow on the grass you walk on, and dye plants rarely grow on grassless dirt you walk on ''' } PlaguebringerVisor: { DisplayName: Plaguebringer Visor - Tooltip: 15% increased summon damage + Tooltip: + ''' + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} + ''' SetBonus: ''' Grants a plague dash which can slam through enemies without taking damage Summons a lil' plaguebringer which swarms your foes with little bees - +3 max minions + Friendly bees inflict the plague ''' } PlagueReaperMask: { DisplayName: Plague Reaper Mask - Tooltip: 10% increased ranged damage and 8% increased ranged critical strike chance + Tooltip: + ''' + {$CommonItemTooltip.PercentIncreasedRangedDamage} and {$CommonItemTooltip.PercentIncreasedRangedCritChance@1} + 25% chance to save ammo + ''' SetBonus: ''' - 25% reduced ammo usage and 5% increased flight time - Enemies receive 10% more damage from ranged projectiles when afflicted by the Plague + {0}% increased flight time + Enemies afflicted by the Plague take {1}x damage from ranged projectiles Getting hit causes plague cinders to rain from above - Press {0} to blind yourself for 5 seconds but massively boost your ranged damage - This has a 25 second cooldown + [c/{2}:Plague Blackout - {3} to greatly empower your damage but completely blind yourself] + [c/009418:{$CommonItemTooltip.PercentIncreasedRangedDamage@4} and {$CommonItemTooltip.PercentIncreasedRangedCritChance@5} while blacked out] + [c/009418:This effect lasts {6} {^6:second;seconds} and has a cooldown of {7} {^7:second;seconds}] ''' } @@ -412,8 +399,8 @@ PlagueReaperStriders: { DisplayName: Plague Reaper Striders Tooltip: ''' - 3% increased ranged critical strike chance - 15% increased movement speed + {$CommonItemTooltip.PercentIncreasedRangedCritChance} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@1} ''' } @@ -421,96 +408,85 @@ PlagueReaperVest: { DisplayName: Plague Reaper Vest Tooltip: ''' + {$CommonItemTooltip.PercentIncreasedRangedDamage} Grants immunity to the Plague - 15% increased ranged damage and 5% increased ranged critical strike chance ''' } ReaverCuisses: { DisplayName: Reaver Cuisses - Tooltip: - ''' - 5% increased critical strike chance - 12% increased movement speed - ''' + Tooltip: "{$CommonItemTooltip.PercentIncreasedMovementSpeed}" } ReaverHeadExplore: { DisplayName: Reaver Headgear Tooltip: ''' - 20% increased mining speed - 50% increased block & wall placement speed + {0}% increased mining speed + {1}% increased block & wall placement speed Grants immunity to lava and can move freely through liquids ''' SetBonus: ''' - Summons an orb which highlights nearby treasure and provides light - Grants underwater breathing and reduced enemy aggression + Emits light and shows the location of treasure and ore + {$Common.AggroReduction} and grants underwater breathing These have a moderate effect while in the Abyss - Increased block placement & tool range by 7 + Increased block placement & tool range by {0} Increases pickup range for items ''' } ReaverHeadMobility: { DisplayName: Reaver Visage - Tooltip: 10% increased jump speed and 15% increased movement speed + Tooltip: "{$CommonItemTooltip.PercentIncreasedMovementSpeed} and {1}% increased jump speed" SetBonus: ''' Grants immunity to fall damage and allows constant jumping - 10% increased flight time and horizontal wing speed - Hooks fly out and retract 50% faster - Reduces the cooldown of dashes + {0}% increased flight time and horizontal wing speed + Grappling hooks retract and pull the player {1}% faster + Reduces the cooldown of dashes by {2}% ''' } ReaverHeadTank: { DisplayName: Reaver Helm - Tooltip: - ''' - 15% increased damage reduction but 30% decreased damage - +50 max life - ''' + Tooltip: +{0} max life and +{1} HP/s life regen SetBonus: ''' - +10 defense and +5 HP/s life regen - Enemies are more likely to target you - Reduces the life regen lost from damage over time debuffs by 20% - 30% decreased movement speed and flight time - Enemy damage is reflected and summons a thorn spike - Reaver Rage activates when you are damaged + {$Common.AggroBoost} + Reduces the life regen lost from damage over time debuffs by {0}% + {1}% decreased movement speed and flight time + Grants Reaver Rage for {2} {^2:second;seconds} after taking damage ''' } ReaverScaleMail: { DisplayName: Reaver Scale Mail - Tooltip: 9% increased damage and 4% increased critical strike chance + Tooltip: "{0}% increased damage reduction" } TitanHeartBoots: { DisplayName: Titan Heart Boots - Tooltip: 4% increased rogue damage, 10% increased rogue velocity, and 5% increased rogue knockback + Tooltip: "{$Common.RogueDamage}" } TitanHeartMantle: { DisplayName: Titan Heart Mantle - Tooltip: 5% boosted rogue damage and knockback + Tooltip: "{$Common.RogueDamage} and {1}% increased rogue knockback" } TitanHeartMask: { DisplayName: Titan Heart Mask Tooltip: ''' - 5% increased rogue damage and knockback + {$Common.RogueDamage} and {$Common.RogueVelocity@1} Rogue weapons inflict the Astral Infection debuff ''' SetBonus: ''' - 10% increased rogue damage and 20% increased rogue knockback - +100 maximum stealth - Stealth strikes deal double knockback and cause an astral explosion - Grants immunity to knockback + {$Common.RogueStealth} + Stealth strikes deal {1}x knockback and cause an astral explosion + {$Common.KnockbackImmunity} ''' } @@ -518,17 +494,17 @@ UmbraphileBoots: { DisplayName: Umbraphile Boots Tooltip: ''' - 9% increased rogue damage and 6% increased rogue crit - 20% increased movement speed + {$Common.RogueDamage} and {$Common.RogueCrit@1} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@2} ''' } UmbraphileHood: { DisplayName: Umbraphile Hood - Tooltip: 8% increased rogue damage and 10% increased rogue velocity + Tooltip: "{$Common.RogueDamage} and {$Common.RogueVelocity@1}" SetBonus: ''' - +110 maximum stealth + {$Common.RogueStealth} Rogue weapons have a chance to create explosions on hit Stealth strikes always create an explosion ''' @@ -536,5 +512,5 @@ UmbraphileHood: { UmbraphileRegalia: { DisplayName: Umbraphile Regalia - Tooltip: 10% increased rogue damage and 10% increased rogue crit + Tooltip: "{$Common.RogueDamageCrit}" } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson index 5274bd43a2..161df2c671 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson @@ -225,7 +225,7 @@ BloodflareHeadRanged: { SetBonus: "{$BloodflareHeadRanged.SetBonusEffect}" SetBonusEffect: ''' - Press {0} to unleash the lost souls of polterghast to destroy your enemies + {0} to unleash the lost souls of polterghast to destroy your enemies This effect has a 30 second cooldown Ranged weapons fire bloodsplosion orbs every 2.5 seconds ''' @@ -292,26 +292,22 @@ DemonshadeHelm: { 100% increased summon damage and +10 max minions Shadowbeams and demon scythes will fire down when you are hit A friendly red devil follows you around - Press {0} to enrage nearby enemies with a dark magic spell for 10 seconds + {0} to enrage nearby enemies with a dark magic spell for 10 seconds This makes them take {1}x total damage, but they will deal {2}x damage to you ''' } EmpyreanCloak: { DisplayName: Empyrean Cloak - Tooltip: - ''' - Armor of the cosmos - 7% increased rogue damage and critical strike chance - ''' + Tooltip: "{$Common.RogueDamage} and {$Common.RogueCrit@1}" } EmpyreanCuisses: { DisplayName: Empyrean Cuisses Tooltip: ''' - 5% increased rogue damage and critical strike chance - 15% increased movement speed + {$Common.RogueDamageCrit} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@1} ''' } @@ -319,13 +315,12 @@ EmpyreanMask: { DisplayName: Empyrean Mask Tooltip: ''' - 11% increased rogue damage and critical strike chance - 5% increased movement speed + {$Common.RogueDamage} and {$Common.RogueCrit@1} + {$Common.RogueVelocity@2} ''' SetBonus: ''' - 9% increased rogue damage and velocity - +115 maximum stealth + {$Common.RogueStealth} Rogue projectiles have special effects on enemy hits Imbued with cosmic wrath when you are damaged ''' @@ -505,7 +500,7 @@ OmegaBlueHelmet: { ''' 10% increased damage and critical strike chance and +2 max minions Short-ranged tentacles heal you by sucking enemy life - Press {0} to activate abyssal madness for 5 seconds + {0} to activate abyssal madness for 5 seconds Abyssal madness increases damage and critical strike chance by 10% It also increases tentacle aggression and range, and allows them to critically strike This effect has a 25 second cooldown @@ -544,7 +539,7 @@ PrismaticHelmet: { ''' +40 max mana and 15% reduced mana cost Increased mana regeneration rate - Press {0} to unleash a barrage of death lasers at the cursor for the next 5 seconds + {0} to unleash a barrage of death lasers at the cursor for the next 5 seconds This has a 30 second cooldown ''' } @@ -648,7 +643,7 @@ TarragonHeadMelee: { SetBonusEffect: ''' Taking damage gives the Tarra Life buff, which grants +1.5 HP/s life regen - Press {0} to cloak yourself in life energy that heavily reduces enemy contact damage for 10 seconds + {0} to cloak yourself in life energy that heavily reduces enemy contact damage for 10 seconds This has a 30 second cooldown ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson index 48930db5d6..4cde8ba463 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson @@ -1,6 +1,6 @@ AerospecBreastplate: { DisplayName: Aerospec Breastplate - Tooltip: "{0}% increased damage and critical strike chance" + Tooltip: "{$CommonItemTooltip.PercentIncreasedDamageCritChance}" CommonSetBonus: ''' Taking over {0} damage in one hit will cause a spread of homing feathers to fall @@ -10,91 +10,96 @@ AerospecBreastplate: { AerospecHeadMagic: { DisplayName: Aerospec Hat - Tooltip: "{0}% increased magic damage and +{1} max mana" + Tooltip: + ''' + {$CommonItemTooltip.IncreasesMaxManaBy} + {$CommonItemTooltip.PercentIncreasedMagicDamage@1} + ''' SetBonus: ''' - {0}% reduced mana cost + {$CommonItemTooltip.PercentReducedManaCost} {1}% increased movement speed and magic critical strike chance ''' } AerospecHeadRogue: { DisplayName: Aerospec Headgear - Tooltip: "{0}% increased rogue damage and {1}% increased movement speed" + Tooltip: "{$Common.RogueDamage} and {$CommonItemTooltip.PercentIncreasedMovementSpeed@1}" SetBonus: ''' - {0}% increased movement speed and rogue critical strike chance - +{1} maximum stealth + {$Common.RogueStealth} + {1}% increased movement speed and rogue critical strike chance ''' } AerospecHeadMelee: { DisplayName: Aerospec Helm - Tooltip: "{0}% increased melee damage" + Tooltip: "{$CommonItemTooltip.PercentIncreasedMeleeDamage}" SetBonus: ''' {0}% increased movement speed and melee critical strike chance - Enemies are more likely to target you + {$Common.AggroBoost} ''' } AerospecHeadSummon: { DisplayName: Aerospec Helmet - Tooltip: "{0}% increased summon damage and {1}% increased movement speed" + Tooltip: "{$CommonItemTooltip.PercentIncreasedSummonDamage} and {$CommonItemTooltip.PercentIncreasedMovementSpeed@1}" SetBonus: ''' - {0}% increased summon damage and +{1} max minion + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} Summons a valkyrie to protect you ''' } AerospecHeadRanged: { DisplayName: Aerospec Hood - Tooltip: "{0}% increased ranged damage" + Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedDamage}" SetBonus: "{0}% increased movement speed and ranged critical strike chance" } AerospecLeggings: { DisplayName: Aerospec Leggings - Tooltip: "{0}% increased movement speed" + Tooltip: "{$CommonItemTooltip.PercentIncreasedMovementSpeed}" } DesertProwlerHat: { DisplayName: Desert Prowler Hat - Tooltip: "{0}% increased rogue critical strike chance" + Tooltip: "{$Common.RogueCrit}" SetBonus: ''' - {0}% increased rogue damage - +{1} maximum stealth - ''' - AbilityBrief: Sandsmoke Bomb - Double tap {0} to shroud yourself in a small cloud of sand - AbilityDescription: - ''' - While the sand cloud is active, gain increased mobility but heavily reduced defense - Using a rogue weapon instantly dispels the sand cloak, but guarantees a supercrit for {0}% damage - The super crit applies only as long as the resulting hit wouldn't exceed {1} damage - Landing the killing blow on an enemy with this shot shortens the ability's cooldown to {2} seconds + {$Common.RogueStealth} + [c/{1}:Sandsmoke Bomb - {2} to shroud yourself in a small cloud of sand] + [c/CCB648:While the sand cloud is active, gain increased mobility but heavily reduced defense] + [c/CCB648:Using a rogue weapon instantly dispels the sand cloak, but guarantees a supercrit for {3}% damage] + [c/CCB648:The supercrit applies only as long as the resulting hit wouldn't exceed {4} damage] + [c/CCB648:Landing the killing blow on an enemy with this shot shortens the ability's cooldown to {5} {^5:second;seconds}] ''' } DesertProwlerPants: { DisplayName: Desert Prowler Pants - Tooltip: "{0}% increased movement speed and immunity to the Mighty Wind debuff" + Tooltip: + ''' + {$Common.RogueCrit} + Grants immunity to {$BuffName.WindPushed} + ''' } DesertProwlerShirt: { DisplayName: Desert Prowler Shirt - Tooltip: "{0}% increased rogue critical strike chance" + Tooltip: "{$Common.RogueDamage}" } MarniteArchitectHeadgear: { DisplayName: Marnite Architect Headgear Tooltip: Increases block placement & tool range by {0} - AbilityBrief: Marnite Lift - You can summon a lift under your feet to reach higher up - AbilityDescription: + SetBonus: ''' - The lift gets summoned when the mount hotkey gets pressed [c/D4C870:without any mounts equipped] - Using the {$Key.UP} and {$Key.DOWN} keys can change the lift's height + [c/{0}:Marnite Lift - You can summon a lift under your feet to reach higher up] + [c/91C5EF:The lift gets summoned when the mount hotkey gets pressed] [c/D4C870:without any mounts equipped] + [c/91C5EF:Press {$Key.UP} and {$Key.DOWN} to change the lift's height, reaching up to {1} tiles above ground] ''' } @@ -105,28 +110,27 @@ MarniteArchitectToga: { SnowRuffianChestplate: { DisplayName: Snow Ruffian Chestplate - Tooltip: "{0}% increased ranged critical strike chance" + Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedCritChance}" } SnowRuffianGreaves: { DisplayName: Snow Ruffian Greaves - Tooltip: "{0}% increased movement speed" + Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedCritChance}" } SnowRuffianMask: { DisplayName: Snow Ruffian Mask - Tooltip: "{0}% increased ranged damage" + Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedCritChance}" SetBonus: ''' - {0}% increased ranged damage and critical strike chance You can glide to negate fall damage - Ranged critical strikes frostburn enemies + Ranged critical strikes frostburn enemies for {0} {^0:second;seconds} ''' } StatigelArmor: { DisplayName: Statigel Armor - Tooltip: "{0}% increased critical strike chance" + Tooltip: "{$CommonItemTooltip.PercentIncreasedCritChance}" CommonSetBonus: ''' When you take over {0} damage in one hit you become immune to damage for an extended period of time @@ -144,8 +148,8 @@ StatigelHeadMagic: { DisplayName: Statigel Cap Tooltip: ''' - {0}% increased magic damage and {1}% reduced mana cost - {2}% increased magic critical strike chance and +{3} max mana + {$CommonItemTooltip.IncreasesMaxManaBy} and {$CommonItemTooltip.PercentReducedManaCost@1} + {$CommonItemTooltip.PercentIncreasedMagicDamage@2} and {$CommonItemTooltip.PercentIncreasedMagicCritChance@3} ''' } @@ -154,17 +158,17 @@ StatigelHeadMelee: { Tooltip: ''' {0}% increased melee damage and melee speed - {1}% increased melee critical strike chance + {$CommonItemTooltip.PercentIncreasedMeleeCritChance@1} ''' - SetBonus: Enemies are more likely to target you + SetBonus: "{$Common.AggroBoost}" } StatigelHeadRanged: { DisplayName: Statigel Headgear Tooltip: ''' - {0}% increased ranged damage - {1}% increased ranged critical strike chance + {$CommonItemTooltip.PercentIncreasedRangedDamage} + {$CommonItemTooltip.PercentIncreasedRangedCritChance@1} ''' } @@ -172,10 +176,10 @@ StatigelHeadRogue: { DisplayName: Statigel Mask Tooltip: ''' - {0}% increased rogue damage - {1}% increased rogue critical strike chance and {2}% increased movement speed + {$Common.RogueDamage} + {$Common.RogueCrit@1} and {$CommonItemTooltip.PercentIncreasedMovementSpeed@2} ''' - SetBonus: +{0} maximum stealth + SetBonus: "{$Common.RogueStealth}" } StatigelHeadSummon: { @@ -183,106 +187,94 @@ StatigelHeadSummon: { Tooltip: Increased minion knockback SetBonus: ''' - {0}% increased summon damage and +{1} max minion + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} Summons a mini paladin to fight for you, the type depends on what world evil you have ''' } SulphurousBreastplate: { DisplayName: Sulphurous Breastplate - Tooltip: "{0}% increased rogue damage and {1}% increased rogue critical strike chance" + Tooltip: "{$Common.RogueDamage}" } SulphurousHelmet: { DisplayName: Sulphurous Helmet Tooltip: ''' - {0}% increased rogue damage - {1}% increased rogue critical strike chance + {$Common.RogueCrit} Grants underwater breathing ''' SetBonus: ''' - +{0} maximum stealth - Attacking and being attacked by enemies inflicts poison + {$Common.RogueStealth} + Attacking and being attacked by enemies inflicts poison for {1} {^1:second;seconds} Grants an additional jump that summons a sulphurous bubble - Provides increased underwater mobility and reduces the severity of the sulphuric waters + Reduces the severity of the sulphuric waters ''' } SulphurousLeggings: { DisplayName: Sulphurous Leggings - Tooltip: - ''' - Movement speed increased by {0}% - Movement speed increased an additional {1}% while submerged in liquid - ''' + Tooltip: "{$Common.RogueDamage}" } VictideBreastplate: { DisplayName: Victide Breastplate - Tooltip: - ''' - 5% increased damage reduction and critical strike chance - +5 defense and 10% increased damage reduction while submerged in liquid - ''' - CommonSetBonus: - ''' - When using any weapon you have a 10% chance to throw a returning seashell projectile - This seashell does true damage and does not benefit from any damage class - Provides increased underwater mobility and slightly reduces breath loss in the abyss - ''' + Tooltip: +{0} HP/s life regen } VictideGreaves: { DisplayName: Victide Greaves + Tooltip: "{$CommonItemTooltip.PercentIncreasedMovementSpeed}" +} + +VictideHeadBarrier: { + DisplayName: Victide Hermit Helmet Tooltip: ''' - Movement speed increased by 8% - Movement speed increased by 30% while submerged in liquid + +{0} HP/s life regen + Increases movement acceleration and deceleration by {1}x ''' -} - -VictideHeadMagic: { - DisplayName: Victide Hermit Helmet - Tooltip: 5% increased magic damage - SetBonus: +1.5 HP/s life regen and 10% increased magic damage while submerged in liquid -} - -VictideHeadMelee: { - DisplayName: Victide Shellmet - Tooltip: 5% increased melee damage SetBonus: ''' - Enemies are more likely to target you - +1.5 HP/s life regen and 10% increased melee damage while submerged in liquid + [c/{0}:Warding Wave - Forms a tidal barrier which can be exploded to launch you] + [c/A2D6FF:The barrier grants {1} defense and gradually heals back {2}% of taken damage] + [c/A2D6FF:{3} to disperse it for {4} {^4:second;seconds} and propel you in the direction of the cursor] + [c/A2D6FF:The resulting dash can slam through and damage enemies] ''' } -VictideHeadRanged: { - DisplayName: Victide Coral Turban - Tooltip: 5% increased ranged damage - SetBonus: +1.5 HP/s life regen and 10% increased ranged damage while submerged in liquid -} - -VictideHeadRogue: { +VictideHeadBurrow: { DisplayName: Victide Headcrab - Tooltip: 5% increased rogue damage + Tooltip: + ''' + {0}% increased movement speed and acceleration + Grants underwater breathing and slightly reduces breath loss in the abyss + ''' SetBonus: ''' - +60 maximum stealth - +1.5 HP/s life regen and 10% increased rogue damage while submerged in liquid + Allows quick travel in water + [c/{0}:Bubbly Burrow - {1} to transform into an agile water spirit for a short time] + [c/A2D6FF:The spirit can be controlled through movement keys and can traverse through tiles] + [c/A2D6FF:While in spirit form, you are impervious to most damage but unable to use items] + [c/A2D6FF:This effect lasts {2} {^2:second;seconds} and has a cooldown of {3} {^3:second;seconds}] ''' } -VictideHeadSummon: { +VictideHeadSnail: { DisplayName: Victide Mask - Tooltip: 10% increased summon damage + Tooltip: + ''' + {$CommonItemTooltip.IncreasesFishingPowerBy} + {$Common.AggroReduction} + ''' SetBonus: ''' - +1 max minion - Summons a sea snail to protect you - +1.5 HP/s life regen and 10% increased summon damage while submerged in liquid + Increases pickup range for items + [c/{0}:Helper Angler - Summons a sea snail to fish alongside you] + [c/A2D6FF:It automatically casts and reels as you are standing still and fishing] + [c/A2D6FF:Equipped fishing abilities and stats are inherited from its owner] ''' } @@ -300,25 +292,24 @@ WulfrumHat: { DisplayName: Wulfrum Hat & Goggles Tooltip: ''' - {0}% increased summon damage + {$CommonItemTooltip.PercentIncreasedSummonDamage} Comes equipped with hair extensions ''' - SetBonus: +{0} max minion - AbilityBrief: Wulfrum Bastion - Double tap {0} while dismounted to equip wulfrum power armor - AbilityDescription: + SetBonus: ''' - While the armor is active, you can only use the integrated fusion cannon, but your defensive stats are increased - Calling down the armor consumes one piece of {0}, and the armor will lose durability faster when hit + [c/{0}:Wulfrum Bastion - {1} to equip a power armor, costing one] [i:CalamityMod/WulfrumMetalScrap] [c/{0}:{$Items.Materials.WulfrumMetalScrap.DisplayName}] + [c/6EC05D:While active, you can only use the integrated fusion cannon, but your defensive stats are increased] + [c/6EC05D:The armor lasts up to {2} {^2:second;seconds}, but each hit loses {3} {^3:second;seconds} of duration] + [c/BEBEBE:Hold Shift to see the stats of the fusion cannon] ''' - ShiftToExpand: Hold Shift to see the stats of the fusion cannon } WulfrumJacket: { DisplayName: Wulfrum Jacket - Tooltip: "{0}% increased summon damage" + Tooltip: "{$CommonItemTooltip.IncreasesMaxMinionsBy}" } WulfrumOveralls: { DisplayName: Wulfrum Overalls - Tooltip: "{0}% increased movement speed" + Tooltip: "{$CommonItemTooltip.PercentIncreasedSummonDamage}" } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.Vanity.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.Vanity.hjson index dbcac168c2..2c7fff7f7e 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.Vanity.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.Vanity.hjson @@ -58,7 +58,7 @@ AstrumDeusMask: { Tooltip: "" } -BrimstoneWaifuMask: { +BrimstoneElementalMask: { DisplayName: Brimstone Elemental Mask Tooltip: "" } @@ -268,6 +268,16 @@ TheGrandGarment: { Tooltip: Part of The High-Flying Finery } +VictideCoralTurban: { + DisplayName: Victide Coral Turban + Tooltip: "" +} + +VictideShellmet: { + DisplayName: Victide Shellmet + Tooltip: "" +} + YharonMask: { DisplayName: Yharon Mask Tooltip: "" diff --git a/Localization/en-US/Mods.CalamityMod.Items.Debug.hjson b/Localization/en-US/Mods.CalamityMod.Items.Debug.hjson new file mode 100644 index 0000000000..3e4013eca5 --- /dev/null +++ b/Localization/en-US/Mods.CalamityMod.Items.Debug.hjson @@ -0,0 +1,4 @@ +DialogueDisplayDebugItem: { + DisplayName: Dialogue Display Debug Item + Tooltip: "" +} diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index 4921599425..c70ba5a81b 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -4623,3 +4623,28 @@ MiniAgedFloodlightItem: { DisplayName: Mini Aged Floodlight Tooltip: "" } + +AridSoil: { + DisplayName: Arid Soil + Tooltip: "" +} + +RunestoneTerracotta: { + DisplayName: Runestone Terracotta + Tooltip: "" +} + +ShellTrimBrick: { + DisplayName: Shell Trim Brick + Tooltip: "" +} + +ShellTrimBrickWall: { + DisplayName: Shell Trim Brick Wall + Tooltip: "" +} + +BasaltSlab: { + DisplayName: Basalt Slab + Tooltip: "" +} diff --git a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson index ad00243c80..3b2b45c9a7 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson @@ -14,7 +14,6 @@ AstralChunk: { Tooltip: ''' Summons Astrum Aureus when used in the Astral Infection - Enrages during the day while outside the Astral Infection {$Common.NotConsumable} 'The Infection's fortress has found another target.' ''' @@ -34,7 +33,7 @@ BloodyWormFood: { Tooltip: ''' Summons the Perforator Hive when used in the Crimson - Enrages outside the Underground Crimson + Despawns outside the Crimson {$Common.NotConsumable} 'Do not play with your food, they won't play with theirs.' ''' @@ -42,11 +41,7 @@ BloodyWormFood: { CausticTear: { DisplayName: Caustic Tear - Tooltip: - ''' - Causes an acidic downpour in the Sulphurous Sea - {$Common.NotConsumable} - ''' + Tooltip: Causes an acidic downpour in the Sulphurous Sea } CeremonialUrn: { @@ -86,7 +81,6 @@ CryoKey: { Tooltip: ''' [SPAWN] - Enrages outside the tundra {$Common.NotConsumable} 'A key for a glacial prison.' ''' @@ -108,8 +102,7 @@ DecapoditaSprout: { DisplayName: Decapodita Sprout Tooltip: ''' - Summons Crabulon when used in the Mushroom biome - Enrages outside the Underground Mushroom biome + Summons Crabulon when used in the Underground Mushroom biome {$Common.NotConsumable} 'Bristling with the spores of a unique, parasitic strain.' ''' @@ -152,8 +145,7 @@ EyeofDesolation: { // The GFB tag generates a new line below when placed at the end of a line Tooltip: ''' - Summons the Calamitas Clone when used during nighttime[GFB] - Enrages during the day + Summons the Calamitas Clone[GFB] {$Common.NotConsumable} 'She is here.' ''' @@ -184,7 +176,7 @@ MarkofProvidence: { SpawnVoid: ''' Summons the Ceaseless Void - Enrages on the surface + Despawns on the surface ''' SpawnSignus: Summons Signus, Envoy of the Devourer SpawnWeaver: Summons the Storm Weaver @@ -192,11 +184,7 @@ MarkofProvidence: { MartianDistressRemote: { DisplayName: Martian Distress Remote - Tooltip: - ''' - Summons the Martian Madness - {$Common.NotConsumable} - ''' + Tooltip: Summons the Martian Madness } NecroplasmicBeacon: { @@ -204,6 +192,7 @@ NecroplasmicBeacon: { Tooltip: ''' Summons Polterghast when used in the Dungeon + Despawns on the surface {$Common.NotConsumable} 'The wails of the spirits disturbed something far more terrifying.' ''' @@ -280,7 +269,6 @@ Starcore: { Tooltip: ''' Summons Astrum Deus at the Astral Beacon, but is not consumed - Enrages during the day 'May the stars guide your way' ''' } @@ -290,7 +278,7 @@ Teratoma: { Tooltip: ''' Summons the Hive Mind when used in the Corruption - Enrages outside the Underground Corruption + Despawns outside the Corruption {$Common.NotConsumable} 'An exquisitely hideous tumor for those diseased in the head.' ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson index 1083e38f93..c558c21085 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson @@ -52,6 +52,17 @@ AxeofPurity: { ''' } +Bakidon: { + DisplayName: Bakidon + Tooltip: + ''' + A lost artifact said to pin the heavens in place + to freeze the passage of day and night temporarily + This does not work during celestial anomalies + The time freeze recharges while not in use + ''' +} + BeastialPickaxe: { DisplayName: Beastial Pickaxe Tooltip: "" @@ -80,8 +91,10 @@ Cosmolight: { DisplayName: Cosmolight Tooltip: ''' - Advances time immediately to the next dawn, noon, dusk or midnight - Does not work while a boss is alive + A lost artifact freshly rekindled by exposure to raw cosmic energies + Hold to drastically accelerate the passage of day and night + to freeze the passage of day and night indefinitely + The time freeze lasts forever and works during celestial anomalies ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.TreasureBags.hjson b/Localization/en-US/Mods.CalamityMod.Items.TreasureBags.hjson index 4dab8cfc05..fc0cf2f1ac 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.TreasureBags.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.TreasureBags.hjson @@ -14,7 +14,7 @@ AstrumDeusBag: { Tooltip: "{$CommonItemTooltip.RightClickToOpen}" } -BrimstoneWaifuBag: { +BrimstoneElementalBag: { DisplayName: Treasure Bag (Brimstone Elemental) Tooltip: "{$CommonItemTooltip.RightClickToOpen}" } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index eefde30e9b..12dfdc08ba 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -488,11 +488,7 @@ ExaltedOathblade: { Excelsus: { DisplayName: Excelsus - Tooltip: - ''' - Fires a spread of spinning blades - Summons laser fountains on hit - ''' + Tooltip: Fires a spread of spinning blades } Exoblade: { @@ -644,7 +640,14 @@ GeliticBlade: { GildedProboscis: { DisplayName: Gilded Proboscis - Tooltip: Heals the player on hit + Tooltip: + ''' + Steals life proportional to the damage dealt to foes + to charge up a precise thrust + The thrust begins weak, but becomes more powerful the longer it's held + to dash forward with a mighty upstrike + The distance you dash depends on if you are moving with or against the dash + ''' } GoldplumeSpear: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson index bca33b7c0a..8a2e932bfb 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson @@ -662,7 +662,7 @@ SarosPossession: { Summons a radiant aura that gives absolute control of light itself The aura will annihilate enemies with orbs of radiance There can only be one aura at a time - Requires 8 minion slots + Requires 6 minion slots ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Misc.hjson index 6ca2aa511e..9e19bfe3cc 100644 --- a/Localization/en-US/Mods.CalamityMod.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Misc.hjson @@ -118,8 +118,6 @@ SwineSecret37: Let me know when it's 7 PM, I've got to tweak something before so SwineSecret38: Thank Xeroc I don't have any of that 'Pathfinding' garbage, whatever the hell that is. SwineSecret39: If you think the Sulphur Sea smells bad, just wait til' you're near a nohitter! SwineSecret40: Did you know there's 40 of these damn things? -// Point Blank -PointBlank: Does extra damage to enemies shot at point-blank range // Charge Charge: Current Charge: {0}% //GFB Rogue Keys diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson index b68715df12..d633004aa0 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson @@ -64,6 +64,8 @@ FlareDust.DisplayName: Flare Dust FlareDust2.DisplayName: Flare Bomb Flarenado.DisplayName: Flarenado FrostMist.DisplayName: Frost Mist +GolemInfernoBolt.DisplayName: Golem Fire Bolt +GolemInfernoBlast.DisplayName: Golem Fire Blast GooglyEye.DisplayName: Googly Eye GreatSandBlast.DisplayName: Great Sand Blast HellfireExplosion.DisplayName: Brimstone Hellfire Explosion diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index 53e09e1f92..cf9b90ba21 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -156,7 +156,6 @@ IllustriousKnife.DisplayName: Illustrious Knife InsidiousHarpoon.DisplayName: Insidious Harpoon JudgementProj.DisplayName: JUDGEMENT LamentationsOfTheChained.DisplayName: Lamentations of the Chained -LaserFountain.DisplayName: Laser Fountain LifeScythe.DisplayName: Lifehunt Scythe LightBeam.DisplayName: Light Beam LightningThing.DisplayName: Lightning @@ -306,3 +305,4 @@ MutilatorSwordProj.DisplayName: The Mutilator MirrorBladeProjectile.DisplayName: Mirror Blade MirrorBladeSlash.DisplayName: Mirror Blade Slash MirrorBladeSlashCreator.DisplayName: Mirror Blade Slash Creator +GildedProboscisProj.DisplayName: Gilded Proboscis diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson index 652d0084ee..dff876c6d5 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson @@ -38,7 +38,6 @@ CelestialReaperProjectile.DisplayName: Celestial Reaper CelestusMiniScythe.DisplayName: Celestus CelestusProj.DisplayName: Celestus CinquedeaProj.DisplayName: Cinquedea -CircletMark.DisplayName: Tornado Mark CircletTornado.DisplayName: Tornado CobaltEnergy.DisplayName: Cobalt Energy CobaltKunaiProjectile.DisplayName: Cobalt Kunai diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson index 3be6965766..0df5dd6778 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson @@ -59,7 +59,7 @@ CausticStaffSummon.DisplayName: Caustic Dragon CelestialAxeMinion.DisplayName: Celestial Axe Cinder.DisplayName: Cinder CinderBlossom.DisplayName: Cinder Blossom -CloudElementalMinion.DisplayName: Cloudy Waifu +CloudElementalMinion.DisplayName: Cloud Elemental CnidarianJellyfishOnTheString.DisplayName: Cnidarian CnidarianSpark.DisplayName: Cnidarian Spark CorroslimeMinion.DisplayName: Corroslime @@ -307,9 +307,7 @@ MagicUmbrella.DisplayName: Cyan Umbrella UniverseSplitterField.DisplayName: Field UniverseSplitterHugeBeam.DisplayName: Universe Splitter Ray UniverseSplitterSmallBeam.DisplayName: Universe Splitter Ray -UrchinSpike.DisplayName: Urchin Spike Valkyrie.DisplayName: Valkyrie -VictideSeaSnail.DisplayName: Sea Snail VileFeederProjectile.DisplayName: Eater of Souls Mini VileFeederSummon.DisplayName: Baby Eater ViridVanguardBlade.DisplayName: Vanguard Blade diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson index b13780d0a6..27ff772d95 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -110,7 +110,6 @@ ProtolithBangleProjectile.DisplayName: Marble Shatter PscTransformAnimation.DisplayName: Psc Transform Animation PscTransformRocks.DisplayName: Psc Transform Rocks PuddleSplash.DisplayName: Puddle Splash -ReaverOrb.DisplayName: Reaver Orb ReaverThornBase.DisplayName: Thorn RedLabSeeker.DisplayName: Seeking Mechanism RelicGuard.DisplayName: Relic Guard @@ -146,6 +145,10 @@ TransformerAura.DisplayName: Transformer Aura TransformerBlob.DisplayName: Transformer Shard UrsaSlash.DisplayName: Ursa Slash VerstaltiteBobber.DisplayName: Verstaltite Bobber +VictideBarrier.DisplayName: Tidal Barrier +VictideBobber.DisplayName: Snail Bobber +VictideSeaSnail.DisplayName: Sea Snail +VictideSpirit.DisplayName: Bubbly Spirit VoidFieldGenerator.DisplayName: Void Field Generator WarbannerDamage.DisplayName: The Unmatched Power of the Sun WarbannerLight.DisplayName: Warbanner Light diff --git a/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson b/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson index 7fda7a31b1..5b5cae9452 100644 --- a/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson +++ b/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson @@ -13,8 +13,6 @@ SandSharkText2: An enormous apex predator approaches... // Plaguebringer Goliath PlagueBossText: PLAGUE NUKE BARRAGE ARMED, PREPARING FOR LAUNCH!!! PlagueBossText2: MISSILES LAUNCHED, TARGETING ROUTINE INITIATED!!! -// Astrum Deus -DeusAltarRejectNightText: The god of the stars rejects your offering. The ritual can only be performed at night. // Providence ProfanedBossText: Holy flames burn away at your wings... // Polterghast diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index 2a0d44bc1a..03539e1b76 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -98,6 +98,8 @@ Cooldowns: { BloodflareFrenzy: Blood Frenzy Cooldown BloodflareRangedSet: Bloodflare Soul Cooldown BrimflameFrenzy: Brimflame Frenzy Cooldown + BubblyBurrowActive: Bubbly Burrow + BubblyBurrowCooldown: Bubbly Burrow Cooldown ChaosState: Teleportation Cooldown DivineBless: Divine Bless Cooldown DivingPlatesBreaking: Abyssal Diving Suit Plates Durability @@ -146,6 +148,7 @@ Cooldowns: { TarragonImmunity: Tarragon Immunity Cooldown UniverseSplitter: Universe Splitter Cooldown WarbanneroftheRighteousBuff: Warbanner Strength + WardingWave: Warding Wave Cooldown WulfrumBastionActive: Power Armor Durability WulfrumBastionCooldown: Wulfrum Bastion Cooldown WulfrumRoverDriveDurability: Protective Matrix Durability @@ -220,13 +223,13 @@ Communication: { Inquiry: Your Origins Response: ''' - My first memories are that of awakening in a distant laboratory on the date of 11.19.1227, well over six centuries ago. Surrounded by nothing but a vast taiga, I was accompanied by only one other thing: a dead organic.\n + My first memories are that of awakening in a distant laboratory on the date of 1227-11-19, well over six centuries ago. Surrounded by nothing but a vast taiga, I was accompanied by only one other thing: a dead organic.\n Presumably, I was created by what I assume to be the laboratory's former inhabitant, though I am unsure how they accomplished such a feat. From what I gathered, they were quite the prestigious inventor, not unlike I. Several gadgets assumedly of their own making were attached to their body, and the equipment in the lab was more advanced than any I found elsewhere in the world.\n I have no recollection of events prior to my activation, but from the start, I knew what my goal was: creation and scientific advancement. Many years were spent optimizing and building upon both the laboratory and myself to assure constant progress.\n - At the date of 7.30.1385, expansion of the laboratory became impractical. Thus, I chose to instead expand my horizons. I sent hundreds of remotely-piloted scoutbots to thoroughly survey the continent, ignorant of the attention such an endeavor would draw when not properly prepared.\n + At the date of 1385-07-30, expansion of the laboratory became impractical. Thus, I chose to instead expand my horizons. I sent hundreds of remotely-piloted scoutbots to thoroughly survey the continent, ignorant of the attention such an endeavor would draw when not properly prepared.\n In the following years, legends and rumors began to spread in nearby cities. Many spoke of encounters with roaming creatures made not of flesh and blood, but steel and oil. Scholars attempted to study my machines. Some explorers even followed my creations back to one of my several recon bodies.\n @@ -238,7 +241,7 @@ Communication: { Inquiry: Role in the Crusade Response: ''' - While the Crusade is widely considered to have begun on the date of 6.19.1781 with Yharon's rebirth, I took no part in it until 4.23.1803. Upon joining, I was chosen to lead the science and engineering divisions. While I was given freedom over which projects I chose and how I pursued them, it was expected that anything I made would be beneficial to the war effort.\n + While the Crusade is widely considered to have begun on the date of 1781-06-19 with Yharon's rebirth, I took no part in it until 1803-04-23. Upon joining, I was chosen to lead the science and engineering divisions. While I was given freedom over which projects I chose and how I pursued them, it was expected that anything I made would be beneficial to the war effort.\n Boosting the efficiency of mining operations was my first major contribution to Yharim's campaign, being essential to any further development. I learned how to mass produce the first generation of Excavators to expand mining operations outside of Azafure, and then used similar mass-producible technology to create arms and armaments that far outclassed our enemies'. Many simply dubbed this equipment "The Arsenal".\n diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson index 355cc01366..30f140caee 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson @@ -49,7 +49,7 @@ SetBonus: { ''' Forbidden: ''' - {$LegacyTooltip.48} {$ArmorSetBonus.Forbidden} + {$LegacyTooltip.48} {0} to call an ancient storm to the cursor location Minions no longer deal less damage while wielding magic weapons ''' Frost: @@ -126,6 +126,11 @@ SetBonus: { Tin: "{0}% increased critical strike chance" Tungsten: Grappling hooks pull and retract {0}% faster MagicHat: Increases maximum mana by 40 + Vortex: + ''' + {$LegacyTooltip.48} {0} to toggle stealth, + increasing ranged ability and reducing chance for enemies to target you but slowing movement speed + ''' Wizard: 4% increased magic critical strike chance CrystalAssassin: ''' diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index 4bf03df40e..6ee2e522b3 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -1,3 +1,4 @@ +DashKey: Press {0} while facing a direction DodgeInfo: ''' Grants the ability to dodge attacks @@ -49,9 +50,6 @@ AddedTooltip: { Nearby fairies grant +2 HP/s life regen, 6 defense and 10% movement speed Fairies are immune to damage and will no longer flee ''' - MoonStone: Reduces the damage of the Nightwither debuff - SunStone: Reduces the damage of the Daybroken debuff - CelestialStone: Reduces the damage of the Nightwither and Daybroken debuffs ArcaneFlower: 5% increased magic damage RifleScope: The scope effect can be toggled with visibility FeatherfallPotion: Disables all airborne flight recovery @@ -76,7 +74,7 @@ EditedTooltip: { BloodySpine: ''' Summons the Brain of Cthulhu when used in the Crimson - Enrages outside the Underground Crimson + Despawns outside the Crimson ''' ClothierVoodooDoll: ''' @@ -95,31 +93,19 @@ EditedTooltip: { Summons the Golem when used at the Lihzahrd Altar Enrages outside the Jungle Temple ''' - MechanicalEye: - ''' - Summons The Twins when used during nighttime - Enrages during the day - ''' + MechanicalEye: Summons The Twins when used during nighttime MechanicalSkull: ''' Summons Skeletron Prime when used during nighttime Enrages during the day ''' - MechanicalWorm: - ''' - Summons The Destroyer when used during nighttime - Enrages during the day - ''' + MechanicalWorm: Summons The Destroyer when used during nighttime QueenSlimeCrystal: Summons Queen Slime when used in the Hallow - SuspiciousLookingEye: - ''' - Summons the Eye of Cthulhu when used during nighttime - Enrages during the day - ''' + SuspiciousLookingEye: Summons the Eye of Cthulhu when used during nighttime WormFood: ''' Summons the Eater of Worlds when used in the Corruption - Enrages outside the Underground Corruption + Despawns outside the Corruption ''' MasterExclusive: Master or Revengeance // Sparkle Slime Balloon @@ -147,7 +133,6 @@ EditedTooltip: { // Arcane Crystal AegisCrystal: Permanently boosts natural life regeneration ArcheryPotion: 20% increased arrow speed and 5% increased arrow damage - IronskinPotion: Increase defense by {0} // Aerial Bane DD2BetsyBow: Shoots a tight spread of 6 splitting arrows AleSake: @@ -181,7 +166,6 @@ EditedTooltip: { MagicQuiver: Increases arrow damage by 5% and greatly increases arrow speed MoltenQuiver1: Increases arrow damage by 7% and greatly increases arrow speed MoltenQuiver2: Lights wooden arrows ablaze and all arrows inflict Hellfire - MagicPowerPotion: 10% increased magic damage MagicHat: 6% increased magic critical strike chance PowerGlove: 10% increased melee speed, does not stack with downgrades BerserkerGlove: 10% increased true melee damage diff --git a/MainMenu/CalamityMainMenu_Sunken.cs b/MainMenu/CalamityMainMenu_Sunken.cs index 984ae491b6..9df3a95724 100644 --- a/MainMenu/CalamityMainMenu_Sunken.cs +++ b/MainMenu/CalamityMainMenu_Sunken.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; +using CalamityMod.Effects; using CalamityMod.Systems; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -74,6 +75,15 @@ namespace CalamityMod.MainMenu public static List Fishes { get; private set; } = []; public static Asset LogoWater => ModContent.Request("CalamityMod/MainMenu/LogoSunken_Water"); + + public static Asset LogoWaterFill => ModContent.Request("CalamityMod/MainMenu/LogoSunken_Water_Fill"); + + public static Asset Perlin => ModContent.Request("CalamityMod/MainMenu/Perlin"); + + public static Asset WorleyInverted => ModContent.Request("CalamityMod/MainMenu/WorleyInverted"); + + private static RenderTarget2D logoWaterFillTarget; + private static RenderTarget2D logoTarget; public int MaxBoids = 120; @@ -96,6 +106,20 @@ namespace CalamityMod.MainMenu public override ModSurfaceBackgroundStyle MenuBackgroundStyle => ModContent.GetInstance(); + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + + LogoWaterFill.Wait(); + Logo.Wait(); + + Main.QueueMainThreadAction(() => + { + logoWaterFillTarget = new RenderTarget2D(Main.instance.GraphicsDevice, LogoWaterFill.Width(), LogoWaterFill.Height()); + logoTarget = new RenderTarget2D(Main.instance.GraphicsDevice, Logo.Width(), Logo.Height()); + }); + } + public static void ForceMenuStyle() { // Forcefully open this ModMenu if it's the player's first time opening the Sunken Sea Overhaul update. @@ -122,6 +146,8 @@ namespace CalamityMod.MainMenu public override bool PreDrawLogo(SpriteBatch spriteBatch, ref Vector2 logoDrawCenter, ref float logoRotation, ref float logoScale, ref Color drawColor) { + DrawLogoWaterShader(spriteBatch); + // Draw the main background for the menu. DrawMenuBackground(spriteBatch); @@ -140,6 +166,47 @@ namespace CalamityMod.MainMenu return false; } + private static void DrawLogoWaterShader(SpriteBatch sb) + { + sb.End(); + + Main.instance.GraphicsDevice.SetRenderTarget(logoWaterFillTarget); + Main.instance.GraphicsDevice.Clear(Color.Transparent); + + sb.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, Matrix.Identity); + + var fillShader = CalamityShaders.SunkenSeaMenuLogoWater.Value; + fillShader.Parameters["uImageSize"]?.SetValue(LogoWaterFill.Size()); + fillShader.Parameters["uTexture0"]?.SetValue(WorleyInverted.Value); + fillShader.Parameters["uBubbleTexture"]?.SetValue(Perlin.Value); + //fillShader.Parameters["uFillAmount"]?.SetValue(0.75f + (MathF.Sin(Main.GlobalTimeWrappedHourly) / 2f) * 0.25f); + fillShader.Parameters["uFillAmount"]?.SetValue(0.75f); + fillShader.Parameters["uWaveStrength"]?.SetValue(2.5f); + fillShader.Parameters["uWaveOffset"]?.SetValue(0.6f); + fillShader.Parameters["uSubtract"]?.SetValue(0.4f); + fillShader.Parameters["uTime"]?.SetValue(Main.GlobalTimeWrappedHourly); + fillShader.Parameters["uFillColor"]?.SetValue(new Color(67, 187, 204, 255 / 2).ToVector4() * 0.7f); + fillShader.Parameters["uEdgeColor"]?.SetValue(new Color(16, 99, 112, 255 / 2).ToVector4() * 0.7f); + fillShader.Parameters["uLineColor"]?.SetValue(new Color(179, 255, 255, 255 / 2).ToVector4() * 0.7f); + fillShader.CurrentTechnique.Passes[0].Apply(); + + sb.Draw(LogoWaterFill.Value, Vector2.Zero, Color.White); + + sb.End(); + + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + + Main.instance.GraphicsDevice.SetRenderTarget(logoTarget); + Main.instance.GraphicsDevice.Clear(Color.Transparent); + sb.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, Matrix.Identity); + + sb.Draw(logoWaterFillTarget, new Vector2(406, 48), Color.White); + + sb.End(); + Main.instance.GraphicsDevice.SetRenderTarget(null); + sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, Main.UIScaleMatrix); + } + private void DrawMenuBackground(SpriteBatch spriteBatch) { Texture2D backgroundTexture = ModContent.Request("CalamityMod/MainMenu/SunkenMenuBackground").Value; @@ -239,6 +306,7 @@ namespace CalamityMod.MainMenu Vector2 drawPos = new Vector2(Main.screenWidth / 2f, 100f); spriteBatch.End(); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.UIScaleMatrix); + spriteBatch.Draw(logoTarget, drawPos, null, drawColor, rotationSecretSeedAdjusted, logoTarget.Size() * 0.5f, WorldGen.drunkWorldGen ? logoScale : 1f, SpriteEffects.None, 0f); spriteBatch.Draw(Logo.Value, drawPos, null, drawColor, rotationSecretSeedAdjusted, Logo.Value.Size() * 0.5f, WorldGen.drunkWorldGen ? logoScale : 1f, SpriteEffects.None, 0f); spriteBatch.Draw(LogoWater.Value, drawPos, null, new Color(255, 255, 255, 0.5f) * 0.7f, rotationSecretSeedAdjusted, Logo.Value.Size() * 0.5f, WorldGen.drunkWorldGen ? logoScale : 1f, SpriteEffects.None, 0f); spriteBatch.End(); diff --git a/MainMenu/LogoSunken_Water.png b/MainMenu/LogoSunken_Water.png index 670fffe66b..12c60ac53f 100644 Binary files a/MainMenu/LogoSunken_Water.png and b/MainMenu/LogoSunken_Water.png differ diff --git a/MainMenu/LogoSunken_Water_Fill.png b/MainMenu/LogoSunken_Water_Fill.png new file mode 100644 index 0000000000..e3a57cf193 Binary files /dev/null and b/MainMenu/LogoSunken_Water_Fill.png differ diff --git a/MainMenu/Perlin.png b/MainMenu/Perlin.png new file mode 100644 index 0000000000..45b02c6b29 Binary files /dev/null and b/MainMenu/Perlin.png differ diff --git a/MainMenu/WorleyInverted.png b/MainMenu/WorleyInverted.png new file mode 100644 index 0000000000..48b63f46aa Binary files /dev/null and b/MainMenu/WorleyInverted.png differ diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index ebf1420994..9d2985bac3 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -866,86 +866,48 @@ namespace CalamityMod public static bool DisableAllDodges(bool disable) => Main.LocalPlayer.Calamity().disableAllDodges = disable; #endregion - #region Can Fire Point Blank Shots - /// - /// Gets whether the given item can fire point blank shots. - /// - /// The item which is being checked. - /// Whether the item can fire point blank shots. - public static bool CanFirePointBlank(Item it) - { - if (it is null || it.Calamity() is null) - return false; - CalamityGlobalItem cgi = it.Calamity(); - return cgi.canFirePointBlankShots; - } - - /// - /// Sets whether the given item can fire point blank shots. - /// - /// The item whose point blank capabilities is being toggled. - /// The value to apply. - /// Whether the item can fire point blank shots. - public static bool SetFirePointBlank(Item it, bool enabled) - { - if (it is null || it.Calamity() is null) - return false; - CalamityGlobalItem cgi = it.Calamity(); - cgi.canFirePointBlankShots = enabled; - return cgi.canFirePointBlankShots; - } - - // Set a projectile's point blank duration - public static void SetPointBlankDuration(Projectile projectile, int duration) - { - if (projectile != null) - projectile.Calamity().pointBlankShotDuration = duration; - } - - // Gets a projectile's current point blank duration - public static int GetPointBlankDuration(Projectile projectile) => projectile?.Calamity()?.pointBlankShotDuration ?? 0; - #endregion - #region Amalgam Potion Buff List public static bool SetAmalgamBuffList(int type, bool shouldBeListed) { - if (shouldBeListed && !AmalgamBuffList.Includes(type)) + if (shouldBeListed && !CalamityBuffSets.BuffedByAmalgam[type]) { - AmalgamBuffList.List.Add(type); + CalamityBuffSets.BuffedByAmalgam[type] = true; return true; } else if (!shouldBeListed) { - return AmalgamBuffList.List.Remove(type); + CalamityBuffSets.BuffedByAmalgam[type] = false; + return false; } return false; } public static bool SetPersistentBuffList(int type, bool isPersistent) { - if (isPersistent && !PersistentBuffList.Includes(type)) + if (isPersistent && !CalamityBuffSets.IsPersistentBuff[type]) { - PersistentBuffList.List.Add(type); + CalamityBuffSets.IsPersistentBuff[type] = true; return true; } else if (!isPersistent) { - return PersistentBuffList.List.Remove(type); + CalamityBuffSets.IsPersistentBuff[type] = false; + return false; } return false; } - public static bool IsOnAmalgamBuffList(int type) => AmalgamBuffList.Includes(type); - public static bool IsOnPersistentBuffList(int type) => PersistentBuffList.Includes(type); + public static bool IsOnAmalgamBuffList(int type) => CalamityBuffSets.BuffedByAmalgam[type]; + public static bool IsOnPersistentBuffList(int type) => CalamityBuffSets.IsPersistentBuff[type]; #endregion #region Venerated Locket Bans public static bool AddToVeneratedLocketBanlist(int type) { - if (!VeneratedLocketBanList.Includes(type)) + if (!CalamityItemSets.DisablesVeneratedLocketEffect[type]) { - VeneratedLocketBanList.List.Add(type); + CalamityItemSets.DisablesVeneratedLocketEffect[type] = true; return true; } return false; @@ -955,35 +917,37 @@ namespace CalamityMod #region Summoner Cross Class Nerf Disabling public static bool SetSummonerNerfDisabledByMinion(int type, bool disableNerf) { - if (disableNerf && !DisabledSummonerNerfMinionList.Includes(type)) + if (disableNerf && !CalamityProjectileSets.MinionWhichIgnoresSummonerNerf[type]) { - DisabledSummonerNerfMinionList.List.Add(type); + CalamityProjectileSets.MinionWhichIgnoresSummonerNerf[type] = true; return true; } else if (!disableNerf) { - return DisabledSummonerNerfMinionList.List.Remove(type); + CalamityProjectileSets.MinionWhichIgnoresSummonerNerf[type] = false; + return false; } return false; } public static bool SetSummonerNerfDisabledByItem(int type, bool disableNerf) { - if (disableNerf && !DisabledSummonerNerfItemList.Includes(type)) + if (disableNerf && !CalamityItemSets.ItemWhichDisablesSummonerNerf[type]) { - DisabledSummonerNerfItemList.List.Add(type); + CalamityItemSets.ItemWhichDisablesSummonerNerf[type] = true; return true; } else if (!disableNerf) { - return DisabledSummonerNerfItemList.List.Remove(type); + CalamityItemSets.ItemWhichDisablesSummonerNerf[type] = false; + return false; } return false; } - public static bool GetSummonerNerfDisabledByMinion(int type) => DisabledSummonerNerfMinionList.Includes(type); - public static bool GetSummonerNerfDisabledByItem(int type) => DisabledSummonerNerfItemList.Includes(type); + public static bool GetSummonerNerfDisabledByMinion(int type) => CalamityProjectileSets.MinionWhichIgnoresSummonerNerf[type]; + public static bool GetSummonerNerfDisabledByItem(int type) => CalamityItemSets.ItemWhichDisablesSummonerNerf[type]; #endregion #region Debuff Display support @@ -1071,9 +1035,9 @@ namespace CalamityMod //This is to add minions to the hp scaling config public static bool AddToHPScaling(int type) { - if (!BossHPScalingList.List.Contains(type)) + if (!CalamityNPCSets.ScalesHealthLikeBoss[type]) { - BossHPScalingList.List.Add(type); + CalamityNPCSets.ScalesHealthLikeBoss[type] = true; return true; } return false; @@ -1887,55 +1851,6 @@ namespace CalamityMod return GetShouldCloseBossHealthBar(castNPC(args[1])); } - case "CanFirePointBlank": - case "CanFirePointBlankShots": - if (args.Length < 2) - return new ArgumentNullException("ERROR: Must specify an Item object (or int index of an Item in the Main.item array)."); ; - if (!isValidItemArg(args[1])) - return new ArgumentException("ERROR: The first argument to \"CanFirePointBlank\" must be an Item or an int."); - return CanFirePointBlank(castItem(args[1])); - - case "SetFirePointBlank": - case "SetFirePointBlankShots": - if (args.Length < 2) - return new ArgumentNullException("ERROR: Must specify both an Item object (or int index of an Item in the Main.item array) and a bool."); - if (args.Length < 3) - return new ArgumentNullException("ERROR: Must specify whether the item can fire point blank as a bool."); - if (!(args[2] is bool firePointBlank)) - return new ArgumentException("ERROR: The second argument to \"SetFirePointBlank\" must be a bool."); - if (!isValidItemArg(args[1])) - return new ArgumentException("ERROR: The first argument to \"SetFirePointBlank\" must be an Item or an int."); - return SetFirePointBlank(castItem(args[1]), firePointBlank); - - - case "GetPointBlankDuration": - case "GetProjectilePointBlank": - case "GetProjectilePointBlankDuration": - { - if (args.Length < 2) - return new ArgumentNullException("ERROR: Must specify a Projectile."); - if (!isValidProjectileArg(args[1])) - return new ArgumentException("ERROR: The first argument to \"GetPointBlankDuration\" must be a Projectile."); - return GetPointBlankDuration(castProjectile(args[1])); - } - - case "SetPointBlankDuration": - case "SetProjectilePointBlank": - case "SetProjectilePointBlankDuration": - { - if (args.Length < 2) - return new ArgumentNullException("ERROR: Must specify both a Projectile and point blank duration as an int."); - if (args.Length < 3) - return new ArgumentNullException("ERROR: Must specify the point blank duration as an int."); - if (!(args[2] is int pbDuration)) - return new ArgumentException("ERROR: The second argument to \"SetPointBlankDuration\" must be an int."); - if (!isValidProjectileArg(args[1])) - return new ArgumentException("ERROR: The first argument to \"SetPointBlankDuration\" must be a Projectile."); - - SetPointBlankDuration(castProjectile(args[1]), pbDuration); - return null; - } - case "NoDodges": case "DodgesDisabled": case "GetDodgesDisabled": diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index e31b109d66..51133250cd 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -2,14 +2,11 @@ using System.Collections.Generic; using System.Linq; using CalamityMod.Buffs.Summon; -using CalamityMod.Cooldowns; using CalamityMod.Events; using CalamityMod.Items; -using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; -using CalamityMod.Items.PermanentBoosters; using CalamityMod.Items.Pets; using CalamityMod.Items.Placeables.Furniture.BossRelics; using CalamityMod.Items.Placeables.Furniture.DevPaintings; @@ -17,16 +14,12 @@ using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.SummonItems; using CalamityMod.Items.SummonItems.Invasion; using CalamityMod.Items.Weapons.DraedonsArsenal; -using CalamityMod.Items.Weapons.Magic; -using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; 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; @@ -57,12 +50,10 @@ using CalamityMod.NPCs.SunkenSea; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.NPCs.TownNPCs; using CalamityMod.NPCs.Yharon; -using CalamityMod.Particles; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Summon.Umbrella; using CalamityMod.Systems; -using CalamityMod.UI; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -567,8 +558,8 @@ namespace CalamityMod { string entryName = "BrimstoneElemental"; BossChecklistProgressionValues.TryGetValue(entryName, out float order); - int type = NPCType(); - List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + int type = NPCType(); + List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; AddBoss(bossChecklist, calamity, entryName, order, DownedBrimstoneElemental, type, new Dictionary() { ["spawnInfo"] = GetSpawnInfo(entryName), diff --git a/NPCs/Abyss/BobbitWormHead.cs b/NPCs/Abyss/BobbitWormHead.cs index 459d996262..682b2f106e 100644 --- a/NPCs/Abyss/BobbitWormHead.cs +++ b/NPCs/Abyss/BobbitWormHead.cs @@ -31,7 +31,6 @@ namespace CalamityMod.NPCs.Abyss public override void SetDefaults() { NPC.lavaImmune = true; - NPC.Calamity().canBreakPlayerDefense = true; NPC.aiStyle = -1; NPC.damage = 150; NPC.width = 80; diff --git a/NPCs/Abyss/DevilFish.cs b/NPCs/Abyss/DevilFish.cs index 2b0c93eb98..0688935939 100644 --- a/NPCs/Abyss/DevilFish.cs +++ b/NPCs/Abyss/DevilFish.cs @@ -46,7 +46,6 @@ namespace CalamityMod.NPCs.Abyss { NPC.noGravity = true; NPC.lavaImmune = true; - NPC.Calamity().canBreakPlayerDefense = true; NPC.damage = 90; NPC.width = 136; NPC.height = 62; diff --git a/NPCs/Abyss/DevilFishAlt.cs b/NPCs/Abyss/DevilFishAlt.cs index bc165bd5e6..1c3be97b1f 100644 --- a/NPCs/Abyss/DevilFishAlt.cs +++ b/NPCs/Abyss/DevilFishAlt.cs @@ -36,7 +36,6 @@ namespace CalamityMod.NPCs.Abyss { NPC.noGravity = true; NPC.lavaImmune = true; - NPC.Calamity().canBreakPlayerDefense = true; NPC.damage = 90; NPC.width = 136; NPC.height = 62; diff --git a/NPCs/Abyss/GulperEelHead.cs b/NPCs/Abyss/GulperEelHead.cs index 211a45f607..b3db09830a 100644 --- a/NPCs/Abyss/GulperEelHead.cs +++ b/NPCs/Abyss/GulperEelHead.cs @@ -47,7 +47,6 @@ namespace CalamityMod.NPCs.Abyss public override void SetDefaults() { - NPC.Calamity().canBreakPlayerDefense = true; NPC.damage = 135; NPC.width = 40; //36 NPC.height = 84; //20 diff --git a/NPCs/AquaticScourge/AquaticScourgeBody.cs b/NPCs/AquaticScourge/AquaticScourgeBody.cs index 1b23cd079d..b9f91cbcc0 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBody.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBody.cs @@ -42,8 +42,6 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.LifeMaxNERB(80000, 96000, 1000000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax *= 2; NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -60,7 +58,7 @@ namespace CalamityMod.NPCs.AquaticScourge else if (Main.expertMode) NPC.scale *= 1.1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 1.25f; NPC.Calamity().VulnerableToHeat = false; @@ -99,7 +97,7 @@ namespace CalamityMod.NPCs.AquaticScourge // Adjust hostility and stats bool nonHostile = calamityGlobalNPC.newAI[0] == 0f; - if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) + if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || Main.zenithWorld) { if (nonHostile) { @@ -236,7 +234,7 @@ namespace CalamityMod.NPCs.AquaticScourge for (int a = 0; a < Main.npc.Length; a++) { int type = Main.npc[a].type; - if (AquaticScourgeIDList.Includes(type)) + if (CalamityNPCTypeSets.AquaticScourge.Contains(type)) Main.npc[a].active = false; } } @@ -259,7 +257,7 @@ namespace CalamityMod.NPCs.AquaticScourge } Vector2 scourgePosition = NPC.Center; - Vector2 predictionVector = CalamityWorld.MaliceMode ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; + Vector2 predictionVector = Main.getGoodWorld ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; float scourgeTargetX = player.Center.X + predictionVector.X; float scourgeTargetY = player.Center.Y + predictionVector.Y; @@ -277,7 +275,7 @@ namespace CalamityMod.NPCs.AquaticScourge scourgeMaxSpeed += Vector2.Distance(player.Center, NPC.Center) * 0.001f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) scourgeMaxSpeed *= 1.15f; } diff --git a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs index 7a3404a557..2bcd18a1d5 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs @@ -40,8 +40,6 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.LifeMaxNERB(80000, 96000, 1000000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax *= 2; NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -58,7 +56,7 @@ namespace CalamityMod.NPCs.AquaticScourge else if (Main.expertMode) NPC.scale *= 1.1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 1.25f; NPC.Calamity().VulnerableToHeat = false; @@ -97,7 +95,7 @@ namespace CalamityMod.NPCs.AquaticScourge // Adjust hostility and stats bool nonHostile = calamityGlobalNPC.newAI[0] == 0f; - if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) + if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || Main.zenithWorld) { if (nonHostile) { @@ -205,7 +203,7 @@ namespace CalamityMod.NPCs.AquaticScourge for (int a = 0; a < Main.npc.Length; a++) { int type = Main.npc[a].type; - if (AquaticScourgeIDList.Includes(type)) + if (CalamityNPCTypeSets.AquaticScourge.Contains(type)) Main.npc[a].active = false; } } @@ -228,7 +226,7 @@ namespace CalamityMod.NPCs.AquaticScourge } Vector2 scourgePosition = NPC.Center; - Vector2 predictionVector = CalamityWorld.MaliceMode ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; + Vector2 predictionVector = Main.getGoodWorld ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; float scourgeTargetX = player.Center.X + predictionVector.X; float scourgeTargetY = player.Center.Y + predictionVector.Y; @@ -246,7 +244,7 @@ namespace CalamityMod.NPCs.AquaticScourge scourgeMaxSpeed += Vector2.Distance(player.Center, NPC.Center) * 0.001f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) scourgeMaxSpeed *= 1.15f; } diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index 98384f6683..4ec01007da 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -68,8 +68,6 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.aiStyle = -1; AIType = -1; NPC.LifeMaxNERB(80000, 96000, 1000000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax *= 2; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(gold: 12); NPC.behindTiles = true; @@ -87,7 +85,7 @@ namespace CalamityMod.NPCs.AquaticScourge else if (Main.expertMode) NPC.scale *= 1.1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 1.25f; NPC.Calamity().VulnerableToHeat = false; @@ -141,7 +139,7 @@ namespace CalamityMod.NPCs.AquaticScourge // Adjust hostility and stats bool nonHostile = calamityGlobalNPC.newAI[0] == 0f; - if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) + if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || Main.zenithWorld) { if (nonHostile) { @@ -390,7 +388,7 @@ namespace CalamityMod.NPCs.AquaticScourge for (int a = 0; a < Main.npc.Length; a++) { int type = Main.npc[a].type; - if (AquaticScourgeIDList.Includes(type)) + if (CalamityNPCTypeSets.AquaticScourge.Contains(type)) Main.npc[a].active = false; } } @@ -410,7 +408,7 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.alpha = 0; Vector2 scourgePosition = NPC.Center; - Vector2 predictionVector = CalamityWorld.MaliceMode ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; + Vector2 predictionVector = Main.getGoodWorld ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; float scourgeTargetX = player.Center.X + predictionVector.X; float scourgeTargetY = player.Center.Y + predictionVector.Y; @@ -443,7 +441,7 @@ namespace CalamityMod.NPCs.AquaticScourge scourgeAcceleration *= accelerationMultiplier; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { scourgeMaxSpeed *= 1.15f; scourgeAcceleration *= 1.15f; @@ -645,7 +643,7 @@ namespace CalamityMod.NPCs.AquaticScourge if (spawnInfo.Player.Calamity().ZoneSulphur && spawnInfo.Water) { if (!NPC.AnyNPCs(ModContent.NPCType())) - return (CalamityWorld.LegendaryMode ? 0.05f : 0.01f); + return Main.zenithWorld ? 0.1f : 0.01f; } return 0f; diff --git a/NPCs/AquaticScourge/AquaticScourgeTail.cs b/NPCs/AquaticScourge/AquaticScourgeTail.cs index f5edca04e6..75935256b7 100644 --- a/NPCs/AquaticScourge/AquaticScourgeTail.cs +++ b/NPCs/AquaticScourge/AquaticScourgeTail.cs @@ -37,8 +37,6 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.LifeMaxNERB(80000, 96000, 1000000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax *= 2; NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -55,7 +53,7 @@ namespace CalamityMod.NPCs.AquaticScourge else if (Main.expertMode) NPC.scale *= 1.1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 1.25f; NPC.Calamity().VulnerableToHeat = false; @@ -94,7 +92,7 @@ namespace CalamityMod.NPCs.AquaticScourge // Adjust hostility and stats bool nonHostile = calamityGlobalNPC.newAI[0] == 0f; - if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) + if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || Main.zenithWorld) { if (nonHostile) { @@ -202,7 +200,7 @@ namespace CalamityMod.NPCs.AquaticScourge for (int a = 0; a < Main.npc.Length; a++) { int type = Main.npc[a].type; - if (AquaticScourgeIDList.Includes(type)) + if (CalamityNPCTypeSets.AquaticScourge.Contains(type)) Main.npc[a].active = false; } } @@ -225,7 +223,7 @@ namespace CalamityMod.NPCs.AquaticScourge } Vector2 scourgePosition = NPC.Center; - Vector2 predictionVector = CalamityWorld.MaliceMode ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; + Vector2 predictionVector = Main.getGoodWorld ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; float scourgeTargetX = player.Center.X + predictionVector.X; float scourgeTargetY = player.Center.Y + predictionVector.Y; @@ -243,7 +241,7 @@ namespace CalamityMod.NPCs.AquaticScourge scourgeMaxSpeed += Vector2.Distance(player.Center, NPC.Center) * 0.001f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) scourgeMaxSpeed *= 1.15f; } diff --git a/NPCs/Astral/Mantis.cs b/NPCs/Astral/Mantis.cs index 6b8e306fd4..3910718d16 100644 --- a/NPCs/Astral/Mantis.cs +++ b/NPCs/Astral/Mantis.cs @@ -38,7 +38,6 @@ namespace CalamityMod.NPCs.Astral public override void SetDefaults() { - NPC.Calamity().canBreakPlayerDefense = true; NPC.damage = 55; NPC.width = 60; NPC.height = 58; diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index a1e503856d..5163a54dbc 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -113,10 +113,10 @@ namespace CalamityMod.NPCs.AstrumAureus NPC.Calamity().VulnerableToSickness = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - if (CalamityWorld.LegendaryMode) - NPC.scale *= 0.8f; + if (Main.getGoodWorld) + NPC.scale = 0.7f; if (Main.zenithWorld) - NPC.scale *= 1.5f; + NPC.scale = 1.5f; } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -195,26 +195,16 @@ namespace CalamityMod.NPCs.AstrumAureus NPC.localAI[3] -= death ? 4f : expertMode ? 2f : 1f; } - float enrageScale = 0f; - if (Main.IsItDay() && !player.Calamity().ZoneAstral) - { - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; - enrageScale += 1f; - } - float astralFlameBarrageTimerIncrement = 1f; if (expertMode) astralFlameBarrageTimerIncrement += death ? (float)Math.Round(3f * (1f - lifeRatio)) : (float)Math.Round(2f * (1f - lifeRatio)); - float walkingVelocity = CalamityWorld.MaliceMode ? 6f : 5f; - walkingVelocity += 3f * enrageScale; - if (phase5) - walkingVelocity += 2f; + float walkingVelocity = phase5 ? 7f : 5f; if (expertMode) walkingVelocity += 1.5f * (1f - lifeRatio); if (revenge) walkingVelocity += Math.Abs(NPC.Center.X - player.Center.X) * 0.0025f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) walkingVelocity *= 1.15f; float walkingProjectileVelocity = walkingVelocity * 0.8f; @@ -343,7 +333,7 @@ namespace CalamityMod.NPCs.AstrumAureus { float velocity = death ? (8f + NPC.localAI[2] * 0.025f) : 7f; int type = ModContent.ProjectileType(); - float spreadLimit = (phase4 ? 100f : 50f) + enrageScale * 50f; + float spreadLimit = phase4 ? 100f : 50f; float randomSpread = (Main.rand.NextFloat() - 0.5f) * spreadLimit; Vector2 spawnVector = new Vector2(NPC.Center.X, NPC.Center.Y - 80f * NPC.scale); Vector2 destination = new Vector2(spawnVector.X + randomSpread, spawnVector.Y - 100f * NPC.scale); @@ -640,11 +630,10 @@ namespace CalamityMod.NPCs.AstrumAureus calamityGlobalNPC.newAI[1] = speedMultLimit; } - float velocity = CalamityWorld.MaliceMode ? 27f : 20f; - velocity += 6f * enrageScale; + float velocity = 20f; if (expertMode) velocity += death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) velocity *= 1.15f; NPC.velocity = (new Vector2(player.Center.X, player.Center.Y - 500f) - NPC.Center).SafeNormalize(Vector2.Zero) * velocity; @@ -770,7 +759,7 @@ namespace CalamityMod.NPCs.AstrumAureus if (Main.netMode != NetmodeID.MultiplayerClient) { - float laserVelocity = CalamityWorld.MaliceMode ? 7f : death ? 6f : 5f; + float laserVelocity = Main.getGoodWorld ? 7f : death ? 6f : 5f; int maxProjectiles = !phase3 ? (death ? 11 : 9) : (death ? 15 : 13); int spread = !phase3 ? (death ? 18 : 16) : (death ? 22 : 20); @@ -819,10 +808,9 @@ namespace CalamityMod.NPCs.AstrumAureus NPC.velocity.Y = -3f; float fallSpeed = 1.2f; - fallSpeed += 0.36f * enrageScale; if (expertMode) fallSpeed += death ? 0.36f * (1f - lifeRatio) : 0.24f * (1f - lifeRatio); - if (CalamityWorld.MaliceMode) + if (Main.getGoodWorld) fallSpeed += 0.5f; if (calamityGlobalNPC.newAI[1] > 0f) @@ -835,7 +823,6 @@ namespace CalamityMod.NPCs.AstrumAureus { // Push Aureus towards the player on the X axis if he's not directly on top of or below the player float velocityXChange = 0.2f + Math.Abs(NPC.Center.X - player.Center.X) * 0.0001f; - velocityXChange += 0.1f * enrageScale; if (calamityGlobalNPC.newAI[0] > 0f) velocityXChange *= calamityGlobalNPC.newAI[0] + 1f; @@ -846,10 +833,9 @@ namespace CalamityMod.NPCs.AstrumAureus NPC.velocity.X += velocityXChange; float velocityXCap = 12f; - velocityXCap += 3.6f * enrageScale; if (expertMode) velocityXCap += death ? 3.6f * (1f - lifeRatio) : 2.4f * (1f - lifeRatio); - if (CalamityWorld.MaliceMode) + if (Main.getGoodWorld) velocityXCap += 5f; if (calamityGlobalNPC.newAI[0] > 0f) @@ -1056,13 +1042,13 @@ namespace CalamityMod.NPCs.AstrumAureus void CustomGravity() { - float gravity = 0.36f + 0.12f * enrageScale; - float maxFallSpeed = reduceFallSpeed ? 12f : 12f + 4f * enrageScale; + float gravity = 0.36f; + float maxFallSpeed = 12f; if (calamityGlobalNPC.newAI[1] > 0f && !reduceFallSpeed) maxFallSpeed *= calamityGlobalNPC.newAI[1] + 1f; - if (CalamityWorld.LegendaryMode && !reduceFallSpeed) + if (Main.getGoodWorld && !reduceFallSpeed) { gravity *= 1.15f; maxFallSpeed *= 1.15f; diff --git a/NPCs/AstrumAureus/AureusSpawn.cs b/NPCs/AstrumAureus/AureusSpawn.cs index c0d00b5ab8..0f58c12d65 100644 --- a/NPCs/AstrumAureus/AureusSpawn.cs +++ b/NPCs/AstrumAureus/AureusSpawn.cs @@ -308,10 +308,10 @@ namespace CalamityMod.NPCs.AstrumAureus { if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalProjectiles = CalamityWorld.LegendaryMode ? 36 : (3 + (int)((NPC.scale - 1f) * 3)); + int totalProjectiles = 3 + (int)((NPC.scale - 1f) * 3); double radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); - float velocity = CalamityWorld.LegendaryMode ? 10f : 6f; + float velocity = 6f; double angleA = radians * 0.5; double angleB = MathHelper.ToRadians(90f) - angleA; float velocityX = (float)(velocity * Math.Sin(angleA) / Math.Sin(angleB)); diff --git a/NPCs/AstrumDeus/AstrumDeusBody.cs b/NPCs/AstrumDeus/AstrumDeusBody.cs index 594be9b998..1a017ad86a 100644 --- a/NPCs/AstrumDeus/AstrumDeusBody.cs +++ b/NPCs/AstrumDeus/AstrumDeusBody.cs @@ -121,13 +121,6 @@ namespace CalamityMod.NPCs.AstrumDeus bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - float enrageScale = 0f; - if (Main.IsItDay()) - { - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; - enrageScale += 1.5f; - } - // Deus cannot hit for 3 seconds or while invulnerable bool doNotDealDamage = calamityGlobalNPC.newAI[1] < 180f || NPC.dontTakeDamage; if (doNotDealDamage) @@ -174,7 +167,7 @@ namespace CalamityMod.NPCs.AstrumDeus calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = calamityGlobalNPC.newAI[1] < resistanceTime; // Flight timer - float aiSwitchTimer = doubleWormPhase ? (CalamityWorld.LegendaryMode ? 600f : 1200f) : (CalamityWorld.LegendaryMode ? 900f : 1800f); + float aiSwitchTimer = doubleWormPhase ? (Main.getGoodWorld ? 600f : 1200f) : (Main.getGoodWorld ? 900f : 1800f); calamityGlobalNPC.newAI[3] += 1f; if (calamityGlobalNPC.newAI[3] >= aiSwitchTimer) @@ -195,12 +188,10 @@ namespace CalamityMod.NPCs.AstrumDeus // Become gradually more pissed as more worms are killed int gfbMaxWormCount = 10; int gfbWormCount = 0; - if (CalamityWorld.MaliceMode) + if (Main.zenithWorld) gfbWormCount = NPC.CountNPCS(ModContent.NPCType()); if (gfbWormCount > gfbMaxWormCount) gfbWormCount = gfbMaxWormCount; - if (gfbWormCount > 0) - enrageScale += (gfbMaxWormCount - gfbWormCount) * 0.111f; // Copy dontTakeDamage and Opacity from head NPC.dontTakeDamage = Main.npc[(int)NPC.ai[2]].dontTakeDamage; @@ -262,7 +253,8 @@ namespace CalamityMod.NPCs.AstrumDeus float segmentVelocityBoost = 5f * (1f - lifeRatio); segmentVelocity += segmentVelocityBoost; - segmentVelocity += 4f * enrageScale; + if (gfbWormCount > 0) + segmentVelocity += (gfbMaxWormCount - gfbWormCount) * 0.444f; if (revenge) { @@ -312,7 +304,9 @@ namespace CalamityMod.NPCs.AstrumDeus { if (Main.netMode != NetmodeID.MultiplayerClient) { - float deusLaserSpeed = (death ? 16f : revenge ? 14f : 13f) + enrageScale * 4f; + float deusLaserSpeed = death ? 16f : revenge ? 14f : 13f; + if (gfbWormCount > 0) + deusLaserSpeed += (gfbMaxWormCount - gfbWormCount) * 0.444f; Vector2 deusLaserCenter = NPC.Center; float deusLaserTargetX = player.Center.X - deusLaserCenter.X; @@ -440,7 +434,7 @@ namespace CalamityMod.NPCs.AstrumDeus // Need segment amount to get a smooth transition down the worm based on length int segmentAmt = Main.zenithWorld ? (CalamityWorld.death ? 8 : CalamityWorld.revenge ? 7 : Main.expertMode ? 6 : 5) : (CalamityWorld.death ? 40 : CalamityWorld.revenge ? 35 : Main.expertMode ? 30 : 25); - float cyanThreshold = CalamityWorld.LegendaryMode ? 300f : 600f; + float cyanThreshold = Main.getGoodWorld ? 300f : 600f; float transitionStart = MathHelper.Lerp(cyanThreshold * 0.75f, cyanThreshold * 0.95f, 1f - (NPC.ai[3] / (float)segmentAmt)); float transitionEnd = MathHelper.Lerp(cyanThreshold * 0.8f, cyanThreshold, 1f - (NPC.ai[3] / (float)segmentAmt)); bool drawCyan = NPC.Calamity().newAI[3] >= transitionEnd && NPC.Calamity().newAI[3] <= cyanThreshold + transitionEnd; diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index bdb41f24a9..728439106b 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -151,13 +151,6 @@ namespace CalamityMod.NPCs.AstrumDeus bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - float enrageScale = 0f; - if (Main.IsItDay()) - { - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; - enrageScale += 1.5f; - } - // Deus cannot hit for 3 seconds or while invulnerable bool doNotDealDamage = calamityGlobalNPC.newAI[1] < 180f || NPC.dontTakeDamage; if (doNotDealDamage) @@ -208,7 +201,7 @@ namespace CalamityMod.NPCs.AstrumDeus calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = calamityGlobalNPC.newAI[1] < resistanceTime; // Flight timer - float aiSwitchTimer = doubleWormPhase ? (CalamityWorld.LegendaryMode ? 600f : 1200f) : (CalamityWorld.LegendaryMode ? 900f : 1800f); + float aiSwitchTimer = doubleWormPhase ? (Main.getGoodWorld ? 600f : 1200f) : (Main.getGoodWorld ? 900f : 1800f); calamityGlobalNPC.newAI[3] += 1f; if (calamityGlobalNPC.newAI[3] >= aiSwitchTimer) @@ -229,12 +222,10 @@ namespace CalamityMod.NPCs.AstrumDeus // Become gradually more pissed as more worms are killed int gfbMaxWormCount = 10; int gfbWormCount = 0; - if (CalamityWorld.MaliceMode) + if (Main.zenithWorld) gfbWormCount = NPC.CountNPCS(ModContent.NPCType()); if (gfbWormCount > gfbMaxWormCount) gfbWormCount = gfbMaxWormCount; - if (gfbWormCount > 0) - enrageScale += (gfbMaxWormCount - gfbWormCount) * 0.111f; // Split into two worms float splitAnimationTime = 180f; @@ -339,7 +330,7 @@ namespace CalamityMod.NPCs.AstrumDeus int startIndexHeadTwo = startIndexHeadOne + phase2Length + 1; int headTwoID = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, NPC.type, startIndexHeadTwo); Main.npc[headTwoID].Calamity().newAI[0] = 2f; - Main.npc[headTwoID].Calamity().newAI[3] = CalamityWorld.LegendaryMode ? 300f : 600f; + Main.npc[headTwoID].Calamity().newAI[3] = Main.getGoodWorld ? 300f : 600f; Main.npc[headTwoID].velocity = Vector2.Normalize(player.Center - Main.npc[headTwoID].Center) * 16f; Main.npc[headTwoID].timeLeft *= 20; Main.npc[headTwoID].ForceNetUpdate(); @@ -446,7 +437,8 @@ namespace CalamityMod.NPCs.AstrumDeus float segmentVelocityBoost = 5f * (1f - lifeRatio); segmentVelocity += segmentVelocityBoost; - segmentVelocity += 4f * enrageScale; + if (gfbWormCount > 0) + segmentVelocity += (gfbMaxWormCount - gfbWormCount) * 0.444f; if (revenge) { @@ -557,8 +549,11 @@ namespace CalamityMod.NPCs.AstrumDeus float turnSpeedBoost = death ? (0.18f * (1f - lifeRatio)) : (0.2f * (1f - lifeRatio)); float speed = (hasJustSpawned ? 0.26f : deathModeEnragePhase_Head ? 0.2f : death ? 0.18f : 0.13f) + speedBoost; float turnSpeed = (hasJustSpawned ? 0.3f : deathModeEnragePhase_Head ? 0.27f : death ? 0.25f : 0.2f) + turnSpeedBoost; - speed += 0.05f * enrageScale; - turnSpeed += 0.08f * enrageScale; + if (gfbWormCount > 0) + { + speed += (gfbMaxWormCount - gfbWormCount) * 0.00555f; + turnSpeed += (gfbMaxWormCount - gfbWormCount) * 0.00888f; + } if (flyAtTarget) { @@ -576,7 +571,7 @@ namespace CalamityMod.NPCs.AstrumDeus speed *= increaseSpeedMore ? 2f : increaseSpeed ? 1.5f : 1f; turnSpeed *= increaseSpeedMore ? 2f : increaseSpeed ? 1.5f : 1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { speed *= 1.15f; turnSpeed *= 1.15f; @@ -799,7 +794,7 @@ namespace CalamityMod.NPCs.AstrumDeus bool deathModeEnragePhase = NPC.Calamity().newAI[0] == 3f; bool doubleWormPhase = NPC.Calamity().newAI[0] != 0f && !deathModeEnragePhase; - float cyanThreshold = CalamityWorld.LegendaryMode ? 300f : 600f; + float cyanThreshold = Main.getGoodWorld ? 300f : 600f; // Head is always the last segment to visually transition float transitionStart = cyanThreshold * 0.95f; bool drawCyan = NPC.Calamity().newAI[3] >= cyanThreshold; diff --git a/NPCs/AstrumDeus/AstrumDeusTail.cs b/NPCs/AstrumDeus/AstrumDeusTail.cs index ea8c9438e3..d231d34b8d 100644 --- a/NPCs/AstrumDeus/AstrumDeusTail.cs +++ b/NPCs/AstrumDeus/AstrumDeusTail.cs @@ -100,13 +100,6 @@ namespace CalamityMod.NPCs.AstrumDeus bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - float enrageScale = 0f; - if (Main.IsItDay()) - { - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; - enrageScale += 1.5f; - } - // Deus cannot hit for 3 seconds or while invulnerable bool doNotDealDamage = calamityGlobalNPC.newAI[1] < 180f || NPC.dontTakeDamage; if (doNotDealDamage) @@ -153,7 +146,7 @@ namespace CalamityMod.NPCs.AstrumDeus calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = calamityGlobalNPC.newAI[1] < resistanceTime; // Flight timer - float aiSwitchTimer = doubleWormPhase ? (CalamityWorld.LegendaryMode ? 600f : 1200f) : (CalamityWorld.LegendaryMode ? 900f : 1800f); + float aiSwitchTimer = doubleWormPhase ? (Main.getGoodWorld ? 600f : 1200f) : (Main.getGoodWorld ? 900f : 1800f); calamityGlobalNPC.newAI[3] += 1f; if (calamityGlobalNPC.newAI[3] >= aiSwitchTimer) @@ -174,12 +167,10 @@ namespace CalamityMod.NPCs.AstrumDeus // Become gradually more pissed as more worms are killed int gfbMaxWormCount = 10; int gfbWormCount = 0; - if (CalamityWorld.MaliceMode) + if (Main.zenithWorld) gfbWormCount = NPC.CountNPCS(ModContent.NPCType()); if (gfbWormCount > gfbMaxWormCount) gfbWormCount = gfbMaxWormCount; - if (gfbWormCount > 0) - enrageScale += (gfbMaxWormCount - gfbWormCount) * 0.111f; // Copy dontTakeDamage and Opacity from head NPC.dontTakeDamage = Main.npc[(int)NPC.ai[2]].dontTakeDamage; @@ -241,7 +232,8 @@ namespace CalamityMod.NPCs.AstrumDeus float segmentVelocityBoost = 5f * (1f - lifeRatio); segmentVelocity += segmentVelocityBoost; - segmentVelocity += 4f * enrageScale; + if (gfbWormCount > 0) + segmentVelocity += (gfbMaxWormCount - gfbWormCount) * 0.444f; if (revenge) { @@ -312,7 +304,7 @@ namespace CalamityMod.NPCs.AstrumDeus bool deathModeEnragePhase = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] == 3f; bool doubleWormPhase = NPC.Calamity().newAI[0] != 0f && !deathModeEnragePhase; - float cyanThreshold = CalamityWorld.LegendaryMode ? 300f : 600f; + float cyanThreshold = Main.getGoodWorld ? 300f : 600f; // Tail is always the first segment to visually transition float transitionStart = cyanThreshold * 0.75f; float transitionEnd = cyanThreshold * 0.8f; diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index 6b54e1fb30..bb9c4e933b 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -460,7 +460,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental NPC.chaseable = true; NPC.ai[3] += 1f; NPC.alpha = 0; - if (NPC.ai[3] >= 2f || phase2 || CalamityWorld.LegendaryMode) + if (NPC.ai[3] >= 2f || phase2 || Main.getGoodWorld) { NPC.ai[0] = -1f; NPC.ai[1] = 0f; @@ -510,8 +510,6 @@ namespace CalamityMod.NPCs.BrimstoneElemental { int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 5f, projectileVelocity, type, damage, 0f, Main.myPlayer, player.position.X, player.position.Y); Main.projectile[proj].timeLeft = 240; - if (CalamityWorld.MaliceMode) - Main.projectile[proj].extraUpdates += 1; } if (NPC.ai[1] % divisor2 == divisor2 - 1f) @@ -531,7 +529,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental projectileVelocity = (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * velocity; int numProj = death ? 8 : 4; int spread = death ? 90 : 45; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { numProj *= 3; spread *= 2; @@ -544,9 +542,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - int proj2 = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer, 1f, 0f, projectileVelocityToPass); - if (CalamityWorld.MaliceMode) - Main.projectile[proj2].extraUpdates += 1; + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer, 1f, 0f, projectileVelocityToPass); } } } @@ -570,7 +566,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental NPC.chaseable = false; NPC.localAI[0] += 1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.localAI[0] += 2f; if (expertMode) NPC.localAI[0] += 1f - lifeRatio; @@ -608,8 +604,6 @@ namespace CalamityMod.NPCs.BrimstoneElemental int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, projectileVelocity, type, damage, 0f, Main.myPlayer, 1f, 0f); Main.projectile[proj].timeLeft = 300; Main.projectile[proj].tileCollide = false; - if (CalamityWorld.MaliceMode) - Main.projectile[proj].extraUpdates += 1; } } @@ -637,9 +631,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians2 * k); - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + vector255.SafeNormalize(Vector2.UnitY) * 5f, vector255, type, damage, 0f, Main.myPlayer, 1f, 0f, projectileVelocityToPass); - if (CalamityWorld.MaliceMode) - Main.projectile[proj].extraUpdates += 1; + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + vector255.SafeNormalize(Vector2.UnitY) * 5f, vector255, type, damage, 0f, Main.myPlayer, 1f, 0f, projectileVelocityToPass); } if (death) @@ -648,9 +640,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians2 * k); - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + vector255.SafeNormalize(Vector2.UnitY) * 5f, vector255 * 0.75f, type, damage, 0f, Main.myPlayer, 1f, 0f, projectileVelocityToPass); - if (CalamityWorld.MaliceMode) - Main.projectile[proj].extraUpdates += 1; + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + vector255.SafeNormalize(Vector2.UnitY) * 5f, vector255 * 0.75f, type, damage, 0f, Main.myPlayer, 1f, 0f, projectileVelocityToPass); } } } @@ -738,7 +728,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental int damage = RayDamage; Projectile.NewProjectile(NPC.GetSource_FromAI(), source, laserVelocity2, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) Projectile.NewProjectile(NPC.GetSource_FromAI(), source, -laserVelocity2, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); if (Main.zenithWorld) @@ -779,7 +769,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental if (Main.netMode != NetmodeID.MultiplayerClient) { Projectile.NewProjectile(NPC.GetSource_FromAI(), source, laserVelocity, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) Projectile.NewProjectile(NPC.GetSource_FromAI(), source, -laserVelocity, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); if (Main.zenithWorld) @@ -801,7 +791,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental if (Main.netMode != NetmodeID.MultiplayerClient) { Projectile.NewProjectile(NPC.GetSource_FromAI(), source.X, source.Y, NPC.localAI[0], NPC.localAI[1], ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, NPC.whoAmI); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) Projectile.NewProjectile(NPC.GetSource_FromAI(), source.X, source.Y, -NPC.localAI[0], -NPC.localAI[1], ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, NPC.whoAmI); if (Main.zenithWorld) @@ -883,7 +873,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType())); + npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType())); // Normal drops: Everything that would otherwise be in the bag var normalOnly = npcLoot.DefineNormalOnlyDropSet(); @@ -910,7 +900,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); // Vanity - normalOnly.Add(ModContent.ItemType(), 7); + normalOnly.Add(ModContent.ItemType(), 7); normalOnly.Add(ModContent.ItemType(), ThankYouPainting.DropInt); } diff --git a/NPCs/Bumblebirb/DraconicSwarmer.cs b/NPCs/Bumblebirb/DraconicSwarmer.cs index 043af182c8..7699b6a720 100644 --- a/NPCs/Bumblebirb/DraconicSwarmer.cs +++ b/NPCs/Bumblebirb/DraconicSwarmer.cs @@ -123,8 +123,6 @@ namespace CalamityMod.NPCs.Bumblebirb swarmerIdleTargetDist.Normalize(); swarmerIdleTargetDist *= swarmerIdleSpeed; NPC.velocity = (NPC.velocity * 29f + swarmerIdleTargetDist) / 30f; - if (CalamityWorld.LegendaryMode && !Main.zenithWorld) - NPC.velocity *= 1.15f; } else if (NPC.velocity.Length() > 2f) NPC.velocity *= 0.95f; @@ -171,8 +169,6 @@ namespace CalamityMod.NPCs.Bumblebirb swarmerChargeTargetDist.Normalize(); swarmerChargeTargetDist *= swarmerChargeSpeed; NPC.velocity = (NPC.velocity * (swarmerChargeVelMult - 1f) + swarmerChargeTargetDist) / swarmerChargeVelMult; - if (CalamityWorld.LegendaryMode && !Main.zenithWorld) - NPC.velocity *= 1.15f; NPC.ForceNetUpdate(); @@ -199,8 +195,6 @@ namespace CalamityMod.NPCs.Bumblebirb swarmerDecelerateTargetDist.Normalize(); swarmerDecelerateTargetDist *= swarmerDecelerateSpeed; NPC.velocity = (NPC.velocity * (swarmerDecelerateVelMult - 1f) + swarmerDecelerateTargetDist) / swarmerDecelerateVelMult; - if (CalamityWorld.LegendaryMode && !Main.zenithWorld) - NPC.velocity *= 1.15f; if (NPC.velocity.X < 0f) NPC.direction = -1; @@ -216,9 +210,6 @@ namespace CalamityMod.NPCs.Bumblebirb NPC.damage = NPC.defDamage; NPC.velocity = swarmerDecelerateTargetDist; - if (CalamityWorld.LegendaryMode && !Main.zenithWorld) - NPC.velocity *= 1.15f; - if (NPC.velocity.X < 0f) NPC.direction = -1; else diff --git a/NPCs/Bumblebirb/Dragonfolly.cs b/NPCs/Bumblebirb/Dragonfolly.cs index 656bbb41ee..6dbe843583 100644 --- a/NPCs/Bumblebirb/Dragonfolly.cs +++ b/NPCs/Bumblebirb/Dragonfolly.cs @@ -173,7 +173,7 @@ namespace CalamityMod.NPCs.Bumblebirb if (NPC.localAI[2] > 0f) enrageScale += 1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) enrageScale += 0.5f; if (enrageScale > 3f) @@ -337,7 +337,7 @@ namespace CalamityMod.NPCs.Bumblebirb } // Max spawn amount - int maxBirbs = CalamityWorld.MaliceMode ? 12 : revenge ? 3 : 2; + int maxBirbs = Main.zenithWorld ? 12 : revenge ? 3 : 2; // Variable for charging float chargeDistance = 600f; @@ -466,7 +466,7 @@ namespace CalamityMod.NPCs.Bumblebirb bool spawnRight = player.velocity.X > 0f; for (int i = 0; i < totalProjectiles; i++) { - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { if (i >= (int)(totalProjectiles * 0.125) && i <= (int)(totalProjectiles * 0.375)) { @@ -533,13 +533,13 @@ namespace CalamityMod.NPCs.Bumblebirb { int totalProjectiles = phase2 ? 40 : 48; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) totalProjectiles *= 2; float radians = MathHelper.TwoPi / totalProjectiles; int distance = phase2 ? 1200 : 1320; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) distance *= 2; bool spawnRight = player.velocity.X > 0f; @@ -648,7 +648,7 @@ namespace CalamityMod.NPCs.Bumblebirb float velocity = 8f + (enrageScale - 1f) * 2f; float follyQuickFlySpeed = velocity + NPC.ai[2] + follyQuickFlyTargetDirection.Length() / 120f; - if (CalamityWorld.MaliceMode) + if (Main.getGoodWorld) follyQuickFlySpeed *= 2f; float follyQuickFlyVelMult = 20f; @@ -657,7 +657,7 @@ namespace CalamityMod.NPCs.Bumblebirb NPC.velocity = (NPC.velocity * (follyQuickFlyVelMult - 1f) + follyQuickFlyTargetDirection) / follyQuickFlyVelMult; NPC.ai[1] += 1f; - if (NPC.ai[1] >= (CalamityWorld.MaliceMode ? 90f : 180f)) + if (NPC.ai[1] >= (Main.getGoodWorld ? 90f : 180f)) { NPC.TargetClosest(); NPC.ai[0] = 0f; @@ -855,7 +855,7 @@ namespace CalamityMod.NPCs.Bumblebirb if (Main.netMode != NetmodeID.MultiplayerClient) { - bool gfbSpawnFlag = CalamityWorld.MaliceMode && (NPC.ai[1] == 145f || NPC.ai[1] == 150f || NPC.ai[1] == 160f || NPC.ai[1] == 165f); + bool gfbSpawnFlag = Main.zenithWorld && (NPC.ai[1] == 145f || NPC.ai[1] == 150f || NPC.ai[1] == 160f || NPC.ai[1] == 165f); bool spawnFlag = NPC.CountNPCS(ModContent.NPCType()) < maxBirbs && (NPC.ai[1] == 140f || (revenge && NPC.ai[1] == 155f) || NPC.ai[1] == 170f || gfbSpawnFlag); if (spawnFlag) { @@ -1247,7 +1247,6 @@ namespace CalamityMod.NPCs.Bumblebirb ModContent.ItemType() }; normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, items)); - normalOnly.Add(ModContent.ItemType(), 10); // Materials normalOnly.Add(ModContent.ItemType(), 1, 25, 30); diff --git a/NPCs/CalClone/CalamitasClone.cs b/NPCs/CalClone/CalamitasClone.cs index b518d27391..a4f951a389 100644 --- a/NPCs/CalClone/CalamitasClone.cs +++ b/NPCs/CalClone/CalamitasClone.cs @@ -204,7 +204,7 @@ namespace CalamityMod.NPCs.CalClone SoundEngine.PlaySound(SoundID.Item109, NPC.Center); calamityGlobalNPC.newAI[2] = 2f; - if (CalamityWorld.MaliceMode) + if (Main.zenithWorld) calamityGlobalNPC.newAI[3] = 0f; SpawnDust(); @@ -228,7 +228,7 @@ namespace CalamityMod.NPCs.CalClone SoundEngine.PlaySound(SoundID.Item109, NPC.Center); calamityGlobalNPC.newAI[2] = 1f; - if (CalamityWorld.MaliceMode) + if (Main.zenithWorld) calamityGlobalNPC.newAI[3] = 0f; SpawnDust(); @@ -292,13 +292,6 @@ namespace CalamityMod.NPCs.CalClone // Target variable Player player = Main.player[NPC.target]; - float enrageScale = 0f; - if (Main.IsItDay()) - { - NPC.Calamity().CurrentlyEnraged = true; - enrageScale += 2f; - } - // Rotation Vector2 npcCenter = new Vector2(NPC.Center.X, NPC.position.Y + NPC.height - 59f); Vector2 lookAt = new Vector2(player.position.X - (player.width / 2), player.position.Y - (player.height / 2)); @@ -376,8 +369,6 @@ namespace CalamityMod.NPCs.CalClone // How fast Cal Clone moves to the destination float baseVelocity = (expertMode ? 10f : 8.5f) * (NPC.ai[1] == 4f ? 1.4f : 1f); float baseAcceleration = (expertMode ? 0.18f : 0.155f) * (NPC.ai[1] == 4f ? 1.4f : 1f); - baseVelocity += 4f * enrageScale; - baseAcceleration += 0.1f * enrageScale; if (revenge) { baseVelocity += 1.5f * (1f - lifeRatio); @@ -388,7 +379,7 @@ namespace CalamityMod.NPCs.CalClone baseVelocity += 1.5f * (1f - lifeRatio); baseAcceleration += 0.03f * (1f - lifeRatio); } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { baseVelocity *= 1.15f; baseAcceleration *= 1.15f; @@ -456,7 +447,7 @@ namespace CalamityMod.NPCs.CalClone if (Main.zenithWorld) type = ModContent.ProjectileType(); - float gigaBlastFrequency = (CalamityWorld.LegendaryMode ? 120f : expertMode ? 180f : 240f) - enrageScale * 15f; + float gigaBlastFrequency = Main.getGoodWorld ? 120f : expertMode ? 180f : 240f; float projSpeed = 5f; if (calamityGlobalNPC.newAI[3] <= 300f) { @@ -477,7 +468,7 @@ namespace CalamityMod.NPCs.CalClone } NPC.ai[0] += 1f; - float hellblastGateValue = (expertMode ? 12f : 16f) - enrageScale; + float hellblastGateValue = expertMode ? 12f : 16f; if (NPC.ai[0] >= hellblastGateValue) { NPC.ai[0] = 0f; @@ -594,7 +585,7 @@ namespace CalamityMod.NPCs.CalClone return; } - else if (CalamityWorld.MaliceMode) + else if (Main.zenithWorld) { if (calamityGlobalNPC.newAI[3] < 900f) calamityGlobalNPC.newAI[3] += 1f; @@ -602,7 +593,7 @@ namespace CalamityMod.NPCs.CalClone calamityGlobalNPC.newAI[3] = 0f; NPC.ai[0] += 1f; - float hellblastGateValue = 30f - enrageScale; + float hellblastGateValue = 30f; if (NPC.ai[0] >= hellblastGateValue) { NPC.ai[0] = 0f; @@ -675,10 +666,8 @@ namespace CalamityMod.NPCs.CalClone SoundEngine.PlaySound(BrimstoneElemental.BrimstoneElemental.HellfireballSound, NPC.Center); float projectileVelocity = expertMode ? 14f : 12.5f; - projectileVelocity += 3f * enrageScale; int type = ModContent.ProjectileType(); - bool shootPredictiveShot = CalamityWorld.MaliceMode && Main.rand.NextBool(); - Vector2 predictionVector = shootPredictiveShot ? player.velocity * 20f : Vector2.Zero; + Vector2 predictionVector = Main.getGoodWorld ? player.velocity * 20f : Vector2.Zero; Vector2 fireballVelocity = Vector2.Normalize(player.Center + predictionVector - NPC.Center) * projectileVelocity; Vector2 offset = Vector2.Normalize(fireballVelocity) * 40f; int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, fireballVelocity, type, HellfireballDamage, 0f, Main.myPlayer, player.position.X, player.position.Y); @@ -706,7 +695,6 @@ namespace CalamityMod.NPCs.CalClone NPC.localAI[1] = 0f; float projectileVelocity = expertMode ? 12.5f : 11f; - projectileVelocity += 3f * enrageScale; int type = ModContent.ProjectileType(); int damage = HellblastDamage; Vector2 fireballVelocity = Vector2.Normalize(player.Center - NPC.Center) * projectileVelocity; @@ -750,7 +738,6 @@ namespace CalamityMod.NPCs.CalClone NPC.rotation = rotation; float chargeVelocity = phase4 ? 30f : death ? 28f : 25f; - chargeVelocity += 5f * enrageScale; Vector2 vector = Vector2.Normalize(player.Center - NPC.Center); NPC.velocity = vector * chargeVelocity; @@ -785,7 +772,7 @@ namespace CalamityMod.NPCs.CalClone if (Main.netMode != NetmodeID.MultiplayerClient && death && phase3 && NPC.ai[2] % (phase4 ? 6f : 10f) == 0f) { int type = ModContent.ProjectileType(); - Vector2 fireballVelocity = CalamityWorld.LegendaryMode ? Main.rand.NextVector2CircularEdge(0.02f, 0.02f) : NPC.velocity * 0.01f; + Vector2 fireballVelocity = Main.getGoodWorld ? Main.rand.NextVector2CircularEdge(0.02f, 0.02f) : NPC.velocity * 0.01f; Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, fireballVelocity, type, HellblastDamage, 0f, Main.myPlayer, 1f, 0f); } } @@ -907,7 +894,7 @@ namespace CalamityMod.NPCs.CalClone // Equipment normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); - normalOnly.Add(ModContent.ItemType(), 10); + normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); // Materials normalOnly.Add(ModContent.ItemType(), 1, 8, 10); diff --git a/NPCs/CalClone/Cataclysm.cs b/NPCs/CalClone/Cataclysm.cs index fbbb1a72b2..54dd688d71 100644 --- a/NPCs/CalClone/Cataclysm.cs +++ b/NPCs/CalClone/Cataclysm.cs @@ -156,13 +156,6 @@ namespace CalamityMod.NPCs.CalClone Player player = Main.player[NPC.target]; - float enrageScale = 0f; - if (Main.IsItDay()) - { - NPC.Calamity().CurrentlyEnraged = true; - enrageScale += 2f; - } - float calCloneBroPlayerXDist = NPC.position.X + (NPC.width / 2) - player.position.X - (player.width / 2); float calCloneBroPlayerYDist = NPC.position.Y + NPC.height - 59f - player.position.Y - (player.height / 2); float calCloneBroRotation = (float)Math.Atan2(calCloneBroPlayerYDist, calCloneBroPlayerXDist) + MathHelper.PiOver2; @@ -227,10 +220,8 @@ namespace CalamityMod.NPCs.CalClone { float calCloneBroProjAttackMaxSpeed = 5f; float calCloneBroProjAttackAccel = 0.1f; - calCloneBroProjAttackMaxSpeed += 2f * enrageScale; - calCloneBroProjAttackAccel += 0.06f * enrageScale; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { calCloneBroProjAttackMaxSpeed *= 1.15f; calCloneBroProjAttackAccel *= 1.15f; @@ -322,7 +313,6 @@ namespace CalamityMod.NPCs.CalClone { NPC.localAI[1] = 0f; float calCloneBroProjSpeed = NPC.AnyNPCs(ModContent.NPCType()) ? 4f : 6f; - calCloneBroProjSpeed += enrageScale; int type = ModContent.ProjectileType(); calCloneBroProjLocation = new Vector2(NPC.position.X + NPC.width * 0.5f, NPC.position.Y + NPC.height * 0.5f); calCloneBroProjTargetX = player.position.X + (player.width / 2) - calCloneBroProjLocation.X; @@ -348,12 +338,11 @@ namespace CalamityMod.NPCs.CalClone NPC.rotation = calCloneBroRotation; float calCloneBroChargeSpeed = 14f + (death ? 4f * (1f - lifeRatio) : 0f); - calCloneBroChargeSpeed += 3f * enrageScale; if (expertMode) calCloneBroChargeSpeed += 2f; if (revenge) calCloneBroChargeSpeed += 2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) calCloneBroChargeSpeed *= 1.25f; Vector2 calCloneBroChargeCenter = NPC.Center; diff --git a/NPCs/CalClone/Catastrophe.cs b/NPCs/CalClone/Catastrophe.cs index a11b491bf1..a6b12b320c 100644 --- a/NPCs/CalClone/Catastrophe.cs +++ b/NPCs/CalClone/Catastrophe.cs @@ -150,13 +150,6 @@ namespace CalamityMod.NPCs.CalClone Player player = Main.player[NPC.target]; - float enrageScale = 0f; - if (Main.IsItDay()) - { - NPC.Calamity().CurrentlyEnraged = true; - enrageScale += 2f; - } - float calCloneBroPlayerXDist = NPC.position.X + (NPC.width / 2) - player.position.X - (player.width / 2); float calCloneBroPlayerYDist = NPC.position.Y + NPC.height - 59f - player.position.Y - (player.height / 2); float calCloneBroRotation = (float)Math.Atan2(calCloneBroPlayerYDist, calCloneBroPlayerXDist) + MathHelper.PiOver2; @@ -221,10 +214,8 @@ namespace CalamityMod.NPCs.CalClone { float calCloneBroProjAttackMaxSpeed = 4.5f; float calCloneBroProjAttackAccel = 0.2f; - calCloneBroProjAttackMaxSpeed += 2f * enrageScale; - calCloneBroProjAttackAccel += 0.1f * enrageScale; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { calCloneBroProjAttackMaxSpeed *= 1.15f; calCloneBroProjAttackAccel *= 1.15f; @@ -313,7 +304,6 @@ namespace CalamityMod.NPCs.CalClone { NPC.localAI[1] = 0f; float calCloneBroProjSpeed = death ? 14f : 12f; - calCloneBroProjSpeed += 3f * enrageScale; int type = ModContent.ProjectileType(); calCloneBroProjLocation = new Vector2(NPC.position.X + NPC.width * 0.5f, NPC.position.Y + NPC.height * 0.5f); calCloneBroProjTargetX = player.position.X + (player.width / 2) - calCloneBroProjLocation.X; @@ -339,12 +329,11 @@ namespace CalamityMod.NPCs.CalClone NPC.rotation = calCloneBroRotation; float calCloneBroChargeSpeed = (NPC.AnyNPCs(ModContent.NPCType()) ? 12f : 16f) + (death ? 4f * (1f - lifeRatio) : 0f); - calCloneBroChargeSpeed += 4f * enrageScale; if (expertMode) calCloneBroChargeSpeed += 2f; if (revenge) calCloneBroChargeSpeed += 2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) calCloneBroChargeSpeed *= 1.25f; Vector2 calCloneBroChargeCenter = new Vector2(NPC.position.X + NPC.width * 0.5f, NPC.position.Y + NPC.height * 0.5f); diff --git a/NPCs/CalamityDrawParameterNPC.cs b/NPCs/CalamityDrawParameterNPC.cs index b05b4f6b4a..40c5bf6185 100644 --- a/NPCs/CalamityDrawParameterNPC.cs +++ b/NPCs/CalamityDrawParameterNPC.cs @@ -101,7 +101,7 @@ namespace CalamityMod.NPCs return false; // Do not draw if the npc does not have miracle blight, or has the polarity effect. - if (calNPC.miracleBlight <= 0 || polNPC.CurPolarity > 0f) + if (!calNPC.miracleBlight || polNPC.CurPolarity > 0f) return false; // Do not draw if the current player has the trippy effect. @@ -121,7 +121,7 @@ namespace CalamityMod.NPCs return false; // I don't know who would be using this while also inflicting miracle blight, but in that rare case, do not draw these. - if (calNPC.miracleBlight > 0) + if (calNPC.miracleBlight) return false; // Do not draw if the npc doesn't have the polarity effect. diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index f00cfe65de..502a33b798 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -19,6 +19,7 @@ using CalamityMod.Graphics.Renderers.CalamityRenderers; using CalamityMod.Items; using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; +using CalamityMod.Items.Armor.PlagueReaper; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.Tools; using CalamityMod.Items.Weapons.Melee; @@ -148,10 +149,25 @@ namespace CalamityMod.NPCs /// public bool? VulnerableToWater = null; - public const double BaseDoTDamageMult = 1D; - public const double VulnerableToDoTDamageMult = 2D; - public const double VulnerableToDoTDamageMult_Worms_SlimeGod = 1.5; - public const double ResistantToDoTDamageMult = 0.5; + public const float BaseDoTDamageMult = 1f; + public const float VulnerableToDoTDamageMult = 2f; + public const float VulnerableToDoTDamageMult_Worms_SlimeGod = 1.5f; + public const float ResistantToDoTDamageMult = 0.5f; + + public StatModifier TypelessDebuffMultiplier = new StatModifier(); + public StatModifier HeatDebuffMultiplier = new StatModifier(); + public StatModifier ColdDebuffMultiplier = new StatModifier(); + public StatModifier SicknessDebuffMultiplier = new StatModifier(); + public StatModifier WaterDebuffMultiplier = new StatModifier(); + public StatModifier ElectricDebuffMultiplier = new StatModifier(); + + // These are all recalculated constantly, while the regular ones are recalulated only on hit + public StatModifier ActiveTypelessDebuffMultiplier = new StatModifier(); + public StatModifier ActiveHeatDebuffMultiplier = new StatModifier(); + public StatModifier ActiveColdDebuffMultiplier = new StatModifier(); + public StatModifier ActiveSicknessDebuffMultiplier = new StatModifier(); + public StatModifier ActiveWaterDebuffMultiplier = new StatModifier(); + public StatModifier ActiveElectricDebuffMultiplier = new StatModifier(); // Cold debuff effects public bool IncreasedColdEffects_EskimoSet = false; @@ -273,16 +289,20 @@ namespace CalamityMod.NPCs /// Tracks the current slowing debuff cooldown for this NPC. public int debuffResistanceTimer = 0; - // Debuffs - public int vaporfied = 0; - public int timeSlow = 0; - public int gState = 0; - public int tesla = 0; - public int tSad = 0; - public int eutrophication = 0; - public int webbed = 0; - public int electrified = 0; - public int pearlAura = 0; + #region Debuffs + public bool vaporfied = false; + public bool timeDistortion = false; + public bool glacialState = false; + public bool galvanicCorrosion = false; + public bool temporalSadness = false; + public bool eutrophication = false; + public bool webbed = false; + public bool electrified = false; + public bool pearlAura = false; + + public float manaBurn = 0f; + public float manaBurnPeak = 0f; + public float playerManaBurnIntensity = 0f; /// /// Counter variable that increments while the NPC is inflicted with Pearl Aura.
/// Used to determine when Giant Pearl's pearl shards should rain down onto the NPC. @@ -293,23 +313,22 @@ namespace CalamityMod.NPCs /// Used for properly counting pearl shard amount and for giving pearl shards an owner. ///
public int pearlAuraOwner = -1; - public int bBlood = 0; - public int brainRot = 0; - public int heavybleeding = 0; - public int laceration = 0; - public int elementalMix = 0; - public int marked = 0; - public int absorberAffliction = 0; - public int irradiated = 0; + public bool burningBlood = false; + public bool brainRot = false; + public bool heavyBleeding = false; + public bool laceration = false; + public bool elementalMix = false; + public bool markedForDeath = false; + public bool absorberAffliction = false; + public bool irradiated = false; public double irradiatedContactBoost = 1.5; - public int bFlames = 0; - public int demonicFlames = 0; + public bool brimstoneFlames = false; + public bool demonicFlames = false; public int demonicFlamesBonusDamage = 0; - public int hFlames = 0; - /// Plague debuff. - public int pFlames = 0; - public int aCrunch = 0; - public int crumble = 0; + public bool holyFlames = false; + public bool plague = false; + public bool armorCrunch = false; + public bool crumble = false; public int antlionCloudDebuffTimer = 0; public bool scionsCurioEffected = false; @@ -369,40 +388,41 @@ namespace CalamityMod.NPCs /// Counter used for removing stacks of Shred. The number of stacks is subtracted every frame, and when it hits zero, it is reset and one stack is removed. public int somaShredFalloff = Shred.StackFalloffFrames; - public int cDepth = 0; - public int rTide = 0; - public int hPressure = 0; - public int gsInferno = 0; - public int dragonFire = 0; - public int vermillionFlux = 0; - public int auricRebuke = 0; - public int staticDischarge = 0; - public int miracleBlight = 0; - public int astralInfection = 0; - public int wDeath = 0; - public int nightwither = 0; + public bool crushDepth = false; + public bool riptide = false; + public bool hadopelagicPressure = false; + public bool godSlayerInferno = false; + public bool dragonFire = false; + public bool vermillionFlux = false; + public bool auricRebuke = false; + public bool staticDischarge = false; + public bool miracleBlight = false; + public bool astralInfection = false; + public bool whisperingDeath = false; + public bool nightwither = false; /// If greater than 0, this NPC has been "shocked" by Ilmeris' Spark's on hurt effect. public int shocked = 0; - public int voidfrost = 0; - public int shellfishVore = 0; - public int clamDebuff = 0; - public int sulphurPoison = 0; + public bool voidfrost = false; + public bool shellfishStaffDebuff = false; + public bool snapClamDebuff = false; + public bool sulphurPoison = false; /// If greater than 0, makes this NPC constantly spawn heart gores. public int ladHearts = 0; - public int relicOfResilienceWeakness = 0; + public bool relicOfResilienceWeakness = false; /// Cooldown variable for spawning Gauss Dagger's gauss flux projectiles. public int GaussFluxTimer = 0; - public int sagePoisonTime = 0; + public bool sagePoison = false; public int sagePoisonDamage = 0; - public int vulnerabilityHex = 0; - public int trueVulnerabilityHex = 0; - public int banishingFire = 0; - public int wither = 0; + public bool vulnerabilityHex = false; + public bool trueVulnerabilityHex = false; + public bool banishingFire = false; + public bool wither = false; /// /// If greater than 0, this enemy will appear to disintegrate into ash when killed.
/// Used by Rancor's laser beam. ///
public int ashesOnDeath = 0; + #endregion // whoAmI Variables public static int[] bobbitWormBottom = new int[5]; @@ -462,6 +482,7 @@ namespace CalamityMod.NPCs // Drawing variables. public FireParticleSet VulnerabilityHexFireDrawer = null; + public FireParticleSet ManaBurnFireDrawer = null; /// /// Boss Enrage variable for use with the boss health UI.
@@ -569,30 +590,30 @@ namespace CalamityMod.NPCs myClone.debuffResistanceTimer = debuffResistanceTimer; myClone.vaporfied = vaporfied; - myClone.timeSlow = timeSlow; - myClone.gState = gState; - myClone.tesla = tesla; - myClone.tSad = tSad; + myClone.timeDistortion = timeDistortion; + myClone.glacialState = glacialState; + myClone.galvanicCorrosion = galvanicCorrosion; + myClone.temporalSadness = temporalSadness; myClone.eutrophication = eutrophication; myClone.webbed = webbed; myClone.electrified = electrified; myClone.pearlAura = pearlAura; myClone.pearlAuraCounter = pearlAuraCounter; - myClone.bBlood = bBlood; + myClone.burningBlood = burningBlood; myClone.brainRot = brainRot; - myClone.heavybleeding = heavybleeding; + myClone.heavyBleeding = heavyBleeding; myClone.laceration = laceration; myClone.elementalMix = elementalMix; - myClone.marked = marked; + myClone.markedForDeath = markedForDeath; myClone.absorberAffliction = absorberAffliction; myClone.irradiated = irradiated; myClone.irradiatedContactBoost = irradiatedContactBoost; - myClone.bFlames = bFlames; + myClone.brimstoneFlames = brimstoneFlames; myClone.demonicFlames = demonicFlames; myClone.demonicFlamesBonusDamage = demonicFlamesBonusDamage; - myClone.hFlames = hFlames; - myClone.pFlames = pFlames; - myClone.aCrunch = aCrunch; + myClone.holyFlames = holyFlames; + myClone.plague = plague; + myClone.armorCrunch = armorCrunch; myClone.crumble = crumble; myClone.antlionCloudDebuffTimer = antlionCloudDebuffTimer; @@ -627,27 +648,27 @@ namespace CalamityMod.NPCs myClone.somaShredApplicator = somaShredApplicator; myClone.somaShredFalloff = somaShredFalloff; - myClone.cDepth = cDepth; - myClone.rTide = rTide; - myClone.hPressure = hPressure; - myClone.gsInferno = gsInferno; + myClone.crushDepth = crushDepth; + myClone.riptide = riptide; + myClone.hadopelagicPressure = hadopelagicPressure; + myClone.godSlayerInferno = godSlayerInferno; myClone.miracleBlight = miracleBlight; myClone.dragonFire = dragonFire; myClone.vermillionFlux = vermillionFlux; myClone.auricRebuke = auricRebuke; myClone.staticDischarge = staticDischarge; myClone.astralInfection = astralInfection; - myClone.wDeath = wDeath; + myClone.whisperingDeath = whisperingDeath; myClone.nightwither = nightwither; myClone.shocked = shocked; myClone.voidfrost = voidfrost; - myClone.shellfishVore = shellfishVore; - myClone.clamDebuff = clamDebuff; + myClone.shellfishStaffDebuff = shellfishStaffDebuff; + myClone.snapClamDebuff = snapClamDebuff; myClone.sulphurPoison = sulphurPoison; myClone.ladHearts = ladHearts; myClone.relicOfResilienceWeakness = relicOfResilienceWeakness; myClone.GaussFluxTimer = GaussFluxTimer; - myClone.sagePoisonTime = sagePoisonTime; + myClone.sagePoison = sagePoison; myClone.sagePoisonDamage = sagePoisonDamage; myClone.vulnerabilityHex = vulnerabilityHex; myClone.trueVulnerabilityHex = trueVulnerabilityHex; @@ -657,6 +678,7 @@ namespace CalamityMod.NPCs // This gets set up as needed. myClone.VulnerabilityHexFireDrawer = null; + myClone.ManaBurnFireDrawer = null; myClone.CurrentlyEnraged = CurrentlyEnraged; @@ -757,6 +779,79 @@ namespace CalamityMod.NPCs CanHaveBossHealthBar = false; ShouldCloseHPBar = false; if (arcZapCooldown > 0) { arcZapCooldown--; } + + //Debuff Bool clearing. + // Doze 2jun2025 - Moved here from PostAI so drawing can read the bools. + if (debuffResistanceTimer > 0) + debuffResistanceTimer--; + + timeDistortion = false; + galvanicCorrosion = false; + glacialState = false; + temporalSadness = false; + eutrophication = false; + webbed = false; + vaporfied = false; + electrified = false; + pearlAura = false; + burningBlood = false; + brainRot = false; + heavyBleeding = false; + laceration = false; + elementalMix = false; + if (!trueVulnerabilityHex && !vulnerabilityHex) + { + cursorFocus = 0; + } + trueVulnerabilityHex = false; + vulnerabilityHex = false; + markedForDeath = false; + absorberAffliction = false; + irradiated = false; + if (scionsCurioEffected) + irradiatedContactBoost = 2f; + brimstoneFlames = false; + if (!demonicFlames) + demonicFlamesBonusDamage = 0; + demonicFlames = false; + holyFlames = false; + plague = false; + // Soma Prime's Shred stacks have a unique falloff mechanic in the debuff's own file. + armorCrunch = false; + crumble = false; + crushDepth = false; + hadopelagicPressure = false; + riptide = false; + godSlayerInferno = false; + dragonFire = false; + vermillionFlux = false; + auricRebuke = false; + staticDischarge = false; + miracleBlight = false; + astralInfection = false; + whisperingDeath = false; + nightwither = false; + if (shocked > 0) + shocked--; + voidfrost = false; + shellfishStaffDebuff = false; + snapClamDebuff = false; + sulphurPoison = false; + sagePoison = false; + if (GaussFluxTimer > 0) + GaussFluxTimer--; + if (ladHearts > 0) + ladHearts--; + banishingFire = false; + wither = false; + if (ashesOnDeath > 0) + ashesOnDeath--; + + if (antlionCloudDebuffTimer > 0) + antlionCloudDebuffTimer--; + if (cursorFocus > 0 && cursorFocus < cursorFocusMax) + cursorFocus--; + relicOfResilienceWeakness = false; } #endregion @@ -799,86 +894,29 @@ namespace CalamityMod.NPCs } } - // Shellfish Staff (and Mollusk armor) debuff stacking - if (shellfishVore > 0) + // Bonebreaker debuff stacking + if (npc.javelined) { - int projectileCount = 0; - int owner = 255; - foreach (Projectile p in Main.ActiveProjectiles) - { - if (p.type == ProjectileType() && - p.ai[0] == 1f && p.ai[1] == npc.whoAmI) - { - owner = p.owner; - projectileCount++; - if (projectileCount >= 5) - { - projectileCount = 5; - break; - } - } - } + if (npc.lifeRegen > 0) + npc.lifeRegen = 0; - Item heldItem = Main.player[owner].ActiveItem(); - int totalDamage = (int)Main.player[owner].GetTotalDamage().ApplyTo(150f); - - if (CalamityUtils.ShouldTriggerSummonPenalty(Main.player[owner], heldItem)) - totalDamage = (int)(totalDamage * BalancingConstants.SummonerCrossClassNerf); - - int totalDisplayedDamage = totalDamage / 5; - ApplyDPSDebuff(projectileCount * totalDamage, projectileCount * totalDisplayedDamage, ref npc.lifeRegen, ref damage); - } - - // Snap Clam debuff stacking - if (clamDebuff > 0) - { int projectileCount = 0; foreach (Projectile p in Main.ActiveProjectiles) { - if (p.ai[0] == 1f && p.ai[1] == npc.whoAmI) - { - if (p.type == ProjectileType()) - projectileCount += 2; - if (p.type == ProjectileType()) - projectileCount++; - } - } - - ApplyDPSDebuff(projectileCount * 15, projectileCount * 3, ref npc.lifeRegen, ref damage); - } - - // Parasitic Scepter debuff stacking - if (irradiated > 0) - { - int projectileCount = 0; - foreach (Projectile p in Main.ActiveProjectiles) - { - if (p.type == ProjectileType() && + if (p.type == ProjectileType() && p.ai[0] == 1f && p.ai[1] == npc.whoAmI) { projectileCount++; } } - int baseIrradiatedDoTValue = (int)(scionsCurioEffected ? 30 : 20); - if (scionsCurioEffected) - { - for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++) - { - Player player = Main.player[playerIndex]; - if (player.active) - { - float playerRangedDamage = player.GetTotalDamage(DamageClass.Ranged).ApplyTo(baseIrradiatedDoTValue * (1 + player.GetTotalCritChance(DamageClass.Ranged) * 0.01f)); - if (playerRangedDamage > baseIrradiatedDoTValue && player.Calamity().scionsCurio) - { - baseIrradiatedDoTValue = (int)playerRangedDamage; - } - } - } - } + if (projectileCount > 0) - ApplyDPSDebuff(projectileCount * baseIrradiatedDoTValue, projectileCount * 4, ref npc.lifeRegen, ref damage); - else - ApplyDPSDebuff(baseIrradiatedDoTValue, baseIrradiatedDoTValue / 20, ref npc.lifeRegen, ref damage); + { + npc.lifeRegen -= projectileCount * 20; + + if (damage < projectileCount * 4) + damage = projectileCount * 4; + } } #endregion @@ -886,460 +924,112 @@ 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 = 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; - bool wetReducedEffectiveness = npc.wet || npc.honeyWet || npc.dripping; - double heatDamageMult = slimed ? ((wormBoss || slimeGod) ? VulnerableToDoTDamageMult_Worms_SlimeGod : VulnerableToDoTDamageMult) : BaseDoTDamageMult; - if (wetReducedEffectiveness) - heatDamageMult *= wormBoss || slimeGod ? 0.66 : ResistantToDoTDamageMult; + bool wormBoss = CalamityNPCTypeSets.DesertScourge.Contains(npc.type) || CalamityNPCTypeSets.EaterOfWorlds.Contains(npc.type) || CalamityNPCTypeSets.Perforators.Contains(npc.type) || + CalamityNPCTypeSets.AquaticScourge.Contains(npc.type) || CalamityNPCTypeSets.AstrumDeus.Contains(npc.type) || CalamityNPCTypeSets.StormWeaver.Contains(npc.type); + bool slimeGod = CalamityNPCTypeSets.SlimeGod.Contains(npc.type); + ActiveHeatDebuffMultiplier = HeatDebuffMultiplier; if (VulnerableToHeat.HasValue) { if (VulnerableToHeat.Value) - heatDamageMult *= slimed ? ((wormBoss || slimeGod) ? 1.25 : 1.5) : ((wormBoss || slimeGod) ? VulnerableToDoTDamageMult_Worms_SlimeGod : VulnerableToDoTDamageMult); + ActiveHeatDebuffMultiplier *= wormBoss ? VulnerableToDoTDamageMult_Worms_SlimeGod : VulnerableToDoTDamageMult; else - heatDamageMult *= slimed ? ((wormBoss || slimeGod) ? 0.66 : ResistantToDoTDamageMult) : ResistantToDoTDamageMult; + ActiveHeatDebuffMultiplier *= ResistantToDoTDamageMult; } - double coldDamageMult = BaseDoTDamageMult; + ActiveColdDebuffMultiplier = ColdDebuffMultiplier; if (VulnerableToCold.HasValue) { if (VulnerableToCold.Value) - coldDamageMult *= wormBoss ? VulnerableToDoTDamageMult_Worms_SlimeGod : VulnerableToDoTDamageMult; + ActiveColdDebuffMultiplier *= wormBoss ? VulnerableToDoTDamageMult_Worms_SlimeGod : VulnerableToDoTDamageMult; else - coldDamageMult *= ResistantToDoTDamageMult; + ActiveColdDebuffMultiplier *= ResistantToDoTDamageMult; } - double sicknessDamageMult = BaseDoTDamageMult; + ActiveSicknessDebuffMultiplier = SicknessDebuffMultiplier; if (VulnerableToSickness.HasValue) { if (VulnerableToSickness.Value) - sicknessDamageMult *= wormBoss ? VulnerableToDoTDamageMult_Worms_SlimeGod : VulnerableToDoTDamageMult; + ActiveSicknessDebuffMultiplier *= wormBoss ? VulnerableToDoTDamageMult_Worms_SlimeGod : VulnerableToDoTDamageMult; else - sicknessDamageMult *= ResistantToDoTDamageMult; + ActiveSicknessDebuffMultiplier *= ResistantToDoTDamageMult; } - bool increasedElectricityDamage = npc.wet || npc.honeyWet || npc.lavaWet || npc.dripping; - double electricityDamageMult = increasedElectricityDamage ? (wormBoss ? VulnerableToDoTDamageMult_Worms_SlimeGod : VulnerableToDoTDamageMult) : BaseDoTDamageMult; + ActiveElectricDebuffMultiplier = ElectricDebuffMultiplier; if (VulnerableToElectricity.HasValue) { if (VulnerableToElectricity.Value) - electricityDamageMult *= increasedElectricityDamage ? (wormBoss ? 1.25 : 1.5) : (wormBoss ? VulnerableToDoTDamageMult_Worms_SlimeGod : VulnerableToDoTDamageMult); + ActiveElectricDebuffMultiplier *= wormBoss ? VulnerableToDoTDamageMult_Worms_SlimeGod : VulnerableToDoTDamageMult; else - electricityDamageMult *= increasedElectricityDamage ? (wormBoss ? 0.66 : ResistantToDoTDamageMult) : ResistantToDoTDamageMult; + ActiveElectricDebuffMultiplier *= ResistantToDoTDamageMult; } - double waterDamageMult = BaseDoTDamageMult; + ActiveWaterDebuffMultiplier = WaterDebuffMultiplier; if (VulnerableToWater.HasValue) { if (VulnerableToWater.Value) - waterDamageMult *= wormBoss ? VulnerableToDoTDamageMult_Worms_SlimeGod : VulnerableToDoTDamageMult; + ActiveWaterDebuffMultiplier *= wormBoss ? VulnerableToDoTDamageMult_Worms_SlimeGod : VulnerableToDoTDamageMult; else - waterDamageMult *= ResistantToDoTDamageMult; + ActiveWaterDebuffMultiplier *= ResistantToDoTDamageMult; } - if (IncreasedColdEffects_EskimoSet) - coldDamageMult += 0.25; - if (IncreasedColdEffects_CryoStone) - coldDamageMult += 0.5; - - if (IncreasedElectricityEffects_Unused) - electricityDamageMult += 0.5; - - if (IncreasedHeatEffects_Fireball) - heatDamageMult += Fireball.HeatDebuffBoost; - if (IncreasedHeatEffects_FireBoots > 0) - heatDamageMult += 0.25 * IncreasedHeatEffects_FireBoots; - if (IncreasedHeatEffects_CinnamonRoll) - heatDamageMult += CinnamonRoll.HeatDebuffBoost; - - if (IncreasedSicknessEffects_ToxicHeart) - sicknessDamageMult += 0.5; - - if (IncreasedWaterEffects_Amulet1) - waterDamageMult += 0.35; - if (IncreasedWaterEffects_Amulet2) - waterDamageMult += 0.6; - - if (IncreasedSicknessAndWaterEffects_CorrosiveSpine) + if (irradiated) { - sicknessDamageMult += 0.25; - waterDamageMult += 0.25; + float irradiatedBoost = scionsCurioEffected ? 1.75f : 1f; + ActiveSicknessDebuffMultiplier += irradiatedBoost; } - if (IncreasedSicknessAndWaterEffects_EvergreenGin) + + if (npc.drippingSlime || npc.drippingSparkleSlime) { - sicknessDamageMult += EvergreenGin.SicknessWaterDebuffBoost; - waterDamageMult += EvergreenGin.SicknessWaterDebuffBoost; + ActiveHeatDebuffMultiplier += 1; } - if (irradiated > 0) + if (npc.wet || npc.honeyWet || npc.lavaWet || npc.dripping) { - double irradiatedBoost = scionsCurioEffected ? 1.75 : 1; - sicknessDamageMult += irradiatedBoost; + ActiveElectricDebuffMultiplier += 1; } - //Amalgam triples all elemental debuff damage. Ironically this excludes Elemental Mix - if (IncreasedDebuffEffects_Amalgam) - { - heatDamageMult += 2; - coldDamageMult += 2; - waterDamageMult += 2; - sicknessDamageMult += 2; - electricityDamageMult += 2; + if (npc.wet || npc.honeyWet || npc.dripping) + { + ActiveColdDebuffMultiplier += 1; + ActiveHeatDebuffMultiplier -= 0.5f; + } + if (npc.HasBuff(BuffID.Chilled)) //Nothing inflicts this at the moment. Put here so we can start using it. + { + ActiveWaterDebuffMultiplier += 1; } - - // Subtract 1 for the vanilla damage multiplier because it's already dealing DoT in the vanilla regen code. - double vanillaHeatDamageMult = heatDamageMult - BaseDoTDamageMult; - double vanillaColdDamageMult = coldDamageMult - BaseDoTDamageMult; - double vanillaSicknessDamageMult = sicknessDamageMult - BaseDoTDamageMult; #endregion // Oiled + + bool hasModHotOil = false; + for (var index = 0; index < npc.buffType.Count(); index++) + { + var type = npc.buffType[index]; + var debuffData = BuffDatasets.DebuffDataset[type]; + if (debuffData == null || debuffData == DebuffData.Oiled) //Oiled is done after + continue; + debuffData.NPCLifeRegenMethod(npc, type, ref index,ref damage); + if (debuffData.HeatDebuffScaling > 0) + hasModHotOil = true; + } + //Oiled comes after so that we can detect if they have a heat debuff bool hasColdOil = npc.onFrostBurn || npc.onFrostBurn2; bool hasHotOil = npc.onFire || npc.onFire2 || npc.onFire3 || npc.shadowFlame; - bool hasModHotOil = bFlames > 0 || demonicFlames > 0 || hFlames > 0 || gsInferno > 0 || dragonFire > 0 || banishingFire > 0 || vulnerabilityHex > 0; - if (npc.oiled && (hasColdOil || hasHotOil || hasModHotOil)) + if (npc.oiled) { - double multiplier = 1D; - if (hasColdOil) - multiplier *= vanillaColdDamageMult; - if (hasHotOil || (hasModHotOil && hasColdOil)) - multiplier *= vanillaHeatDamageMult; - if (hasModHotOil && !hasColdOil && !hasHotOil) - multiplier *= heatDamageMult; - - int baseOiledDoTValue = (int)(50 * multiplier); - npc.lifeRegen -= baseOiledDoTValue; - if (damage < baseOiledDoTValue / 4) - damage = baseOiledDoTValue / 4; + var oil = DebuffData.Oiled; + int index = npc.FindBuffIndex(BuffID.Oiled); + if (hasHotOil || hasColdOil) + npc.lifeRegen -= oil.EnemyVanillaRegenToCancelOut; + oil.NPCLifeRegenMethod(npc, BuffID.Oiled, ref index, ref damage); } - #region Cold Debuffs - // Frostburn - if (npc.onFrostBurn) - { - int baseFrostBurnDoTValue = (int)(16 * vanillaColdDamageMult); - npc.lifeRegen -= baseFrostBurnDoTValue; - if (damage < baseFrostBurnDoTValue / 4) - damage = baseFrostBurnDoTValue / 4; - } - - // Frostbite - if (npc.onFrostBurn2) - { - int baseFrostBiteDoTValue = (int)(50 * vanillaColdDamageMult); - npc.lifeRegen -= baseFrostBiteDoTValue; - if (damage < baseFrostBiteDoTValue / 4) - damage = baseFrostBiteDoTValue / 4; - } - - // Nightwither - if (nightwither > 0) - { - int baseNightwitherDoTValue = (int)(200 * coldDamageMult); - ApplyDPSDebuff(baseNightwitherDoTValue, baseNightwitherDoTValue / 5, ref npc.lifeRegen, ref damage); - } - - // Voidfrost - if (voidfrost > 0) - { - int baseVoidfrostDoTValue = (int)(300 * coldDamageMult); - ApplyDPSDebuff(baseVoidfrostDoTValue, baseVoidfrostDoTValue / 5, ref npc.lifeRegen, ref damage); - } - #endregion - - #region Electricity Debuffs - // Static Discharge - if (staticDischarge > 0) - { - int baseStaticDischargeDoTValue = (int)(5 * (npc.velocity.X == 0 ? 1 : 4) * electricityDamageMult); // 24 on moving targets - ApplyDPSDebuff(baseStaticDischargeDoTValue, baseStaticDischargeDoTValue / 15, ref npc.lifeRegen, ref damage); - } - - // Electrified - if (electrified > 0) - { - int baseElectrifiedDoTValue = (int)(21 * (npc.velocity.X == 0 ? 1 : 4) * electricityDamageMult); // 84 on moving targets - ApplyDPSDebuff(baseElectrifiedDoTValue, baseElectrifiedDoTValue / 22, ref npc.lifeRegen, ref damage); - } - - // Vermillion Flux - if (vermillionFlux > 0) - { - int baseVermillionFluxDoTValue = (int)(100 * (npc.velocity.X == 0 ? 1 : 4) * electricityDamageMult); // 400 on moving targets - ApplyDPSDebuff(baseVermillionFluxDoTValue, baseVermillionFluxDoTValue / 40, ref npc.lifeRegen, ref damage); - } - - // Auric Rebuke - if (auricRebuke > 0) - { - int baseAuricRebukeDoTValue = (int)(200 * (npc.velocity.X == 0 ? 1 : 4) * electricityDamageMult); // 800 on moving targets - ApplyDPSDebuff(baseAuricRebukeDoTValue, baseAuricRebukeDoTValue / 70, ref npc.lifeRegen, ref damage); - } - #endregion - - #region Heat Debuffs - // On Fire - if (npc.onFire) - { - int baseOnFireDoTValue = (int)(12 * vanillaHeatDamageMult); - npc.lifeRegen -= baseOnFireDoTValue; - if (damage < baseOnFireDoTValue / 4) - damage = baseOnFireDoTValue / 4; - } - - // Hellfire - if (npc.onFire3) - { - int baseHellfireDoTValue = (int)(30 * vanillaHeatDamageMult); - npc.lifeRegen -= baseHellfireDoTValue; - if (damage < baseHellfireDoTValue / 4) - damage = baseHellfireDoTValue / 4; - } - - // Cursed Inferno - if (npc.onFire2) - { - int baseCursedInfernoDoTValue = (int)(48 * vanillaHeatDamageMult); - npc.lifeRegen -= baseCursedInfernoDoTValue; - if (damage < baseCursedInfernoDoTValue / 4) - damage = baseCursedInfernoDoTValue / 4; - } - - // Shadowflame - if (npc.shadowFlame) - { - int baseShadowFlameDoTValue = (int)(60 * vanillaHeatDamageMult); - npc.lifeRegen -= baseShadowFlameDoTValue; - if (damage < baseShadowFlameDoTValue / 4) - damage = baseShadowFlameDoTValue / 4; - } - - // Daybroken - // 18OCT2023: Ozzatron: im not gonna sugarcoat it - // vanilla debuff damage from Daybreak impales scales linearly up to 8 for 800 DPS - // instead of allowing this entire 800 DPS to be multiplied by heat weakness + heat DoT bonuses, - // each Daybreak spear beyond the first is only affected 25% as much by weaknesses or resistances. - // This also stops Daybreak's DPS from being utterly shafted by heat resistance. - // As no other weapon can stack Daybroken, this has no effect on other weapons (they count as "1 Daybreak spear") - if (npc.daybreak) - { - int numImpaledSpears = 0; - for (int k = 0; k < Main.maxProjectiles; k++) - { - if (Main.projectile[k].active && Main.projectile[k].type == ProjectileID.Daybreak && Main.projectile[k].ai[0] == 1f && Main.projectile[k].ai[1] == npc.whoAmI) - numImpaledSpears++; - } - - // If there are no Daybreak impaled spears, Daybroken has 1x potency (it was applied some other way) - float daybrokenMultiplier = numImpaledSpears <= 1 ? 1f : (1f + 0.25f * (numImpaledSpears - 1)); - - int baseDaybreakDoTValue = (int)(daybrokenMultiplier * 2 * 100 * vanillaHeatDamageMult); - npc.lifeRegen -= baseDaybreakDoTValue; - if (damage < baseDaybreakDoTValue / 4) - damage = baseDaybreakDoTValue / 4; - } - - // Brimstone Flames - if (bFlames > 0) - { - int baseBrimstoneFlamesDoTValue = (int)(60 * heatDamageMult); - ApplyDPSDebuff(baseBrimstoneFlamesDoTValue, baseBrimstoneFlamesDoTValue / 5, ref npc.lifeRegen, ref damage); - } - - // Demonic Flames - // An unresistable fire debuff that you can set the damage of when it is applied - // This way it can be viable for multiple tiers - if (demonicFlames > 0) - { - int baseDemonicFlamesDoTValue = (int)((demonicFlamesBonusDamage) * Math.Max(heatDamageMult, 1)); - ApplyDPSDebuff(baseDemonicFlamesDoTValue, baseDemonicFlamesDoTValue / 15, ref npc.lifeRegen, ref damage); - } - - // Holy Flames - if (hFlames > 0) - { - int baseHolyFlamesDoTValue = (int)(300 * heatDamageMult); - ApplyDPSDebuff(baseHolyFlamesDoTValue, baseHolyFlamesDoTValue / 5, ref npc.lifeRegen, ref damage); - } - - // God Slayer Inferno - if (gsInferno > 0) - { - int baseGodSlayerInfernoDoTValue = (int)(500 * heatDamageMult); - ApplyDPSDebuff(baseGodSlayerInfernoDoTValue, baseGodSlayerInfernoDoTValue / 5, ref npc.lifeRegen, ref damage); - } - - // Dragonfire - if (dragonFire > 0) - { - int baseDragonFireDoTValue = (int)(960 * heatDamageMult); - ApplyDPSDebuff(baseDragonFireDoTValue, baseDragonFireDoTValue / 5, ref npc.lifeRegen, ref damage); - } - - // Vulnerability Hex - if (vulnerabilityHex > 0) - { - int baseVulnerabilityHexDoTValue = (int)(VulnerabilityHex.DPS * heatDamageMult); - ApplyDPSDebuff(baseVulnerabilityHexDoTValue, VulnerabilityHex.TickNumber, ref npc.lifeRegen, ref damage); - } - - // True Vulnerability Hex - if (trueVulnerabilityHex > 0) - { - int baseTrueVHexDoTValue = (int)(TrueVulnerabilityHex.DPS * heatDamageMult); - ApplyDPSDebuff(baseTrueVHexDoTValue, TrueVulnerabilityHex.TickNumber, ref npc.lifeRegen, ref damage); - } - - // Banishing Fire - if (banishingFire > 0) - { - int baseBanishingFireDoTValue = (int)((npc.lifeMax >= 1000000 ? npc.lifeMax / 500 : 4000) * heatDamageMult); - ApplyDPSDebuff(baseBanishingFireDoTValue, baseBanishingFireDoTValue / 5, ref npc.lifeRegen, ref damage); - } - #endregion - - #region Sickness Debuffs - // Poisoned - if (npc.poisoned) - { - int basePoisonedDoTValue = (int)(12 * vanillaSicknessDamageMult); - npc.lifeRegen -= basePoisonedDoTValue; - if (damage < basePoisonedDoTValue / 4) - damage = basePoisonedDoTValue / 4; - } - - // Venom - if (npc.venom) - { - int baseVenomDoTValue = (int)(60 * vanillaSicknessDamageMult); - npc.lifeRegen -= baseVenomDoTValue; - if (damage < baseVenomDoTValue / 4) - damage = baseVenomDoTValue / 4; - } - - // Burning Blood - if (bBlood > 0) - { - int baseBurningBloodDoTValue = (int)(40 * sicknessDamageMult); - ApplyDPSDebuff(baseBurningBloodDoTValue, baseBurningBloodDoTValue / 5, ref npc.lifeRegen, ref damage); - } - - // Brain Rot - if (brainRot > 0) - { - int baseBrainRotDoTValue = (int)(40 * sicknessDamageMult); - ApplyDPSDebuff(baseBrainRotDoTValue, baseBrainRotDoTValue / 5, ref npc.lifeRegen, ref damage); - } - - // Astral Infection - if (astralInfection > 0) - { - int baseAstralInfectionDoTValue = (int)(75 * sicknessDamageMult); - ApplyDPSDebuff(baseAstralInfectionDoTValue, baseAstralInfectionDoTValue / 5, ref npc.lifeRegen, ref damage); - } - - // Plague - if (pFlames > 0) - { - int basePlagueDoTValue = (int)(100 * sicknessDamageMult); - ApplyDPSDebuff(basePlagueDoTValue, basePlagueDoTValue / 5, ref npc.lifeRegen, ref damage); - } - - // Sulphuric Poisoning - if (sulphurPoison > 0) - { - int baseSulphurPoisonDoTValue = (int)(240 * sicknessDamageMult); - ApplyDPSDebuff(baseSulphurPoisonDoTValue, baseSulphurPoisonDoTValue / 5, ref npc.lifeRegen, ref damage); - } - - //Absorber Affliction - if (absorberAffliction > 0) - { - int baseAbsorberDoTValue = (int)(400 * sicknessDamageMult); - ApplyDPSDebuff(baseAbsorberDoTValue, baseAbsorberDoTValue / 65, ref npc.lifeRegen, ref damage); - } - #endregion - - #region Water Debuffs - // Riptide - if (rTide > 0) - { - int baseRiptideDoTValue = (int)(30 * waterDamageMult); - ApplyDPSDebuff(baseRiptideDoTValue, baseRiptideDoTValue / 3, ref npc.lifeRegen, ref damage); - } - - // Crush Depth - if (cDepth > 0) - { - int baseCrushDepthDoTValue = (int)(100 * waterDamageMult); - ApplyDPSDebuff(baseCrushDepthDoTValue, baseCrushDepthDoTValue / 2, ref npc.lifeRegen, ref damage); - } - - //Hadopelagic Pressure - if (hPressure > 0) - { - int baseHadopelagicPressureDoTValue = (int)(400 * waterDamageMult); - ApplyDPSDebuff(baseHadopelagicPressureDoTValue, baseHadopelagicPressureDoTValue / 2, ref npc.lifeRegen, ref damage); - } - #endregion - if (npc.dryadBane) { - // Buffs match 1:1 with Town NPC buffs - // See CalamityGlobalTownNPC: BuffTownNPC - float buffedDryadsBaneMult = 0f + - (NPC.downedMoonlord ? 0.6f : 0f) + - (DownedBossSystem.downedProvidence ? 0.2f : 0f) + - (DownedBossSystem.downedPolterghast ? 0.2f : 0f) + - (DownedBossSystem.downedDoG ? 0.2f : 0f) + - (DownedBossSystem.downedYharon ? 0.2f : 0f) + - (DownedBossSystem.downedExoMechs ? 0.6f : 0f) + - (DownedBossSystem.downedCalamitas ? 0.6f : 0f); - if (Main.expertMode) - buffedDryadsBaneMult *= Main.GameModeInfo.TownNPCDamageMultiplier; - int buffedDryadsBaneDoTValue = 2 * (int)(4 * buffedDryadsBaneMult); - npc.lifeRegen -= buffedDryadsBaneDoTValue; - - // Scales damage tick if greater than the vanilla amount - float vanillaDryadsBaneMult = 1f + - (NPC.downedBoss1 ? 0.1f : 0f) + - (NPC.downedBoss2 ? 0.1f : 0f) + - (NPC.downedBoss3 ? 0.1f : 0f) + - (NPC.downedQueenBee ? 0.1f : 0f) + - (Main.hardMode ? 0.4f : 0f) + - (NPC.downedMechBoss1 ? 0.15f : 0f) + - (NPC.downedMechBoss1 ? 0.15f : 0f) + - (NPC.downedMechBoss1 ? 0.15f : 0f) + - (NPC.downedPlantBoss ? 0.15f : 0f) + - (NPC.downedGolemBoss ? 0.15f : 0f) + - (NPC.downedAncientCultist ? 0.15f : 0f); - if (Main.expertMode) - vanillaDryadsBaneMult *= Main.GameModeInfo.TownNPCDamageMultiplier; - int totalDryadsBaneDoTValue = 2 * (int)(4 * vanillaDryadsBaneMult) + buffedDryadsBaneDoTValue; - if (damage < totalDryadsBaneDoTValue / 6) - damage = totalDryadsBaneDoTValue / 6; + } // Debuffs that aren't affected by weaknesses or resistances. - if (vaporfied > 0) - ApplyDPSDebuff(30, 6, ref npc.lifeRegen, ref damage); if (somaShredStacks > 0) Shred.TickDebuff(npc, this); - if (sagePoisonTime > 0) - { - // npc.Calamity().sagePoisonDamage = 50 * (float)(Math.Pow(totalSageSpirits, 0.9D) + Math.Pow(totalSageSpirits, 1.13D)) * 0.5f - // See SageNeedle.cs for details - ApplyDPSDebuff(npc.Calamity().sagePoisonDamage, npc.Calamity().sagePoisonDamage / 5, ref npc.lifeRegen, ref damage); - } - if (heavybleeding > 0) - ApplyDPSDebuff(80, 10, ref npc.lifeRegen, ref damage); - if (laceration > 0) - ApplyDPSDebuff(400, 100, ref npc.lifeRegen, ref damage); - if (elementalMix > 0) - ApplyDPSDebuff(400, 100, ref npc.lifeRegen, ref damage); - if (miracleBlight > 0) - ApplyDPSDebuff(3000, 500, ref npc.lifeRegen, ref damage); // Reduce DoT on worm bosses and Creepers by 75%. if ((wormBoss || npc.type == NPCID.Creeper) && npc.lifeRegen < 0) @@ -1352,6 +1042,30 @@ namespace CalamityMod.NPCs if (((npc.ai[2] % 2f == 0f && npc.type == NPCID.EaterofWorldsBody) || npc.type == NPCID.EaterofWorldsHead) && (CalamityWorld.death || BossRushEvent.BossRushActive)) npc.lifeRegen = 0; } + + // Mana Burn + //This is at the end to leave it full effect on worms, and to force the DOT numbers to match mana burn + if (manaBurn > 0) + { + if (manaBurnPeak >= 0.1f) + { + manaBurnPeak *= 0.999f; + } + manaBurnPeak = Math.Max(manaBurnPeak, manaBurn); + int burnPerSecond = (int)MathF.Ceiling(manaBurn * 0.5f); + manaBurn -= burnPerSecond / 60f; + + if (npc.lifeRegen > 0) + npc.lifeRegen = 0; + + npc.lifeRegen -= burnPerSecond * 2; + damage += (int)(burnPerSecond * 0.5f); + } + else + { + manaBurnPeak = 0; + playerManaBurnIntensity = 0; + } } public void ApplyDPSDebuff(int lifeRegenValue, int damageValue, ref int lifeRegen, ref int damage) @@ -1378,7 +1092,6 @@ namespace CalamityMod.NPCs { NPCID.GolemFistLeft, 0.15f }, { NPCID.GolemFistRight, 0.15f }, { NPCID.GolemHead, 0.15f }, - { NPCID.GolemHeadFree, 0.15f }, { NPCID.MoonLordCore, 0.15f }, { NPCID.MoonLordHand, 0.15f }, { NPCID.MoonLordHead, 0.15f }, @@ -1537,7 +1250,7 @@ namespace CalamityMod.NPCs } // Aquatic Scourge sets kill time in AI, not here. - if (BossKillTimes.TryGetValue(npc.type, out int revKillTime) && !AquaticScourgeIDList.Includes(npc.type)) + if (BossKillTimes.TryGetValue(npc.type, out int revKillTime) && !CalamityNPCTypeSets.AquaticScourge.Contains(npc.type)) { KillTime = revKillTime; } @@ -1580,6 +1293,14 @@ namespace CalamityMod.NPCs BoundNPCSafety(Mod, npc); } + + public override bool? CanFallThroughPlatforms(NPC npc) + { + // Allow the free Golem Head to pass through platforms in Rev+ + if (npc.type == NPCID.GolemHeadFree && (CalamityWorld.revenge || BossRushEvent.BossRushActive)) + return true; + return base.CanFallThroughPlatforms(npc); + } #endregion #region Boss Health UI Variable Setting @@ -1621,7 +1342,7 @@ namespace CalamityMod.NPCs break; case NPCID.Golem: - npc.lifeMax = 30000; + npc.lifeMax = 40000; break; case NPCID.GolemHead: @@ -1686,7 +1407,7 @@ namespace CalamityMod.NPCs #region Boss Rush Stat Changes private void BossRushStatChanges(NPC npc, Mod mod) { - if (BossRushHPChangeDict.TryGet(npc.type, out var newHP)) + if (CalamityNPCSets.BossRushHealth.TryGetValue(npc.type, out var newHP)) { npc.lifeMax = newHP; } @@ -1696,10 +1417,9 @@ namespace CalamityMod.NPCs #region Revengeance and Death Mode Stat Changes private void RevDeathStatChanges(NPC npc, Mod mod) { - if (DeathModeSplittingWormList.Includes(npc.type)) + if (CalamityNPCSets.DeathModeSplittingWorm[npc.type] && CalamityWorld.death) { - if (CalamityWorld.death) - npc.lifeMax = (int)Math.Round(npc.lifeMax * 0.15); + npc.lifeMax = (int)Math.Round(npc.lifeMax * 0.15); } if (npc.type == NPCID.Mothron) @@ -1731,16 +1451,16 @@ namespace CalamityMod.NPCs } else if (npc.type == NPCID.Golem) { - npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.275); + npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.2); npc.npcSlots = 64f; } else if (npc.type == NPCID.GolemHead) { npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.2); } - else if (npc.type == NPCID.GolemHeadFree) + else if (npc.type == NPCID.GolemFistLeft || npc.type == NPCID.GolemFistRight) { - npc.dontTakeDamage = false; + npc.scale *= 1.15f; } else if (npc.type == NPCID.HallowBoss) { @@ -1752,7 +1472,7 @@ namespace CalamityMod.NPCs npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.2); npc.npcSlots = 32f; } - else if (DestroyerIDList.Includes(npc.type)) + else if (CalamityNPCTypeSets.Destroyer.Contains(npc.type)) { npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.25); npc.scale *= Main.zenithWorld ? 2f : 1.2f; @@ -1833,7 +1553,7 @@ namespace CalamityMod.NPCs { npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.4); } - else if (EaterOfWorldsIDList.Includes(npc.type)) + else if (CalamityNPCTypeSets.EaterOfWorlds.Contains(npc.type)) { npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.2); @@ -1855,13 +1575,13 @@ namespace CalamityMod.NPCs else if (npc.type == NPCID.KingSlime) { if (CalamityWorld.death) - npc.scale = CalamityWorld.LegendaryMode ? 6f : 2.5f; + npc.scale = Main.getGoodWorld ? 6f : 2.5f; else - npc.scale = CalamityWorld.LegendaryMode ? 3f : 1.5f; + npc.scale = Main.getGoodWorld ? 3f : 1.5f; - npc.lifeMax = (int)Math.Round(npc.lifeMax * (CalamityWorld.LegendaryMode ? 1.8 : 1.5)); + npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.5); } - else if ((npc.type == NPCID.Wraith || npc.type == NPCID.Mimic || npc.type == NPCID.Reaper || npc.type == NPCID.PresentMimic || npc.type == NPCID.SandElemental || npc.type == NPCID.Ghost) && CalamityWorld.LegendaryMode) + else if ((npc.type == NPCID.Wraith || npc.type == NPCID.Mimic || npc.type == NPCID.Reaper || npc.type == NPCID.PresentMimic || npc.type == NPCID.SandElemental || npc.type == NPCID.Ghost) && Main.getGoodWorld) { npc.knockBackResist = 0f; } @@ -1929,7 +1649,6 @@ namespace CalamityMod.NPCs // Organic undead or other enemies that are covered in slime. case NPCID.ArmedZombieSlimed: case NPCID.BigSlimedZombie: - case NPCID.BunnySlimed: case NPCID.SlimedZombie: case NPCID.SmallSlimedZombie: VulnerableToCold = true; @@ -2569,6 +2288,204 @@ namespace CalamityMod.NPCs VulnerableToHeat = true; VulnerableToSickness = false; break; + + // Town NPCs. Mostly irrelevant, but it displays in the Bestiary + case NPCID.Merchant: + case NPCID.Nurse: + case NPCID.ArmsDealer: + case NPCID.Dryad: + case NPCID.Guide: + case NPCID.OldMan: + case NPCID.Demolitionist: + case NPCID.Clothier: + case NPCID.BoundGoblin: + case NPCID.BoundWizard: + case NPCID.GoblinTinkerer: + case NPCID.Wizard: + case NPCID.BoundMechanic: + case NPCID.Mechanic: + case NPCID.Truffle: + case NPCID.Steampunker: + case NPCID.DyeTrader: + case NPCID.PartyGirl: + case NPCID.Painter: + case NPCID.WitchDoctor: + case NPCID.Pirate: + case NPCID.Stylist: + case NPCID.WebbedStylist: + case NPCID.TravellingMerchant: + case NPCID.Angler: + case NPCID.SleepingAngler: + case NPCID.DD2Bartender: + case NPCID.BartenderUnconscious: + case NPCID.Golfer: + case NPCID.GolferRescue: + case NPCID.BestiaryGirl: + case NPCID.Princess: + case NPCID.TownCat: + case NPCID.TownDog: + case NPCID.TownBunny: + VulnerableToCold = true; + VulnerableToHeat = true; + VulnerableToSickness = true; + break; + case NPCID.SantaClaus: + VulnerableToCold = false; + VulnerableToHeat = true; + VulnerableToSickness = true; + break; + case NPCID.TaxCollector: + VulnerableToCold = true; + VulnerableToHeat = false; + VulnerableToSickness = true; + break; + // Non-organic Town NPCs. + case NPCID.Cyborg: + case NPCID.BoundTownSlimeOld: + VulnerableToSickness = false; + break; + // Town Slimes. + case NPCID.TownSlimeBlue: + case NPCID.TownSlimeGreen: + case NPCID.TownSlimeOld: + case NPCID.TownSlimePurple: + case NPCID.TownSlimeRainbow: + case NPCID.TownSlimeRed: + case NPCID.TownSlimeYellow: + case NPCID.TownSlimeCopper: + case NPCID.BoundTownSlimePurple: + VulnerableToSickness = false; + VulnerableToHeat = true; + break; + + // Critters + case NPCID.Bunny: + case NPCID.Bird: + case NPCID.BirdBlue: + case NPCID.BirdRed: + case NPCID.Squirrel: + case NPCID.Mouse: + case NPCID.BunnySlimed: + case NPCID.BunnyXmas: + case NPCID.Firefly: + case NPCID.Butterfly: + case NPCID.Worm: + case NPCID.LightningBug: + case NPCID.Snail: + case NPCID.GlowingSnail: + case NPCID.Frog: + case NPCID.Duck: + case NPCID.Duck2: + case NPCID.DuckWhite: + case NPCID.DuckWhite2: + case NPCID.ScorpionBlack: + case NPCID.Scorpion: + case NPCID.TruffleWorm: + case NPCID.TruffleWormDigger: + case NPCID.Grasshopper: + case NPCID.GoldBird: + case NPCID.GoldBunny: + case NPCID.GoldButterfly: + case NPCID.GoldFrog: + case NPCID.GoldGrasshopper: + case NPCID.GoldMouse: + case NPCID.GoldWorm: + case NPCID.EnchantedNightcrawler: + case NPCID.Grubby: + case NPCID.Sluggy: + case NPCID.Buggy: + case NPCID.SquirrelRed: + case NPCID.SquirrelGold: + case NPCID.PartyBunny: + case NPCID.BlackDragonfly: + case NPCID.BlueDragonfly: + case NPCID.GreenDragonfly: + case NPCID.OrangeDragonfly: + case NPCID.RedDragonfly: + case NPCID.YellowDragonfly: + case NPCID.GoldDragonfly: + case NPCID.Seagull: + case NPCID.Seagull2: + case NPCID.LadyBug: + case NPCID.GoldLadyBug: + case NPCID.Maggot: + case NPCID.Grebe: + case NPCID.Grebe2: + case NPCID.Rat: + case NPCID.Owl: + case NPCID.WaterStrider: + case NPCID.GoldWaterStrider: + case NPCID.ExplosiveBunny: + case NPCID.EmpressButterfly: + case NPCID.Stinkbug: + case NPCID.ScarletMacaw: + case NPCID.BlueMacaw: + case NPCID.Toucan: + case NPCID.YellowCockatiel: + case NPCID.GrayCockatiel: + case NPCID.Shimmerfly: + case NPCID.BoundTownSlimeYellow: + VulnerableToCold = true; + VulnerableToHeat = true; + VulnerableToSickness = true; + break; + // Water Critters + case NPCID.Goldfish: + case NPCID.GoldfishWalker: + case NPCID.GoldGoldfish: + case NPCID.GoldGoldfishWalker: + case NPCID.Pupfish: + case NPCID.Dolphin: + case NPCID.Turtle: + case NPCID.TurtleJungle: + case NPCID.SeaTurtle: + case NPCID.Seahorse: + case NPCID.GoldSeahorse: + VulnerableToHeat = false; + VulnerableToSickness = true; + VulnerableToElectricity = true; + VulnerableToWater = false; + break; + // Penguins + case NPCID.Penguin: + case NPCID.PenguinBlack: + VulnerableToCold = false; + VulnerableToHeat = true; + VulnerableToSickness = true; + break; + // Fairies + case NPCID.FairyCritterPink: + case NPCID.FairyCritterGreen: + case NPCID.FairyCritterBlue: + VulnerableToSickness = false; + break; + // Gem Critters + case NPCID.GemSquirrelAmethyst: + case NPCID.GemSquirrelTopaz: + case NPCID.GemSquirrelSapphire: + case NPCID.GemSquirrelEmerald: + case NPCID.GemSquirrelRuby: + case NPCID.GemSquirrelDiamond: + case NPCID.GemSquirrelAmber: + case NPCID.GemBunnyAmethyst: + case NPCID.GemBunnyTopaz: + case NPCID.GemBunnySapphire: + case NPCID.GemBunnyEmerald: + case NPCID.GemBunnyDiamond: + case NPCID.GemBunnyAmber: + VulnerableToCold = true; + VulnerableToSickness = true; + VulnerableToWater = true; + break; + // Underworld Critters + case NPCID.HellButterfly: + case NPCID.Lavafly: + case NPCID.MagmaSnail: + VulnerableToCold = true; + VulnerableToHeat = false; + VulnerableToSickness = true; + VulnerableToWater = true; + break; } } #endregion @@ -2578,7 +2495,7 @@ namespace CalamityMod.NPCs { EditGlobalCoinDrops(npc); - if ((npc.boss && npc.type != NPCID.MartianSaucerCore) || BossHPScalingList.Includes(npc.type)) + if ((npc.boss && npc.type != NPCID.MartianSaucerCore) || CalamityNPCSets.ScalesHealthLikeBoss[npc.type]) { double HPBoost = CalamityServerConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)Math.Round(npc.lifeMax * HPBoost); @@ -2590,42 +2507,14 @@ namespace CalamityMod.NPCs case NPCID.EyeofCthulhu: case NPCID.BrainofCthulhu: case NPCID.QueenBee: - case NPCID.Crawdad: - case NPCID.Crawdad2: - case NPCID.ManEater: - case NPCID.AngryTrapper: - case NPCID.Snatcher: - case NPCID.SpikeBall: - case NPCID.DesertBeast: - case NPCID.BoneLee: case NPCID.Paladin: case NPCID.BigMimicCorruption: case NPCID.BigMimicCrimson: case NPCID.BigMimicHallow: - case NPCID.DiggerHead: - case NPCID.SeekerHead: - case NPCID.DuneSplicerHead: - case NPCID.SolarCrawltipedeHead: - case NPCID.Mimic: - case NPCID.SandShark: - case NPCID.SandsharkCorrupt: - case NPCID.SandsharkCrimson: - case NPCID.SandsharkHallow: - case NPCID.Butcher: - case NPCID.DeadlySphere: case NPCID.Mothron: - case NPCID.Reaper: - case NPCID.Psycho: - case NPCID.PresentMimic: - case NPCID.Yeti: - case NPCID.NebulaBeast: - case NPCID.SolarCorite: - case NPCID.StardustWormHead: case NPCID.EaterofWorldsHead: case NPCID.SkeletronHead: case NPCID.WallofFlesh: - case NPCID.TheHungry: - case NPCID.TheHungryII: case NPCID.Spazmatism: case NPCID.Retinazer: case NPCID.TheDestroyer: @@ -2646,11 +2535,7 @@ namespace CalamityMod.NPCs case NPCID.PumpkingBlade: case NPCID.SantaNK1: case NPCID.DukeFishron: - case NPCID.RockGolem: - case NPCID.BloodEelHead: case NPCID.BloodNautilus: - case NPCID.GoblinShark: - case NPCID.ZombieMerman: case NPCID.HallowBoss: case NPCID.QueenSlimeBoss: case NPCID.Deerclops: @@ -2659,10 +2544,6 @@ namespace CalamityMod.NPCs // Enemies that should have coldDamage set to true case NPCID.IceMimic: - canBreakPlayerDefense = true; - npc.coldDamage = true; - break; - case NPCID.IceBat: case NPCID.IceTortoise: npc.coldDamage = true; @@ -2681,11 +2562,6 @@ namespace CalamityMod.NPCs npc.lifeMax = (int)Math.Round(npc.lifeMax * 0.25); break; - case NPCID.ChatteringTeethBomb: - npc.damage = 100; - canBreakPlayerDefense = true; - break; - case NPCID.LarvaeAntlion: npc.lifeMax = 15; break; @@ -2721,8 +2597,6 @@ namespace CalamityMod.NPCs npc.lifeMax = (int)Math.Round(npc.lifeMax * 0.5); npc.damage = (int)Math.Round(npc.damage * DesertEnemyStatMultiplier); npc.defDamage = npc.damage; - // Tomb Crawler Head has 0 defense so there is no need to reduce it - canBreakPlayerDefense = true; break; case NPCID.TombCrawlerBody: @@ -2782,7 +2656,7 @@ namespace CalamityMod.NPCs { if (!NPC.downedMechBossAny) { - if (DestroyerIDList.Includes(npc.type) || npc.type == NPCID.Probe || SkeletronPrimeIDList.Includes(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer) + if (CalamityNPCTypeSets.Destroyer.Contains(npc.type) || npc.type == NPCID.Probe || CalamityNPCTypeSets.SkeletronPrime.Contains(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer) { double multiplier = Main.expertMode ? EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert : EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Classic; npc.lifeMax = (int)Math.Round(npc.lifeMax * multiplier); @@ -2792,7 +2666,7 @@ namespace CalamityMod.NPCs } else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) { - if (DestroyerIDList.Includes(npc.type) || npc.type == NPCID.Probe || SkeletronPrimeIDList.Includes(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer) + if (CalamityNPCTypeSets.Destroyer.Contains(npc.type) || npc.type == NPCID.Probe || CalamityNPCTypeSets.SkeletronPrime.Contains(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer) { double multiplier = Main.expertMode ? EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert : EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Classic; npc.lifeMax = (int)Math.Round(npc.lifeMax * multiplier); @@ -2819,7 +2693,7 @@ namespace CalamityMod.NPCs } } - if (Main.hardMode && HardmodeNPCNerfList.Includes(npc.type)) + if (Main.hardMode && CalamityNPCSets.NerfDamageInHardmode[npc.type]) { npc.damage = (int)Math.Round(npc.damage * 0.75); npc.defDamage = npc.damage; @@ -2827,21 +2701,21 @@ namespace CalamityMod.NPCs if (DownedBossSystem.downedDoG) { - if (PumpkinMoonBuffList.Includes(npc.type)) + if (CalamityNPCSets.IsBuffedPumpkinMoonEnemy[npc.type]) { npc.lifeMax = (int)Math.Round(npc.lifeMax * 3.5); npc.damage += 30; npc.life = npc.lifeMax; npc.defDamage = npc.damage; } - else if (FrostMoonBuffList.Includes(npc.type)) + else if (CalamityNPCSets.IsBuffedFrostMoonEnemy[npc.type]) { npc.lifeMax = (int)Math.Round(npc.lifeMax * 2.5); npc.damage += 30; npc.life = npc.lifeMax; npc.defDamage = npc.damage; } - else if (EclipseBuffList.Includes(npc.type)) + else if (CalamityNPCSets.IsBuffedSolarEclipseEnemy[npc.type]) { npc.lifeMax = (int)Math.Round(npc.lifeMax * 5D); npc.damage += 30; @@ -2852,7 +2726,7 @@ namespace CalamityMod.NPCs if (NPC.downedMoonlord) { - if (BuffedDungeonEnemiesList.Includes(npc.type)) + if (CalamityNPCSets.IsBuffedDungeonEnemy[npc.type]) { npc.lifeMax = (int)Math.Round(npc.lifeMax * 2.5); npc.damage += 30; @@ -2964,7 +2838,7 @@ namespace CalamityMod.NPCs return; bool countsAsBoss = npc.boss || NPCID.Sets.ShouldBeCountedAsBoss[npc.type]; - bool scalesLikeBoss = countsAsBoss || BossHPScalingList.List.Contains(npc.type); + bool scalesLikeBoss = countsAsBoss || CalamityNPCSets.ScalesHealthLikeBoss[npc.type]; bool isCalamityNPC = npc.ModNPC != null && npc.ModNPC.Mod == CalamityMod.Instance; // 14APR2025: Ozzatron: Reworked how Calamity changes the health of Expert+ multiplayer bosses @@ -3062,7 +2936,7 @@ namespace CalamityMod.NPCs // Apply armor penetration based on Calamity debuffs. The hit system manages the sequencing. // Ozzatron 05JAN2023: fixed doubled armor pen, this time for real - int defenseReduction = (marked > 0 && DR <= 0f ? MarkedforDeath.DefenseReduction : 0) + (wither > 0 ? RemsRevenge.WitherDefenseReduction : 0) + miscDefenseLoss; + int defenseReduction = (markedForDeath && DR <= 0f ? MarkedforDeath.DefenseReduction : 0) + (wither ? RemsRevenge.WitherDefenseReduction : 0) + miscDefenseLoss; modifiers.ArmorPenetration += defenseReduction; // DR applies after vanilla defense. @@ -3071,12 +2945,12 @@ namespace CalamityMod.NPCs // Damage reduction on spawn for certain worm bosses. if (CalamityWorld.revenge) { - if (EaterOfWorldsIDList.Includes(npc.type) && newAI[1] < EaterOfWorldsAI.DRIncreaseTime) + if (CalamityNPCTypeSets.EaterOfWorlds.Contains(npc.type) && newAI[1] < EaterOfWorldsAI.DRIncreaseTime) modifiers.FinalDamage *= 1f - (float)Math.Sqrt(MathHelper.Lerp(0f, 0.99f, MathHelper.Clamp(1f - newAI[1] / EaterOfWorldsAI.DRIncreaseTime, 0f, 1f))); - if (DestroyerIDList.Includes(npc.type) && newAI[1] < DestroyerAI.DRIncreaseTime) + if (CalamityNPCTypeSets.Destroyer.Contains(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 (AstrumDeusIDList.Includes(npc.type)) + if (CalamityNPCTypeSets.AstrumDeus.Contains(npc.type)) { float drTime = newAI[0] != 0f ? 300f : 600f; if (newAI[1] < drTime) @@ -3133,18 +3007,22 @@ namespace CalamityMod.NPCs modifiers.FinalDamage *= finalMultiplier; } + //TODO: + //This will need to be adjusted to use DebuffData in the future. + //However, we still need to decide what to actually do with these due to the general flattening of DR amounts and removal from most enemies + //This means that this will be handled in the future private float DefaultDRMath(NPC npc, float DR) { float calcDR = DR; - if (marked > 0) + if (markedForDeath) calcDR *= 0.5f; - if (absorberAffliction > 0) + if (absorberAffliction) calcDR *= 0.8f; - if (npc.Calamity().aCrunch > 0) + if (npc.Calamity().armorCrunch) calcDR *= ArmorCrunch.MultiplicativeDamageReductionEnemy; - if (npc.Calamity().crumble > 0) + if (npc.Calamity().crumble) calcDR *= Crumbling.MultiplicativeDamageReductionEnemy; - if (relicOfResilienceWeakness > 0) + if (relicOfResilienceWeakness) calcDR *= 0.5f; @@ -3242,6 +3120,16 @@ namespace CalamityMod.NPCs if (VulnerabilityHexFireDrawer != null) VulnerabilityHexFireDrawer.Update(); + if (ManaBurnFireDrawer != null) + { + ManaBurnFireDrawer.LocalTimer = 0; + float power = npc.height / 100f; + if (power > 2.75f) + power = 2.75f; + ManaBurnFireDrawer.RelativePower = power * MathHelper.Lerp(0.5f, 1.5f, MathHelper.Clamp(manaBurn / manaBurnPeak, 0, 1)) * playerManaBurnIntensity; + ManaBurnFireDrawer.Update(); + } + SetPatreonTownNPCName(npc, Mod); // Decrement each immune timer if it's greater than 0. @@ -3279,7 +3167,7 @@ namespace CalamityMod.NPCs } // Setting this in SetDefaults will disable expert mode scaling, so put it here instead - if (ZeroContactDamageNPCList.Includes(npc.type) && (npc.type != NPCID.RuneWizard || !Main.zenithWorld)) + if (CalamityNPCSets.DealsZeroContactDamage[npc.type] && !(npc.type == NPCID.RuneWizard && Main.zenithWorld)) npc.damage = 0; // Don't do damage for 42 frames after spawning in @@ -4543,16 +4431,6 @@ namespace CalamityMod.NPCs npc.damage = npc.ai[0] == 2f ? npc.defDamage : 0; break; - case NPCID.DD2GoblinT1: - case NPCID.DD2GoblinT2: - case NPCID.DD2GoblinT3: - npc.damage = (npc.ai[0] > 0f && npc.ai[0] < 24f) ? npc.defDamage : 0; - break; - - case NPCID.PumpkingBlade: - npc.damage = (npc.ai[2] == 2f || npc.ai[2] == 5f) ? npc.defDamage : 0; - break; - case NPCID.Mothron: npc.damage = npc.ai[0] == 3.2f ? (int)Math.Round(npc.defDamage * 1.3) : npc.ai[0] == 2f ? (int)Math.Round(npc.defDamage * 0.5) : 0; break; @@ -4561,10 +4439,6 @@ namespace CalamityMod.NPCs npc.damage = npc.ai[0] == 2.1f ? npc.defDamage : 0; break; - case NPCID.Flocko: - npc.damage = npc.ai[0] > 0f ? npc.defDamage : 0; - break; - case NPCID.Mimic: case NPCID.IceMimic: case NPCID.PresentMimic: @@ -4583,32 +4457,11 @@ namespace CalamityMod.NPCs break; - case NPCID.DeadlySphere: - npc.damage = npc.ai[0] == 1f ? npc.defDamage : 0; - break; - - case NPCID.NebulaHeadcrab: - npc.damage = npc.ai[0] == 5f ? npc.defDamage : 0; - break; - case NPCID.MartianDrone: case NPCID.SolarCorite: npc.damage = (npc.ai[0] == 2f || npc.ai[0] == 3f) ? npc.defDamage : 0; break; - case NPCID.ArmedTorchZombie: - case NPCID.ArmedZombie: - case NPCID.ArmedZombieCenx: - case NPCID.ArmedZombieEskimo: - case NPCID.ArmedZombiePincussion: - case NPCID.ArmedZombieSlimed: - case NPCID.ArmedZombieSwamp: - case NPCID.ArmedZombieTwiggy: - case NPCID.Crawdad: - case NPCID.Crawdad2: - npc.damage = npc.ai[2] == 0f ? 0 : (int)Math.Round(npc.defDamage * 1.4); - break; - case NPCID.GraniteFlyer: npc.damage = npc.ai[0] == -1f ? 0 : npc.defDamage; break; @@ -4617,21 +4470,6 @@ namespace CalamityMod.NPCs npc.damage = npc.ai[2] < 0f ? 0 : npc.defDamage; break; - case NPCID.Squid: - case NPCID.BlueJellyfish: - case NPCID.GreenJellyfish: - case NPCID.PinkJellyfish: - case NPCID.BloodJelly: - case NPCID.FungoFish: - float damagingVelocity = npc.type == NPCID.GreenJellyfish ? 3.6f : 2.8f; - npc.damage = (npc.dontTakeDamage || npc.velocity.Length() > damagingVelocity) ? npc.defDamage : 0; - break; - - case NPCID.Herpling: - case NPCID.Derpling: - npc.damage = (npc.velocity.Y == 0f || npc.velocity.Length() < 3f) ? 0 : npc.defDamage; - break; - case NPCID.BlueSlime: case NPCID.MotherSlime: case NPCID.LavaSlime: @@ -4660,7 +4498,6 @@ namespace CalamityMod.NPCs case NPCID.JungleSlime: case NPCID.BabySlime: case NPCID.Pinky: - case NPCID.BunnySlimed: case NPCID.Slimeling: case NPCID.Slimer2: npc.damage = (npc.velocity.Y == 0f || npc.velocity.Length() < 3f) ? 0 : npc.defDamage; @@ -4772,125 +4609,7 @@ namespace CalamityMod.NPCs npc.ai[3] = 0f; } - // Debuff decrements - if (debuffResistanceTimer > 0) - debuffResistanceTimer--; - - if (timeSlow > 0) - timeSlow--; - if (tesla > 0) - tesla--; - if (gState > 0) - gState--; - if (tSad > 0) - tSad--; - if (eutrophication > 0) - eutrophication--; - if (webbed > 0) - webbed--; - if (vaporfied > 0) - vaporfied--; - - if (electrified > 0) - electrified--; - if (pearlAura > 0) - pearlAura--; - if (bBlood > 0) - bBlood--; - if (brainRot > 0) - brainRot--; - if (heavybleeding > 0) - heavybleeding--; - if (laceration > 0) - laceration--; - if (elementalMix > 0) - elementalMix--; - if (trueVulnerabilityHex > 0) - { - vulnerabilityHex = 0; // You cannot stack True VHex with its lesser counterpart. - trueVulnerabilityHex--; - if (trueVulnerabilityHex == 0) - cursorFocus = 0; - } - if (vulnerabilityHex > 0) - vulnerabilityHex--; - if (marked > 0) - marked--; - if (absorberAffliction > 0) - absorberAffliction--; - if (irradiated > 0) - irradiated--; - if (scionsCurioEffected) - irradiatedContactBoost = 2f; - if (bFlames > 0) - bFlames--; - if (demonicFlames > 0) - demonicFlames--; - else - demonicFlamesBonusDamage = 0; - if (hFlames > 0) - hFlames--; - if (pFlames > 0) - pFlames--; - // Soma Prime's Shred stacks have a unique falloff mechanic in the debuff's own file. - if (aCrunch > 0) - aCrunch--; - if (crumble > 0) - crumble--; - if (cDepth > 0) - cDepth--; - if (hPressure > 0) - hPressure--; - if (rTide > 0) - rTide--; - if (gsInferno > 0) - gsInferno--; - if (dragonFire > 0) - dragonFire--; - if (vermillionFlux > 0) - vermillionFlux--; - if (auricRebuke > 0) - auricRebuke--; - if (staticDischarge > 0) - staticDischarge--; - if (miracleBlight > 0) - miracleBlight--; - if (astralInfection > 0) - astralInfection--; - if (wDeath > 0) - wDeath--; - if (nightwither > 0) - nightwither--; - if (shocked > 0) - shocked--; - if (voidfrost > 0) - voidfrost--; - if (shellfishVore > 0) - shellfishVore--; - if (clamDebuff > 0) - clamDebuff--; - if (sulphurPoison > 0) - sulphurPoison--; - if (sagePoisonTime > 0) - sagePoisonTime--; - if (GaussFluxTimer > 0) - GaussFluxTimer--; - if (ladHearts > 0) - ladHearts--; - if (banishingFire > 0) - banishingFire--; - if (wither > 0) - wither--; - if (ashesOnDeath > 0) - ashesOnDeath--; - - if (antlionCloudDebuffTimer > 0) - antlionCloudDebuffTimer--; - if (cursorFocus > 0 && cursorFocus < cursorFocusMax) - cursorFocus--; - - if (relicOfResilienceWeakness > 0) - relicOfResilienceWeakness--; + if (warbannerBurnTimer > 0) warbannerBurnTimer--; @@ -5075,7 +4794,7 @@ namespace CalamityMod.NPCs // Pearl Aura shard spawning // Slowing is handled in the general slowing code below - if (pearlAura > 0) + if (pearlAura) { pearlAuraCounter++; if (pearlAuraCounter >= 45) @@ -5122,23 +4841,23 @@ namespace CalamityMod.NPCs if (debuffResistanceTimer <= 0 || (debuffResistanceTimer > slowingDebuffResistanceMin)) { // Slowing debuffs which set a velocity hard cap take priority first. - if (vulnerabilityHex > 0) + if (vulnerabilityHex) npc.velocity = Vector2.Clamp(npc.velocity, new Vector2(-Calamity.MaxNPCSpeed), new Vector2(Calamity.MaxNPCSpeed, 10f)); // Then debuffs which apply a multiplier to velocity. // These multipliers can stack with each other, even if you'll rarely see this on a boss. float velocitySlownessFactor = 1f; - if (tSad > 0) + if (temporalSadness) velocitySlownessFactor += 0.2f; - if (timeSlow > 0) + if (timeDistortion) velocitySlownessFactor += 0.15f; - if (webbed > 0) + if (webbed) velocitySlownessFactor += 0.15f; - if (gState > 0) + if (glacialState) { float baseSlownessFactor = 0.1f; if (VulnerableToCold.HasValue) @@ -5151,10 +4870,10 @@ namespace CalamityMod.NPCs velocitySlownessFactor += baseSlownessFactor; } - if (pearlAura > 0) + if (pearlAura) velocitySlownessFactor += 0.1f; - if (eutrophication > 0) + if (eutrophication) { float baseSlownessFactor = 0.05f; if (VulnerableToWater.HasValue) @@ -5167,7 +4886,7 @@ namespace CalamityMod.NPCs velocitySlownessFactor += baseSlownessFactor; } - if (tesla > 0) + if (galvanicCorrosion) { float baseSlownessFactor = 0.05f; if (VulnerableToElectricity.HasValue) @@ -5180,7 +4899,7 @@ namespace CalamityMod.NPCs velocitySlownessFactor += baseSlownessFactor; } - if (vaporfied > 0) + if (vaporfied) velocitySlownessFactor += 0.05f; // Divide 1 by the slowness factor to get the amount to slow by. @@ -5319,28 +5038,10 @@ namespace CalamityMod.NPCs target.AddBuff(BuffID.BrokenArmor, 300); break; - case NPCID.PossessedArmor: - target.AddBuff(BuffID.Cursed, 60); - break; - - case NPCID.Ghost: - case NPCID.PirateGhost: - target.AddBuff(BuffID.Cursed, 60); - target.AddBuff(BuffID.Silenced, 180); - break; - - case NPCID.ChaosElemental: - target.AddBuff(BuffID.Silenced, 180); - break; - case NPCID.IlluminantBat: target.AddBuff(BuffID.Confused, 120); break; - case NPCID.IlluminantSlime: - target.AddBuff(BuffID.Slow, 180); - break; - case NPCID.Piranha: target.AddBuff(BuffID.Bleeding, 180); break; @@ -5400,20 +5101,8 @@ namespace CalamityMod.NPCs if (Main.hardMode) { - switch (npc.type) - { - case NPCID.BigBoned: - case NPCID.ShortBones: - case NPCID.AngryBones: - case NPCID.AngryBonesBig: - case NPCID.AngryBonesBigMuscle: - case NPCID.AngryBonesBigHelmet: - target.AddBuff(BuffType(), 120); - break; - - default: - break; - } + if (CalamityNPCTypeSets.AngryBones[npc.type]) + target.AddBuff(BuffType(), 120); if (NPC.downedPlantBoss) { @@ -5523,13 +5212,13 @@ namespace CalamityMod.NPCs float damageMult = 1f; if (npc.type == NPCType()) damageMult = 0.8f; - else if (EaterOfWorldsIDList.Includes(npc.type) || npc.type == NPCID.Creeper || npc.type == NPCType()) + else if (CalamityNPCTypeSets.EaterOfWorlds.Contains(npc.type) || npc.type == NPCID.Creeper || npc.type == NPCType()) damageMult = 0.75f; - else if (PerforatorWormIDList.Includes(npc.type) || AquaticScourgeIDList.Includes(npc.type) || DestroyerIDList.Includes(npc.type) || - RavagerIDList.Includes(npc.type) || AstrumDeusIDList.Includes(npc.type) || StormWeaverIDList.Includes(npc.type) || + else if (CalamityNPCTypeSets.Perforators.Contains(npc.type) || CalamityNPCTypeSets.AquaticScourge.Contains(npc.type) || CalamityNPCTypeSets.Destroyer.Contains(npc.type) || + CalamityNPCTypeSets.Ravager.Contains(npc.type) || CalamityNPCTypeSets.AstrumDeus.Contains(npc.type) || CalamityNPCTypeSets.StormWeaver.Contains(npc.type) || npc.type == NPCType() || npc.type == NPCType()) damageMult = 0.5f; - else if (ThanatosIDList.Includes(npc.type)) + else if (CalamityNPCTypeSets.Thanatos.Contains(npc.type)) damageMult = 0.35f; modifiers.SourceDamage *= damageMult; @@ -5675,39 +5364,25 @@ namespace CalamityMod.NPCs if (!projectile.npcProj && !projectile.trap) { - // Plague Reaper deals 1.1x damage to Plagued enemies - if (projectile.CountsAsClass() && modPlayer.plagueReaper && pFlames > 0) - modifiers.SourceDamage *= 1.1f; + // Plague Reaper deals extra damage to Plagued enemies + if (projectile.CountsAsClass() && modPlayer.plagueReaper && plague) + modifiers.SourceDamage *= PlagueReaperMask.SetBonusPlaguedRangedDamageMult; // True Vulnerability Hex causes enemies to take 1.15x damage, 2.5x from Calamity itself - if (trueVulnerabilityHex > 0) + if (trueVulnerabilityHex) modifiers.SourceDamage *= (projectile.type == ProjectileType() && projectile.ai[1] == 255f) ? 2.5f : 1.15f; } - // Any weapons that shoot projectiles from anywhere other than the player's center aren't affected by point-blank shot damage boost. - if (!Main.player[projectile.owner].ActiveItem().IsAir && Main.player[projectile.owner].ActiveItem().Calamity().canFirePointBlankShots && projectile.CountsAsClass()) - { - if (projectile.Calamity().pointBlankShotDuration > 0 && projectile.Calamity().pointBlankShotDistanceTravelled < CalamityGlobalProjectile.PointBlankShotDistanceLimit) - { - float pointBlankShotDurationRatio = projectile.Calamity().pointBlankShotDuration / (float)CalamityGlobalProjectile.DefaultPointBlankDuration; - float pointBlankShotDistanceRatio = 1f - projectile.Calamity().pointBlankShotDistanceTravelled / CalamityGlobalProjectile.PointBlankShotDistanceLimit; - float pointBlankDamageRatio = (pointBlankShotDurationRatio < pointBlankShotDistanceRatio ? pointBlankShotDurationRatio : pointBlankShotDistanceRatio) * 0.25f; - float pointBlankShotDamageMultiplier = 1f + pointBlankDamageRatio; - modifiers.SourceDamage *= pointBlankShotDamageMultiplier; - projectile.Calamity().pointBlankShotDuration = 0; - } - } - // Apply balancing resists/vulnerabilities. BalancingChangesManager.ApplyFromProjectile(npc, ref modifiers, projectile); - if (GrenadeResistIDList.Includes(projectile.type)) + if (CalamityProjectileSets.ResistedExplosiveProjectile[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 66% - bool hasResist = EaterOfWorldsIDList.Includes(npc.type) && !Main.expertMode; + // Note that Calamity reduces the vanilla resist from 80% to 60% + bool hasResist = CalamityNPCTypeSets.EaterOfWorlds.Contains(npc.type) && !Main.expertMode; // Add a resist for BoC's creepers and Prehardmode worm bosses - if (npc.type == NPCID.Creeper || DesertScourgeIDList.Includes(npc.type) || PerforatorWormIDList.Includes(npc.type)) + if (npc.type == NPCID.Creeper || CalamityNPCTypeSets.DesertScourge.Contains(npc.type) || CalamityNPCTypeSets.Perforators.Contains(npc.type)) hasResist = true; if (hasResist) modifiers.SourceDamage *= 0.33f; @@ -5797,7 +5472,7 @@ namespace CalamityMod.NPCs if (npc.buffTime[i] >= 1) { int type = npc.buffType[i]; - if (SummonTagDebuffDict.TryGet(type, out SummonTag tag)) + if (CalamityBuffSets.SummonTagDebuff.TryGetValue(type, out SummonTag tag)) { tag.TagModifyHitEffects(proj, npc, ref modifiers, ref TagDamageMult, ref critChance); } @@ -5851,7 +5526,7 @@ namespace CalamityMod.NPCs if (npc.buffTime[i] >= 1) { int type = npc.buffType[i]; - if (SummonTagDebuffDict.TryGet(type, out SummonTag tag)) + if (CalamityBuffSets.SummonTagDebuff.TryGetValue(type, out SummonTag tag)) { tag.TagOnHit(npc, projectile, hit, damagedone); } @@ -5927,7 +5602,7 @@ namespace CalamityMod.NPCs { if (Main.netMode != NetmodeID.MultiplayerClient) { - int slimeAmt = CalamityWorld.LegendaryMode ? Main.rand.Next(6) + 10 : Main.rand.Next(2) + 2; // 2 to 3 extra + int slimeAmt = Main.rand.Next(2) + 2; // 2 to 3 extra for (int s = 0; s < slimeAmt; s++) { int slime = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)(npc.position.Y + npc.height), NPCID.BlueSlime, 0, 0f, 0f, 0f, 0f, 255); @@ -5935,8 +5610,8 @@ namespace CalamityMod.NPCs npc2.SetDefaults(NPCID.BabySlime); npc2.velocity.X = npc.velocity.X * 2f; npc2.velocity.Y = npc.velocity.Y; - npc2.velocity.X += Main.rand.Next(-20, 20) * (CalamityWorld.LegendaryMode ? 0.5f : 0.1f) + s * npc.direction * (CalamityWorld.LegendaryMode ? 0.5f : 0.3f); - npc2.velocity.Y -= Main.rand.Next(0, 10) * (CalamityWorld.LegendaryMode ? 0.5f : 0.1f) + s; + npc2.velocity.X += Main.rand.Next(-20, 20) * 0.1f + s * npc.direction * 0.3f; + npc2.velocity.Y -= Main.rand.Next(10) * 0.1f + s; npc2.ai[0] = -1000 * Main.rand.Next(3); if (Main.dedServ && slime < Main.maxNPCs) @@ -5949,7 +5624,7 @@ namespace CalamityMod.NPCs case NPCID.CursedHammer: case NPCID.EnchantedSword: case NPCID.CrimsonAxe: - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.justHit = false; break; @@ -5960,13 +5635,13 @@ namespace CalamityMod.NPCs case NPCID.IceTortoise: case NPCID.BlackRecluse: case NPCID.BlackRecluseWall: - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.justHit = false; break; case NPCID.Paladin: - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.justHit = false; break; @@ -5974,13 +5649,13 @@ namespace CalamityMod.NPCs if (npc.type == NPCType()) { - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.justHit = false; } } // Plague debuff on kill effect - if (pFlames > 0 && npc.life <= 0 && npc.realLife == -1) + if (plague && npc.life <= 0 && npc.realLife == -1) { if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -6146,8 +5821,8 @@ namespace CalamityMod.NPCs } target.Calamity().scionsCurioEffected = true; - if (target.Calamity().irradiated > 0) - target.Calamity().irradiated += 90; + if (target.Calamity().irradiated) + target.buffTime[target.FindBuffIndex(ModContent.BuffType())] += 90; else target.AddBuff(BuffType(), 180); } @@ -6664,11 +6339,17 @@ namespace CalamityMod.NPCs #region Drawing public override void FindFrame(NPC npc, int frameHeight) { - /*if (CalamityWorld.revenge || BossRushEvent.BossRushActive) + if (CalamityWorld.revenge || BossRushEvent.BossRushActive) { - if (npc.type == NPCID.SkeletronPrime) - npc.frameCounter = 0D; - }*/ + // Used to force the head to look to the sides for the laser spread attack + if (npc.type == NPCID.GolemHead && (npc.ai[0] == 2f || npc.ai[0] == 3f)) + { + if (npc.localAI[1] == 1f) + npc.frame.Y = frameHeight * 2; + else + npc.frame.Y = frameHeight * 4; + } + } // Increment the bestiary worm timer when hovering over the NPC or having their entry open. Pauses otherwise if (npc.IsABestiaryIconDummy) { @@ -6679,15 +6360,18 @@ namespace CalamityMod.NPCs bestiaryWormTimer = 0; } } + + } // Debuff visuals. Alphabetical order as per usual, please + // TODO - Merge these into DebuffData public override void DrawEffects(NPC npc, ref Color drawColor) { if (!npc.canDisplayBuffs) return; - if (absorberAffliction > 0) + if (absorberAffliction) AbsorberAffliction.DrawEffects(npc, ref drawColor); // Rancor's burn effect @@ -6704,58 +6388,58 @@ namespace CalamityMod.NPCs } } - if (astralInfection > 0) + if (astralInfection) AstralInfectionDebuff.DrawEffects(npc, ref drawColor); // Brimstone Flames and Demonshade Enrage set bonus share the same visual effects // TODO -- change this when Demonshade is reworked - if (bFlames > 0 || npc.HasBuff()) + if (brimstoneFlames || npc.HasBuff()) BrimstoneFlames.DrawEffects(npc, ref drawColor); - if (demonicFlames > 0) + if (demonicFlames) DemonicFlames.DrawEffects(npc, ref drawColor); - if (bBlood > 0) + if (burningBlood ) BurningBlood.DrawEffects(npc, ref drawColor); - if (brainRot > 0) + if (brainRot) BrainRot.DrawEffects(npc, ref drawColor); - if (cDepth > 0) + if (crushDepth) CrushDepth.DrawEffects(npc, ref drawColor); - if (hPressure > 0) + if (hadopelagicPressure) HadopelagicPressure.DrawEffects(npc, ref drawColor); - if (dragonFire > 0) + if (dragonFire) Dragonfire.DrawEffects(npc, ref drawColor); - if (vermillionFlux > 0) + if (vermillionFlux) VermillionFlux.DrawEffects(npc, ref drawColor); - if (auricRebuke > 0) + if (auricRebuke) AuricRebuke.DrawEffects(npc, ref drawColor); - if (staticDischarge > 0) + if (staticDischarge) StaticDischarge.DrawEffects(npc, ref drawColor); - if (elementalMix > 0) + if (elementalMix) ElementalMix.DrawEffects(npc, ref drawColor); // Eutrophication and Temporal Sadness share the same visual effects - if (eutrophication > 0 || tSad > 0) + if (eutrophication || temporalSadness) Eutrophication.DrawEffects(npc, ref drawColor); - if (gsInferno > 0) + if (godSlayerInferno) GodSlayerInferno.DrawEffects(npc, ref drawColor); // Holy Flames and Banishing Fire share the same visual effects - if (hFlames > 0 || banishingFire > 0) + if (holyFlames || banishingFire) HolyFlames.DrawEffects(npc, ref drawColor); - if (heavybleeding > 0) + if (heavyBleeding) HeavyBleeding.DrawEffects(npc, ref drawColor); - + if (hyperiusFxTimer > 0) { float rate = (Main.GlobalTimeWrappedHourly * 5); @@ -6794,7 +6478,7 @@ namespace CalamityMod.NPCs } } - if (laceration > 0) + if (laceration) Laceration.DrawEffects(npc, ref drawColor); if (laserBurnTimer > 0) @@ -6820,34 +6504,34 @@ namespace CalamityMod.NPCs } // These draw effects do not include Miracle Blight's shader - if (miracleBlight > 0) + if (miracleBlight) MiracleBlight.DrawEffects(npc, ref drawColor); - if (nightwither > 0) + if (nightwither) Nightwither.DrawEffects(npc, ref drawColor); - if (pearlAura > 0) + if (pearlAura) PearlAura.DrawEffects(npc, ref drawColor); - if (pFlames > 0) // Plague debuff + if (plague) // Plague debuff Plague.DrawEffects(npc, ref drawColor); - if (relicOfResilienceWeakness > 0) + if (relicOfResilienceWeakness) ProfanedWeakness.DrawEffects(npc, ref drawColor); - if (rTide > 0) + if (riptide) RiptideDebuff.DrawEffects(npc, ref drawColor); - + if (somaShredStacks > 0 && !Main.dedServ) Shred.DrawEffects(npc, this, ref drawColor); - - if (sulphurPoison > 0) + + if (sulphurPoison) SulphuricPoisoning.DrawEffects(npc, ref drawColor); - if (trueVulnerabilityHex > 0) + if (trueVulnerabilityHex) TrueVulnerabilityHex.DrawEffects(npc, ref drawColor); - if (vaporfied > 0) + if (vaporfied) Vaporfied.DrawEffects(npc, ref drawColor); if (veriumDoomTimer > 0) @@ -6862,18 +6546,18 @@ namespace CalamityMod.NPCs } } - if (voidfrost > 0) + if (voidfrost) Voidfrost.DrawEffects(npc, ref drawColor); // TODO -- These debuff visuals cannot be moved because they correspond to vanilla debuffs - if (electrified > 0) + if (electrified) { if (Main.rand.NextBool()) { Dust.NewDustDirect(npc.position, npc.width, npc.height, DustID.Electric, Main.rand.NextFloat(-2f, 2f), Main.rand.NextFloat(-2f, 2f), 0, default, 0.35f); } } - if (webbed > 0) + if (webbed) { if (Main.rand.Next(5) < 4) { @@ -6907,35 +6591,35 @@ namespace CalamityMod.NPCs // Calamity debuff coloring effects // These are in order of precedence because they override each other. - if (gState > 0) + if (glacialState) drawColor = Color.Cyan; - else if (auricRebuke > 0) + else if (auricRebuke) { int scaleFactor = (int)(Utils.Remap(npc.width, 30, 400, 5, 15, true)); drawColor = Main.rand.NextBool(scaleFactor) ? Color.Lerp(Color.DarkBlue, Color.White, Utils.Remap(npc.width, 30, 400, 0.4f, 0.7f, true)) : Color.White; } - else if (vermillionFlux > 0) + else if (vermillionFlux) { int scaleFactor = (int)(Utils.Remap(npc.width, 30, 400, 5, 15, true)); drawColor = Main.rand.NextBool(scaleFactor) ? Color.Lerp(Color.DarkRed, Color.White, Utils.Remap(npc.width, 30, 400, 0, 0.7f, true)) : Color.White; } - else if (electrified > 0) + else if (electrified) { int scaleFactor = (int)(Utils.Remap(npc.width, 30, 400, 5, 15, true)); drawColor = Main.rand.NextBool(scaleFactor) ? Color.Lerp(Color.SlateGray, Color.White, Utils.Remap(npc.width, 30, 400, 0, 0.7f, true)) : Color.White; } - else if (absorberAffliction > 0) + else if (absorberAffliction) drawColor = Color.DarkSeaGreen; - else if (marked > 0 || vaporfied > 0) + else if (markedForDeath || vaporfied) drawColor = Color.Fuchsia; - else if (pearlAura > 0) + else if (pearlAura) drawColor = new Color(185, 185, 255); - else if (timeSlow > 0 || tesla > 0) + else if (timeDistortion || galvanicCorrosion) drawColor = Color.Aquamarine; } @@ -6945,7 +6629,7 @@ namespace CalamityMod.NPCs if (npc.IsABestiaryIconDummy) return null; - if (Main.LocalPlayer.Calamity().trippy || (npc.type == NPCID.KingSlime && CalamityWorld.LegendaryMode)) + if (Main.LocalPlayer.Calamity().trippy || (npc.type == NPCID.KingSlime && Main.zenithWorld)) return new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Main.DiscoR); if (npc.type == NPCID.KingSlime && CalamityWorld.death) @@ -6971,55 +6655,58 @@ namespace CalamityMod.NPCs return null; } + + //TODO - Make this a part of DebuffData public static List<(string, Predicate)> moddedDebuffTextureList = new List<(string, Predicate)> { // All Calamity DoTs in alphabetical order - ("CalamityMod/Buffs/DamageOverTime/AstralInfectionDebuff", NPC => NPC.Calamity().astralInfection > 0), - ("CalamityMod/Buffs/DamageOverTime/AuricRebuke", NPC => NPC.Calamity().auricRebuke > 0), - ("CalamityMod/Buffs/DamageOverTime/BanishingFire", NPC => NPC.Calamity().banishingFire > 0), - ("CalamityMod/Buffs/DamageOverTime/BrainRot", NPC => NPC.Calamity().brainRot > 0), - ("CalamityMod/Buffs/DamageOverTime/BrimstoneFlames", NPC => NPC.Calamity().bFlames > 0), - ("CalamityMod/Buffs/DamageOverTime/DemonicFlames", NPC => NPC.Calamity().demonicFlames > 0), - ("CalamityMod/Buffs/DamageOverTime/BurningBlood", NPC => NPC.Calamity().bBlood > 0), - ("CalamityMod/Buffs/DamageOverTime/CrushDepth", NPC => NPC.Calamity().cDepth > 0), - ("CalamityMod/Buffs/DamageOverTime/Dragonfire", NPC => NPC.Calamity().dragonFire > 0), - ("CalamityMod/Buffs/DamageOverTime/ElementalMix", NPC => NPC.Calamity().elementalMix > 0), - ("CalamityMod/Buffs/DamageOverTime/GodSlayerInferno", NPC => NPC.Calamity().gsInferno > 0), - ("CalamityMod/Buffs/DamageOverTime/HadopelagicPressure", NPC => NPC.Calamity().hPressure > 0), - ("CalamityMod/Buffs/DamageOverTime/HolyFlames", NPC => NPC.Calamity().hFlames > 0), - ("CalamityMod/Buffs/DamageOverTime/Laceration", NPC => NPC.Calamity().laceration > 0), - ("CalamityMod/Buffs/DamageOverTime/HeavyBleeding", NPC => NPC.Calamity().heavybleeding > 0), - ("CalamityMod/Buffs/DamageOverTime/MiracleBlight", NPC => NPC.Calamity().miracleBlight > 0), - ("CalamityMod/Buffs/DamageOverTime/Nightwither", NPC => NPC.Calamity().nightwither > 0), - ("CalamityMod/Buffs/DamageOverTime/Plague", NPC => NPC.Calamity().pFlames > 0), - ("CalamityMod/Buffs/DamageOverTime/RiptideDebuff", NPC => NPC.Calamity().rTide > 0), - ("CalamityMod/Buffs/DamageOverTime/SagePoison", NPC => NPC.Calamity().sagePoisonTime > 0), - ("CalamityMod/Buffs/DamageOverTime/ShellfishClaps", NPC => NPC.Calamity().shellfishVore > 0), + ("CalamityMod/Buffs/DamageOverTime/AstralInfectionDebuff", NPC => NPC.Calamity().astralInfection), + ("CalamityMod/Buffs/DamageOverTime/AuricRebuke", NPC => NPC.Calamity().auricRebuke), + ("CalamityMod/Buffs/DamageOverTime/BanishingFire", NPC => NPC.Calamity().banishingFire), + ("CalamityMod/Buffs/DamageOverTime/BrainRot", NPC => NPC.Calamity().brainRot), + ("CalamityMod/Buffs/DamageOverTime/BrimstoneFlames", NPC => NPC.Calamity().brimstoneFlames), + ("CalamityMod/Buffs/DamageOverTime/DemonicFlames", NPC => NPC.Calamity().demonicFlames), + ("CalamityMod/Buffs/DamageOverTime/BurningBlood", NPC => NPC.Calamity().burningBlood), + ("CalamityMod/Buffs/DamageOverTime/CrushDepth", NPC => NPC.Calamity().crushDepth), + ("CalamityMod/Buffs/DamageOverTime/Dragonfire", NPC => NPC.Calamity().dragonFire), + ("CalamityMod/Buffs/DamageOverTime/ElementalMix", NPC => NPC.Calamity().elementalMix), + ("CalamityMod/Buffs/DamageOverTime/GodSlayerInferno", NPC => NPC.Calamity().godSlayerInferno), + ("CalamityMod/Buffs/DamageOverTime/HadopelagicPressure", NPC => NPC.Calamity().hadopelagicPressure), + ("CalamityMod/Buffs/DamageOverTime/HolyFlames", NPC => NPC.Calamity().holyFlames), + ("CalamityMod/Buffs/DamageOverTime/Laceration", NPC => NPC.Calamity().laceration), + ("CalamityMod/Buffs/DamageOverTime/HeavyBleeding", NPC => NPC.Calamity().heavyBleeding), + ("CalamityMod/Buffs/DamageOverTime/ManaBurn", NPC => NPC.Calamity().manaBurn > 0), + ("CalamityMod/Buffs/DamageOverTime/MiracleBlight", NPC => NPC.Calamity().miracleBlight), + ("CalamityMod/Buffs/DamageOverTime/Nightwither", NPC => NPC.Calamity().nightwither), + ("CalamityMod/Buffs/DamageOverTime/Plague", NPC => NPC.Calamity().plague), + ("CalamityMod/Buffs/DamageOverTime/RiptideDebuff", NPC => NPC.Calamity().riptide), + ("CalamityMod/Buffs/DamageOverTime/SagePoison", NPC => NPC.Calamity().sagePoison), + ("CalamityMod/Buffs/DamageOverTime/ShellfishClaps", NPC => NPC.Calamity().shellfishStaffDebuff), ("CalamityMod/Buffs/DamageOverTime/Shred", NPC => NPC.Calamity().somaShredStacks > 0), - ("CalamityMod/Buffs/DamageOverTime/SnapClamDebuff", NPC => NPC.Calamity().clamDebuff > 0), - ("CalamityMod/Buffs/DamageOverTime/StaticDischarge", NPC => NPC.Calamity().staticDischarge > 0), - ("CalamityMod/Buffs/DamageOverTime/SulphuricPoisoning", NPC => NPC.Calamity().sulphurPoison > 0), - ("CalamityMod/Buffs/DamageOverTime/TrueVulnerabilityHex", NPC => NPC.Calamity().trueVulnerabilityHex > 0), - ("CalamityMod/Buffs/DamageOverTime/Vaporfied", NPC => NPC.Calamity().vaporfied > 0), - ("CalamityMod/Buffs/DamageOverTime/VermillionFlux", NPC => NPC.Calamity().vermillionFlux > 0), - ("CalamityMod/Buffs/DamageOverTime/Voidfrost", NPC => NPC.Calamity().voidfrost > 0), - ("CalamityMod/Buffs/DamageOverTime/VulnerabilityHex", NPC => NPC.Calamity().vulnerabilityHex > 0), + ("CalamityMod/Buffs/DamageOverTime/SnapClamDebuff", NPC => NPC.Calamity().snapClamDebuff), + ("CalamityMod/Buffs/DamageOverTime/StaticDischarge", NPC => NPC.Calamity().staticDischarge), + ("CalamityMod/Buffs/DamageOverTime/SulphuricPoisoning", NPC => NPC.Calamity().sulphurPoison), + ("CalamityMod/Buffs/DamageOverTime/TrueVulnerabilityHex", NPC => NPC.Calamity().trueVulnerabilityHex), + ("CalamityMod/Buffs/DamageOverTime/Vaporfied", NPC => NPC.Calamity().vaporfied), + ("CalamityMod/Buffs/DamageOverTime/VermillionFlux", NPC => NPC.Calamity().vermillionFlux), + ("CalamityMod/Buffs/DamageOverTime/Voidfrost", NPC => NPC.Calamity().voidfrost), + ("CalamityMod/Buffs/DamageOverTime/VulnerabilityHex", NPC => NPC.Calamity().vulnerabilityHex), // All other important Calamity debuffs, in alphabetical order - ("CalamityMod/Buffs/StatDebuffs/AbsorberAffliction", NPC => NPC.Calamity().absorberAffliction > 0), - ("CalamityMod/Buffs/StatDebuffs/ArmorCrunch", NPC => NPC.Calamity().aCrunch > 0), - ("CalamityMod/Buffs/StatDebuffs/Crumbling", NPC => NPC.Calamity().crumble > 0), - ("CalamityMod/Buffs/StatDebuffs/Eutrophication", NPC => NPC.Calamity().eutrophication > 0), - ("CalamityMod/Buffs/StatDebuffs/GalvanicCorrosion", NPC => NPC.Calamity().tesla > 0), - ("CalamityMod/Buffs/StatDebuffs/GlacialState", NPC => NPC.Calamity().gState > 0), - ("CalamityMod/Buffs/StatDebuffs/Irradiated", NPC => NPC.Calamity().irradiated > 0), - ("CalamityMod/Buffs/StatDebuffs/MarkedforDeath", NPC => NPC.Calamity().marked > 0), - ("CalamityMod/Buffs/StatDebuffs/PearlAura", NPC => NPC.Calamity().pearlAura > 0), - ("CalamityMod/Buffs/StatDebuffs/ProfanedWeakness", NPC => NPC.Calamity().relicOfResilienceWeakness > 0), - ("CalamityMod/Buffs/StatDebuffs/TemporalSadness", NPC => NPC.Calamity().tSad > 0), - ("CalamityMod/Buffs/StatDebuffs/TimeDistortion", NPC => NPC.Calamity().timeSlow > 0), - ("CalamityMod/Buffs/StatDebuffs/WhisperingDeath", NPC => NPC.Calamity().wDeath > 0), - ("CalamityMod/Buffs/StatDebuffs/WitherDebuff", NPC => NPC.Calamity().wither > 0), + ("CalamityMod/Buffs/StatDebuffs/AbsorberAffliction", NPC => NPC.Calamity().absorberAffliction), + ("CalamityMod/Buffs/StatDebuffs/ArmorCrunch", NPC => NPC.Calamity().armorCrunch), + ("CalamityMod/Buffs/StatDebuffs/Crumbling", NPC => NPC.Calamity().crumble), + ("CalamityMod/Buffs/StatDebuffs/Eutrophication", NPC => NPC.Calamity().eutrophication), + ("CalamityMod/Buffs/StatDebuffs/GalvanicCorrosion", NPC => NPC.Calamity().galvanicCorrosion), + ("CalamityMod/Buffs/StatDebuffs/GlacialState", NPC => NPC.Calamity().glacialState), + ("CalamityMod/Buffs/StatDebuffs/Irradiated", NPC => NPC.Calamity().irradiated), + ("CalamityMod/Buffs/StatDebuffs/MarkedforDeath", NPC => NPC.Calamity().markedForDeath), + ("CalamityMod/Buffs/StatDebuffs/PearlAura", NPC => NPC.Calamity().pearlAura), + ("CalamityMod/Buffs/StatDebuffs/ProfanedWeakness", NPC => NPC.Calamity().relicOfResilienceWeakness), + ("CalamityMod/Buffs/StatDebuffs/TemporalSadness", NPC => NPC.Calamity().temporalSadness), + ("CalamityMod/Buffs/StatDebuffs/TimeDistortion", NPC => NPC.Calamity().timeDistortion), + ("CalamityMod/Buffs/StatDebuffs/WhisperingDeath", NPC => NPC.Calamity().whisperingDeath), + ("CalamityMod/Buffs/StatDebuffs/WitherDebuff", NPC => NPC.Calamity().wither), }; public override bool PreDraw(NPC npc, SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -7052,7 +6739,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) || NeedsDebuffIconDisplayList.Includes(npc.type))) + if (CalamityClientConfig.Instance.DebuffDisplay && (npc.boss || BossHealthBarManager.MinibossHPBarList.Contains(npc.type) || BossHealthBarManager.OneToMany.ContainsKey(npc.type) || CalamityNPCSets.ForceDrawDebuffDisplay[npc.type])) { List currentDebuffs = new List() { }; @@ -7063,9 +6750,8 @@ namespace CalamityMod.NPCs currentDebuffs.Add(Request(moddedDebuffTextureList[b].Item1).Value); } } - // Vanilla damage over time debuffs - if (electrified > 0) + if (electrified) currentDebuffs.Add(TextureAssets.Buff[BuffID.Electrified].Value); if (npc.onFire) currentDebuffs.Add(TextureAssets.Buff[BuffID.OnFire].Value); @@ -7105,7 +6791,7 @@ namespace CalamityMod.NPCs currentDebuffs.Add(TextureAssets.Buff[BuffID.Confused].Value); if (npc.ichor) currentDebuffs.Add(TextureAssets.Buff[BuffID.Ichor].Value); - if (webbed > 0) + if (webbed) currentDebuffs.Add(TextureAssets.Buff[BuffID.Webbed].Value); if (npc.midas) currentDebuffs.Add(TextureAssets.Buff[BuffID.Midas].Value); @@ -7172,7 +6858,7 @@ namespace CalamityMod.NPCs { if (npc.buffTime[i] > 0) { - if (SummonTagDebuffDict.TryGet(npc.buffType[i], out SummonTag tag)) + if (CalamityBuffSets.SummonTagDebuff.TryGetValue(npc.buffType[i], out SummonTag tag)) { // Fetch the item and its frames var tex = TextureAssets.Item[tag.TagItem].Value; @@ -7198,7 +6884,7 @@ namespace CalamityMod.NPCs if (CalamityWorld.revenge || BossRushEvent.BossRushActive) { - if (DestroyerIDList.Includes(npc.type)) + if (CalamityNPCTypeSets.Destroyer.Contains(npc.type)) shouldDrawBool = false; // Allows correct frames to draw in Rev+ phases @@ -7235,6 +6921,45 @@ namespace CalamityMod.NPCs npc.frame.Y = (int)newAI[3]; } + + if (npc.type == NPCID.GolemHeadFree) + { + // Draw the head as usual. + Texture2D golemHeadTexture = TextureAssets.Npc[npc.type].Value; + Vector2 headDrawPosition = npc.Center - screenPos; + spriteBatch.Draw(golemHeadTexture, headDrawPosition, npc.frame, npc.GetAlpha(drawColor), 0f, npc.frame.Size() * 0.5f, npc.scale, SpriteEffects.None, 0f); + + // Draw the eyes. The way vanilla handles this is hardcoded bullshit that cannot handle different hitboxes and thus requires rewriting. + Color eyeColor = new Color(Main.mouseTextColor, Main.mouseTextColor, Main.mouseTextColor, 0); + Vector2 eyesDrawPosition = headDrawPosition - npc.scale * new Vector2(1f, 12f); + Rectangle eyesFrame = new Rectangle(0, 0, TextureAssets.Golem[1].Value.Width, TextureAssets.Golem[1].Value.Height / 2); + spriteBatch.Draw(TextureAssets.Golem[1].Value, eyesDrawPosition, eyesFrame, eyeColor, 0f, eyesFrame.Size() * 0.5f, npc.scale, SpriteEffects.None, 0f); + + // Draw the glowmasks. + int frameCounter = (int)npc.frameCounter / 4; + Rectangle frame = TextureAssets.Extra[106].Value.Frame(1, 8); + frame.Y += frame.Height * 2 * frameCounter + npc.frame.Y; + Rectangle glowFrame = frame; + spriteBatch.Draw(TextureAssets.Extra[106].Value, eyesDrawPosition, glowFrame, eyeColor, 0f, glowFrame.Size() * 0.5f, npc.scale, SpriteEffects.None, 0f); + frame = npc.frame; + Rectangle glowFrame2 = frame; + spriteBatch.Draw(TextureAssets.Extra[107].Value, eyesDrawPosition, glowFrame2, eyeColor, 0f, glowFrame2.Size() * 0.5f, npc.scale, SpriteEffects.None, 0f); + + // Draw the sparkle telegraphs for the laser spread attack if applicable. + if (npc.ai[0] == 3f && npc.ai[1] <= 60f) + { + spriteBatch.SetBlendState(BlendState.Additive); + for (int i = -1; i <= 1; i += 2) + { + Texture2D sparkle = Request("CalamityMod/Particles/Sparkle2").Value; + Vector2 sparkleDraw = headDrawPosition + new Vector2(14f * i, -15f) * npc.scale; + Color drawFade = Color.Yellow * Utils.GetLerpValue(0, 30, 60f - npc.ai[1], true); + spriteBatch.Draw(sparkle, sparkleDraw, null, drawFade, MathHelper.Pi * 0.02f * npc.ai[1] * i, sparkle.Size() / 2f, 1.25f * npc.scale, SpriteEffects.None, 0f); + } + spriteBatch.SetBlendState(BlendState.AlphaBlend); + } + shouldDrawBool = false; + } } if (npc.type == NPCID.Corruptor || npc.type == NPCID.BloodSquid || (npc.type == NPCID.HornetHoney && npc.ai[3] == 1f)) @@ -7250,31 +6975,6 @@ namespace CalamityMod.NPCs shouldDrawBool = false; } - if (npc.type == NPCID.GolemHeadFree) - { - // Draw the head as usual. - Texture2D golemHeadTexture = TextureAssets.Npc[npc.type].Value; - Vector2 headDrawPosition = npc.Center - screenPos; - spriteBatch.Draw(golemHeadTexture, headDrawPosition, npc.frame, npc.GetAlpha(drawColor), 0f, npc.frame.Size() * 0.5f, npc.scale, SpriteEffects.None, 0f); - - // Draw the eyes. The way vanilla handles this is hardcoded bullshit that cannot handle different hitboxes and thus requires rewriting. - Color eyeColor = new Color(Main.mouseTextColor, Main.mouseTextColor, Main.mouseTextColor, 0); - Vector2 eyesDrawPosition = headDrawPosition - npc.scale * new Vector2(1f, 12f); - Rectangle eyesFrame = new Rectangle(0, 0, TextureAssets.Golem[1].Value.Width, TextureAssets.Golem[1].Value.Height / 2); - spriteBatch.Draw(TextureAssets.Golem[1].Value, eyesDrawPosition, eyesFrame, eyeColor, 0f, eyesFrame.Size() * 0.5f, npc.scale, SpriteEffects.None, 0f); - - // Draw the glowmasks. - int frameCounter = (int)npc.frameCounter / 4; - Rectangle frame = TextureAssets.Extra[106].Value.Frame(1, 8); - frame.Y += frame.Height * 2 * frameCounter + npc.frame.Y; - Rectangle glowFrame = frame; - spriteBatch.Draw(TextureAssets.Extra[106].Value, eyesDrawPosition, glowFrame, eyeColor, 0f, glowFrame.Size() * 0.5f, npc.scale, SpriteEffects.None, 0f); - frame = npc.frame; - Rectangle glowFrame2 = frame; - spriteBatch.Draw(TextureAssets.Extra[107].Value, eyesDrawPosition, glowFrame2, eyeColor, 0f, glowFrame2.Size() * 0.5f, npc.scale, SpriteEffects.None, 0f); - shouldDrawBool = false; - } - if (Main.LocalPlayer.Calamity().trippy && !npc.IsABestiaryIconDummy) { SpriteEffects spriteEffects = SpriteEffects.None; @@ -7398,8 +7098,8 @@ namespace CalamityMod.NPCs } else { - // VHex and Miracle Blight visuals do not appear if Odd Mushroom is in use for sanity reasons - if (npc.Calamity().vulnerabilityHex > 0 || npc.Calamity().trueVulnerabilityHex > 0) + // VHex, Mana Burn and Miracle Blight visuals do not appear if Odd Mushroom is in use for sanity reasons + if (npc.Calamity().vulnerabilityHex || npc.Calamity().trueVulnerabilityHex) { float compactness = npc.width * 0.6f; if (compactness < 10f) @@ -7407,14 +7107,33 @@ namespace CalamityMod.NPCs float power = npc.height / 100f; if (power > 2.75f) power = 2.75f; + var color = Color.Red; if (VulnerabilityHexFireDrawer is null || VulnerabilityHexFireDrawer.LocalTimer >= VulnerabilityHexFireDrawer.SetLifetime) - VulnerabilityHexFireDrawer = new FireParticleSet(npc.Calamity().trueVulnerabilityHex > 0 ? npc.Calamity().trueVulnerabilityHex : npc.Calamity().vulnerabilityHex, 1, Color.Red * 1.25f, Color.Red, compactness, power); + VulnerabilityHexFireDrawer = new FireParticleSet(npc.Calamity().trueVulnerabilityHex ? npc.buffTime[npc.FindBuffIndex(ModContent.BuffType())] : npc.buffTime[npc.FindBuffIndex(ModContent.BuffType())], 1, Color.Red * 1.25f, Color.Red, compactness, power); else VulnerabilityHexFireDrawer.DrawSet(npc.Bottom - Vector2.UnitY * (12f - npc.gfxOffY)); } else VulnerabilityHexFireDrawer = null; + // Mana Burn effect is just vhex but blue + if (npc.Calamity().manaBurn > 0) + { + float compactness = npc.width * 0.6f; + if (compactness < 10f) + compactness = 10f; + float power = npc.height / 100f; + if (power > 2.75f) + power = 2.75f; + var color = Color.Blue; + if (ManaBurnFireDrawer is null || ManaBurnFireDrawer.LocalTimer >= ManaBurnFireDrawer.SetLifetime) + ManaBurnFireDrawer = new FireParticleSet(60, 1, color * 1.25f, color, compactness, power); + else + ManaBurnFireDrawer.DrawSet(npc.Bottom - Vector2.UnitY * (12f - npc.gfxOffY)); + } + else + ManaBurnFireDrawer = null; + // Only draw the NPC if told to by the miracle blight drawer. if (MiracleBlightRenderer.ValidToDraw(npc)) return MiracleBlightRenderer.ActuallyDoPreDraw; @@ -7499,7 +7218,7 @@ namespace CalamityMod.NPCs } // Destroyer drawing and laser telegraphs - else if (DestroyerIDList.Includes(npc.type) && !npc.IsABestiaryIconDummy) + else if (CalamityNPCTypeSets.Destroyer.Contains(npc.type) && !npc.IsABestiaryIconDummy) { Texture2D npcTexture = TextureAssets.Npc[npc.type].Value; int frameHeight = npcTexture.Height / Main.npcFrameCount[npc.type]; @@ -7670,7 +7389,7 @@ namespace CalamityMod.NPCs Color currentColor = npc.GetAlpha(drawColor); float opacity = (1f - Main.npc[NPC.crimsonBoss].life / (float)Main.npc[NPC.crimsonBoss].lifeMax) * 2f; opacity *= opacity; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) opacity = 1f; opacity = MathHelper.Clamp(opacity, 0f, 1f); @@ -8201,8 +7920,7 @@ namespace CalamityMod.NPCs { if (!GetDownedBossVariable(npc.type)) { - BossTypeDict.TryGet(npc.type, out int newBossTypeJustDowned); - + CalamityNPCSets.BossSpeedrunTimerID.TryGetValue(npc.type, out int newBossTypeJustDowned); for (int i = 0; i < Main.maxPlayers; i++) { Player player = Main.player[i]; @@ -8244,13 +7962,13 @@ namespace CalamityMod.NPCs #region Should Affect NPC public static bool ShouldAffectNPC(NPC target) { - if (EaterOfWorldsIDList.Includes(target.type) || DestroyerIDList.Includes(target.type)) + if (CalamityNPCTypeSets.EaterOfWorlds.Contains(target.type) || CalamityNPCTypeSets.Destroyer.Contains(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 && !EnemyImmunitiesList.Includes(target.type) && !AcidRainEvent.AllMinibosses.Contains(target.type)) + target.type != NPCType() && target.type != NPCType() && target.type != NPCID.DD2Betsy && !CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[target.type] && !AcidRainEvent.AllMinibosses.Contains(target.type)) { return true; } diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 663b306e04..550a052602 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -98,12 +98,6 @@ namespace CalamityMod.NPCs case NPCID.Werewolf: npcLoot.ChangeDropRate(ItemID.MoonCharm, 1, 20); break; - - // Possessed Armor - // Nazar @ 1% Normal, 2% Expert+ - case NPCID.PossessedArmor: - npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.Nazar, 100, 50)); - break; #endregion #region Sky / Space @@ -291,8 +285,8 @@ namespace CalamityMod.NPCs // Rare Elemental in a Bottle @ 10% Normal, 16.67% Expert+ // Desert Key @ 10% case NPCID.SandElemental: - npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 5, 3)); - npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 10, 6)); + npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 5, 3)); + npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 10, 6)); npcLoot.Add(ItemID.DungeonDesertKey, 10); break; @@ -465,14 +459,10 @@ namespace CalamityMod.NPCs break; // Chaos Elemental - // Megaphone @ 1% Normal, 2% Expert+ // Rod of Discord @ 0.5% Normal, 0.625% Expert+ (2.5 times higher chance than vanilla) case NPCID.ChaosElemental: - npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.Megaphone, 100, 50)); - // Remove the vanilla loot rule for Rod of Discord. npcLoot.RemoveWhere((rule) => rule is CommonDrop conditionalRule && conditionalRule.itemId == ItemID.RodofDiscord); - // Define a replacement rule which has an increased chance. npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.RodofDiscord, 200, 160)); break; @@ -483,12 +473,6 @@ namespace CalamityMod.NPCs npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.TrifoldMap, 100, 50)); break; - // Illuminant Slime - // Fast Clock @ 1% Normal, 2% Expert+ - case NPCID.IlluminantSlime: - npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.FastClock, 100, 50)); - break; - // Gastropod // 5-10 Pink Gel @ 100% case NPCID.Gastropod: @@ -562,7 +546,12 @@ namespace CalamityMod.NPCs #endregion #region Jungle - //Moss hornets are after all of this switching since it no longer works if placed here + // Moss Hornet + // Needler @ 4% Normal, 6.67% Expert+ + // This automatically covers all variations + case NPCID.MossHornet: + npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 25, 15)); + break; // Moth // Butterfly Dust @ 100% INSTEAD OF 50% @@ -707,11 +696,8 @@ namespace CalamityMod.NPCs break; // Ghost Bracelet @ 5% (Dandy requests this drops at a "high chance" but inventory clutter is real so) - // Nazar and Megaphone @ 1% Normal, 2% Expert case NPCID.Ghost: npcLoot.Add(ModContent.ItemType(), 20); - npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.Nazar, 100, 50)); - npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.Megaphone, 100, 50)); break; #endregion @@ -729,14 +715,11 @@ namespace CalamityMod.NPCs npcLoot.Add(ModContent.ItemType(), 1, 6, 12); break; - // Wandering Eye Fish - // Bouncing Eyeball @ 10% Normal, 16.66% Expert+ + // Wandering Eye Fish, Zombie Merman + // Bouncing Eyeball @ 12.5% case NPCID.EyeballFlyingFish: - npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 10, 6)); - postEoC.Add(ModContent.ItemType(), 1, 10, 12); - break; - case NPCID.ZombieMerman: + npcLoot.Add(ModContent.ItemType(), 8); postEoC.Add(ModContent.ItemType(), 1, 10, 12); break; @@ -813,13 +796,6 @@ namespace CalamityMod.NPCs rev.Add(ItemID.FlyingDutchmanMasterTrophy); rev.Add(ItemID.PirateShipMountItem, 4); break; - - // Pirate's Curse - // Nazar and Megaphone @ 1% Normal, 2% Expert - case NPCID.PirateGhost: - npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.Nazar, 100, 50)); - npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.Megaphone, 100, 50)); - break; #endregion #region Solar Eclipse @@ -997,15 +973,15 @@ namespace CalamityMod.NPCs #region Martian Madness // Martian Madness On-Foot Soldiers - // 1.5% chance to drop any of the three Calamity martian drops + // 1% chance to drop any of the three Calamity martian drops case NPCID.BrainScrambler: case NPCID.GrayGrunt: case NPCID.GigaZapper: case NPCID.RayGunner: case NPCID.ScutlixRider: - npcLoot.Add(ModContent.ItemType(), 66); - npcLoot.Add(ModContent.ItemType(), 66); - npcLoot.Add(ModContent.ItemType(), 66); + npcLoot.Add(ModContent.ItemType(), 100); + npcLoot.Add(ModContent.ItemType(), 100); + npcLoot.Add(ModContent.ItemType(), 100); break; // Martian Engineer @@ -1155,10 +1131,10 @@ namespace CalamityMod.NPCs npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.RoyalGel)); // Would be in the bag otherwise - npcLoot.AddNormalOnly(ItemDropRule.ByCondition(DropHelper.Remix, ItemID.Keybrand, 4)); - npcLoot.AddNormalOnly(ItemDropRule.ByCondition(DropHelper.NotRemix, ItemID.Katana, 4)); + npcLoot.AddNormalOnly(ItemDropRule.ByCondition(DropHelper.Remix, ItemID.Keybrand, DropHelper.NormalWeaponDropRateInt)); + npcLoot.AddNormalOnly(ItemDropRule.ByCondition(DropHelper.NotRemix, ItemID.Katana, DropHelper.NormalWeaponDropRateInt)); - npcLoot.AddNormalOnly(ModContent.ItemType(), 10); + npcLoot.AddNormalOnly(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); npcLoot.AddNormalOnly(ModContent.ItemType(), ThankYouPainting.DropInt); // Master items drop in Revengeance @@ -1177,8 +1153,8 @@ namespace CalamityMod.NPCs npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.EoCShield)); // Would be in the bag otherwise - npcLoot.AddNormalOnly(ModContent.ItemType(), 10); - npcLoot.AddNormalOnly(ModContent.ItemType(), 4); + npcLoot.AddNormalOnly(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); + npcLoot.AddNormalOnly(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); npcLoot.AddNormalOnly(ModContent.ItemType(), ThankYouPainting.DropInt); // Master items drop in Revengeance @@ -1302,7 +1278,7 @@ namespace CalamityMod.NPCs // Expert+ drops are also available on Normal npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.HiveBackpack)); - npcLoot.AddNormalOnly(ModContent.ItemType(), 10); + npcLoot.AddNormalOnly(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); // Would be in the bag otherwise npcLoot.AddNormalOnly(ModContent.ItemType(), ThankYouPainting.DropInt); @@ -1507,7 +1483,6 @@ namespace CalamityMod.NPCs // Expert+ drops are also available on Normal. These are done manually due to Last Twin Standing. npcLoot.AddIf((info) => !Main.expertMode && IsLastTwinStanding(info), ItemID.MechanicalWheelPiece); - npcLoot.AddIf((info) => !Main.expertMode && IsLastTwinStanding(info), ModContent.ItemType(), 10); // Would be in the bag otherwise npcLoot.AddIf((info) => !Main.expertMode && IsLastTwinStanding(info), ModContent.ItemType(), ThankYouPainting.DropInt); @@ -1902,22 +1877,16 @@ namespace CalamityMod.NPCs break; #endregion } - //If the enemy is part of a list (Hornets, Skeletons, etc,) place it here as in the section before it no longer works + //If the enemy is part of a list, place it here as in the section before it no longer works #region Enemy Lists - - // All Moss Hornets - // Needler @ 4% Normal, 6.67% Expert+ - if (MossHornetIDList.Includes(npc.type)) - npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 25, 15)); - // All Skeletons // Ancient Bone Dust @ 20% Normal, 33.33% Expert+ - if (SkeletonIDList.Includes(npc.type)) + if (CalamityNPCTypeSets.Skeleton[npc.type]) npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 5, 3)); // All Hardmode Dungeon Enemies // Ectoplasm @ 20% - if (BuffedDungeonEnemiesList.Includes(npc.type)) + if (CalamityNPCSets.IsBuffedDungeonEnemy[npc.type]) npcLoot.Add(ItemID.Ectoplasm, 5); #endregion } @@ -1951,7 +1920,7 @@ namespace CalamityMod.NPCs 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 && (EaterOfWorldsIDList.Includes(npc.type) || npc.type == NPCID.Creeper)) + if (CalamityWorld.revenge && (CalamityNPCTypeSets.EaterOfWorlds.Contains(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 9eb1b6520d..04e4c25760 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -27,6 +27,7 @@ using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Enums; using Terraria.GameContent; using Terraria.ID; using Terraria.Localization; @@ -204,6 +205,7 @@ namespace CalamityMod.NPCs private static readonly string[] SantaClausNames = { "Jank", // <@!339950757472239616> (jankle_) + "Aoi Kurashiki", // <@!358411687885537291> (nothinpurrsonal) }; private static readonly string[] SkeletonMerchantNames = { @@ -230,6 +232,7 @@ namespace CalamityMod.NPCs "Xsiana", // <@!625780237489143839> (lokistic) "Lain", // <@!655201622863118337> (literallyadeerfr) "Hamis", // <@!608455754093035521> (haefer) + "Brio Scarlet", // <@!358576903701004289> (brio_scarlet) }; private static readonly string[] TavernkeepNames = { @@ -1081,10 +1084,8 @@ namespace CalamityMod.NPCs public void BoundNPCSafety(Mod mod, NPC npc) { // Make Bound Town NPCs take no damage - if (BoundNPCIDList.Includes(npc.type)) - { + if (CalamityNPCTypeSets.BoundTownNPC[npc.type]) npc.dontTakeDamageFromHostiles = true; - } } public void MakeTownNPCsTakeMoreDamage(NPC npc, Projectile projectile, Mod mod, ref NPC.HitModifiers modifiers) @@ -1147,98 +1148,93 @@ namespace CalamityMod.NPCs public override void ModifyShop(NPCShop shop) { int type = shop.NpcType; - int goldCost = NPC.downedMoonlord ? 16 : Main.hardMode ? 8 : 4; - - bool happy = Main.LocalPlayer.currentShoppingSettings.PriceAdjustment <= 0.9; + Condition spelunkerGlowCondition = new(Language.GetText("Conditions.NightDayFullMoon"), () => !Main.dayTime || Main.GetMoonPhase() == MoonPhase.Full); // Identical to the one in NPCShopDatabase Condition hasFlareGunUpgrade = new(CalamityUtils.GetText("Condition.HasFlareGun"), () => (Main.LocalPlayer.HasItem(ItemType()) || Main.LocalPlayer.HasItem(ItemType())) && !Main.LocalPlayer.HasItem(ItemID.FlareGun)); Condition bestiaryProgressLacewing = new(CalamityUtils.GetText("Condition.LacewingBestiary"), () => Main.GetBestiaryProgressReport().CompletionPercent >= 0.4f); - Condition roguePlayer = CalamityConditions.PlayerHasRogueArmor; - Condition wingedPlayer = CalamityConditions.PlayerHasWings; - Condition revengeance = CalamityConditions.InRevengeanceMode; - Condition downedPolterghast = CalamityConditions.DownedPolterghast; - Condition downedDoG = CalamityConditions.DownedDevourerOfGods; if (type == NPCID.Merchant) { - shop.AddWithCustomValue(ItemID.Bottle, Item.buyPrice(copper: 20)) - .AddWithCustomValue(ItemID.WormholePotion, Item.buyPrice(silver: 5), Condition.HappyEnoughToSellPylons); - shop.Add(ItemID.Flare, hasFlareGunUpgrade) - .Add(ItemID.BlueFlare, hasFlareGunUpgrade) + shop.InsertBefore(ItemID.LesserHealingPotion, ItemID.Bottle) + .InsertAfter(ItemID.ManaPotion, ItemID.WormholePotion, Condition.HappyEnoughToSellPylons) + .InsertAfter(ItemID.Flare, ItemID.Flare, hasFlareGunUpgrade) + .InsertAfter(ItemID.BlueFlare, ItemID.BlueFlare, hasFlareGunUpgrade) .AddWithCustomValue(ItemID.AngelStatue, Item.buyPrice(gold: 5), Condition.NpcIsPresent(NPCType())); } if (type == NPCID.DyeTrader) { - shop.Add(ItemType(), Condition.Hardmode) + shop.Add(Condition.Hardmode) .AddWithCustomValue(ItemID.DyeTradersScimitar, Item.buyPrice(gold: 15)); } if (type == NPCID.Demolitionist) { - shop.Add(ItemType(), Condition.DownedMechBossAny); + shop.Add(Condition.DownedMechBossAny); } if (type == NPCID.ArmsDealer) { - shop.AddWithCustomValue(ItemType(), Item.buyPrice(gold: 20), Condition.DownedSkeletron) - .AddWithCustomValue(ItemType(), Item.buyPrice(gold: 25), Condition.Hardmode) - .AddWithCustomValue(ItemID.Boomstick, Item.buyPrice(gold: 20), Condition.DownedQueenBee) - .AddWithCustomValue(ItemID.Uzi, Item.buyPrice(gold: 45), Condition.DownedPlantera) - .AddWithCustomValue(ItemID.TacticalShotgun, Item.buyPrice(gold: 60), Condition.DownedGolem) - .AddWithCustomValue(ItemID.SniperRifle, Item.buyPrice(gold: 60), Condition.DownedGolem) - .AddWithCustomValue(ItemID.RifleScope, Item.buyPrice(gold: 60), Condition.DownedGolem); + .Add(Condition.Hardmode) + .AddWithCustomValue(ItemID.Boomstick, Item.buyPrice(gold: 25), Condition.DownedQueenBee) + .AddWithCustomValue(ItemID.Uzi, Item.buyPrice(gold: 50), Condition.DownedPlantera) + .AddWithCustomValue(ItemID.TacticalShotgun, Item.buyPrice(platinum: 1), Condition.DownedGolem) + .AddWithCustomValue(ItemID.SniperRifle, Item.buyPrice(platinum: 1), Condition.DownedGolem) + .AddWithCustomValue(ItemID.RifleScope, Item.buyPrice(platinum: 1), Condition.DownedGolem); } if (type == NPCID.Stylist) { - shop.Add(ItemType(), roguePlayer) - .Add(ItemType(), wingedPlayer) - .Add(ItemType(), revengeance) - .Add(ItemType(), revengeance) + shop.Add(CalamityConditions.PlayerHasRogueArmor) + .Add(CalamityConditions.PlayerHasWings) + .Add(CalamityConditions.InRevengeanceMode) + .Add(CalamityConditions.InRevengeanceMode) .AddWithCustomValue(ItemID.StylistKilLaKillScissorsIWish, Item.buyPrice(gold: 15)); } if (type == NPCID.Cyborg) { - shop.AddWithCustomValue(ItemID.RocketLauncher, Item.buyPrice(gold: 25), Condition.DownedGolem) - .AddWithCustomValue(ItemType(), Item.buyPrice(gold: 50), Condition.DownedGolem) - .Add(ItemType(), downedPolterghast); + shop.AddWithCustomValue(ItemID.RocketLauncher, Item.buyPrice(platinum: 1), Condition.DownedGolem) + .Add(Condition.DownedGolem) + .Add(CalamityConditions.DownedPolterghast); } if (type == NPCID.Dryad) { - shop.AddWithCustomValue(ItemID.JungleRose, Item.buyPrice(gold: 2)) - .AddWithCustomValue(ItemID.NaturesGift, Item.buyPrice(gold: 10)) - .Add(ItemType()) - .Add(ItemType(), Condition.DownedSkeletron) - .Add(ItemID.CorruptSeeds, Condition.CrimsonWorld, Condition.InGraveyard, Condition.PreHardmode) - .Add(ItemID.CrimsonSeeds, Condition.CorruptWorld, Condition.InGraveyard, Condition.PreHardmode) // Vanilla sells these in Hardmode, we just make them available at all times - .Add(ItemType(), Condition.NotBloodMoon, Condition.Hardmode); + shop.InsertAfter(ItemID.AshGrassSeeds, ItemType(), Condition.DownedSkeletron) + // Vanilla sells these in Hardmode, we just make them available at all times + // Fun fact: Corrupt and Crimson Seeds are sold twice, in different positions! + // This position is placed over the Graveyard one, and not the Blood Moon one (which is what happens if you insert after Corrupt Seeds). Totally awesome shop database. - Iris + .InsertAfter(ItemID.GrassWall, ItemID.CorruptSeeds, Condition.CrimsonWorld, Condition.InGraveyard, Condition.PreHardmode) + .InsertAfter(ItemID.GrassWall, ItemID.CrimsonSeeds, Condition.CorruptWorld, Condition.InGraveyard, Condition.PreHardmode) + .InsertAfter(ItemID.HallowedGrassEcho, ItemType(), Condition.NotBloodMoon, Condition.Hardmode) + .AddWithCustomValue(ItemID.JungleRose, Item.buyPrice(gold: 3)) + .AddWithCustomValue(ItemID.NaturesGift, Item.buyPrice(gold: 15)) + .Add(); } if (type == NPCID.GoblinTinkerer) { - shop.Add(ItemType()) + shop.Add() .Add(ItemID.Toolbox, Condition.NpcIsPresent(NPCID.Mechanic)); } if (type == NPCID.Mechanic) { - shop.AddWithCustomValue(ItemID.BuilderPotion, Item.buyPrice(gold: 4), Condition.HappyEnoughToSellPylons) - .AddWithCustomValue(ItemID.CombatWrench, Item.buyPrice(gold: 10)); + shop.AddWithCustomValue(ItemID.BuilderPotion, Item.buyPrice(gold: 2), Condition.HappyEnoughToSellPylons) + .AddWithCustomValue(ItemID.CombatWrench, Item.buyPrice(gold: 15)); } if (type == NPCID.Clothier) { - shop.AddWithCustomValue(ItemType(), Item.buyPrice(gold: 10)) - .AddWithCustomValue(ItemID.GoldenKey, Item.buyPrice(gold: 5), Condition.Hardmode) - .AddWithCustomValue(ItemType(), Item.buyPrice(gold: 8), downedDoG) - .AddWithCustomValue(ItemType(), Item.buyPrice(gold: 8), downedDoG) - .AddWithCustomValue(ItemType(), Item.buyPrice(gold: 8), downedDoG) - .AddWithCustomValue(ItemType(), Item.buyPrice(gold: 8), downedDoG) - .AddWithCustomValue(ItemType(), Item.buyPrice(gold: 8), downedDoG); + shop.Add() + .AddWithCustomValue(ItemID.GoldenKey, Item.buyPrice(gold: 15), Condition.Hardmode) + .Add(CalamityConditions.DownedDevourerOfGods) + .Add(CalamityConditions.DownedDevourerOfGods) + .Add(CalamityConditions.DownedDevourerOfGods) + .Add(CalamityConditions.DownedDevourerOfGods) + .Add(CalamityConditions.DownedDevourerOfGods); } if (type == NPCID.Painter) @@ -1248,42 +1244,42 @@ namespace CalamityMod.NPCs if (type == NPCID.Steampunker) { - shop.Add(ItemType(), Condition.NotRemixWorld) - .Add(ItemID.PurpleSolution, Condition.InGraveyard, Condition.CrimsonWorld, Condition.NotRemixWorld) - .Add(ItemID.RedSolution, Condition.InGraveyard, Condition.CorruptWorld, Condition.NotRemixWorld) - .Add(ItemType()) - .Add(ItemType()) - .Add(ItemType()) - .Add(ItemType()); + shop.InsertAfter(ItemID.BlueSolution, ItemType(), Condition.NotRemixWorld) + .InsertAfter(ItemID.PurpleSolution, ItemID.PurpleSolution, Condition.InGraveyard, Condition.CrimsonWorld, Condition.NotRemixWorld) + .InsertAfter(ItemID.RedSolution, ItemID.RedSolution, Condition.InGraveyard, Condition.CorruptWorld, Condition.NotRemixWorld) + .Add() + .Add() + .Add() + .Add(); } if (type == NPCID.Wizard) { - shop.AddWithCustomValue(ItemType(), CalamityGlobalItem.RarityLightRedBuyPrice * 3) - .AddWithCustomValue(ItemID.MagicMissile, Item.buyPrice(gold: 5)) - .AddWithCustomValue(ItemID.SpectreStaff, Item.buyPrice(gold: 25), Condition.DownedGolem) - .AddWithCustomValue(ItemID.InfernoFork, Item.buyPrice(gold: 25), Condition.DownedGolem) - .AddWithCustomValue(ItemID.ShadowbeamStaff, Item.buyPrice(gold: 25), Condition.DownedGolem) - .AddWithCustomValue(ItemID.MagnetSphere, Item.buyPrice(gold: 25), Condition.DownedGolem) - .Add(ItemType()) - .Add(ItemType()) - .Add(ItemType()) - .Add(ItemType()); + shop.Add() + .AddWithCustomValue(ItemID.MagicMissile, Item.buyPrice(gold: 25)) + .AddWithCustomValue(ItemID.SpectreStaff, Item.buyPrice(platinum: 1), Condition.DownedGolem) + .AddWithCustomValue(ItemID.InfernoFork, Item.buyPrice(platinum: 1), Condition.DownedGolem) + .AddWithCustomValue(ItemID.ShadowbeamStaff, Item.buyPrice(platinum: 1), Condition.DownedGolem) + .AddWithCustomValue(ItemID.MagnetSphere, Item.buyPrice(platinum: 1), Condition.DownedGolem) + .Add() + .Add() + .Add() + .Add(); } if (type == NPCID.WitchDoctor) { - shop.Add(ItemType()) - .Add(ItemType()) - .Add(ItemType()) - .Add(ItemType()) - .Add(ItemType()) - .AddWithCustomValue(ItemID.ButterflyDust, Item.buyPrice(gold: 10), Condition.DownedGolem); + shop.InsertAfter(ItemID.OasisFountain, ItemType()) + .InsertAfter(ItemID.OasisFountain, ItemType()) + .InsertAfter(ItemID.OasisFountain, ItemType()) + .InsertAfter(ItemID.OasisFountain, ItemType()) + .InsertAfter(ItemID.OasisFountain, ItemType()) + .AddWithCustomValue(ItemID.ButterflyDust, Item.buyPrice(gold: 25), Condition.DownedGolem); } if (type == NPCID.PartyGirl) { - shop.AddWithCustomValue(ItemID.GenderChangePotion, Item.buyPrice(silver: 25), Condition.HappyEnoughToSellPylons); + shop.Add(ItemID.GenderChangePotion, Condition.HappyEnoughToSellPylons); } if (type == NPCID.Princess) @@ -1294,32 +1290,32 @@ namespace CalamityMod.NPCs musicMod.TryFind("Interlude3MusicBox", out ModItem interlude3Box); musicMod.TryFind("DevourerofGodsEulogyMusicBox", out ModItem eulogyBox); - shop.AddWithCustomValue(ItemID.PrincessWeapon, Item.buyPrice(gold: 50), Condition.Hardmode) - .Add(ItemType()) - .AddWithCustomValue(interlude1Box.Type, Item.buyPrice(gold: 10), CalamityConditions.DownedCalamitasClone) - .AddWithCustomValue(interlude2Box.Type, Item.buyPrice(gold: 10), Condition.DownedMoonLord) - .AddWithCustomValue(interlude3Box.Type, Item.buyPrice(gold: 10), CalamityConditions.DownedYharon) - .AddWithCustomValue(eulogyBox.Type, Item.buyPrice(gold: 10), CalamityConditions.DownedDevourerOfGods); + shop.InsertAfter(ItemID.MusicBoxCredits, interlude1Box.Type, CalamityConditions.DownedCalamitasClone) + .InsertAfter(ItemID.MusicBoxCredits, interlude2Box.Type, Condition.DownedMoonLord) + .InsertAfter(ItemID.MusicBoxCredits, interlude3Box.Type, CalamityConditions.DownedYharon) + .InsertAfter(ItemID.MusicBoxCredits, eulogyBox.Type, CalamityConditions.DownedDevourerOfGods) + .AddWithCustomValue(ItemID.PrincessWeapon, Item.buyPrice(platinum: 1), Condition.Hardmode) + .Add(); } if (type == NPCID.SkeletonMerchant) { - shop.AddWithCustomValue(ItemType(), Item.buyPrice(silver: 25)) - .Add(ItemID.MilkCarton) + shop.InsertAfter(ItemID.HealingPotion, ItemType()) + .InsertAfter(ItemID.HealingPotion, ItemID.MilkCarton) + .InsertAfter(ItemID.SpelunkerFlare, ItemID.SpelunkerFlare, spelunkerGlowCondition, hasFlareGunUpgrade) .AddWithCustomValue(ItemID.Marrow, Item.buyPrice(gold: 25), Condition.Hardmode) - .AddWithCustomValue(ItemType(), Item.buyPrice(gold: 12)) - .AddWithCustomValue(ItemType(), Item.buyPrice(gold: 12)); + .AddWithCustomValue(Item.buyPrice(gold: 15)) + .AddWithCustomValue(Item.buyPrice(gold: 15)); } - if (type == NPCID.BestiaryGirl) { - shop.AddWithCustomValue(ItemID.EmpressButterfly, Item.buyPrice(gold: 15), bestiaryProgressLacewing); + shop.Add(ItemID.EmpressButterfly, bestiaryProgressLacewing); } if (type == NPCID.Truffle) { - shop.Add(ItemType()); + shop.Add(); } } @@ -1338,11 +1334,7 @@ namespace CalamityMod.NPCs break; } } - var punch = new Item(ItemType()) - { - shopCustomPrice = Item.buyPrice(gold: 10) - }; - items[index] = punch; + items[index] = new Item(ItemType()); } } #endregion diff --git a/NPCs/CalamityPierceResistance.cs b/NPCs/CalamityPierceResistance.cs index b01140fda0..ac34f3d460 100644 --- a/NPCs/CalamityPierceResistance.cs +++ b/NPCs/CalamityPierceResistance.cs @@ -62,7 +62,6 @@ namespace CalamityMod.NPCs exemptProjectiles.Add(ProjectileType()); // Included here as it does not have a projectile exemptProjectiles.Add(ProjectileID.MonkStaffT3); exemptProjectiles.Add(ProjectileID.PiercingStarlight); - exemptProjectiles.Add(ProjectileID.SandnadoFriendly); exemptProjectiles.Add(ProjectileID.Terragrim); // Specific vanilla projectile single hitbox exemptions @@ -148,7 +147,7 @@ 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 (ThanatosIDList.Includes(npc.type) && npc.GetGlobalNPC().unbreakableDR) + if (CalamityNPCTypeSets.Thanatos.Contains(npc.type) && npc.GetGlobalNPC().unbreakableDR) return; float damageReduction = projectile.Calamity().timesPierced * BalancingConstants.PierceResistHarshness; diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs index edbb95134b..a424a7349b 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -156,7 +156,7 @@ namespace CalamityMod.NPCs.CeaselessVoid if (phase4) darkEnergyAmt += 1; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) darkEnergyAmt *= 2; // Spawn a few Dark Energies as soon as the fight starts @@ -189,15 +189,12 @@ namespace CalamityMod.NPCs.CeaselessVoid Player player = Main.player[NPC.target]; - // Speed enrage - bool moveVeryFast = Vector2.Distance(NPC.Center, player.Center) > 960f || (!player.ZoneDungeon && !BossRushEvent.BossRushActive && player.position.Y < Main.worldSurface * 16.0); - // Despawn - if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > 5600f) + if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > 5600f || (player.position.Y < Main.worldSurface * 16.0 && !BossRushEvent.BossRushActive)) { NPC.TargetClosest(false); player = Main.player[NPC.target]; - if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > 5600f) + if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > 5600f || (player.position.Y < Main.worldSurface * 16.0 && !BossRushEvent.BossRushActive)) { if (NPC.velocity.Y > 3f) NPC.velocity.Y = 3f; @@ -214,24 +211,18 @@ namespace CalamityMod.NPCs.CeaselessVoid else if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; - float tileEnrageMult = CalamityWorld.MaliceMode ? 1.5f : 1f; - NPC.Calamity().CurrentlyEnraged = tileEnrageMult > 1f && !BossRushEvent.BossRushActive; - - // Set AI variable to be used by Dark Energies - NPC.ai[1] = tileEnrageMult; - // Increase projectile fire rate based on number of nearby active tiles - float projectileFireRateMultiplier = MathHelper.Lerp(0.5f, 1.5f, 1f - ((tileEnrageMult - 1f) / 0.5f)); + float projectileFireRateMultiplier = Main.getGoodWorld ? 0.5f : 1.5f; // Decides whether Ceaseless moves closer to its target or not - float distanceRequiredToMove = CalamityWorld.LegendaryMode ? 300f : 720f; + float distanceRequiredToMove = Main.getGoodWorld ? 300f : 720f; bool move = Vector2.Distance(NPC.Center, player.Center) > distanceRequiredToMove || !Collision.CanHit(NPC.Center, 1, 1, player.Center, 1, 1); // Succ attack if (!anyDarkEnergies) { // This is here because it's used in multiple places - float suckDistance = CalamityWorld.MaliceMode ? 2400f : death ? 1600f : revenge ? 1440f : expertMode ? 1280f : 1040f; + float suckDistance = death ? 1600f : revenge ? 1440f : expertMode ? 1280f : 1040f; // Move closer to the target before trying to succ if (movingDuringSuccPhase) @@ -531,8 +522,8 @@ namespace CalamityMod.NPCs.CeaselessVoid // Basic movement towards a location void Movement(bool succ) { - float velocity = moveVeryFast ? 25f : ((expertMode ? 7.5f : 6f) + (float)(death ? 2f * (1D - lifeRatio) : 0f)) * tileEnrageMult; - float acceleration = (moveVeryFast ? 0.75f : death ? 0.2f : expertMode ? 0.16f : 0.12f) + (float)(death ? 0.04f * (1D - lifeRatio) : 0f) * tileEnrageMult; + float velocity = ((expertMode ? 7.5f : 6f) + (float)(death ? 2f * (1D - lifeRatio) : 0f)); + float acceleration = (death ? 0.2f : expertMode ? 0.16f : 0.12f) + (float)(death ? 0.04f * (1D - lifeRatio) : 0f); // Increase speed dramatically in succ phase if (succ) @@ -548,7 +539,7 @@ namespace CalamityMod.NPCs.CeaselessVoid acceleration *= 5f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.15f; acceleration *= 1.15f; @@ -558,8 +549,8 @@ namespace CalamityMod.NPCs.CeaselessVoid // Move between 8 different positions around the player, in order float maxDistance = 320f; - Vector2 moveToOffset = succ ? Vector2.Zero : CalamityWorld.LegendaryMode ? new Vector2(0f, -maxDistance) : Vector2.Zero; - if ((!succ && CalamityWorld.LegendaryMode) || !madeItToLocation) + Vector2 moveToOffset = succ ? Vector2.Zero : Main.getGoodWorld ? new Vector2(0f, -maxDistance) : Vector2.Zero; + if ((!succ && Main.getGoodWorld) || !madeItToLocation) { // Move to a new location every few seconds calamityGlobalNPC.newAI[2] += 1f; @@ -581,7 +572,7 @@ namespace CalamityMod.NPCs.CeaselessVoid Vector2 distanceFromDestination = destination - NPC.Center; // Movement - if (NPC.Distance(destination) > maxDistance || succ || (!CalamityWorld.LegendaryMode && !madeItToLocation)) + if (NPC.Distance(destination) > maxDistance || succ || (!Main.getGoodWorld && !madeItToLocation)) CalamityUtils.SmoothMovement(NPC, 0f, distanceFromDestination, velocity, acceleration, true); if (NPC.Distance(destination) < 80) { @@ -815,12 +806,8 @@ namespace CalamityMod.NPCs.CeaselessVoid if (NPC.soundDelay == 0 && NPC.life >= NPC.lifeMax * 0.05f) { NPC.soundDelay = 8; - float pitchVar = 0; - if (Main.zenithWorld) - { - pitchVar = Main.rand.Next(-60, 41) * 0.01f; - } - SoundEngine.PlaySound(CommonCalamitySounds.OtherwordlyHitSound with { Pitch = CommonCalamitySounds.OtherwordlyHitSound.Pitch + pitchVar }, NPC.Center); + float pitchVar = Main.zenithWorld ? 0.4f : 0; + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/NPCHit/OtherworldlyHit") with { PitchVariance = pitchVar }, NPC.Center); } for (int k = 0; k < 5; k++) diff --git a/NPCs/CeaselessVoid/DarkEnergy.cs b/NPCs/CeaselessVoid/DarkEnergy.cs index c242ed17af..f147f52a7f 100644 --- a/NPCs/CeaselessVoid/DarkEnergy.cs +++ b/NPCs/CeaselessVoid/DarkEnergy.cs @@ -119,7 +119,7 @@ namespace CalamityMod.NPCs.CeaselessVoid if (NPC.Opacity > 1f) NPC.Opacity = 1f; - NPC.scale = MathHelper.Lerp(0.05f, CalamityWorld.LegendaryMode ? 0.5f : 1f, NPC.Opacity); + NPC.scale = MathHelper.Lerp(0.05f, Main.getGoodWorld ? 0.5f : 1f, NPC.Opacity); } else { @@ -161,13 +161,10 @@ namespace CalamityMod.NPCs.CeaselessVoid bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - // Gets how enraged Ceaseless Void is - float tileEnrageMult = Main.npc[CalamityGlobalNPC.voidBoss].ai[1]; - // Distance from Ceaseless Void double maxDistance = death ? 1040D : revenge ? 960D : expertMode ? 880D : minMaxDistance; double rateOfChangeIncrease = (maxDistance / minMaxDistance) - 1D; - double rateOfChange = (NPC.ai[1] * 0.5f) + 2D + (tileEnrageMult - 1f) + rateOfChangeIncrease; + double rateOfChange = (NPC.ai[1] * 0.5f) + 2D + rateOfChangeIncrease; if (NPC.Calamity().newAI[0] == 0f) { distance += rateOfChange; @@ -188,7 +185,7 @@ namespace CalamityMod.NPCs.CeaselessVoid } // Rotation velocity - float minRotationVelocity = 0.5f + tileEnrageMult - 1f; + float minRotationVelocity = 0.5f; float rotationVelocityIncrease = death ? 0.2f : revenge ? 0.15f : expertMode ? 0.1f : 0f; rotationVelocityIncrease += rotationVelocityIncrease * (NPC.ai[1] * 0.5f); diff --git a/NPCs/Crabulon/CrabShroom.cs b/NPCs/Crabulon/CrabShroom.cs index 7a979cac62..665ccc03c2 100644 --- a/NPCs/Crabulon/CrabShroom.cs +++ b/NPCs/Crabulon/CrabShroom.cs @@ -31,14 +31,12 @@ namespace CalamityMod.NPCs.Crabulon NPC.damage = 18; // 36 NPC.width = 14; NPC.height = 14; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale = 2f; - NPC.lifeMax = CalamityWorld.LegendaryMode ? 180 : 15; + NPC.lifeMax = 15; if (BossRushEvent.BossRushActive) NPC.lifeMax = 6000; - if (CalamityWorld.LegendaryMode) - NPC.lifeMax *= 2; AIType = -1; NPC.knockBackResist = 0.5f; NPC.noGravity = true; @@ -67,7 +65,7 @@ namespace CalamityMod.NPCs.Crabulon bool death = CalamityWorld.death || BossRushEvent.BossRushActive; float xVelocityLimit = death ? 8f : revenge ? 6f : 5f; - float yVelocityLimit = CalamityWorld.LegendaryMode ? 0.25f : death ? 0.75f : revenge ? 0.9f : 1f; + float yVelocityLimit = Main.getGoodWorld ? 0.25f : death ? 0.75f : revenge ? 0.9f : 1f; // Get a target if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) @@ -99,7 +97,7 @@ namespace CalamityMod.NPCs.Crabulon NPC.rotation = NPC.velocity.X * 0.1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { float pushVelocity = 0.5f; foreach (NPC n in Main.ActiveNPCs) diff --git a/NPCs/Crabulon/Crabulon.cs b/NPCs/Crabulon/Crabulon.cs index 19533f9192..531fdd9487 100644 --- a/NPCs/Crabulon/Crabulon.cs +++ b/NPCs/Crabulon/Crabulon.cs @@ -97,7 +97,7 @@ namespace CalamityMod.NPCs.Crabulon NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { NPC.scale *= 1.5f; NPC.defense += 12; @@ -183,32 +183,6 @@ namespace CalamityMod.NPCs.Crabulon else if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; - // Enrage - if ((!player.ZoneGlowshroom || (NPC.position.Y / 16f) < Main.worldSurface) && !BossRushEvent.BossRushActive) - { - if (biomeEnrageTimer > 0) - biomeEnrageTimer--; - } - else - biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - - bool biomeEnraged = biomeEnrageTimer <= 0; - - float enrageScale = 0f; - if (biomeEnraged && (NPC.position.Y / 16f) < Main.worldSurface) - { - NPC.Calamity().CurrentlyEnraged = true; - enrageScale += 1f; - } - if (biomeEnraged && !player.ZoneGlowshroom) - { - NPC.Calamity().CurrentlyEnraged = true; - enrageScale += 1f; - } - - if (CalamityWorld.LegendaryMode) - enrageScale += 0.5f; - if (NPC.ai[0] < 2f) { int mushBombAmt = phase4 ? 6 : phase3 ? 3 : phase2 ? 2 : 1; @@ -276,14 +250,14 @@ namespace CalamityMod.NPCs.Crabulon // Avoid cheap bullshit NPC.damage = 0; - float walkingVelocity = (death ? (5f + 2f * (1f - lifeRatio)) : expertMode ? 5f : 3.5f) + 2.5f * enrageScale; + float walkingVelocity = death ? (5f + 2f * (1f - lifeRatio)) : expertMode ? 5f : 3.5f; if (phase2) walkingVelocity += 0.5f; if (phase3) walkingVelocity += 0.75f; if (phase4) walkingVelocity += 1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) walkingVelocity *= 2f; bool shouldWalkSlower = false; @@ -407,7 +381,7 @@ namespace CalamityMod.NPCs.Crabulon NPC.ai[1] += 1f; } - float jumpGateValue = (expertMode ? 60f : 120f) / (enrageScale + 1f); + float jumpGateValue = expertMode ? 60f : 120f; if (NPC.ai[1] >= jumpGateValue) { NPC.ai[1] = -20f; @@ -640,7 +614,7 @@ namespace CalamityMod.NPCs.Crabulon } else { - float velocityX = (death ? 0.15f : expertMode ? 0.125f : 0.1f) + 0.05f * enrageScale; + float velocityX = death ? 0.15f : expertMode ? 0.125f : 0.1f; if (NPC.direction < 0) NPC.velocity.X -= velocityX; else if (NPC.direction > 0) @@ -710,7 +684,7 @@ namespace CalamityMod.NPCs.Crabulon center = player.Center; center.Y -= 320f + Math.Abs(player.Center.Y - NPC.Center.Y); - center.X += Math.Abs(player.Center.X - NPC.Center.X) * ((player.Center.X - NPC.Center.X > 0f) ? 1 : -1); + center.X += Math.Abs(player.Center.X - NPC.Center.X) * ((player.Center.X > NPC.Center.X) ? 1 : -1); NPC.ai[2] = 1f; NPC.ai[3] = NPC.Bottom.Y; @@ -720,6 +694,7 @@ namespace CalamityMod.NPCs.Crabulon NPC.velocity = center - NPC.Center; NPC.velocity = NPC.velocity.SafeNormalize(Vector2.Zero); NPC.velocity *= leapVelocity; + NPC.velocity.X *= 0.6f; float velocityMinY = -leapVelocity; if (NPC.velocity.Y > velocityMinY) @@ -729,7 +704,7 @@ namespace CalamityMod.NPCs.Crabulon } else { - float mushroomFireRate = death ? 20f : 10f; + float mushroomFireRate = 15f; if (NPC.ai[1] % mushroomFireRate == 0f) { SoundEngine.PlaySound(SoundID.Item42, NPC.Center); @@ -779,10 +754,10 @@ namespace CalamityMod.NPCs.Crabulon Vector2 initialSpawnLocation = NPC.Bottom - new Vector2(0f, 8f); for (int i = 0; i < numProj; i++) - Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation + new Vector2(Main.rand.Next(0, 81), Main.rand.Next(-20, 1)), initialVelocity - ((i / (float)numProj) * initialVelocity), type, MushroomShotDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation + new Vector2(Main.rand.Next(0, 81), Main.rand.Next(-20, 1)), initialVelocity - (i / (float)numProj * initialVelocity), type, MushroomShotDamage, 0f, Main.myPlayer); for (int i = 0; i < numProj; i++) - Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation - new Vector2(Main.rand.Next(0, 81), Main.rand.Next(-20, 1)), -(initialVelocity - ((i / (float)numProj) * initialVelocity)), type, MushroomShotDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation + new Vector2(Main.rand.Next(-81, 0), Main.rand.Next(-20, 1)), -(initialVelocity - (i / (float)numProj * initialVelocity)), type, MushroomShotDamage, 0f, Main.myPlayer); } for (int j = (int)NPC.position.X - 20; j < (int)NPC.position.X + NPC.width + 40; j += 20) @@ -975,7 +950,7 @@ namespace CalamityMod.NPCs.Crabulon { if (Main.netMode != NetmodeID.MultiplayerClient) { - int crabShroomSpawnFreq = (int)(NPC.lifeMax * (CalamityWorld.LegendaryMode ? 0.02 : 0.05)); + int crabShroomSpawnFreq = (int)(NPC.lifeMax * (Main.getGoodWorld ? 0.02 : 0.05)); if ((NPC.life + crabShroomSpawnFreq) < NPC.localAI[0]) { NPC.localAI[0] = NPC.life; @@ -987,8 +962,8 @@ namespace CalamityMod.NPCs.Crabulon int npcType = ModContent.NPCType(); int crabShroom = NPC.NewNPC(NPC.GetSource_FromAI(), x, y, npcType); Main.npc[crabShroom].SetDefaults(npcType); - Main.npc[crabShroom].velocity.X = Main.rand.Next(-50, 51) * (CalamityWorld.LegendaryMode ? 0.2f : 0.1f); - Main.npc[crabShroom].velocity.Y = Main.rand.Next(-50, -31) * (CalamityWorld.LegendaryMode ? 0.2f : 0.1f); + Main.npc[crabShroom].velocity.X = Main.rand.Next(-50, 51) * (Main.getGoodWorld ? 0.2f : 0.1f); + Main.npc[crabShroom].velocity.Y = Main.rand.Next(-50, -31) * (Main.getGoodWorld ? 0.2f : 0.1f); if (Main.dedServ && crabShroom < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, crabShroom); } diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index 53fa4fd862..cbcfad9450 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -115,7 +115,7 @@ namespace CalamityMod.NPCs.Cryogen NPC.HitSound = HitSound; NPC.DeathSound = DeathSound; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 0.8f; if (Main.zenithWorld) @@ -188,27 +188,6 @@ namespace CalamityMod.NPCs.Cryogen bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - // Enrage - if (!player.ZoneSnow && !BossRushEvent.BossRushActive) - { - if (biomeEnrageTimer > 0) - biomeEnrageTimer--; - } - else - biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - - bool biomeEnraged = biomeEnrageTimer <= 0; - - float enrageScale = death ? 0.5f : 0f; - if (biomeEnraged) - { - NPC.Calamity().CurrentlyEnraged = true; - enrageScale += 2f; - } - - if (enrageScale > 2f) - enrageScale = 2f; - // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -291,7 +270,7 @@ namespace CalamityMod.NPCs.Cryogen else if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { int spawnType = Main.zenithWorld ? NPCID.RedDevil : NPCID.IceGolem; if (!NPC.AnyNPCs(spawnType)) @@ -319,13 +298,13 @@ namespace CalamityMod.NPCs.Cryogen float chargePhaseGateValue = 360f; float chargeDuration = 60f; - float chargeTelegraphTime = NPC.ai[0] == 2f ? (CalamityWorld.LegendaryMode ? 60f : 80f) : (CalamityWorld.LegendaryMode ? 90f : 120f); + float chargeTelegraphTime = NPC.ai[0] == 2f ? (Main.getGoodWorld ? 60f : 80f) : (Main.getGoodWorld ? 90f : 120f); float chargeTelegraphMaxRotationIncrement = 1f; float chargeTelegraphRotationIncrement = chargeTelegraphMaxRotationIncrement / chargeTelegraphTime; float chargeSlowDownTime = 15f; - float chargeVelocityMin = CalamityWorld.LegendaryMode ? 24f : 12f; - float chargeVelocityMax = CalamityWorld.LegendaryMode ? 42f : 30f; - if (CalamityWorld.LegendaryMode) + float chargeVelocityMin = Main.getGoodWorld ? 24f : 12f; + float chargeVelocityMax = Main.getGoodWorld ? 42f : 30f; + if (Main.getGoodWorld) { chargePhaseGateValue *= 0.7f; chargeDuration *= 0.8f; @@ -381,7 +360,7 @@ namespace CalamityMod.NPCs.Cryogen int totalProjectiles = 16; float radians = MathHelper.TwoPi / totalProjectiles; int type = iceBlast; - float velocity = 9f + enrageScale; + float velocity = death ? 9.5f : 9f; float projectileVelocityToPass = 0f; if (type == ModContent.ProjectileType()) projectileVelocityToPass = velocity * 2f; @@ -401,15 +380,14 @@ namespace CalamityMod.NPCs.Cryogen float playerYDist = player.Center.Y - cryogenCenter.Y; float playerDistance = (float)Math.Sqrt(playerXDist * playerXDist + playerYDist * playerYDist); - float cryogenSpeed = revenge ? 5f : 4f; - cryogenSpeed += 4f * enrageScale; + float cryogenSpeed = death ? 7f : revenge ? 5f : 4f; playerDistance = cryogenSpeed / playerDistance; playerXDist *= playerDistance; playerYDist *= playerDistance; float inertia = 50f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) inertia *= 0.5f; NPC.velocity.X = (NPC.velocity.X * inertia + playerXDist) / (inertia + 1f); @@ -456,7 +434,7 @@ namespace CalamityMod.NPCs.Cryogen int totalProjectiles = 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = iceBlast; - float velocity2 = 9f + enrageScale; + float velocity2 = death ? 9.5f : 9f; float projectileVelocityToPass = 0f; if (type == ModContent.ProjectileType()) projectileVelocityToPass = velocity2 * 2f; @@ -471,10 +449,8 @@ namespace CalamityMod.NPCs.Cryogen } } - float velocity = revenge ? 3.5f : 4f; - float acceleration = 0.15f; - velocity -= enrageScale * 0.8f; - acceleration += 0.07f * enrageScale; + float velocity = death ? 3.1f : revenge ? 3.5f : 4f; + float acceleration = death ? 0.185f : 0.15f; if (NPC.position.Y > player.position.Y - 375f) { @@ -532,7 +508,7 @@ namespace CalamityMod.NPCs.Cryogen if (Main.netMode != NetmodeID.MultiplayerClient) { int type = iceRain; - float maxVelocity = 9f + enrageScale; + float maxVelocity = death ? 9.5f : 9f; float velocity = maxVelocity - (calamityGlobalNPC.newAI[0] * maxVelocity * 0.5f); int totalProjectiles = 10; int maxTotalProjectileReductionBasedOnRotationSpeed = (int)(totalProjectiles * 0.7f); @@ -571,7 +547,7 @@ namespace CalamityMod.NPCs.Cryogen if (NPC.ai[1] == chargeGateValue) { float chargeVelocity = Vector2.Distance(NPC.Center, player.Center) / chargeDuration * 2f; - NPC.velocity = Vector2.Normalize(player.Center - NPC.Center) * (chargeVelocity + enrageScale * 2f); + NPC.velocity = Vector2.Normalize(player.Center - NPC.Center) * (chargeVelocity + (death ? 1f : 0f)); if (NPC.velocity.Length() < chargeVelocityMin) { @@ -652,7 +628,7 @@ namespace CalamityMod.NPCs.Cryogen int totalProjectiles = 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = iceBlast; - float velocity = 9f + enrageScale; + float velocity = death ? 9.5f : 9f; float projectileVelocityToPass = 0f; if (type == ModContent.ProjectileType()) projectileVelocityToPass = velocity * 2f; @@ -672,15 +648,14 @@ namespace CalamityMod.NPCs.Cryogen float playerYDist = player.Center.Y - cryogenCenter.Y; float playerDistance = (float)Math.Sqrt(playerXDist * playerXDist + playerYDist * playerYDist); - float cryogenSpeed = revenge ? 7f : 6f; - cryogenSpeed += 4f * enrageScale; + float cryogenSpeed = death ? 9f : revenge ? 7f : 6f; playerDistance = cryogenSpeed / playerDistance; playerXDist *= playerDistance; playerYDist *= playerDistance; float inertia = 50f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) inertia *= 0.5f; NPC.velocity.X = (NPC.velocity.X * inertia + playerXDist) / (inertia + 1f); @@ -700,7 +675,7 @@ namespace CalamityMod.NPCs.Cryogen if (Main.netMode != NetmodeID.MultiplayerClient) { int type = iceRain; - float maxVelocity = 9f + enrageScale; + float maxVelocity = death ? 9.5f : 9f; float velocity = maxVelocity - (calamityGlobalNPC.newAI[0] * maxVelocity * 0.5f); int totalProjectiles = calamityGlobalNPC.newAI[1] == 0f ? 8 : 4; int maxTotalProjectileReductionBasedOnRotationSpeed = (int)(totalProjectiles * 0.4f); @@ -739,7 +714,7 @@ namespace CalamityMod.NPCs.Cryogen if (NPC.ai[1] == chargeGateValue) { float chargeVelocity = Vector2.Distance(NPC.Center, player.Center) / chargeDuration * 2f; - NPC.velocity = Vector2.Normalize(player.Center - NPC.Center) * (chargeVelocity + enrageScale * 2f); + NPC.velocity = Vector2.Normalize(player.Center - NPC.Center) * (chargeVelocity + (death ? 1f : 0f)); if (NPC.velocity.Length() < chargeVelocityMin) { @@ -813,7 +788,7 @@ namespace CalamityMod.NPCs.Cryogen int totalProjectiles = 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = iceBlast; - float velocity = 10f + enrageScale; + float velocity = death ? 10.5f : 10f; float projectileVelocityToPass = 0f; if (type == ModContent.ProjectileType()) projectileVelocityToPass = velocity * 2f; @@ -833,15 +808,14 @@ namespace CalamityMod.NPCs.Cryogen float playerYDist = player.Center.Y - cryogenCenter.Y; float playerDistance = (float)Math.Sqrt(playerXDist * playerXDist + playerYDist * playerYDist); - float speed = revenge ? 5.5f : 5f; - speed += 3f * enrageScale; + float speed = death ? 7f : revenge ? 5.5f : 5f; playerDistance = speed / playerDistance; playerXDist *= playerDistance; playerYDist *= playerDistance; float inertia = 50f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) inertia *= 0.5f; NPC.velocity.X = (NPC.velocity.X * inertia + playerXDist) / (inertia + 1f); @@ -917,7 +891,7 @@ namespace CalamityMod.NPCs.Cryogen if (Main.netMode != NetmodeID.MultiplayerClient) { int type = iceRain; - float velocity = 9f + enrageScale; + float velocity = death ? 9.5f : 9f; for (int i = 0; i < 3; i++) { int totalProjectiles = 6; @@ -1008,7 +982,7 @@ namespace CalamityMod.NPCs.Cryogen { if (NPC.ai[1] == 60f) // Spawn homing ice blasts on charge { - NPC.velocity = Vector2.Normalize(player.Center - NPC.Center) * (18f + enrageScale * 2f); + NPC.velocity = Vector2.Normalize(player.Center - NPC.Center) * (death ? 19f : 18f); if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height)) { @@ -1017,7 +991,7 @@ namespace CalamityMod.NPCs.Cryogen if (Main.netMode != NetmodeID.MultiplayerClient) { int type = iceBlast; - float velocity = 1.5f + enrageScale * 0.5f; + float velocity = death ? 1.75f : 1.5f; int totalSpreads = phase7 ? 3 : 2; for (int i = 0; i < totalSpreads; i++) { @@ -1084,7 +1058,7 @@ namespace CalamityMod.NPCs.Cryogen return; } - float chargeVelMult = 18f + enrageScale * 2f; + float chargeVelMult = death ? 19f : 18f; Vector2 chargeDirection = new Vector2(NPC.Center.X + (NPC.direction * 20), NPC.Center.Y + 6f); float playerchargeXDist = player.position.X + player.width * 0.5f - chargeDirection.X; @@ -1118,7 +1092,7 @@ namespace CalamityMod.NPCs.Cryogen } float inertia = 30f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) inertia *= 0.5f; NPC.velocity.X = (NPC.velocity.X * inertia + playerchargeXDist) / (inertia + 1f); @@ -1174,10 +1148,8 @@ namespace CalamityMod.NPCs.Cryogen NPC.netUpdate = true; } - float velocity = revenge ? 5f : 6f; - float acceleration = 0.2f; - velocity -= enrageScale; - acceleration += 0.07f * enrageScale; + float velocity = death ? 4.5f : revenge ? 5f : 6f; + float acceleration = death ? 0.535f : 0.2f; if (NPC.position.Y > player.position.Y - 375f) { diff --git a/NPCs/Cryogen/CryogenShield.cs b/NPCs/Cryogen/CryogenShield.cs index b936f757f6..a2befaa003 100644 --- a/NPCs/Cryogen/CryogenShield.cs +++ b/NPCs/Cryogen/CryogenShield.cs @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.Cryogen NPC.coldDamage = true; NPC.width = 216; NPC.height = 216; - NPC.scale *= (CalamityWorld.death || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) ? 0.8f : 1f; + NPC.scale *= (CalamityWorld.death || BossRushEvent.BossRushActive || Main.getGoodWorld) ? 0.8f : 1f; NPC.DR_NERD(0.4f); NPC.LifeMaxNERB(2800, 3360, 33600); NPC.Opacity = 0f; diff --git a/NPCs/DesertScourge/DesertNuisanceBody.cs b/NPCs/DesertScourge/DesertNuisanceBody.cs index 1af12df8f8..d696d93a50 100644 --- a/NPCs/DesertScourge/DesertNuisanceBody.cs +++ b/NPCs/DesertScourge/DesertNuisanceBody.cs @@ -44,12 +44,12 @@ namespace CalamityMod.NPCs.DesertScourge NPC.height = 88; NPC.defense = 5; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.defense += 27; NPC.LifeMaxNERB(1500, 1800, 40000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax = 4800; + if (Main.getGoodWorld) + NPC.lifeMax *= 2; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; diff --git a/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs b/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs index 6fff24e78e..74ab964b4a 100644 --- a/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs @@ -44,12 +44,12 @@ namespace CalamityMod.NPCs.DesertScourge NPC.height = 78; NPC.defense = 4; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.defense += 26; NPC.LifeMaxNERB(1300, 1560, 35000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax = 4000; + if (Main.getGoodWorld) + NPC.lifeMax *= 2; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; diff --git a/NPCs/DesertScourge/DesertNuisanceHead.cs b/NPCs/DesertScourge/DesertNuisanceHead.cs index 24e74f0275..d3be799c43 100644 --- a/NPCs/DesertScourge/DesertNuisanceHead.cs +++ b/NPCs/DesertScourge/DesertNuisanceHead.cs @@ -56,15 +56,15 @@ namespace CalamityMod.NPCs.DesertScourge NPC.damage = 25; // 40 (1.6x expert scaling) NPC.defense = 3; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.defense += 19; NPC.width = 88; NPC.height = 88; NPC.LifeMaxNERB(1500, 1800, 40000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax = 4800; + if (Main.getGoodWorld) + NPC.lifeMax *= 2; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; @@ -142,7 +142,7 @@ namespace CalamityMod.NPCs.DesertScourge speed += 0.085f * enrageScale; turnSpeed += 0.17f * enrageScale; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { speed *= 1.1f; turnSpeed *= 1.2f; @@ -164,7 +164,7 @@ namespace CalamityMod.NPCs.DesertScourge { int previous = NPC.whoAmI; int minLength = 8; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) minLength *= 2; int bodyTypeAIVariable = 0; @@ -268,7 +268,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.spriteDirection = -1; float maxChaseSpeed = Main.zenithWorld ? SegmentVelocity_ZenithSeed : - CalamityWorld.LegendaryMode ? SegmentVelocity_GoodWorld : + Main.getGoodWorld ? SegmentVelocity_GoodWorld : death ? SegmentVelocity_Death : SegmentVelocity_Expert; maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); @@ -295,12 +295,6 @@ namespace CalamityMod.NPCs.DesertScourge } } - if (CalamityWorld.LegendaryMode) - { - speed *= 1.5f; - turnSpeed *= 1.5f; - } - Vector2 npcCenter = NPC.Center; float playerX = Main.player[NPC.target].Center.X; float targettingPosition = Main.player[NPC.target].Center.Y; diff --git a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs index 45b3676e8b..0b8353912f 100644 --- a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs @@ -48,15 +48,15 @@ namespace CalamityMod.NPCs.DesertScourge NPC.damage = 25; // 40 (1.6x expert scaling) NPC.defense = 2; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.defense += 18; NPC.width = 78; NPC.height = 78; NPC.LifeMaxNERB(1300, 1560, 35000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax = 4000; + if (Main.getGoodWorld) + NPC.lifeMax *= 2; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; @@ -138,7 +138,7 @@ namespace CalamityMod.NPCs.DesertScourge speed += 0.07f * enrageScale; turnSpeed += 0.14f * enrageScale; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { speed *= 1.1f; turnSpeed *= 1.2f; @@ -198,7 +198,7 @@ namespace CalamityMod.NPCs.DesertScourge { int previous = NPC.whoAmI; int minLength = 8; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) minLength *= 2; int bodyTypeAIVariable = 0; @@ -306,7 +306,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.spriteDirection = -1; float maxChaseSpeed = Main.zenithWorld ? SegmentVelocity_ZenithSeed : - CalamityWorld.LegendaryMode ? SegmentVelocity_GoodWorld : + Main.getGoodWorld ? SegmentVelocity_GoodWorld : death ? SegmentVelocity_Death : SegmentVelocity_Expert; maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); @@ -333,12 +333,6 @@ namespace CalamityMod.NPCs.DesertScourge } } - if (CalamityWorld.LegendaryMode) - { - speed *= 1.5f; - turnSpeed *= 1.5f; - } - Vector2 npcCenter = NPC.Center; float playerX = Main.player[NPC.target].Center.X; float targettingPosition = Main.player[NPC.target].Center.Y; diff --git a/NPCs/DesertScourge/DesertNuisanceTail.cs b/NPCs/DesertScourge/DesertNuisanceTail.cs index 06b472173f..56ce8db014 100644 --- a/NPCs/DesertScourge/DesertNuisanceTail.cs +++ b/NPCs/DesertScourge/DesertNuisanceTail.cs @@ -26,12 +26,12 @@ namespace CalamityMod.NPCs.DesertScourge NPC.height = 88; NPC.defense = 8; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.defense += 34; NPC.LifeMaxNERB(1500, 1800, 40000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax = 4800; + if (Main.getGoodWorld) + NPC.lifeMax *= 2; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; diff --git a/NPCs/DesertScourge/DesertNuisanceTailYoung.cs b/NPCs/DesertScourge/DesertNuisanceTailYoung.cs index 6bec098fe0..5b6bc7ee94 100644 --- a/NPCs/DesertScourge/DesertNuisanceTailYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceTailYoung.cs @@ -26,12 +26,12 @@ namespace CalamityMod.NPCs.DesertScourge NPC.height = 78; NPC.defense = 7; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.defense += 33; NPC.LifeMaxNERB(1300, 1560, 35000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax = 4000; + if (Main.getGoodWorld) + NPC.lifeMax *= 2; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; diff --git a/NPCs/DesertScourge/DesertScourgeBody.cs b/NPCs/DesertScourge/DesertScourgeBody.cs index ea3d5a8279..916fa6ba25 100644 --- a/NPCs/DesertScourge/DesertScourgeBody.cs +++ b/NPCs/DesertScourge/DesertScourgeBody.cs @@ -49,8 +49,8 @@ namespace CalamityMod.NPCs.DesertScourge NPC.defense = 6; NPC.LifeMaxNERB(4200, 5000, 1150000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax *= 4; + if (Main.getGoodWorld) + NPC.lifeMax *= 2; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; @@ -64,7 +64,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.netAlways = true; NPC.dontCountMe = true; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 0.4f; NPC.Calamity().VulnerableToCold = true; diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index 4440d7ba44..168fd05ce5 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -96,8 +96,8 @@ namespace CalamityMod.NPCs.DesertScourge NPC.height = 104; NPC.LifeMaxNERB(4200, 5000, 1150000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax *= 4; + if (Main.getGoodWorld) + NPC.lifeMax *= 2; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; @@ -111,9 +111,8 @@ namespace CalamityMod.NPCs.DesertScourge NPC.DeathSound = DeathSound; NPC.netAlways = true; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 0.4f; - if (Main.zenithWorld) NPC.scale *= 4f; @@ -254,7 +253,7 @@ namespace CalamityMod.NPCs.DesertScourge speed += 0.085f * enrageScale; turnSpeed += 0.17f * enrageScale; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { speed *= 1.1f; turnSpeed *= 1.2f; @@ -426,7 +425,7 @@ namespace CalamityMod.NPCs.DesertScourge { int previous = NPC.whoAmI; int minLength = death ? 24 : revenge ? 21 : expertMode ? 18 : 15; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) minLength *= 3; int bodyTypeAIVariable = 0; @@ -537,7 +536,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.spriteDirection = -1; float maxChaseSpeed = Main.zenithWorld ? SegmentVelocity_ZenithSeed : - CalamityWorld.LegendaryMode ? SegmentVelocity_GoodWorld : + Main.getGoodWorld ? SegmentVelocity_GoodWorld : death ? SegmentVelocity_Death : expertMode ? SegmentVelocity_Expert : SegmentVelocity_Normal; @@ -596,14 +595,14 @@ namespace CalamityMod.NPCs.DesertScourge { // Spit a huge spread of sand upwards that falls down SoundEngine.PlaySound(SandBlastSound, NPC.Center); - float velocity = CalamityWorld.LegendaryMode ? 16f : death ? 8.5f : revenge ? 8f : expertMode ? 7.5f : 6f; + float velocity = Main.getGoodWorld ? 16f : death ? 8.5f : revenge ? 8f : expertMode ? 7.5f : 6f; int type = ModContent.ProjectileType(); Vector2 projectileVelocity = (NPC.Center + NPC.velocity * 10f - NPC.Center).SafeNormalize(Vector2.UnitY) * velocity; int numProj = death ? 24 : revenge ? 21 : expertMode ? 18 : 12; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) numProj *= 2; - int spread = CalamityWorld.LegendaryMode ? 120 : 90; + int spread = Main.getGoodWorld ? 120 : 90; float rotation = MathHelper.ToRadians(spread); for (int i = 0; i < numProj; i++) { diff --git a/NPCs/DesertScourge/DesertScourgeTail.cs b/NPCs/DesertScourge/DesertScourgeTail.cs index 4647a5e631..c736d3dab9 100644 --- a/NPCs/DesertScourge/DesertScourgeTail.cs +++ b/NPCs/DesertScourge/DesertScourgeTail.cs @@ -29,8 +29,8 @@ namespace CalamityMod.NPCs.DesertScourge NPC.defense = 9; NPC.LifeMaxNERB(4200, 5000, 1150000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax *= 4; + if (Main.getGoodWorld) + NPC.lifeMax *= 2; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; @@ -44,7 +44,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.netAlways = true; NPC.dontCountMe = true; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 0.4f; NPC.Calamity().VulnerableToCold = true; diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index 4df6789f0d..43dd699c66 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -89,7 +89,7 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.dontCountMe = true; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 1.5f; } @@ -271,7 +271,7 @@ namespace CalamityMod.NPCs.DevourerofGods float segmentVelocity = death ? 17.5f : 16f; if (expertMode) segmentVelocity += 4f * (1f - lifeRatio); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) segmentVelocity *= 1.1f; } diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 50fbc9d04e..fee6b77511 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -5,6 +5,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Events; +using CalamityMod.Fonts; using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Armor.Vanity; @@ -155,6 +156,7 @@ namespace CalamityMod.NPCs.DevourerofGods // Sounds public static readonly SoundStyle SpawnSound = new("CalamityMod/Sounds/Custom/DevourerSpawn"); public static readonly SoundStyle AttackSound = new("CalamityMod/Sounds/Custom/DevourerAttack"); + public static readonly SoundStyle HitSound = new("CalamityMod/Sounds/NPCHit/OtherworldlyHit"); public static readonly SoundStyle DeathAnimationSound = new("CalamityMod/Sounds/NPCKilled/DevourerDeath"); public static readonly SoundStyle DeathExplosionSound = new("CalamityMod/Sounds/NPCKilled/DevourerDeathImpact"); public static readonly SoundStyle DeathSegmentSound = new("CalamityMod/Sounds/NPCKilled/DevourerSegmentBreak", 4); @@ -217,7 +219,7 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 1.5f; } @@ -425,7 +427,7 @@ namespace CalamityMod.NPCs.DevourerofGods groundPhaseTurnSpeed += Vector2.Distance(destination, NPC.Center) * 0.0002f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { segmentVelocity *= 1.1f; speed *= 1.1f; @@ -751,10 +753,10 @@ namespace CalamityMod.NPCs.DevourerofGods // Fireballs // Check angle and distance to make sure it's realistic that they'd be fired - if (NPC.Opacity >= 1f && (distanceFromTarget > 480f || CalamityWorld.LegendaryMode) && (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) + if (NPC.Opacity >= 1f && distanceFromTarget > 480f && (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) { calamityGlobalNPC.newAI[0] += 1f; - if (calamityGlobalNPC.newAI[0] >= (CalamityWorld.LegendaryMode ? 30f : 150f) && calamityGlobalNPC.newAI[0] % (CalamityWorld.LegendaryMode ? 30f : phase7 ? 30f : 60f) == 0f) + if (calamityGlobalNPC.newAI[0] >= (Main.getGoodWorld ? 30f : 150f) && calamityGlobalNPC.newAI[0] % (Main.getGoodWorld ? 30f : phase7 ? 30f : 60f) == 0f) { float fireballSpeed = 8f; Vector2 fireballVelocity = Vector2.Normalize(player.Center - NPC.Center) * fireballSpeed + NPC.velocity * 0.5f; @@ -769,7 +771,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (Main.netMode != NetmodeID.MultiplayerClient) Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, fireballVelocity, type, damage, 0f, Main.myPlayer); - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) { for (int l = 0; l < 8; l++) { @@ -1111,7 +1113,7 @@ namespace CalamityMod.NPCs.DevourerofGods speedCopy += Vector2.Distance(destination, NPC.Center) * 0.005f; turnSpeedCopy += Vector2.Distance(destination, NPC.Center) * 0.00025f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { if ((player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) speedCopy *= 2f; @@ -1269,7 +1271,7 @@ namespace CalamityMod.NPCs.DevourerofGods else if (increaseSpeed) groundPhaseTurnSpeed *= 2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { if ((player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) segmentVelocity *= 2f; @@ -1870,7 +1872,7 @@ namespace CalamityMod.NPCs.DevourerofGods turnSpeedCopy += distanceFromTarget * 0.0001f * (1f - lifeRatio); } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { if ((player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) speedCopy *= 2f; @@ -2014,7 +2016,7 @@ namespace CalamityMod.NPCs.DevourerofGods else if (increaseSpeed) groundPhaseTurnSpeed *= 2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { if ((player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) segmentVelocity *= 2f; @@ -2317,7 +2319,7 @@ namespace CalamityMod.NPCs.DevourerofGods float mult = revenge ? 1.5f : 3f; for (int i = 0; i < totalSpreads; i++) { - int totalProjectiles = (CalamityWorld.LegendaryMode) ? 30 : 12; + int totalProjectiles = Main.getGoodWorld ? 30 : 12; float radians = MathHelper.TwoPi / totalProjectiles; float newVelocity = finalVelocity - i * mult; float velocityMult = 1f + ((finalVelocity - newVelocity) / (newVelocity * 2f) / 100f); @@ -2604,7 +2606,6 @@ namespace CalamityMod.NPCs.DevourerofGods }; normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, weapons)); normalOnly.Add(ModContent.ItemType(), 10); - normalOnly.Add(ModContent.ItemType(), 10); // Vanity normalOnly.Add(ModContent.ItemType(), 7); @@ -2735,7 +2736,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (NPC.soundDelay == 0) { NPC.soundDelay = 8; - SoundEngine.PlaySound(CommonCalamitySounds.OtherwordlyHitSound with { Pitch = CommonCalamitySounds.OtherwordlyHitSound.Pitch + extrapitch }, NPC.Center); + SoundEngine.PlaySound(HitSound with { Pitch = HitSound.Pitch + extrapitch }, NPC.Center); } if (NPC.life <= 0) { @@ -2797,9 +2798,9 @@ namespace CalamityMod.NPCs.DevourerofGods Rectangle location = new Rectangle((int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height); // Speak in Wingdings if the Punch Card is equipped - if (target.Transformation().Type == ModContent.ItemType() && DoGWingdings.Wingdings != null && System.Environment.OSVersion.Platform == PlatformID.Win32NT && !GameCulture.FromCultureName(GameCulture.CultureName.Chinese).IsActive && !GameCulture.FromCultureName(GameCulture.CultureName.Russian).IsActive) + if (target.Transformation().Type == ModContent.ItemType() && FontAssetSystem.Fonts["Wingdings"] != null && System.Environment.OSVersion.Platform == PlatformID.Win32NT && !GameCulture.FromCultureName(GameCulture.CultureName.Chinese).IsActive && !GameCulture.FromCultureName(GameCulture.CultureName.Russian).IsActive) { - Vector2 vector = DoGWingdings.Wingdings.MeasureString(Language.GetTextValue(text)); + Vector2 vector = FontAssetSystem.Fonts["Wingdings"].MeasureString(Language.GetTextValue(text)); // This is how normal combat text spawn positioning is handled float positionX = (float)location.X + (float)location.Width * 0.5f - vector.X * 0.5f + Main.rand.Next(-(int)((double)location.Width * 0.5), (int)((double)location.Width * 0.5) + 1); float positionY = (float)location.Y + (float)location.Height * 0.25f - vector.Y * 0.5f + Main.rand.Next(-(int)((double)location.Height * 0.5), (int)((double)location.Height * 0.5) + 1); diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index c2bca730da..64e31b8cae 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -85,7 +85,7 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.takenDamageMultiplier = 1.25f; NPC.dontCountMe = true; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 1.5f; } @@ -304,7 +304,7 @@ namespace CalamityMod.NPCs.DevourerofGods float segmentVelocity = death ? 17.5f : 16f; if (expertMode) segmentVelocity += 4f * (1f - lifeRatio); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) segmentVelocity *= 1.1f; } @@ -385,7 +385,7 @@ namespace CalamityMod.NPCs.DevourerofGods { NPC.soundDelay = 8; float extrapitch = Main.zenithWorld ? 0.3f : 0f; - SoundEngine.PlaySound(CommonCalamitySounds.OtherwordlyHitSound with { Pitch = CommonCalamitySounds.OtherwordlyHitSound.Pitch + extrapitch }, NPC.Center); + SoundEngine.PlaySound(DevourerofGodsHead.HitSound with { Pitch = DevourerofGodsHead.HitSound.Pitch + extrapitch }, NPC.Center); } if (NPC.life <= 0) { diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index 94dcf7ca05..4b87ce9e40 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -151,7 +151,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.damage = 240; // 480 + NPC.damage = 250; // 500 NPC.npcSlots = 5f; NPC.width = 204; NPC.height = 226; @@ -424,7 +424,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo float timeToLineUpAttack = 30f; float timeToLineUpCharge = death ? 60f : revenge ? 68f : expertMode ? 75f : 90f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { timeToLineUpAttack *= 0.5f; timeToLineUpCharge *= 0.5f; @@ -445,7 +445,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo // Charge velocity float chargeVelocity = death ? 105f : revenge ? 101.25f : expertMode ? 97.5f : 90f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { baseVelocity *= 1.5f; chargeVelocity *= 1.15f; @@ -466,7 +466,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo float rocketPhaseDuration = lastMechAlive ? 60f : 90f; int numRockets = nerfedAttacks ? 2 : 3; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) numRockets += 3; // Default vector to fly to @@ -488,7 +488,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo int randomLocationVarianceX = shouldGetBuffedByBerserkPhase ? 50 : 20; int randomLocationVarianceY = shouldGetBuffedByBerserkPhase ? 250 : 100; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { randomLocationVarianceX *= 2; randomLocationVarianceY *= 2; @@ -1178,7 +1178,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo NPC.ForceNetUpdate(); // Plasma bolts on charge - if (Main.netMode != NetmodeID.MultiplayerClient && (!(Main.zenithWorld && !exoMechdusa) || (CalamityWorld.LegendaryMode))) + if (Main.netMode != NetmodeID.MultiplayerClient && !(Main.zenithWorld && !exoMechdusa)) { int totalProjectiles = death ? 12 : 8; float radians = MathHelper.TwoPi / totalProjectiles; diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index 055a1b2733..2e9aea4990 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -889,7 +889,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares else { // Enrage if the target is more than the deathray length away - if ((distanceFromTarget > DeathrayEnrageDistance || (CalamityWorld.LegendaryMode)) && EnragedState == (float)Enraged.No) + if ((distanceFromTarget > DeathrayEnrageDistance || Main.zenithWorld) && EnragedState == (float)Enraged.No) { // Play enrage sound if (Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < soundDistance) @@ -909,7 +909,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.velocity *= decelerationVelocityMult; int totalProjectiles = death ? 10 : revenge ? 9 : expertMode ? 8 : 6; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) totalProjectiles += 4; float radians = MathHelper.TwoPi / totalProjectiles; diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index 51e7694438..06f8bef2ec 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -456,7 +456,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis float attackPhaseGateValue = shouldGetBuffedByBerserkPhase ? berserkAttackTime : normalAttackTime; float timeToLineUpAttack = phase2 ? 30f : 45f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) timeToLineUpAttack *= 0.5f; // Spin variables @@ -495,7 +495,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis // Charge variables float chargeVelocity = nerfedAttacks ? 60f : death ? 74f : revenge ? 70.5f : expertMode ? 67f : 60f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeVelocity *= 1.15f; float chargeDistance = 2000f; @@ -520,7 +520,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis float baseVelocity = ((AIState == (int)Phase.Deathray || lineUpAttack || AIState == (int)Phase.LaserShotgun) ? 40f : 20f) * baseVelocityMult; float decelerationVelocityMult = 0.85f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) baseVelocity *= 1.5f; // Laser shotgun variables @@ -534,7 +534,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis int randomLocationVarianceX = shouldGetBuffedByBerserkPhase ? 50 : 20; int randomLocationVarianceY = shouldGetBuffedByBerserkPhase ? 250 : 100; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { randomLocationVarianceX *= 2; randomLocationVarianceY *= 2; diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index 208d7695ab..63d10f0991 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -525,7 +525,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else baseVelocity *= increaseSpeedMult; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) baseVelocity *= 1.15f; } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index 5c35828c78..fb5343f815 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -528,7 +528,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else baseVelocity *= increaseSpeedMult; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) baseVelocity *= 1.15f; } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index 864f6b5472..f77496ed32 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -172,7 +172,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.damage = 270; // 540 + NPC.damage = 250; // 500 NPC.npcSlots = 5f; NPC.width = 164; NPC.height = 164; @@ -253,7 +253,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } public float GetSlowdownAreaEdgeRadius(bool lastMechAlive) => - (CalamityWorld.death ? 600f : CalamityWorld.revenge ? 700f : Main.expertMode ? 800f : 1000f) * (lastMechAlive ? 0.75f : 1f) * (Main.zenithWorld && !exoMechdusa ? 2 : CalamityWorld.LegendaryMode ? 0.5f : 1f); + (CalamityWorld.death ? 600f : CalamityWorld.revenge ? 700f : Main.expertMode ? 800f : 1000f) * (lastMechAlive ? 0.75f : 1f) * (Main.zenithWorld && !exoMechdusa ? 2 : Main.getGoodWorld ? 0.75f : 1f); public int CheckForOtherMechs(ref int targetIndex, out bool exoPrimeAlive, out bool exoTwinsAlive) { @@ -526,7 +526,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else baseVelocity *= increaseSpeedMult; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) baseVelocity *= 1.15f; float turnDegrees = baseVelocity * 0.1f * (shouldGetBuffedByBerserkPhase ? 1.25f : 1.1f); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index 748c09e955..5e888f834e 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -526,7 +526,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else baseVelocity *= increaseSpeedMult; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) baseVelocity *= 1.15f; } diff --git a/NPCs/HiveMind/DankCreeper.cs b/NPCs/HiveMind/DankCreeper.cs index 64a3323cd2..baef197d63 100644 --- a/NPCs/HiveMind/DankCreeper.cs +++ b/NPCs/HiveMind/DankCreeper.cs @@ -24,15 +24,15 @@ namespace CalamityMod.NPCs.HiveMind NPC.lifeMax = 120; if (BossRushEvent.BossRushActive) NPC.lifeMax = 2000; - if (CalamityWorld.LegendaryMode) - NPC.lifeMax *= 4; - - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) + { + NPC.lifeMax *= 3; NPC.reflectsProjectiles = true; + } NPC.aiStyle = -1; AIType = -1; - NPC.knockBackResist = BossRushEvent.BossRushActive ? 0f : 0.3f; + NPC.knockBackResist = 0.3f; NPC.noGravity = true; NPC.noTileCollide = true; NPC.HitSound = SoundID.NPCHit1; diff --git a/NPCs/HiveMind/DarkHeart.cs b/NPCs/HiveMind/DarkHeart.cs index dd5b6714b7..3970830b8e 100644 --- a/NPCs/HiveMind/DarkHeart.cs +++ b/NPCs/HiveMind/DarkHeart.cs @@ -29,8 +29,8 @@ namespace CalamityMod.NPCs.HiveMind NPC.lifeMax = 75; if (BossRushEvent.BossRushActive) NPC.lifeMax = 1800; - if (CalamityWorld.LegendaryMode) - NPC.lifeMax *= 4; + if (Main.getGoodWorld) + NPC.lifeMax *= 3; NPC.aiStyle = -1; AIType = -1; @@ -82,9 +82,9 @@ namespace CalamityMod.NPCs.HiveMind NPC.active = false; } - float velocity = CalamityWorld.LegendaryMode ? 10f : death ? 7f : revenge ? 6f : 4f; - float acceleration = CalamityWorld.LegendaryMode ? 0.5f : death ? 0.35f : revenge ? 0.3f : 0.2f; - float deceleration = CalamityWorld.LegendaryMode ? 0.9f : death ? 0.95f : revenge ? 0.96f : 0.98f; + float velocity = Main.getGoodWorld ? 10f : death ? 7f : revenge ? 6f : 4f; + float acceleration = Main.getGoodWorld ? 0.5f : death ? 0.35f : revenge ? 0.3f : 0.2f; + float deceleration = Main.getGoodWorld ? 0.9f : death ? 0.95f : revenge ? 0.96f : 0.98f; if (NPC.position.Y > Main.player[NPC.target].position.Y - 400f) { @@ -125,14 +125,14 @@ namespace CalamityMod.NPCs.HiveMind if (dropRain && Main.netMode != NetmodeID.MultiplayerClient) { NPC.ai[0] += 1f; - float rainDropRate = CalamityWorld.LegendaryMode ? 10f : death ? 15f : revenge ? 20f : 30f; + float rainDropRate = Main.getGoodWorld ? 10f : death ? 15f : revenge ? 20f : 30f; if (NPC.ai[0] >= rainDropRate) { NPC.ai[0] = 0f; int shaderainXPos = (int)(NPC.position.X + 10f + Main.rand.Next(NPC.width - 20)); int shaderainYos = (int)(NPC.position.Y + NPC.height + 4f); int type = ModContent.ProjectileType(); - float randomXVelocity = CalamityWorld.LegendaryMode ? Main.rand.NextFloat() * 5f : 0f; + float randomXVelocity = Main.getGoodWorld ? Main.rand.NextFloat() * 5f : 0f; float velocityY = 8f; Projectile.NewProjectile(NPC.GetSource_FromAI(), shaderainXPos, shaderainYos, randomXVelocity, velocityY, type, HiveMind.ShaderainDamage, 0f, Main.myPlayer); } diff --git a/NPCs/HiveMind/HiveBlob.cs b/NPCs/HiveMind/HiveBlob.cs index a836b51da9..f9467741d4 100644 --- a/NPCs/HiveMind/HiveBlob.cs +++ b/NPCs/HiveMind/HiveBlob.cs @@ -14,14 +14,12 @@ namespace CalamityMod.NPCs.HiveMind { public class HiveBlob : ModNPC { - private const float ShootGateValue = 240f; + private const float NormalShootGate = 240f; + private const float FastShootGate = 180f; private const float TelegraphDuration = 120f; - private const float ShowTelegraphValue = ShootGateValue - TelegraphDuration; + private bool FastVariant => NPC.ai[2] > 0f; - public override void SetStaticDefaults() - { - NPCID.Sets.NeedsExpertScaling[Type] = true; - } + public override void SetStaticDefaults() => NPCID.Sets.NeedsExpertScaling[Type] = true; public static int VileClotDamage = 8; // 32 @@ -39,7 +37,7 @@ namespace CalamityMod.NPCs.HiveMind NPC.lifeMax = 50; if (BossRushEvent.BossRushActive) NPC.lifeMax = 1300; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.lifeMax *= 2; NPC.knockBackResist = 0.9f; @@ -112,10 +110,11 @@ namespace CalamityMod.NPCs.HiveMind } } - float hiveMindVelocity = Main.npc[hiveMind].velocity.Length(); float relocateSpeed = getFuckedAI ? 1.2f : death ? 0.8f : revenge ? 0.7f : expertMode ? 0.6f : 0.5f; float acceleration = 0.8f; - float distanceFromMind = CalamityWorld.LegendaryMode ? 256f : 128f; + float distanceFromMind = FastVariant ? 96f : 128f; + if (Main.getGoodWorld) + distanceFromMind *= 2; float hiveMindX = Main.npc[hiveMind].Center.X; float hiveMindY = Main.npc[hiveMind].Center.Y; @@ -166,14 +165,14 @@ namespace CalamityMod.NPCs.HiveMind if (Main.netMode != NetmodeID.MultiplayerClient) { + float shootGateValue = FastVariant ? FastShootGate : NormalShootGate; if (!Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[Main.npc[hiveMind].target].position, Main.player[Main.npc[hiveMind].target].width, Main.player[Main.npc[hiveMind].target].height)) - NPC.localAI[1] = ShootGateValue * 0.5f; + NPC.localAI[1] = shootGateValue * 0.5f; - float shootGateValue = ShootGateValue; if (NPC.localAI[1] < shootGateValue) { NPC.localAI[1] += 1f; - if (NPC.localAI[1] < ShowTelegraphValue) + if (NPC.localAI[1] < shootGateValue - TelegraphDuration) NPC.localAI[1] += Main.rand.Next(2); if (death) NPC.localAI[1] += 1f; @@ -188,7 +187,7 @@ namespace CalamityMod.NPCs.HiveMind if (Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[Main.npc[hiveMind].target].position, Main.player[Main.npc[hiveMind].target].width, Main.player[Main.npc[hiveMind].target].height)) { float projSpeed = death ? 8f : revenge ? 7f : expertMode ? 6f : 4f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) projSpeed *= 1.5f; Vector2 projDirection = NPC.Center; @@ -198,7 +197,7 @@ namespace CalamityMod.NPCs.HiveMind playerDist = projSpeed / playerDist; playerX *= playerDist; playerY *= playerDist; - int type = (CalamityWorld.LegendaryMode && Main.rand.NextBool(5)) ? ProjectileID.CursedFlameHostile : ModContent.ProjectileType(); + int type = (Main.getGoodWorld && Main.rand.NextBool(5)) ? ProjectileID.CursedFlameHostile : ModContent.ProjectileType(); int damage = type == ProjectileID.CursedFlameHostile ? CursedFlameDamage : VileClotDamage; Vector2 projectileVelocity = new Vector2(playerX, playerY); if (type == ProjectileID.CursedFlameHostile) @@ -229,8 +228,9 @@ namespace CalamityMod.NPCs.HiveMind vector2 += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY); Color color = NPC.GetAlpha(drawColor); - if (NPC.localAI[1] > ShowTelegraphValue) - color = Color.Lerp(color, Color.LimeGreen * NPC.Opacity, MathHelper.Clamp((NPC.localAI[1] - ShowTelegraphValue) / TelegraphDuration, 0f, 1f)); + float shootGateValue = FastVariant ? FastShootGate : NormalShootGate; + if (NPC.localAI[1] > shootGateValue - TelegraphDuration) + color = Color.Lerp(color, Color.LimeGreen * NPC.Opacity, MathHelper.Clamp((NPC.localAI[1] - (shootGateValue - TelegraphDuration)) / TelegraphDuration, 0f, 1f)); spriteBatch.Draw(texture, vector2, NPC.frame, color, NPC.rotation, vector, NPC.scale, spriteEffects, 0f); @@ -256,6 +256,16 @@ namespace CalamityMod.NPCs.HiveMind for (int k = 0; k < 10; k++) Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Demonite, hit.HitDirection, -1f, 0, default, 1f); } + + if (Main.netMode != NetmodeID.MultiplayerClient && FastVariant && Main.zenithWorld) + { + // Spawn even more blobs on death + for (int i = 1; i < 3; i++) + { + Vector2 spawnAt = NPC.Center + new Vector2(0f, NPC.height / 2f); + NPC.NewNPC(NPC.GetSource_FromThis(), (int)spawnAt.X, (int)spawnAt.Y, ModContent.NPCType()); + } + } } } } diff --git a/NPCs/HiveMind/HiveBlob2.cs b/NPCs/HiveMind/HiveBlob2.cs deleted file mode 100644 index afc5893ee2..0000000000 --- a/NPCs/HiveMind/HiveBlob2.cs +++ /dev/null @@ -1,260 +0,0 @@ -using System; -using CalamityMod.Events; -using CalamityMod.Projectiles.Boss; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.GameContent; -using Terraria.ID; -using Terraria.Localization; -using Terraria.ModLoader; - -namespace CalamityMod.NPCs.HiveMind -{ - public class HiveBlob2 : ModNPC - { - private const float ShootGateValue = 180f; - private const float TelegraphDuration = 120f; - private const float ShowTelegraphValue = ShootGateValue - TelegraphDuration; - - public override LocalizedText DisplayName => CalamityUtils.GetText("NPCs.HiveBlob.DisplayName"); - public override string Texture => "CalamityMod/NPCs/HiveMind/HiveBlob"; - - public override void SetStaticDefaults() - { - this.HideFromBestiary(); - NPCID.Sets.NeedsExpertScaling[Type] = true; - } - - public override void SetDefaults() - { - NPC.npcSlots = 0.1f; - NPC.aiStyle = -1; - NPC.damage = 0; // No contact damage - NPC.width = 25; - NPC.height = 25; - - NPC.lifeMax = 75; - if (BossRushEvent.BossRushActive) - NPC.lifeMax = 1300; - if (CalamityWorld.LegendaryMode) - NPC.lifeMax *= 2; - - NPC.knockBackResist = 0.9f; - AIType = -1; - NPC.noGravity = true; - NPC.noTileCollide = true; - NPC.chaseable = false; - NPC.HitSound = SoundID.NPCHit1; - NPC.DeathSound = SoundID.NPCDeath1; - NPC.Calamity().VulnerableToHeat = true; - NPC.Calamity().VulnerableToCold = true; - NPC.Calamity().VulnerableToSickness = true; - } - - public override void AI() - { - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - - bool getFuckedAI = Main.zenithWorld; - - int hiveMind = CalamityGlobalNPC.hiveMind; - if (hiveMind < 0 || !Main.npc[hiveMind].active) - { - NPC.life = 0; - NPC.HitEffect(); - NPC.active = false; - NPC.netUpdate = true; - return; - } - - // When Hive Mind starts flying around - bool phase2 = Main.npc[hiveMind].life / (float)Main.npc[hiveMind].lifeMax < 0.8f; - - if (phase2) - { - NPC.life = 0; - NPC.HitEffect(); - NPC.active = false; - NPC.netUpdate = true; - return; - } - - NPC.alpha = Main.npc[hiveMind].alpha; - - if (NPC.ai[3] > 0f) - hiveMind = (int)NPC.ai[3] - 1; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.localAI[0] -= getFuckedAI ? 10f : 1f; //Relocation rate - float RandomPositionMultiplier = getFuckedAI ? 2f : 1f; - if (NPC.localAI[0] <= 0f) - { - NPC.localAI[0] = Main.rand.Next(180, 361); - NPC.ai[0] = Main.rand.Next(-100, 101) * RandomPositionMultiplier; //X position - NPC.ai[1] = Main.rand.Next(-100, 101) * RandomPositionMultiplier; //Y position - NPC.netUpdate = true; - } - } - - float hiveMindVelocity = Main.npc[hiveMind].velocity.Length(); - float relocateSpeed = getFuckedAI ? 1.2f : death ? 0.8f : revenge ? 0.7f : expertMode ? 0.6f : 0.5f; - float acceleration = 0.8f; - float distanceFromMind = CalamityWorld.LegendaryMode ? 192f : 96f; - - float hiveMindX = Main.npc[hiveMind].Center.X; - float hiveMindY = Main.npc[hiveMind].Center.Y; - Vector2 hiveMindPos = new Vector2(hiveMindX, hiveMindY); - float randomPosX = hiveMindX + NPC.ai[0]; - float randomPosY = hiveMindY + NPC.ai[1]; - float finalRandPosX = randomPosX - hiveMindPos.X; - float finalRandPosY = randomPosY - hiveMindPos.Y; - float finalRandDistance = (float)Math.Sqrt(finalRandPosX * finalRandPosX + finalRandPosY * finalRandPosY); - finalRandDistance = distanceFromMind / finalRandDistance; - finalRandPosX *= finalRandDistance; - finalRandPosY *= finalRandDistance; - - if (NPC.position.X < hiveMindX + finalRandPosX) - { - NPC.velocity.X += relocateSpeed; - if (NPC.velocity.X < 0f && finalRandPosX > 0f) - NPC.velocity.X *= acceleration; - } - else if (NPC.position.X > hiveMindX + finalRandPosX) - { - NPC.velocity.X -= relocateSpeed; - if (NPC.velocity.X > 0f && finalRandPosX < 0f) - NPC.velocity.X *= acceleration; - } - if (NPC.position.Y < hiveMindY + finalRandPosY) - { - NPC.velocity.Y += relocateSpeed; - if (NPC.velocity.Y < 0f && finalRandPosY > 0f) - NPC.velocity.Y *= acceleration; - } - else if (NPC.position.Y > hiveMindY + finalRandPosY) - { - NPC.velocity.Y -= relocateSpeed; - if (NPC.velocity.Y > 0f && finalRandPosY < 0f) - NPC.velocity.Y *= acceleration; - } - - float velocityLimit = relocateSpeed * 16f; - if (NPC.velocity.X > velocityLimit) - NPC.velocity.X = velocityLimit; - if (NPC.velocity.X < -velocityLimit) - NPC.velocity.X = -velocityLimit; - if (NPC.velocity.Y > velocityLimit) - NPC.velocity.Y = velocityLimit; - if (NPC.velocity.Y < -velocityLimit) - NPC.velocity.Y = -velocityLimit; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - if (!Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[Main.npc[hiveMind].target].position, Main.player[Main.npc[hiveMind].target].width, Main.player[Main.npc[hiveMind].target].height)) - NPC.localAI[1] = ShootGateValue * 0.5f; - - float shootGateValue = ShootGateValue; - if (NPC.localAI[1] < shootGateValue) - { - NPC.localAI[1] += 1f; - if (NPC.localAI[1] < ShowTelegraphValue) - NPC.localAI[1] += Main.rand.Next(2); - if (death) - NPC.localAI[1] += 1f; - } - - if (NPC.alpha > 0) - return; - - if (NPC.localAI[1] >= shootGateValue && Vector2.Distance(Main.player[Main.npc[hiveMind].target].Center, NPC.Center) > 80f) - { - NPC.localAI[1] = 0f; - if (Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[Main.npc[hiveMind].target].position, Main.player[Main.npc[hiveMind].target].width, Main.player[Main.npc[hiveMind].target].height)) - { - float projSpeed = death ? 8f : revenge ? 7f : expertMode ? 6f : 4f; - if (CalamityWorld.LegendaryMode) - projSpeed *= 1.5f; - - Vector2 projDirection = NPC.Center; - float playerX = Main.player[Main.npc[hiveMind].target].Center.X - projDirection.X; - float playerY = Main.player[Main.npc[hiveMind].target].Center.Y - projDirection.Y; - float playerDist = (float)Math.Sqrt(playerX * playerX + playerY * playerY); - playerDist = projSpeed / playerDist; - playerX *= playerDist; - playerY *= playerDist; - int type = (CalamityWorld.LegendaryMode && Main.rand.NextBool(5)) ? ProjectileID.CursedFlameHostile : ModContent.ProjectileType(); - int damage = type == ProjectileID.CursedFlameHostile ? HiveBlob.CursedFlameDamage : HiveBlob.VileClotDamage; - Vector2 projectileVelocity = new Vector2(playerX, playerY); - if (type == ProjectileID.CursedFlameHostile) - { - Vector2 v = Main.player[Main.npc[hiveMind].target].Center - NPC.Center - Main.player[Main.npc[hiveMind].target].velocity * 20f; - projectileVelocity = v.SafeNormalize(Vector2.UnitY) * projSpeed; - } - Projectile.NewProjectile(NPC.GetSource_FromAI(), projDirection, projectileVelocity, type, damage, 0f, Main.myPlayer); - NPC.netUpdate = true; - } - } - } - } - - public override bool CanHitNPC(NPC target) => NPC.alpha == 0; // Can only be hit while fully visible - - public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) - { - SpriteEffects spriteEffects = SpriteEffects.None; - if (NPC.spriteDirection == 1) - spriteEffects = SpriteEffects.FlipHorizontally; - - Texture2D texture = TextureAssets.Npc[Type].Value; - Vector2 vector = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / 2); - - Vector2 vector2 = NPC.Center - screenPos; - vector2 -= new Vector2(texture.Width, texture.Height) * NPC.scale / 2f; - vector2 += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY); - Color color = NPC.GetAlpha(drawColor); - - if (NPC.localAI[1] > ShowTelegraphValue) - color = Color.Lerp(color, Color.LimeGreen * NPC.Opacity, MathHelper.Clamp((NPC.localAI[1] - ShowTelegraphValue) / TelegraphDuration, 0f, 1f)); - - spriteBatch.Draw(texture, vector2, NPC.frame, color, NPC.rotation, vector, NPC.scale, spriteEffects, 0f); - - return false; - } - - public override void OnKill() - { - int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); - if (Main.rand.NextBool(4) && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) - Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); - } - - public override bool CheckActive() => false; - - public override void HitEffect(NPC.HitInfo hit) - { - for (int k = 0; k < 5; k++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Demonite, hit.HitDirection, -1f, 0, default, 1f); - - if (NPC.life <= 0) - { - for (int k = 0; k < 10; k++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Demonite, hit.HitDirection, -1f, 0, default, 1f); - - if (Main.netMode != NetmodeID.MultiplayerClient && Main.zenithWorld) - { - // Spawn even more blobs on death - for (int i = 1; i < 3; i++) - { - Vector2 spawnAt = NPC.Center + new Vector2(0f, NPC.height / 2f); - NPC.NewNPC(NPC.GetSource_FromThis(), (int)spawnAt.X, (int)spawnAt.Y, ModContent.NPCType()); - } - } - } - } - } -} diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index 1c933134f5..accf78c801 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -54,7 +54,6 @@ namespace CalamityMod.NPCs.HiveMind } // This block of values can be modified in SetDefaults() based on difficulty mode or something - private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; private int burrowTimer = 120; private int minimumDriftTime = 300; private int teleportRadius = 300; @@ -190,7 +189,7 @@ namespace CalamityMod.NPCs.HiveMind driftBoost = 1.5f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { reelbackFade *= 10; arcTime *= 0.5f; @@ -220,7 +219,6 @@ namespace CalamityMod.NPCs.HiveMind public override void SendExtraAI(BinaryWriter writer) { - writer.Write(biomeEnrageTimer); writer.Write(NPC.dontTakeDamage); writer.Write(NPC.noTileCollide); writer.Write(NPC.noGravity); @@ -244,7 +242,6 @@ namespace CalamityMod.NPCs.HiveMind public override void ReceiveExtraAI(BinaryReader reader) { - biomeEnrageTimer = reader.ReadInt32(); NPC.dontTakeDamage = reader.ReadBoolean(); NPC.noTileCollide = reader.ReadBoolean(); NPC.noGravity = reader.ReadBoolean(); @@ -433,29 +430,6 @@ namespace CalamityMod.NPCs.HiveMind // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; - // Enrage - if ((!player.ZoneCorrupt || (NPC.position.Y / 16f) < Main.worldSurface) && !BossRushEvent.BossRushActive) - { - if (biomeEnrageTimer > 0) - biomeEnrageTimer--; - } - else - biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - - bool biomeEnraged = biomeEnrageTimer <= 0; - - float enrageScale = 0f; - if (biomeEnraged && !player.ZoneCorrupt) - { - NPC.Calamity().CurrentlyEnraged = true; - enrageScale += 1f; - } - if (biomeEnraged && (NPC.position.Y / 16f) < Main.worldSurface) - { - NPC.Calamity().CurrentlyEnraged = true; - enrageScale += 1f; - } - // Phase 2 settings if (IsPhaseTwo) { @@ -511,11 +485,11 @@ namespace CalamityMod.NPCs.HiveMind CalamityGlobalNPC.hiveMind = NPC.whoAmI; - if (!player.active || player.dead) + if (!player.active || player.dead || !(player.ZoneCorrupt || BossRushEvent.BossRushActive)) { NPC.TargetClosest(false); player = Main.player[NPC.target]; - if (!player.active || player.dead) + if (!player.active || player.dead || !(player.ZoneCorrupt || BossRushEvent.BossRushActive)) { if (NPC.timeLeft > 60) NPC.timeLeft = 60; @@ -555,13 +529,13 @@ namespace CalamityMod.NPCs.HiveMind { NPC.localAI[0] = 1f; int maxBlobs = death ? 15 : revenge ? 7 : expertMode ? 6 : 5; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) maxBlobs *= 2; if (Main.zenithWorld) maxBlobs = 50; for (int i = 0; i < maxBlobs; i++) - NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, Main.rand.NextBool() ? ModContent.NPCType() : ModContent.NPCType(), NPC.whoAmI); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), NPC.whoAmI, ai2: Main.rand.Next(2)); } } @@ -606,7 +580,7 @@ namespace CalamityMod.NPCs.HiveMind int x = (int)(NPC.position.X + Main.rand.Next(NPC.width - 32)); int y = (int)(NPC.position.Y + Main.rand.Next(NPC.height - 32)); - int type = Main.rand.NextBool() ? ModContent.NPCType() : ModContent.NPCType(); + int type = ModContent.NPCType(); if (NPC.CountNPCS(ModContent.NPCType()) < maxDankSpawns) type = ModContent.NPCType(); @@ -624,7 +598,7 @@ namespace CalamityMod.NPCs.HiveMind burrowTimer--; if (burrowTimer < -120) { - burrowTimer = (death ? 180 : revenge ? 300 : expertMode ? 360 : 420) - (int)enrageScale * 55; + burrowTimer = death ? 180 : revenge ? 300 : expertMode ? 360 : 420; if (burrowTimer < 30) burrowTimer = 30; @@ -675,7 +649,7 @@ namespace CalamityMod.NPCs.HiveMind for (int i = 0; i < Main.maxNPCs; i++) { NPC hiveBlob = Main.npc[i]; - if (hiveBlob.active && (hiveBlob.type == ModContent.NPCType() || hiveBlob.type == ModContent.NPCType())) + if (hiveBlob.active && hiveBlob.type == ModContent.NPCType()) { hiveBlob.position.X = NPC.position.X; hiveBlob.position.Y = NPC.position.Y; @@ -794,11 +768,11 @@ namespace CalamityMod.NPCs.HiveMind NPC.ForceNetUpdate(); } - if (!player.active || player.dead || Vector2.Distance(NPC.Center, player.Center) > 8000f) + if (!player.active || player.dead || Vector2.Distance(NPC.Center, player.Center) > 8000f || !(player.ZoneCorrupt || BossRushEvent.BossRushActive)) { NPC.TargetClosest(false); player = Main.player[NPC.target]; - if (!player.active || player.dead || Vector2.Distance(NPC.Center, player.Center) > 8000f) + if (!player.active || player.dead || Vector2.Distance(NPC.Center, player.Center) > 8000f || !(player.ZoneCorrupt || BossRushEvent.BossRushActive)) { if (NPC.timeLeft > 60) NPC.timeLeft = 60; @@ -838,7 +812,7 @@ namespace CalamityMod.NPCs.HiveMind if (phase2timer <= -180) // No stalling drift mode forever { - NPC.velocity *= 2f / 255f * (reelbackFade + 2 * (int)enrageScale); + NPC.velocity *= 2f / 255f * reelbackFade; ReelBack(); NPC.ForceNetUpdate(); } @@ -846,9 +820,9 @@ namespace CalamityMod.NPCs.HiveMind { NPC.velocity.Normalize(); if (expertMode) // Variable velocity in expert and up - NPC.velocity *= driftSpeed + enrageScale + driftBoost * lifeRatio; + NPC.velocity *= driftSpeed + driftBoost * lifeRatio; else - NPC.velocity *= driftSpeed + enrageScale; + NPC.velocity *= driftSpeed; } break; @@ -858,7 +832,7 @@ namespace CalamityMod.NPCs.HiveMind // Avoid cheap bullshit NPC.damage = 0; - NPC.alpha += reelbackFade + 2 * (int)enrageScale; + NPC.alpha += reelbackFade; NPC.velocity -= deceleration; if (NPC.alpha >= 255) @@ -899,7 +873,7 @@ namespace CalamityMod.NPCs.HiveMind // Avoid cheap bullshit NPC.damage = 0; - NPC.alpha += reelbackFade + 2 * (int)enrageScale; + NPC.alpha += reelbackFade; NPC.velocity -= deceleration; if (NPC.alpha >= 255) @@ -956,10 +930,10 @@ namespace CalamityMod.NPCs.HiveMind // Set damage NPC.damage = NPC.defDamage; - phase2timer = lungeTime - 4 * (int)enrageScale; + phase2timer = lungeTime; NPC.velocity = player.Center - NPC.Center; NPC.velocity.Normalize(); - NPC.velocity *= teleportRadius / (lungeTime - (int)enrageScale); + NPC.velocity *= teleportRadius / lungeTime; dashStarted = true; SoundEngine.PlaySound(RoarSound, NPC.Center); NPC.netUpdate = true; @@ -1098,7 +1072,7 @@ namespace CalamityMod.NPCs.HiveMind { int type = ModContent.ProjectileType(); Vector2 cloudSpawnPos = new Vector2(NPC.position.X + Main.rand.Next(NPC.width), NPC.position.Y + Main.rand.Next(NPC.height)); - Vector2 randomVelocity = CalamityWorld.LegendaryMode ? Main.rand.NextVector2CircularEdge(4f, 4f) : Vector2.Zero; + Vector2 randomVelocity = Main.getGoodWorld ? Main.rand.NextVector2CircularEdge(4f, 4f) : Vector2.Zero; Projectile.NewProjectile(NPC.GetSource_FromAI(), cloudSpawnPos, randomVelocity, type, ShaderainDamage, 0, Main.myPlayer, 11f); } diff --git a/NPCs/HiveMind/HiveTumor.cs b/NPCs/HiveMind/HiveTumor.cs index 209437e1ea..a092cd754e 100644 --- a/NPCs/HiveMind/HiveTumor.cs +++ b/NPCs/HiveMind/HiveTumor.cs @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.HiveMind NPC.width = 30; //324 NPC.height = 30; //216 NPC.defense = 0; - NPC.lifeMax = CalamityWorld.LegendaryMode ? 10 : 1000; + NPC.lifeMax = Main.zenithWorld ? 10 : 1000; NPC.knockBackResist = 0f; NPC.chaseable = false; NPC.HitSound = SoundID.NPCHit1; @@ -80,7 +80,7 @@ namespace CalamityMod.NPCs.HiveMind type = ModContent.NPCType(); break; case 4: - type = ModContent.NPCType(); + type = ModContent.NPCType(); break; default: break; @@ -131,7 +131,7 @@ namespace CalamityMod.NPCs.HiveMind { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Demonite, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.MultiplayerClient && (!NPC.AnyNPCs(ModContent.NPCType()) || CalamityWorld.LegendaryMode)) + if (Main.netMode != NetmodeID.MultiplayerClient && (!NPC.AnyNPCs(ModContent.NPCType()) || Main.zenithWorld)) { Vector2 spawnAt = NPC.Bottom; NPC.NewNPC(NPC.GetSource_Death(), (int)spawnAt.X, (int)spawnAt.Y, ModContent.NPCType()); diff --git a/NPCs/Leviathan/Anahita.cs b/NPCs/Leviathan/Anahita.cs index d5922b0ff9..64846def35 100644 --- a/NPCs/Leviathan/Anahita.cs +++ b/NPCs/Leviathan/Anahita.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.Leviathan private int frameUsed = 0; public bool HasBegunSummoningLeviathan = false; private int DrawProjectileTelegraphTimer = 0; - private int LegendaryModeAttackChosen = 0; + private int GetGoodAttackChosen = 0; public static Asset ChargeTexture; public bool WaitingForLeviathan { @@ -88,7 +88,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 0.8f; if (Main.zenithWorld) @@ -190,9 +190,7 @@ namespace CalamityMod.NPCs.Leviathan bubbleVelocity += 4f * enrageScale; if (!leviAlive) bubbleVelocity += 2f * (1f - lifeRatio); - if (CalamityWorld.LegendaryMode) - bubbleVelocity *= 1.15f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) bubbleVelocity *= 2f; // Phases @@ -617,14 +615,14 @@ namespace CalamityMod.NPCs.Leviathan float velocity = death ? 13.5f : 12f; velocity += 6f * enrageScale; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) velocity *= 1.15f; Vector2 chargeSetupLocation = Vector2.Normalize(targetVector - NPC.Center - NPC.velocity) * velocity; float acceleration = death ? 0.28f : 0.25f; acceleration += 0.2f * enrageScale; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) acceleration *= 1.15f; if (Math.Abs(NPC.Center.Y - targetVector.Y) > 50f * NPC.scale || Math.Abs(NPC.Center.X - player.Center.X) > 350f * NPC.scale) @@ -653,17 +651,17 @@ namespace CalamityMod.NPCs.Leviathan int totalTelegraphs = 8; float telegraphDist = 500f; - // In Legendary, the projectiles she fires is randomized - if (CalamityWorld.LegendaryMode) + // In FTW, the projectiles she fires is randomized + if (Main.getGoodWorld) { - LegendaryModeAttackChosen = Main.rand.Next(3); - if (LegendaryModeAttackChosen == 2) + GetGoodAttackChosen = Main.rand.Next(3); + if (GetGoodAttackChosen == 2) telegraphDist -= 50f; for (int i = 0; i < totalTelegraphs; i++) { Vector2 spawnVector = player.Center - Vector2.UnitY.RotatedBy(MathHelper.TwoPi / totalTelegraphs * i) * telegraphDist; - int tele = Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, player.whoAmI, LegendaryModeAttackChosen); + int tele = Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, player.whoAmI, GetGoodAttackChosen); Main.projectile[tele].netUpdate = true; } @@ -709,12 +707,12 @@ namespace CalamityMod.NPCs.Leviathan int projectileDistance = 600; int type = ModContent.ProjectileType(); int damage = SpearDamage; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { float radians = MathHelper.TwoPi / totalProjectiles; for (int i = 0; i < totalProjectiles; i++) { - switch (LegendaryModeAttackChosen) + switch (GetGoodAttackChosen) { case 0: SoundEngine.PlaySound(SoundID.Item21, player.Center); @@ -829,7 +827,7 @@ namespace CalamityMod.NPCs.Leviathan if (revenge) chargeVelocity += 2f + (death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio)); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeVelocity *= 1.15f; // Stunt velocity at the end of the charge attack to prevent her flying off if (NPC.ai[0] == -1f) @@ -857,7 +855,7 @@ namespace CalamityMod.NPCs.Leviathan { NPC.damage = (int)Math.Round(NPC.defDamage * DashDamageMult); - if (CalamityWorld.LegendaryMode && NPC.ai[1] % 5f == 0f) + if (Main.zenithWorld && NPC.ai[1] % 5f == 0f) { SoundEngine.PlaySound(SoundID.Item85, NPC.Center); Vector2 bubbleSpawnPos = new Vector2(NPC.position.X + (NPC.width / 2) + (15 * NPC.direction * NPC.scale), NPC.position.Y + 30 * NPC.scale); @@ -927,7 +925,7 @@ namespace CalamityMod.NPCs.Leviathan Vector2 chargeSetupLocation = Vector2.Normalize(player.Center + new Vector2(NPC.localAI[0], -distance) - NPC.Center - NPC.velocity) * 12f; float acceleration = revenge ? 0.75f : 0.5f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) acceleration *= 1.15f; NPC.SimpleFlyMovement(chargeSetupLocation, acceleration); @@ -984,7 +982,7 @@ namespace CalamityMod.NPCs.Leviathan if (DrawProjectileTelegraphTimer > 0) { Color telegraphColor = Color.Black; - switch (CalamityWorld.LegendaryMode ? LegendaryModeAttackChosen : (int)NPC.localAI[3]) + switch (Main.getGoodWorld ? GetGoodAttackChosen : (int)NPC.localAI[3]) { case 0: telegraphColor = new Color(55, 70, 240); diff --git a/NPCs/Leviathan/AnahitasIceShield.cs b/NPCs/Leviathan/AnahitasIceShield.cs index bc01f7169c..d15a59dbe7 100644 --- a/NPCs/Leviathan/AnahitasIceShield.cs +++ b/NPCs/Leviathan/AnahitasIceShield.cs @@ -46,7 +46,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.Calamity().VulnerableToCold = false; NPC.Calamity().VulnerableToSickness = false; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 0.8f; } diff --git a/NPCs/Leviathan/AquaticAberration.cs b/NPCs/Leviathan/AquaticAberration.cs index 152244ae2b..e809b6b408 100644 --- a/NPCs/Leviathan/AquaticAberration.cs +++ b/NPCs/Leviathan/AquaticAberration.cs @@ -54,7 +54,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 1.3f; } diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 0eacfebad3..fc7a3933a7 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -86,7 +86,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 1.3f; if (Main.zenithWorld) @@ -310,7 +310,7 @@ namespace CalamityMod.NPCs.Leviathan hoverAcceleration += death ? 0.15f * (1f - lifeRatio) : 0.1f * (1f - lifeRatio); } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { hoverSpeed *= 1.15f; hoverAcceleration *= 1.15f; @@ -409,7 +409,7 @@ namespace CalamityMod.NPCs.Leviathan if (Main.zenithWorld) { - type = CalamityWorld.LegendaryMode ? ProjectileID.BouncyBoulder : ProjectileID.Boulder; + type = Main.rand.NextBool() ? ProjectileID.BouncyBoulder : ProjectileID.Boulder; leviCenter.Y -= 5; //Shoot a bit more up since boulders are affected by gravity } @@ -439,7 +439,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.ai[1] += 1f; bool spawnedAberration = false; - float aberrationSpawnDelay = CalamityWorld.LegendaryMode ? 20f : (!sirenAlive || phase4) ? 60f : 50f; + float aberrationSpawnDelay = Main.zenithWorld ? 20f : (!sirenAlive || phase4) ? 60f : 50f; if (NPC.ai[1] > aberrationSpawnDelay) { NPC.ai[1] = 0f; @@ -447,7 +447,7 @@ namespace CalamityMod.NPCs.Leviathan spawnedAberration = true; } - int spawnLimit = CalamityWorld.LegendaryMode ? 10 : (sirenAlive && !phase4) ? 0 : 2; + int spawnLimit = Main.zenithWorld ? 20 : Main.getGoodWorld ? 6 : (sirenAlive && !phase4) ? 0 : 2; if (spawnedAberration && NPC.CountNPCS(ModContent.NPCType()) < spawnLimit && NPC.ai[2] <= spawnLimit) { SoundEngine.PlaySound(soundChoice with { Pitch = soundChoice.Pitch + extrapitch }, npcCenter); @@ -562,7 +562,7 @@ namespace CalamityMod.NPCs.Leviathan if (revenge && (!sirenAlive || phase4)) lineupSpeed += death ? 9f * (1f - lifeRatio) : 6f * (1f - lifeRatio); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) lineupSpeed *= 1.15f; Vector2 leviChargeCenter = npcCenter; @@ -598,7 +598,7 @@ namespace CalamityMod.NPCs.Leviathan chargeAcceleration += death ? 0.15f * (1f - lifeRatio) : 0.1f * (1f - lifeRatio); } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { chargeSpeed *= 1.15f; chargeAcceleration *= 1.15f; diff --git a/NPCs/Leviathan/LeviathanStart.cs b/NPCs/Leviathan/LeviathanStart.cs index 35ddf96f39..7aeb82cfcf 100644 --- a/NPCs/Leviathan/LeviathanStart.cs +++ b/NPCs/Leviathan/LeviathanStart.cs @@ -59,7 +59,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.Calamity().VulnerableToWater = false; NPC.Calamity().ProvidesProximityRage = false; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 0.8f; } diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.cs b/NPCs/NormalNPCs/ArmoredDiggerHead.cs index dfed057395..5b812c76be 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerHead.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerHead.cs @@ -421,7 +421,7 @@ namespace CalamityMod.NPCs.NormalNPCs { if (!CalamityPlayer.areThereAnyDamnBosses && NPC.downedPlantBoss && !NPC.AnyNPCs(ModContent.NPCType())) { - float spawnRateDivisor = CalamityWorld.LegendaryMode ? 125f : CalamityWorld.revenge ? 425f : 500f; + float spawnRateDivisor = CalamityWorld.revenge ? 425f : 500f; return 1 / spawnRateDivisor; } } diff --git a/NPCs/NormalNPCs/Bohldohr.cs b/NPCs/NormalNPCs/Bohldohr.cs index e5fec5a50e..a7c0f35756 100644 --- a/NPCs/NormalNPCs/Bohldohr.cs +++ b/NPCs/NormalNPCs/Bohldohr.cs @@ -15,7 +15,6 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetDefaults() { - NPC.Calamity().canBreakPlayerDefense = true; NPC.aiStyle = -1; AIType = -1; NPC.damage = 80; diff --git a/NPCs/NormalNPCs/PlanterasFreeTentacle.cs b/NPCs/NormalNPCs/PlanterasFreeTentacle.cs index 0ab71a7709..0908378d3d 100644 --- a/NPCs/NormalNPCs/PlanterasFreeTentacle.cs +++ b/NPCs/NormalNPCs/PlanterasFreeTentacle.cs @@ -75,7 +75,7 @@ namespace CalamityMod.NPCs.NormalNPCs bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { if (Main.rand.NextBool(5)) NPC.reflectsProjectiles = true; @@ -129,7 +129,7 @@ namespace CalamityMod.NPCs.NormalNPCs Vector2 idealVelocity = NPC.SafeDirectionTo(Main.player[NPC.target].Center) * (death ? 7f : 5.5f); float acceleration = death ? 0.14f : 0.105f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { idealVelocity *= 1.2f; acceleration *= 1.4f; diff --git a/NPCs/NormalNPCs/ShockstormShuttle.cs b/NPCs/NormalNPCs/ShockstormShuttle.cs index fc28052dc9..4d0f33e355 100644 --- a/NPCs/NormalNPCs/ShockstormShuttle.cs +++ b/NPCs/NormalNPCs/ShockstormShuttle.cs @@ -85,8 +85,8 @@ namespace CalamityMod.NPCs.NormalNPCs npcPos.X += velocity.X; npcPos.Y += velocity.Y; - int spread = CalamityWorld.LegendaryMode ? 100 : 20; - for (int i = 0; i < (CalamityWorld.LegendaryMode ? 10 : 2); i++) + int spread = 20; + for (int i = 0; i < 2; i++) { velocity = Main.player[NPC.target].Center - npcPos; targetDist = velocity.Length(); @@ -404,7 +404,7 @@ namespace CalamityMod.NPCs.NormalNPCs { return 0f; } - return SpawnCondition.Sky.Chance * (CalamityWorld.LegendaryMode ? 0.5f : 0.1f); + return SpawnCondition.Sky.Chance * 0.1f; } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/NormalNPCs/SuperDummyNPC.cs b/NPCs/NormalNPCs/SuperDummyNPC.cs index abc85a9ace..d910753482 100644 --- a/NPCs/NormalNPCs/SuperDummyNPC.cs +++ b/NPCs/NormalNPCs/SuperDummyNPC.cs @@ -61,7 +61,8 @@ namespace CalamityMod.NPCs.NormalNPCs public override void UpdateLifeRegen(ref int damage) { - NPC.lifeRegen += 2000000; + if (NPC.lifeRegen >= 0) + NPC.lifeRegen += 2000000; } public override bool CanHitPlayer(Player target, ref int cooldownSlot) => Main.zenithWorld; diff --git a/NPCs/NormalNPCs/WildBumblebirb.cs b/NPCs/NormalNPCs/WildBumblebirb.cs index 9ad32c868c..6734a6b014 100644 --- a/NPCs/NormalNPCs/WildBumblebirb.cs +++ b/NPCs/NormalNPCs/WildBumblebirb.cs @@ -154,8 +154,6 @@ namespace CalamityMod.NPCs.NormalNPCs swarmerIdleTargetDist.Normalize(); swarmerIdleTargetDist *= swarmerIdleSpeed; NPC.velocity = (NPC.velocity * 29f + swarmerIdleTargetDist) / 30f; - if (CalamityWorld.LegendaryMode && !Main.zenithWorld) - NPC.velocity *= 1.15f; } else if (NPC.velocity.Length() > 2f) NPC.velocity *= 0.95f; @@ -202,8 +200,6 @@ namespace CalamityMod.NPCs.NormalNPCs swarmerChargeTargetDist.Normalize(); swarmerChargeTargetDist *= swarmerChargeSpeed; NPC.velocity = (NPC.velocity * (swarmerChargeVelMult - 1f) + swarmerChargeTargetDist) / swarmerChargeVelMult; - if (CalamityWorld.LegendaryMode && !Main.zenithWorld) - NPC.velocity *= 1.15f; NPC.ForceNetUpdate(); @@ -230,8 +226,6 @@ namespace CalamityMod.NPCs.NormalNPCs swarmerDecelerateTargetDist.Normalize(); swarmerDecelerateTargetDist *= swarmerDecelerateSpeed; NPC.velocity = (NPC.velocity * (swarmerDecelerateVelMult - 1f) + swarmerDecelerateTargetDist) / swarmerDecelerateVelMult; - if (CalamityWorld.LegendaryMode && !Main.zenithWorld) - NPC.velocity *= 1.15f; if (NPC.velocity.X < 0f) NPC.direction = -1; @@ -247,8 +241,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.damage = NPC.defDamage; NPC.velocity = swarmerDecelerateTargetDist; - if (CalamityWorld.LegendaryMode && !Main.zenithWorld) - NPC.velocity *= 1.15f; if (NPC.velocity.X < 0f) NPC.direction = -1; diff --git a/NPCs/NormalNPCs/WulfrumAmplifier.cs b/NPCs/NormalNPCs/WulfrumAmplifier.cs index 8546cfcaf7..525ddc4bdb 100644 --- a/NPCs/NormalNPCs/WulfrumAmplifier.cs +++ b/NPCs/NormalNPCs/WulfrumAmplifier.cs @@ -95,7 +95,7 @@ namespace CalamityMod.NPCs.NormalNPCs // Spawn some off-screen enemies to act as threats if the player enters the field. if (Main.netMode != NetmodeID.MultiplayerClient) { - int enemiesToSpawn = CalamityWorld.LegendaryMode ? 4 : CalamityWorld.death ? 3 : CalamityWorld.revenge ? 2 : 1; + int enemiesToSpawn = Main.getGoodWorld ? 4 : CalamityWorld.death ? 3 : CalamityWorld.revenge ? 2 : 1; for (int i = 0; i < enemiesToSpawn; i++) { int tries = 0; @@ -119,7 +119,7 @@ namespace CalamityMod.NPCs.NormalNPCs else if (tries < 500 && Main.zenithWorld) { //Summon the army - int npcToSpawn = CalamityWorld.LegendaryMode ? 0 : Main.rand.Next(0, 4); + int npcToSpawn = Main.rand.Next(0, 4); switch (enemiesToSpawn) { case 0: @@ -186,11 +186,11 @@ namespace CalamityMod.NPCs.NormalNPCs Dust.NewDust(npcAtIndex.position, npcAtIndex.width, npcAtIndex.height, DustID.Electric); } } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { laserDelay--; NPC.spriteDirection = (player.Center.X - NPC.Center.X < 0).ToDirectionInt(); - for (int times = CalamityWorld.LegendaryMode ? 3 : 2; times > 0 && laserDelay == 0; times--) + for (int times = 3; times > 0 && laserDelay == 0; times--) { Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.UnitX * 6f * NPC.spriteDirection, NPC.SafeDirectionTo(player.Center, Vector2.UnitY) * 4.5f, ProjectileID.SaucerMissile, 10, 0f); } diff --git a/NPCs/NormalNPCs/WulfrumDrone.cs b/NPCs/NormalNPCs/WulfrumDrone.cs index 784c9cd5f4..7a041ec944 100644 --- a/NPCs/NormalNPCs/WulfrumDrone.cs +++ b/NPCs/NormalNPCs/WulfrumDrone.cs @@ -176,7 +176,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (Main.zenithWorld) { int spread = 15; - for (int times = CalamityWorld.LegendaryMode ? 3 : 2; times > 0; times--) + for (int times = 3; times > 0; times--) { Vector2 velocity = NPC.SafeDirectionTo(player.Center, Vector2.UnitY) * 6f; Vector2 perturbedspeed = new Vector2(velocity.X + Main.rand.Next(-2, 3), velocity.Y + Main.rand.Next(-2, 3)).RotatedBy(MathHelper.ToRadians(spread)); diff --git a/NPCs/NormalNPCs/WulfrumGyrator.cs b/NPCs/NormalNPCs/WulfrumGyrator.cs index 6d089b7204..a93af36bb5 100644 --- a/NPCs/NormalNPCs/WulfrumGyrator.cs +++ b/NPCs/NormalNPCs/WulfrumGyrator.cs @@ -128,8 +128,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.direction = direction; NPC.ForceNetUpdate(); } - //GOTTA GO FAST (Legendary only) - if (CalamityWorld.LegendaryMode) + //GOTTA GO FAST (FTW only) + if (Main.getGoodWorld) { NPC.velocity *= 1.01f; //Overcharged diff --git a/NPCs/NormalNPCs/WulfrumHovercraft.cs b/NPCs/NormalNPCs/WulfrumHovercraft.cs index 56c020c681..fe522f1f96 100644 --- a/NPCs/NormalNPCs/WulfrumHovercraft.cs +++ b/NPCs/NormalNPCs/WulfrumHovercraft.cs @@ -317,8 +317,8 @@ namespace CalamityMod.NPCs.NormalNPCs } } } - //Become a spark piñata in Legendary - if (CalamityWorld.LegendaryMode && Supercharged) + //Become a spark piñata in FTW + if (Main.getGoodWorld && Supercharged) { for (int Sparks = Main.rand.Next(2, 5); Sparks > 0; Sparks--) { diff --git a/NPCs/NormalNPCs/WulfrumRover.cs b/NPCs/NormalNPCs/WulfrumRover.cs index ced5a43f1d..abb690b689 100644 --- a/NPCs/NormalNPCs/WulfrumRover.cs +++ b/NPCs/NormalNPCs/WulfrumRover.cs @@ -97,11 +97,11 @@ namespace CalamityMod.NPCs.NormalNPCs if (Supercharged) { SuperchargeTimer--; - NPC.defense = CalamityWorld.LegendaryMode ? 20 : 13; + NPC.defense = Main.getGoodWorld ? 20 : 13; } else if (!Supercharged) { - NPC.defense = CalamityWorld.LegendaryMode ? 10 : 4; + NPC.defense = Main.getGoodWorld ? 10 : 4; } Player player = Main.player[NPC.target]; @@ -184,7 +184,7 @@ namespace CalamityMod.NPCs.NormalNPCs Main.projectile[mine].hostile = true; Main.projectile[mine].timeLeft = 60; } - mineDelay = CalamityWorld.LegendaryMode ? 3 : 5; + mineDelay = 3; } else if (Main.zenithWorld && mineDelay >= 1) mineDelay--; diff --git a/NPCs/OldDuke/OldDuke.cs b/NPCs/OldDuke/OldDuke.cs index c15f3289ad..5162e69562 100644 --- a/NPCs/OldDuke/OldDuke.cs +++ b/NPCs/OldDuke/OldDuke.cs @@ -94,6 +94,7 @@ namespace CalamityMod.NPCs.OldDuke public override void SetDefaults() { + NPC.Calamity().canBreakPlayerDefense = true; NPC.damage = 140; // 280 NPC.alpha = 255; NPC.width = 150; @@ -203,7 +204,7 @@ namespace CalamityMod.NPCs.OldDuke bool death = CalamityWorld.death || BossRushEvent.BossRushActive; float exhaustionGateValue = 360f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) exhaustionGateValue *= 0.5f; float numberOfAttacksBeforeExhaustion = 12f; @@ -217,8 +218,6 @@ namespace CalamityMod.NPCs.OldDuke Phase = phase3 ? 2 : phase2 ? 1 : 0; NuclearOverlayVisual = (Phase == 2 && NPC.Calamity().newAI[1] != 1) ? MathHelper.Lerp(NuclearOverlayVisual, 0.2f, 0.2f) : MathHelper.Lerp(NuclearOverlayVisual, 0f, 0.1f); - NPC.Calamity().canBreakPlayerDefense = true; - bool charging = NPC.ai[3] < 10f; if (calamityGlobalNPC.newAI[0] >= exhaustionGateValue) calamityGlobalNPC.newAI[1] = 1f; @@ -293,7 +292,7 @@ namespace CalamityMod.NPCs.OldDuke } // The dumbest thing to ever exist - if (CalamityWorld.MaliceMode) + if (Main.zenithWorld) chargeVelocity *= 1.25f; if (exhausted) @@ -361,11 +360,26 @@ namespace CalamityMod.NPCs.OldDuke if (exhausted) { - NPC.Calamity().canBreakPlayerDefense = false; + // Disable contact damage while tired + NPC.damage = 0; - // Play exhausted sound + // Play exhausted sound and huff fumes if (calamityGlobalNPC.newAI[0] % 60f == 0f && Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < 2800f) + { SoundEngine.PlaySound(HuffSound with { Volume = HuffSound.Volume * 1.25f }, Main.LocalPlayer.Center); + for (int i = 0; i < 40; i++) + { + float scale = Main.rand.NextFloat(1f, 3f); + Vector2 fumePos = NPC.Center + NPC.rotation.ToRotationVector2() * (Main.rand.NextBool() ? 100f : 80f) * NPC.direction; + Vector2 fumeVel = Vector2.UnitX * NPC.velocity.X + Vector2.UnitY.RotatedByRandom(MathHelper.ToRadians(12f)) * scale * -8f * Main.rand.NextFloat(1f, 1.25f); + MediumMistParticle fume = new(fumePos, fumeVel, GlowColor, Color.DarkSlateGray, scale, 150f); + GeneralParticleHandler.SpawnParticle(fume); + } + + Vector2 pulsePos = NPC.Center + NPC.rotation.ToRotationVector2() * 88f * NPC.direction; + CustomPulse pulse = new(pulsePos, Vector2.Zero, Color.White * 0.2f, "CalamityMod/Particles/DustyCircleHardEdge", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.05f, 0.125f, 30); + GeneralParticleHandler.SpawnParticle(pulse); + } if (Main.zenithWorld) { @@ -450,7 +464,7 @@ namespace CalamityMod.NPCs.OldDuke } // The dumbest thing to ever exist - if (CalamityWorld.MaliceMode) + if (Main.zenithWorld) chargeTime *= 2; // Set variables for spawn effects @@ -748,7 +762,7 @@ namespace CalamityMod.NPCs.OldDuke else if (NPC.ai[0] == 1f) { // The dumbest thing to ever exist - if (CalamityWorld.MaliceMode && NPC.ai[2] % 10f == 0f) + if (Main.zenithWorld && NPC.ai[2] % 10f == 0f) { // Rotation and direction int dir = Math.Sign(player.Center.X - NPC.Center.X); @@ -914,7 +928,7 @@ namespace CalamityMod.NPCs.OldDuke NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + 900f), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - 900f), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + 1800f), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - 1800f), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); @@ -958,7 +972,7 @@ namespace CalamityMod.NPCs.OldDuke NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + 50f + calamityGlobalNPC.newAI[2]), (int)(NPC.Center.Y + 540f), ModContent.NPCType(), 0, 0f, 0f, 1f, -sharkronVelocity, 255); NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - 50f - calamityGlobalNPC.newAI[2]), (int)(NPC.Center.Y + 540f), ModContent.NPCType(), 0, 0f, 0f, -1f, -sharkronVelocity, 255); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + 50f + calamityGlobalNPC.newAI[2] * 0.5f), (int)(NPC.Center.Y + 270f), ModContent.NPCType(), 0, 0f, 0f, 1f, -sharkronVelocity, 255); NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - 50f - calamityGlobalNPC.newAI[2] * 0.5f), (int)(NPC.Center.Y + 270f), ModContent.NPCType(), 0, 0f, 0f, -1f, -sharkronVelocity, 255); @@ -1108,7 +1122,7 @@ namespace CalamityMod.NPCs.OldDuke else if (NPC.ai[0] == 6f) { // The dumbest thing to ever exist - if (CalamityWorld.MaliceMode && NPC.ai[2] % 8f == 0f) + if (Main.zenithWorld && NPC.ai[2] % 8f == 0f) { // Rotation and direction int dir = Math.Sign(player.Center.X - NPC.Center.X); @@ -1257,13 +1271,13 @@ namespace CalamityMod.NPCs.OldDuke { Vector2 phase2GoreDirection = NPC.rotation.ToRotationVector2() * (Vector2.UnitX * NPC.direction) * (NPC.width + 20) / 2f + NPC.Center; int type = ModContent.ProjectileType(); - int totalGore = CalamityWorld.LegendaryMode ? 40 : 20; + int totalGore = Main.getGoodWorld ? 40 : 20; for (int i = 0; i < totalGore; i++) { float velocityX = NPC.direction * goreVelocityX * (Main.rand.NextFloat(0.2f, 0.8f) + 0.5f); float velocityY = goreVelocityY * (Main.rand.NextFloat(0.2f, 0.8f) + 0.5f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocityX *= Main.rand.NextFloat() + 0.5f; velocityY *= Main.rand.NextFloat() + 0.5f; @@ -1324,7 +1338,7 @@ namespace CalamityMod.NPCs.OldDuke NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + 50f + calamityGlobalNPC.newAI[2]), (int)(NPC.Center.Y - 540f), ModContent.NPCType(), 0, 0f, 0f, 1f, sharkronVelocity, 255); NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - 50f - calamityGlobalNPC.newAI[2]), (int)(NPC.Center.Y - 540f), ModContent.NPCType(), 0, 0f, 0f, -1f, sharkronVelocity, 255); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + 50f + calamityGlobalNPC.newAI[2] * 0.5f), (int)(NPC.Center.Y + 270f), ModContent.NPCType(), 0, 0f, 0f, 1f, -sharkronVelocity, 255); NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - 50f - calamityGlobalNPC.newAI[2] * 0.5f), (int)(NPC.Center.Y + 270f), ModContent.NPCType(), 0, 0f, 0f, -1f, -sharkronVelocity, 255); @@ -1486,7 +1500,7 @@ namespace CalamityMod.NPCs.OldDuke else if (NPC.ai[0] == 11f) { // The dumbest thing to ever exist - if (CalamityWorld.MaliceMode && NPC.ai[2] % 6f == 0f) + if (Main.zenithWorld && NPC.ai[2] % 6f == 0f) { // Rotation and direction int dir = Math.Sign(player.Center.X - NPC.Center.X); @@ -1620,13 +1634,13 @@ namespace CalamityMod.NPCs.OldDuke { Vector2 phase3GoreDirection = NPC.rotation.ToRotationVector2() * (Vector2.UnitX * NPC.direction) * (NPC.width + 20) / 2f + NPC.Center; int type = ModContent.ProjectileType(); - int totalGore = CalamityWorld.LegendaryMode ? 40 : 20; + int totalGore = Main.getGoodWorld ? 40 : 20; for (int i = 0; i < totalGore; i++) { float velocityX = NPC.direction * goreVelocityX * (Main.rand.NextFloat(0.2f, 0.8f) + 0.5f); float velocityY = goreVelocityY * (Main.rand.NextFloat(0.2f, 0.8f) + 0.5f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocityX *= Main.rand.NextFloat() + 0.5f; velocityY *= Main.rand.NextFloat() + 0.5f; @@ -1649,7 +1663,7 @@ namespace CalamityMod.NPCs.OldDuke NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + x), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - x), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + x), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2] * 0.5f), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - x), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2] * 0.5f), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); @@ -2114,8 +2128,8 @@ namespace CalamityMod.NPCs.OldDuke { if (hurtInfo.Damage > 0) { - target.AddBuff(ModContent.BuffType(), 480); - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), Phase == 2 ? 600 : Phase == 1 ? 480 : 360); + target.AddBuff(ModContent.BuffType(), Phase == 2 ? 300 : Phase == 1 ? 240 : 180); if (Main.zenithWorld) { target.AddBuff(BuffID.Rabies, Main.rand.Next(180, 601)); diff --git a/NPCs/OldDuke/OldDukeToothBall.cs b/NPCs/OldDuke/OldDukeToothBall.cs index cbec36d85c..03bc136dcb 100644 --- a/NPCs/OldDuke/OldDukeToothBall.cs +++ b/NPCs/OldDuke/OldDukeToothBall.cs @@ -250,12 +250,6 @@ namespace CalamityMod.NPCs.OldDuke return base.PreDraw(spriteBatch, screenPos, drawColor); } - public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) - { - if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 240); - } - public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 3; k++) diff --git a/NPCs/OldDuke/SulphurousSharkron.cs b/NPCs/OldDuke/SulphurousSharkron.cs index 8bb954e543..d399c527f3 100644 --- a/NPCs/OldDuke/SulphurousSharkron.cs +++ b/NPCs/OldDuke/SulphurousSharkron.cs @@ -207,7 +207,7 @@ namespace CalamityMod.NPCs.OldDuke if (Main.rand.NextBool(8) && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode) + if (Main.netMode != NetmodeID.MultiplayerClient && Main.getGoodWorld) { int spawnX = NPC.width / 2; int type = ModContent.ProjectileType(); @@ -262,12 +262,6 @@ namespace CalamityMod.NPCs.OldDuke return NPC.Opacity == 1f; } - public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) - { - if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 240); - } - public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 5; k++) diff --git a/NPCs/Other/THELORDE.cs b/NPCs/Other/THELORDE.cs index 5811af7d54..516be41821 100644 --- a/NPCs/Other/THELORDE.cs +++ b/NPCs/Other/THELORDE.cs @@ -584,8 +584,7 @@ namespace CalamityMod.NPCs.Other public override void ModifyNPCLoot(NPCLoot npcLoot) { double pisquaredover6 = Math.Pow(MathHelper.Pi, 2) / 6; - npcLoot.AddIf(() => CalamityWorld.LegendaryMode, ModContent.ItemType()); // guaranteed in Legendary mode - npcLoot.AddIf(() => !CalamityWorld.LegendaryMode, ModContent.ItemType(), 27); // otherwise 1 in 27 + npcLoot.Add(ModContent.ItemType()); npcLoot.Add(ModContent.ItemType(), 1, 22, (int)(pisquaredover6 * 100)); } } diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index e021df330e..ab2fd8ced9 100644 --- a/NPCs/Perforator/PerforatorHeadLarge.cs +++ b/NPCs/Perforator/PerforatorHeadLarge.cs @@ -26,8 +26,6 @@ namespace CalamityMod.NPCs.Perforator public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/PerfLargeDeath"); public static Asset GlowTexture; - - private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; private bool TailSpawned = false; public override void SetStaticDefaults() @@ -104,14 +102,12 @@ namespace CalamityMod.NPCs.Perforator public override void SendExtraAI(BinaryWriter writer) { - writer.Write(biomeEnrageTimer); for (int i = 0; i < 4; i++) writer.Write(NPC.Calamity().newAI[i]); } public override void ReceiveExtraAI(BinaryReader reader) { - biomeEnrageTimer = reader.ReadInt32(); for (int i = 0; i < 4; i++) NPC.Calamity().newAI[i] = reader.ReadSingle(); } @@ -132,23 +128,6 @@ namespace CalamityMod.NPCs.Perforator Player player = Main.player[NPC.target]; - // Enrage - if ((!player.ZoneCrimson || (NPC.position.Y / 16f) < Main.worldSurface) && !BossRushEvent.BossRushActive) - { - if (biomeEnrageTimer > 0) - biomeEnrageTimer--; - } - else - biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - - bool biomeEnraged = biomeEnrageTimer <= 0; - - float enrageScale = 0f; - if (biomeEnraged && !player.ZoneCrimson) - enrageScale += 1f; - if (biomeEnraged && (NPC.position.Y / 16f) < Main.worldSurface) - enrageScale += 1f; - // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -157,9 +136,9 @@ namespace CalamityMod.NPCs.Perforator if (expertMode) { - float velocityScale = (death ? 0.1f : 0.07f) * enrageScale; + float velocityScale = death ? 0.1f : 0.07f; speed += velocityScale * (1f - lifeRatio); - float accelerationScale = (death ? 0.07f : 0.05f) * enrageScale; + float accelerationScale = death ? 0.07f : 0.05f; turnSpeed += accelerationScale * (1f - lifeRatio); } diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index 73829ca465..05bf4dca42 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -25,7 +25,6 @@ namespace CalamityMod.NPCs.Perforator public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/PerfMediumDeath"); public static Asset GlowTexture; - private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; public override void SetStaticDefaults() { NPCID.Sets.BossBestiaryPriority.Add(Type); @@ -103,21 +102,6 @@ namespace CalamityMod.NPCs.Perforator bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - if ((!Main.player[NPC.target].ZoneCrimson || (NPC.position.Y / 16f) < Main.worldSurface) && !BossRushEvent.BossRushActive) - { - if (biomeEnrageTimer > 0) - biomeEnrageTimer--; - } - else - biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - - bool biomeEnraged = biomeEnrageTimer <= 0 && !BossRushEvent.BossRushActive; - float enrageScale = 0f; - if (biomeEnraged && (NPC.position.Y / 16f) < Main.worldSurface) - enrageScale += 1f; - if (biomeEnraged && !Main.player[NPC.target].ZoneCrimson) - enrageScale += 1f; - // Total body segments float totalSegments = GetMediumPerforatorSegmentsCount(); @@ -132,9 +116,9 @@ namespace CalamityMod.NPCs.Perforator if (expertMode) { - float velocityScale = (death ? 0.125f : 0.085f) * enrageScale; + float velocityScale = death ? 0.125f : 0.085f; speed += velocityScale * (1f - lifeRatio); - float accelerationScale = (death ? 0.085f : 0.06f) * enrageScale; + float accelerationScale = death ? 0.085f : 0.06f; turnSpeed += accelerationScale * (1f - lifeRatio); } @@ -482,7 +466,7 @@ namespace CalamityMod.NPCs.Perforator public static int GetMediumPerforatorSegmentsCount() { - return CalamityWorld.LegendaryMode ? 20 : (CalamityWorld.death || BossRushEvent.BossRushActive) ? 14 : CalamityWorld.revenge ? 13 : Main.expertMode ? 12 : 10; + return Main.getGoodWorld ? 20 : (CalamityWorld.death || BossRushEvent.BossRushActive) ? 14 : CalamityWorld.revenge ? 13 : Main.expertMode ? 12 : 10; } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index 69dee673c6..7e21656207 100644 --- a/NPCs/Perforator/PerforatorHeadSmall.cs +++ b/NPCs/Perforator/PerforatorHeadSmall.cs @@ -26,9 +26,6 @@ namespace CalamityMod.NPCs.Perforator public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/PerfSmallDeath"); public static Asset GlowTexture; - - private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - private const int MsgType = 23; private bool TailSpawned = false; public override void SetStaticDefaults() @@ -99,39 +96,12 @@ namespace CalamityMod.NPCs.Perforator }); } - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(biomeEnrageTimer); - } - - public override void ReceiveExtraAI(BinaryReader reader) - { - biomeEnrageTimer = reader.ReadInt32(); - } - public override void AI() { bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - // Enrage - if ((!Main.player[NPC.target].ZoneCrimson || (NPC.position.Y / 16f) < Main.worldSurface) && !BossRushEvent.BossRushActive) - { - if (biomeEnrageTimer > 0) - biomeEnrageTimer--; - } - else - biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - - bool biomeEnraged = biomeEnrageTimer <= 0; - - float enrageScale = 0f; - if (biomeEnraged && !Main.player[NPC.target].ZoneCrimson) - enrageScale += 1f; - if (biomeEnraged && (NPC.position.Y / 16f) < Main.worldSurface) - enrageScale += 1f; - // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -140,9 +110,9 @@ namespace CalamityMod.NPCs.Perforator if (expertMode) { - float velocityScale = (death ? 0.2f : 0.14f) * enrageScale; + float velocityScale = death ? 0.2f : 0.14f; speed += velocityScale * (1f - lifeRatio); - float accelerationScale = (death ? 0.15f : 0.1f) * enrageScale; + float accelerationScale = death ? 0.15f : 0.1f; turnSpeed += accelerationScale * (1f - lifeRatio); } @@ -177,7 +147,7 @@ namespace CalamityMod.NPCs.Perforator Main.npc[lol].ai[2] = NPC.whoAmI; Main.npc[lol].ai[1] = Previous; Main.npc[Previous].ai[0] = lol; - NetMessage.SendData(MsgType, -1, -1, null, lol, 0f, 0f, 0f, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol, 0f, 0f, 0f, 0); Previous = lol; } diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index 9b67caa5b7..3889abcdb1 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -48,14 +48,11 @@ namespace CalamityMod.NPCs.Perforator private const int Width = 110; private const int Height = 100; - - private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; private bool smallSpawned = false; private bool mediumSpawned = false; private bool largeSpawned = false; private int wormsAlive = 0; - private float squash; private float addedStretch; private int squashTimer = 0; // Tracks current progress in scaling animation private const int squashInterval = 24; @@ -122,7 +119,6 @@ namespace CalamityMod.NPCs.Perforator public override void SendExtraAI(BinaryWriter writer) { - writer.Write(biomeEnrageTimer); writer.Write(wormsAlive); writer.Write(smallSpawned); writer.Write(mediumSpawned); @@ -133,7 +129,6 @@ namespace CalamityMod.NPCs.Perforator public override void ReceiveExtraAI(BinaryReader reader) { - biomeEnrageTimer = reader.ReadInt32(); wormsAlive = reader.ReadInt32(); smallSpawned = reader.ReadBoolean(); mediumSpawned = reader.ReadBoolean(); @@ -170,38 +165,15 @@ namespace CalamityMod.NPCs.Perforator // Phases based on life percentage bool phase2 = lifeRatio < 0.7f; - bool spawnSmall = CalamityWorld.LegendaryMode ? lifeRatio < 0.85f : lifeRatio < 0.75f; - bool spawnMedium = CalamityWorld.LegendaryMode ? lifeRatio < 0.60f : lifeRatio < 0.50f; - bool spawnLarge = CalamityWorld.LegendaryMode ? lifeRatio < 0.45f : lifeRatio < 0.25f; + bool spawnSmall = Main.getGoodWorld ? lifeRatio < 0.85f : lifeRatio < 0.75f; + bool spawnMedium = Main.getGoodWorld ? lifeRatio < 0.60f : lifeRatio < 0.50f; + bool spawnLarge = Main.getGoodWorld ? lifeRatio < 0.45f : lifeRatio < 0.25f; - // Enrage - if ((!player.ZoneCrimson || (NPC.position.Y / 16f) < Main.worldSurface) && !BossRushEvent.BossRushActive) - { - if (biomeEnrageTimer > 0) - biomeEnrageTimer--; - } - else - biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - - bool biomeEnraged = biomeEnrageTimer <= 0; - - float enrageScale = 0f; - if (biomeEnraged && !player.ZoneCrimson) - { - NPC.Calamity().CurrentlyEnraged = true; - enrageScale += 1f; - } - if (biomeEnraged && (NPC.position.Y / 16f) < Main.worldSurface) - { - NPC.Calamity().CurrentlyEnraged = true; - enrageScale += 1f; - } - - if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > 5600f) + if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > 5600f || !(player.ZoneCrimson || BossRushEvent.BossRushActive)) { NPC.TargetClosest(false); player = Main.player[NPC.target]; - if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > 5600f) + if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > 5600f || !(player.ZoneCrimson || BossRushEvent.BossRushActive)) { NPC.rotation = NPC.velocity.X * 0.04f; @@ -357,7 +329,7 @@ namespace CalamityMod.NPCs.Perforator } - if (CalamityWorld.LegendaryMode && lifeRatio < 0.5f) + if (Main.getGoodWorld && lifeRatio < 0.5f) { if (lifeRatio > 0.35f) NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X + Main.rand.Next(-25, 26), (int)NPC.Center.Y + Main.rand.Next(-25, 26), ModContent.NPCType(), 1); @@ -410,7 +382,7 @@ namespace CalamityMod.NPCs.Perforator // Emit ichor blobs if (phase2) { - if (wormsAlive == 0 || largeSpawned || floatAboveToFireBlobs || CalamityWorld.LegendaryMode) + if (wormsAlive == 0 || largeSpawned || floatAboveToFireBlobs || Main.getGoodWorld) { NPC.ai[2] += 1f; if (NPC.ai[2] >= blobPhaseGateValue) @@ -461,7 +433,7 @@ namespace CalamityMod.NPCs.Perforator bool ichorBlobBigWormPhase = wormsAlive > 0 && largeSpawned; int numBlobs = expertMode ? (ichorBlobBigWormPhase ? 4 : 6) : (ichorBlobBigWormPhase ? 2 : 4); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) numBlobs *= 2; int type = ModContent.ProjectileType(); @@ -473,7 +445,7 @@ namespace CalamityMod.NPCs.Perforator blobVelocity.Normalize(); blobVelocity *= Main.rand.Next(400, 801) * 0.01f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) blobVelocity *= Main.rand.NextFloat() + 1f; float blobVelocityYAdd = Math.Abs(blobVelocity.Y) * 0.25f; @@ -489,9 +461,6 @@ namespace CalamityMod.NPCs.Perforator } } - // Movement velocities, increased while enraged - float velocityEnrageIncrease = enrageScale; - // When firing blobs, float above the target and don't call any other projectile firing or movement code if (floatAboveToFireBlobs) { @@ -499,9 +468,9 @@ namespace CalamityMod.NPCs.Perforator NPC.damage = 0; if (revenge) - Movement(player, 9f + velocityEnrageIncrease, 0.3f, 450f); + Movement(player, 9f, 0.3f, 450f); else - Movement(player, 6f + velocityEnrageIncrease, 0.2f, 450f); + Movement(player, 6f, 0.2f, 450f); return; } @@ -515,7 +484,7 @@ namespace CalamityMod.NPCs.Perforator SoundEngine.PlaySound(GeyserShoot, NPC.Center); int numProj = death ? 16 : revenge ? 14 : expertMode ? 12 : 10; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) numProj *= 2; int spread = 75; @@ -575,13 +544,13 @@ namespace CalamityMod.NPCs.Perforator NPC.damage = NPC.defDamage; if (largeSpawned || death) - Movement(player, 13f + velocityEnrageIncrease, death ? 0.115f : 0.1f, 20f); + Movement(player, 13f, death ? 0.115f : 0.1f, 20f); else if (mediumSpawned) - Movement(player, 12f + velocityEnrageIncrease, death ? 0.11f : 0.095f, 30f); + Movement(player, 12f, death ? 0.11f : 0.095f, 30f); else if (smallSpawned) - Movement(player, 11f + velocityEnrageIncrease, death ? 0.105f : 0.09f, 40f); + Movement(player, 11f, death ? 0.105f : 0.09f, 40f); else - Movement(player, 10f + velocityEnrageIncrease, death ? 0.1f : 0.085f, 50f); + Movement(player, 10f, death ? 0.1f : 0.085f, 50f); break; @@ -590,7 +559,7 @@ namespace CalamityMod.NPCs.Perforator // Avoid cheap bullshit NPC.damage = 0; - Movement(player, 8f + velocityEnrageIncrease, 0.2f, 350f); + Movement(player, 8f, 0.2f, 350f); break; @@ -599,7 +568,7 @@ namespace CalamityMod.NPCs.Perforator // Avoid cheap bullshit NPC.damage = 0; - Movement(player, 8f + velocityEnrageIncrease, 0.2f, 275f); + Movement(player, 8f, 0.2f, 275f); break; @@ -608,7 +577,7 @@ namespace CalamityMod.NPCs.Perforator // Avoid cheap bullshit NPC.damage = 0; - Movement(player, 8f + velocityEnrageIncrease, 0.2f, 200f); + Movement(player, 8f, 0.2f, 200f); break; } @@ -618,7 +587,7 @@ namespace CalamityMod.NPCs.Perforator // Avoid cheap bullshit NPC.damage = 0; - Movement(player, 6f + velocityEnrageIncrease, 0.15f, 350f); + Movement(player, 6f, 0.15f, 350f); } } diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 2e79fd0096..0bd369b793 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -175,7 +175,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath float challengeAmt = (1f - lifeRatio) * 100f; float nukeBarrageChallengeAmt = (0.5f - lifeRatio) * 200f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { challengeAmt *= 1.5f; nukeBarrageChallengeAmt *= 1.5f; @@ -207,7 +207,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath // Missile countdown if (halfLife && MissileCountdown == 0) - MissileCountdown = CalamityWorld.LegendaryMode ? 300 : 600; + MissileCountdown = Main.getGoodWorld ? 300 : 600; if (MissileCountdown > 1) MissileCountdown--; @@ -248,7 +248,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (enrageScale > 1.5f) enrageScale = 1.5f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) enrageScale += 0.5f; bool diagonalDash = (revenge && phase2); @@ -539,8 +539,8 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (calamityGlobalNPC.newAI[0] > 90f) NPC.velocity *= 1.01f; - // Spawn honey in legendary rev+ - if (CalamityWorld.LegendaryMode && calamityGlobalNPC.newAI[0] % 6f == 0f) + // Spawn honey in the stupid seed + if (Main.zenithWorld && calamityGlobalNPC.newAI[0] % 6f == 0f) { if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -798,7 +798,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.direction = playerLocation < 0 ? 1 : -1; NPC.spriteDirection = NPC.direction; - if (NPC.ai[2] > (CalamityWorld.LegendaryMode ? 3f : 5f)) + if (NPC.ai[2] > 5f) { NPC.ai[0] = -1f; NPC.ai[1] = 2f; @@ -1339,7 +1339,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), diff --git a/NPCs/Polterghast/PhantomFuckYou.cs b/NPCs/Polterghast/PhantomFuckYou.cs index 25af8a694d..c1b66f1394 100644 --- a/NPCs/Polterghast/PhantomFuckYou.cs +++ b/NPCs/Polterghast/PhantomFuckYou.cs @@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.Polterghast } float chargePhaseGateValue = 480f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargePhaseGateValue *= 0.5f; bool chargePhase = Main.npc[CalamityGlobalNPC.ghostBoss].Calamity().newAI[0] >= chargePhaseGateValue - 60f; @@ -99,11 +99,11 @@ namespace CalamityMod.NPCs.Polterghast direction *= 0.5f; NPC.rotation = direction.ToRotation(); - if (!chargePhase || CalamityWorld.LegendaryMode) + if (!chargePhase || Main.getGoodWorld) { NPC.ai[2] += 1f; float shootMineGateValue = 150f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) shootMineGateValue *= 0.5f; if (NPC.ai[2] >= shootMineGateValue) @@ -130,7 +130,7 @@ namespace CalamityMod.NPCs.Polterghast if (SPEEN < 0f) SPEEN = 0f; - NPC.ai[1] += (CalamityWorld.LegendaryMode ? 1.5f : 0.5f) + SPEEN; + NPC.ai[1] += (Main.getGoodWorld ? 1.5f : 0.5f) + SPEEN; } public override Color? GetAlpha(Color drawColor) => new Color(200, 200, 200, 0); diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs index 985610220a..d1e74b8527 100644 --- a/NPCs/Polterghast/PolterPhantom.cs +++ b/NPCs/Polterghast/PolterPhantom.cs @@ -38,13 +38,13 @@ namespace CalamityMod.NPCs.Polterghast { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; - NPC.damage = 168; // 336 + NPC.damage = 180; // 360 NPC.width = 90; NPC.height = 120; NPC.defense = 45; NPC.DR_NERD(0.1f); NPC.LifeMaxNERB(62500, 75000, 60000); - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) NPC.lifeMax *= 4; NPC.knockBackResist = 0f; @@ -117,7 +117,7 @@ namespace CalamityMod.NPCs.Polterghast Vector2 vector = NPC.Center; float chargePhaseGateValue = 480f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargePhaseGateValue *= 0.5f; float colorChangeTime = 180f; @@ -422,7 +422,7 @@ namespace CalamityMod.NPCs.Polterghast spriteEffects = SpriteEffects.FlipHorizontally; float chargePhaseGateValue = 480f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargePhaseGateValue *= 0.5f; float timeToReachFullColor = 120f; diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 197f906f5e..2585460db1 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -103,12 +103,12 @@ namespace CalamityMod.NPCs.Polterghast } } - public static float Phase2ContactDamageMult = 1.2f; // 288 - public static float Phase3ContactDamageMult = 1.4f; // 336 - public static int BlueShotDamage = 60; // 240 - public static int BlueBlastDamage = 66; // 264 - public static int RedShotDamage = 66; // 264 - public static int RedBlastDamage = 72; // 288 + public static float Phase2ContactDamageMult = 1.25f; // 300 + public static float Phase3ContactDamageMult = 1.5f; // 360 + public static int BlueShotDamage = 65; // 260 + public static int BlueBlastDamage = 70; // 280 + public static int RedShotDamage = 70; // 280 + public static int RedBlastDamage = 75; // 300 public override void SetDefaults() { @@ -225,7 +225,7 @@ namespace CalamityMod.NPCs.Polterghast // Velocity and acceleration calamityGlobalNPC.newAI[0] += 1f; float chargePhaseGateValue = 480f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargePhaseGateValue *= 0.5f; bool chargePhase = calamityGlobalNPC.newAI[0] >= chargePhaseGateValue; @@ -1103,7 +1103,7 @@ namespace CalamityMod.NPCs.Polterghast } float chargePhaseGateValue = 480f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargePhaseGateValue *= 0.5f; float timeToReachFullColor = 120f; diff --git a/NPCs/Polterghast/PolterghastHook.cs b/NPCs/Polterghast/PolterghastHook.cs index 44a72cfd55..ad8a02d2e5 100644 --- a/NPCs/Polterghast/PolterghastHook.cs +++ b/NPCs/Polterghast/PolterghastHook.cs @@ -96,7 +96,7 @@ namespace CalamityMod.NPCs.Polterghast } float chargePhaseGateValue = 480f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargePhaseGateValue *= 0.5f; bool chargePhase = Main.npc[CalamityGlobalNPC.ghostBoss].Calamity().newAI[0] >= chargePhaseGateValue - 60f; @@ -152,7 +152,7 @@ namespace CalamityMod.NPCs.Polterghast NPC.ai[2] += 1f; if (NPC.ai[3] == 0f) { - if (NPC.ai[2] > ((CalamityWorld.LegendaryMode) ? 12f : 120f)) + if (NPC.ai[2] > (Main.getGoodWorld ? 40f : 120f)) { NPC.ai[2] = 0f; NPC.ai[3] = 1f; @@ -184,7 +184,7 @@ namespace CalamityMod.NPCs.Polterghast private void Movement(bool phase2, bool expertMode, bool revenge, bool death, bool speedBoost, bool despawnBoost, float lifeRatio, float tileEnrageMult, Player player) { float chargePhaseGateValue = 480f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargePhaseGateValue *= 0.5f; float colorChangeTime = 180f; @@ -326,7 +326,7 @@ namespace CalamityMod.NPCs.Polterghast Color lightRed = new Color(255, 100, 100, 255); float chargePhaseGateValue = 480f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargePhaseGateValue *= 0.5f; float timeToReachFullColor = 120f; diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs index d898aa06cd..8786ae0910 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs @@ -336,7 +336,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm float ancientDoomGateValue = death ? 95f : revenge ? 100f : expertMode ? 105f : 120f; float lightningChargePhaseGateValue = death ? 120f : revenge ? 135f : expertMode ? 150f : 180f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { lightningRainDuration *= 0.5f; eidolonWyrmPhaseDuration *= 0.25f; @@ -454,7 +454,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm // Velocity and turn speed values float velocityScale = death ? 1.8f : revenge ? 1.5f : expertMode ? 1.2f : 0f; float baseVelocity = (targetDownDeep ? 10f : 15f) + (targetDownDeep ? velocityScale : velocityScale * 1.5f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) baseVelocity *= 1.15f; float turnSpeed = baseVelocity * 0.015f; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index 7080a84d05..781b769989 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -369,9 +369,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Charge variables float chargeVelocityMult = 0.25f; float maxChargeVelocity = death ? 28f : revenge ? 26f : expertMode ? 24f : 20f; - if (CalamityWorld.LegendaryMode) - maxChargeVelocity *= 1.15f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) maxChargeVelocity *= 2f; float inertia = death ? 45f : revenge ? 47f : expertMode ? 50f : 55f; @@ -379,7 +377,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians inertia *= 0.8f; if (!phase1) inertia *= 0.75f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) inertia *= 0.8f; bool speedUp = Vector2.Distance(NPC.Center, player.Center) > 960f; @@ -458,7 +456,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians calamityGlobalNPC.newAI[0] = -NPC.direction; float velocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) velocity *= 1.25f; if (healerAlive) velocity *= 0.8f; @@ -786,7 +784,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians bool targetRanAwayAndWillNowBeFucked = NPC.ai[2] == 1f; bool boostVelocityToCatchUp = NPC.ai[1] == 0f || targetRanAwayAndWillNowBeFucked; float velocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) velocity *= 1.25f; if (boostVelocityToCatchUp) velocity *= 2f; @@ -843,7 +841,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians else if (NPC.ai[1] % spearShootDivisor == 0f) { float spearVelocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) spearVelocity *= 1.25f; if (boostVelocityToCatchUp) spearVelocity *= 1.5f; @@ -898,7 +896,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians float velocity = death ? 4f : revenge ? 3.75f : expertMode ? 3.5f : 3f; if (NPC.ai[1] < laserGateValue) velocity *= 6f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) velocity *= 1.25f; calamityGlobalNPC.newAI[0] = -NPC.direction; @@ -916,7 +914,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Limit Y velocity while firing laser if (NPC.ai[1] >= laserGateValue) { - float speedCap = CalamityWorld.LegendaryMode ? 4f : 2f; + float speedCap = Main.getGoodWorld ? 4f : 2f; if (NPC.velocity.Y > speedCap) NPC.velocity.Y = speedCap; if (NPC.velocity.Y < -speedCap) @@ -973,7 +971,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (revenge) Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, -laserVelocity, ModContent.ProjectileType(), RayDamage, 0f, Main.myPlayer, -beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI); - if (CalamityWorld.LegendaryMode) + if (CalamityWorld.death) { rotation *= 0.33f; laserVelocity = laserVelocity.RotatedBy(-(double)beamDirection * MathHelper.TwoPi / 2f); @@ -1201,7 +1199,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { npcLoot.Add(ModContent.ItemType(), 4); npcLoot.Add(ModContent.ItemType(), 7); - npcLoot.Add(ModContent.ItemType(), 5); + npcLoot.Add(ModContent.ItemType(), 4); npcLoot.Add(ModContent.ItemType(), 10); npcLoot.Add(ModContent.ItemType()); npcLoot.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 15, 20, 20, 25)); diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs index f8fe31cd81..f5a2ad3aaf 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs @@ -262,7 +262,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Charge variables float chargeVelocityMult = 0.25f; float maxChargeVelocity = death ? 22f : revenge ? 20.5f : expertMode ? 19f : 16f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) maxChargeVelocity *= 1.15f; // Whether the commander is calling all guardians together for the laser attack @@ -382,7 +382,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } float moveVelocity = death ? 22f : revenge ? 21f : expertMode ? 20f : 18f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) moveVelocity *= 1.25f; if (healerAlive) moveVelocity *= 0.8f; @@ -455,7 +455,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (distanceFromDestination.Length() > 40f) { float inertia = (commanderUsingLaser || commanderGoingLowOrHighInPhase1) ? 10f : 15f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) inertia *= 0.8f; NPC.velocity = (NPC.velocity * (inertia - 1) + desiredVelocity) / inertia; @@ -487,7 +487,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.ai[1] >= -throwRocksGateValue) { NPC.velocity *= 0.8f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.velocity *= 0.5f; } @@ -548,7 +548,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (distanceFromDestination.Length() > 40f) { float inertia = commanderGoingLowOrHighInPhase2 ? 8f : 15f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) inertia *= 0.8f; NPC.velocity = (NPC.velocity * (inertia - 1) + desiredVelocity) / inertia; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs index fda7a1b29a..3072c2dd99 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs @@ -216,7 +216,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians bool useCrystalShards = AIState == (float)Phase.CrystalShards; float velocity = useCrystalShards ? (death ? 16f : revenge ? 15f : expertMode ? 14f : 12f) : (Main.npc[CalamityGlobalNPC.doughnutBoss].velocity.Length() + 5f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) velocity *= 1.25f; float idealDistanceFromDestination = useCrystalShards ? 80f : 160f; @@ -250,7 +250,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (distanceFromDestination.Length() > 40f) { float inertia = 10f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) inertia *= 0.8f; NPC.velocity = (NPC.velocity * (inertia - 1) + desiredVelocity) / inertia; @@ -403,7 +403,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians float inertia = death ? 32f : revenge ? 34f : expertMode ? 36f : 40f; if (lifeRatio < 0.5f) inertia *= 0.8f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) inertia *= 0.8f; NPC.velocity = (NPC.velocity * (inertia - 1) + desiredVelocity) / inertia; diff --git a/NPCs/ProfanedGuardians/ProfanedRocks.cs b/NPCs/ProfanedGuardians/ProfanedRocks.cs index 234672c46b..d9988fbf75 100644 --- a/NPCs/ProfanedGuardians/ProfanedRocks.cs +++ b/NPCs/ProfanedGuardians/ProfanedRocks.cs @@ -208,7 +208,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Start off slow Vector2 finalVelocity = NPC.SafeDirectionTo(player.Center, -Vector2.UnitY) * chargeSpeed; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) finalVelocity *= Main.rand.NextFloat(1f, 1.7f); NPC.Calamity().newAI[2] = finalVelocity.X; diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 3ba404d415..ba9045341d 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -273,7 +273,7 @@ namespace CalamityMod.NPCs.Providence NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 0.25f; } @@ -854,7 +854,7 @@ namespace CalamityMod.NPCs.Providence velocity = 30f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.2f; acceleration *= 1.2f; @@ -870,12 +870,12 @@ namespace CalamityMod.NPCs.Providence float moveUpThreshold = player.position.Y - (NPC.position.Y + NPC.height); if (moveUpThreshold < (laserPhaseSlow ? 150f : 200f)) // 150 - NPC.velocity.Y -= CalamityWorld.LegendaryMode ? 0.4f : 0.2f; + NPC.velocity.Y -= Main.getGoodWorld ? 0.4f : 0.2f; if (moveUpThreshold > (laserPhaseSlow ? 200f : 250f)) // 200 - NPC.velocity.Y += CalamityWorld.LegendaryMode ? 0.4f : 0.2f; + NPC.velocity.Y += Main.getGoodWorld ? 0.4f : 0.2f; float speedCap = laserPhaseSlow ? 2f : 6f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) speedCap *= 1.5f; if (NPC.velocity.Y > speedCap) @@ -1524,7 +1524,7 @@ namespace CalamityMod.NPCs.Providence { Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, vector2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -vector2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); } } @@ -1551,7 +1551,7 @@ namespace CalamityMod.NPCs.Providence { Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, velocity2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, 1f, 0f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -velocity2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, 1f, 0f); } } diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 589c2fea98..1807ed445f 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -491,7 +491,7 @@ namespace CalamityMod.NPCs.Ravager NPC.ai[1] += 1f; } - float jumpGateValue = CalamityWorld.LegendaryMode ? 0f : 180f; + float jumpGateValue = Main.getGoodWorld ? 0f : 180f; if (NPC.ai[1] >= jumpGateValue) { NPC.ai[1] = -20f; @@ -588,30 +588,6 @@ namespace CalamityMod.NPCs.Ravager bool anyRockPillars = NPC.AnyNPCs(ModContent.NPCType()); bool anyFlamePillars = NPC.AnyNPCs(ModContent.NPCType()); - if (CalamityWorld.LegendaryMode) - { - if (!expertMode || anyRockPillars || anyFlamePillars) - SoundEngine.PlaySound(PillarSound, NPC.Center); - - // Eruption of bouncing rock projectiles - float projectileVelocity = 12f; - int type = ModContent.ProjectileType(); - Vector2 destination = new Vector2(NPC.Center.X, NPC.Center.Y - 100f) - NPC.Center; - destination.Normalize(); - destination *= projectileVelocity; - int numProj = 11; - float rotation = MathHelper.ToRadians(90); - for (int i = 0; i < numProj; i++) - { - // Spawn projectiles 0, 1, 2, 3, 7, 8, 9 and 10 - if (i < 4 || i > 6) - { - Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.UnitY * 30f * NPC.scale + Vector2.Normalize(perturbedSpeed) * 30f * NPC.scale, perturbedSpeed, type, RockDamage, 0f, Main.myPlayer); - } - } - } - if (expertMode) { foreach (NPC n in Main.ActiveNPCs) @@ -630,12 +606,12 @@ namespace CalamityMod.NPCs.Ravager { SoundEngine.PlaySound(PillarSound, NPC.Center); } - if (!anyRockPillars || CalamityWorld.LegendaryMode) + if (!anyRockPillars || Main.getGoodWorld) { NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.Center.X - spawnDistance * 1.25f), (int)player.Center.Y - 100, ModContent.NPCType()); NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.Center.X + spawnDistance * 1.25f), (int)player.Center.Y - 100, ModContent.NPCType()); } - else if (!anyFlamePillars || CalamityWorld.LegendaryMode) + else if (!anyFlamePillars || Main.getGoodWorld) { float distanceMultiplier = finalPhase ? 2.5f : 2f; NPC.NewNPC(NPC.GetSource_FromAI(), (int)player.Center.X - (int)(spawnDistance * distanceMultiplier), (int)player.Center.Y - 100, ModContent.NPCType()); diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index cceffde46d..fc7f8d7c36 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -140,12 +140,12 @@ namespace CalamityMod.NPCs.Signus double lifeRatio = NPC.life / (double)NPC.lifeMax; - lifeToAlpha = (int)((CalamityWorld.LegendaryMode ? 200D : 100D) * (1D - lifeRatio)); + lifeToAlpha = (int)((Main.getGoodWorld ? 200D : 100D) * (1D - lifeRatio)); int maxCharges = death ? 1 : revenge ? 2 : expertMode ? 3 : 4; int maxTeleports = (death && lifeRatio < 0.9) ? 1 : revenge ? 2 : expertMode ? 3 : 4; float inertia = death ? 10f : revenge ? 11f : expertMode ? 12f : 14f; float chargeVelocity = death ? 14f : revenge ? 13f : expertMode ? 12f : 10f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { inertia *= 0.5f; chargeVelocity *= 1.15f; @@ -199,7 +199,7 @@ namespace CalamityMod.NPCs.Signus else if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; - if (lifeToAlpha < (CalamityWorld.LegendaryMode ? 100 : 50) && NPC.ai[0] != 1f) + if (lifeToAlpha < (Main.getGoodWorld ? 100 : 50) && NPC.ai[0] != 1f) { for (int i = 0; i < 2; i++) { @@ -262,7 +262,7 @@ namespace CalamityMod.NPCs.Signus playerYDist *= playerDistance; float inertia2 = 50f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) inertia2 *= 0.5f; NPC.velocity.X = (NPC.velocity.X * inertia2 + playerXDist) / (inertia2 + 1f); @@ -294,7 +294,7 @@ namespace CalamityMod.NPCs.Signus if (expertMode) NPC.localAI[1] += death ? 3f * (float)(1D - lifeRatio) : 2f * (float)(1D - lifeRatio); - if (NPC.localAI[1] >= (CalamityWorld.LegendaryMode ? 0f : 120f)) + if (NPC.localAI[1] >= (Main.getGoodWorld ? 0f : 120f)) { NPC.localAI[1] = 0f; @@ -563,7 +563,7 @@ namespace CalamityMod.NPCs.Signus { if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalLamps = (CalamityWorld.LegendaryMode && !Main.zenithWorld) ? 10 : 5; + int totalLamps = (Main.getGoodWorld && !Main.zenithWorld) ? 10 : 5; if (NPC.CountNPCS(ModContent.NPCType()) < totalLamps) { bool buffed = false; @@ -690,12 +690,8 @@ namespace CalamityMod.NPCs.Signus if ((phase2 || buffed) && NPC.ai[2] % 3f == 0f) { SoundEngine.PlaySound(SoundID.Item73, NPC.Center); - int type = (CalamityWorld.LegendaryMode) ? ModContent.ProjectileType() : ModContent.ProjectileType(); - Vector2 velocity = Main.zenithWorld ? new Vector2(Main.rand.Next(-10, 11), Main.rand.Next(-10, 11)) : Vector2.Zero; - if (CalamityWorld.LegendaryMode && !Main.zenithWorld) - { - velocity = new Vector2(Main.rand.Next(-5, 6), Main.rand.Next(-5, 6)); - } + int type = Main.zenithWorld ? ModContent.ProjectileType() : ModContent.ProjectileType(); + Vector2 velocity = Main.rand.NextVector2Circular(Main.zenithWorld ? 10f : 0f, Main.zenithWorld ? 10f : 0f); int ai = buffed ? 69 : 0; Projectile.NewProjectile(NPC.GetSource_FromAI(), vectorCenter, velocity, type, DustDamage, 0f, Main.myPlayer, ai); } diff --git a/NPCs/SlimeGod/CorruptSlimeSpawn.cs b/NPCs/SlimeGod/CorruptSlimeSpawn.cs index ab8ea6601f..fd9842e659 100644 --- a/NPCs/SlimeGod/CorruptSlimeSpawn.cs +++ b/NPCs/SlimeGod/CorruptSlimeSpawn.cs @@ -29,11 +29,9 @@ namespace CalamityMod.NPCs.SlimeGod NPC.damage = 28; // 56 NPC.width = 40; NPC.height = 30; - if (CalamityWorld.LegendaryMode) - NPC.scale = 2f; NPC.defense = 6; - NPC.lifeMax = BossRushEvent.BossRushActive ? 10000 : CalamityWorld.LegendaryMode ? 360 : 180; + NPC.lifeMax = BossRushEvent.BossRushActive ? 10000 : 180; NPC.knockBackResist = 0.7f; AnimationType = NPCID.Slimer; NPC.lavaImmune = false; diff --git a/NPCs/SlimeGod/CorruptSlimeSpawn2.cs b/NPCs/SlimeGod/CorruptSlimeSpawn2.cs index 35eb93535f..2a4539f271 100644 --- a/NPCs/SlimeGod/CorruptSlimeSpawn2.cs +++ b/NPCs/SlimeGod/CorruptSlimeSpawn2.cs @@ -26,11 +26,9 @@ namespace CalamityMod.NPCs.SlimeGod NPC.damage = 20; // 40 NPC.width = 40; NPC.height = 30; - if (CalamityWorld.LegendaryMode) - NPC.scale = 2f; NPC.defense = 4; - NPC.lifeMax = BossRushEvent.BossRushActive ? 5000 : CalamityWorld.LegendaryMode ? 180 : 90; + NPC.lifeMax = BossRushEvent.BossRushActive ? 5000 : 90; NPC.knockBackResist = 0.9f; AnimationType = NPCID.CorruptSlime; NPC.lavaImmune = false; diff --git a/NPCs/SlimeGod/CrimsonSlimeSpawn.cs b/NPCs/SlimeGod/CrimsonSlimeSpawn.cs index 70d731eb17..acbf43a7cf 100644 --- a/NPCs/SlimeGod/CrimsonSlimeSpawn.cs +++ b/NPCs/SlimeGod/CrimsonSlimeSpawn.cs @@ -25,11 +25,9 @@ namespace CalamityMod.NPCs.SlimeGod NPC.damage = 20; // 40 NPC.width = 40; NPC.height = 30; - if (CalamityWorld.LegendaryMode) - NPC.scale = 2f; NPC.defense = 4; - NPC.lifeMax = BossRushEvent.BossRushActive ? 10000 : CalamityWorld.LegendaryMode ? 220 : 110; + NPC.lifeMax = BossRushEvent.BossRushActive ? 10000 : 110; NPC.knockBackResist = 0.8f; AnimationType = NPCID.CorruptSlime; NPC.lavaImmune = false; diff --git a/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs b/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs index 635c400287..49d8410197 100644 --- a/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs +++ b/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs @@ -34,11 +34,9 @@ namespace CalamityMod.NPCs.SlimeGod NPC.damage = 28; // 56 NPC.width = 40; NPC.height = 30; - if (CalamityWorld.LegendaryMode) - NPC.scale = 2f; NPC.defense = 6; - NPC.lifeMax = BossRushEvent.BossRushActive ? 12000 : CalamityWorld.LegendaryMode ? 260 : 130; + NPC.lifeMax = BossRushEvent.BossRushActive ? 12000 : 130; NPC.knockBackResist = 0.7f; NPC.lavaImmune = false; NPC.noGravity = false; diff --git a/NPCs/SlimeGod/CrimulanPaladin.cs b/NPCs/SlimeGod/CrimulanPaladin.cs index 92b31f87e7..852cfe7269 100644 --- a/NPCs/SlimeGod/CrimulanPaladin.cs +++ b/NPCs/SlimeGod/CrimulanPaladin.cs @@ -109,7 +109,7 @@ namespace CalamityMod.NPCs.SlimeGod addedStretch = -landingRecoil; // Used for teleporting - float scale = CalamityWorld.LegendaryMode ? 0.6f : 1f; + float scale = Main.getGoodWorld ? 0.8f : 1f; // How fast the slime slams down float slamVelocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; @@ -152,7 +152,7 @@ namespace CalamityMod.NPCs.SlimeGod if (lifeRatio <= 0.5f && Main.netMode != NetmodeID.MultiplayerClient && expertMode) { // Spread of random globs in meme mode - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) { int type = ModContent.ProjectileType(); for (int i = 0; i < 30; i++) diff --git a/NPCs/SlimeGod/EbonianPaladin.cs b/NPCs/SlimeGod/EbonianPaladin.cs index c45b32cdef..b28982e265 100644 --- a/NPCs/SlimeGod/EbonianPaladin.cs +++ b/NPCs/SlimeGod/EbonianPaladin.cs @@ -96,7 +96,7 @@ namespace CalamityMod.NPCs.SlimeGod setDamage += SlimeGodCore.PossessionDamageBoost; } - float scale = CalamityWorld.LegendaryMode ? 0.6f : 1f; + float scale = Main.getGoodWorld ? 0.8f : 1f; NPC.aiAction = 0; // Get a target @@ -126,7 +126,7 @@ namespace CalamityMod.NPCs.SlimeGod if (lifeRatio <= 0.5f && Main.netMode != NetmodeID.MultiplayerClient && expertMode) { - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) { int type = ModContent.ProjectileType(); for (int i = 0; i < 30; i++) @@ -308,7 +308,7 @@ namespace CalamityMod.NPCs.SlimeGod { if (Main.netMode != NetmodeID.MultiplayerClient) { - int numProjectiles = CalamityWorld.LegendaryMode ? 12 : death ? 6 : 4; + int numProjectiles = Main.getGoodWorld ? 12 : death ? 6 : 4; float projectileVelocity = death ? 8f : 6f; int type = ModContent.ProjectileType(); Vector2 destination = (new Vector2(NPC.Center.X, NPC.Center.Y + 100f) - NPC.Center).SafeNormalize(Vector2.UnitY); @@ -321,7 +321,7 @@ namespace CalamityMod.NPCs.SlimeGod Vector2 dustSpawnOffset = dustSpawnBox * 0.5f; for (int i = 0; i < numProjectiles; i++) { - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) destination *= Main.rand.NextFloat() + 0.5f; Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProjectiles - 1))); @@ -486,15 +486,13 @@ namespace CalamityMod.NPCs.SlimeGod // Charge variables float chargeVelocityMult = 0.1f; float maxChargeVelocity = enraged ? 12f : death ? 10f : revenge ? 9f : expertMode ? 8f : 6f; - if (CalamityWorld.LegendaryMode) - maxChargeVelocity *= 1.15f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) maxChargeVelocity *= 2f; float inertia = death ? 110f : revenge ? 114f : expertMode ? 120f : 130f; if (lifeRatio < 0.75f) inertia *= 0.8f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) inertia *= 0.8f; // Start charge diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index df352658d5..e305a07cb0 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -91,7 +91,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.npcSlots = 10f; NPC.width = 96; NPC.height = 98; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale = 2f; NPC.defense = 6; @@ -529,7 +529,7 @@ namespace CalamityMod.NPCs.SlimeGod flySpeed += 3f; if (phase2) flySpeed *= 1.1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) flySpeed *= 1.3f; Vector2 flyDestination = aggressionLevel >= (int)AggressionLevel.ChargeAtPlayer ? player.Center : player.Center - Vector2.UnitY * 320f; @@ -571,10 +571,8 @@ namespace CalamityMod.NPCs.SlimeGod float maxInertiaDistance = 600f; float totalInertiaAdjustmentDistance = maxInertiaDistance - minInertiaDistance; float distanceFromInertiaAdjustmentCutoff = distanceFromFlyDestination - minInertiaDistance; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) maxInertia *= 0.8f; - if (CalamityWorld.LegendaryMode) - maxInertia *= Main.rand.NextFloat(0.2f, 1f); float inertia = distanceFromFlyDestination >= maxInertiaDistance ? maxInertia : distanceFromFlyDestination <= minInertiaDistance ? minInertia : diff --git a/NPCs/SlimeGod/SplitCrimulanPaladin.cs b/NPCs/SlimeGod/SplitCrimulanPaladin.cs index 985b530688..54c404647b 100644 --- a/NPCs/SlimeGod/SplitCrimulanPaladin.cs +++ b/NPCs/SlimeGod/SplitCrimulanPaladin.cs @@ -122,7 +122,7 @@ namespace CalamityMod.NPCs.SlimeGod addedStretch = -landingRecoil; // Used for teleporting - float scale = CalamityWorld.LegendaryMode ? 0.6f : 1f; + float scale = Main.getGoodWorld ? 0.8f : 1f; // How fast the slime slams down float slamVelocity = death ? 18.25f : revenge ? 16.5f : expertMode ? 15.5f : 13.5f; diff --git a/NPCs/SlimeGod/SplitEbonianPaladin.cs b/NPCs/SlimeGod/SplitEbonianPaladin.cs index b827299dcf..94812533c6 100644 --- a/NPCs/SlimeGod/SplitEbonianPaladin.cs +++ b/NPCs/SlimeGod/SplitEbonianPaladin.cs @@ -118,7 +118,7 @@ namespace CalamityMod.NPCs.SlimeGod addedStretch = -landingRecoil; - float scale = CalamityWorld.LegendaryMode ? 0.6f : 1f; + float scale = Main.getGoodWorld ? 0.8f : 1f; // How fast the slime slams down float slamVelocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; diff --git a/NPCs/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index ec54f5f5de..098572787f 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -69,7 +69,7 @@ namespace CalamityMod.NPCs.StormWeaver else if (Main.expertMode) NPC.scale *= 1.1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 0.7f; NPC.Calamity().VulnerableToElectricity = false; @@ -112,7 +112,7 @@ namespace CalamityMod.NPCs.StormWeaver Player player = Main.player[NPC.target]; // Update armored settings to naked settings - if (phase2 && (!CalamityWorld.LegendaryMode || !revenge)) + if (phase2 && (!Main.zenithWorld || !revenge)) { // Spawn armor gore and set other crucial variables if (!NPC.chaseable) @@ -248,7 +248,7 @@ namespace CalamityMod.NPCs.StormWeaver float lifeRatio = NPC.life / (float)NPC.lifeMax; - bool phase2 = lifeRatio < 0.8f && (!CalamityWorld.LegendaryMode || !revenge); + bool phase2 = lifeRatio < 0.8f && (!Main.zenithWorld || !revenge); bool phase3 = lifeRatio < 0.55f; // Gate value that decides when Storm Weaver will charge diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 0992006f02..67b623d8ae 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -123,7 +123,7 @@ namespace CalamityMod.NPCs.StormWeaver else if (Main.expertMode) NPC.scale *= 1.1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 0.7f; NPC.Calamity().VulnerableToElectricity = false; @@ -191,7 +191,7 @@ namespace CalamityMod.NPCs.StormWeaver bool phase4 = lifeRatio < 0.3f; // Update armored settings to naked settings - if (phase2 && !CalamityWorld.LegendaryMode) + if (phase2 && !Main.zenithWorld) { // Spawn armor gore, roar and set other crucial variables if (!NPC.chaseable) @@ -278,7 +278,7 @@ namespace CalamityMod.NPCs.StormWeaver } // Used for body and tail projectile firing timings in phase 1 - if (!phase2 || CalamityWorld.LegendaryMode) + if (!phase2 || Main.zenithWorld) NPC.localAI[0] += 1f; } @@ -554,7 +554,8 @@ namespace CalamityMod.NPCs.StormWeaver if (calamityGlobalNPC.newAI[0] == chargePhaseGateValue - 70) { Vector2 soundCenter = Main.player[NPC.target].Center; - SoundEngine.PlaySound(CommonCalamitySounds.LightningTelegraph, soundCenter); + SoundStyle lightning = new("CalamityMod/Sounds/Custom/LightningTelegraph") { Volume = 0.7f }; + SoundEngine.PlaySound(lightning, soundCenter); } if (calamityGlobalNPC.newAI[0] >= chargePhaseGateValue) { @@ -617,7 +618,7 @@ namespace CalamityMod.NPCs.StormWeaver } } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.4f; acceleration *= 1.4f; @@ -828,7 +829,7 @@ namespace CalamityMod.NPCs.StormWeaver float lifeRatio = NPC.life / (float)NPC.lifeMax; - bool phase2 = lifeRatio < 0.8f && !CalamityWorld.LegendaryMode; + bool phase2 = lifeRatio < 0.8f && !Main.zenithWorld; bool phase3 = lifeRatio < 0.55f; // Gate value that decides when Storm Weaver will charge diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index f4a1862d72..3608b9cc4d 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -68,7 +68,7 @@ namespace CalamityMod.NPCs.StormWeaver else if (Main.expertMode) NPC.scale *= 1.1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 0.7f; NPC.Calamity().VulnerableToElectricity = false; @@ -118,7 +118,7 @@ namespace CalamityMod.NPCs.StormWeaver bool phase2 = NPC.life / (float)NPC.lifeMax < 0.8f; // Update armored settings to naked settings - if (phase2 && (!CalamityWorld.LegendaryMode || !CalamityWorld.revenge)) + if (phase2 && (!Main.zenithWorld || !CalamityWorld.revenge)) { // Spawn armor gore and set other crucial variables if (NPC.takenDamageMultiplier == 2f) @@ -244,7 +244,7 @@ namespace CalamityMod.NPCs.StormWeaver float lifeRatio = NPC.life / (float)NPC.lifeMax; - bool phase2 = lifeRatio < 0.8f && (!CalamityWorld.LegendaryMode || !revenge); + bool phase2 = lifeRatio < 0.8f && (!Main.zenithWorld || !revenge); bool phase3 = lifeRatio < 0.55f; // Gate value that decides when Storm Weaver will charge diff --git a/NPCs/SulphurousSea/Trasher.cs b/NPCs/SulphurousSea/Trasher.cs index 6c31bd3614..0d74458909 100644 --- a/NPCs/SulphurousSea/Trasher.cs +++ b/NPCs/SulphurousSea/Trasher.cs @@ -32,7 +32,6 @@ namespace CalamityMod.NPCs.SulphurousSea public override void SetDefaults() { - NPC.Calamity().canBreakPlayerDefense = true; NPC.noGravity = true; NPC.damage = 50; NPC.width = 150; diff --git a/NPCs/SunkenSea/PolypPanasea.cs b/NPCs/SunkenSea/PolypPanasea.cs index 027c5905b4..f172a5c609 100644 --- a/NPCs/SunkenSea/PolypPanasea.cs +++ b/NPCs/SunkenSea/PolypPanasea.cs @@ -334,7 +334,7 @@ namespace CalamityMod.NPCs.SunkenSea { if (CurrentBehavior == (int)PhaseType.Idle) { - pathfinding.ClearResults(); + pathfinding?.ClearResults(); CurrentBehavior = (int)PhaseType.Flee; AlertPolyp(); } diff --git a/NPCs/SunkenSea/Scavenger.cs b/NPCs/SunkenSea/Scavenger.cs index ca7f553b27..641900a856 100644 --- a/NPCs/SunkenSea/Scavenger.cs +++ b/NPCs/SunkenSea/Scavenger.cs @@ -1,10 +1,12 @@ using CalamityMod.BiomeManagers; using CalamityMod.Enums; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.Critters; using CalamityMod.Items.Fishing.SunkenSeaCatches; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Items.Placeables.FurnitureDriftwood; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.NPCs.NormalNPCs; @@ -151,6 +153,8 @@ namespace CalamityMod.NPCs.SunkenSea AddScavengerItem(white, ItemID.Coral, 3, 10, 0.2f); AddScavengerItem(white, ItemID.Starfish, 3, 10, 0.2f); AddScavengerItem(white, ItemID.Seashell, 3, 10, 0.2f); + AddScavengerItem(white, ModContent.ItemType(), 1, 0.05f); + AddScavengerItem(white, ModContent.ItemType(), 1, 0.05f); // Critters. Golds, Radiants, Pearlpods and any Basalt Gully/Timeless Shore critters are to be excluded AddScavengerItem(white, ModContent.ItemType(), 1, 0.02f); AddScavengerItem(white, ModContent.ItemType(), 1, 0.02f); diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index 7d8bdd188c..10c78e8c89 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -206,7 +206,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas GeneralParticleHandler.SpawnParticle(spark2); } - float distanceFromSCal = CalamityWorld.LegendaryMode ? 300f : 225f; + float distanceFromSCal = Main.getGoodWorld ? 300f : 225f; NPC.position = SCal.Center - MathHelper.ToRadians(RotationalDegreeOffset).ToRotationVector2() * distanceFromSCal - NPC.Size * 0.5f; NPC.velocity = Vector2.Zero; RotationalDegreeOffset += 0.5f; diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index c38563edf8..5050775e26 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -204,7 +204,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas public static readonly SoundStyle BrimstoneShotSound = new("CalamityMod/Sounds/Custom/SCalSounds/BrimstoneShoot"); public static readonly SoundStyle BrotherHit = new("CalamityMod/Sounds/Custom/SCalSounds/BrothersHurt", 2); public static readonly SoundStyle BrotherDeath = new("CalamityMod/Sounds/Custom/SCalSounds/BrothersDeath", 2); - public static readonly SoundStyle CatastropheSwing = new("CalamityMod/Sounds/Custom/SCalSounds/CatastropheResonanceSlash1"); + public static readonly SoundStyle CatastropheSwing = new("CalamityMod/Sounds/Custom/SCalSounds/CatastropheResonanceSlash"); public static readonly SoundStyle BrimstoneBigShotSound = new("CalamityMod/Sounds/Custom/SCalSounds/BrimstoneBigShoot"); // DON'T YOU WANNA BE A [BIG SHOT] public static readonly SoundStyle DashSound = new("CalamityMod/Sounds/Custom/SCalSounds/SCalDash"); public static readonly SoundStyle HellblastSound = new("CalamityMod/Sounds/Custom/SCalSounds/BrimstoneHellblastSound"); @@ -254,8 +254,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas } public static int DartDamage = 85; // 340 + public static int SkullDamage = 90; // 360 public static int HellblastDamage = 100; // 400 - public static int SkullDamage = 100; // 400 public static int FireblastDamage = 100; // 400 public static int GigablastDamage = 110; // 440 @@ -455,8 +455,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Used for Scal's teleport at the start of brothers phase bool teleport = false; - // permafrost and zenith scal are mutually exclusive unless it's legendary - bool zenithAI = Main.zenithWorld && (!permafrost || (CalamityWorld.LegendaryMode && permafrost)); + // permafrost and zenith scal are mutually exclusive + bool zenithAI = Main.zenithWorld && !permafrost; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -472,7 +472,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas int bodyHeight = 42; int baseBulletHellProjectileGateValue = revenge ? 8 : expertMode ? 9 : 10; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) baseBulletHellProjectileGateValue -= 2; Vector2 vectorCenter = NPC.Center; @@ -1593,7 +1593,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { int buffID = NPC.buffType[l]; - bool shouldHalveDuration = DebuffsList.Includes(buffID); + bool shouldHalveDuration = CalamityBuffSets.IsDebuff[buffID]; if (shouldHalveDuration && NPC.buffTime[l] > 4) NPC.buffTime[l] = 4; @@ -1952,9 +1952,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas else { SoundEngine.PlaySound(SoundID.Item74, NPC.Center); - int totalSeekers = CalamityWorld.LegendaryMode ? 20 : 10; + int totalSeekers = Main.getGoodWorld ? 20 : 10; int degreesBetweenEachSeeker = 360 / totalSeekers; - int distanceFromSCal = CalamityWorld.LegendaryMode ? 300 : 225; + int distanceFromSCal = Main.getGoodWorld ? 300 : 225; for (int i = 0; i < totalSeekers; i++) { int FireEye = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(vectorCenter.X + (Math.Sin(i * degreesBetweenEachSeeker) * distanceFromSCal)), (int)(vectorCenter.Y + (Math.Cos(i * degreesBetweenEachSeeker) * distanceFromSCal)), ModContent.NPCType(), NPC.whoAmI, 0, 0, 0, -1); @@ -2165,7 +2165,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 12f; float acceleration = 0.12f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.15f; acceleration *= 1.15f; @@ -2279,7 +2279,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float chargeVelocity = (wormAlive ? 26f : 30f) + (1f - lifeRatio) * 8f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeVelocity *= 1.15f; if (!canDespawn) @@ -2381,7 +2381,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 32f; float acceleration = 1.2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.15f; acceleration *= 1.15f; @@ -2460,7 +2460,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 32f; float acceleration = 1.2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.15f; acceleration *= 1.15f; @@ -2732,7 +2732,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 12f; float acceleration = 0.12f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.15f; acceleration *= 1.15f; @@ -2841,7 +2841,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float chargeVelocity = (wormAlive ? 26f : 30f) + (1f - lifeRatio) * 8f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeVelocity *= 1.15f; if (!canDespawn) @@ -2915,7 +2915,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 32f; float acceleration = 1.2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.15f; acceleration *= 1.15f; @@ -2999,7 +2999,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 32f; float acceleration = 1.2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.15f; acceleration *= 1.15f; diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index a4988ae9d6..dc946029a9 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -74,7 +74,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - public static int FistDamage = 110; // 440 + public static int FistDamage = 105; // 420 public override void SetDefaults() { diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index e4d2c7feb6..a86a36d1ec 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -67,7 +67,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - public static int SlashDamage = 110; // 440 + public static int SlashDamage = 105; // 420 + public static int TrailedSlashDamage = 120; // 480 public override void SetDefaults() { @@ -272,7 +273,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas dashAttackTimer--; int type = ModContent.ProjectileType(); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, NPC.velocity.SafeNormalize(Vector2.UnitY) * 0.1f, type, SlashDamage, 0f, Main.myPlayer, 0f, SlashingFromRight.ToInt(), 4 + dashes); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, NPC.velocity.SafeNormalize(Vector2.UnitY) * 0.1f, type, TrailedSlashDamage, 0f, Main.myPlayer, 0f, SlashingFromRight.ToInt(), 4 + dashes); dashes++; if (dashes == 30 && broIsAlive == false) { @@ -302,8 +303,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas { SoundStyle slash = new("CalamityMod/Sounds/Item/MurasamaBigSwing"); SoundEngine.PlaySound(slash with { Volume = 0.55f, Pitch = -0.3f }, NPC.Center); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + NPC.DirectionTo(Target.Center).RotatedBy(0.34f) * 130, NPC.DirectionTo(Target.Center).RotatedBy(0.34f) * 90f, type, SlashDamage, 0f, Main.myPlayer, 0f, 0, 50); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + NPC.DirectionTo(Target.Center).RotatedBy(-0.34f) * 130, NPC.DirectionTo(Target.Center).RotatedBy(-0.34f) * 90f, type, SlashDamage, 0f, Main.myPlayer, 0f, 0, 50); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + NPC.DirectionTo(Target.Center).RotatedBy(0.34f) * 130, NPC.DirectionTo(Target.Center).RotatedBy(0.34f) * 90f, type, TrailedSlashDamage, 0f, Main.myPlayer, 0f, 0, 50); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + NPC.DirectionTo(Target.Center).RotatedBy(-0.34f) * 130, NPC.DirectionTo(Target.Center).RotatedBy(-0.34f) * 90f, type, TrailedSlashDamage, 0f, Main.myPlayer, 0f, 0, 50); for (int i = 0; i < 30; i++) { Vector2 vel = new Vector2(7, 7).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 2.5f); @@ -450,6 +451,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas if ((broIsAlive == false ? BigAttackLimit <= 3 && BigAttackLimit > 0 : BigAttackLimit == 1) && death) { + if (!Main.zenithWorld) + damage = TrailedSlashDamage; + Projectile.NewProjectile(NPC.GetSource_FromAI(), slashSpawnPosition + firingVelocity * 130, (Phase2 ? NPC.DirectionTo(Target.Center) : firingVelocity) * 90f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 5, 50); SoundStyle slash = new("CalamityMod/Sounds/Item/MurasamaBigSwing"); SoundEngine.PlaySound(slash with { Volume = 0.55f, Pitch = -0.3f - BigAttackLimit * 0.1f }, NPC.Center); diff --git a/NPCs/TownNPCs/AndroombaFriendly.cs b/NPCs/TownNPCs/AndroombaFriendly.cs index 0a62a3a2f0..0ce196767d 100644 --- a/NPCs/TownNPCs/AndroombaFriendly.cs +++ b/NPCs/TownNPCs/AndroombaFriendly.cs @@ -65,6 +65,8 @@ namespace CalamityMod.NPCs.TownNPCs NPC.catchItem = (short)ModContent.ItemType(); SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; NPC.dontTakeDamage = true; + NPC.Calamity().VulnerableToSickness = false; + NPC.Calamity().VulnerableToElectricity = true; } public override bool CanChat() => false; diff --git a/NPCs/TownNPCs/Archmage.cs b/NPCs/TownNPCs/Archmage.cs index 9d51ae5deb..9e3e4458ef 100644 --- a/NPCs/TownNPCs/Archmage.cs +++ b/NPCs/TownNPCs/Archmage.cs @@ -65,6 +65,9 @@ namespace CalamityMod.NPCs.TownNPCs NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.8f; AnimationType = NPCID.Guide; + NPC.Calamity().VulnerableToCold = false; + NPC.Calamity().VulnerableToHeat = true; + NPC.Calamity().VulnerableToSickness = true; } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -152,24 +155,24 @@ namespace CalamityMod.NPCs.TownNPCs public override void AddShops() { NPCShop shop = new(Type); - shop.Add(ModContent.ItemType()) - .Add(ModContent.ItemType()) - .Add(ModContent.ItemType()) - .Add(ModContent.ItemType(), Condition.DownedMechBossAll) - .Add(ModContent.ItemType(), Condition.DownedMechBossAll) - .Add(ModContent.ItemType(), Condition.DownedMechBossAll) - .Add(ModContent.ItemType(), Condition.DownedMechBossAll) - .Add(ModContent.ItemType(), Condition.DownedEverscream, Condition.DownedSantaNK1, Condition.DownedIceQueen) - .Add(ModContent.ItemType(), Condition.DownedEverscream, Condition.DownedSantaNK1, Condition.DownedIceQueen) - .Add(ModContent.ItemType(), Condition.DownedEverscream, Condition.DownedSantaNK1, Condition.DownedIceQueen) - .Add(ModContent.ItemType(), Condition.DownedEverscream, Condition.DownedSantaNK1, Condition.DownedIceQueen) - .Add(ModContent.ItemType(), Condition.DownedEverscream, Condition.DownedSantaNK1, Condition.DownedIceQueen) - .Add(ModContent.ItemType()) + shop.Add() + .Add() + .Add() + .Add(Condition.DownedMechBossAll) + .Add(Condition.DownedMechBossAll) + .Add(Condition.DownedMechBossAll) + .Add(Condition.DownedMechBossAll) + .Add(Condition.DownedEverscream, Condition.DownedSantaNK1, Condition.DownedIceQueen) + .Add(Condition.DownedEverscream, Condition.DownedSantaNK1, Condition.DownedIceQueen) + .Add(Condition.DownedEverscream, Condition.DownedSantaNK1, Condition.DownedIceQueen) + .Add(Condition.DownedEverscream, Condition.DownedSantaNK1, Condition.DownedIceQueen) + .Add(Condition.DownedEverscream, Condition.DownedSantaNK1, Condition.DownedIceQueen) + .Add() .Add(ItemID.SuperManaPotion) - .Add(ModContent.ItemType()) - .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(5)) - .Add(ModContent.ItemType()) - .Add(ModContent.ItemType(), Condition.PlayerCarriesItem(ModContent.ItemType())) + .Add() + .Add() + .Add() + .Add(Condition.PlayerCarriesItem(ModContent.ItemType())) .Register(); } diff --git a/NPCs/TownNPCs/Bandit.cs b/NPCs/TownNPCs/Bandit.cs index b0eb9f89bf..c87c764726 100644 --- a/NPCs/TownNPCs/Bandit.cs +++ b/NPCs/TownNPCs/Bandit.cs @@ -70,6 +70,9 @@ namespace CalamityMod.NPCs.TownNPCs NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.5f; AnimationType = NPCID.PartyGirl; + NPC.Calamity().VulnerableToCold = true; + NPC.Calamity().VulnerableToHeat = true; + NPC.Calamity().VulnerableToSickness = true; } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -298,26 +301,23 @@ namespace CalamityMod.NPCs.TownNPCs } public override void AddShops() { - Condition downedCalclone = CalamityConditions.DownedCalamitasClone; - Condition downedDoG = CalamityConditions.DownedDevourerOfGods; - Condition downedYharon = CalamityConditions.DownedYharon; NPCShop shop = new(Type); - shop.AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 9)) - .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 9)) - .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 40)) - .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 40)) + shop.Add() + .Add() + .Add() + .Add() .Add(ItemID.TigerClimbingGear) - .Add(ModContent.ItemType(), Condition.DownedPirates) - .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 60), Condition.DownedMechBossAll) - .Add(ModContent.ItemType(), downedCalclone) - .Add(ModContent.ItemType(), Condition.DownedPlantera) - .Add(ModContent.ItemType(), Condition.DownedPlantera) - .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(1), Condition.DownedGolem) - .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(2), Condition.DownedMoonLord) - .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(25), downedDoG) - .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(40), downedYharon) - .Add(ModContent.ItemType()) //:BearWatchingYou: + .Add(Condition.DownedPirates) + .Add(Condition.DownedMechBossAll) + .Add(CalamityConditions.DownedCalamitasClone) + .Add(Condition.DownedPlantera) + .Add(Condition.DownedPlantera) + .Add(Condition.DownedGolem) + .Add(Condition.DownedMoonLord) + .Add(CalamityConditions.DownedDevourerOfGods) + .Add(CalamityConditions.DownedYharon) + .Add() //:BearWatchingYou: .Register(); } diff --git a/NPCs/TownNPCs/BrimstoneWitch.cs b/NPCs/TownNPCs/BrimstoneWitch.cs index 2657f75b43..e2ddf3ba9c 100644 --- a/NPCs/TownNPCs/BrimstoneWitch.cs +++ b/NPCs/TownNPCs/BrimstoneWitch.cs @@ -66,6 +66,9 @@ namespace CalamityMod.NPCs.TownNPCs NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath6; NPC.knockBackResist = 0.8f; + NPC.Calamity().VulnerableToHeat = false; + NPC.Calamity().VulnerableToCold = true; + NPC.Calamity().VulnerableToSickness = true; } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/TownNPCs/SeaKing.cs b/NPCs/TownNPCs/SeaKing.cs index 4ff9da3fd5..d7680a3acc 100644 --- a/NPCs/TownNPCs/SeaKing.cs +++ b/NPCs/TownNPCs/SeaKing.cs @@ -61,6 +61,10 @@ namespace CalamityMod.NPCs.TownNPCs NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.65f; AnimationType = NPCID.Guide; + NPC.Calamity().VulnerableToElectricity = true; + NPC.Calamity().VulnerableToHeat = false; + NPC.Calamity().VulnerableToSickness = true; + NPC.Calamity().VulnerableToWater = false; } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -194,18 +198,16 @@ namespace CalamityMod.NPCs.TownNPCs } public override void AddShops() { - Condition downedOldDuke = CalamityConditions.DownedOldDuke; - NPCShop shop = new(Type); - shop.Add(ModContent.ItemType()) - .Add(ModContent.ItemType()) - .Add(ModContent.ItemType()) - .Add(ModContent.ItemType()) - .Add(ModContent.ItemType()) - .Add(ModContent.ItemType()) - .Add(ModContent.ItemType()) - .AddWithCustomValue(ItemID.TruffleWorm, Item.buyPrice(gold: 20), Condition.Hardmode) - .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 40), downedOldDuke) + shop.Add() + .Add() + .Add() + .Add() + .Add() + .Add() + .Add() + .AddWithCustomValue(ItemID.TruffleWorm, Item.buyPrice(gold: 25), Condition.Hardmode) + .AddWithCustomValue(Item.buyPrice(platinum: 1), CalamityConditions.DownedOldDuke) .Register(); } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs index 8d979d3d03..bdbaee9557 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs @@ -86,7 +86,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phase 2 if (npc.ai[0] < 0f) { - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.brainOfGravity = npc.whoAmI; // Spawn gore @@ -216,7 +216,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float velocityScale = death ? 6f : 4.5f; float velocityBoost = velocityScale * (1f - lifeRatio); float nonChargeSpeed = (death ? 25.5f : 18f) + velocityBoost; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) nonChargeSpeed *= 1.15f; float minInertia = death ? 50f : 75f; @@ -270,7 +270,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Velocity npc.velocity = (Main.player[npc.target].Center + (death ? Main.player[npc.target].velocity * 10f : Vector2.Zero) - npc.Center).SafeNormalize(Vector2.UnitY) * chargeVelocity; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.velocity *= 1.15f; } } @@ -287,7 +287,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { SoundEngine.PlaySound(SoundID.ForceRoar, npc.Center); - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) { if (!Main.dedServ) { @@ -315,7 +315,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * -chargeVelocity; if (death) npc.velocity *= 1.5f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.velocity *= 1.15f; } } @@ -705,7 +705,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float targetYDistPhase1 = Main.player[npc.target].Center.Y - brainCenterPhase1.Y; float targetDistancePhase1 = (float)Math.Sqrt(targetXDistPhase1 * targetXDistPhase1 + targetYDistPhase1 * targetYDistPhase1); float maxMoveVelocity = (death ? 4f : 1.5f) + velocityScale; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) maxMoveVelocity *= 2f; if (targetDistancePhase1 < maxMoveVelocity) @@ -959,7 +959,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 destination = Main.player[npc.target].Center + (death ? Main.player[npc.target].velocity * 20f : Vector2.Zero); Vector2 targetDirection = destination - npc.Center; targetDirection = targetDirection.SafeNormalize(Vector2.UnitY); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { targetDirection *= chargeVelocity + 6f; npc.velocity = (npc.velocity * 49f + targetDirection) / 50f; @@ -1013,7 +1013,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static int GetBrainOfCthuluCreepersCountRevDeath() { - return CalamityWorld.LegendaryMode ? 40 : (CalamityWorld.death || BossRushEvent.BossRushActive) ? 30 : 20; + return Main.getGoodWorld ? 40 : (CalamityWorld.death || BossRushEvent.BossRushActive) ? 30 : 20; } private static float GetCrimsonBossKnockBack(NPC npc, int numPlayers, float lifeScale, float baseKnockBackResist) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs index 404908d767..9c2853f6ba 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs @@ -76,7 +76,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int idleTime = phase8 ? 20 : phase7 ? 30 : phase3 ? 35 : 40; float timeToFinishRitual = phase8 ? 180f : phase7 ? 240f : phase5 ? 300f : 360f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { iceMistFireRate = 40; iceMistSpeed = 15f; @@ -1195,7 +1195,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses kill = true; if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalProjectiles = CalamityWorld.LegendaryMode ? 9 : (Main.npc[(int)npc.ai[0]].type == NPCID.CultistBoss && !phase3) ? 8 : death ? 5 : 4; + int totalProjectiles = Main.getGoodWorld ? 9 : (Main.npc[(int)npc.ai[0]].type == NPCID.CultistBoss && !phase3) ? 8 : death ? 5 : 4; float radians = MathHelper.TwoPi / totalProjectiles; Vector2 spinningPoint = new Vector2(0f, -splitProjVelocity); for (int k = 0; k < totalProjectiles; k++) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs index 5bb3ee3d51..78436ec1da 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs @@ -175,7 +175,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Total segment variable - int totalSegments = CalamityWorld.LegendaryMode ? 100 : 80; + int totalSegments = Main.getGoodWorld ? 100 : 80; // Calculate aggression based on how many broken segments there are float brokenSegmentAggressionMultiplier = 1f; @@ -229,7 +229,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses speed *= brokenSegmentAggressionMultiplier; turnSpeed *= brokenSegmentAggressionMultiplier; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { segmentVelocity *= 1.2f; speed *= 1.2f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs index a717274bf3..a6c99486c7 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs @@ -61,7 +61,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses idlePhaseVelocity = 10f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { idlePhaseAcceleration *= 1.15f; idlePhaseVelocity *= 1.15f; @@ -89,7 +89,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeVelocity *= 1.13f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeVelocity *= 1.15f; int bubbleBelchPhaseTimer = death ? 60 : 80; @@ -97,7 +97,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float bubbleBelchPhaseAcceleration = death ? 0.35f : 0.3f; float bubbleBelchPhaseVelocity = death ? 5.5f : 5f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { bubbleBelchPhaseAcceleration *= 1.5f; bubbleBelchPhaseVelocity *= 1.5f; @@ -115,7 +115,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float bubbleSpinPhaseVelocity = 20f; float bubbleSpinPhaseRotation = MathHelper.TwoPi / (bubbleSpinPhaseTimer / 2); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) bubbleSpinBubbleVelocity *= 1.5f; int spawnEffectPhaseTimer = 75; @@ -188,11 +188,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeVelocity += 3f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeTime += Main.rand.Next(5, 66); // Spawn cthulhunadoes in phase 3 - if (phase3AI && ((!phase4 && !deathModeSurprise) || CalamityWorld.LegendaryMode)) + if (phase3AI && ((!phase4 && !deathModeSurprise) || Main.getGoodWorld)) { calamityGlobalNPC.newAI[0] += 1f; float timeGateValue = 600f; @@ -341,7 +341,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phase switch npc.ai[2] += 1f; - if (npc.ai[2] >= idlePhaseTimer || CalamityWorld.LegendaryMode) + if (npc.ai[2] >= idlePhaseTimer || Main.zenithWorld) { int attackPicker = 0; switch ((int)npc.ai[3]) @@ -589,7 +589,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phase switch npc.ai[2] += 1f; - if (npc.ai[2] >= idlePhaseTimer || CalamityWorld.LegendaryMode) + if (npc.ai[2] >= idlePhaseTimer || Main.zenithWorld) { int phase2AttackPicker = 0; switch ((int)npc.ai[3]) @@ -730,7 +730,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 phase2BubbleSharkronDirection = Vector2.Normalize(npc.velocity) * (npc.width + 20) / 2f + npc.Center; int phase2Bubbles = NPC.NewNPC(npc.GetSource_FromAI(), (int)phase2BubbleSharkronDirection.X, (int)phase2BubbleSharkronDirection.Y + 45, NPCID.DetonatingBubble); Main.npc[phase2Bubbles].target = npc.target; - Main.npc[phase2Bubbles].velocity = Vector2.Normalize(npc.velocity).RotatedBy(MathHelper.PiOver2 * npc.direction) * bubbleSpinBubbleVelocity * (CalamityWorld.LegendaryMode ? (Main.rand.NextFloat() + 0.5f) : 1f); + Main.npc[phase2Bubbles].velocity = Vector2.Normalize(npc.velocity).RotatedBy(MathHelper.PiOver2 * npc.direction) * bubbleSpinBubbleVelocity * (Main.getGoodWorld ? (Main.rand.NextFloat() + 0.5f) : 1f); Main.npc[phase2Bubbles].netUpdate = true; Main.npc[phase2Bubbles].ai[3] = Main.rand.Next(80, 121) / 100f; @@ -861,7 +861,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phase switch npc.ai[2] += 1f; - if (npc.ai[2] >= idlePhaseTimer || CalamityWorld.LegendaryMode) + if (npc.ai[2] >= idlePhaseTimer || Main.zenithWorld) { int phase3AttackPicker = 0; if (phase4) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs index f2d3702a09..33bf322ade 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs @@ -27,13 +27,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Causes it to split far more in death mode - if ((((npc.ai[2] % 2f == 0f && npc.type == NPCID.EaterofWorldsBody) || npc.type == NPCID.EaterofWorldsHead) && death) || CalamityWorld.LegendaryMode) + if ((((npc.ai[2] % 2f == 0f && npc.type == NPCID.EaterofWorldsBody) || npc.type == NPCID.EaterofWorldsHead) && death) || Main.getGoodWorld) { calamityGlobalNPC.DR = 0.5f; npc.defense = npc.defDefense * 2; } - if (CalamityWorld.LegendaryMode && npc.type == NPCID.EaterofWorldsHead) + if (Main.getGoodWorld && npc.type == NPCID.EaterofWorldsHead) npc.reflectsProjectiles = true; // Get a target @@ -76,7 +76,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.localAI[1] -= 1f; int vileSpitGateValue = (int)MathHelper.Lerp(death ? 45f : 90f, 900f, lifeRatio); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) vileSpitGateValue = (int)(vileSpitGateValue * 0.5f); Vector2 vileSpitShootLocation = npc.Center + npc.velocity; @@ -378,7 +378,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses segmentAcceleration += (npc.justHit ? 0.16f : 0.04f); } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { segmentVelocity += 4f; segmentAcceleration += 0.05f; @@ -415,7 +415,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int npcWidth = npc.width; npcWidth = (int)(npcWidth * npc.scale); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npcWidth = 62; targetDistance = (targetDistance - npcWidth) / targetDistance; @@ -707,7 +707,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static int GetEaterOfWorldsSegmentsCountRevDeath() { - return CalamityWorld.LegendaryMode ? 100 : (CalamityWorld.death || BossRushEvent.BossRushActive) ? 57 : 62; + return Main.getGoodWorld ? 100 : (CalamityWorld.death || BossRushEvent.BossRushActive) ? 57 : 62; } } } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs index b4672ca23f..5a5ab61042 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs @@ -96,7 +96,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool visible = true; bool takeDamage = true; float lessTimeSpentPerPhaseMultiplier = phase2 ? (death ? 0.375f : 0.5f) : (death ? 0.75f : 1f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) lessTimeSpentPerPhaseMultiplier *= 0.2f; float extraPhaseTime; @@ -174,7 +174,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.damage = 0; float idleTimer = phase2 ? (death ? 10f : 15f) : (death ? 20f : 30f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) idleTimer *= 0.5f; if (idleTimer < 10f) idleTimer = 10f; @@ -422,7 +422,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] < 60f) AI_120_HallowBoss_DoMagicEffect(npc.Center + randomStreakOffset, 1, Utils.GetLerpValue(0f, 60f, npc.ai[1], clamped: true), npc); - int streakSpawnFrequency = CalamityWorld.LegendaryMode ? 1 : 2; + int streakSpawnFrequency = Main.getGoodWorld ? 1 : 2; if (phase3) streakSpawnFrequency *= 2; @@ -441,21 +441,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + randomStreakOffset, rainbowStreakVelocity, projectileType, projectileDamage, 0f, Main.myPlayer, npc.target, ai3); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + randomStreakOffset, rainbowStreakVelocity, projectileType, projectileDamage, 0f, Main.myPlayer, npc.target, ai3); if (phase3) { - int proj2 = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + randomStreakOffset, -rainbowStreakVelocity, projectileType, projectileDamage, 0f, Main.myPlayer, npc.target, 1f - ai3); - if (Main.rand.NextBool(60) && CalamityWorld.LegendaryMode) - { - Main.projectile[proj2].extraUpdates += 1; - Main.projectile[proj2].netUpdate = true; - } - } - - if (Main.rand.NextBool(60) && CalamityWorld.LegendaryMode) - { - Main.projectile[proj].extraUpdates += 1; - Main.projectile[proj].netUpdate = true; + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + randomStreakOffset, -rainbowStreakVelocity, projectileType, projectileDamage, 0f, Main.myPlayer, npc.target, 1f - ai3); } } @@ -637,7 +626,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] % 42f == 0f && npc.ai[1] < 42f) { float projRotation = MathHelper.TwoPi * Main.rand.NextFloat(); - float totalProjectiles = CalamityWorld.LegendaryMode ? 30f : death ? (dayTimeEnrage ? 22f : 15f) : (dayTimeEnrage ? 18f : 13f); + float totalProjectiles = Main.getGoodWorld ? 30f : death ? (dayTimeEnrage ? 22f : 15f) : (dayTimeEnrage ? 18f : 13f); int projIndex = 0; bool inversePhase2SpreadPattern = Main.rand.NextBool(); for (float i = 0f; i < 1f; i += 1f / totalProjectiles) @@ -653,7 +642,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float initialVelocity = death ? 2f : 1.75f; if (dayTimeEnrage && projIndex % 2 == 0) initialVelocity *= 2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) initialVelocity *= 1.5f; // Given that maxAddedVelocity = 2 @@ -935,11 +924,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, rainbowStreakVelocity, projectileType, projectileDamage, 0f, Main.myPlayer, npc.target, ai3); - if (Main.rand.NextBool(30) && CalamityWorld.LegendaryMode) - { + if (Main.getGoodWorld) Main.projectile[proj].extraUpdates += 1; - Main.projectile[proj].netUpdate = true; - } } // Spawn extra homing Rainbow Streaks per player. @@ -1171,22 +1157,16 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 vector = new Vector2(0f, (death ? -24f : -22f) - (phase3 ? ((death ? 6f : 4f) * streakHomeTime) : 0f)).RotatedBy(MathHelper.TwoPi * streakHomeTime); if (Main.netMode != NetmodeID.MultiplayerClient) { - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projRandomOffset, vector, projectileType, projectileDamage, 0f, Main.myPlayer, npc.target, streakHomeTime); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projRandomOffset, vector, projectileType, projectileDamage, 0f, Main.myPlayer, npc.target, streakHomeTime); if (phase3) { int proj2 = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projRandomOffset, -vector, projectileType, projectileDamage, 0f, Main.myPlayer, npc.target, 1f - streakHomeTime); - if (Main.rand.NextBool(15) && CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { Main.projectile[proj2].extraUpdates += 1; Main.projectile[proj2].netUpdate = true; } } - - if (Main.rand.NextBool(15) && CalamityWorld.LegendaryMode) - { - Main.projectile[proj].extraUpdates += 1; - Main.projectile[proj].netUpdate = true; - } } // Spawn extra homing Rainbow Streaks per player. diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs index d948eacfd0..ca92584f6e 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs @@ -130,7 +130,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float hoverSpeed = death ? 9.5f + 7f * (1f - lifeRatio) : 7f; float hoverAcceleration = death ? 0.2f + 0.15f * (1f - lifeRatio) : 0.15f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { hoverSpeed += 3f; hoverAcceleration += 0.08f; @@ -159,7 +159,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[3] += 1f; float servantSpawnGateValue = death ? 10f : 40f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) servantSpawnGateValue *= 0.8f; if (npc.ai[3] >= servantSpawnGateValue && shootProjectile) @@ -207,7 +207,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float chargeSpeed = (death ? 10.5f : 8f) + npc.ai[3] * additionalVelocityPerCharge; if (death) chargeSpeed += 10f * (1f - lifeRatio); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeSpeed += 4f; npc.velocity = npc.SafeDirectionTo(Main.player[npc.target].Center) * chargeSpeed; @@ -218,7 +218,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[1] == 2f) { int chargeDelay = death ? (75 - (int)Math.Round(30f * (1f - lifeRatio))) : 95; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeDelay -= 30; float slowDownGateValue = chargeDelay * (death ? 0.85f : 0.65f); @@ -231,7 +231,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses decelerationScalar = 0f; npc.velocity *= (MathHelper.Lerp(death ? 0.76f : 0.92f, death ? 0.88f : 0.96f, decelerationScalar)); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.velocity *= 0.99f; if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1) @@ -273,7 +273,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[0] == 1f || npc.ai[0] == 2f) { - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.reflectsProjectiles = true; if (npc.ai[0] == 1f) @@ -292,13 +292,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation += npc.ai[2]; float phaseChangeRate = death ? 2f : 1f; - float servantSpawnGateValue = CalamityWorld.LegendaryMode ? 4f : 20f; + float servantSpawnGateValue = Main.getGoodWorld ? 4f : 20f; npc.ai[1] += phaseChangeRate; if (npc.ai[1] % servantSpawnGateValue == 0f) { float servantVelocity = death ? 11.3f : 5.65f; Vector2 servantSpawnVelocity = Main.rand.NextVector2CircularEdge(servantVelocity, servantVelocity); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) servantSpawnVelocity *= 3f; Vector2 servantSpawnCenter = npc.Center + servantSpawnVelocity.SafeNormalize(Vector2.UnitY) * ProjectileOffset; @@ -310,21 +310,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.dedServ && servantSpawn < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, servantSpawn); - - if (CalamityWorld.LegendaryMode) - { - int type = ProjectileID.BloodNautilusShot; - Vector2 projectileVelocity = Main.rand.NextVector2CircularEdge(15f, 15f); - int numProj = 3; - int spread = 20; - float rotation = MathHelper.ToRadians(spread); - for (int i = 0; i < numProj; i++) - { - Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * ProjectileOffset, perturbedSpeed, type, 15, 0f, Main.myPlayer); - Main.projectile[proj].timeLeft = 600; - } - } } for (int n = 0; n < 10; n++) @@ -402,7 +387,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { hoverSpeed += 1f; hoverAcceleration += 0.1f; @@ -458,7 +443,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeSpeed *= 1.15f; if (npc.ai[3] == 2f) chargeSpeed *= 1.3f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeSpeed *= 1.2f; npc.velocity = npc.SafeDirectionTo(Main.player[npc.target].Center) * chargeSpeed; @@ -688,14 +673,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.dedServ && eye < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, eye); } - else if (!CalamityWorld.LegendaryMode) + else if (!Main.getGoodWorld) { int projType = ProjectileID.BloodNautilusShot; int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + servantSpawnVelocity.SafeNormalize(Vector2.UnitY) * ProjectileOffset, servantSpawnVelocity * 2f, projType, BloodShotDamage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 600; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { int type = ProjectileID.BloodNautilusShot; Vector2 projectileVelocity = servantSpawnVelocity * 3f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs index 5d04005446..fcbbdc7270 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs @@ -1,5 +1,7 @@ using System; using CalamityMod.Events; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; @@ -62,12 +64,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = CalamityWorld.LegendaryMode; + turboEnrage = Main.getGoodWorld; } else - turboEnrage = CalamityWorld.LegendaryMode; + turboEnrage = Main.getGoodWorld; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) enrage = true; npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && (enrage || turboEnrage); @@ -88,16 +90,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool headAlive = NPC.AnyNPCs(NPCID.GolemHead); bool leftFistAlive = NPC.AnyNPCs(NPCID.GolemFistLeft); bool rightFistAlive = NPC.AnyNPCs(NPCID.GolemFistRight); - npc.dontTakeDamage = (headAlive || leftFistAlive || rightFistAlive) && !CalamityWorld.LegendaryMode; - - // Phase 2, check for free head - bool freeHeadAlive = NPC.AnyNPCs(NPCID.GolemHeadFree); + npc.dontTakeDamage = headAlive || leftFistAlive || rightFistAlive; // Distance required for despawning int despawnDistance = turboEnrage ? 7500 : enrage ? 6000 : 4500; // Deactivate torches - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode && npc.velocity.Y > 0f) + if (Main.netMode != NetmodeID.MultiplayerClient && Main.getGoodWorld && npc.velocity.Y > 0f) { for (int j = (int)(npc.position.X / 16f); (float)j < (npc.position.X + (float)npc.width) / 16f; j++) { @@ -114,7 +113,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Spawn arm dust - if (!CalamityWorld.LegendaryMode) + if (!Main.getGoodWorld) { if (!leftFistAlive) { @@ -176,49 +175,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Avoid cheap bullshit npc.damage = 0; - // Laser fire when head is dead - if (Main.netMode != NetmodeID.MultiplayerClient && (!headAlive || turboEnrage || CalamityWorld.LegendaryMode) && npc.ai[2] == 0f) - { - npc.localAI[1] += 1f; - - float divisor = 15f - - (phase2 ? 4f : 0f) - - (phase3 ? 3f : 0f) - - (phase4 ? 2f : 0f); - - if (enrage) - divisor = 5f; - - if (turboEnrage && CalamityWorld.LegendaryMode) - divisor = 2f; - - Vector2 projectileFirePos = new Vector2(npc.Center.X, npc.Center.Y - 60f); - if (npc.localAI[1] % divisor == 0f && (Vector2.Distance(Main.player[npc.target].Center, projectileFirePos) > 160f || !freeHeadAlive)) - { - float laserSpeed = turboEnrage ? 16f : enrage ? 12f : 6f; - float laserTargetXDist = Main.player[npc.target].Center.X - projectileFirePos.X; - float laserTargetYDist = Main.player[npc.target].Center.Y - projectileFirePos.Y; - float laserTargetDistance = (float)Math.Sqrt(laserTargetXDist * laserTargetXDist + laserTargetYDist * laserTargetYDist); - - laserTargetDistance = laserSpeed / laserTargetDistance; - laserTargetXDist *= laserTargetDistance; - laserTargetYDist *= laserTargetDistance; - - Vector2 laserVelocity = new Vector2(laserTargetXDist, laserTargetYDist); - int type = ProjectileID.EyeBeam; - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int bodyLaser = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileFirePos + laserVelocity.SafeNormalize(Vector2.UnitY) * 40f, laserVelocity, type, LaserDamage, 0f, Main.myPlayer); - Main.projectile[bodyLaser].timeLeft = enrage ? 720 : 360; - if (turboEnrage && CalamityWorld.LegendaryMode) - Main.projectile[bodyLaser].extraUpdates += 1; - } - } - - if (npc.localAI[1] >= 15f) - npc.localAI[1] = 0f; - } - // Delay before jumping if (npc.ai[2] == 0f) { @@ -228,8 +184,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] > 0f) { - npc.ai[1] += (death ? 2f : 1f); - if (CalamityWorld.LegendaryMode) + npc.ai[1] += death ? 1.5f : 1f; + if (Main.getGoodWorld) npc.ai[1] += 100f; if (enrage || death) @@ -242,11 +198,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] += 6f; if (!rightFistAlive) npc.ai[1] += 6f; - if (!headAlive) - npc.ai[1] += 6f; } } - if (npc.ai[1] >= 300f) + bool canJump = (!headAlive || Main.npc[NPC.FindFirstNPC(NPCID.GolemHead)].ai[0] <= 1f) && (!NPC.AnyNPCs(NPCID.GolemHeadFree) || Main.npc[NPC.FindFirstNPC(NPCID.GolemHeadFree)].ai[0] != 3); + if (npc.ai[1] >= 300f && canJump) { npc.ai[1] = -20f; npc.frameCounter = 0D; @@ -260,164 +215,30 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = npc.defDamage; - if (death) + if (npc.ai[3] == 0f) + npc.ai[3] = (death ? !leftFistAlive && !rightFistAlive : !headAlive) ? Main.rand.Next(1, 2+1) : 1f; + + switch ((int)npc.ai[3]) { - float straightUpJumpHeight = 640f; - if (npc.ai[3] == 0f) - npc.ai[3] = (!headAlive && npc.Bottom.Y - straightUpJumpHeight > Main.player[npc.target].Top.Y) ? Main.rand.Next(3) + 1f : (!leftFistAlive && !rightFistAlive) ? Main.rand.Next(2) + 1f : 1f; + default: + case 0: + case 1: + NormalJump(canJump); + break; - switch ((int)npc.ai[3]) - { - default: - case 0: - case 1: - NormalJump(); - break; - - // Jump directly above the target's head and slam down - case 2: - - npc.noTileCollide = true; - - npc.ai[2] += 1f; - float jumpVelocity = 26f; - if (enrage) - jumpVelocity *= 1.25f; - if (turboEnrage) - jumpVelocity *= 1.25f; - - float minJumpTime = 15f; - float maxJumpTime = 45f; - if ((npc.ai[2] >= minJumpTime && Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) <= jumpVelocity) || npc.ai[2] >= maxJumpTime) - { - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 1f; - npc.velocity.Y = -3f; - npc.netUpdate = true; - } - - Vector2 center = npc.Center; - if (!Main.player[npc.target].dead && Main.player[npc.target].active && Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) <= despawnDistance) - center = Main.player[npc.target].Center; - - center.Y -= 480f; - if (npc.velocity.Y == 0f) - { - npc.velocity = center - npc.Center; - npc.velocity = npc.velocity.SafeNormalize(Vector2.Zero); - npc.velocity *= jumpVelocity; - - float distanceBelowTarget = npc.position.Y - (Main.player[npc.target].position.Y + 80f); - float speedMult = 1f; - - float multiplier = turboEnrage ? 0.0025f : enrage ? 0.002f : 0.0015f; - if (distanceBelowTarget > 0f && ((!leftFistAlive && !rightFistAlive) || turboEnrage || CalamityWorld.LegendaryMode)) - speedMult += distanceBelowTarget * multiplier; - - float speedMultLimit = turboEnrage ? 3.25f : enrage ? 3f : 2.5f; - if (speedMult > speedMultLimit) - speedMult = speedMultLimit; - - if (Main.player[npc.target].position.Y < npc.Bottom.Y) - npc.velocity.Y *= speedMult; - } - else - npc.velocity.Y *= 0.95f; - - break; - - // Jump straight up and create a wall of lasers on both sides - case 3: - - npc.velocity.Y = (((!freeHeadAlive && !headAlive) || turboEnrage || CalamityWorld.LegendaryMode) ? -15.1f : -12.1f) + (enrage ? -4f : 0f); - - npc.noTileCollide = true; - - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 2f; - - float jumpDuration = (float)Math.Floor(straightUpJumpHeight / Math.Abs(npc.velocity.Y)); - npc.ai[3] = jumpDuration; - - npc.netUpdate = true; - - break; - } - } - else - { - if (npc.ai[3] == 0f) - npc.ai[3] = !headAlive ? Main.rand.Next(2) + 1f : 1f; - - switch ((int)npc.ai[3]) - { - default: - case 0: - case 1: - NormalJump(); - break; - - // Jump directly above the target's head and slam down - case 2: - - npc.noTileCollide = true; - - npc.ai[2] += 1f; - float jumpVelocity = 21f; - if (enrage) - jumpVelocity *= 1.25f; - if (turboEnrage) - jumpVelocity *= 1.25f; - - float minJumpTime = 15f; - float maxJumpTime = 45f; - if ((npc.ai[2] >= minJumpTime && Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) <= jumpVelocity) || npc.ai[2] >= maxJumpTime) - { - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 1f; - npc.velocity.Y = -3f; - npc.netUpdate = true; - } - - Vector2 center = npc.Center; - if (!Main.player[npc.target].dead && Main.player[npc.target].active && Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) <= despawnDistance) - center = Main.player[npc.target].Center; - - center.Y -= 480f; - if (npc.velocity.Y == 0f) - { - npc.velocity = center - npc.Center; - npc.velocity = npc.velocity.SafeNormalize(Vector2.Zero); - npc.velocity *= jumpVelocity; - - float distanceBelowTarget = npc.position.Y - (Main.player[npc.target].position.Y + 80f); - float speedMult = 1f; - - float multiplier = turboEnrage ? 0.0025f : enrage ? 0.002f : 0.0015f; - if (distanceBelowTarget > 0f && ((!leftFistAlive && !rightFistAlive) || turboEnrage || CalamityWorld.LegendaryMode)) - speedMult += distanceBelowTarget * multiplier; - - float speedMultLimit = turboEnrage ? 3.25f : enrage ? 3f : 2.5f; - if (speedMult > speedMultLimit) - speedMult = speedMultLimit; - - if (Main.player[npc.target].position.Y < npc.Bottom.Y) - npc.velocity.Y *= speedMult; - } - else - npc.velocity.Y *= 0.95f; - - break; - } + // Jump directly above the target's head and slam down + case 2: + SlamJump(canJump); + break; } - void NormalJump() + void NormalJump(bool jump) { - float velocityBoost = death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio); - float velocityX = (death ? 9f : 6f) + velocityBoost; + if (!jump) + return; + + float velocityBoost = (death ? 5f : 3.8f) * (1f - (lifeRatio / 2)); + float velocityX = (death ? 6f : 4f) + velocityBoost; if (enrage) velocityX *= 1.5f; @@ -430,8 +251,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float distanceBelowTarget = npc.position.Y - (Main.player[npc.target].position.Y + 80f); float speedMult = 1f; - float multiplier = turboEnrage ? 0.0025f : enrage ? 0.002f : 0.0015f; - if (distanceBelowTarget > 0f && ((!leftFistAlive && !rightFistAlive) || turboEnrage || CalamityWorld.LegendaryMode)) + float multiplier = turboEnrage ? 0.00275f : enrage ? 0.0025f : 0.00175f; + if (distanceBelowTarget > 0f && ((!leftFistAlive && !rightFistAlive) || turboEnrage)) speedMult += distanceBelowTarget * multiplier; float speedMultLimit = turboEnrage ? 3.25f : enrage ? 3f : 2.5f; @@ -439,7 +260,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses speedMult = speedMultLimit; if (Main.player[npc.target].position.Y < npc.Bottom.Y) - npc.velocity.Y = ((((!freeHeadAlive && !headAlive) || turboEnrage || CalamityWorld.LegendaryMode) ? -15.1f : -12.1f) + (enrage ? -4f : 0f)) * speedMult; + npc.velocity.Y = ((turboEnrage ? -15.5f : -11.75f) + (enrage ? -4f : 0f)) * speedMult; else npc.velocity.Y = 1f; @@ -451,6 +272,60 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.netUpdate = true; npc.SyncExtraAI(); } + + void SlamJump(bool jump) + { + npc.noTileCollide = true; + + npc.ai[2] += 1f; + float jumpVelocity = death ? 26f : 21f; + if (enrage) + jumpVelocity *= 1.25f; + if (turboEnrage) + jumpVelocity *= 1.25f; + + float minJumpTime = 15f; + float maxJumpTime = 45f; + if ((npc.ai[2] >= minJumpTime && Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) <= jumpVelocity) || npc.ai[2] >= maxJumpTime || !jump) + { + npc.ai[0] = 1f; + npc.ai[1] = 0f; + npc.ai[2] = 1f; + npc.velocity.Y = -3f; + npc.netUpdate = true; + } + + if (!jump) + return; + + Vector2 center = npc.Center; + if (!Main.player[npc.target].dead && Main.player[npc.target].active && Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) <= despawnDistance) + center = Main.player[npc.target].Center; + + center.Y -= 480f; + if (npc.velocity.Y == 0f) + { + npc.velocity = center - npc.Center; + npc.velocity = npc.velocity.SafeNormalize(Vector2.Zero); + npc.velocity *= jumpVelocity; + + float distanceBelowTarget = npc.position.Y - (Main.player[npc.target].position.Y + 80f); + float speedMult = 1f; + + float multiplier = turboEnrage ? 0.0025f : enrage ? 0.002f : 0.0015f; + if (distanceBelowTarget > 0f && ((!leftFistAlive && !rightFistAlive) || turboEnrage)) + speedMult += distanceBelowTarget * multiplier; + + float speedMultLimit = turboEnrage ? 3.25f : enrage ? 3f : 2.5f; + if (speedMult > speedMultLimit) + speedMult = speedMultLimit; + + if (Main.player[npc.target].position.Y < npc.Bottom.Y) + npc.velocity.Y *= speedMult; + } + else + npc.velocity.Y *= 0.95f; + } } } @@ -494,7 +369,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Fireball explosion when head is detached - if (Main.netMode != NetmodeID.MultiplayerClient && (!headAlive || turboEnrage || CalamityWorld.LegendaryMode)) + if (Main.netMode != NetmodeID.MultiplayerClient && (!headAlive || turboEnrage)) { for (int i = 0; i < 10; i++) { @@ -528,7 +403,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses destination.Normalize(); destination *= projectileVelocity; int totalFireballsPerSide = 3; - int totalIterations = (turboEnrage && CalamityWorld.LegendaryMode) ? 11 : death ? 40 : 60; + int totalIterations = turboEnrage ? 11 : death ? 40 : 60; float rotation = MathHelper.ToRadians(90); for (int i = 0; i < totalIterations; i++) { @@ -537,8 +412,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(totalIterations - 1))); int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + Vector2.UnitY * (npc.height / 2 * 0.8f) * npc.scale + Vector2.Normalize(perturbedSpeed) * (npc.width / 3) * npc.scale, perturbedSpeed, type, damage, 0f, Main.myPlayer); - Main.projectile[proj].timeLeft = enrage ? 480 : 240; - if (turboEnrage && CalamityWorld.LegendaryMode) + Main.projectile[proj].timeLeft = enrage ? 480 : 150; // The difference is meant to be this stark. + if (turboEnrage) Main.projectile[proj].extraUpdates += 1; } } @@ -552,97 +427,55 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.damage = npc.defDamage; // Velocity when falling - if (npc.ai[2] == 2f) + if ((npc.position.X < Main.player[npc.target].position.X && npc.position.X + npc.width > Main.player[npc.target].position.X + Main.player[npc.target].width) || npc.ai[2] == 1f) { - // Do not collide with tiles while doing this crazy shit - npc.noTileCollide = true; + npc.velocity.X *= npc.ai[2] == 1f ? 0.5f : 0.8f; - float laserShootGateValue = death ? 6f : 9f; - if (npc.ai[3] % laserShootGateValue == 0f) + if (npc.Bottom.Y < Main.player[npc.target].position.Y || npc.ai[2] == 1f) { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - Vector2 fireFrom = new Vector2(npc.Center.X, npc.Center.Y - 60f); - int projectileAmt = 2; - int type = ProjectileID.EyeBeam; - int damage = LaserDamage; - Vector2 laserVelocity = Vector2.UnitY * npc.velocity.Y * (turboEnrage ? 2f : enrage ? 1f : 0.5f); - for (int i = 0; i < projectileAmt; i++) - { - int totalProjectiles = 2; - float radians = MathHelper.TwoPi / totalProjectiles; - for (int j = 0; j < totalProjectiles; j++) - { - Vector2 projVelocity = laserVelocity.RotatedBy(radians * j + MathHelper.PiOver2); - int bodyLaser = Projectile.NewProjectile(npc.GetSource_FromAI(), fireFrom, projVelocity, type, damage, 0f, Main.myPlayer); - Main.projectile[bodyLaser].timeLeft = enrage ? 720 : 360; - if (turboEnrage && CalamityWorld.LegendaryMode) - Main.projectile[bodyLaser].extraUpdates += 1; - } - } - } - } + float fallSpeedBoost = death ? 0.9f * (1f - (lifeRatio / 2)) : 0.75f * (1f - (lifeRatio / 2)); + float fallSpeed = (death ? 0.3f : 0.2f) + fallSpeedBoost; + if (enrage) + fallSpeed *= 2f; - npc.ai[3] -= 1f; - if (npc.ai[3] <= 0f) - { - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.ForceNetUpdate(); + npc.velocity.Y += fallSpeed; } } else { - if ((npc.position.X < Main.player[npc.target].position.X && npc.position.X + npc.width > Main.player[npc.target].position.X + Main.player[npc.target].width) || npc.ai[2] == 1f) - { - npc.velocity.X *= npc.ai[2] == 1f ? 0.5f : 0.8f; + float velocityChangeBoost = death ? 0.16f * (1f - (lifeRatio / 2)) : 0.12f * (1f - (lifeRatio / 2)); + float velocityXChange = (death ? 0.285f : 0.2f) + velocityChangeBoost; + if (npc.direction < 0) + npc.velocity.X -= velocityXChange; + else if (npc.direction > 0) + npc.velocity.X += velocityXChange; - if (npc.Bottom.Y < Main.player[npc.target].position.Y || npc.ai[2] == 1f) - { - float fallSpeedBoost = death ? 1.2f * (1f - lifeRatio) : 0.8f * (1f - lifeRatio); - float fallSpeed = (death ? 0.3f : 0.2f) + fallSpeedBoost; - if (enrage) - fallSpeed *= 2f; + float velocityBoost = death ? 5.75f * (1f - (lifeRatio / 2)) : 4f * (1f - (lifeRatio / 2)); + float velocityXCap = (death ? 6f : 4f) + velocityBoost; + if (enrage) + velocityXCap *= 3f; - npc.velocity.Y += fallSpeed; - } - } - else - { - float velocityChangeBoost = death ? 0.18f * (1f - lifeRatio) : 0.12f * (1f - lifeRatio); - float velocityXChange = (death ? 0.3f : 0.2f) + velocityChangeBoost; - if (npc.direction < 0) - npc.velocity.X -= velocityXChange; - else if (npc.direction > 0) - npc.velocity.X += velocityXChange; + float playerLocation = npc.Center.X - Main.player[npc.target].Center.X; + int directionRelativeToTarget = playerLocation < 0 ? 1 : -1; + bool slowDown = directionRelativeToTarget != calamityGlobalNPC.newAI[1]; - float velocityBoost = death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio); - float velocityXCap = (death ? 9f : 6f) + velocityBoost; - if (enrage) - velocityXCap *= 3f; + if (slowDown) + velocityXCap *= (enrage ? 0.2f : 0.5f); - float playerLocation = npc.Center.X - Main.player[npc.target].Center.X; - int directionRelativeToTarget = playerLocation < 0 ? 1 : -1; - bool slowDown = directionRelativeToTarget != calamityGlobalNPC.newAI[1]; - - if (slowDown) - velocityXCap *= (enrage ? 0.2f : 0.5f); - - if (npc.velocity.X < -velocityXCap) - npc.velocity.X = -velocityXCap; - if (npc.velocity.X > velocityXCap) - npc.velocity.X = velocityXCap; - } - - CustomGravity(npc.ai[2] == 1f); + if (npc.velocity.X < -velocityXCap) + npc.velocity.X = -velocityXCap; + if (npc.velocity.X > velocityXCap) + npc.velocity.X = velocityXCap; } + + CustomGravity(npc.ai[2] == 1f); } } void CustomGravity(bool isSlamming) { - float gravity = turboEnrage ? (CalamityWorld.LegendaryMode ? 1.15f : 0.85f) : enrage ? 0.75f : (!leftFistAlive && !rightFistAlive) ? 0.45f : 0.3f; - float maxFallSpeed = reduceFallSpeed ? 12f : turboEnrage ? (CalamityWorld.LegendaryMode ? 40f : 30f) : enrage ? 25f : (!leftFistAlive && !rightFistAlive) ? 15f : 10f; + float gravity = turboEnrage ? 0.85f : enrage ? 0.75f : (!leftFistAlive && !rightFistAlive) ? 0.45f : 0.3f; + float maxFallSpeed = reduceFallSpeed ? 12f : turboEnrage ? 30f : enrage ? 25f : (!leftFistAlive && !rightFistAlive) ? 15f : 10f; if (isSlamming && !reduceFallSpeed) { gravity *= 4f; @@ -712,15 +545,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = CalamityWorld.LegendaryMode; + turboEnrage = Main.getGoodWorld; } else - turboEnrage = CalamityWorld.LegendaryMode; + turboEnrage = Main.getGoodWorld; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) enrage = true; - float aggression = turboEnrage ? (CalamityWorld.LegendaryMode ? 4f : 3f) : enrage ? 2f : death ? 1.7f : 1f; + float aggression = turboEnrage ? 3f : enrage ? 2f : death ? 1.7f : 1f; Vector2 fistCenter = golem.Center + golem.velocity + new Vector2(0f, -9f * npc.scale); fistCenter.X += (float)((npc.type == NPCID.GolemFistLeft) ? -84 : 78) * npc.scale; @@ -802,7 +635,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Dust dust = Dust.NewDustPerfect(npc.Center + largeRandDustRecoil + largeRandDustRadius + smallRandDustRadius, 228, largeRandDustRecoil); dust.fadeIn = 1.5f; dust.scale = 0.5f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) dust.noLight = true; dust.noGravity = true; @@ -843,7 +676,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = npc.defDamage; - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode) + if (Main.netMode != NetmodeID.MultiplayerClient && Main.getGoodWorld) { for (int j = (int)(npc.position.X / 16f) - 1; (float)j < (npc.position.X + (float)npc.width) / 16f + 1f; j++) { @@ -987,10 +820,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Count body parts bool leftFistAlive = NPC.AnyNPCs(NPCID.GolemFistLeft); bool rightFistAlive = NPC.AnyNPCs(NPCID.GolemFistRight); - npc.dontTakeDamage = (leftFistAlive || rightFistAlive) && !CalamityWorld.LegendaryMode; + npc.dontTakeDamage = leftFistAlive || rightFistAlive; // Stay in position on top of body npc.Center = Main.npc[NPC.golemBoss].Center - new Vector2(3f, 57f) * npc.scale; + npc.velocity = Main.npc[NPC.golemBoss].velocity; // Enrage if the target isn't inside the temple bool enrage = !BossRushEvent.BossRushActive; @@ -1004,12 +838,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = CalamityWorld.LegendaryMode; + turboEnrage = Main.getGoodWorld; } else - turboEnrage = CalamityWorld.LegendaryMode; + turboEnrage = Main.getGoodWorld; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) enrage = true; // Alpha @@ -1077,10 +911,22 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else npc.localAI[1] = 0f; + // Timer for special laser attack + npc.ai[3]++; + if (npc.ai[3] >= 600f && Main.npc[NPC.golemBoss].velocity.Y == 0f && MathF.Abs(Main.npc[NPC.golemBoss].velocity.X) < 0.5f) + { + npc.ai[0] = 2f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + npc.localAI[1] = (Main.player[npc.target].Center.X > npc.Center.X).ToDirectionInt(); + npc.netUpdate = true; + } + // Fireballs npc.ai[1] += 1f; - float openMouthGateValue = 20f - (death ? 15f * (1f - lifeRatio) : 10f * (1f - lifeRatio)); - float shootFireballGateValue = 120f - (death ? 90f * (1f - lifeRatio) : 60f * (1f - lifeRatio)); + float openMouthGateValue = 20f - (death ? 15f * (1f - (lifeRatio / 2)) : 10f * (1f - (lifeRatio / 2))); + float shootFireballGateValue = 120f - (death ? 75f * (1f - (lifeRatio / 2)) : 50f * (1f - (lifeRatio / 2))); if (npc.ai[1] < openMouthGateValue || npc.ai[1] > shootFireballGateValue - openMouthGateValue) npc.localAI[0] = 1f; else @@ -1102,19 +948,19 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int type = ProjectileID.Fireball; int damage = FireballDamage; - int fireballAmount = death ? 3 : 1; + int fireballAmount = death ? 2 : 1; Vector2 fireballVelocity = new Vector2(fireballFistsDedTargetX, fireballFistsDedTargetY); for (int i = 0; i < fireballAmount; i++) { int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileFirePos, fireballVelocity * (1f / (i + 1)), type, damage, 0f, Main.myPlayer); - Main.projectile[proj].timeLeft = 450; + Main.projectile[proj].timeLeft = 225; } npc.netUpdate = true; } // Lasers - float shootBoost2 = death ? 5f * (1f - lifeRatio) : 3f * (1f - lifeRatio); + float shootBoost2 = death ? 4.5f * (1f - (lifeRatio / 2)) : 2.75f * (1f - (lifeRatio / 2)); npc.ai[2] += 1f + shootBoost2; if (enrage) npc.ai[2] += 4f; @@ -1150,7 +996,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { int bodyLaser = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileFirePos + laserVelocity.SafeNormalize(Vector2.UnitY) * 40f, laserVelocity, projType, dmg, 0f, Main.myPlayer); Main.projectile[bodyLaser].timeLeft = enrage ? 600 : 300; - if (turboEnrage && CalamityWorld.LegendaryMode) + if (turboEnrage) Main.projectile[bodyLaser].extraUpdates += 1; npc.netUpdate = true; @@ -1179,7 +1025,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { int extraLasers = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileFirePos + laserVelocity.SafeNormalize(Vector2.UnitY) * 40f, laserVelocity, projType, dmg, 0f, Main.myPlayer); Main.projectile[extraLasers].timeLeft = enrage ? 600 : 300; - if (turboEnrage && CalamityWorld.LegendaryMode) + if (turboEnrage) Main.projectile[extraLasers].extraUpdates += 1; npc.netUpdate = true; @@ -1188,13 +1034,63 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - // Laser fire if arms are dead - if ((!leftFistAlive && !rightFistAlive) || death || CalamityWorld.LegendaryMode) + // Special laser spread attack + else if (npc.ai[0] == 2f || npc.ai[0] == 3f) { - npc.ai[0] = 1f; - return false; + int telegraphTime = 60; + int endTime = 120; + Vector2 spawnLocation = new Vector2(npc.Center.X + (30f * npc.scale * npc.localAI[1]), npc.Center.Y - 22f * npc.scale); + if (npc.ai[1] == 1f) + { + SparkleParticle eyeTele = new(spawnLocation, Vector2.Zero, Color.Yellow, Color.White, 1.25f * npc.scale, telegraphTime, MathHelper.Pi * 0.02f, needed: true); + GeneralParticleHandler.SpawnParticle(eyeTele); + } + + npc.ai[1]++; + if (npc.ai[1] >= telegraphTime && npc.ai[1] < endTime && npc.ai[1] % 2f == 0f) + { + // Manually plays the sound at a slower rate (the sound from the lasers is disabled by setting ai[1]) + if (npc.ai[1] % 10f == 0f) + SoundEngine.PlaySound(SoundID.Item33, spawnLocation); + + float laserFireAngle = MathHelper.ToRadians((npc.ai[1] - telegraphTime + 20) * (death ? 2.45f : 2f)); + Vector2 laserVelocity = Vector2.UnitY.RotatedBy(laserFireAngle * -npc.localAI[1]) * (death ? 15f : 12f); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int extraLasers = Projectile.NewProjectile(npc.GetSource_FromAI(), spawnLocation + laserVelocity.SafeNormalize(Vector2.UnitY) * 40f, laserVelocity, ProjectileID.EyeBeam, LaserDamage, 0f, Main.myPlayer, 0f, 1f); + Main.projectile[extraLasers].timeLeft = enrage ? 600 : 300; + if (turboEnrage) + Main.projectile[extraLasers].extraUpdates += 1; + + npc.netUpdate = true; + } + } + + // Do another attack in the opposite direction in Death Mode + if (death && npc.ai[0] == 2f && npc.ai[1] >= endTime) + { + npc.ai[0] = 3f; + npc.ai[1] = 0f; + npc.localAI[1] = -npc.localAI[1]; + npc.netUpdate = true; + } + + if (npc.ai[1] >= endTime + 30) + { + npc.ai[0] = 1f; + npc.ai[1] = 0f; + npc.netUpdate = true; + } } - npc.ai[0] = 0f; + + // Laser fire if arms are dead + if ((!leftFistAlive && !rightFistAlive) || death || Main.getGoodWorld) + { + if (npc.ai[0] <= 1f) + npc.ai[0] = 1f; + } + else + npc.ai[0] = 0f; return false; } @@ -1215,10 +1111,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Die if body is gone if (NPC.golemBoss < 0) { - calamityGlobalNPC.DR = 0.25f; - calamityGlobalNPC.unbreakableDR = false; - calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = false; - if (Main.netMode != NetmodeID.MultiplayerClient) npc.StrikeInstantKill(); @@ -1226,14 +1118,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Percent life remaining - float lifeRatio = npc.life / (float)npc.lifeMax; float golemLifeRatio = Main.npc[NPC.golemBoss].life / (float)Main.npc[NPC.golemBoss].lifeMax; + float PosDelay = 270f; // Phases bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool phase2 = lifeRatio < 0.7f || golemLifeRatio < 0.85f || death; - bool phase3 = lifeRatio < 0.55f || golemLifeRatio < 0.7f || death; - bool phase4 = lifeRatio < 0.4f || golemLifeRatio < 0.55f || death; + bool phase2 = golemLifeRatio < 0.66f; + bool phase3 = golemLifeRatio < 0.33f; // Enrage if the target isn't inside the temple bool enrage = !BossRushEvent.BossRushActive; @@ -1247,106 +1138,100 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = CalamityWorld.LegendaryMode; + turboEnrage = Main.getGoodWorld; } else - turboEnrage = CalamityWorld.LegendaryMode; + turboEnrage = Main.getGoodWorld; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) enrage = true; - if (turboEnrage) - { - calamityGlobalNPC.DR = 0.9999f; - calamityGlobalNPC.unbreakableDR = true; - calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = true; - } - // Float through tiles or not - bool canPassThroughTiles = false; - if (!Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1) || phase3 || turboEnrage) + npc.noTileCollide = !Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1) || phase2 || turboEnrage; + + // Immediately trigger the laser spread attack at phase transition thresholds + if (phase2 && npc.ai[0] == 0f || phase3 && npc.ai[0] == 1f) { - npc.noTileCollide = true; - canPassThroughTiles = true; + npc.ai[0] = 3f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = PosDelay; + calamityGlobalNPC.newAI[3] = 0; + npc.netUpdate = true; + npc.SyncExtraAI(); } - else - npc.noTileCollide = false; // Move to new location + float maxDistanceDiagonal = 360f; + float maxDistanceStraight = 480f; if (npc.ai[3] <= 0f) { - npc.ai[3] = 400f; - - float maxDistance = 400f; - - // Four corners around target - if (phase3 || turboEnrage) + npc.ai[3] = PosDelay; + calamityGlobalNPC.newAI[3] += phase2 ? 1 : 0; + if (calamityGlobalNPC.newAI[3] >= 7) { - if (calamityGlobalNPC.newAI[1] == -maxDistance) + calamityGlobalNPC.newAI[3] = 0; + npc.ai[0] = 3f; + npc.ai[1] = 0f; + npc.ai[3] = PosDelay; + } + + // Four positions around target + if (!(phase3 || turboEnrage)) + { + if (phase2) { - switch ((int)calamityGlobalNPC.newAI[0]) + // 0 is top left, then goes counter-clockwise + switch ((int)(calamityGlobalNPC.newAI[3] % 4)) { case 0: - case 400: - calamityGlobalNPC.newAI[0] = -maxDistance; + calamityGlobalNPC.newAI[0] = -maxDistanceDiagonal; + calamityGlobalNPC.newAI[1] = -maxDistanceDiagonal; break; - case -400: - calamityGlobalNPC.newAI[1] = maxDistance; + case 1: + calamityGlobalNPC.newAI[0] = -maxDistanceDiagonal; + calamityGlobalNPC.newAI[1] = maxDistanceDiagonal; break; - default: + case 2: + calamityGlobalNPC.newAI[0] = maxDistanceDiagonal; + calamityGlobalNPC.newAI[1] = maxDistanceDiagonal; + break; + case 3: + calamityGlobalNPC.newAI[0] = maxDistanceDiagonal; + calamityGlobalNPC.newAI[1] = -maxDistanceDiagonal; break; } } + + // Above target else { - switch ((int)calamityGlobalNPC.newAI[0]) - { - case 0: - case -400: - calamityGlobalNPC.newAI[0] = maxDistance; - break; - case 400: - calamityGlobalNPC.newAI[1] = -maxDistance; - break; - default: - break; - } + calamityGlobalNPC.newAI[0] = Main.rand.NextFloat(-150f, 150f); + calamityGlobalNPC.newAI[1] = -maxDistanceStraight * 0.85f; } } - // Above target - else if (phase2) - { - switch ((int)calamityGlobalNPC.newAI[0]) - { - case 0: - calamityGlobalNPC.newAI[0] = maxDistance; - break; - case 400: - calamityGlobalNPC.newAI[0] = -maxDistance; - break; - case -400: - calamityGlobalNPC.newAI[0] = 0f; - break; - default: - break; - } - } - else - { - calamityGlobalNPC.newAI[0] = 0f; - calamityGlobalNPC.newAI[1] = -maxDistance; - } - npc.netSpam = 5; npc.SyncExtraAI(); npc.ForceNetUpdate(); } - npc.ai[3] -= 1f + - (turboEnrage ? 1f : phase2 ? 0.5f : 0f) + - (turboEnrage ? 1f : phase3 ? 0.5f : 0f) + - (turboEnrage ? 2f : phase4 ? 1f : 0f); + float positioningInc = enrage ? 6f : phase3 ? 2.5f : phase2 ? 1.8f : 1f; + npc.ai[3] -= positioningInc; + + // Move in a circle around the player in final phase + if (phase3 || turboEnrage) + { + float spinSpeedMult = enrage ? 2.5f : death ? 1.35f : 1.2f; + calamityGlobalNPC.newAI[0] = maxDistanceStraight * MathF.Sin(MathHelper.ToRadians(npc.ai[2] * spinSpeedMult)); + calamityGlobalNPC.newAI[1] = maxDistanceStraight * MathF.Cos(MathHelper.ToRadians(npc.ai[2] * spinSpeedMult)); + } + // Always move above the player during laser spread attack + if (npc.ai[0] == 3f) + { + calamityGlobalNPC.newAI[0] = 0f; + calamityGlobalNPC.newAI[1] = -maxDistanceStraight * 0.8f; + } float offsetX = calamityGlobalNPC.newAI[0]; float offsetY = calamityGlobalNPC.newAI[1]; @@ -1354,141 +1239,115 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Velocity and acceleration float velocity = (turboEnrage ? 15f : 10f) + - (turboEnrage ? 7.5f : phase2 ? 5f : 0f) + - (turboEnrage ? 7.5f : phase3 ? 5f : 0f); + (turboEnrage ? 7.5f : phase2 ? 10f : 0f) + + (turboEnrage ? 7.5f : phase3 ? 15f : 0f); if (enrage) velocity = (phase3 || turboEnrage) ? 35f : 25f; - float acceleration = phase3 ? 0f : turboEnrage ? 6f : enrage ? 4.8f : phase2 ? 1.2f : 0.8f; + float acceleration = npc.ai[0] == 3f ? 1.5f : phase2 ? 0f : turboEnrage ? 5f : enrage ? 3f : 0.3f; // How far Golem's Head is from where it's supposed to be Vector2 distanceFromDestination = destination - npc.Center; - // Whether Golem can fire projectiles - bool canFireProjectiles = distanceFromDestination.Length() < 120f || enrage; + bool canFireProjectiles = (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 160f && npc.ai[0] != 3f) || enrage; - CalamityUtils.SmoothMovement(npc, 80f, distanceFromDestination, velocity, acceleration, !phase3); + // Ensure the free head stays still during the attack + if (npc.ai[0] == 3f && npc.ai[1] >= 60f) + npc.velocity = Vector2.Zero; + else + CalamityUtils.SmoothMovement(npc, 80f, distanceFromDestination, velocity, acceleration, !phase2 || npc.ai[0] == 3f); - if (death && calamityGlobalNPC.newAI[2] < 120f) + // Laser spread attack, followed by lingering flame bolts + if (npc.ai[0] == 3f) { - calamityGlobalNPC.newAI[2] += 1f; + int telegraphTime = 60; + int laserEndTime = 120; + int fireballStartTime = 160; - if (calamityGlobalNPC.newAI[2] % 15f == 0f) + npc.ai[1]++; + // Grrrrr stop incrementing the damn timer + npc.ai[3] = PosDelay; + // Laser spread + if (npc.ai[1] >= telegraphTime && npc.ai[1] < laserEndTime && npc.ai[1] % 2f == 0f) { + // Manually plays the sound at a slower rate (the sound from the lasers is disabled by setting ai[1]) + if (npc.ai[1] % 10f == 0f) + SoundEngine.PlaySound(SoundID.Item33, npc.Center); + + for (int i = -1; i <= 1; i += 2) + { + Vector2 spawnLocation = new Vector2(npc.Center.X + 14f * npc.scale * i, npc.Center.Y - 20f * npc.scale); + float laserFireAngle = MathHelper.ToRadians((npc.ai[1] - telegraphTime + 20) * (death ? 2.1f : 2f)); + Vector2 laserVelocity = -Vector2.UnitY.RotatedBy(laserFireAngle * i) * (death ? 15f : 12f); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int spreadLasers = Projectile.NewProjectile(npc.GetSource_FromAI(), spawnLocation + laserVelocity.SafeNormalize(Vector2.UnitY) * 40f, laserVelocity, ProjectileID.EyeBeam, LaserDamage, 0f, Main.myPlayer, 0f, 1f); + Main.projectile[spreadLasers].timeLeft = enrage ? 600 : 300; + if (turboEnrage) + Main.projectile[spreadLasers].extraUpdates += 1; + + npc.netUpdate = true; + } + } + } + // Sets the mouth to be open for the upcoming flame bolts + if (npc.ai[1] > laserEndTime) + npc.localAI[0] = 1f; + + // Flame bolts + if (npc.ai[1] >= fireballStartTime && npc.ai[1] % 30 == 10f) + { + Vector2 spawnLocation = npc.Center + Vector2.UnitY * 20f * npc.scale; + Vector2 fireBoltVelocity = Utils.DirectionTo(spawnLocation, Main.player[npc.target].Center) * (enrage ? 30f : death ? 16f : 12f); + + int type = ModContent.ProjectileType(); + int damage = InfernoBoltDamage; + Projectile.NewProjectile(npc.GetSource_FromAI(), spawnLocation, fireBoltVelocity, type, damage, 0f, Main.myPlayer, Main.player[npc.target].Center.X, Main.player[npc.target].Center.Y); + } + + // Death fires 2 bolts, Rev fires just 1 + if (npc.ai[1] >= fireballStartTime + (death ? 40 : 10)) + { + npc.ai[0] = phase3 ? 2f : 1f; + npc.ai[1] = 0f; + if (phase3) + calamityGlobalNPC.newAI[2] = Main.rand.Next(120); // Used as a random start point for phase 3 circling + npc.ai[2] = calamityGlobalNPC.newAI[2]; + npc.localAI[0] = 0f; + // Needs to be done to properly put it in the top left corner afterwards in phase 2 + calamityGlobalNPC.newAI[0] = -maxDistanceDiagonal; npc.netUpdate = true; npc.SyncExtraAI(); } - - return false; - } - - // Fireballs - if (canFireProjectiles) - npc.ai[1] += 1f; - - float combinedLifeRatio = (lifeRatio + golemLifeRatio) * 0.5f; - float openMouthGateValue = 20f - (death ? 15f * (1f - combinedLifeRatio) : 10f * (1f - combinedLifeRatio)); - float shootFireballGateValue = 240f - (death ? 180f * (1f - combinedLifeRatio) : 120f * (1f - combinedLifeRatio)); - if (npc.ai[1] < openMouthGateValue || npc.ai[1] > shootFireballGateValue - openMouthGateValue) - npc.localAI[0] = 1f; - else - npc.localAI[0] = 0f; - - if (canPassThroughTiles && !phase3) - npc.ai[1] = openMouthGateValue; - - if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[1] >= shootFireballGateValue) - { - npc.ai[1] = 0f; - - Vector2 freeHeadCenter = new Vector2(npc.Center.X, npc.Center.Y + 20f * npc.scale); - float freeHeadSpeed = turboEnrage ? 24f : enrage ? 18f : 6f; - if (death) - freeHeadSpeed *= 1.25f; - - float freeHeadTargetX = Main.player[npc.target].Center.X - freeHeadCenter.X; - float freeHeadTargetY = Main.player[npc.target].Center.Y - freeHeadCenter.Y; - float freeHeadTargetDist = (float)Math.Sqrt(freeHeadTargetX * freeHeadTargetX + freeHeadTargetY * freeHeadTargetY); - - freeHeadTargetDist = freeHeadSpeed / freeHeadTargetDist; - freeHeadTargetX *= freeHeadTargetDist; - freeHeadTargetY *= freeHeadTargetDist; - - int projectileType = (phase3 || death) ? ProjectileID.InfernoHostileBolt : ProjectileID.Fireball; - int damage = projectileType == ProjectileID.InfernoHostileBolt ? InfernoBoltDamage : FireballDamage; - float ai0 = projectileType == ProjectileID.InfernoHostileBolt ? Main.player[npc.target].Center.X : 0f; - float ai1 = projectileType == ProjectileID.InfernoHostileBolt ? Main.player[npc.target].Center.Y : 0f; - float ai2 = projectileType == ProjectileID.InfernoHostileBolt ? 1f : 0f; - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), freeHeadCenter.X, freeHeadCenter.Y, freeHeadTargetX, freeHeadTargetY, projectileType, damage, 0f, Main.myPlayer, ai0, ai1, ai2); - if (projectileType == ProjectileID.InfernoHostileBolt) - { - Main.projectile[proj].timeLeft = 300; - Main.projectile[proj].netUpdate = true; - } - else - Main.projectile[proj].timeLeft = 450; - - npc.netUpdate = true; } // Lasers - if (canFireProjectiles) - npc.ai[2] += 1f; + npc.ai[2] += 1f; - float laserGateValue = 300f - (death ? 240f * (1f - combinedLifeRatio) : 180f * (1f - combinedLifeRatio)); - if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] >= laserGateValue) + int laserGateValue = (int)(PosDelay / positioningInc); + if (canFireProjectiles && Main.netMode != NetmodeID.MultiplayerClient && ((npc.ai[2] - calamityGlobalNPC.newAI[2]) % (laserGateValue / 2) == 0f)) { - npc.ai[2] = 0f; - int numLasers = 2; - bool leftLaserIsFast = Main.rand.NextBool(); for (int i = 0; i < numLasers; i++) { Vector2 freeHeadProjSpawn = new Vector2(npc.Center.X, npc.Center.Y - 20f * npc.scale); - if (i == 0) - freeHeadProjSpawn.X -= 14f * npc.scale; - else if (i == 1) - freeHeadProjSpawn.X += 14f * npc.scale; + freeHeadProjSpawn.X += 14f * npc.scale * (i == 1).ToDirectionInt(); - float freeHeadProjSpeed = 5f + (death ? 5f * (1f - combinedLifeRatio) : 3f * (1f - combinedLifeRatio)); - if (death) - { - if (i == 0) - { - if (leftLaserIsFast) - freeHeadProjSpeed *= 1.25f; - else - freeHeadProjSpeed *= 0.75f; - } - else - { - if (!leftLaserIsFast) - freeHeadProjSpeed *= 1.25f; - else - freeHeadProjSpeed *= 0.75f; - } - } + float freeHeadProjSpeed = 7f + (5f * (1f - golemLifeRatio)); + Vector2 laserVelocity = Main.player[npc.target].Center - freeHeadProjSpawn; + laserVelocity = laserVelocity.SafeNormalize(Vector2.UnitY) * freeHeadProjSpeed; - float freeHeadProjTargetX = Main.player[npc.target].Center.X - freeHeadProjSpawn.X; - float freeHeadProjTargetY = Main.player[npc.target].Center.Y - freeHeadProjSpawn.Y; - float freeHeadProjTargetDist = (float)Math.Sqrt(freeHeadProjTargetX * freeHeadProjTargetX + freeHeadProjTargetY * freeHeadProjTargetY); - - freeHeadProjTargetDist = freeHeadProjSpeed / freeHeadProjTargetDist; - freeHeadProjTargetX *= freeHeadProjTargetDist; - freeHeadProjTargetY *= freeHeadProjTargetDist; - - Vector2 laserVelocity = new Vector2(freeHeadProjTargetX, freeHeadProjTargetY); int type = ProjectileID.EyeBeam; int damage = LaserDamage; int freeHeadLaser = Projectile.NewProjectile(npc.GetSource_FromAI(), freeHeadProjSpawn + laserVelocity.SafeNormalize(Vector2.UnitY) * 40f, laserVelocity, type, damage, 0f, Main.myPlayer); Main.projectile[freeHeadLaser].timeLeft = enrage ? 600 : 300; - if (turboEnrage && CalamityWorld.LegendaryMode) + if (turboEnrage) Main.projectile[freeHeadLaser].extraUpdates += 1; } } - if (!CalamityWorld.LegendaryMode) + if (!Main.getGoodWorld) { npc.position += npc.netOffset; int randDustOffset = Main.rand.Next(2) * 2 - 1; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs index 83b4b1c189..d9d895141c 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool teleported = false; npc.aiAction = 0; float teleportScaleSpeed = 2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { teleportScaleSpeed -= 1f - lifeRatio; teleportScale *= teleportScaleSpeed; @@ -319,7 +319,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[0] += teleportRate; teleportScale = MathHelper.Clamp((60f - npc.ai[0]) / 60f, 0f, 1f); teleportScale = 0.5f + teleportScale * 0.5f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) teleportScale *= teleportScaleSpeed; if (npc.ai[0] >= 60f) @@ -401,7 +401,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[0] += teleportRate; teleportScale = MathHelper.Clamp(npc.ai[0] / 30f, 0f, 1f); teleportScale = 0.5f + teleportScale * 0.5f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) teleportScale *= teleportScaleSpeed; if (npc.ai[0] >= 30f && Main.netMode != NetmodeID.MultiplayerClient) @@ -513,7 +513,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float jumpVelocityLimit = redCrystalAlive ? 3f : 4.5f; if (death) jumpVelocityLimit += 3f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) jumpVelocityLimit = 8f; if ((npc.direction == 1 && npc.velocity.X < jumpVelocityLimit) || (npc.direction == -1 && npc.velocity.X > -jumpVelocityLimit)) @@ -551,12 +551,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses return false; // Adjust size based on HP - float maxScale = CalamityWorld.LegendaryMode ? 3f : death ? 2.5f : 1.5f; + float maxScale = Main.getGoodWorld ? 3f : death ? 2.5f : 1.5f; float minScale = death ? 0.5f : 0.75f; float maxScaledValue = maxScale - minScale; // Inversed scale in FTW - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) lifeRatio = (maxScaledValue - lifeRatio * maxScaledValue) + minScale; else lifeRatio = lifeRatio * maxScaledValue + minScale; @@ -639,7 +639,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.rand.NextBool(100)) npcType = NPCID.Pinky; - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) npcType = NPCID.RainbowSlime; int offset = 16; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs index 98757d7b09..f6c6d16f79 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs @@ -58,7 +58,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) aggressionLevel = 6; if (npc.type == NPCID.MoonLordCore) @@ -820,7 +820,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.localAI[1] < 0f) { npc.localAI[1] = 0f; - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode && Main.remixWorld) + if (Main.netMode != NetmodeID.MultiplayerClient && Main.zenithWorld) { for (int k = 0; k < 30; k++) { @@ -1174,9 +1174,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 handAttackDirection = Vector2.Normalize(handAttackRotation) * velocity; float ai = (MathHelper.TwoPi * (float)Main.rand.NextDouble() - MathHelper.Pi) / 30f + 0.0174532924f * handFaceDirection; int type = ProjectileID.PhantasmalEye; - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), handAttackMovement, handAttackDirection, type, EyeDamage, 0f, Main.myPlayer, 0f, ai); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), handAttackMovement, handAttackDirection, type, EyeDamage, 0f, Main.myPlayer, 0f, ai, aggressionLevel); Main.projectile[proj].timeLeft = 1200; - Main.projectile[proj].Calamity().lineColor = aggressionLevel; } } else @@ -1864,7 +1863,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + freeEyeRotation.X, npc.Center.Y + freeEyeRotation.Y, trueEyeSphereDirection.X, trueEyeSphereDirection.Y, type, 0, 0f, Main.myPlayer, 30f, npc.whoAmI); Main.projectile[proj].timeLeft = 1200; - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) { for (int k = 0; k < 3; k++) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs index 196ddcf11e..8093a7ec60 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs @@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static int ThornBallDamage = 27; // 108 // Expert AI has uses a magic number which we have to correct for - public static int ContactDamageCorrection = 100; + public static int ContactDamageCorrection = Main.masterMode ? 150 : 100; // Rev+ exclusive public static int ThornBallSpikeDamage = 22; // 88 @@ -186,7 +186,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.15f; acceleration *= 1.15f; @@ -315,7 +315,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int totalProjectiles = death ? 36 : 30; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); - float velocity2 = CalamityWorld.LegendaryMode ? 10f : 5f; + float velocity2 = Main.getGoodWorld ? 10f : 5f; Vector2 spinningPoint = new Vector2(0f, -velocity2); for (int k = 0; k < totalProjectiles; k++) { @@ -522,7 +522,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int totalProjectiles = secondCharge ? 6 : 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); - float velocity2 = CalamityWorld.LegendaryMode ? 10f : 5f; + float velocity2 = Main.getGoodWorld ? 10f : 5f; Vector2 spinningPoint = new Vector2(0f, -velocity2); for (int k = 0; k < totalProjectiles; k++) { @@ -644,7 +644,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (enrage) npc.localAI[1] += 2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.localAI[1] += 1f; float shootProjectileGateValue = death ? 30f : 60f; @@ -671,7 +671,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - bool shootPoisonSeed = (CalamityWorld.LegendaryMode || Main.rand.NextBool(death ? 2 : 4)) && !shootThornBall; + bool shootPoisonSeed = (Main.getGoodWorld || Main.rand.NextBool(death ? 2 : 4)) && !shootThornBall; int projectileType = shootThornBall ? ProjectileID.ThornBall : shootPoisonSeed ? ProjectileID.PoisonSeedPlantera : ProjectileID.SeedPlantera; float projectileSpeed = death ? 16f : 14f; int damage = shootThornBall ? ThornBallDamage : shootPoisonSeed ? PoisonSeedDamage : PinkSeedDamage; @@ -724,15 +724,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.localAI[0] = 2f; int totalTentacles = death ? 12 : 8; - if (CalamityWorld.LegendaryMode) - totalTentacles += 6; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) totalTentacles *= 2; for (int i = 0; i < totalTentacles; i++) NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { foreach (NPC n in Main.ActiveNPCs) { @@ -1088,7 +1086,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float hookMoveDistance = (float)Math.Sqrt(hookMoveX * hookMoveX + hookMoveY * hookMoveY); if (hookMoveDistance < 12f + velocity) { - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode && npc.localAI[3] == 1f) + if (Main.netMode != NetmodeID.MultiplayerClient && Main.getGoodWorld && npc.localAI[3] == 1f) { npc.localAI[3] = 0f; WorldGen.SpawnPlanteraThorns(npc.Center); @@ -1099,7 +1097,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else { - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode) + if (Main.netMode != NetmodeID.MultiplayerClient && Main.getGoodWorld) npc.localAI[3] = 1f; hookMoveDistance = velocity / hookMoveDistance; @@ -1133,7 +1131,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { if (Main.rand.NextBool(5)) npc.reflectsProjectiles = true; @@ -1208,7 +1206,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses deceleration *= 0.75f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) tentacleAcceleration += 4f; // Fast retraction diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs index d2cd39bd11..b695a3093d 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs @@ -45,16 +45,16 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if ((npc.position.Y / 16f) < Main.worldSurface && enrage) { calamityGlobalNPC.CurrentlyEnraged = true; - enrageScale += 0.5f; + enrageScale += 1f; } if (!Main.player[npc.target].ZoneJungle && enrage) { calamityGlobalNPC.CurrentlyEnraged = true; - enrageScale += 0.5f; + enrageScale += 1f; } - if (CalamityWorld.LegendaryMode) - enrageScale += 1f; + if (Main.getGoodWorld) + enrageScale += 0.5f; if (enrageScale > maxEnrageScale) enrageScale = maxEnrageScale; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs index c16a8274e0..2949c7af76 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs @@ -333,7 +333,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (death) { int numGelProjectiles = 12; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) numGelProjectiles = 15; float gelVelocity = death ? 20f : 16f; @@ -345,7 +345,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { Vector2 spinningpoint = new Vector2(gelVelocity, 0f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) spinningpoint *= Main.rand.NextFloat() + 0.5f; spinningpoint = spinningpoint.RotatedBy((float)(-j) * MathHelper.TwoPi / (float)numGelProjectiles, Vector2.Zero); @@ -470,7 +470,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses break; float jumpVelocity = death ? 7f : 4.5f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) jumpVelocity = 12f; if ((npc.direction == 1 && npc.velocity.X < jumpVelocity) || (npc.direction == -1 && npc.velocity.X > 0f - jumpVelocity)) @@ -516,7 +516,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (phase2) slamDelay = 10; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) slamDelay = 0; if (npc.velocity.Y == 0f) @@ -628,7 +628,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.velocity.Y += death ? 1.75f : 1.5f; float slamVelocity = death ? 15.5f : 15f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { npc.velocity.Y += 1f; slamVelocity = 15.99f; @@ -733,8 +733,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int numGelProjectiles = phase4 ? Main.rand.Next(9, 12) : phase2 ? Main.rand.Next(6, 9) : 12; if (phase5) numGelProjectiles += 6; - if (CalamityWorld.LegendaryMode) - numGelProjectiles = 20; + if (Main.getGoodWorld) + numGelProjectiles = 15; float projectileVelocity = death ? 12f : 10.5f; int type = ProjectileID.QueenSlimeGelAttack; @@ -745,7 +745,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float rotation = MathHelper.ToRadians(120); for (int i = 0; i < numGelProjectiles; i++) { - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) destination *= Main.rand.NextFloat() + 0.5f; Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numGelProjectiles - 1))); @@ -759,7 +759,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { Vector2 spinningpoint = new Vector2(projectileVelocity, 0f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) spinningpoint *= Main.rand.NextFloat() + 0.5f; spinningpoint = spinningpoint.RotatedBy((-j) * MathHelper.TwoPi / numGelProjectiles, Vector2.Zero); @@ -871,7 +871,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.netUpdate = true; } - float slimeSpawnHealthGateValue = CalamityWorld.LegendaryMode ? 0.01f : phase3 ? 0.04f : phase2 ? 0.03f : 0.025f; + float slimeSpawnHealthGateValue = Main.zenithWorld ? 0.01f : phase3 ? 0.04f : phase2 ? 0.03f : 0.025f; if (death) slimeSpawnHealthGateValue *= 0.5f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs index 830249b332..4d20d1977f 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs @@ -162,39 +162,39 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Hand variables bool handsDead = numHandsAlive == 0; - int numProj = CalamityWorld.LegendaryMode ? 22 : death ? 5 : 3; - float spread = CalamityWorld.LegendaryMode ? 180 : 60; + int numProj = Main.getGoodWorld ? 22 : death ? 5 : 3; + float spread = Main.getGoodWorld ? 180 : 60; float headSpinVelocityMult = phase3 ? 12f : 4.5f; switch (numHandsAlive) { case 0: - numProj = CalamityWorld.LegendaryMode ? 36 : death ? 9 : 7; - spread = CalamityWorld.LegendaryMode ? 180 : death ? 90 : 82; + numProj = Main.getGoodWorld ? 36 : death ? 9 : 7; + spread = Main.getGoodWorld ? 180 : death ? 90 : 82; headSpinVelocityMult = phase3 ? 12f : 6f; break; case 1: - numProj = CalamityWorld.LegendaryMode ? 27 : death ? 7 : 5; - spread = CalamityWorld.LegendaryMode ? 150 : death ? 76 : 68; + numProj = Main.getGoodWorld ? 27 : death ? 7 : 5; + spread = Main.getGoodWorld ? 150 : death ? 76 : 68; headSpinVelocityMult = phase3 ? 11.5f : 5f; break; case 2: - numProj = CalamityWorld.LegendaryMode ? 18 : death ? 6 : 4; - spread = CalamityWorld.LegendaryMode ? 140 : death ? 70 : 62; + numProj = Main.getGoodWorld ? 18 : death ? 6 : 4; + spread = Main.getGoodWorld ? 140 : death ? 70 : 62; headSpinVelocityMult = phase3 ? 11f : 4.5f; break; case 3: - numProj = CalamityWorld.LegendaryMode ? 15 : death ? 5 : 3; - spread = CalamityWorld.LegendaryMode ? 130 : death ? 64 : 56; + numProj = Main.getGoodWorld ? 15 : death ? 5 : 3; + spread = Main.getGoodWorld ? 130 : death ? 64 : 56; headSpinVelocityMult = phase3 ? 10.5f : 4f; break; case 4: - numProj = CalamityWorld.LegendaryMode ? 12 : death ? 4 : 3; - spread = CalamityWorld.LegendaryMode ? 120 : 56; + numProj = Main.getGoodWorld ? 12 : death ? 4 : 3; + spread = Main.getGoodWorld ? 120 : 56; headSpinVelocityMult = phase3 ? 10f : 3.5f; break; } @@ -354,7 +354,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if ((handsDead || death) && npc.ai[1] == 0f && !phase4) { float skullProjFrequency = phase2 ? (48f - (death ? 17.5f * (1f - lifeRatio) : 0f)) : 60f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) skullProjFrequency *= 0.8f; skullProjFrequency = (float)Math.Ceiling(skullProjFrequency); @@ -428,11 +428,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - float headYAcceleration = (CalamityWorld.LegendaryMode ? 0.07f : death ? (0.06f + 0.04f * (1f - lifeRatio)) : 0.04f); + float headYAcceleration = (Main.getGoodWorld ? 0.07f : death ? (0.06f + 0.04f * (1f - lifeRatio)) : 0.04f); float headYTopSpeed = headYAcceleration * 100f; - float headXAcceleration = (CalamityWorld.LegendaryMode ? 0.21f : death ? (0.16f + 0.08f * (1f - lifeRatio)) : 0.08f); + float headXAcceleration = (Main.getGoodWorld ? 0.21f : death ? (0.16f + 0.08f * (1f - lifeRatio)) : 0.08f); float headXTopSpeed = headXAcceleration * 100f; - float deceleration = CalamityWorld.LegendaryMode ? 0.83f : death ? 0.86f : 0.89f; + float deceleration = Main.getGoodWorld ? 0.83f : death ? 0.86f : 0.89f; float moveAwayGateValue = chargePhaseGateValue - (5f + chargePhaseChangeRate); bool moveAwayBeforeCharge = npc.ai[2] >= moveAwayGateValue; @@ -518,7 +518,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Spin charge else if (npc.ai[1] == 1f) { - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { npc.reflectsProjectiles = true; if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == 0f) @@ -545,7 +545,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) { if (!NPC.AnyNPCs(NPCID.DiabolistWhite)) { @@ -619,7 +619,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float dashPhaseTime = death ? 210f : 300f; if (npc.ai[2] >= dashPhaseTime) { - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { if (Main.netMode != NetmodeID.MultiplayerClient && NPC.CountNPCS(NPCID.DarkCaster) < 6) { @@ -707,7 +707,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses headSpinVelocityMult *= baseDistanceVelocityMult; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) headSpinVelocityMult *= 1.3f; headSpinTargetDist = headSpinVelocityMult / headSpinTargetDist; @@ -868,7 +868,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float velocityMultiplier = MathHelper.Lerp(death ? 0.6f : 0.7f, 1f, skeletronLifeRatio); float velocityIncrement = MathHelper.Lerp(0.2f, death ? 0.4f : 0.3f, 1f - skeletronLifeRatio); float handSwipeVelocity = MathHelper.Lerp(16f, death ? 24f : 20f, 1f - skeletronLifeRatio); - float deceleration = CalamityWorld.LegendaryMode ? 0.78f : death ? 0.82f : 0.86f; + float deceleration = Main.getGoodWorld ? 0.78f : death ? 0.82f : 0.86f; if (death) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs index 77cd83cc81..663fa2f28e 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs @@ -165,7 +165,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] == 0f || npc.ai[1] == 4f) { // Start other phases; if arms are dead, start with spin phase - if (phase2 || CalamityWorld.LegendaryMode || allArmsDead) + if (phase2 || Main.getGoodWorld || allArmsDead) { // Start spin phase after 1.5 seconds npc.ai[2] += phase3 ? 1.5f : 1f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs index b9c320c399..f1ff62a5df 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs @@ -148,7 +148,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses acceleration += phase1MaxAccelerationIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)); } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { maxVelocity *= 1.15f; acceleration *= 1.15f; @@ -202,7 +202,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!Main.player[npc.target].dead) { npc.ai[3] += 1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.ai[3] += 0.5f; } @@ -230,7 +230,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float chargeSpeed = death ? 18f : 15f; if (death) chargeSpeed += phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeSpeed += 2f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitX * direction) * chargeSpeed; @@ -393,7 +393,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float maxVelocity = death ? 10.85f + 3f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 9.5f; float acceleration = death ? 0.1975f + 0.05f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0.175f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { maxVelocity *= 1.15f; acceleration *= 1.15f; @@ -463,7 +463,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float maxVelocity = death ? 10.85f + 3f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 9.5f; float acceleration = death ? 0.295f + 0.075f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0.25f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { maxVelocity *= 1.15f; acceleration *= 1.15f; @@ -520,7 +520,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float chargeSpeed = (death ? 25f : 22f) + (death ? 8f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); if (!spazAlive) chargeSpeed += 2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeSpeed += 2f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * chargeSpeed; @@ -630,7 +630,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeAcceleration *= 0.75f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { chargeSpeed *= 1.15f; chargeAcceleration *= 1.15f; @@ -773,7 +773,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses acceleration += phase1MaxAccelerationIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)); } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { maxVelocity *= 1.15f; acceleration *= 1.15f; @@ -818,7 +818,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!Main.player[npc.target].dead) { npc.ai[3] += 1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.ai[3] += 0.4f; } @@ -845,7 +845,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = hoverRotation; float chargeSpeed = death ? 20.4f + phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 18f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeSpeed *= 1.2f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitX * direction) * chargeSpeed; @@ -1029,7 +1029,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (distanceFromDestination > distanceFromTarget) maxVelocity += MathHelper.Lerp(0f, death ? 8f : 6f, MathHelper.Clamp((distanceFromDestination - distanceFromTarget) / 1000f, 0f, 1f)); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { maxVelocity *= 1.15f; acceleration *= 1.15f; @@ -1118,7 +1118,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = hoverRotation; float chargeSpeed = (death ? 22.8f : 18f) + (death ? 5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeSpeed *= 1.2f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitX * direction) * chargeSpeed; @@ -1192,7 +1192,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float spazmatismPhase3ChargeSpeed = (death ? 23f : 20f) + (death ? 6f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); if (npc.ai[2] == -1f || (!retAlive && npc.ai[3] == secondFastCharge)) spazmatismPhase3ChargeSpeed *= 1.3f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) spazmatismPhase3ChargeSpeed *= 1.2f; Vector2 distanceVector = Main.player[npc.target].Center - npc.Center; @@ -1293,7 +1293,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeAcceleration *= 0.75f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { chargeSpeed *= 1.15f; chargeAcceleration *= 1.15f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs index 70a5fb1b21..e1fe967125 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs @@ -51,7 +51,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool phase2 = lifeRatio < 0.66f; bool phase3 = lifeRatio < 0.33f; - if (CalamityWorld.LegendaryMode && Main.netMode != NetmodeID.MultiplayerClient && Main.rand.NextBool(180)) + if (Main.getGoodWorld && Main.netMode != NetmodeID.MultiplayerClient && Main.rand.NextBool(180)) { if (NPC.CountNPCS(NPCID.FireImp) < 4) { @@ -94,7 +94,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] += 1f; if (phase3) npc.ai[1] += 1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.ai[1] += 9f; if (npc.ai[1] > 2700f) @@ -323,7 +323,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (death) velocityX *= 1.2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocityX *= 1.1f; velocityX += 0.1f; diff --git a/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs b/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs index 16c8b29ac6..f9db3ad02d 100644 --- a/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs +++ b/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs @@ -4167,7 +4167,7 @@ PrepareToShoot: if (Main.netMode != NetmodeID.MultiplayerClient && !targetDead) { - if (CalamityWorld.LegendaryMode && npc.type == NPCID.EaterofSouls) + if (Main.getGoodWorld && npc.type == NPCID.EaterofSouls) { if (NPC.AnyNPCs(NPCID.EaterofWorldsHead)) { @@ -5433,7 +5433,7 @@ PrepareToShoot: } else { - if (CalamityWorld.LegendaryMode && npc.type == NPCID.FireImp) + if (Main.getGoodWorld && npc.type == NPCID.FireImp) { if (NPC.AnyNPCs(NPCID.WallofFlesh)) { @@ -6790,15 +6790,8 @@ PrepareToShoot: int projType = ProjectileID.SandBallFalling; - // If Legendary is enabled, can fire 8 to 13 sand balls (random chance for 10x the amount) - int projAmt = 1; - if (CalamityWorld.LegendaryMode) - { - projAmt = Main.rand.Next(8, 14); - if (Main.rand.NextBool(1000) || Main.zenithWorld) - projAmt = Main.rand.Next(80, 131); - } - + // In FTW, can fire 8 sand balls (100 in stupid meme seed) + int projAmt = Main.zenithWorld ? 100 : Main.getGoodWorld ? 8 : 1; for (int i = 0; i < projAmt; i++) { // Adjust the velocity to make it a shotgun-like spread diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index fd632ec3cc..ef6891904d 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -56,11 +56,9 @@ namespace CalamityMod.NPCs.Yharon private int invincibilityCounter = 0; private int fastChargeTelegraphTime = 120; - private const float ai2GateValue = 0.55f; - public const int Phase2InvincibilityTime = 300; - - public static float normalDR = 0.22f; - public static float EnragedDR = 0.9f; + private const float AI2GateValue = 0.55f; + private const int Phase2InvincibilityTime = 300; + private const float EnragedDR = 0.9f; public static readonly SoundStyle RoarSound = new("CalamityMod/Sounds/Custom/Yharon/YharonRoar"); public static readonly SoundStyle ShortRoarSound = new("CalamityMod/Sounds/Custom/Yharon/YharonRoarShort"); @@ -110,7 +108,7 @@ namespace CalamityMod.NPCs.Yharon public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.damage = 200; // 400 + NPC.damage = 220; // 440 NPC.npcSlots = 50f; NPC.width = 200; NPC.height = 200; @@ -121,7 +119,6 @@ namespace CalamityMod.NPCs.Yharon AIType = -1; NPC.value = Item.buyPrice(platinum: 2, gold: 50); NPC.boss = true; - NPC.DR_NERD(normalDR); NPC.noGravity = true; NPC.noTileCollide = true; @@ -226,7 +223,7 @@ namespace CalamityMod.NPCs.Yharon float phase2GateValue = revenge ? 0.9f : expertMode ? 0.85f : 0.8f; bool phase2Check = death || lifeRatio <= phase2GateValue; bool phase3Check = lifeRatio <= (death ? 0.8f : revenge ? 0.75f : expertMode ? 0.7f : 0.65f); - bool phase4Check = lifeRatio <= ai2GateValue; + bool phase4Check = lifeRatio <= AI2GateValue; bool phase1Change = NPC.ai[0] > -1f; bool phase2Change = NPC.ai[0] > 5f; bool phase3Change = NPC.ai[0] > 12f; @@ -371,12 +368,12 @@ namespace CalamityMod.NPCs.Yharon enraged = false; if (Main.netMode != NetmodeID.MultiplayerClient) { - safeBox.X = (int)(player.Center.X - (Main.zenithWorld ? 1500f : CalamityWorld.LegendaryMode ? 1000f : revenge ? 3000f : 3500f)); + safeBox.X = (int)(player.Center.X - (Main.zenithWorld ? 1500f : Main.getGoodWorld ? 1000f : revenge ? 3000f : 3500f)); safeBox.Y = (int)Main.topWorld; - safeBox.Width = Main.zenithWorld ? 3000 : CalamityWorld.LegendaryMode ? 2000 : revenge ? 6000 : 7000; + safeBox.Width = Main.zenithWorld ? 3000 : Main.getGoodWorld ? 2000 : revenge ? 6000 : 7000; safeBox.Height = Main.maxTilesY * 16; - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X + (Main.zenithWorld ? 1500f : CalamityWorld.LegendaryMode ? 1000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X - (Main.zenithWorld ? 1500f : CalamityWorld.LegendaryMode ? 1000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X + (Main.zenithWorld ? 1500f : Main.getGoodWorld ? 1000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X - (Main.zenithWorld ? 1500f : Main.getGoodWorld ? 1000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); } // Force Yharon to send a sync packet so that the arena gets sent immediately @@ -398,13 +395,13 @@ namespace CalamityMod.NPCs.Yharon protectionBoost = false; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) phaseSwitchTimer /= 2; // Set DR based on protection boost (aka enrage) bool chargeTelegraph = (NPC.ai[0] == 0f || NPC.ai[0] == 6f || NPC.ai[0] == 13f) && NPC.localAI[1] > 0f; bool bulletHell = NPC.ai[0] == 8f || NPC.ai[0] == 15f; - calamityGlobalNPC.DR = protectionBoost ? EnragedDR : normalDR; + calamityGlobalNPC.DR = protectionBoost ? EnragedDR : 0f; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = protectionBoost; // Increased DR during phase transitions @@ -412,17 +409,17 @@ namespace CalamityMod.NPCs.Yharon { if (phase3Change) { - calamityGlobalNPC.DR = phase4Check ? 0.7f : normalDR; + calamityGlobalNPC.DR = phase4Check ? 0.7f : 0f; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase4Check; } else if (phase2Change) { - calamityGlobalNPC.DR = phase3Check ? 0.7f : normalDR; + calamityGlobalNPC.DR = phase3Check ? 0.7f : 0f; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase3Check; } else if (phase1Change) { - calamityGlobalNPC.DR = phase2Check ? 0.7f : normalDR; + calamityGlobalNPC.DR = phase2Check ? 0.7f : 0f; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase2Check; } } @@ -1718,7 +1715,7 @@ namespace CalamityMod.NPCs.Yharon // Set DR based on protection boost (aka enrage) bool bulletHell = NPC.ai[0] == 5f; NPC.dontTakeDamage = bulletHell; - calamityGlobalNPC.DR = protectionBoost ? EnragedDR : normalDR; + calamityGlobalNPC.DR = protectionBoost ? EnragedDR : 0f; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = protectionBoost; // Increased DR during phase transitions @@ -1728,21 +1725,21 @@ namespace CalamityMod.NPCs.Yharon { case 1: - calamityGlobalNPC.DR = phase2 ? 0.7f : normalDR; + calamityGlobalNPC.DR = phase2 ? 0.7f : 0f; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase2; break; case 2: - calamityGlobalNPC.DR = phase3 ? 0.7f : normalDR; + calamityGlobalNPC.DR = phase3 ? 0.7f : 0f; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase3; break; case 3: - calamityGlobalNPC.DR = phase4 ? 0.7f : normalDR; + calamityGlobalNPC.DR = phase4 ? 0.7f : 0f; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase4; break; @@ -1770,7 +1767,7 @@ namespace CalamityMod.NPCs.Yharon float fireballBreathTimer = 60f; float fireballBreathPhaseTimer = fireballBreathTimer + 80f; - float fireballBreathPhaseVelocity = expertMode ? 32f : 30f; + float fireballBreathPhaseVelocity = expertMode ? 28f : 25f; float splittingFireballBreathTimer = 40f; float splittingFireballBreathPhaseVelocity = 22f; @@ -1796,7 +1793,7 @@ namespace CalamityMod.NPCs.Yharon } float flareSpawnDecelerationTimer = death ? 75f : 90f; - int flareSpawnPhaseTimerReduction = revenge ? (int)(flareSpawnDecelerationTimer * (ai2GateValue - lifeRatio)) : 0; + int flareSpawnPhaseTimerReduction = revenge ? (int)(flareSpawnDecelerationTimer * (AI2GateValue - lifeRatio)) : 0; float flareSpawnPhaseTimer = (death ? 150f : 180f) - flareSpawnPhaseTimerReduction; float teleportPhaseTimer = 45f; @@ -1811,7 +1808,7 @@ namespace CalamityMod.NPCs.Yharon chargeSpeed *= velocityMult; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) phaseSwitchTimer *= 0.5f; if (NPC.ai[0] == 0f) @@ -2254,9 +2251,6 @@ namespace CalamityMod.NPCs.Yharon int type = ModContent.ProjectileType(); Projectile.NewProjectile(NPC.GetSource_FromAI(), position, projectileVelocity, type, FlareDamage, 0f, Main.myPlayer); } - - if (Math.Abs(targetData.Center.X - NPC.Center.X) > 700f && Math.Abs(NPC.velocity.X) < chargeSpeed) - NPC.velocity.X += Math.Sign(NPC.velocity.X) * 0.5f; } if (NPC.ai[1] >= fireballBreathPhaseTimer) @@ -3055,14 +3049,6 @@ namespace CalamityMod.NPCs.Yharon } #endregion - #region On Hit Player - public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) - { - if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 180); - } - #endregion - #region HP Bar Cooldown Slot and Stats public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) { diff --git a/Particles/FlameExplosion.cs b/Particles/FlameExplosion.cs index 6403703253..cb484bc753 100644 --- a/Particles/FlameExplosion.cs +++ b/Particles/FlameExplosion.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Particles private float OriginalScale; private float FinalScale; + private float baseOpacity; private float opacity; private Vector2 Squish; private Color BaseColor; @@ -31,6 +32,7 @@ namespace CalamityMod.Particles Lifetime = lifeTime; Squish = squish; Rotation = rotation; + baseOpacity = opacity; } public override void Update() @@ -38,7 +40,7 @@ namespace CalamityMod.Particles float pulseProgress = PiecewiseAnimation(LifetimeCompletion, new CurveSegment[] { new CurveSegment(EasingType.PolyOut, 0f, 0f, 1f, 4) }); Scale = MathHelper.Lerp(OriginalScale, FinalScale, pulseProgress); - opacity = (float)Math.Sin(MathHelper.PiOver2 + LifetimeCompletion * MathHelper.PiOver2); + opacity = (float)Math.Sin(MathHelper.PiOver2 + LifetimeCompletion * MathHelper.PiOver2) * baseOpacity; Color = BaseColor * opacity; Lighting.AddLight(Position, Color.R / 255f, Color.G / 255f, Color.B / 255f); diff --git a/Particles/MiniFlower.png b/Particles/MiniFlower.png new file mode 100644 index 0000000000..793d007ecd Binary files /dev/null and b/Particles/MiniFlower.png differ diff --git a/Projectiles/BaseProjectiles/BaseCustomMeleeSwingProjectile.cs b/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs similarity index 87% rename from Projectiles/BaseProjectiles/BaseCustomMeleeSwingProjectile.cs rename to Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs index 4c9237af5b..d9d042c6df 100644 --- a/Projectiles/BaseProjectiles/BaseCustomMeleeSwingProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs @@ -14,6 +14,8 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using System; +using System.IO; +using CalamityMod.Projectiles.Summon; namespace CalamityMod.Projectiles.BaseProjectiles { @@ -161,10 +163,24 @@ namespace CalamityMod.Projectiles.BaseProjectiles /// Defaults to 0.5f ///
public virtual float RotateInStartup { get; set; } = 0.5f; + + /// + /// Speed at which the projectile should rotate to match the mouse angle during Cooldown. + /// Set to 0 to disable. + /// Defaults to 0.5f + /// + public virtual float RotateInCooldown { get; set; } = 0.5f; + /// /// What sound to use when the sword begins the actual swing (after startup frames) /// public virtual SoundStyle? UseSound {get; set;} = null; + /// + /// The length (from the player) of the projectile's line collision. + /// This helps to prevent blindspots. + /// Defaults to 0 + /// + public virtual float lineCollisionLength { get; set; } = 0; #endregion @@ -175,6 +191,11 @@ namespace CalamityMod.Projectiles.BaseProjectiles /// public Vector2 angle { get; set; } = Vector2.Zero; /// + /// The projectile's center based on offset to the player the previous update + /// Can be used for effects that stay consistent in motion + /// + public Vector2 oldPlayerOffset { get; set; } + /// /// Internal timer for the projectile's entire lifespan /// public int timer { get; set; } = 0; @@ -256,10 +277,6 @@ namespace CalamityMod.Projectiles.BaseProjectiles #endregion #region Overrides - public override void SetStaticDefaults() - { - ProjectileDestroyExceptionsList.List.Add(Projectile.type); - } /// /// DO NOT OVERRIDE IN MOST SITUATIONS /// use Defaults() instead. @@ -283,8 +300,6 @@ namespace CalamityMod.Projectiles.BaseProjectiles ProjectileID.Sets.TrailingMode[Projectile.type] = 2; ProjectileID.Sets.TrailCacheLength[Projectile.type] = 100; Defaults(); - - } /// /// DO NOT OVERRIDE IN MOST SITUATIONS @@ -340,6 +355,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles baseScale = Projectile.scale; ExistsTime = swingTime + StartupTime + CooldownTime; Projectile.timeLeft = ExistsTime * 2; + Projectile.netUpdate = true; } /// @@ -354,7 +370,10 @@ namespace CalamityMod.Projectiles.BaseProjectiles float adust = MathHelper.ToRadians(225); if (timer < StartupTime || timer > StartupTime + swingTime) { - angle = Vector2.Lerp(angle, (player.Center - Main.MouseWorld).SafeNormalize(Vector2.One), RotateInStartup); + if (inStartup) + angle = Vector2.Lerp(angle, (player.Center - Main.MouseWorld).SafeNormalize(Vector2.One), RotateInStartup); + if (inCooldown) + angle = Vector2.Lerp(angle, (player.Center - Main.MouseWorld).SafeNormalize(Vector2.One), RotateInCooldown); if (angle.X < 0) { player.direction = 1; @@ -389,7 +408,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles Projectile.Center = armCenter - (angle * OffsetDistance * (1 + (Projectile.scale - 1) * 0.75f)).RotatedBy(Projectile.spriteDirection * angle2); Projectile.rotation = angle.RotatedBy(Projectile.spriteDirection * angle2).ToRotation() + adust; AdditionalAI(); - + oldPlayerOffset = Projectile.Center - player.Center; player.itemTime = ExistsTime + 2 - timer; player.itemAnimation = ExistsTime + 2 - timer; if (timer > ExistsTime) @@ -470,6 +489,21 @@ namespace CalamityMod.Projectiles.BaseProjectiles hitbox.Location = (center - new Vector2(hitbox.Width / 2, hitbox.Height / 2)).ToPoint(); } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (lineCollisionLength > 0) + { + var player = Main.player[Projectile.owner]; + var armcenter = player.Center - new Vector2(5 * player.direction, 2); + var swordDir = armcenter.DirectionTo(Projectile.Center); + var collisionline = new Vector2(lineCollisionLength / 2f, 0).RotatedBy(swordDir.ToRotation())*Projectile.scale; + bool c = Collision.CheckAABBvLineCollision(targetHitbox.Location.ToVector2(), targetHitbox.Size(), Projectile.Center, Projectile.Center + collisionline); + if (c && !float.IsNaN(collisionline.X) && !float.IsNaN(collisionline.Y)) + return true; + } + return base.Colliding(projHitbox, targetHitbox); + } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { modifiers.HitDirectionOverride = ((Main.player[Projectile.owner].DirectionTo(target.Center)).X >= 0 ? 1 : -1); @@ -479,6 +513,32 @@ namespace CalamityMod.Projectiles.BaseProjectiles { return inSwing; } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.WriteVector2(angle); + writer.Write(swingTime); + writer.Write(StartupTime); + writer.Write(CooldownTime); + writer.Write(timer); + writer.Write(swingTimer); + writer.Write(ExistsTime); + writer.Write(baseScale); + writer.Write(Projectile.scale); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + angle = reader.ReadVector2(); + swingTime = reader.Read(); + StartupTime = reader.Read(); + CooldownTime = reader.Read(); + timer = reader.Read(); + swingTimer = reader.Read(); + ExistsTime = reader.Read(); + baseScale = reader.ReadSingle(); + Projectile.scale = reader.ReadSingle(); + } #endregion #region Helper Methods diff --git a/Projectiles/Boss/ApolloChargeTelegraph.cs b/Projectiles/Boss/ApolloChargeTelegraph.cs index f2e9d814cd..ea5ebbe5b6 100644 --- a/Projectiles/Boss/ApolloChargeTelegraph.cs +++ b/Projectiles/Boss/ApolloChargeTelegraph.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Boss bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; Projectile.timeLeft = death ? 60 : revenge ? 68 : expertMode ? 75 : 90; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) Projectile.timeLeft /= 2; } @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Boss // Determine opacity float telegraphTotalTime = death ? 60f : revenge ? 68f : expertMode ? 75f : 90f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) telegraphTotalTime *= 0.5f; Projectile.Opacity = Utils.GetLerpValue(0f, 6f, Projectile.timeLeft, true) * Utils.GetLerpValue(telegraphTotalTime, telegraphTotalTime - 6f, Projectile.timeLeft, true); diff --git a/Projectiles/Boss/ApolloFireball.cs b/Projectiles/Boss/ApolloFireball.cs index 8568c5408c..ba04dae241 100644 --- a/Projectiles/Boss/ApolloFireball.cs +++ b/Projectiles/Boss/ApolloFireball.cs @@ -128,14 +128,6 @@ namespace CalamityMod.Projectiles.Boss public override bool CanHitPlayer(Player target) => Projectile.Opacity == 1f; - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0 || Projectile.Opacity != 1f) - return; - - target.AddBuff(BuffID.CursedInferno, 180); - } - public override bool PreDraw(ref Color lightColor) { lightColor.R = (byte)(255 * Projectile.Opacity); diff --git a/Projectiles/Boss/ApolloRocket.cs b/Projectiles/Boss/ApolloRocket.cs index 563bd7fed5..65c5918527 100644 --- a/Projectiles/Boss/ApolloRocket.cs +++ b/Projectiles/Boss/ApolloRocket.cs @@ -178,14 +178,6 @@ namespace CalamityMod.Projectiles.Boss } } - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - target.AddBuff(BuffID.CursedInferno, 180); - } - public override bool PreDraw(ref Color lightColor) { CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); diff --git a/Projectiles/Boss/AresGaussNukeProjectile.cs b/Projectiles/Boss/AresGaussNukeProjectile.cs index 020204e778..ce9f32c87a 100644 --- a/Projectiles/Boss/AresGaussNukeProjectile.cs +++ b/Projectiles/Boss/AresGaussNukeProjectile.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Boss CooldownSlot = ImmunityCooldownID.Bosses; Projectile.timeLeft = timeLeft; - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) Projectile.extraUpdates = 1; } @@ -123,6 +123,13 @@ namespace CalamityMod.Projectiles.Boss int target = Player.FindClosest(Projectile.Center, 1, 1); Vector2 distanceFromTarget = Main.player[target].Center - Projectile.Center; + // Instant explode upon collision with the target + if (CalamityUtils.CircularHitboxCollision(Projectile.Center, 45f, Main.player[target].Hitbox)) + { + Projectile.Kill(); + return; + } + // Set AI to stop homing, start accelerating float stopHomingDistance = death ? 280f : revenge ? 290f : expertMode ? 300f : 320f; if ((distanceFromTarget.Length() < stopHomingDistance && Projectile.ai[0] != -1f) || Projectile.ai[0] == 1f) @@ -175,10 +182,8 @@ namespace CalamityMod.Projectiles.Boss Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Projectiles/Boss/AresGaussNukeProjectileGlow").Value, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, drawStart, texture.Width, height)), Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 45f, targetHitbox); - - // Explodes on contact - public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers) => Projectile.Kill(); + // Does not do damage by itself, only through the explosion + public override bool? CanDamage() => false; public override void OnKill(int timeLeft) { @@ -200,7 +205,7 @@ namespace CalamityMod.Projectiles.Boss // Explosion waves for (int i = 0; i < 3; i++) { - Projectile explosion = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, 0f, Main.myPlayer); + Projectile explosion = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), i == 2 ? Projectile.damage : 0, 0f, Main.myPlayer); if (explosion.whoAmI.WithinBounds(Main.maxProjectiles)) { // Make the max explosion radius decrease over time, creating a ring effect. diff --git a/Projectiles/Boss/AresGaussNukeProjectileBoom.cs b/Projectiles/Boss/AresGaussNukeProjectileBoom.cs index 2c7d2d2db3..1d60927f9f 100644 --- a/Projectiles/Boss/AresGaussNukeProjectileBoom.cs +++ b/Projectiles/Boss/AresGaussNukeProjectileBoom.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; using Terraria; @@ -29,6 +30,8 @@ namespace CalamityMod.Projectiles.Boss } public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + private List PlayersHit = new List() { -1 }; + public override void SetStaticDefaults() { ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; @@ -48,6 +51,8 @@ namespace CalamityMod.Projectiles.Boss public override void PostAI() => Lighting.AddLight(Projectile.Center, 0.2f, 0.1f, 0f); - public override bool CanHitPlayer(Player target) => CalamityUtils.CircularHitboxCollision(Projectile.Center, CurrentRadius * Projectile.scale * 0.4f, target.Hitbox) && Projectile.timeLeft > 6; + public override bool CanHitPlayer(Player target) => CalamityUtils.CircularHitboxCollision(Projectile.Center, CurrentRadius * Projectile.scale * 0.4f, target.Hitbox) && Projectile.timeLeft > 6 && !PlayersHit.Contains(target.whoAmI); + + public override void OnHitPlayer(Player target, Player.HurtInfo info) => PlayersHit.Add(target.whoAmI); } } diff --git a/Projectiles/Boss/AresLaserBeamStart.cs b/Projectiles/Boss/AresLaserBeamStart.cs index fd96c14180..46f236d723 100644 --- a/Projectiles/Boss/AresLaserBeamStart.cs +++ b/Projectiles/Boss/AresLaserBeamStart.cs @@ -228,14 +228,6 @@ namespace CalamityMod.Projectiles.Boss return false; } - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - target.AddBuff(ModContent.BuffType(), 150); - } - public override bool CanHitPlayer(Player target) => Projectile.scale >= 0.5f; } } diff --git a/Projectiles/Boss/AresPlasmaBolt.cs b/Projectiles/Boss/AresPlasmaBolt.cs index 3b250b5baf..923848fd8f 100644 --- a/Projectiles/Boss/AresPlasmaBolt.cs +++ b/Projectiles/Boss/AresPlasmaBolt.cs @@ -69,14 +69,6 @@ namespace CalamityMod.Projectiles.Boss public override bool CanHitPlayer(Player target) => Projectile.Opacity == 1f; - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0 || Projectile.Opacity != 1f) - return; - - target.AddBuff(BuffID.CursedInferno, 90); - } - public override bool PreDraw(ref Color lightColor) { lightColor.R = (byte)(255 * Projectile.Opacity); diff --git a/Projectiles/Boss/AresPlasmaFireball.cs b/Projectiles/Boss/AresPlasmaFireball.cs index 86a957439b..669e1333c7 100644 --- a/Projectiles/Boss/AresPlasmaFireball.cs +++ b/Projectiles/Boss/AresPlasmaFireball.cs @@ -126,14 +126,6 @@ namespace CalamityMod.Projectiles.Boss public override bool CanHitPlayer(Player target) => Projectile.Opacity == 1f; - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0 || Projectile.Opacity != 1f) - return; - - target.AddBuff(BuffID.CursedInferno, 180); - } - public override bool PreDraw(ref Color lightColor) { lightColor.R = (byte)(255 * Projectile.Opacity); diff --git a/Projectiles/Boss/ArtemisLaser.cs b/Projectiles/Boss/ArtemisLaser.cs index 38eede7c02..197657c4fe 100644 --- a/Projectiles/Boss/ArtemisLaser.cs +++ b/Projectiles/Boss/ArtemisLaser.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Boss // If a velocity is in reserve, set the true velocity to it and make it as "taken" by setting it to <0,0> if (Velocity != Vector2.Zero) { - Projectile.extraUpdates = CalamityWorld.LegendaryMode ? 4 : 3; + Projectile.extraUpdates = Main.getGoodWorld ? 4 : 3; Projectile.velocity = Velocity; Velocity = Vector2.Zero; Projectile.netUpdate = true; @@ -195,14 +195,6 @@ namespace CalamityMod.Projectiles.Boss public override bool CanHitPlayer(Player target) => TelegraphDelay > TelegraphTotalTime; - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0 || TelegraphDelay <= TelegraphTotalTime) - return; - - target.AddBuff(ModContent.BuffType(), 90); - } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { return CalamityUtils.CircularHitboxCollision(projHitbox.Center(), Projectile.Size.Length() * 0.5f, targetHitbox); diff --git a/Projectiles/Boss/ArtemisSpinLaserbeam.cs b/Projectiles/Boss/ArtemisSpinLaserbeam.cs index 08b27e1575..3bf0879995 100644 --- a/Projectiles/Boss/ArtemisSpinLaserbeam.cs +++ b/Projectiles/Boss/ArtemisSpinLaserbeam.cs @@ -151,7 +151,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 150); + target.AddBuff(ModContent.BuffType(), 300); } public override bool CanHitPlayer(Player target) => Projectile.scale >= 0.5f; diff --git a/Projectiles/Boss/AstralFlame.cs b/Projectiles/Boss/AstralFlame.cs index fc740c018b..b3c3cdd0de 100644 --- a/Projectiles/Boss/AstralFlame.cs +++ b/Projectiles/Boss/AstralFlame.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = 1; Projectile.timeLeft = 600; - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) Projectile.extraUpdates = 1; } diff --git a/Projectiles/Boss/BrimstoneMonster.cs b/Projectiles/Boss/BrimstoneMonster.cs index 3c9dab94fa..94fdc5611a 100644 --- a/Projectiles/Boss/BrimstoneMonster.cs +++ b/Projectiles/Boss/BrimstoneMonster.cs @@ -351,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 && AmalgamBuffList.Includes(buffType)) + if (target.buffTime[l] > 0 && CalamityBuffSets.BuffedByAmalgam[buffType]) { target.DelBuff(l); l--; diff --git a/Projectiles/Boss/BrimstoneRay.cs b/Projectiles/Boss/BrimstoneRay.cs index de5275700d..2bf79eff7a 100644 --- a/Projectiles/Boss/BrimstoneRay.cs +++ b/Projectiles/Boss/BrimstoneRay.cs @@ -134,8 +134,6 @@ namespace CalamityMod.Projectiles.Boss Vector2 projVelocity = Projectile.velocity.RotatedBy(radians * j + MathHelper.PiOver2); int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), fireFrom, projVelocity, type, BrimstoneElemental.DartDamage, 0f, Main.myPlayer, death ? 2f : 1f, 0f, projectileVelocityToPass); Main.projectile[proj].tileCollide = true; - if (CalamityWorld.LegendaryMode) - Main.projectile[proj].extraUpdates += 1; } fireFrom += velocity * distanceBetweenProjectiles; } diff --git a/Projectiles/Boss/DarkEnergyBall.cs b/Projectiles/Boss/DarkEnergyBall.cs index 498edb8a4e..69a37de561 100644 --- a/Projectiles/Boss/DarkEnergyBall.cs +++ b/Projectiles/Boss/DarkEnergyBall.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; Projectile.Opacity = 0f; - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) Projectile.extraUpdates = 1; } diff --git a/Projectiles/Boss/DarkEnergyBall2.cs b/Projectiles/Boss/DarkEnergyBall2.cs index 53e95b4bfe..d0de4c0066 100644 --- a/Projectiles/Boss/DarkEnergyBall2.cs +++ b/Projectiles/Boss/DarkEnergyBall2.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; Projectile.Opacity = 0f; - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) Projectile.extraUpdates = 1; } diff --git a/Projectiles/Boss/DesertScourgeSpit.cs b/Projectiles/Boss/DesertScourgeSpit.cs index 8f1271c812..7f66e9cd0f 100644 --- a/Projectiles/Boss/DesertScourgeSpit.cs +++ b/Projectiles/Boss/DesertScourgeSpit.cs @@ -25,12 +25,10 @@ namespace CalamityMod.Projectiles.Boss { Projectile.width = 16; Projectile.height = 16; - if (CalamityWorld.LegendaryMode) - Projectile.scale = 2f; Projectile.hostile = true; Projectile.tileCollide = false; Projectile.penetrate = 1; - Projectile.timeLeft = CalamityWorld.LegendaryMode ? 900 : 600; + Projectile.timeLeft = 600; Projectile.aiStyle = ProjAIStyleID.Arrow; Projectile.alpha = 255; } diff --git a/Projectiles/Boss/DoGBeam.cs b/Projectiles/Boss/DoGBeam.cs index 7336ec46f6..50ffd783ae 100644 --- a/Projectiles/Boss/DoGBeam.cs +++ b/Projectiles/Boss/DoGBeam.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = 1; Projectile.timeLeft = 960; - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) Projectile.extraUpdates = 1; } diff --git a/Projectiles/Boss/DoGWingdings.cs b/Projectiles/Boss/DoGWingdings.cs index c30a8365fb..bac601f122 100644 --- a/Projectiles/Boss/DoGWingdings.cs +++ b/Projectiles/Boss/DoGWingdings.cs @@ -1,6 +1,6 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Fonts; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using ReLogic.Graphics; using System; using System.IO; @@ -15,18 +15,8 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - public static DynamicSpriteFont Wingdings = null; - public string dialogue; - public override void SetStaticDefaults() - { - if (System.Environment.OSVersion.Platform == PlatformID.Win32NT) - { - Wingdings = CalamityMod.Instance.Assets.Request("Fonts/Wingdings", AssetRequestMode.ImmediateLoad).Value; - } - } - public override void SetDefaults() { Projectile.width = 28; @@ -100,10 +90,10 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { // Do not draw if the font isn't loaded or text is Cyrillic or Chinese - if (Wingdings == null || System.Environment.OSVersion.Platform != PlatformID.Win32NT || GameCulture.FromCultureName(GameCulture.CultureName.Chinese).IsActive || GameCulture.FromCultureName(GameCulture.CultureName.Russian).IsActive) + if (FontAssetSystem.Fonts["Wingdings"] == null || System.Environment.OSVersion.Platform != PlatformID.Win32NT || GameCulture.FromCultureName(GameCulture.CultureName.Chinese).IsActive || GameCulture.FromCultureName(GameCulture.CultureName.Russian).IsActive) return false; // Otherwise identical drawcode to CombatText - Vector2 stringSize = Wingdings.MeasureString(dialogue); + Vector2 stringSize = FontAssetSystem.Fonts["Wingdings"].MeasureString(dialogue); Vector2 origin = new Vector2(stringSize.X * 0.5f, stringSize.Y * 0.5f); Color cyan = Color.Cyan; float scale = Projectile.scale; @@ -146,11 +136,11 @@ namespace CalamityMod.Projectiles.Boss { float finalYPos = Projectile.position.Y - Main.screenPosition.Y; finalYPos = (float)Main.screenHeight - finalYPos; - Main.spriteBatch.DrawString(Wingdings, dialogue.ToUpper(), new Vector2(Projectile.position.X - Main.screenPosition.X + xOffset + origin.X, finalYPos + yOffset + origin.Y), color, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0f); + Main.spriteBatch.DrawString(FontAssetSystem.Fonts["Wingdings"], dialogue.ToUpper(), new Vector2(Projectile.position.X - Main.screenPosition.X + xOffset + origin.X, finalYPos + yOffset + origin.Y), color, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0f); } else { - Main.spriteBatch.DrawString(Wingdings, dialogue.ToUpper(), new Vector2(Projectile.position.X - Main.screenPosition.X + xOffset + origin.X, Projectile.position.Y - Main.screenPosition.Y + yOffset + origin.Y), color, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0f); + Main.spriteBatch.DrawString(FontAssetSystem.Fonts["Wingdings"], dialogue.ToUpper(), new Vector2(Projectile.position.X - Main.screenPosition.X + xOffset + origin.X, Projectile.position.Y - Main.screenPosition.Y + yOffset + origin.Y), color, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0f); } } return false; diff --git a/Projectiles/Boss/Flarenado.cs b/Projectiles/Boss/Flarenado.cs index 1f3fc488b8..f1c0368464 100644 --- a/Projectiles/Boss/Flarenado.cs +++ b/Projectiles/Boss/Flarenado.cs @@ -110,7 +110,7 @@ namespace CalamityMod.Projectiles.Boss center.Y += 2f; Projectile.NewProjectile(Projectile.GetSource_FromThis(), center, Projectile.velocity, Projectile.type, Projectile.damage, Projectile.knockBack, Projectile.owner, 11f, Projectile.ai[1] - 1f); } - int tornadoSpeed = 10; + int tornadoSpeed = 15; int breakThreshold = 300; Projectile.localAI[1] += 1f; bool breakapart = Main.zenithWorld && Projectile.localAI[1] >= breakThreshold; @@ -128,9 +128,6 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.localAI[1] == breakThreshold && Main.zenithWorld) { Projectile.velocity.X = Main.rand.NextBool() ? -tornadoSpeed : tornadoSpeed; - - if (CalamityWorld.LegendaryMode) - Projectile.velocity.X *= 1.5f; } if (Projectile.timeLeft == 480) @@ -159,7 +156,7 @@ namespace CalamityMod.Projectiles.Boss return; if (Projectile.timeLeft <= 480) - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 60); } } } diff --git a/Projectiles/Boss/GolemInfernoBlast.cs b/Projectiles/Boss/GolemInfernoBlast.cs new file mode 100644 index 0000000000..24c308ac5b --- /dev/null +++ b/Projectiles/Boss/GolemInfernoBlast.cs @@ -0,0 +1,56 @@ +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Boss +{ + public class GolemInfernoBlast : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Boss"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + private const int Lifetime = 900; + private const float Radius = 200f; + public override void SetDefaults() + { + Projectile.width = Projectile.height = 170; // Doesn't matter because circular hitbox + Projectile.hostile = true; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.timeLeft = Lifetime; + Projectile.Calamity().DealsDefenseDamage = true; + } + + public override void AI() + { + // Visual effects + for (int i = 0; i < 4; i++) + { + Vector2 spawn = Projectile.Center + Main.rand.NextVector2Circular(Radius, Radius); + HealingPlus test = new HealingPlus(spawn, 1f, Vector2.Zero, Color.Orange, Color.OrangeRed, 2) { Rotation = Main.rand.NextFloat(MathHelper.TwoPi) }; + GeneralParticleHandler.SpawnParticle(test); + } + + if (Projectile.timeLeft % 3 == 0) + { + FlameExplosion blast = new(Projectile.Center, Vector2.Zero, Color.Orange, Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.1f, 0.17f, 15, 0.7f); + GeneralParticleHandler.SpawnParticle(blast); + } + + for (int i = 0; i < 3; i++) + { + float randomMult = Main.rand.NextFloat(0.35f, 0.9f); + Vector2 dustSpawn = Projectile.Center + Main.rand.NextVector2CircularEdge(Radius, Radius) * randomMult; + Vector2 dustVel = Utils.DirectionTo(Projectile.Center, dustSpawn) * Utils.Remap(randomMult, 0.35f, 0.9f, 6f, 1f); + Dust fire = Dust.NewDustPerfect(dustSpawn, DustID.InfernoFork, dustVel, Scale: 1.25f); + fire.noGravity = true; + } + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Radius, targetHitbox); + public override bool CanHitPlayer(Player target) => Projectile.timeLeft < Lifetime - 30; + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.OnFire, 360); + } +} diff --git a/Projectiles/Boss/GolemInfernoBolt.cs b/Projectiles/Boss/GolemInfernoBolt.cs new file mode 100644 index 0000000000..0b61d5b2b6 --- /dev/null +++ b/Projectiles/Boss/GolemInfernoBolt.cs @@ -0,0 +1,50 @@ +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Boss +{ + public class GolemInfernoBolt : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Boss"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 12; + Projectile.hostile = true; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + } + + public override void AI() + { + if (Projectile.ai[2] == 0f) + { + SoundEngine.PlaySound(SoundID.Item20, Projectile.Center); + Projectile.ai[2] = 1f; + } + + bool hasReachedX = (Projectile.velocity.X < 0f && Projectile.Center.X < Projectile.ai[0]) || (Projectile.velocity.X > 0f && Projectile.Center.X > Projectile.ai[0]); + bool hasReachedY = (Projectile.velocity.Y < 0f && Projectile.Center.Y < Projectile.ai[1]) || (Projectile.velocity.Y > 0f && Projectile.Center.Y > Projectile.ai[1]); + + if (hasReachedX && hasReachedY) + Projectile.Kill(); + + // Add visual effects + MediumMistParticle mist = new(Projectile.Center, Main.rand.NextVector2Circular(3f, 3f), Color.Gray, Color.DarkGray, 0.5f, 192f); + GeneralParticleHandler.SpawnParticle(mist); + Dust.NewDustPerfect(Projectile.Center, DustID.InfernoFork, Main.rand.NextVector2Circular(2f, 2f), Scale: 1.75f); + } + + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.OnFire, 360); + public override void OnKill(int timeLeft) + { + if (Main.myPlayer == Projectile.owner) + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, 0f, Projectile.owner); + } + } +} diff --git a/Projectiles/Boss/GreatSandBlast.cs b/Projectiles/Boss/GreatSandBlast.cs index cbceb613d7..86ac452813 100644 --- a/Projectiles/Boss/GreatSandBlast.cs +++ b/Projectiles/Boss/GreatSandBlast.cs @@ -22,12 +22,12 @@ namespace CalamityMod.Projectiles.Boss { Projectile.width = 10; Projectile.height = 10; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) Projectile.scale = 2f; Projectile.hostile = true; Projectile.tileCollide = false; Projectile.penetrate = 1; - Projectile.timeLeft = CalamityWorld.LegendaryMode ? 900 : 600; + Projectile.timeLeft = Main.getGoodWorld ? 900 : 600; Projectile.aiStyle = ProjAIStyleID.Arrow; Projectile.alpha = 255; } diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index 90d11517e0..9fcca7cfd2 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -159,7 +159,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { int totalProjectiles = !ProvUtils.StandardAI() ? 8 : 6; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) totalProjectiles *= 2; float radians = MathHelper.TwoPi / totalProjectiles; diff --git a/Projectiles/Boss/HolyBurnOrb.cs b/Projectiles/Boss/HolyBurnOrb.cs index 0ac7a0ce8b..693c5353ec 100644 --- a/Projectiles/Boss/HolyBurnOrb.cs +++ b/Projectiles/Boss/HolyBurnOrb.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.timeLeft = 160; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { if (Projectile.velocity.Length() < 12f && Projectile.ai[1] == 0f) { diff --git a/Projectiles/Boss/HolyFire.cs b/Projectiles/Boss/HolyFire.cs index 0a3936aef6..b64fc8f3e2 100644 --- a/Projectiles/Boss/HolyFire.cs +++ b/Projectiles/Boss/HolyFire.cs @@ -93,12 +93,12 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { Vector2 velocity = new Vector2(0.01f, 0f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); @@ -109,12 +109,12 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { Vector2 velocity = new Vector2(0.05f, 0f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); diff --git a/Projectiles/Boss/HomingGasBulbSporeGas.cs b/Projectiles/Boss/HomingGasBulbSporeGas.cs index f7f002d02e..2fbf24928d 100644 --- a/Projectiles/Boss/HomingGasBulbSporeGas.cs +++ b/Projectiles/Boss/HomingGasBulbSporeGas.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { Projectile.ai[1] += 1f; - if (Projectile.ai[1] > (CalamityWorld.LegendaryMode ? 600f : 900f)) + if (Projectile.ai[1] > (Main.getGoodWorld ? 600f : 900f)) { Projectile.localAI[0] += 10f; } @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.rotation += Projectile.velocity.X * 0.02f; Projectile.rotation += Projectile.direction * 0.002f; - if (Projectile.velocity.Length() > (CalamityWorld.LegendaryMode ? 2f : 0.5f)) + if (Projectile.velocity.Length() > (Main.getGoodWorld ? 2f : 0.5f)) Projectile.velocity *= 0.985f; if (Projectile.timeLeft <= 40) @@ -99,7 +99,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - if (Projectile.ai[1] <= (CalamityWorld.LegendaryMode ? 600f : 900f) && Projectile.ai[1] > 120f) + if (Projectile.ai[1] <= (Main.getGoodWorld ? 600f : 900f) && Projectile.ai[1] > 120f) target.AddBuff(BuffID.Poisoned, 240); } } diff --git a/Projectiles/Boss/Infernado.cs b/Projectiles/Boss/Infernado.cs index 1e0477cfd1..884a3aa3af 100644 --- a/Projectiles/Boss/Infernado.cs +++ b/Projectiles/Boss/Infernado.cs @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Boss center.Y += 2f; Projectile.NewProjectile(Projectile.GetSource_FromThis(), center, Projectile.velocity, Projectile.type, Projectile.damage, Projectile.knockBack, Projectile.owner, 11f, Projectile.ai[1] - 1f); } - int tornadoSpeed = 10; + int tornadoSpeed = 15; int breakThreshold = 300; Projectile.localAI[1] += 1f; bool breakapart = Main.zenithWorld && Projectile.localAI[1] >= breakThreshold; @@ -130,9 +130,6 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.localAI[1] == breakThreshold && Main.zenithWorld) { Projectile.velocity.X = Main.rand.NextBool() ? -tornadoSpeed : tornadoSpeed; - - if (CalamityWorld.LegendaryMode) - Projectile.velocity.X *= 1.5f; } if (Projectile.timeLeft == 600) @@ -161,7 +158,7 @@ namespace CalamityMod.Projectiles.Boss return; if (Projectile.timeLeft <= 600) - target.AddBuff(ModContent.BuffType(), 150); + target.AddBuff(ModContent.BuffType(), 180); } } } diff --git a/Projectiles/Boss/Infernado2.cs b/Projectiles/Boss/Infernado2.cs index 2b3d614128..7b2c97c25d 100644 --- a/Projectiles/Boss/Infernado2.cs +++ b/Projectiles/Boss/Infernado2.cs @@ -155,7 +155,7 @@ namespace CalamityMod.Projectiles.Boss return; if (Projectile.timeLeft <= 720) - target.AddBuff(ModContent.BuffType(), 150); + target.AddBuff(ModContent.BuffType(), 180); } } } diff --git a/Projectiles/Boss/InfernadoRevenge.cs b/Projectiles/Boss/InfernadoRevenge.cs index 7e73ff201f..bcd9d4b570 100644 --- a/Projectiles/Boss/InfernadoRevenge.cs +++ b/Projectiles/Boss/InfernadoRevenge.cs @@ -113,7 +113,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 150); + target.AddBuff(ModContent.BuffType(), 180); } } } diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index f23933c8f6..19d312fc7d 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -168,7 +168,7 @@ namespace CalamityMod.Projectiles.Boss for (int b = 0; b < blobAmt; b++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f) + additionalBlobVelocity; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) velocity *= 2f; Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), BlobDamage, 0f, Projectile.owner); diff --git a/Projectiles/Boss/OldDukeGore.cs b/Projectiles/Boss/OldDukeGore.cs index b1fcb344fb..74b72f6f9a 100644 --- a/Projectiles/Boss/OldDukeGore.cs +++ b/Projectiles/Boss/OldDukeGore.cs @@ -80,14 +80,6 @@ namespace CalamityMod.Projectiles.Boss } } - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - target.AddBuff(ModContent.BuffType(), 180); - } - public override bool PreDraw(ref Color lightColor) { CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); diff --git a/Projectiles/Boss/OldDukeToothBallSpike.cs b/Projectiles/Boss/OldDukeToothBallSpike.cs index 6640ed68aa..16bfa07763 100644 --- a/Projectiles/Boss/OldDukeToothBallSpike.cs +++ b/Projectiles/Boss/OldDukeToothBallSpike.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 360); } public override void OnKill(int timeLeft) diff --git a/Projectiles/Boss/PhantomBlast.cs b/Projectiles/Boss/PhantomBlast.cs index 5c74ab7deb..b0083c28d1 100644 --- a/Projectiles/Boss/PhantomBlast.cs +++ b/Projectiles/Boss/PhantomBlast.cs @@ -110,13 +110,5 @@ namespace CalamityMod.Projectiles.Boss Main.dust[killGhostDust2].velocity *= 2f; } } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - target.AddBuff(ModContent.BuffType(), 120); - } } } diff --git a/Projectiles/Boss/PhantomBlast2.cs b/Projectiles/Boss/PhantomBlast2.cs index f4f724911c..e801a4083e 100644 --- a/Projectiles/Boss/PhantomBlast2.cs +++ b/Projectiles/Boss/PhantomBlast2.cs @@ -110,13 +110,5 @@ namespace CalamityMod.Projectiles.Boss Main.dust[killGhostDust2].velocity *= 2f; } } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - target.AddBuff(ModContent.BuffType(), 180); - } } } diff --git a/Projectiles/Boss/PhantomGhostShot.cs b/Projectiles/Boss/PhantomGhostShot.cs index 61f6e7a116..f11f34fd13 100644 --- a/Projectiles/Boss/PhantomGhostShot.cs +++ b/Projectiles/Boss/PhantomGhostShot.cs @@ -66,14 +66,6 @@ namespace CalamityMod.Projectiles.Boss } } - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - target.AddBuff(ModContent.BuffType(), 120); - } - public override Color? GetAlpha(Color lightColor) { return new Color(100, 250, 250, Projectile.alpha); diff --git a/Projectiles/Boss/PhantomHookShot.cs b/Projectiles/Boss/PhantomHookShot.cs index 32d119dd72..e8f110184e 100644 --- a/Projectiles/Boss/PhantomHookShot.cs +++ b/Projectiles/Boss/PhantomHookShot.cs @@ -66,14 +66,6 @@ namespace CalamityMod.Projectiles.Boss } } - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - target.AddBuff(ModContent.BuffType(), 80); - } - public override Color? GetAlpha(Color lightColor) { return new Color(100, 250, 250, Projectile.alpha); diff --git a/Projectiles/Boss/PhantomMine.cs b/Projectiles/Boss/PhantomMine.cs index 98d97725c7..ddc7a8bf6c 100644 --- a/Projectiles/Boss/PhantomMine.cs +++ b/Projectiles/Boss/PhantomMine.cs @@ -14,7 +14,6 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 30; Projectile.height = 30; Projectile.hostile = true; @@ -39,7 +38,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.velocity *= Projectile.ai[0]; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { if (Projectile.velocity.Length() >= Projectile.ai[0]) { @@ -98,17 +97,5 @@ namespace CalamityMod.Projectiles.Boss Main.dust[phantomDust2].velocity *= 2f; } } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - if (Projectile.velocity.Length() >= Projectile.ai[0]) - { - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 180); - } - } } } diff --git a/Projectiles/Boss/PhantomShot.cs b/Projectiles/Boss/PhantomShot.cs index 0cc7f9eed7..82aee0921a 100644 --- a/Projectiles/Boss/PhantomShot.cs +++ b/Projectiles/Boss/PhantomShot.cs @@ -67,13 +67,5 @@ namespace CalamityMod.Projectiles.Boss { return new Color(100, 250, 250, Projectile.alpha); } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - target.AddBuff(ModContent.BuffType(), 80); - } } } diff --git a/Projectiles/Boss/PhantomShot2.cs b/Projectiles/Boss/PhantomShot2.cs index fc48efce2d..352a950538 100644 --- a/Projectiles/Boss/PhantomShot2.cs +++ b/Projectiles/Boss/PhantomShot2.cs @@ -67,13 +67,5 @@ namespace CalamityMod.Projectiles.Boss { return new Color(250, 100, 100, Projectile.alpha); } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - target.AddBuff(ModContent.BuffType(), 120); - } } } diff --git a/Projectiles/Boss/SandPoisonCloudOldDuke.cs b/Projectiles/Boss/SandPoisonCloudOldDuke.cs index aba5827d69..ec90cc8009 100644 --- a/Projectiles/Boss/SandPoisonCloudOldDuke.cs +++ b/Projectiles/Boss/SandPoisonCloudOldDuke.cs @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 240, true); + target.AddBuff(ModContent.BuffType(), 480, true); } } } diff --git a/Projectiles/Boss/ShadeNimbusHostile.cs b/Projectiles/Boss/ShadeNimbusHostile.cs index cc42d08de0..a4e68db418 100644 --- a/Projectiles/Boss/ShadeNimbusHostile.cs +++ b/Projectiles/Boss/ShadeNimbusHostile.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Boss else { Projectile.ai[0] += 1f; - if (Projectile.ai[0] >= (CalamityWorld.LegendaryMode ? 10f : 36f)) + if (Projectile.ai[0] >= (Main.getGoodWorld ? 10f : 36f)) { Projectile.ai[0] = 0f; int rainSpawnX = (int)(Projectile.position.X + 14f + (float)Main.rand.Next(Projectile.width - 28)); diff --git a/Projectiles/Boss/SporeGasPlantera.cs b/Projectiles/Boss/SporeGasPlantera.cs index 37da7212b3..f84715fe34 100644 --- a/Projectiles/Boss/SporeGasPlantera.cs +++ b/Projectiles/Boss/SporeGasPlantera.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { Projectile.ai[1] += 1f; - if (Projectile.ai[1] > (CalamityWorld.LegendaryMode ? 600f : 900f)) + if (Projectile.ai[1] > (Main.getGoodWorld ? 600f : 900f)) { Projectile.localAI[0] += 10f; Projectile.damage = 0; @@ -68,17 +68,17 @@ namespace CalamityMod.Projectiles.Boss Projectile.rotation += Projectile.velocity.X * 0.02f; Projectile.rotation += Projectile.direction * 0.002f; - if (Projectile.velocity.Length() > (CalamityWorld.LegendaryMode ? 4f : 2f)) + if (Projectile.velocity.Length() > (Main.getGoodWorld ? 4f : 2f)) Projectile.velocity *= 0.985f; } - public override bool CanHitPlayer(Player target) => Projectile.ai[1] <= (CalamityWorld.LegendaryMode ? 600f : 900f) && Projectile.ai[1] > 120f; + public override bool CanHitPlayer(Player target) => Projectile.ai[1] <= (Main.getGoodWorld ? 600f : 900f) && Projectile.ai[1] > 120f; public override Color? GetAlpha(Color lightColor) { - if (Projectile.ai[1] > (CalamityWorld.LegendaryMode ? 600f : 900f)) + if (Projectile.ai[1] > (Main.getGoodWorld ? 600f : 900f)) { - byte b2 = (byte)((26f - (Projectile.ai[1] - (CalamityWorld.LegendaryMode ? 600f : 900f))) * 10f); + byte b2 = (byte)((26f - (Projectile.ai[1] - (Main.getGoodWorld ? 600f : 900f))) * 10f); byte a2 = (byte)(Projectile.alpha * (b2 / 255f)); return new Color(b2, b2, b2, a2); } @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - if (Projectile.ai[1] <= (CalamityWorld.LegendaryMode ? 600f : 900f) && Projectile.ai[1] > 120f) + if (Projectile.ai[1] <= (Main.getGoodWorld ? 600f : 900f) && Projectile.ai[1] > 120f) target.AddBuff(BuffID.Poisoned, 480); } } diff --git a/Projectiles/Boss/SupremeCatastropheSlash.cs b/Projectiles/Boss/SupremeCatastropheSlash.cs index 0e6a90038c..1939353905 100644 --- a/Projectiles/Boss/SupremeCatastropheSlash.cs +++ b/Projectiles/Boss/SupremeCatastropheSlash.cs @@ -26,8 +26,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; - // These never naturally use rotations, so this shouldn't be an issue. Projectile.width = 100; Projectile.height = 60; diff --git a/Projectiles/Boss/THanosSideLaser.cs b/Projectiles/Boss/THanosSideLaser.cs index e17154f9d9..d3d797b890 100644 --- a/Projectiles/Boss/THanosSideLaser.cs +++ b/Projectiles/Boss/THanosSideLaser.cs @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Boss // If a velocity is in reserve, set the true velocity to it and make it as "taken" by setting it to <0,0> if (Velocity != Vector2.Zero) { - Projectile.extraUpdates = CalamityWorld.LegendaryMode ? 4 : 3; + Projectile.extraUpdates = Main.getGoodWorld ? 4 : 3; Projectile.velocity = Velocity; Velocity = Vector2.Zero; Projectile.netUpdate = true; diff --git a/Projectiles/Boss/ThanatosBeamStart.cs b/Projectiles/Boss/ThanatosBeamStart.cs index 42a1b9140c..f2c2441310 100644 --- a/Projectiles/Boss/ThanatosBeamStart.cs +++ b/Projectiles/Boss/ThanatosBeamStart.cs @@ -136,7 +136,7 @@ namespace CalamityMod.Projectiles.Boss } // Periodically fire beams along the laser perpendicular to its direction. - float laserFireRate = (CalamityWorld.LegendaryMode) ? 60f : expertMode ? 80f : 160f; + float laserFireRate = Main.getGoodWorld ? 60f : expertMode ? 80f : 160f; if (Main.npc[OwnerIndex].Calamity().newAI[2] % laserFireRate == 0f) { // Play a laser sound to go with the beams. @@ -155,7 +155,7 @@ namespace CalamityMod.Projectiles.Boss float radians = MathHelper.TwoPi / totalProjectiles; for (int j = 0; j < totalProjectiles; j++) { - Vector2 projVelocity = (CalamityWorld.LegendaryMode) ? new Vector2(Main.rand.Next(-12, 12), Main.rand.Next(-12, 12)) : Projectile.velocity.RotatedBy(radians * j + MathHelper.PiOver2) * 12f; + Vector2 projVelocity = Main.getGoodWorld ? new Vector2(Main.rand.Next(-12, 12), Main.rand.Next(-12, 12)) : Projectile.velocity.RotatedBy(radians * j + MathHelper.PiOver2) * 12f; Projectile.NewProjectile(Projectile.GetSource_FromThis(), laserFirePosition, projVelocity, type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, -1f); } laserFirePosition += beamDirection * distanceBetweenProjectiles; @@ -240,7 +240,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(ModContent.BuffType(), 300); } public override bool CanHitPlayer(Player target) => OwnerIsValid && Projectile.scale >= 0.5f; diff --git a/Projectiles/Boss/ThanatosLaser.cs b/Projectiles/Boss/ThanatosLaser.cs index a8d06e422c..c0bbc975d5 100644 --- a/Projectiles/Boss/ThanatosLaser.cs +++ b/Projectiles/Boss/ThanatosLaser.cs @@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Boss // If a velocity is in reserve, set the true velocity to it and make it as "taken" by setting it to <0,0> if (Velocity != Vector2.Zero) { - Projectile.extraUpdates = CalamityWorld.LegendaryMode ? 4 : 3; + Projectile.extraUpdates = Main.getGoodWorld ? 4 : 3; Projectile.velocity = Velocity; Velocity = Vector2.Zero; Projectile.netUpdate = true; @@ -160,7 +160,7 @@ namespace CalamityMod.Projectiles.Boss // If a velocity is in reserve, set the true velocity to it and make it as "taken" by setting it to <0,0> if (Velocity != Vector2.Zero) { - Projectile.extraUpdates = CalamityWorld.LegendaryMode ? 4 : 3; + Projectile.extraUpdates = Main.getGoodWorld ? 4 : 3; Projectile.velocity = Velocity; Velocity = Vector2.Zero; Projectile.netUpdate = true; @@ -239,14 +239,6 @@ namespace CalamityMod.Projectiles.Boss public override bool CanHitPlayer(Player target) => TelegraphDelay > TelegraphTotalTime; - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0 || TelegraphDelay <= TelegraphTotalTime) - return; - - target.AddBuff(ModContent.BuffType(), 90); - } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { return CalamityUtils.CircularHitboxCollision(projHitbox.Center(), Projectile.Size.Length() * 0.5f, targetHitbox); diff --git a/Projectiles/Boss/UnstableCrimulanGlob.cs b/Projectiles/Boss/UnstableCrimulanGlob.cs index 3db3a7a054..2a49abbf7c 100644 --- a/Projectiles/Boss/UnstableCrimulanGlob.cs +++ b/Projectiles/Boss/UnstableCrimulanGlob.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.tileCollide = false; Projectile.timeLeft = CalamityWorld.death ? 490 : CalamityWorld.revenge ? 440 : Main.expertMode ? 390 : 240; - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) Projectile.extraUpdates = 1; } diff --git a/Projectiles/Boss/UnstableEbonianGlob.cs b/Projectiles/Boss/UnstableEbonianGlob.cs index 95ef39e3df..6a1cc8636b 100644 --- a/Projectiles/Boss/UnstableEbonianGlob.cs +++ b/Projectiles/Boss/UnstableEbonianGlob.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.tileCollide = false; Projectile.timeLeft = CalamityWorld.death ? 600 : CalamityWorld.revenge ? 540 : Main.expertMode ? 480 : 300; - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) Projectile.extraUpdates = 1; } diff --git a/Projectiles/Boss/YharonBulletHellVortex.cs b/Projectiles/Boss/YharonBulletHellVortex.cs index 430144499a..906fe2c972 100644 --- a/Projectiles/Boss/YharonBulletHellVortex.cs +++ b/Projectiles/Boss/YharonBulletHellVortex.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.hostile = true; Projectile.width = Projectile.height = (int)(408f * Projectile.scale); float inertia = 5f; - float speed = CalamityWorld.LegendaryMode ? 10.7f : 5.35f; + float speed = 5.35f; float minDist = 160f; if (victim >= 0 && Main.player[victim].active && !Main.player[victim].dead) { @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Boss } // Fly away from other vortices - float pushForce = CalamityWorld.LegendaryMode ? 0.1f : 0.05f; + float pushForce = 0.05f; for (int k = 0; k < Main.maxProjectiles; k++) { Projectile otherProj = Main.projectile[k]; diff --git a/Projectiles/Boss/YharonFireball.cs b/Projectiles/Boss/YharonFireball.cs index 89771b207e..b7b87e1de4 100644 --- a/Projectiles/Boss/YharonFireball.cs +++ b/Projectiles/Boss/YharonFireball.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 34; Projectile.height = 34; Projectile.hostile = true; diff --git a/Projectiles/Boss/YharonFireball2.cs b/Projectiles/Boss/YharonFireball2.cs index 5457f659ec..96b9044f0d 100644 --- a/Projectiles/Boss/YharonFireball2.cs +++ b/Projectiles/Boss/YharonFireball2.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 34; Projectile.height = 34; Projectile.hostile = true; diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index a211a8a134..6fe1f34c6c 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -13,6 +13,8 @@ using CalamityMod.Events; using CalamityMod.ExtraTextures; using CalamityMod.Items.Accessories; using CalamityMod.Items.Ammo; +using CalamityMod.Items.Armor.Daedalus; +using CalamityMod.Items.Armor.Reaver; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.NPCs; @@ -191,21 +193,6 @@ namespace CalamityMod.Projectiles /// public int timesPierced = 0; - /// - /// If this projectile uses point-blank damage, this gets set to , then is decremented every frame.
- /// If it reaches 0, this projectile can no longer deal point-blank damage. - ///
- public int pointBlankShotDuration = 0; - /// - /// If this projectile uses point-blank damage, this value is incremented on every update by the distance the projectile traveled on that update.
- /// If it exceeds , this projectile can no longer deal point-blank damage. - ///
- public float pointBlankShotDistanceTravelled = 0f; - /// Constant variable which stores how many frames a projectile is allowed to deal point-blank damage. - public const int DefaultPointBlankDuration = 18; - /// Constant variable which stores the maximum distance a projectile can travel to deal point-blank damage, in pixels. - public const float PointBlankShotDistanceLimit = 240f; // 15 tiles - // Empress of Light variables private const float EmpressRainbowStreakSpreadOutCutoff = 140f; private const int EmpressLastingRainbowTotalDuration = 660; @@ -266,10 +253,6 @@ namespace CalamityMod.Projectiles /// Cooldown variable used to prevent projectiles from spawning orbs while in The Transformer's aura. public int TransformerTimer = 0; - // Note: Although this was intended for fishing line colors, I use this as an AI variable a lot because vanilla only has 4 that sometimes are already in use. ~Ben - // TODO -- uses of this variable are undocumented and unstable. Remove it from the API surface. - public int lineColor = 0; - /// /// There are several NPCs in Calamity which do not take damage from minions in certain circumstances.
/// If true, this variable allows a projectile that deals summon damage to bypass this mechanic. @@ -409,12 +392,6 @@ namespace CalamityMod.Projectiles #endregion - if (!Main.player[projectile.owner].ActiveItem().IsAir && !Main.player[projectile.owner].ActiveItem().Calamity().canFirePointBlankShots) - pointBlankShotDuration = 0; - - if (pointBlankShotDuration > 0) - pointBlankShotDuration--; - // Reduce secondary yoyo damage if the player has Yoyo Glove // Brief behavior documentation of yoyo AI: ai[0, 1] are the x, y co-ords and localAI[0] is the airtime in frames // All secondary yoyos are spawned with ai[0] of 1 which tells then tell its AI to do secondary yoyo AI @@ -1042,105 +1019,6 @@ namespace CalamityMod.Projectiles } } - else if (projectile.type == ProjectileID.Sharknado) - { - int num535 = 10; - int num536 = 15; - float num537 = 1f; - int num538 = 150; - int num539 = 42; - - if (projectile.velocity.X != 0f) - projectile.direction = (projectile.spriteDirection = -Math.Sign(projectile.velocity.X)); - - projectile.frameCounter++; - if (projectile.frameCounter > 2) - { - projectile.frame++; - projectile.frameCounter = 0; - } - - if (projectile.frame >= 6) - projectile.frame = 0; - - if (projectile.localAI[0] == 0f && Main.myPlayer == projectile.owner) - { - projectile.localAI[0] = 1f; - projectile.position.X += projectile.width / 2; - projectile.position.Y += projectile.height / 2; - projectile.scale = ((float)(num535 + num536) - projectile.ai[1]) * num537 / (float)(num536 + num535); - projectile.width = (int)((float)num538 * projectile.scale); - projectile.height = (int)((float)num539 * projectile.scale); - projectile.position.X -= projectile.width / 2; - projectile.position.Y -= projectile.height / 2; - projectile.netUpdate = true; - } - - if (projectile.ai[1] != -1f) - { - projectile.scale = ((float)(num535 + num536) - projectile.ai[1]) * num537 / (float)(num536 + num535); - projectile.width = (int)((float)num538 * projectile.scale); - projectile.height = (int)((float)num539 * projectile.scale); - } - - int maxAlpha = 150; - int minAlpha = 60; - if (projectile.timeLeft > FishronSharknadoTotalDuration - FishronTornadoTimeBeforeDealingDamage) - { - maxAlpha = 220; - minAlpha = 180; - } - - if (!Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.alpha -= 30; - if (projectile.alpha < minAlpha) - projectile.alpha = minAlpha; - } - else - { - projectile.alpha += 30; - if (projectile.alpha > maxAlpha) - projectile.alpha = maxAlpha; - } - - if (projectile.ai[0] > 0f) - projectile.ai[0]--; - - if (projectile.ai[0] == 1f && projectile.ai[1] > 0f && projectile.owner == Main.myPlayer) - { - projectile.netUpdate = true; - Vector2 center4 = projectile.Center; - center4.Y -= (float)num539 * projectile.scale / 2f; - float num540 = ((float)(num535 + num536) - projectile.ai[1] + 1f) * num537 / (float)(num536 + num535); - center4.Y -= (float)num539 * num540 / 2f; - center4.Y += 2f; - Projectile.NewProjectile(projectile.GetSource_FromAI(), center4, projectile.velocity, projectile.type, projectile.damage, projectile.knockBack, projectile.owner, 10f, projectile.ai[1] - 1f); - int num541 = 4; - - if ((int)projectile.ai[1] % num541 == 0 && projectile.ai[1] != 0f) - { - int num542 = NPCID.Sharkron; - int num543 = NPC.NewNPC(projectile.GetSource_FromAI(), (int)center4.X, (int)center4.Y, num542); - Main.npc[num543].velocity = projectile.velocity; - Main.npc[num543].netUpdate = true; - } - } - - if (projectile.ai[0] <= 0f) - { - float num544 = MathHelper.Pi / 30f; - float num545 = (float)projectile.width / 5f; - float num546 = (float)(Math.Cos(num544 * (0f - projectile.ai[0])) - 0.5) * num545; - projectile.position.X -= num546 * (float)(-projectile.direction); - projectile.ai[0]--; - num546 = (float)(Math.Cos(num544 * (0f - projectile.ai[0])) - 0.5) * num545; - projectile.position.X += num546 * (float)(-projectile.direction); - } - - return false; - } - // Larger cthulhunadoes else if (projectile.type == ProjectileID.Cthulunado) { @@ -2288,7 +2166,7 @@ namespace CalamityMod.Projectiles if (projectile.velocity.Y > 16f) projectile.velocity.Y = 16f; - if (CalamityWorld.LegendaryMode && projectile.velocity.Length() > 4f) + if (Main.getGoodWorld && projectile.velocity.Length() > 4f) projectile.velocity *= 0.985f; return false; @@ -2556,110 +2434,6 @@ namespace CalamityMod.Projectiles return false; } - else if (projectile.type == ProjectileID.InfernoHostileBolt && projectile.ai[2] > 0f) - { - if (projectile.localAI[0] == 0f) - { - SoundEngine.PlaySound(SoundID.Item20, projectile.position); - projectile.localAI[0] += 1f; - } - - bool killX = false; - bool killY = false; - if (projectile.velocity.X < 0f && projectile.position.X < projectile.ai[0]) - killX = true; - - if (projectile.velocity.X > 0f && projectile.position.X > projectile.ai[0]) - killX = true; - - if (projectile.velocity.Y < 0f && projectile.position.Y < projectile.ai[1]) - killY = true; - - if (projectile.velocity.Y > 0f && projectile.position.Y > projectile.ai[1]) - killY = true; - - if (killX && killY) - projectile.Kill(); - - for (int i = 0; i < 10; i++) - { - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.IchorTorch, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1.6f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0.3f; - Main.dust[dust].velocity += projectile.velocity * 0.1f; - if (CalamityWorld.LegendaryMode) - Main.dust[dust].noLight = true; - } - - Particle theSpark = new AltSparkParticle(projectile.Center, projectile.velocity * 0.06f + projectile.velocity * 0.1f, false, 40, 1f, new Color(255, 255, 100)); - GeneralParticleHandler.SpawnParticle(theSpark); - - return false; - } - - else if (projectile.type == ProjectileID.InfernoHostileBlast && projectile.ai[2] > 0f) - { - if (projectile.localAI[0] == 0f) - { - SoundEngine.PlaySound(SoundID.Item74, projectile.position); - projectile.localAI[0] += 1f; - } - - projectile.ai[0] += 1f; - - float totalDust = 20f; - if (projectile.ai[0] > 540f) - totalDust -= (projectile.ai[0] - 180f) / 2f; - - if (totalDust <= 0f) - { - totalDust = 0f; - projectile.Kill(); - } - - float maxDustVelocityX = 10f; - float maxDustVelocityY = 10f; - float minDustSpeed = 3f; - float maxDustSpeed = 8f; - - for (int i = 0; i < (int)totalDust; i++) - { - float dustVelocityX = Main.rand.NextFloat(-maxDustVelocityX, maxDustVelocityX); - float dustVelocityY = Main.rand.NextFloat(-maxDustVelocityY, maxDustVelocityY); - float randomDustSpeed = Main.rand.NextFloat(minDustSpeed, maxDustSpeed); - float velocityLength = (float)Math.Sqrt(dustVelocityX * dustVelocityX + dustVelocityY * dustVelocityY); - velocityLength = randomDustSpeed / velocityLength; - dustVelocityX *= velocityLength; - dustVelocityY *= velocityLength; - Vector2 dustVelocity = new Vector2(dustVelocityX, dustVelocityY); - Vector2 dustPosition = projectile.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-10f, 10f)); - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.IchorTorch, 0f, 0f, 100, default, 1.8f); - Main.dust[dust].noGravity = true; - Main.dust[dust].position = dustPosition; - Main.dust[dust].velocity = dustVelocity; - if (CalamityWorld.LegendaryMode) - Main.dust[dust].noLight = true; - } - - float maxSparkVelocityX = 10f; - float maxSparkVelocityY = 10f; - float minSparkSpeed = 3f; - float maxSparkSpeed = 7f; - - float sparkVelocityX = Main.rand.NextFloat(-maxSparkVelocityX, maxSparkVelocityX); - float sparkVelocityY = Main.rand.NextFloat(-maxSparkVelocityY, maxSparkVelocityY); - float randSparkSpeed = Main.rand.NextFloat(minSparkSpeed, maxSparkSpeed); - float sparkLength = (float)Math.Sqrt(sparkVelocityX * sparkVelocityX + sparkVelocityY * sparkVelocityY); - sparkLength = randSparkSpeed / sparkLength; - sparkVelocityX *= sparkLength; - sparkVelocityY *= sparkLength; - - Particle theSpark = new AltSparkParticle(projectile.Center, new Vector2(sparkVelocityX, sparkVelocityY), false, 40, 1f, new Color(255, 255, 100)); - GeneralParticleHandler.SpawnParticle(theSpark); - - return false; - } - else if (projectile.type == ProjectileID.AncientDoomProjectile) { if (projectile.velocity.Length() < 6f) @@ -2887,7 +2661,7 @@ namespace CalamityMod.Projectiles return false; } - float velocityLimit = (death ? 28f : 24f) / MathHelper.Clamp(lineColor * 0.75f, 1f, 3f); + float velocityLimit = (death ? 28f : 24f) / MathHelper.Clamp(projectile.ai[2] * 0.75f, 1f, 3f); if (projectile.velocity.Length() < velocityLimit) projectile.velocity *= 1.01f; } @@ -3144,22 +2918,19 @@ namespace CalamityMod.Projectiles if (NPC.downedMoonlord) { - if (BuffedDungeonProjectilesList.Includes(projectile.type)) + if (CalamityProjectileSets.IsBuffedDungeonProjectile[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; - // These projectiles will not be buffed if Golem fires them - bool isGolemBossProjectile = (projectile.type == ProjectileID.InfernoHostileBolt || projectile.type == ProjectileID.InfernoHostileBlast) && projectile.ai[2] > 0f; - - if (!isSkeletronBossProjectile && !isGolemBossProjectile) + if (!isSkeletronBossProjectile) projectile.damage += 30; } } if (DownedBossSystem.downedDoG && (Main.pumpkinMoon || Main.snowMoon || Main.eclipse)) { - if (EventProjectileBuffList.Includes(projectile.type)) + if (CalamityProjectileSets.IsBuffedEventProjectile[projectile.type]) projectile.damage += 15; } @@ -3325,6 +3096,18 @@ namespace CalamityMod.Projectiles projectile.velocity *= 1.0025f; } + // Sharknado is more translucent before dealing damage + if (projectile.type == ProjectileID.Sharknado) + { + if (projectile.timeLeft > FishronCthulhunadoTotalDuration - FishronTornadoTimeBeforeDealingDamage) + { + if (projectile.alpha < 200) + projectile.alpha = 200; + if (projectile.alpha > 220) + projectile.alpha = 220; + } + } + // Accelerate for 1.5 seconds to full velocity if (projectile.type == ProjectileID.HallowBossLastingRainbow && (CalamityWorld.revenge || BossRushEvent.BossRushActive)) { @@ -3415,36 +3198,6 @@ namespace CalamityMod.Projectiles } } - if (projectile.type == ProjectileID.OrnamentFriendly && lineColor == 1) //spawned by Festive Wings - { - Vector2 center = projectile.Center; - float maxDistance = 460f; - bool homeIn = false; - - foreach (NPC n in Main.ActiveNPCs) - { - if (n.CanBeChasedBy(projectile, false)) - { - float extraDistance = (float)(n.width / 2) + (n.height / 2); - - bool canHit = Collision.CanHit(projectile.Center, 1, 1, n.Center, 1, 1); - - if (Vector2.Distance(n.Center, projectile.Center) < (maxDistance + extraDistance) && canHit) - { - center = n.Center; - homeIn = true; - break; - } - } - } - - if (homeIn) - { - Vector2 moveDirection = projectile.SafeDirectionTo(center, Vector2.UnitY); - projectile.velocity = (projectile.velocity * 20f + moveDirection * 15f) / 21f; - } - } - if (!projectile.npcProj && !projectile.trap && projectile.friendly && projectile.damage > 0) { if (modPlayer.fungalSymbiote && player.HasBuff(BuffType())) @@ -3530,10 +3283,9 @@ namespace CalamityMod.Projectiles { if (Main.player[projectile.owner].miscCounter % 30 == 0 && projectile.FinalExtraUpdate()) { - if (projectile.owner == Main.myPlayer && player.ownedProjectileCounts[ProjectileID.CrystalShard] < 15) + if (projectile.owner == Main.myPlayer && player.ownedProjectileCounts[ProjectileID.CrystalShard] < DaedalusHeadRogue.ShardCountLimit) { - // Daedalus Rogue Crystals: 25%, soft cap starts at 120 base damage - int crystalDamage = CalamityUtils.DamageSoftCap(projectile.damage * 0.25, 30); + int crystalDamage = CalamityUtils.DamageSoftCap(projectile.damage * DaedalusHeadRogue.ShardDamageRatio, DaedalusHeadRogue.ShardDamageSoftcap); Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); int shard = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, velocity, ProjectileID.CrystalShard, crystalDamage, 0f, projectile.owner); @@ -3698,7 +3450,7 @@ namespace CalamityMod.Projectiles showArcFlash = true; if (conditionalHomingRange > 0f) { - CalamityUtils.HomeInOnNPC(projectile, !projectile.tileCollide, conditionalHomingRange, 12f, 20f); + CalamityUtils.HomeInOnNPC(projectile, !projectile.tileCollide, conditionalHomingRange, 12f, 20f,true); } if (brimstoneBullets) { @@ -3872,22 +3624,15 @@ namespace CalamityMod.Projectiles } // Spawn Bloom Stone flower on landed hooks - // Should only spawn if: Projectile is a hook, hook is grappled to a tile, the player is wearing Bloom Stone, no flower has been spawned from this hook, no pollen exists + // Should only spawn if: Projectile is a hook, hook is grappled to a tile, the player is wearing Bloom Stone, no flower has been spawned from this hook if (projectile.aiStyle == ProjAIStyleID.Hook && projectile.ai[0] == 2f && - Main.player[projectile.owner].Calamity().bloomStone && !hookCanSpawnFlower && - !CalamityUtils.AnyOwnedProjectiles(ProjectileType(), projectile.owner)) + Main.player[projectile.owner].Calamity().bloomStone && !hookCanSpawnFlower) { hookCanSpawnFlower = true; if (Main.myPlayer == projectile.owner) Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileType(), 0, 0f, projectile.owner, projectile.whoAmI); } - // CIT 29JUN2024: Moved from PreAI to PostAI so that it is called every update instead of every frame. - // This makes the distance traveled increment more accurately for projectiles with extra updates, as previously projectiles with extra updates - // would add the distance traveled for the whole frame on the first update, making the distance checking much choppier. - if (pointBlankShotDistanceTravelled < PointBlankShotDistanceLimit) - pointBlankShotDistanceTravelled += projectile.velocity.Length(); - // optimization to remove conversion X/Y loop for irrelevant projectiles bool isConversionProjectile = projectile.type == ProjectileID.PurificationPowder || projectile.type == ProjectileID.VilePowder @@ -3968,33 +3713,44 @@ namespace CalamityMod.Projectiles { if (player.Calamity().bloomStoneHookVisuals) { - // Insert vine effect when spawning a hook + for (int i = 0; i < 8; i++) + { + Particle floweyFromHitGameUndertale = new CustomSpark(player.Center, Utils.DirectionTo(player.Center, player.Calamity().mouseWorld).RotatedByRandom(0.6f) * Main.rand.NextFloat(4f, 11f), + "CalamityMod/Particles/MiniFlower", false, Main.rand.Next(65, 78 + 1), Main.rand.NextFloat(1.8f, 2.8f), + Color.Lerp(Color.HotPink, Color.Plum, Main.rand.NextFloat(0, 0.65f)), new Vector2(1f, 1f), true, extraRotation: Main.rand.NextFloat(0, MathHelper.TwoPi)); + GeneralParticleHandler.SpawnParticle(floweyFromHitGameUndertale); + + Dust pollenDust = Dust.NewDustPerfect(player.Center, DustType()); + pollenDust.noLightEmittence = true; + pollenDust.noGravity = true; + pollenDust.scale = Main.rand.NextFloat(0.9f, 1.4f); + pollenDust.color = Main.rand.NextBool() ? Color.Gold : Color.HotPink; + pollenDust.velocity = Utils.DirectionTo(player.Center, player.Calamity().mouseWorld).RotatedByRandom(0.6f) * Main.rand.NextFloat(4f, 11f); + pollenDust.fadeIn = -0.5f; + } } } public override void GrapplePullSpeed(Projectile projectile, Player player, ref float speed) { float mult = 1f; if (player.Calamity().reaverSpeed) - mult += 0.5f; + mult += ReaverHeadMobility.SetBonusHookBoost; if (player.Calamity().tungstenArmorHookBoost) mult += TungstenArmorSetChange.HookBoost; if (player.Calamity().bloomStone) mult += 0.5f; speed *= mult; - // Visual flowers while being pulled - if (player.Calamity().bloomStoneHookVisuals && player.miscCounter % 5 == 0 && player.velocity.Length() > 2f) + if (player.velocity.Length() > 2f) { - Vector2 spawnPos = player.Center + Main.rand.NextVector2Circular(20f, 20f); - CustomSprite flowey = new(spawnPos, Vector2.Zero, 12, "CalamityMod/Projectiles/Magic/GleamingBolt", 0.425f, Color.White * 0.75f, 0f, false); - GeneralParticleHandler.SpawnParticle(flowey); + player.Calamity().hookPullVisuals = 60; } } public override void GrappleRetreatSpeed(Projectile projectile, Player player, ref float speed) { float mult = 1f; if (player.Calamity().reaverSpeed) - mult += 0.5f; + mult += ReaverHeadMobility.SetBonusHookBoost; if (player.Calamity().tungstenArmorHookBoost) mult += TungstenArmorSetChange.HookBoost; if (player.Calamity().bloomStone) @@ -4136,7 +3892,13 @@ namespace CalamityMod.Projectiles { if (BloodstoneOrbValue > 0) Projectile.NewProjectile(projectile.GetSource_OnHit(target), projectile.Center, projectile.velocity.SafeNormalize(Vector2.Zero) * Math.Min(((projectile.velocity.Length() * projectile.MaxUpdates) / 4f), 4f) * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType(), BloodstoneOrbValue, 0f, Main.player[projectile.owner].whoAmI); - + //Mana Burn + if (Main.player[projectile.owner].statMana < 0) + { + float burnRatio = (-Main.player[projectile.owner].statMana / 5000f); // -400 mana = +8% dmg, -700 mana = +14% dmg + target.Calamity().manaBurn += damageDone * burnRatio; + target.Calamity().playerManaBurnIntensity = -Main.player[projectile.owner].statMana / (float)Main.player[projectile.owner].statManaMax2; + } // Hyperius Overflow if (projectile.type != ProjectileType() && projectile.type != ProjectileType() && projectile.type != ProjectileType() && projectile.type != ProjectileType() && target.Calamity().hyperiusMarked) { @@ -4162,18 +3924,15 @@ namespace CalamityMod.Projectiles // Implementation of shared static iframes. // If this projectile does not use static iframes, or is not registered to share them, then do nothing. - if (!projectile.usesIDStaticNPCImmunity || !SharedStaticIFrames.Includes(projectile.type)) - return; - - // Get the set of shared static iframe projectile types. - // If it's empty, then do nothing. - IList sharedWithProjectiles = SharedStaticIFrames.GetSharedStaticIFrames(projectile.type); - if (sharedWithProjectiles.Count <= 0) + if (!projectile.usesIDStaticNPCImmunity || CalamityProjectileSets.SharedIDStaticIFrames[projectile.type] == -1) return; // Apply the appropriate shared static iframes to all projectile types with which it is shared. - foreach (int projType in sharedWithProjectiles) - Projectile.perIDStaticNPCImmunity[projType][target.whoAmI] = Main.GameUpdateCount + (uint)projectile.idStaticNPCHitCooldown; + for (int proj = 0; proj < CalamityProjectileSets.SharedIDStaticIFrames.Length; proj++) + { + if (CalamityProjectileSets.SharedIDStaticIFrames[proj] == CalamityProjectileSets.SharedIDStaticIFrames[projectile.type]) + Projectile.perIDStaticNPCImmunity[proj][target.whoAmI] = Main.GameUpdateCount + (uint)projectile.idStaticNPCHitCooldown; + } } #endregion @@ -4191,7 +3950,7 @@ namespace CalamityMod.Projectiles case ProjectileID.DeerclopsIceSpike: if (CalamityWorld.revenge || BossRushEvent.BossRushActive) { - float fadeInTime = 50f; + float fadeInTime = 25f; float fadeOutGateValue = death ? 90f : 65f; return (projectile.ai[0] >= fadeInTime && projectile.ai[0] < fadeOutGateValue); } @@ -4598,7 +4357,6 @@ namespace CalamityMod.Projectiles public override bool PreKill(Projectile projectile, int timeLeft) { bool revQueenBeeBeeHive = projectile.type == ProjectileID.BeeHive && (CalamityWorld.revenge || BossRushEvent.BossRushActive) && (projectile.ai[2] == 1f || CalamityWorld.death); - bool revGolemInferno = projectile.type == ProjectileID.InfernoHostileBolt && projectile.ai[2] > 0f; if (revQueenBeeBeeHive) { @@ -4674,17 +4432,9 @@ namespace CalamityMod.Projectiles if (Main.netMode != NetmodeID.SinglePlayer) NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, projectile.identity, projectile.owner); } - - else if (revGolemInferno) - { - Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileID.InfernoHostileBlast, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f, projectile.ai[2]); - - if (Main.netMode != NetmodeID.SinglePlayer) - NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, projectile.identity, projectile.owner); - } } - if (revQueenBeeBeeHive || revGolemInferno) + if (revQueenBeeBeeHive) { projectile.active = false; return false; diff --git a/Projectiles/CalamityGlobalProjectileTweaks.cs b/Projectiles/CalamityGlobalProjectileTweaks.cs index ea7e30bc23..e190ebfb24 100644 --- a/Projectiles/CalamityGlobalProjectileTweaks.cs +++ b/Projectiles/CalamityGlobalProjectileTweaks.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles IProjectileTweak[] defenseDamage = Do(DefenseDamage); IProjectileTweak[] trueMelee = Do(TrueMelee, DefaultIDStaticIFrames); // All the tweaked true melee projectiles need to be changed from global to static as well IProjectileTweak[] trueMeleeNoSpeed = Do(TrueMeleeNoSpeed, DefaultIDStaticIFrames); - IProjectileTweak[] pointBlank = Do(PointBlank); - IProjectileTweak[] standardBulletTweaks = Do(PointBlank, ExtraUpdatesDelta(+2)); + IProjectileTweak[] defaultIFrames = Do(DefaultIDStaticIFrames); + IProjectileTweak[] standardBulletTweaks = Do(ExtraUpdatesDelta(+2)); IProjectileTweak[] standardChainsawTweaks = Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+15), LocalIFrames(5)); IProjectileTweak[] standardDrillTweaks = Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+25), LocalIFrames(5)); IProjectileTweak[] counterweightTweaks = Do(MaxUpdatesExact(2), DefaultIDStaticIFrames); @@ -117,12 +117,12 @@ namespace CalamityMod.Projectiles { ProjectileID.Anchor, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.Arkhalis, Do(TrueMeleeNoSpeed, ScaleExact(1.25f), IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes { ProjectileID.Bee, Do(PiercingExact(2), DefaultIDStaticIFrames) }, - { ProjectileID.BeeArrow, Do(PointBlank, ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, + { ProjectileID.BeeArrow, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.BlackCounterweight, counterweightTweaks }, { ProjectileID.BlueCounterweight, counterweightTweaks }, { ProjectileID.BlueMoon, Do(ExtraUpdatesExact(1)) }, - { ProjectileID.Bullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, - { ProjectileID.BulletHighVelocity, Do(PointBlank, LocalIFrames(-1)) }, + { ProjectileID.Bullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, + { ProjectileID.BulletHighVelocity, Do(LocalIFrames(-1)) }, { ProjectileID.ButchersChainsaw, Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+15), LocalIFrames(7), ScaleExact(1.5f)) }, { ProjectileID.ChlorophyteChainsaw, standardChainsawTweaks }, { ProjectileID.ChlorophyteDrill, standardDrillTweaks }, @@ -130,10 +130,10 @@ namespace CalamityMod.Projectiles { ProjectileID.CobaltChainsaw, standardChainsawTweaks }, { ProjectileID.CobaltDrill, standardDrillTweaks }, { ProjectileID.CobaltNaginata, Do(TrueMelee, LocalIFrames(9)) }, - { ProjectileID.CrystalBullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, + { ProjectileID.CrystalBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.CrystalVileShardHead, Do(LocalIFrames(23)) }, { ProjectileID.CrystalVileShardShaft, Do(LocalIFrames(23)) }, - { ProjectileID.CursedBullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, + { ProjectileID.CursedBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.ClusterRocketI, Do(LocalIFrames(15)) }, { ProjectileID.ClusterFragmentsI, Do(IDStaticIFrames(15)) }, { ProjectileID.ClusterRocketII, Do(LocalIFrames(15)) }, @@ -146,7 +146,7 @@ namespace CalamityMod.Projectiles { ProjectileID.EmeraldBolt, Do(NoPiercing) }, { ProjectileID.EmpressBlade, Do(LocalIFrames(30)) }, // Terraprisma { ProjectileID.EnchantedBoomerang, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, - { ProjectileID.ExplosiveBullet, Do(PointBlank, ExtraUpdatesDelta(+2), IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes + { ProjectileID.ExplosiveBullet, Do(ExtraUpdatesDelta(+2), IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes { ProjectileID.FairyQueenRangedItemShot, Do(PiercingExact(7), ExtraUpdatesExact(1)) }, // Eventide Convert { ProjectileID.FlaironBubble, Do(ExtraUpdatesExact(1), TimeLeftExact(150), DefaultIDStaticIFrames) }, { ProjectileID.Flamarang, Do(ExtraUpdatesExact(2), DefaultIDStaticIFrames) }, @@ -158,13 +158,14 @@ namespace CalamityMod.Projectiles { ProjectileID.FruitcakeChakram, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.GiantBee, Do(PiercingExact(2), DefaultIDStaticIFrames) }, { ProjectileID.GladiusStab, Do(TrueMelee, LocalIFrames(-1)) }, - { ProjectileID.GoldenBullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, + { ProjectileID.GoldenBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.GoldenShowerFriendly, Do(PiercingExact(2), DefaultIDStaticIFrames) }, { ProjectileID.GreenCounterweight, counterweightTweaks }, { ProjectileID.Hamdrax, standardDrillTweaks }, // Drax (never internally renamed since 1.1) + { ProjectileID.HellfireArrow, Do(ExtraUpdatesDelta(+2)) }, { ProjectileID.IceBoomerang, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.IceSickle, Do(ExtraUpdatesExact(1)) }, - { ProjectileID.IchorBullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, + { ProjectileID.IchorBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.InfluxWaver, Do(ExtraUpdatesExact(1)) }, { ProjectileID.InfernoFriendlyBolt, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.InfernoFriendlyBlast, Do(ExtraUpdatesExact(2), DefaultIDStaticIFrames) }, @@ -181,14 +182,14 @@ namespace CalamityMod.Projectiles { ProjectileID.MythrilChainsaw, standardChainsawTweaks }, { ProjectileID.MythrilDrill, standardDrillTweaks }, { ProjectileID.MythrilHalberd, Do(TrueMelee, LocalIFrames(8)) }, - { ProjectileID.NanoBullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, + { ProjectileID.NanoBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.NebulaDrill, standardDrillTweaks }, { ProjectileID.NebulaLaser, Do(ExtraUpdatesDelta(-1)) }, { ProjectileID.OrichalcumChainsaw, standardChainsawTweaks }, { ProjectileID.OrichalcumDrill, standardDrillTweaks }, { ProjectileID.PalladiumChainsaw, standardChainsawTweaks }, { ProjectileID.PalladiumDrill, standardDrillTweaks }, - { ProjectileID.PartyBullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, + { ProjectileID.PartyBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.PoisonFang, Do(LocalIFrames(10)) }, { ProjectileID.PurpleCounterweight, counterweightTweaks }, { ProjectileID.QueenSlimeGelAttack, Do(NoPiercing) }, @@ -199,7 +200,6 @@ namespace CalamityMod.Projectiles { ProjectileID.RocketFireworkRed, Do(TimeLeftDelta(+45)) }, { ProjectileID.RocketFireworkYellow, Do(TimeLeftDelta(+45)) }, { ProjectileID.SawtoothShark, Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+15), LocalIFrames(6)) }, - { ProjectileID.ShadowBeamHostile, Do(ExtraUpdatesExact(1)) }, { ProjectileID.Shroomerang, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.SolarFlareDrill, standardDrillTweaks }, { ProjectileID.StardustDrill, standardDrillTweaks }, @@ -213,7 +213,7 @@ namespace CalamityMod.Projectiles { ProjectileID.TitaniumDrill, standardDrillTweaks }, { ProjectileID.Trimarang, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.TrueNightsEdge, Do(PiercingExact(4)) }, - { ProjectileID.VenomBullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, + { ProjectileID.VenomBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.VenomFang, Do(LocalIFrames(10)) }, { ProjectileID.VenomSpider, Do( ExtraUpdatesExact(2), LocalIFrames(45)) }, //Spider Staff spiders. It has Venom, Dangerous, and Jumping spiders. { ProjectileID.VortexDrill, standardDrillTweaks }, @@ -254,373 +254,356 @@ namespace CalamityMod.Projectiles { ProjectileID.VortexChainsaw, trueMeleeNoSpeed }, #endregion - #region CATEGORY 4: Point Blank support - { ProjectileID.Blizzard, Do(PointBlank, DefaultIDStaticIFrames) }, // Blizzard Staff projectiles, re-used in Frostbite Blaster. - { ProjectileID.BlueFlare, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.BoneArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.CandyCorn, Do(PointBlank, IDStaticIFrames(7)) }, // Has an exception in Vanilla iframe code, uses 7 iframes - { ProjectileID.ChlorophyteArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.ChlorophyteBullet, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.CrimsandBallGun, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.CrystalDart, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.CursedArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.CursedDart, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.DD2PhoenixBowShot, pointBlank }, // Phantom Phoenix - { ProjectileID.EbonsandBallGun, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.FireArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.Flare, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.FrostburnArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.Harpoon, pointBlank }, - { ProjectileID.Hellwing, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.HellfireArrow, Do(PointBlank, ExtraUpdatesDelta(+2)) }, - { ProjectileID.HolyArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.IchorArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.JestersArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.MoonlordArrow, pointBlank }, // Luminite Arrow - { ProjectileID.PainterPaintball, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.PearlSandBallGun, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.PhantasmArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.PoisonDartBlowgun, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.PulseBolt, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.SandBallGun, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.Seed, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.ShadowFlameArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.SnowBallFriendly, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.Stake, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.UnholyArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.VenomArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.WoodenArrowFriendly, Do(PointBlank, DefaultIDStaticIFrames) }, - #endregion - - #region CATEGORY 5: Defense Damage support - { ProjectileID.CannonballHostile, defenseDamage }, + #region CATEGORY 4: Defense Damage support { ProjectileID.Cthulunado, defenseDamage }, // Duke Fishron's larger Sharknados - { ProjectileID.DD2BetsyFireball, defenseDamage }, { ProjectileID.DD2BetsyFlameBreath, defenseDamage }, { ProjectileID.DeerclopsIceSpike, defenseDamage }, { ProjectileID.FairyQueenSunDance, defenseDamage }, // Empress of Light's Sun Dance { ProjectileID.FlamingScythe, defenseDamage }, // Pumpking orange spinning scythes { ProjectileID.InfernoHostileBlast, defenseDamage }, // Diabolist inferno fork explosions - { ProjectileID.JavelinHostile, defenseDamage }, { ProjectileID.PaladinsHammerHostile, defenseDamage }, { ProjectileID.PhantasmalDeathray, defenseDamage }, { ProjectileID.PhantasmalSphere, defenseDamage }, - { ProjectileID.Present, defenseDamage }, // Falling present bombs in Frost Moon - { ProjectileID.RockGolemRock, defenseDamage }, - { ProjectileID.RuneBlast, defenseDamage }, // Rune Wizard shots { ProjectileID.SaucerDeathray, defenseDamage }, - { ProjectileID.SaucerMissile, defenseDamage }, { ProjectileID.Sharknado, defenseDamage }, - { ProjectileID.SniperBullet, defenseDamage }, // Skeleton Sniper bullets - { ProjectileID.Spike, defenseDamage }, // Santank spike balls { ProjectileID.ThornBall, Do(Main.zenithWorld ? IgnoreWater : DontIgnoreWater, DefenseDamage) }, // Plantera bouncing thorn balls - { ProjectileID.UnholyTridentHostile, defenseDamage }, #endregion - #region CATEGORY 6: ID-Static Immunity Frame changes - {ProjectileID.AbigailCounter, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Ale, Do(DefaultIDStaticIFrames)}, - {ProjectileID.AmberBolt, Do(DefaultIDStaticIFrames)}, - {ProjectileID.AmethystBolt, Do(DefaultIDStaticIFrames)}, - {ProjectileID.AshBallFalling, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BallofFire, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BallofFrost, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Bananarang, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Bat, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BeeHive, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Beenade, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BlackCat, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BloodArrow, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BloodButcherer, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BloodNautilusTears, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BloodWater, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BloodyMachete, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Bomb, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BombFish, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Bone, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BoneArrowFromMerchant, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BoneDagger, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BookOfSkullsSkull, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BookStaffShot, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Boulder, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BoulderStaffOfEarth, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BouncyBomb, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BouncyBoulder, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BouncyDynamite, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BouncyGrenade, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BoxingGlove, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Bubble, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Bunny, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CannonballFriendly, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CavelingGardener, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Celeb2Rocket, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Celeb2RocketExplosive, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Celeb2RocketExplosiveLarge, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Celeb2RocketLarge, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Celeb2Weapon, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ChainGuillotine, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ChainKnife, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ChargedBlasterCannon, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ChargedBlasterLaser, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ChargedBlasterOrb, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ChlorophytePartisan, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ClothiersCurse, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ClusterMineI, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ClusterMineII, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ClusterSnowmanFragmentsI, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ClusterSnowmanFragmentsII, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CoinPortal, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CopperCoin, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CorruptSpray, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CrimsandBallFalling, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CrimsonHeart, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CrimsonSpray, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CrystalLeaf, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CrystalLeafShot, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CrystalPulse, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CrystalPulse2, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CrystalShard, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CrystalStorm, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CursedDartFlame, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CursedFlameFriendly, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CursedFlare, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DD2PhoenixBow, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DemonScythe, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DiamondBolt, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DirtBall, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DirtBomb, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DirtSpray, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DirtStickyBomb, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DripplerFlailExtraBall, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DryadsWardCircle, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DryBomb, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DryMine, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DryRocket, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DrySnowmanRocket, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Dynamite, Do(DefaultIDStaticIFrames)}, - {ProjectileID.EatersBite, Do(DefaultIDStaticIFrames)}, - {ProjectileID.EbonsandBallFalling, Do(DefaultIDStaticIFrames)}, - {ProjectileID.EighthNote, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Electrosphere, Do(IDStaticIFrames(8))}, // Has an exception in Vanilla iframe code, uses 8 iframes - {ProjectileID.ElectrosphereMissile, Do(DefaultIDStaticIFrames)}, - {ProjectileID.EnchantedBeam, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Explosives, Do(DefaultIDStaticIFrames)}, - {ProjectileID.FallingStar, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Flairon, Do(DefaultIDStaticIFrames)}, - {ProjectileID.FlamesTrap, Do(DefaultIDStaticIFrames)}, - {ProjectileID.FlowerPowPetal, Do(DefaultIDStaticIFrames)}, - {ProjectileID.FrostArrow, Do(DefaultIDStaticIFrames)}, - {ProjectileID.FrostDaggerfish, Do(DefaultIDStaticIFrames)}, - {ProjectileID.GasTrap, Do(DefaultIDStaticIFrames)}, - {ProjectileID.GelBalloon, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Geode, Do(DefaultIDStaticIFrames)}, - {ProjectileID.GeyserTrap, Do(DefaultIDStaticIFrames)}, - {ProjectileID.GoldCoin, Do(DefaultIDStaticIFrames)}, - {ProjectileID.GolemFist, Do(DefaultIDStaticIFrames)}, - {ProjectileID.GreenLaser, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Grenade, Do(DefaultIDStaticIFrames)}, - {ProjectileID.HallowSpray, Do(DefaultIDStaticIFrames)}, - {ProjectileID.HallowStar, Do(DefaultIDStaticIFrames)}, - {ProjectileID.HeatRay, Do(DefaultIDStaticIFrames)}, - {ProjectileID.HolyWater, Do(DefaultIDStaticIFrames)}, - {ProjectileID.HoneyBomb, Do(DefaultIDStaticIFrames)}, - {ProjectileID.HoneyGrenade, Do(DefaultIDStaticIFrames)}, - {ProjectileID.HoneyMine, Do(DefaultIDStaticIFrames)}, - {ProjectileID.HoneyRocket, Do(DefaultIDStaticIFrames)}, - {ProjectileID.HoneySnowmanRocket, Do(DefaultIDStaticIFrames)}, - {ProjectileID.HornetStinger, Do(DefaultIDStaticIFrames)}, - {ProjectileID.HoundiusShootiusFireball, Do(DefaultIDStaticIFrames)}, - {ProjectileID.IceBlock, Do(DefaultIDStaticIFrames)}, - {ProjectileID.IceBolt, Do(DefaultIDStaticIFrames)}, - {ProjectileID.IchorDart, Do(DefaultIDStaticIFrames)}, - {ProjectileID.JackOLantern, Do(DefaultIDStaticIFrames)}, - {ProjectileID.JavelinFriendly, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Landmine, Do(DefaultIDStaticIFrames)}, - {ProjectileID.LaserMachinegun, Do(DefaultIDStaticIFrames)}, - {ProjectileID.LaserMachinegunLaser, Do(DefaultIDStaticIFrames)}, - {ProjectileID.LastPrism, Do(DefaultIDStaticIFrames)}, - {ProjectileID.LastPrismLaser, Do(IDStaticIFrames(5))}, // Has an exception in Vanilla iframe code, uses 5 iframes - {ProjectileID.LavaBomb, Do(DefaultIDStaticIFrames)}, - {ProjectileID.LavaMine, Do(DefaultIDStaticIFrames)}, - {ProjectileID.LavaRocket, Do(DefaultIDStaticIFrames)}, - {ProjectileID.LavaSnowmanRocket, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Leaf, Do(DefaultIDStaticIFrames)}, - {ProjectileID.LifeCrystalBoulder, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MagicMissile, Do(IDStaticIFrames(8))}, // Has an exception in Vanilla iframe code, uses 8 iframes - {ProjectileID.MagnetSphereBolt, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MedusaHead, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MedusaHeadRay, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Meteor1, Do(IDStaticIFrames(5))}, // Has an exception in Vanilla iframe code, uses 5 iframes - {ProjectileID.Meteor2, Do(IDStaticIFrames(5))}, // Has an exception in Vanilla iframe code, uses 5 iframes - {ProjectileID.Meteor3, Do(IDStaticIFrames(5))}, // Has an exception in Vanilla iframe code, uses 5 iframes - {ProjectileID.MinecartMechLaser, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MiniBoulder, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MiniMinotaur, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MiniNukeMineI, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MiniNukeMineII, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MiniNukeRocketI, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MiniNukeRocketII, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MiniNukeSnowmanRocketI, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MiniNukeSnowmanRocketII, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MiniRetinaLaser, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MiniSharkron, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MolotovCocktail, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MolotovFire, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MolotovFire2, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MolotovFire3, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MonkStaffT3_AltShot, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MudBall, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Mushroom, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MushroomSpray, Do(DefaultIDStaticIFrames)}, - {ProjectileID.NailFriendly, Do(IDStaticIFrames(1))}, // Has an exception in Vanilla iframe code, uses 1 iframe - {ProjectileID.NebulaArcanumExplosionShot, Do(DefaultIDStaticIFrames)}, - {ProjectileID.NebulaArcanumExplosionShotShard, Do(DefaultIDStaticIFrames)}, - {ProjectileID.NebulaBlaze1, Do(IDStaticIFrames(5))}, // Has an exception in Vanilla iframe code, uses 5 iframes - {ProjectileID.NebulaBlaze2, Do(IDStaticIFrames(5))}, // Has an exception in Vanilla iframe code, uses 5 iframes - {ProjectileID.NettleBurstEnd, Do(DefaultIDStaticIFrames)}, - {ProjectileID.NettleBurstLeft, Do(DefaultIDStaticIFrames)}, - {ProjectileID.NettleBurstRight, Do(DefaultIDStaticIFrames)}, - {ProjectileID.NightBeam, Do(DefaultIDStaticIFrames)}, - {ProjectileID.NorthPoleSnowflake, Do(DefaultIDStaticIFrames)}, - {ProjectileID.NorthPoleSpear, Do(DefaultIDStaticIFrames)}, - {ProjectileID.NorthPoleWeapon, Do(DefaultIDStaticIFrames)}, - {ProjectileID.NurseSyringeHeal, Do(DefaultIDStaticIFrames)}, - {ProjectileID.NurseSyringeHurt, Do(DefaultIDStaticIFrames)}, - {ProjectileID.OrnamentFriendly, Do(DefaultIDStaticIFrames)}, - {ProjectileID.OrnamentStar, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PaladinsHammerFriendly, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PaperAirplaneA, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PaperAirplaneB, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PartyGirlGrenade, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PearlSandBallFalling, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PewMaticHornShot, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Phantasm, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PineNeedleFriendly, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PlatinumCoin, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PoisonDart, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PoisonDartTrap, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PoisonedKnife, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PossessedHatchet, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PrincessWeapon, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ProximityMineI, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ProximityMineII, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ProximityMineIII, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ProximityMineIV, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PureSpray, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PurificationPowder, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PurpleLaser, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PygmySpear, Do(DefaultIDStaticIFrames)}, - {ProjectileID.QuarterNote, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RainbowFlare, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketFireworksBoxBlue, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketFireworksBoxGreen, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketFireworksBoxRed, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketFireworksBoxYellow, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketI, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketII, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketIII, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketIV, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketSnowmanI, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketSnowmanII, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketSnowmanIII, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketSnowmanIV, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RollingCactus, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RollingCactusSpike, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RottenEgg, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RubyBolt, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SandBallFalling, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SandSpray, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SantaBombs, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SantankMountRocket, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SapphireBolt, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ScarabBomb, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ScutlixLaser, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ScutlixLaserFriendly, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SeedlerNut, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SeedlerThorn, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ShadowBeamFriendly, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ShadowFlameKnife, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ShellPileFalling, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ShimmerArrow, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ShimmerFlare, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Shuriken, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SiltBall, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SilverBullet, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SilverCoin, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SkyFracture, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SlushBall, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SnowSpray, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SolarCounter, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SolarFlareRay, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SoulDrain, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SpearTrap, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SpelunkerFlare, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Spider, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SpiderEgg, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SpikyBall, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SpikyBallTrap, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SpiritFlame, Do(IDStaticIFrames(5))}, // Has an exception in Vanilla iframe code, uses 5 iframes - {ProjectileID.SporeGas, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SporeGas2, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SporeGas3, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SporeTrap, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SporeTrap2, Do(DefaultIDStaticIFrames)}, - {ProjectileID.StarAnise, Do(DefaultIDStaticIFrames)}, - {ProjectileID.StarCannonStar, Do(DefaultIDStaticIFrames)}, - {ProjectileID.StardustCellMinion, Do(DefaultIDStaticIFrames)}, - {ProjectileID.StardustGuardianExplosion, Do(DefaultIDStaticIFrames)}, - {ProjectileID.StickyBomb, Do(DefaultIDStaticIFrames)}, - {ProjectileID.StickyDynamite, Do(DefaultIDStaticIFrames)}, - {ProjectileID.StickyGrenade, Do(DefaultIDStaticIFrames)}, - {ProjectileID.StormTigerGem, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Stynger, Do(IDStaticIFrames(7))}, // Has an exception in Vanilla iframe code, uses 7 iframes - {ProjectileID.StyngerShrapnel, Do(DefaultIDStaticIFrames)}, - {ProjectileID.TentacleSpike, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ThornChakram, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ThrowingKnife, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ThunderSpear, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ThunderSpearShot, Do(DefaultIDStaticIFrames)}, - {ProjectileID.TiedEighthNote, Do(DefaultIDStaticIFrames)}, - {ProjectileID.TitaniumStormShard, Do(DefaultIDStaticIFrames)}, - {ProjectileID.TopazBolt, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ToxicBubble, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ToxicCloud, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ToxicCloud2, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ToxicCloud3, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ToxicFlask, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Truffle, Do(DefaultIDStaticIFrames)}, - {ProjectileID.TruffleSpore, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Typhoon, Do(IDStaticIFrames(6))}, // Has an exception in Vanilla iframe code, uses 6 iframes - {ProjectileID.UFOLaser, Do(DefaultIDStaticIFrames)}, - {ProjectileID.UFOMinion, Do(DefaultIDStaticIFrames)}, - {ProjectileID.UnholyTridentFriendly, Do(DefaultIDStaticIFrames)}, - {ProjectileID.UnholyWater, Do(DefaultIDStaticIFrames)}, - {ProjectileID.VampireKnife, Do(DefaultIDStaticIFrames)}, - {ProjectileID.VenomDartTrap, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ViciousPowder, Do(DefaultIDStaticIFrames)}, - {ProjectileID.VilePowder, Do(DefaultIDStaticIFrames)}, - {ProjectileID.VilethornBase, Do(DefaultIDStaticIFrames)}, - {ProjectileID.VilethornTip, Do(DefaultIDStaticIFrames)}, - {ProjectileID.VortexBeater, Do(DefaultIDStaticIFrames)}, - {ProjectileID.VortexBeaterRocket, Do(DefaultIDStaticIFrames)}, - {ProjectileID.VortexVortexLightning, Do(DefaultIDStaticIFrames)}, - {ProjectileID.VortexVortexPortal, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Waffle, Do(DefaultIDStaticIFrames)}, - {ProjectileID.WandOfFrostingFrost, Do(DefaultIDStaticIFrames)}, - {ProjectileID.WandOfSparkingSpark, Do(DefaultIDStaticIFrames)}, - {ProjectileID.WaterBolt, Do(DefaultIDStaticIFrames)}, - {ProjectileID.WaterStream, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Web, Do(DefaultIDStaticIFrames)}, - {ProjectileID.WetBomb, Do(DefaultIDStaticIFrames)}, - {ProjectileID.WetMine, Do(DefaultIDStaticIFrames)}, - {ProjectileID.WetRocket, Do(DefaultIDStaticIFrames)}, - {ProjectileID.WetSnowmanRocket, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Wisp, Do(DefaultIDStaticIFrames)}, - {ProjectileID.WoodenBoomerang, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Xenopopper, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ZapinatorLaser, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ZoologistStrikeGreen, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ZoologistStrikeRed, Do(DefaultIDStaticIFrames)}, + #region CATEGORY 5: ID-Static Immunity Frame changes + { ProjectileID.AbigailCounter, defaultIFrames }, + { ProjectileID.Ale, defaultIFrames }, + { ProjectileID.AmberBolt, defaultIFrames }, + { ProjectileID.AmethystBolt, defaultIFrames }, + { ProjectileID.AshBallFalling, defaultIFrames }, + { ProjectileID.BallofFire, defaultIFrames }, + { ProjectileID.BallofFrost, defaultIFrames }, + { ProjectileID.Bananarang, defaultIFrames }, + { ProjectileID.Bat, defaultIFrames }, + { ProjectileID.BeeHive, defaultIFrames }, + { ProjectileID.Beenade, defaultIFrames }, + { ProjectileID.BlackCat, defaultIFrames }, + { ProjectileID.Blizzard, defaultIFrames }, // Blizzard Staff projectiles, re-used in Frostbite Blaster. + { ProjectileID.BloodArrow, defaultIFrames }, + { ProjectileID.BloodButcherer, defaultIFrames }, + { ProjectileID.BloodNautilusTears, defaultIFrames }, + { ProjectileID.BloodWater, defaultIFrames }, + { ProjectileID.BloodyMachete, defaultIFrames }, + { ProjectileID.BlueFlare, defaultIFrames }, + { ProjectileID.Bomb, defaultIFrames }, + { ProjectileID.BombFish, defaultIFrames }, + { ProjectileID.Bone, defaultIFrames }, + { ProjectileID.BoneArrow, defaultIFrames }, + { ProjectileID.BoneArrowFromMerchant, defaultIFrames }, + { ProjectileID.BoneDagger, defaultIFrames }, + { ProjectileID.BookOfSkullsSkull, defaultIFrames }, + { ProjectileID.BookStaffShot, defaultIFrames }, + { ProjectileID.Boulder, defaultIFrames }, + { ProjectileID.BoulderStaffOfEarth, defaultIFrames }, + { ProjectileID.BouncyBomb, defaultIFrames }, + { ProjectileID.BouncyBoulder, defaultIFrames }, + { ProjectileID.BouncyDynamite, defaultIFrames }, + { ProjectileID.BouncyGrenade, defaultIFrames }, + { ProjectileID.BoxingGlove, defaultIFrames }, + { ProjectileID.Bubble, defaultIFrames }, + { ProjectileID.Bunny, defaultIFrames }, + { ProjectileID.CandyCorn, Do(IDStaticIFrames(7)) }, // Has an exception in Vanilla iframe code, uses 7 iframes + { ProjectileID.CannonballFriendly, defaultIFrames }, + { ProjectileID.CavelingGardener, defaultIFrames }, + { ProjectileID.Celeb2Rocket, defaultIFrames }, + { ProjectileID.Celeb2RocketExplosive, defaultIFrames }, + { ProjectileID.Celeb2RocketExplosiveLarge, defaultIFrames }, + { ProjectileID.Celeb2RocketLarge, defaultIFrames }, + { ProjectileID.Celeb2Weapon, defaultIFrames }, + { ProjectileID.ChainGuillotine, defaultIFrames }, + { ProjectileID.ChainKnife, defaultIFrames }, + { ProjectileID.ChargedBlasterCannon, defaultIFrames }, + { ProjectileID.ChargedBlasterLaser, defaultIFrames }, + { ProjectileID.ChargedBlasterOrb, defaultIFrames }, + { ProjectileID.ChlorophyteArrow, defaultIFrames }, + { ProjectileID.ChlorophyteBullet, defaultIFrames }, + { ProjectileID.ChlorophytePartisan, defaultIFrames }, + { ProjectileID.ClothiersCurse, defaultIFrames }, + { ProjectileID.ClusterMineI, defaultIFrames }, + { ProjectileID.ClusterMineII, defaultIFrames }, + { ProjectileID.ClusterSnowmanFragmentsI, defaultIFrames }, + { ProjectileID.ClusterSnowmanFragmentsII, defaultIFrames }, + { ProjectileID.CoinPortal, defaultIFrames }, + { ProjectileID.CopperCoin, defaultIFrames }, + { ProjectileID.CorruptSpray, defaultIFrames }, + { ProjectileID.CrimsandBallFalling, defaultIFrames }, + { ProjectileID.CrimsandBallGun, defaultIFrames }, + { ProjectileID.CrimsonHeart, defaultIFrames }, + { ProjectileID.CrimsonSpray, defaultIFrames }, + { ProjectileID.CrystalDart, defaultIFrames }, + { ProjectileID.CrystalLeaf, defaultIFrames }, + { ProjectileID.CrystalLeafShot, defaultIFrames }, + { ProjectileID.CrystalPulse, defaultIFrames }, + { ProjectileID.CrystalPulse2, defaultIFrames }, + { ProjectileID.CrystalShard, defaultIFrames }, + { ProjectileID.CrystalStorm, defaultIFrames }, + { ProjectileID.CursedArrow, defaultIFrames }, + { ProjectileID.CursedDart, defaultIFrames }, + { ProjectileID.CursedDartFlame, defaultIFrames }, + { ProjectileID.CursedFlameFriendly, defaultIFrames }, + { ProjectileID.CursedFlare, defaultIFrames }, + { ProjectileID.DD2PhoenixBow, defaultIFrames }, + { ProjectileID.DemonScythe, defaultIFrames }, + { ProjectileID.DiamondBolt, defaultIFrames }, + { ProjectileID.DirtBall, defaultIFrames }, + { ProjectileID.DirtBomb, defaultIFrames }, + { ProjectileID.DirtSpray, defaultIFrames }, + { ProjectileID.DirtStickyBomb, defaultIFrames }, + { ProjectileID.DripplerFlailExtraBall, defaultIFrames }, + { ProjectileID.DryadsWardCircle, defaultIFrames }, + { ProjectileID.DryBomb, defaultIFrames }, + { ProjectileID.DryMine, defaultIFrames }, + { ProjectileID.DryRocket, defaultIFrames }, + { ProjectileID.DrySnowmanRocket, defaultIFrames }, + { ProjectileID.Dynamite, defaultIFrames }, + { ProjectileID.EatersBite, defaultIFrames }, + { ProjectileID.EbonsandBallFalling, defaultIFrames }, + { ProjectileID.EbonsandBallGun, defaultIFrames }, + { ProjectileID.EighthNote, defaultIFrames }, + { ProjectileID.Electrosphere, Do(IDStaticIFrames(8)) }, // Has an exception in Vanilla iframe code, uses 8 iframes + { ProjectileID.ElectrosphereMissile, defaultIFrames }, + { ProjectileID.EnchantedBeam, defaultIFrames }, + { ProjectileID.Explosives, defaultIFrames }, + { ProjectileID.FallingStar, defaultIFrames }, + { ProjectileID.FireArrow, defaultIFrames }, + { ProjectileID.Flairon, defaultIFrames }, + { ProjectileID.FlamesTrap, defaultIFrames }, + { ProjectileID.Flare, defaultIFrames }, + { ProjectileID.FlowerPowPetal, defaultIFrames }, + { ProjectileID.FrostArrow, defaultIFrames }, + { ProjectileID.FrostburnArrow, defaultIFrames }, + { ProjectileID.FrostDaggerfish, defaultIFrames }, + { ProjectileID.GasTrap, defaultIFrames }, + { ProjectileID.GelBalloon, defaultIFrames }, + { ProjectileID.Geode, defaultIFrames }, + { ProjectileID.GeyserTrap, defaultIFrames }, + { ProjectileID.GoldCoin, defaultIFrames }, + { ProjectileID.GolemFist, defaultIFrames }, + { ProjectileID.GreenLaser, defaultIFrames }, + { ProjectileID.Grenade, defaultIFrames }, + { ProjectileID.HallowSpray, defaultIFrames }, + { ProjectileID.HallowStar, defaultIFrames }, + { ProjectileID.Hellwing, defaultIFrames }, + { ProjectileID.HolyArrow, defaultIFrames }, + { ProjectileID.HeatRay, Do(DefaultIDStaticIFrames) }, + { ProjectileID.HolyWater, defaultIFrames }, + { ProjectileID.HoneyBomb, defaultIFrames }, + { ProjectileID.HoneyGrenade, defaultIFrames }, + { ProjectileID.HoneyMine, defaultIFrames }, + { ProjectileID.HoneyRocket, defaultIFrames }, + { ProjectileID.HoneySnowmanRocket, defaultIFrames }, + { ProjectileID.HornetStinger, defaultIFrames }, + { ProjectileID.HoundiusShootiusFireball, defaultIFrames }, + { ProjectileID.IceBlock, defaultIFrames }, + { ProjectileID.IceBolt, defaultIFrames }, + { ProjectileID.IchorArrow, defaultIFrames }, + { ProjectileID.IchorDart, defaultIFrames }, + { ProjectileID.JackOLantern, defaultIFrames }, + { ProjectileID.JavelinFriendly, defaultIFrames }, + { ProjectileID.JestersArrow, defaultIFrames }, + { ProjectileID.Landmine, defaultIFrames }, + { ProjectileID.LaserMachinegun, defaultIFrames }, + { ProjectileID.LaserMachinegunLaser, defaultIFrames }, + { ProjectileID.LastPrism, defaultIFrames }, + { ProjectileID.LastPrismLaser, Do(IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes + { ProjectileID.LavaBomb, defaultIFrames }, + { ProjectileID.LavaMine, defaultIFrames }, + { ProjectileID.LavaRocket, defaultIFrames }, + { ProjectileID.LavaSnowmanRocket, defaultIFrames }, + { ProjectileID.Leaf, defaultIFrames }, + { ProjectileID.LifeCrystalBoulder, defaultIFrames }, + { ProjectileID.MagicMissile, Do(IDStaticIFrames(8)) }, // Has an exception in Vanilla iframe code, uses 8 iframes + { ProjectileID.MagnetSphereBolt, defaultIFrames }, + { ProjectileID.MedusaHead, defaultIFrames }, + { ProjectileID.MedusaHeadRay, defaultIFrames }, + { ProjectileID.Meteor1, Do(IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes + { ProjectileID.Meteor2, Do(IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes + { ProjectileID.Meteor3, Do(IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes + { ProjectileID.MinecartMechLaser, defaultIFrames }, + { ProjectileID.MiniBoulder, defaultIFrames }, + { ProjectileID.MiniMinotaur, defaultIFrames }, + { ProjectileID.MiniNukeMineI, defaultIFrames }, + { ProjectileID.MiniNukeMineII, defaultIFrames }, + { ProjectileID.MiniNukeRocketI, defaultIFrames }, + { ProjectileID.MiniNukeRocketII, defaultIFrames }, + { ProjectileID.MiniNukeSnowmanRocketI, defaultIFrames }, + { ProjectileID.MiniNukeSnowmanRocketII, defaultIFrames }, + { ProjectileID.MiniRetinaLaser, defaultIFrames }, + { ProjectileID.MiniSharkron, defaultIFrames }, + { ProjectileID.MolotovCocktail, defaultIFrames }, + { ProjectileID.MolotovFire, defaultIFrames }, + { ProjectileID.MolotovFire2, defaultIFrames }, + { ProjectileID.MolotovFire3, defaultIFrames }, + { ProjectileID.MonkStaffT3_AltShot, defaultIFrames }, + { ProjectileID.MudBall, defaultIFrames }, + { ProjectileID.Mushroom, defaultIFrames }, + { ProjectileID.MushroomSpray, defaultIFrames }, + { ProjectileID.NailFriendly, Do(IDStaticIFrames(1)) }, // Has an exception in Vanilla iframe code, uses 1 iframe + { ProjectileID.NebulaArcanumExplosionShot, defaultIFrames }, + { ProjectileID.NebulaArcanumExplosionShotShard, defaultIFrames }, + { ProjectileID.NebulaBlaze1, Do(IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes + { ProjectileID.NebulaBlaze2, Do(IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes + { ProjectileID.NettleBurstEnd, defaultIFrames }, + { ProjectileID.NettleBurstLeft, defaultIFrames }, + { ProjectileID.NettleBurstRight, defaultIFrames }, + { ProjectileID.NightBeam, defaultIFrames }, + { ProjectileID.NorthPoleSnowflake, defaultIFrames }, + { ProjectileID.NorthPoleSpear, defaultIFrames }, + { ProjectileID.NorthPoleWeapon, defaultIFrames }, + { ProjectileID.NurseSyringeHeal, defaultIFrames }, + { ProjectileID.NurseSyringeHurt, defaultIFrames }, + { ProjectileID.OrnamentFriendly, defaultIFrames }, + { ProjectileID.OrnamentStar, defaultIFrames }, + { ProjectileID.PainterPaintball, defaultIFrames }, + { ProjectileID.PaladinsHammerFriendly, defaultIFrames }, + { ProjectileID.PaperAirplaneA, defaultIFrames }, + { ProjectileID.PaperAirplaneB, defaultIFrames }, + { ProjectileID.PartyGirlGrenade, defaultIFrames }, + { ProjectileID.PearlSandBallFalling, defaultIFrames }, + { ProjectileID.PearlSandBallGun, defaultIFrames }, + { ProjectileID.PewMaticHornShot, defaultIFrames }, + { ProjectileID.Phantasm, defaultIFrames }, + { ProjectileID.PhantasmArrow, defaultIFrames }, + { ProjectileID.PineNeedleFriendly, defaultIFrames }, + { ProjectileID.PlatinumCoin, defaultIFrames }, + { ProjectileID.PoisonDart, defaultIFrames }, + { ProjectileID.PoisonDartBlowgun, defaultIFrames }, + { ProjectileID.PoisonDartTrap, defaultIFrames }, + { ProjectileID.PoisonedKnife, defaultIFrames }, + { ProjectileID.PossessedHatchet, defaultIFrames }, + { ProjectileID.PrincessWeapon, defaultIFrames }, + { ProjectileID.ProximityMineI, defaultIFrames }, + { ProjectileID.ProximityMineII, defaultIFrames }, + { ProjectileID.ProximityMineIII, defaultIFrames }, + { ProjectileID.ProximityMineIV, defaultIFrames }, + { ProjectileID.PulseBolt, defaultIFrames }, + { ProjectileID.PureSpray, defaultIFrames }, + { ProjectileID.PurificationPowder, defaultIFrames }, + { ProjectileID.PurpleLaser, defaultIFrames }, + { ProjectileID.PygmySpear, defaultIFrames }, + { ProjectileID.QuarterNote, defaultIFrames }, + { ProjectileID.RainbowFlare, defaultIFrames }, + { ProjectileID.RocketFireworksBoxBlue, defaultIFrames }, + { ProjectileID.RocketFireworksBoxGreen, defaultIFrames }, + { ProjectileID.RocketFireworksBoxRed, defaultIFrames }, + { ProjectileID.RocketFireworksBoxYellow, defaultIFrames }, + { ProjectileID.RocketI, defaultIFrames }, + { ProjectileID.RocketII, defaultIFrames }, + { ProjectileID.RocketIII, defaultIFrames }, + { ProjectileID.RocketIV, defaultIFrames }, + { ProjectileID.RocketSnowmanI, defaultIFrames }, + { ProjectileID.RocketSnowmanII, defaultIFrames }, + { ProjectileID.RocketSnowmanIII, defaultIFrames }, + { ProjectileID.RocketSnowmanIV, defaultIFrames }, + { ProjectileID.RollingCactus, defaultIFrames }, + { ProjectileID.RollingCactusSpike, defaultIFrames }, + { ProjectileID.RottenEgg, defaultIFrames }, + { ProjectileID.RubyBolt, defaultIFrames }, + { ProjectileID.SandBallFalling, defaultIFrames }, + { ProjectileID.SandBallGun, defaultIFrames }, + { ProjectileID.SandSpray, defaultIFrames }, + { ProjectileID.SantaBombs, defaultIFrames }, + { ProjectileID.SantankMountRocket, defaultIFrames }, + { ProjectileID.SapphireBolt, defaultIFrames }, + { ProjectileID.ScarabBomb, defaultIFrames }, + { ProjectileID.ScutlixLaser, defaultIFrames }, + { ProjectileID.ScutlixLaserFriendly, defaultIFrames }, + { ProjectileID.Seed, defaultIFrames }, + { ProjectileID.SeedlerNut, defaultIFrames }, + { ProjectileID.SeedlerThorn, defaultIFrames }, + { ProjectileID.ShadowBeamFriendly, defaultIFrames }, + { ProjectileID.ShadowFlameArrow, defaultIFrames }, + { ProjectileID.ShadowFlameKnife, defaultIFrames }, + { ProjectileID.ShellPileFalling, defaultIFrames }, + { ProjectileID.ShimmerArrow, defaultIFrames }, + { ProjectileID.ShimmerFlare, defaultIFrames }, + { ProjectileID.Shuriken, defaultIFrames }, + { ProjectileID.SiltBall, defaultIFrames }, + { ProjectileID.SilverBullet, defaultIFrames }, + { ProjectileID.SilverCoin, defaultIFrames }, + { ProjectileID.SkyFracture, defaultIFrames }, + { ProjectileID.SlushBall, defaultIFrames }, + { ProjectileID.SnowBallFriendly, defaultIFrames }, + { ProjectileID.SnowSpray, defaultIFrames }, + { ProjectileID.SolarCounter, defaultIFrames }, + { ProjectileID.SolarFlareRay, defaultIFrames }, + { ProjectileID.SoulDrain, defaultIFrames }, + { ProjectileID.SpearTrap, defaultIFrames }, + { ProjectileID.SpelunkerFlare, defaultIFrames }, + { ProjectileID.Spider, defaultIFrames }, + { ProjectileID.SpiderEgg, defaultIFrames }, + { ProjectileID.SpikyBall, defaultIFrames }, + { ProjectileID.SpikyBallTrap, defaultIFrames }, + { ProjectileID.SpiritFlame, Do(IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes + { ProjectileID.SporeGas, defaultIFrames }, + { ProjectileID.SporeGas2, defaultIFrames }, + { ProjectileID.SporeGas3, defaultIFrames }, + { ProjectileID.SporeTrap, defaultIFrames }, + { ProjectileID.SporeTrap2, defaultIFrames }, + { ProjectileID.Stake, defaultIFrames }, + { ProjectileID.StarAnise, defaultIFrames }, + { ProjectileID.StarCannonStar, defaultIFrames }, + { ProjectileID.StardustCellMinion, defaultIFrames }, + { ProjectileID.StardustGuardianExplosion, defaultIFrames }, + { ProjectileID.StickyBomb, defaultIFrames }, + { ProjectileID.StickyDynamite, defaultIFrames }, + { ProjectileID.StickyGrenade, defaultIFrames }, + { ProjectileID.StormTigerGem, defaultIFrames }, + { ProjectileID.Stynger, Do(IDStaticIFrames(7)) }, // Has an exception in Vanilla iframe code, uses 7 iframes + { ProjectileID.StyngerShrapnel, defaultIFrames }, + { ProjectileID.TentacleSpike, defaultIFrames }, + { ProjectileID.ThornChakram, defaultIFrames }, + { ProjectileID.ThrowingKnife, defaultIFrames }, + { ProjectileID.ThunderSpear, defaultIFrames }, + { ProjectileID.ThunderSpearShot, defaultIFrames }, + { ProjectileID.TiedEighthNote, defaultIFrames }, + { ProjectileID.TitaniumStormShard, defaultIFrames }, + { ProjectileID.TopazBolt, defaultIFrames }, + { ProjectileID.ToxicBubble, defaultIFrames }, + { ProjectileID.ToxicCloud, defaultIFrames }, + { ProjectileID.ToxicCloud2, defaultIFrames }, + { ProjectileID.ToxicCloud3, defaultIFrames }, + { ProjectileID.ToxicFlask, defaultIFrames }, + { ProjectileID.Truffle, defaultIFrames }, + { ProjectileID.TruffleSpore, defaultIFrames }, + { ProjectileID.Typhoon, Do(IDStaticIFrames(6)) }, // Has an exception in Vanilla iframe code, uses 6 iframes + { ProjectileID.UFOLaser, defaultIFrames }, + { ProjectileID.UFOMinion, defaultIFrames }, + { ProjectileID.UnholyArrow, defaultIFrames }, + { ProjectileID.UnholyTridentFriendly, defaultIFrames }, + { ProjectileID.UnholyWater, defaultIFrames }, + { ProjectileID.VampireKnife, defaultIFrames }, + { ProjectileID.VenomArrow, defaultIFrames }, + { ProjectileID.VenomDartTrap, defaultIFrames }, + { ProjectileID.ViciousPowder, defaultIFrames }, + { ProjectileID.VilePowder, defaultIFrames }, + { ProjectileID.VilethornBase, defaultIFrames }, + { ProjectileID.VilethornTip, defaultIFrames }, + { ProjectileID.VortexBeater, defaultIFrames }, + { ProjectileID.VortexBeaterRocket, defaultIFrames }, + { ProjectileID.VortexVortexLightning, defaultIFrames }, + { ProjectileID.VortexVortexPortal, defaultIFrames }, + { ProjectileID.Waffle, defaultIFrames }, + { ProjectileID.WandOfFrostingFrost, defaultIFrames }, + { ProjectileID.WandOfSparkingSpark, defaultIFrames }, + { ProjectileID.WaterBolt, defaultIFrames }, + { ProjectileID.WaterStream, defaultIFrames }, + { ProjectileID.Web, defaultIFrames }, + { ProjectileID.WetBomb, defaultIFrames }, + { ProjectileID.WetMine, defaultIFrames }, + { ProjectileID.WetRocket, defaultIFrames }, + { ProjectileID.WetSnowmanRocket, defaultIFrames }, + { ProjectileID.Wisp, defaultIFrames }, + { ProjectileID.WoodenArrowFriendly, defaultIFrames }, + { ProjectileID.WoodenBoomerang, defaultIFrames }, + { ProjectileID.Xenopopper, defaultIFrames }, + { ProjectileID.ZapinatorLaser, defaultIFrames }, + { ProjectileID.ZoologistStrikeGreen, defaultIFrames }, + { ProjectileID.ZoologistStrikeRed, defaultIFrames }, #endregion @@ -840,16 +823,6 @@ namespace CalamityMod.Projectiles internal static IProjectileTweak InfinitePiercing = new PiercingExactRule(-1); #endregion - #region Point Blank - internal class PointBlankRule : IProjectileTweak - { - public bool AppliesTo(Projectile proj) => true; - public void ApplyTweak(Projectile proj) - => proj.Calamity().pointBlankShotDuration = DefaultPointBlankDuration; - } - internal static IProjectileTweak PointBlank => new PointBlankRule(); - #endregion - #region Scale internal class ScaleDeltaRule : IProjectileTweak { diff --git a/Projectiles/DraedonsArsenal/PoleWarperSummon.cs b/Projectiles/DraedonsArsenal/PoleWarperSummon.cs index bc3e1aa9ec..d29fe0dceb 100644 --- a/Projectiles/DraedonsArsenal/PoleWarperSummon.cs +++ b/Projectiles/DraedonsArsenal/PoleWarperSummon.cs @@ -12,7 +12,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal { public new string LocalizationCategory => "Projectiles.Misc"; public float AngularOffset = 0f; - public const float MaximumRepulsionSpeed = 13f; + public const float MaximumRepulsionSpeed = 11f; + public const float ChargeTime = 45f; public float Time { get => Projectile.ai[0]; @@ -44,7 +45,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Projectile.minion = true; Projectile.tileCollide = false; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 12; + Projectile.localNPCHitCooldown = 20; Projectile.DamageType = DamageClass.Summon; } @@ -57,7 +58,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Projectile.localAI[0] = 1f; } GrantBuffs(player); - NPC potentialTarget = Projectile.Center.MinionHoming(1400f, player); + NPC potentialTarget = Projectile.Center.MinionHoming(2000f, player); // Teleport near the target if very far away from them. if (!Projectile.WithinRange(player.Center, 4200f)) @@ -73,7 +74,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal else { NPCMovement(potentialTarget); - if (Time % 60f < 35f) + if (Time % ChargeTime < 35f) { RepelMovement(); } @@ -131,22 +132,22 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } } } - if (Time % 60f < 20f) + if (Time % ChargeTime < 20f) { float offsetAngle = AngularOffset * 0.5f + (!North).ToInt() * MathHelper.Pi; Vector2 destination = npc.Center + Vector2.UnitY.RotatedBy(offsetAngle) * 180f; Projectile.velocity = (Projectile.velocity * 4f + Projectile.SafeDirectionTo(destination) * 10f) / 5f; - Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 25f; + Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 30f; Projectile.rotation = Projectile.AngleTo(npc.Center) + MathHelper.PiOver2; } - else if (Time % 60f < 35f) + else if (Time % ChargeTime < 35f) { Projectile.velocity *= 0.96f; Projectile.rotation += 0.05f; } - else if (Time % 60f == 35f) + else if (Time % ChargeTime == 35f) { - Projectile.velocity = Projectile.SafeDirectionTo(npc.Center, -Vector2.UnitY) * 29f; + Projectile.velocity = Projectile.SafeDirectionTo(npc.Center, -Vector2.UnitY) * 20f; Projectile.rotation = Projectile.AngleTo(npc.Center) + MathHelper.PiOver2; } } @@ -156,8 +157,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal // This does not incorporate attraction on purpose. Doing so causes the minions to very easily become distracted. foreach (Projectile p in Main.ActiveProjectiles) { - if (p.type == Projectile.type && - Projectile.Distance(p.Center) < 40f) + if (p.type == Projectile.type && Projectile.Distance(p.Center) < 40f) { PoleWarperSummon otherPole = (PoleWarperSummon)p.ModProjectile; if (otherPole.North != North) diff --git a/Projectiles/Enemy/EarthRockBig.cs b/Projectiles/Enemy/EarthRockBig.cs index 6d24b0c175..53a8b9b58c 100644 --- a/Projectiles/Enemy/EarthRockBig.cs +++ b/Projectiles/Enemy/EarthRockBig.cs @@ -12,7 +12,6 @@ namespace CalamityMod.Projectiles.Enemy public new string LocalizationCategory => "Projectiles.Enemy"; public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 32; Projectile.height = 32; Projectile.hostile = true; diff --git a/Projectiles/Enemy/MantisRing.cs b/Projectiles/Enemy/MantisRing.cs index 002314546d..b2096ae397 100644 --- a/Projectiles/Enemy/MantisRing.cs +++ b/Projectiles/Enemy/MantisRing.cs @@ -20,7 +20,6 @@ namespace CalamityMod.Projectiles.Enemy public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.knockBack = 3f; Projectile.width = 72; Projectile.height = 30; diff --git a/Projectiles/Healing/AbsorberAura.cs b/Projectiles/Healing/AbsorberAura.cs index 91fb6286d8..3d3ea8922c 100644 --- a/Projectiles/Healing/AbsorberAura.cs +++ b/Projectiles/Healing/AbsorberAura.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Healing for (int l = 0; l < Player.MaxBuffs; l++) { int buffID = player.buffType[l]; - if (player.buffTime[l] > 2 && DebuffsList.Includes(buffID)) + if (player.buffTime[l] > 2 && CalamityBuffSets.IsDebuff[buffID]) { player.buffTime[l] *= 0; } diff --git a/Projectiles/Healing/BlueJellyAura.cs b/Projectiles/Healing/BlueJellyAura.cs index 1282ea8349..137e066c5a 100644 --- a/Projectiles/Healing/BlueJellyAura.cs +++ b/Projectiles/Healing/BlueJellyAura.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Healing for (int l = 0; l < Player.MaxBuffs; l++) { int buffID = player.buffType[l]; - if (player.buffTime[l] > 2 && DebuffsList.Includes(buffID)) + if (player.buffTime[l] > 2 && CalamityBuffSets.IsDebuff[buffID]) { player.buffTime[l] *= 0; } diff --git a/Projectiles/Healing/GreenJellyAura.cs b/Projectiles/Healing/GreenJellyAura.cs index 3b41df93d3..7941337d59 100644 --- a/Projectiles/Healing/GreenJellyAura.cs +++ b/Projectiles/Healing/GreenJellyAura.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Healing for (int l = 0; l < Player.MaxBuffs; l++) { int buffID = player.buffType[l]; - if (player.buffTime[l] > 2 && DebuffsList.Includes(buffID)) + if (player.buffTime[l] > 2 && CalamityBuffSets.IsDebuff[buffID]) { player.buffTime[l] *= 0; } diff --git a/Projectiles/Magic/HeliumFlashHoldout.cs b/Projectiles/Magic/HeliumFlashHoldout.cs index c26c976f60..db956457ef 100644 --- a/Projectiles/Magic/HeliumFlashHoldout.cs +++ b/Projectiles/Magic/HeliumFlashHoldout.cs @@ -152,7 +152,7 @@ namespace CalamityMod.Projectiles.Magic // Full charge effects if (CurrentChargingFrames == HeliumFlash.FullChargeFrames) { - SoundStyle fire = new("CalamityMod/Sounds/Item/HeliumFlashReadyAlt"); + SoundStyle fire = new("CalamityMod/Sounds/Item/HeliumFlashReady"); SoundEngine.PlaySound(fire with { Volume = 1f, Pitch = 0f }, Projectile.Center); for (int i = 0; i < 18; i++) { diff --git a/Projectiles/Magic/MadAlchemistsCocktailAlt.cs b/Projectiles/Magic/MadAlchemistsCocktailAlt.cs index 4bc6077cae..49748b34ad 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailAlt.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailAlt.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 360); + target.AddBuff(ModContent.BuffType(), 480); } public override void OnKill(int timeLeft) diff --git a/Projectiles/Magic/NebulaCloudCore.cs b/Projectiles/Magic/NebulaCloudCore.cs index d48efbeab7..531bbd6f31 100644 --- a/Projectiles/Magic/NebulaCloudCore.cs +++ b/Projectiles/Magic/NebulaCloudCore.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Magic public class NebulaCloudCore : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; - private const float IntendedVelocity = 4f; + private const float IntendedVelocity = 6f; public override void SetStaticDefaults() { @@ -28,12 +28,12 @@ namespace CalamityMod.Projectiles.Magic Projectile.height = 32; Projectile.friendly = true; Projectile.alpha = 255; - Projectile.penetrate = 4; + Projectile.penetrate = 3; Projectile.ignoreWater = true; Projectile.DamageType = DamageClass.Magic; Projectile.MaxUpdates = 3; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 8 * Projectile.MaxUpdates; // 8 effective, 24 total + Projectile.localNPCHitCooldown = 10 * Projectile.MaxUpdates; // 10 effective, 30 total } public override void AI() @@ -351,12 +351,10 @@ namespace CalamityMod.Projectiles.Magic int totalProjectiles = Main.rand.Next(6, 9); float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); - float velocity = Main.rand.Next(70, 101) * 0.1f; - Vector2 spinningPoint = new Vector2(0f, -velocity); for (int k = 0; k < totalProjectiles; k++) { - Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + Utils.RandomVector2(Main.rand, -30f, 30f), velocity2, type, (int)(Projectile.damage * 0.5), Projectile.knockBack * 0.8f, Projectile.owner); + Vector2 velocity = -Vector2.UnitY.RotatedBy(radians * k) * Main.rand.NextFloat(7f, 10f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + Main.rand.NextVector2Circular(30f, 30f), velocity, type, (int)(Projectile.damage * 0.5), Projectile.knockBack * 0.8f, Projectile.owner); } } } diff --git a/Projectiles/Magic/NebulaNova.cs b/Projectiles/Magic/NebulaNova.cs index 84830b3f48..db975c183e 100644 --- a/Projectiles/Magic/NebulaNova.cs +++ b/Projectiles/Magic/NebulaNova.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.DamageType = DamageClass.Magic; Projectile.timeLeft = TotalXFrames * TotalYFrames * FrameTimer; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; + Projectile.localNPCHitCooldown = 30; } public override void AI() diff --git a/Projectiles/Magic/NebulousCataclysm_Held.cs b/Projectiles/Magic/NebulousCataclysm_Held.cs index d29dbbe09e..7c83485dc5 100644 --- a/Projectiles/Magic/NebulousCataclysm_Held.cs +++ b/Projectiles/Magic/NebulousCataclysm_Held.cs @@ -60,9 +60,8 @@ namespace CalamityMod.Projectiles.Magic Projectile.ai[0] = 0f; bool shoot = CurrentFrame == ShootFrame && Projectile.ai[0] == 0f; - bool ableToShoot = true; + bool ableToShoot = false; bool weaponInUse = !Owner.CantUseHoldout(); - int manaCost = (int)(30f * Owner.manaCost); Vector2 halvedSize = Projectile.Size / 2f; Vector2 staffOffset = halvedSize + new Vector2(24f, 24f); @@ -72,43 +71,21 @@ namespace CalamityMod.Projectiles.Magic if (weaponInUse) { - if (Owner.statMana < manaCost) - { - if (Owner.manaFlower) - { - Owner.QuickMana(); - if (Owner.statMana >= manaCost) - { - Owner.manaRegenDelay = (int)Owner.maxRegenDelay; - Owner.statMana -= manaCost; - } - else - { - Projectile.Kill(); - ableToShoot = false; - } - } - else - { - Projectile.Kill(); - ableToShoot = false; - } - } + if (Owner.CheckMana(Owner.HeldItem.mana)) + ableToShoot = true; else - { - if (Owner.statMana >= manaCost) - { - Owner.statMana -= manaCost; - Owner.manaRegenDelay = (int)Owner.maxRegenDelay; - } - } + Projectile.Kill(); if (ableToShoot) SoundEngine.PlaySound(SoundID.Item117, Projectile.Center); } + else + Projectile.Kill(); if (Main.myPlayer == Projectile.owner && ableToShoot) { + Owner.CheckMana(Owner.HeldItem.mana, true); + int projectileType = ModContent.ProjectileType(); float coreVelocity = 8f; int weaponDamage = Owner.GetWeaponDamage(Owner.ActiveItem()); diff --git a/Projectiles/Magic/OmicronHoldout.cs b/Projectiles/Magic/OmicronHoldout.cs index a476798def..6e3eed8973 100644 --- a/Projectiles/Magic/OmicronHoldout.cs +++ b/Projectiles/Magic/OmicronHoldout.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Magic if (Owner.Calamity().mouseRight && PostFireCooldown <= 0) { - if (Owner.CheckMana(Owner.ActiveItem(), (int)(HeldItem.mana * Owner.manaCost) * 16, true, false)) + if (Owner.CheckMana(Owner.ActiveItem(), (int)(HeldItem.mana * Owner.manaCost) * 13, true)) { PostFireCooldown = 100; Shoot(true); @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Magic } else if (ShootingTimer >= FireRate) { - if (Owner.CheckMana(Owner.ActiveItem(), -1, true, false) && PostFireCooldown <= 0) + if (Owner.CheckMana(Owner.ActiveItem(), -1, true) && PostFireCooldown <= 0) { MaxFireRateShots++; diff --git a/Projectiles/Magic/VolterionHoldout.cs b/Projectiles/Magic/VolterionHoldout.cs index 9fae60413e..aca54af815 100644 --- a/Projectiles/Magic/VolterionHoldout.cs +++ b/Projectiles/Magic/VolterionHoldout.cs @@ -4,6 +4,7 @@ using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; +using ReLogic.Utilities; using Terraria; using Terraria.Audio; using Terraria.GameContent; @@ -26,6 +27,7 @@ namespace CalamityMod.Projectiles.Magic public override string Texture => "CalamityMod/Projectiles/Magic/VolterionHoldout"; public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/VolterionFire") { Volume = 0.35f }; + public SlotId FireSoundSlot; public ref float FlashTimer => ref Projectile.ai[0]; @@ -100,7 +102,9 @@ namespace CalamityMod.Projectiles.Magic if (Owner.CheckMana(Owner.ActiveItem(), -1, true)) { FlashTimer = 4f; - SoundEngine.PlaySound(FireSound, GunTipPosition); + FireSoundSlot = SoundEngine.PlaySound(FireSound, GunTipPosition); + if (Owner.Calamity().GeneralScreenShakePower < 3f) + Owner.Calamity().GeneralScreenShakePower = 3f; // Start from slightly behind the tip Vector2 offsetPos = GunTipPosition - Projectile.velocity.SafeNormalize(Vector2.UnitY) * 18f; @@ -126,6 +130,9 @@ namespace CalamityMod.Projectiles.Magic Projectile.frameCounter = 0; } } + + if (SoundEngine.TryGetActiveSound(FireSoundSlot, out var currentSound) && currentSound.IsPlaying) + currentSound.Position = GunTipPosition; } // Muzzle flash can deal damage diff --git a/Projectiles/Melee/CometQuasherHoldout.cs b/Projectiles/Melee/CometQuasherHoldout.cs index 8a5e54dcfd..bd253b4c53 100644 --- a/Projectiles/Melee/CometQuasherHoldout.cs +++ b/Projectiles/Melee/CometQuasherHoldout.cs @@ -222,7 +222,7 @@ namespace CalamityMod.Projectiles.Melee if (spawnBoom) { Vector2 spawnSpot = target.Center + new Vector2(Main.rand.NextFloat(-550, 550), Main.rand.NextFloat(-750, -950)); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 1.5f), 0, Projectile.owner, 0, 0, 4); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 1.5f), 0, Projectile.owner, 0, Main.rand.Next(3), 4); spawnBoom = false; } } diff --git a/Projectiles/Melee/CometQuasherMeteor.cs b/Projectiles/Melee/CometQuasherMeteor.cs index f9ab862f37..b195a428aa 100644 --- a/Projectiles/Melee/CometQuasherMeteor.cs +++ b/Projectiles/Melee/CometQuasherMeteor.cs @@ -87,11 +87,20 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - if (Projectile.Calamity().lineColor == 1) - tex = ModContent.Request("CalamityMod/Projectiles/Melee/CometQuasherMeteor2").Value; - if (Projectile.Calamity().lineColor == 2) - tex = ModContent.Request("CalamityMod/Projectiles/Melee/CometQuasherMeteor3").Value; + Texture2D tex; + switch (Projectile.ai[1]) + { + case 0: + default: + tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + break; + case 1: + tex = ModContent.Request("CalamityMod/Projectiles/Melee/CometQuasherMeteor2").Value; + break; + case 2: + tex = ModContent.Request("CalamityMod/Projectiles/Melee/CometQuasherMeteor3").Value; + break; + } CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.White, 1, tex); return false; diff --git a/Projectiles/Melee/CosmicDischargeFlail.cs b/Projectiles/Melee/CosmicDischargeFlail.cs index df46b60a8a..d070b22adc 100644 --- a/Projectiles/Melee/CosmicDischargeFlail.cs +++ b/Projectiles/Melee/CosmicDischargeFlail.cs @@ -23,10 +23,10 @@ namespace CalamityMod.Projectiles.Melee Projectile.tileCollide = false; Projectile.DamageType = DamageClass.MeleeNoSpeed; Projectile.ignoreWater = true; + Projectile.MaxUpdates = 2; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 6; + Projectile.localNPCHitCooldown = 6 * Projectile.MaxUpdates; Projectile.coldDamage = true; - Projectile.extraUpdates = 1; } public override Color SpecialDrawColor => new Color(150, 255, 255); diff --git a/Projectiles/Melee/CosmicShivBlade.cs b/Projectiles/Melee/CosmicShivBlade.cs index 074d2769c8..1e2714859a 100644 --- a/Projectiles/Melee/CosmicShivBlade.cs +++ b/Projectiles/Melee/CosmicShivBlade.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Texture2D texture = TextureAssets.Projectile[Type].Value; Rectangle sourceRectangle = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Vector2 origin = sourceRectangle.Size() / 2f; float rotation = Projectile.rotation; diff --git a/Projectiles/Melee/DevilsDevastationHoldout.cs b/Projectiles/Melee/DevilsDevastationHoldout.cs index 16d5f599b0..4e5c1dd466 100644 --- a/Projectiles/Melee/DevilsDevastationHoldout.cs +++ b/Projectiles/Melee/DevilsDevastationHoldout.cs @@ -64,6 +64,14 @@ namespace CalamityMod.Projectiles.Melee Projectile.localNPCHitCooldown = -1; Projectile.DamageType = TrueMeleeDamageClass.Instance; } + public override void OnSpawn(IEntitySource source) + { + base.OnSpawn(source); + // This is needed because EntitySource_ItemUse always sets Projectile.originalDamage to the item's damage, + // regardless of the value passed into the damage argument of NewProjectile. + // This results in continuous updating damage resetting the damage. + Projectile.originalDamage *= 15; + } public override void WhenSpawned() { IgnoreActiveAnimation = true; @@ -97,6 +105,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), lastHitTarget.Center, vel.RotatedBy(MathHelper.ToRadians(45)), ModContent.ProjectileType(), 0, 0f, Owner.whoAmI, 1, 0); } Projectile strike = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), lastHitTarget.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 1.5f), 0f, Owner.whoAmI, lastHitTarget.whoAmI, 0); + strike.DamageType = DamageClass.Melee; SoundStyle dieSound = new("CalamityMod/Sounds/Item/LanceofDestinyStrong"); SoundEngine.PlaySound(dieSound with { Volume = 0.9f, Pitch = 0.3f }, lastHitTarget.Center); diff --git a/Projectiles/Melee/EssenceScythe.cs b/Projectiles/Melee/EssenceScythe.cs index 64b2e4eba6..0e922a90f5 100644 --- a/Projectiles/Melee/EssenceScythe.cs +++ b/Projectiles/Melee/EssenceScythe.cs @@ -23,16 +23,16 @@ namespace CalamityMod.Projectiles.Melee Projectile.width = 100; Projectile.height = 78; Projectile.aiStyle = ProjAIStyleID.Sickle; + AIType = ProjectileID.DeathSickle; Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; Projectile.tileCollide = false; - Projectile.alpha = 55; - Projectile.penetrate = 10; - Projectile.timeLeft = 300; Projectile.ignoreWater = true; - AIType = ProjectileID.DeathSickle; + Projectile.alpha = 55; + Projectile.penetrate = 5; + Projectile.timeLeft = 300; Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 2; + Projectile.idStaticNPCHitCooldown = 3; } public override void AI() @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Melee Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.ShadowbeamStaff, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); } - CalamityUtils.HomeInOnNPC(Projectile, true, 300f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 512f, 12f, 20f); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Melee/GalaxySmasherEcho.cs b/Projectiles/Melee/GalaxySmasherEcho.cs index c9eba67b70..75b3241061 100644 --- a/Projectiles/Melee/GalaxySmasherEcho.cs +++ b/Projectiles/Melee/GalaxySmasherEcho.cs @@ -97,10 +97,8 @@ namespace CalamityMod.Projectiles.Melee { if (targeted != null && target != targeted) modifiers.SourceDamage *= 0.3f; - } - public override bool? CanHitNPC(NPC target) - { - return null; + else + modifiers.SetCrit(); } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { diff --git a/Projectiles/Melee/GalaxySmasherHammer.cs b/Projectiles/Melee/GalaxySmasherHammer.cs index d36e49c644..5332350457 100644 --- a/Projectiles/Melee/GalaxySmasherHammer.cs +++ b/Projectiles/Melee/GalaxySmasherHammer.cs @@ -217,13 +217,13 @@ namespace CalamityMod.Projectiles.Melee } if (EchoHammerPrep > 40) { - int hammer = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity, ModContent.ProjectileType(), Projectile.damage * 10, Projectile.knockBack * 2.5f, Projectile.owner, 0f, Projectile.ai[1]); + int hammer = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity, ModContent.ProjectileType(), Projectile.damage * 9, Projectile.knockBack * 2.5f, Projectile.owner, 0f, Projectile.ai[1]); Main.projectile[hammer].localAI[0] = Math.Sign(Projectile.velocity.X); Main.projectile[hammer].netUpdate = true; Projectile.Kill(); } else - EchoHammerPrep += 0.2f; + EchoHammerPrep += 0.275f; } if (targetDist < 1400) diff --git a/Projectiles/Melee/LaserFountain.cs b/Projectiles/Melee/LaserFountain.cs deleted file mode 100644 index 1df4e4245f..0000000000 --- a/Projectiles/Melee/LaserFountain.cs +++ /dev/null @@ -1,46 +0,0 @@ -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Melee -{ - public class LaserFountain : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Melee"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetDefaults() - { - Projectile.width = 4; - Projectile.height = 4; - Projectile.friendly = true; - Projectile.alpha = 255; - Projectile.penetrate = -1; - Projectile.tileCollide = false; - Projectile.timeLeft = 60; - Projectile.DamageType = DamageClass.Melee; - Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 10; - } - - public override void AI() - { - Projectile.localAI[0] += 1f; - float SpeedX = (float)Main.rand.Next(-15, 15); - float SpeedY = (float)Main.rand.Next(-20, -10); - if (Projectile.localAI[0] >= 12f) - { - if (Projectile.owner == Main.myPlayer) - { - int damage = (int)Main.player[Projectile.owner].GetTotalDamage().ApplyTo(350f); - int laserShot = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, SpeedX, SpeedY, ModContent.ProjectileType(), damage, Projectile.knockBack, Projectile.owner, 0f, 0f); - if (laserShot.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[laserShot].DamageType = DamageClass.Melee; - Main.projectile[laserShot].aiStyle = ProjAIStyleID.Arrow; - } - } - Projectile.localAI[0] = 0f; - } - } - } -} diff --git a/Projectiles/Melee/MaceFlails/BallOFuguProj.cs b/Projectiles/Melee/MaceFlails/BallOFuguProj.cs index afbe2c194e..304031057f 100644 --- a/Projectiles/Melee/MaceFlails/BallOFuguProj.cs +++ b/Projectiles/Melee/MaceFlails/BallOFuguProj.cs @@ -70,12 +70,18 @@ namespace CalamityMod.Projectiles.Melee.MaceFlails if (SpikeCount > 0) { SoundEngine.PlaySound(BallOFugu.BlowSound, Projectile.Center); - Particle BlowParticle = new CustomPulse(Projectile.Center, Vector2.Zero, SpikeColor, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(0, MathHelper.TwoPi), 0f, 0.05f + 0.005f * SpikeCount, 12); - GeneralParticleHandler.SpawnParticle(BlowParticle); + + for (int i = -4; i < 5; i++) + { + Vector2 maxScale = new Vector2(Main.rand.NextFloat(1f, 1.2f), Main.rand.NextFloat(0.6f, 0.75f)) * (i % 2 == 0 ? 1f : 1.35f); + float rotation = Projectile.velocity.ToRotation() + MathHelper.ToRadians(30f * i); + CustomPulse spike = new CustomPulse(Projectile.Center, Vector2.One, SpikeColor, "CalamityMod/Particles/BlastCone", maxScale, rotation, 1f, 0.5f, 12); + GeneralParticleHandler.SpawnParticle(spike); + } for (int i = 0; i < SpikeCount; i++) { - Vector2 velocity = Main.rand.NextVector2Unit() * Main.rand.NextFloat(6f, 7.2f); + Vector2 velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(MathHelper.ToRadians(105f)) * Main.rand.NextFloat(6f, 7.2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * SpikeDamage), Projectile.knockBack * SpikeKnockback, Projectile.owner); } } diff --git a/Projectiles/Melee/MaceFlails/UrchinMaceProj.cs b/Projectiles/Melee/MaceFlails/UrchinMaceProj.cs index 43b21f426c..408eca4e75 100644 --- a/Projectiles/Melee/MaceFlails/UrchinMaceProj.cs +++ b/Projectiles/Melee/MaceFlails/UrchinMaceProj.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Melee.MaceFlails // This flail only runs through one state (spin), thereby making most parameters unnecessary to fill out public override int AssociatedItemID => ModContent.ItemType(); public override int SpinIFrames => 15; - public override float SpinHitboxRadius => 64f; + public override float SpinHitboxRadius => 56f; public override float SpinVerticalFactor => 1f; // This flail moves circular public override float LaunchSpeed => 22f; @@ -134,17 +134,17 @@ namespace CalamityMod.Projectiles.Melee.MaceFlails Texture2D whirlpoolTexture = TextureAssets.Projectile[ModContent.ProjectileType()].Value; float WindupProgress = MathHelper.Clamp(StateTimer, 0, MaxWindup) / MaxWindup; - float whirlpoolScale = MathHelper.Clamp(WindupProgress * 3f - 0.4f, 0f, 1f) * 2f; + float whirlpoolScale = MathHelper.Clamp(WindupProgress * 3f - 0.4f, 0f, 1f) * 1.6f; float whirlpoolOpacity = WindupProgress * 0.2f + MathF.Sin(Main.GlobalTimeWrappedHourly * 3f) * 0.1f; float whirlpoolRotation = StateTimer * 0.34f * Owner.direction; SpriteEffects flip = Owner.direction < 0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - Main.EntitySpriteDraw(whirlpoolTexture, Owner.MountedCenter - Main.screenPosition, null, Lighting.GetColor((int)Owner.MountedCenter.X / 16, (int)Owner.MountedCenter.Y / 16) * whirlpoolOpacity * 0.3f, whirlpoolRotation * 1.2f, whirlpoolTexture.Size() / 2f, whirlpoolScale, flip, 0); - Main.EntitySpriteDraw(whirlpoolTexture, Owner.MountedCenter - Main.screenPosition, null, Lighting.GetColor((int)Owner.MountedCenter.X / 16, (int)Owner.MountedCenter.Y / 16) * whirlpoolOpacity, whirlpoolRotation, whirlpoolTexture.Size() / 2f, whirlpoolScale, flip, 0); + Main.EntitySpriteDraw(whirlpoolTexture, Owner.MountedCenter - Main.screenPosition, null, Lighting.GetColor((int)Owner.MountedCenter.X / 16, (int)Owner.MountedCenter.Y / 16) * whirlpoolOpacity * 0.3f, whirlpoolRotation * 1.2f, whirlpoolTexture.Size() * 0.5f, whirlpoolScale, flip); + Main.EntitySpriteDraw(whirlpoolTexture, Owner.MountedCenter - Main.screenPosition, null, Lighting.GetColor((int)Owner.MountedCenter.X / 16, (int)Owner.MountedCenter.Y / 16) * whirlpoolOpacity, whirlpoolRotation, whirlpoolTexture.Size() * 0.5f, whirlpoolScale, flip); Vector2 handleOrigin = new Vector2(0, maceTexture.Height); float maceRotation = Projectile.rotation + MathHelper.PiOver4; - Main.EntitySpriteDraw(maceTexture, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), maceRotation, handleOrigin, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(maceTexture, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), maceRotation, handleOrigin, Projectile.scale, SpriteEffects.None); return false; } } diff --git a/Projectiles/Melee/MurasamaSlash.cs b/Projectiles/Melee/MurasamaSlash.cs index 62c4e42c16..2b0d77c490 100644 --- a/Projectiles/Melee/MurasamaSlash.cs +++ b/Projectiles/Melee/MurasamaSlash.cs @@ -173,12 +173,15 @@ namespace CalamityMod.Projectiles.Melee Projectile.velocity = newVelocity; } } - public override void ModifyDamageHitbox(ref Rectangle hitbox) + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { - int size = 60; - if (Slash3) - hitbox.Inflate(size, size); + Vector2 lineEnd = Main.player[Projectile.owner].Center + Projectile.velocity * (Slash3 ? 11.35f : 8.6f); + // The slash sprite is top-heavy, so make the width lean in a direction + float lineWidth = (Projectile.direction == 1 && projHitbox.Center.X > targetHitbox.Center.X) || (Projectile.direction == -1 && projHitbox.Center.X < targetHitbox.Center.X) ? 320f : 200f; + float _ = 0f; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Main.player[Projectile.owner].Center, lineEnd, lineWidth, ref _); } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { if (target.Organic()) diff --git a/Projectiles/Melee/PrismaticBreakerHoldout.cs b/Projectiles/Melee/PrismaticBreakerHoldout.cs index 7b0dc48d71..fb6c9c15e7 100644 --- a/Projectiles/Melee/PrismaticBreakerHoldout.cs +++ b/Projectiles/Melee/PrismaticBreakerHoldout.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Melee { StarTimer = 0f; SoundEngine.PlaySound(SoundID.Item43 with { Volume = 0.6f }, Projectile.Center); - for (int i = 0; i < 4; i++) + for (int i = 0; i < 3; i++) { float clampedChargeTime = MathHelper.Clamp(Timer / LaserChargeTime, 0f, 1f); float starOffset = MathHelper.Lerp(MathHelper.Pi / 6f, 0f, clampedChargeTime); diff --git a/Projectiles/Melee/PrismaticMagicCircle.cs b/Projectiles/Melee/PrismaticMagicCircle.cs index 760f51b0de..4693feba1e 100644 --- a/Projectiles/Melee/PrismaticMagicCircle.cs +++ b/Projectiles/Melee/PrismaticMagicCircle.cs @@ -75,10 +75,8 @@ namespace CalamityMod.Projectiles.Melee GameShaders.Misc["CalamityMod:ExoVortex"].Apply(); for (int i = 0; i < 6; i++) - { - Color portalColor = Color.Lerp(Main.DiscoColor, Color.White, (float)Math.Abs(Math.Sin(Main.GlobalTimeWrappedHourly * 2f))); Main.spriteBatch.Draw(howNoisy, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, howNoisy.Size() / 2f, squishScale, SpriteEffects.None, 0f); - } + Main.spriteBatch.ExitShaderRegion(); return false; } diff --git a/Projectiles/Melee/PrismaticRay.cs b/Projectiles/Melee/PrismaticRay.cs index 28d99875b9..237be73ecd 100644 --- a/Projectiles/Melee/PrismaticRay.cs +++ b/Projectiles/Melee/PrismaticRay.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.tileCollide = false; Projectile.timeLeft = 360; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 6; + Projectile.localNPCHitCooldown = 9; Projectile.hide = true; } @@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Melee if (HitSoundCooldown == 0) { SoundEngine.PlaySound(HitSound, target.Center); - HitSoundCooldown = 10; + HitSoundCooldown = 9; } } diff --git a/Projectiles/Melee/RedtideWhirlpool.cs b/Projectiles/Melee/RedtideWhirlpool.cs index 0b983a87b8..56cfea6532 100644 --- a/Projectiles/Melee/RedtideWhirlpool.cs +++ b/Projectiles/Melee/RedtideWhirlpool.cs @@ -14,10 +14,15 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public Player Owner => Main.player[Projectile.owner]; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 2; + } + public override void SetDefaults() { - Projectile.width = 60; - Projectile.height = 60; + Projectile.width = Projectile.height = 60; Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; Projectile.ignoreWater = true; @@ -42,29 +47,29 @@ namespace CalamityMod.Projectiles.Melee Dust dust = Dust.NewDustPerfect(dustPos, 176, (angle - MathHelper.PiOver2 * Math.Sign(Projectile.velocity.X)).ToRotationVector2() * 8f + Projectile.velocity, Scale: Main.rand.NextFloat(1.6f, 3f)); dust.noGravity = true; } - - Vector2 trailOffset = Projectile.velocity.SafeNormalize(Vector2.Zero).RotatedBy(MathHelper.PiOver2) * Main.rand.NextFloat(40f, 48f); - Dust trail = Dust.NewDustPerfect(Projectile.Center + trailOffset, 176, Main.rand.NextVector2Circular(0.2f, 0.2f)); - trail.noGravity = true; - trail.scale = Main.rand.NextFloat(0.8f, 3f); - trail.alpha = Main.rand.Next(120, 180 + 1); - trail = Dust.NewDustPerfect(Projectile.Center - trailOffset, 176, Main.rand.NextVector2Circular(0.2f, 0.2f)); - trail.noGravity = true; - trail.scale = Main.rand.NextFloat(0.8f, 3f); - trail.alpha = Main.rand.Next(120, 180 + 1); } public override bool PreDraw(ref Color lightColor) { Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - SpriteEffects flip = Math.Sign(Projectile.velocity.X) < 0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, lightColor * 0.3f, Projectile.rotation * 1.2f, texture.Size() * 0.5f, 1.2f, flip); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, lightColor * 0.4f, Projectile.rotation, texture.Size() * 0.5f, 1.6f, flip); - Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, lightColor * 0.3f, Projectile.rotation * 1.2f, texture.Size() / 2f, 1.5f, flip, 0); - Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, lightColor * 0.4f, Projectile.rotation, texture.Size() / 2f, 2f, flip, 0); - + // Custom afterimage + for (int i = 1; i < Projectile.oldPos.Length; i++) + { + float afterimageRot = Projectile.oldRot[i]; + Vector2 drawPos = Projectile.oldPos[i] + texture.Size() * 0.5f - Main.screenPosition; + float intensity = MathHelper.Lerp(0.01f, 0.1f, 1f - i / (float)Projectile.oldPos.Length); + + Main.EntitySpriteDraw(texture, drawPos, null, lightColor * intensity, afterimageRot, texture.Size() * 0.5f, 1.6f, flip); + } return false; } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 56f, targetHitbox); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); public override void OnKill(int timeLeft) diff --git a/Projectiles/Melee/SkytideDragoonHoldout.cs b/Projectiles/Melee/SkytideDragoonHoldout.cs index e362c1c7f4..3b227f0261 100644 --- a/Projectiles/Melee/SkytideDragoonHoldout.cs +++ b/Projectiles/Melee/SkytideDragoonHoldout.cs @@ -220,7 +220,7 @@ namespace CalamityMod.Projectiles.Melee if (fancySwing) // Call down the bolt { Owner.Calamity().GeneralScreenShakePower = 3f; - SoundStyle sound = new("CalamityMod/Sounds/Item/SkytiedBolt"); + SoundStyle sound = new("CalamityMod/Sounds/Item/SkytideBolt"); SoundEngine.PlaySound(sound with { Volume = 0.8f }, Projectile.Center); Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center + new Vector2(0, -600), new Vector2(0, 10), ModContent.ProjectileType(), (int)(Projectile.damage * 9), Projectile.knockBack, Projectile.owner, 0, 0.5f); proj.timeLeft = 45; @@ -230,7 +230,7 @@ namespace CalamityMod.Projectiles.Melee else if (redirected) // Redirect the bolt { Owner.Calamity().GeneralScreenShakePower = 4.5f; - SoundStyle fire = new("CalamityMod/Sounds/Item/SkytiedBolt"); + SoundStyle fire = new("CalamityMod/Sounds/Item/SkytideBolt"); SoundEngine.PlaySound(fire with { Volume = 1f, Pitch = -0.2f }, Projectile.Center); SoundStyle fire2 = new("CalamityMod/Sounds/Item/AuricBulletHit"); SoundEngine.PlaySound(fire2 with { Volume = 0.5f, Pitch = 0.2f }, Projectile.Center); diff --git a/Projectiles/Melee/Spears/GildedProboscisProj.cs b/Projectiles/Melee/Spears/GildedProboscisProj.cs index f0967784f6..0d5cf451c9 100644 --- a/Projectiles/Melee/Spears/GildedProboscisProj.cs +++ b/Projectiles/Melee/Spears/GildedProboscisProj.cs @@ -1,50 +1,271 @@ -using CalamityMod.Balancing; -using System; +using System; +using CalamityMod.Balancing; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.CalPlayer.Dashes; using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.Healing; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Melee.Spears { - public class GildedProboscisProj : BaseSpearProjectile + public class GildedProboscisProj : BaseSwordHoldoutProjectile, ILocalizedModType { - public override LocalizedText DisplayName => CalamityUtils.GetItemName(); - public override void SetDefaults() + public new string LocalizationCategory => "Projectiles.Melee"; + public override bool useMeleeSpeed => false; + public override bool useMeleeSize => false; + public override int swingWidth => 360; + public override Item BaseItem => ModContent.GetModItem(ModContent.ItemType()).Item; + public override int AfterImageLength => 0; + + public override int StartupTime { get; set; } + public override int CooldownTime { get; set; } + + + public override float lineCollisionLength => 196; + + bool isChannelable = false; + + int channelCharge = 0; + + public override void Defaults() { - Projectile.width = Projectile.height = 40; - Projectile.DamageType = TrueMeleeDamageClass.Instance; - Projectile.timeLeft = 90; - Projectile.friendly = true; - Projectile.hostile = false; - Projectile.tileCollide = false; - Projectile.ignoreWater = true; - Projectile.penetrate = -1; - Projectile.ownerHitCheck = true; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 4; + Projectile.width = Projectile.height = 138; + Projectile.extraUpdates = 5; //ExtraUpdates help make the VFX smoother + Projectile.noEnchantmentVisuals = true; + } + public override void Spawn(IEntitySource source) + { + //This sets variables for the spear in general, as well as the secondary attack + //The secondary attack is the "default" because it was coded first + var player = Main.player[Projectile.owner]; + var modplayer = player.GetModPlayer(); + StartupTime = 20; + CooldownTime = 41; + swingTime -= StartupTime + CooldownTime; + modplayer.swingNum = 0; + OffsetDistance = 70; + angle = new Vector2(angle.X > 0 ? 1 : -1, 0); + if (player.dashDelay == -1) + { + angle = new Vector2(-MathF.Sign(player.velocity.X), 0 ); + } + RotateInStartup = 0; + RotateInCooldown = 0; + + UseSound = SoundID.DD2_BetsysWrathImpact; + //This adjusts variables for the primary attack + if (player.altFunctionUse == 0) + { + UseSound = SoundID.DD2_JavelinThrowersAttack; + isChannelable = true; + RotateInStartup = 0.5f; + OffsetDistance = 10; + } } - // These numbers sure are common, huh? yeah, they are - public override float InitialSpeed => 3f; - public override float ReelbackSpeed => 2.4f; - public override float ForwardSpeed => 0.8f; - public override void ExtraBehavior() + public override void AdditionalAI() { - if (Main.rand.NextBool(4)) + var player = Main.player[Projectile.owner]; + //Primary attack is a chargable spear stab + //The DPS is worse than the secondary due to being able to charge it while out of range + //The goal gameplay loop is for the primary to be used when getting up close, than the secondary to be used while close + #region Primary Attack + if (isChannelable) { - int dust = Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.RedTorch, Projectile.direction * 2, 0f, 150, default, 1f); - Main.dust[dust].noGravity = true; + //When channeling, the internal timer will not progress & the charge timer will go up + if (player.channel) + { + if (timer >= StartupTime - 1) + { + timer--; + Projectile.timeLeft++; + } + if (Projectile.FinalExtraUpdate() && channelCharge < CalamityUtils.SecondsToFrames(5)) + channelCharge++; + } + //Once not channeling, set the damage at the end of the startup + else + { + if (timer == StartupTime - 1) + Projectile.damage = (int)(Projectile.damage * 0.75 * (channelCharge / 60f)); //scales from 0x to 3.75x power + } + //Make the sprite rotation look right in game + Projectile.rotation -= (MathHelper.PiOver2) * (angle.X > 0 ? 1 : -1); + + //Adjust the offset distance (how close/far the weapon is held to the player) depending on charge during startup + //In cooldown or during the swing, these are based on how far completed the corresponding step is + if (inStartup) + { + OffsetDistance = (int)MathHelper.SmoothStep(40, 5, channelCharge / 300f); + } + if (inCooldown) + { + OffsetDistance = (int)MathHelper.SmoothStep(90, 60, MathF.Pow(CooldownCompletion, 1)); + + if (CooldownCompletion > 0.5f && Main.LocalPlayer.whoAmI == Projectile.owner && player.HeldItem.type == ModContent.ItemType() && Main.mouseRight) + { + player.itemAnimation = 1; + player.itemTime = 1; + Projectile.timeLeft = 1; + timer = StartupTime + swingTime + CooldownTime; + return; + } + } + + if (inSwing) + { + OffsetDistance = (int)MathHelper.Lerp(-40, 90, MathF.Pow(SwingCompletion, 1.7f)); + //Spawn the little sparks + var veloc = oldPlayerOffset - (Projectile.Center - Main.player[Projectile.owner].Center); + veloc.Normalize(); + if (swingTimer % 4 == 0) + { + for (int i2 = -1; i2 <= 1; i2 += 2) + { + int sparkLifetime = Main.rand.Next(15, 23); + + Vector2 sparkVel = Vector2.UnitY * -9f; + float maxRotationDeviance = 0.4f; + float rotationAngle = Main.rand.NextFloat(-maxRotationDeviance, maxRotationDeviance); + sparkVel = sparkVel.RotatedBy(rotationAngle) * Main.rand.NextFloat(0.3f, 1.0f); + + float sparkScale = Main.rand.NextFloat(0.007f, 0.015f); + + Vector2 compensatedSparkVel = angle.RotatedBy(i2 * -0.15f) * Main.rand.NextFloat(5, 10); + Vector2 pos = player.Center + angle.RotatedBy(MathHelper.Pi) * (OffsetDistance + Main.rand.NextFloat(30, 100)) * Projectile.scale + new Vector2(0, 10 * i2).RotatedByRandom(MathHelper.Pi - 0.2f); + + Particle spark = new GlowSparkParticle(pos, compensatedSparkVel, false, sparkLifetime, sparkScale, Main.rand.NextBool() ? Color.Red : Color.Gold, new Vector2(0.5f, 1.3f)); + GeneralParticleHandler.SpawnParticle(spark); + } + + } + //Spawn the large glow V + var sparkAngle = angle.RotatedBy(MathHelper.Pi); + int dir = MathF.Sign(sparkAngle.X); + var color = Color.Lerp(Color.Gold, Color.Crimson, SwingCompletion); + if (swingTimer % 2 == 0 || (swingTimer == swingTime - 1)) + for (int i = -1; i <= 1; i += 2) + { + Vector2 velocity = -sparkAngle.RotatedBy(i * -0.3f) * 10f; + Vector2 position = Projectile.Center + new Vector2(75, i * 22).RotatedBy(sparkAngle.ToRotation()); + Particle spark = new CustomSpark(position, velocity, "CalamityMod/Particles/BloomCircle", false, 10, 0.3f, color, new Vector2(0.3f, 3f), shrinkSpeed: 0.2f); + GeneralParticleHandler.SpawnParticle(spark); + } + } + return; } + #endregion + //The secondary attack is based on Byleth's side-special from Smash Ultimate + //It moves the player forward when used, and is meant to be the higher DPS option of the two + #region Secondary Attack + + //Sets the max dash velocity depending on keys + //Base of 12, 4 when holding against the dash & 20 when holding with the dash + var dashStrength = 12; + if ((player.direction == 1 && player.controlLeft) || (player.direction == -1 && player.controlRight)) + dashStrength -= 8; + if ((player.direction == 1 && player.controlRight) || (player.direction == -1 && player.controlLeft)) + dashStrength += 8; + if (inStartup) + { + //Scale % offset distance during startup + Projectile.scale = baseScale * MathHelper.Lerp(0.9f, 0.65f, MathF.Pow(StartupCompletion, 2f)); + OffsetDistance = (int)MathHelper.Lerp(60f, 40f, MathF.Pow(StartupCompletion, 2f)); + ref var vel = ref Main.player[Projectile.owner].velocity; + //accel for player during dash + if (StartupCompletion > 0.5f && -vel.X * angle.X < dashStrength) + vel.X -= angle.X; + } + else if (inCooldown) + { + //Scale & offset distance during cooldown + Projectile.scale = baseScale * MathHelper.Lerp(1, 0.9f, 1 - MathF.Pow(1 - CooldownCompletion, 2)); + OffsetDistance = (int)MathHelper.Lerp(70, 60, 1 - MathF.Pow(1 - CooldownCompletion, 2)); + ref var vel = ref Main.player[Projectile.owner].velocity; + //decel for player after dash + if (CooldownCompletion < 0.25f && -vel.X * angle.X > 5) + vel.X *= 0.9f; + } + else + { + //scale & offset for the damaging swing part of the anim + //This keeps "am" (short for animation) at 0 or 1 most of the time, with a quick but smooth transition + float am = MathHelper.Clamp(MathF.Pow((SwingCompletion - (0.5f - (1 / 3f))) * 3f, 3f), 0, 1); + if (float.IsNaN(am)) + am = 0; + Projectile.scale = baseScale * MathHelper.Lerp(0.65f, 1, am); + am = MathHelper.Clamp(MathF.Pow((SwingCompletion - (0.3f - (1 / 3f))) * 3f, 3f), 0, 1); + if (float.IsNaN(am)) + am = 0; + OffsetDistance = (int)MathHelper.Lerp(40, 70, am); + //accel for player during dash + ref var vel = ref Main.player[Projectile.owner].velocity; + if (-vel.X * angle.X < dashStrength) + vel.X -= angle.X; + + var veloc = oldPlayerOffset - (Projectile.Center - Main.player[Projectile.owner].Center); + veloc.Normalize(); + //Little sparks + for (var i = 0; i < 2; i++) + { + int sparkLifetime = Main.rand.Next(15, 23); + + Vector2 sparkVel = Vector2.UnitY * -9f; + float maxRotationDeviance = 0.4f; + float rotationAngle = Main.rand.NextFloat(-maxRotationDeviance, maxRotationDeviance); + sparkVel = sparkVel.RotatedBy(rotationAngle) * Main.rand.NextFloat(0.3f, 1.0f); + + float sparkScale = Main.rand.NextFloat(0.007f, 0.015f); + + Vector2 compensatedSparkVel = veloc * Main.rand.NextFloat(2, 5); + Particle spark = new GlowSparkParticle(Projectile.Center + new Vector2(-angle.X, Main.rand.NextFloat(-0.05f, 0.05f)).RotatedBy(Projectile.rotation) * Main.rand.NextFloat(50, 120) * Projectile.scale, compensatedSparkVel, false, sparkLifetime, sparkScale, Main.rand.NextBool() ? Color.Red : Color.Gold, new Vector2(0.5f, 1.3f)); + GeneralParticleHandler.SpawnParticle(spark); + + } + // Smoke/fire effect + Color[] smokeColor = { Color.Red, Color.Goldenrod, Color.Crimson }; + Vector2 smokePosition = Projectile.Center + new Vector2(-angle.X, Main.rand.NextFloat(-0.05f, 0.05f)).RotatedBy(Projectile.rotation) * 80 * Projectile.scale; + for (var i = 0; i < 3; i++) + { + Particle beam4 = new CustomSpark(smokePosition, smokePosition.DirectionTo(Main.player[Projectile.owner].Center), "CalamityMod/ExtraTextures/Trails/ScarletDevilStreak", false, 10, 0.6f * Projectile.scale, smokeColor[timer % 3], new Vector2(1f, 1), true, false, 0, false, false, 0f); + GeneralParticleHandler.SpawnParticle(beam4); + } + } + Projectile.rotation -= (MathHelper.PiOver2) * angle.X; + #endregion + } + + public override float SwingFunction() + { + if (isChannelable) //Primary attack + { + if (inStartup && channelCharge >= CalamityUtils.SecondsToFrames(5)) + { + //shake when fully charged + return Main.rand.NextFloat(-0.025f, 0.025f); + } + return 0; //Primary attack should face the mouse direction directly + } + //Everything else is secondary attack + if (inStartup) + return MathHelper.ToRadians(MathHelper.SmoothStep(swingWidth * 0.7f, swingWidth * 0.33f, MathF.Pow(StartupCompletion, 4f))); + if (inCooldown) + return MathHelper.ToRadians(MathHelper.Lerp(-swingWidth * 0.2f, -swingWidth * 0.3f, 1 - MathF.Pow(1 - CooldownCompletion, 3f))); + return MathHelper.ToRadians(MathHelper.SmoothStep(swingWidth * 0.33f, -swingWidth * 0.2f, SwingCompletion)); } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 240); - Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.01)); + target.AddBuff(ModContent.BuffType(), 900); + Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.002)); } } } diff --git a/Projectiles/Melee/TheMutilatorHoldoutProjectile.cs b/Projectiles/Melee/TheMutilatorHoldoutProjectile.cs index a562a8cc32..2bc10c3cc6 100644 --- a/Projectiles/Melee/TheMutilatorHoldoutProjectile.cs +++ b/Projectiles/Melee/TheMutilatorHoldoutProjectile.cs @@ -42,6 +42,9 @@ namespace CalamityMod.Projectiles.Melee public override int StartupTime { get; set; } public override int CooldownTime { get; set; } + public override SoundStyle? UseSound => SoundID.Item1; + + public bool hasGivenBlood = false; public override void Spawn(IEntitySource source) diff --git a/Projectiles/Melee/UrchinSpikeFugu.cs b/Projectiles/Melee/UrchinSpikeFugu.cs index 249d92ad9a..f96645ac3e 100644 --- a/Projectiles/Melee/UrchinSpikeFugu.cs +++ b/Projectiles/Melee/UrchinSpikeFugu.cs @@ -46,8 +46,11 @@ namespace CalamityMod.Projectiles.Melee Projectile.velocity = (Projectile.velocity * 20f + idealVelocity) / 21f; Projectile.velocity = Projectile.velocity.MoveTowards(idealVelocity, 2f); } + else if (Time >= 48f) + Projectile.velocity *= 0.9f; - if (Main.rand.NextBool(8)) + int dustRate = (int)MathF.Max(Utils.Remap(Time, 0f, 12f, 20f, 4f), Utils.Remap(Time, 60f, 90f, 4f, 20f)); + if (Main.rand.NextBool(dustRate)) { Dust offTrail = Dust.NewDustPerfect(Projectile.Center, 171, Main.rand.NextVector2Circular(0.2f, 0.2f)); offTrail.noGravity = true; diff --git a/Projectiles/Melee/Yoyos/BurningRevelationYoyo.cs b/Projectiles/Melee/Yoyos/BurningRevelationYoyo.cs index 738d7d071c..c88f451f81 100644 --- a/Projectiles/Melee/Yoyos/BurningRevelationYoyo.cs +++ b/Projectiles/Melee/Yoyos/BurningRevelationYoyo.cs @@ -206,7 +206,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos SoundStyle explode = new("CalamityMod/Sounds/Custom/Providence/ProvidenceHolyBlastImpact"); SoundEngine.PlaySound(explode with { Volume = 0.5f, Pitch = 0.3f * power }, Projectile.Center); - SoundStyle explode2 = new("CalamityMod/Sounds/Item/HeliumFlashReadyAlt"); + SoundStyle explode2 = new("CalamityMod/Sounds/Item/HeliumFlashReady"); SoundEngine.PlaySound(explode2 with { Volume = 0.7f, Pitch = 0.6f * power }, Projectile.Center); } } diff --git a/Projectiles/Ranged/AMR2.cs b/Projectiles/Ranged/AMR2.cs index 0e7a6fd955..bcf73a3b9a 100644 --- a/Projectiles/Ranged/AMR2.cs +++ b/Projectiles/Ranged/AMR2.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.height = 4; Projectile.light = 0.5f; Projectile.alpha = 255; - Projectile.extraUpdates = 5; + Projectile.extraUpdates = 10; Projectile.scale = 1.18f; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Ranged/AMRShot.cs b/Projectiles/Ranged/AMRShot.cs index d1c7e80d46..0b926f5740 100644 --- a/Projectiles/Ranged/AMRShot.cs +++ b/Projectiles/Ranged/AMRShot.cs @@ -24,18 +24,16 @@ namespace CalamityMod.Projectiles.Ranged Projectile.ignoreWater = true; Projectile.penetrate = 1; Projectile.timeLeft = 600; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() { - float num107 = (float)Math.Sqrt(Projectile.velocity.X * Projectile.velocity.X + Projectile.velocity.Y * Projectile.velocity.Y); if (Projectile.alpha > 0) - Projectile.alpha -= (byte)(num107 * 0.9); + Projectile.alpha -= (int)(Projectile.velocity.Length() * 0.9f); if (Projectile.alpha < 0) Projectile.alpha = 0; - Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.PiOver2; + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; } public override Color? GetAlpha(Color lightColor) @@ -76,12 +74,12 @@ namespace CalamityMod.Projectiles.Ranged if (crit) { var source = Projectile.GetSource_FromThis(); - extraProjectileAmt = 5; + extraProjectileAmt = 4; for (int x = 0; x < extraProjectileAmt; x++) { if (Projectile.owner == Main.myPlayer) { - fromRight = x > 3; + fromRight = x >= 2; CalamityUtils.ProjectileBarrage(source, Projectile.Center, targetPos, fromRight, 500f, 500f, 0f, 500f, 10f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.15), Projectile.knockBack * 0.1f, Projectile.owner); } } diff --git a/Projectiles/Ranged/AnimosityBullet.cs b/Projectiles/Ranged/AnimosityBullet.cs index 546f2b7cf2..afced06a79 100644 --- a/Projectiles/Ranged/AnimosityBullet.cs +++ b/Projectiles/Ranged/AnimosityBullet.cs @@ -32,7 +32,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = Main.zenithWorld ? 3 : 1; Projectile.extraUpdates = 2; Projectile.timeLeft = 300; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() { diff --git a/Projectiles/Ranged/AquaBlast.cs b/Projectiles/Ranged/AquaBlast.cs index 4a0a100b61..bc67355089 100644 --- a/Projectiles/Ranged/AquaBlast.cs +++ b/Projectiles/Ranged/AquaBlast.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = Lifetime; Projectile.extraUpdates = 2; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/Aquashard.cs b/Projectiles/Ranged/Aquashard.cs index 7aaa3c6e6a..2731b8fc06 100644 --- a/Projectiles/Ranged/Aquashard.cs +++ b/Projectiles/Ranged/Aquashard.cs @@ -18,7 +18,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 300; Projectile.aiStyle = ProjAIStyleID.Arrow; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ArcherfishRing.cs b/Projectiles/Ranged/ArcherfishRing.cs index afbe1a3107..a2c7a234a2 100644 --- a/Projectiles/Ranged/ArcherfishRing.cs +++ b/Projectiles/Ranged/ArcherfishRing.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.MaxUpdates = 3; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox); diff --git a/Projectiles/Ranged/ArcherfishShot.cs b/Projectiles/Ranged/ArcherfishShot.cs index 918ebc8a95..d2dc2ab678 100644 --- a/Projectiles/Ranged/ArcherfishShot.cs +++ b/Projectiles/Ranged/ArcherfishShot.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.MaxUpdates = 3; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/AstralRound.cs b/Projectiles/Ranged/AstralRound.cs index 834728bd1c..8f89a2b96b 100644 --- a/Projectiles/Ranged/AstralRound.cs +++ b/Projectiles/Ranged/AstralRound.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.light = 0.25f; Projectile.extraUpdates = 2; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Ranged/AstralSandgun.cs b/Projectiles/Ranged/AstralSandgun.cs index fca008bd42..44efefd7a5 100644 --- a/Projectiles/Ranged/AstralSandgun.cs +++ b/Projectiles/Ranged/AstralSandgun.cs @@ -17,7 +17,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.friendly = true; Projectile.DamageType = DamageClass.Ranged; Projectile.penetrate = -1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 10; } diff --git a/Projectiles/Ranged/AstrealArrow.cs b/Projectiles/Ranged/AstrealArrow.cs index 4d72d5c9f0..0878dab0af 100644 --- a/Projectiles/Ranged/AstrealArrow.cs +++ b/Projectiles/Ranged/AstrealArrow.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 1; Projectile.penetrate = 1; Projectile.timeLeft = 600; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/AuralisBullet.cs b/Projectiles/Ranged/AuralisBullet.cs index 9de76738f3..6051520954 100644 --- a/Projectiles/Ranged/AuralisBullet.cs +++ b/Projectiles/Ranged/AuralisBullet.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 10; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/AuricBullet.cs b/Projectiles/Ranged/AuricBullet.cs index 61d6186699..a88a7029c2 100644 --- a/Projectiles/Ranged/AuricBullet.cs +++ b/Projectiles/Ranged/AuricBullet.cs @@ -32,7 +32,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 600; Projectile.extraUpdates = 15; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.tileCollide = false; Projectile.ArmorPenetration = 50; Projectile.alpha = 255; diff --git a/Projectiles/Ranged/BallistaGreatArrow.cs b/Projectiles/Ranged/BallistaGreatArrow.cs index 6ce0a50098..51e9c5e621 100644 --- a/Projectiles/Ranged/BallistaGreatArrow.cs +++ b/Projectiles/Ranged/BallistaGreatArrow.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Projectiles.Ranged AIType = ProjectileID.WoodenArrowFriendly; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Ranged/BarinadeArrow.cs b/Projectiles/Ranged/BarinadeArrow.cs index 8e5a2ad405..7d177158e3 100644 --- a/Projectiles/Ranged/BarinadeArrow.cs +++ b/Projectiles/Ranged/BarinadeArrow.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 300; Projectile.extraUpdates = 2; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() { diff --git a/Projectiles/Ranged/BloodClotFriendly.cs b/Projectiles/Ranged/BloodClotFriendly.cs index a72db98d46..caf1e8b0b1 100644 --- a/Projectiles/Ranged/BloodClotFriendly.cs +++ b/Projectiles/Ranged/BloodClotFriendly.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.aiStyle = ProjAIStyleID.Arrow; Projectile.extraUpdates = 3; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/BloodfireArrowProj.cs b/Projectiles/Ranged/BloodfireArrowProj.cs index a793e5aad8..fa3534bfaa 100644 --- a/Projectiles/Ranged/BloodfireArrowProj.cs +++ b/Projectiles/Ranged/BloodfireArrowProj.cs @@ -39,7 +39,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.extraUpdates = 9; Projectile.timeLeft = 1200; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/BloodfireBulletProj.cs b/Projectiles/Ranged/BloodfireBulletProj.cs index 5fddf998a1..3f13d793b9 100644 --- a/Projectiles/Ranged/BloodfireBulletProj.cs +++ b/Projectiles/Ranged/BloodfireBulletProj.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.extraUpdates = 12; Projectile.timeLeft = Lifetime; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.tileCollide = false; } diff --git a/Projectiles/Ranged/BoltArrow.cs b/Projectiles/Ranged/BoltArrow.cs index 69ea77610f..7750c3a0b1 100644 --- a/Projectiles/Ranged/BoltArrow.cs +++ b/Projectiles/Ranged/BoltArrow.cs @@ -19,7 +19,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.arrow = true; Projectile.penetrate = 1; Projectile.timeLeft = 180; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Electrified, 60); diff --git a/Projectiles/Ranged/BouncingShotgunPellet.cs b/Projectiles/Ranged/BouncingShotgunPellet.cs index 926212c0fa..c912fea852 100644 --- a/Projectiles/Ranged/BouncingShotgunPellet.cs +++ b/Projectiles/Ranged/BouncingShotgunPellet.cs @@ -21,7 +21,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.aiStyle = ProjAIStyleID.Arrow; AIType = ProjectileID.BulletHighVelocity; Projectile.timeLeft = 180; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Ranged/BrimstoneBolt.cs b/Projectiles/Ranged/BrimstoneBolt.cs index 70666e710f..1ff6ff8ae1 100644 --- a/Projectiles/Ranged/BrimstoneBolt.cs +++ b/Projectiles/Ranged/BrimstoneBolt.cs @@ -24,7 +24,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 3; Projectile.extraUpdates = 2; Projectile.timeLeft = 300; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; } diff --git a/Projectiles/Ranged/BubonicRoundProj.cs b/Projectiles/Ranged/BubonicRoundProj.cs index d591810015..23a22b4d46 100644 --- a/Projectiles/Ranged/BubonicRoundProj.cs +++ b/Projectiles/Ranged/BubonicRoundProj.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 600; Projectile.extraUpdates = 3; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/BuzzkillSaw.cs b/Projectiles/Ranged/BuzzkillSaw.cs index a9d383fd87..4a736dbb47 100644 --- a/Projectiles/Ranged/BuzzkillSaw.cs +++ b/Projectiles/Ranged/BuzzkillSaw.cs @@ -39,7 +39,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; // Saw pierce is set when the saw is spawned, due to it being dynamic based on charge. Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ChargedBlast.cs b/Projectiles/Ranged/ChargedBlast.cs index 6f0cbfa965..a61c09f6b7 100644 --- a/Projectiles/Ranged/ChargedBlast.cs +++ b/Projectiles/Ranged/ChargedBlast.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.extraUpdates = 6; Projectile.timeLeft = 360; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() @@ -57,7 +56,7 @@ namespace CalamityMod.Projectiles.Ranged if (Svant) Projectile.ArmorPenetration = 200; if (Infinity) - Projectile.ArmorPenetration = 25; + Projectile.ArmorPenetration = 20; } Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; if (Projectile.timeLeft == 2) @@ -73,10 +72,9 @@ namespace CalamityMod.Projectiles.Ranged if (!outOfTime) { SoundEngine.PlaySound(SoundID.Item62, Projectile.Center); - int projectiles = 2; if (Projectile.owner == Main.myPlayer) { - for (int k = 0; k < projectiles; k++) + for (int k = 0; k < 2; k++) Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -baseVel.RotatedByRandom(0.9f) * Main.rand.NextFloat(0.6f, 0.7f), ModContent.ProjectileType(), (int)(Projectile.damage * (Projectile.ai[2] > 0 ? 0.3f : 0.5f)), Projectile.knockBack * 0.8f, Main.myPlayer, 0, 0, Projectile.ai[2]); } for (int k = 0; k < 3; k++) diff --git a/Projectiles/Ranged/ChargedBlastSplit.cs b/Projectiles/Ranged/ChargedBlastSplit.cs index 9251ff639d..93e16f4165 100644 --- a/Projectiles/Ranged/ChargedBlastSplit.cs +++ b/Projectiles/Ranged/ChargedBlastSplit.cs @@ -57,12 +57,12 @@ namespace CalamityMod.Projectiles.Ranged if (Infinity) { Projectile.timeLeft = 340; - Projectile.ArmorPenetration = 25; + Projectile.ArmorPenetration = 20; } if (Svant) { Projectile.timeLeft = 640; - Projectile.ArmorPenetration = 100; + Projectile.ArmorPenetration = 200; } direction = Main.rand.NextBool(); homeSpeed = Main.rand.NextFloat(5, 8); diff --git a/Projectiles/Ranged/CinderArrowProj.cs b/Projectiles/Ranged/CinderArrowProj.cs index aa7d906b6b..2dee125be4 100644 --- a/Projectiles/Ranged/CinderArrowProj.cs +++ b/Projectiles/Ranged/CinderArrowProj.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.MaxUpdates = 2; Projectile.timeLeft = 600; Projectile.aiStyle = ProjAIStyleID.Arrow; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; } diff --git a/Projectiles/Ranged/ClamorRifleProj.cs b/Projectiles/Ranged/ClamorRifleProj.cs index ce6bb0907b..0ce05c97c7 100644 --- a/Projectiles/Ranged/ClamorRifleProj.cs +++ b/Projectiles/Ranged/ClamorRifleProj.cs @@ -20,7 +20,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.ignoreWater = true; Projectile.penetrate = 1; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/CondemnationArrow.cs b/Projectiles/Ranged/CondemnationArrow.cs index a3f208088d..617e839429 100644 --- a/Projectiles/Ranged/CondemnationArrow.cs +++ b/Projectiles/Ranged/CondemnationArrow.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.arrow = true; Projectile.extraUpdates = 2; Projectile.timeLeft = 300; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ContagionArrow.cs b/Projectiles/Ranged/ContagionArrow.cs index 067c7820e3..cb75277d92 100644 --- a/Projectiles/Ranged/ContagionArrow.cs +++ b/Projectiles/Ranged/ContagionArrow.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.extraUpdates = 1; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/CorrodedShell.cs b/Projectiles/Ranged/CorrodedShell.cs index d70b68fad7..bd470fb368 100644 --- a/Projectiles/Ranged/CorrodedShell.cs +++ b/Projectiles/Ranged/CorrodedShell.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 12; Projectile.aiStyle = ProjAIStyleID.Arrow; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/DWArrow.cs b/Projectiles/Ranged/DWArrow.cs index 74f4fb6f83..6160c3f44e 100644 --- a/Projectiles/Ranged/DWArrow.cs +++ b/Projectiles/Ranged/DWArrow.cs @@ -22,7 +22,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 5; Projectile.timeLeft = 600; Projectile.arrow = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/DryadsTearMain.cs b/Projectiles/Ranged/DryadsTearMain.cs index 81766cb87a..48d0f4c787 100644 --- a/Projectiles/Ranged/DryadsTearMain.cs +++ b/Projectiles/Ranged/DryadsTearMain.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 600; Projectile.extraUpdates = 5; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ElysianArrowProj.cs b/Projectiles/Ranged/ElysianArrowProj.cs index 6cf4dfc842..c823175f28 100644 --- a/Projectiles/Ranged/ElysianArrowProj.cs +++ b/Projectiles/Ranged/ElysianArrowProj.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 1200; Projectile.extraUpdates = 2; Projectile.aiStyle = ProjAIStyleID.Arrow; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ExoCrystalArrow.cs b/Projectiles/Ranged/ExoCrystalArrow.cs index e51f5150fe..fb03247967 100644 --- a/Projectiles/Ranged/ExoCrystalArrow.cs +++ b/Projectiles/Ranged/ExoCrystalArrow.cs @@ -40,7 +40,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 1; Projectile.timeLeft = 300; Projectile.arrow = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/FeatherLarge.cs b/Projectiles/Ranged/FeatherLarge.cs index db3737de73..c0e0124b8d 100644 --- a/Projectiles/Ranged/FeatherLarge.cs +++ b/Projectiles/Ranged/FeatherLarge.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.penetrate = 1; Projectile.timeLeft = 300; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/FlareBat.cs b/Projectiles/Ranged/FlareBat.cs index eec96dfc86..70e03eed6a 100644 --- a/Projectiles/Ranged/FlareBat.cs +++ b/Projectiles/Ranged/FlareBat.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.light = 0.25f; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/FlashRoundProj.cs b/Projectiles/Ranged/FlashRoundProj.cs index 097af310b5..bab429e622 100644 --- a/Projectiles/Ranged/FlashRoundProj.cs +++ b/Projectiles/Ranged/FlashRoundProj.cs @@ -37,7 +37,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.localNPCHitCooldown = -1; Projectile.aiStyle = ProjAIStyleID.Arrow; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/FlurrystormIceChunk.cs b/Projectiles/Ranged/FlurrystormIceChunk.cs index 33f031585d..39b2db16d6 100644 --- a/Projectiles/Ranged/FlurrystormIceChunk.cs +++ b/Projectiles/Ranged/FlurrystormIceChunk.cs @@ -18,7 +18,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.coldDamage = true; Projectile.penetrate = 1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/FungiOrb.cs b/Projectiles/Ranged/FungiOrb.cs index b0917fb7a7..08be24b2b6 100644 --- a/Projectiles/Ranged/FungiOrb.cs +++ b/Projectiles/Ranged/FungiOrb.cs @@ -18,7 +18,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.aiStyle = ProjAIStyleID.Arrow; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/GodSlayerSlugProj.cs b/Projectiles/Ranged/GodSlayerSlugProj.cs index 5f40a1c0fc..42e5f8155c 100644 --- a/Projectiles/Ranged/GodSlayerSlugProj.cs +++ b/Projectiles/Ranged/GodSlayerSlugProj.cs @@ -50,7 +50,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; Projectile.timeLeft = Lifetime; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void SendExtraAI(BinaryWriter writer) => writer.Write(Projectile.tileCollide); @@ -99,10 +98,9 @@ namespace CalamityMod.Projectiles.Ranged Projectile.ai[1] = BlueNoCollideFrames; Projectile.tileCollide = false; - // Reduce damage, but remove piercing. Reset local iframes so the bullet, turned blue, may always strike again. Reset the point blank timer. - Projectile.damage = (int)(0.23f * Projectile.damage); + // Reduce damage, but remove piercing. Reset local iframes so the bullet, turned blue, may always strike again. + Projectile.damage = (int)(0.25f * Projectile.damage); Projectile.penetrate = 1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; for (int i = 0; i < Main.maxNPCs; i++) Projectile.localNPCImmunity[i] = 0; diff --git a/Projectiles/Ranged/HailstormBulletProj.cs b/Projectiles/Ranged/HailstormBulletProj.cs index 17620c79fa..72f591fa25 100644 --- a/Projectiles/Ranged/HailstormBulletProj.cs +++ b/Projectiles/Ranged/HailstormBulletProj.cs @@ -37,7 +37,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; Projectile.coldDamage = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/HallowPointRoundProj.cs b/Projectiles/Ranged/HallowPointRoundProj.cs index 8d8ec76fec..02da6911c5 100644 --- a/Projectiles/Ranged/HallowPointRoundProj.cs +++ b/Projectiles/Ranged/HallowPointRoundProj.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Projectiles.Ranged // Invisible for the first few frames Projectile.alpha = 255; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/HellbornProj.cs b/Projectiles/Ranged/HellbornProj.cs index 132e147bf5..ff222b2b20 100644 --- a/Projectiles/Ranged/HellbornProj.cs +++ b/Projectiles/Ranged/HellbornProj.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 600; Projectile.DamageType = DamageClass.Ranged; Projectile.extraUpdates = 2; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; } diff --git a/Projectiles/Ranged/HolyFireBulletProj.cs b/Projectiles/Ranged/HolyFireBulletProj.cs index 3c3fdd2a79..f0ecc0e263 100644 --- a/Projectiles/Ranged/HolyFireBulletProj.cs +++ b/Projectiles/Ranged/HolyFireBulletProj.cs @@ -35,7 +35,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.extraUpdates = 7; Projectile.timeLeft = 600; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; } diff --git a/Projectiles/Ranged/HydraHeadLaunch.cs b/Projectiles/Ranged/HydraHeadLaunch.cs index db6d8fc4aa..48edcc98f4 100644 --- a/Projectiles/Ranged/HydraHeadLaunch.cs +++ b/Projectiles/Ranged/HydraHeadLaunch.cs @@ -22,7 +22,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.MaxUpdates = 3; Projectile.penetrate = 1; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } //Normal hitbox size for explosion, rotated otherwise diff --git a/Projectiles/Ranged/HyperiusBulletProj.cs b/Projectiles/Ranged/HyperiusBulletProj.cs index 777dee25c5..0b08d01060 100644 --- a/Projectiles/Ranged/HyperiusBulletProj.cs +++ b/Projectiles/Ranged/HyperiusBulletProj.cs @@ -37,7 +37,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.tileCollide = false; AIType = ProjectileID.Bullet; Projectile.ignoreWater = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; } diff --git a/Projectiles/Ranged/IcicleArrowProj.cs b/Projectiles/Ranged/IcicleArrowProj.cs index 85a3f2a673..bb2953d0f9 100644 --- a/Projectiles/Ranged/IcicleArrowProj.cs +++ b/Projectiles/Ranged/IcicleArrowProj.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 1000; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 15 * Projectile.MaxUpdates; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ImpactRound.cs b/Projectiles/Ranged/ImpactRound.cs index 9dae2a8086..bd6a72442c 100644 --- a/Projectiles/Ranged/ImpactRound.cs +++ b/Projectiles/Ranged/ImpactRound.cs @@ -32,7 +32,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = Lifetime; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/LeafArrow.cs b/Projectiles/Ranged/LeafArrow.cs index e5fb34f26e..800f0c3249 100644 --- a/Projectiles/Ranged/LeafArrow.cs +++ b/Projectiles/Ranged/LeafArrow.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 1; Projectile.timeLeft = 300; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/LunarBolt.cs b/Projectiles/Ranged/LunarBolt.cs index b7fa456499..b5883c7d61 100644 --- a/Projectiles/Ranged/LunarBolt.cs +++ b/Projectiles/Ranged/LunarBolt.cs @@ -18,7 +18,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.extraUpdates = 1; Projectile.timeLeft = 180; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/MagnaShot.cs b/Projectiles/Ranged/MagnaShot.cs index 874aa255a4..4538ed3922 100644 --- a/Projectiles/Ranged/MagnaShot.cs +++ b/Projectiles/Ranged/MagnaShot.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 300; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.extraUpdates = 2; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 50; diff --git a/Projectiles/Ranged/MegalodonShot.cs b/Projectiles/Ranged/MegalodonShot.cs index 9ecee22bea..08d42679d7 100644 --- a/Projectiles/Ranged/MegalodonShot.cs +++ b/Projectiles/Ranged/MegalodonShot.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.MaxUpdates = 3; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/MiniSharkron.cs b/Projectiles/Ranged/MiniSharkron.cs index 6f357a690c..07831fa91b 100644 --- a/Projectiles/Ranged/MiniSharkron.cs +++ b/Projectiles/Ranged/MiniSharkron.cs @@ -20,9 +20,9 @@ namespace CalamityMod.Projectiles.Ranged AIType = ProjectileID.MiniSharkron; Projectile.friendly = true; Projectile.alpha = 255; + Projectile.arrow = true; Projectile.ignoreWater = true; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void OnKill(int timeLeft) diff --git a/Projectiles/Ranged/MistArrow.cs b/Projectiles/Ranged/MistArrow.cs index 60782c2b63..30bacffc92 100644 --- a/Projectiles/Ranged/MistArrow.cs +++ b/Projectiles/Ranged/MistArrow.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged AIType = ProjectileID.WoodenArrowFriendly; Projectile.arrow = true; Projectile.coldDamage = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/NitroShot.cs b/Projectiles/Ranged/NitroShot.cs index 5496c63ec7..33ca4ed10f 100644 --- a/Projectiles/Ranged/NitroShot.cs +++ b/Projectiles/Ranged/NitroShot.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 600; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/NorfleetCannon.cs b/Projectiles/Ranged/NorfleetCannon.cs index caeb01d06d..a2d0eedeeb 100644 --- a/Projectiles/Ranged/NorfleetCannon.cs +++ b/Projectiles/Ranged/NorfleetCannon.cs @@ -180,7 +180,7 @@ namespace CalamityMod.Projectiles.Ranged private void ShootRocket(Item item) { - if (hasFired == false) + if (!hasFired) { // We use the velocity of this projectile as its direction vector. Vector2 shootDirection = Projectile.velocity.SafeNormalize(Vector2.Zero); @@ -194,7 +194,7 @@ namespace CalamityMod.Projectiles.Ranged for (int i = 0; i < 3; i++) { - Vector2 firingVelocity = shootDirection.RotatedByRandom((0.2f * i) + 0.02f) * 5f * Main.rand.NextFloat(0.7f, 1.3f); + Vector2 firingVelocity = shootDirection.RotatedByRandom((0.1f * i) + 0.02f) * 5f * Main.rand.NextFloat(0.8f, 1.2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, firingVelocity, ModContent.ProjectileType(), Projectile.damage / 3, Projectile.knockBack, Projectile.owner, 0, i, PUNISHMENTMODE ? 1 : 0); } diff --git a/Projectiles/Ranged/NovaChargedShot.cs b/Projectiles/Ranged/NovaChargedShot.cs index 26e5da2318..8839304a71 100644 --- a/Projectiles/Ranged/NovaChargedShot.cs +++ b/Projectiles/Ranged/NovaChargedShot.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 1200; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.extraUpdates = 24; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; diff --git a/Projectiles/Ranged/NovaShot.cs b/Projectiles/Ranged/NovaShot.cs index c121177a34..cdddb8ab0e 100644 --- a/Projectiles/Ranged/NovaShot.cs +++ b/Projectiles/Ranged/NovaShot.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = -1; Projectile.timeLeft = 300; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.extraUpdates = 3; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; diff --git a/Projectiles/Ranged/OpalChargedStrike.cs b/Projectiles/Ranged/OpalChargedStrike.cs index 52cf57f8aa..b4f268199b 100644 --- a/Projectiles/Ranged/OpalChargedStrike.cs +++ b/Projectiles/Ranged/OpalChargedStrike.cs @@ -24,7 +24,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 3; Projectile.timeLeft = 300; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.extraUpdates = 3; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 50; diff --git a/Projectiles/Ranged/OpalStrike.cs b/Projectiles/Ranged/OpalStrike.cs index c2d0bbc307..2799d09ce6 100644 --- a/Projectiles/Ranged/OpalStrike.cs +++ b/Projectiles/Ranged/OpalStrike.cs @@ -24,7 +24,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 2; Projectile.timeLeft = 300; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.extraUpdates = 2; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 50; diff --git a/Projectiles/Ranged/P90Round.cs b/Projectiles/Ranged/P90Round.cs index 1fb3cf5ea8..0616130e94 100644 --- a/Projectiles/Ranged/P90Round.cs +++ b/Projectiles/Ranged/P90Round.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 600; Projectile.extraUpdates = 5; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.tileCollide = false; // Custom tile collision since the hitbox is large Projectile.ArmorPenetration = 30; } diff --git a/Projectiles/Ranged/PiercingBullet.cs b/Projectiles/Ranged/PiercingBullet.cs index 650721a4f8..e7cd9580f2 100644 --- a/Projectiles/Ranged/PiercingBullet.cs +++ b/Projectiles/Ranged/PiercingBullet.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Ranged AIType = ProjectileID.BulletHighVelocity; Projectile.penetrate = 1; Projectile.timeLeft = 600; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) diff --git a/Projectiles/Ranged/PlagueArrow.cs b/Projectiles/Ranged/PlagueArrow.cs index f6ee408e98..144d8c151b 100644 --- a/Projectiles/Ranged/PlagueArrow.cs +++ b/Projectiles/Ranged/PlagueArrow.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.aiStyle = ProjAIStyleID.Arrow; Projectile.timeLeft = 600; AIType = ProjectileID.WoodenArrowFriendly; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void OnKill(int timeLeft) diff --git a/Projectiles/Ranged/PlagueTaintedDrone.cs b/Projectiles/Ranged/PlagueTaintedDrone.cs index c364af3ef6..a77fbc4953 100644 --- a/Projectiles/Ranged/PlagueTaintedDrone.cs +++ b/Projectiles/Ranged/PlagueTaintedDrone.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Ranged public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - if (target.Calamity().pFlames > 0) + if (target.Calamity().plague) { if (Projectile.ai[1] == 1) return; diff --git a/Projectiles/Ranged/PlagueTaintedProjectile.cs b/Projectiles/Ranged/PlagueTaintedProjectile.cs index 1c24282b48..b1661d4d99 100644 --- a/Projectiles/Ranged/PlagueTaintedProjectile.cs +++ b/Projectiles/Ranged/PlagueTaintedProjectile.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 600; Projectile.extraUpdates = 2; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/PlanarRipperBolt.cs b/Projectiles/Ranged/PlanarRipperBolt.cs index 49223801bc..da0808050a 100644 --- a/Projectiles/Ranged/PlanarRipperBolt.cs +++ b/Projectiles/Ranged/PlanarRipperBolt.cs @@ -32,7 +32,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.aiStyle = ProjAIStyleID.Arrow; AIType = ProjectileID.BulletHighVelocity; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/PlasmaExplosion.cs b/Projectiles/Ranged/PlasmaExplosion.cs index 47b172c2d7..e09f8507ca 100644 --- a/Projectiles/Ranged/PlasmaExplosion.cs +++ b/Projectiles/Ranged/PlasmaExplosion.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = -1; Projectile.timeLeft = 5; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 1; + Projectile.localNPCHitCooldown = -1; } public override void AI() @@ -34,62 +34,14 @@ namespace CalamityMod.Projectiles.Ranged SoundEngine.PlaySound(SoundID.Item93, Projectile.position); Projectile.localAI[0] += 1f; } - bool xflag = false; - bool yflag = false; - if (Projectile.velocity.X < 0f && Projectile.position.X < Projectile.ai[0]) + + for (int i = 0; i < 20; i++) { - xflag = true; + Vector2 randDirection = new Vector2(Main.rand.NextFloat(-40f, 40f), Main.rand.NextFloat(-40f, 40f)); + randDirection = randDirection.SafeNormalize(Vector2.Zero) * Main.rand.NextFloat(12f, 35f); + Dust stardust = Dust.NewDustPerfect(Projectile.Center, Projectile.ai[1] == 1f ? 173 : 221, randDirection, 100, Scale: 2f); + stardust.noGravity = true; } - if (Projectile.velocity.X > 0f && Projectile.position.X > Projectile.ai[0]) - { - xflag = true; - } - if (Projectile.velocity.Y < 0f && Projectile.position.Y < Projectile.ai[1]) - { - yflag = true; - } - if (Projectile.velocity.Y > 0f && Projectile.position.Y > Projectile.ai[1]) - { - yflag = true; - } - if (xflag && yflag) - { - Projectile.Kill(); - } - float projTimer = 25f; - if (Projectile.ai[0] > 180f) - { - projTimer -= (Projectile.ai[0] - 180f) / 2f; - } - if (projTimer <= 0f) - { - projTimer = 0f; - Projectile.Kill(); - } - projTimer *= 0.7f; - Projectile.ai[0] += 4f; - int timerCounter = 0; - while ((float)timerCounter < projTimer) - { - float rand1 = (float)Main.rand.Next(-40, 41); - float rand2 = (float)Main.rand.Next(-40, 41); - float rand3 = (float)Main.rand.Next(12, 36); - float randAdjust = (float)Math.Sqrt((double)(rand1 * rand1 + rand2 * rand2)); - randAdjust = rand3 / randAdjust; - rand1 *= randAdjust; - rand2 *= randAdjust; - int dustID = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Projectile.ai[1] == 1f ? 173 : 221, 0f, 0f, 100, default, 2f); - Dust dust = Main.dust[dustID]; - dust.noGravity = true; - dust.position.X = Projectile.Center.X; - dust.position.Y = Projectile.Center.Y; - dust.position.X += (float)Main.rand.Next(-10, 11); - dust.position.Y += (float)Main.rand.Next(-10, 11); - dust.velocity.X = rand1; - dust.velocity.Y = rand2; - timerCounter++; - } - return; } } } diff --git a/Projectiles/Ranged/PumplerGrenade.cs b/Projectiles/Ranged/PumplerGrenade.cs index 04ff44cbea..422818de55 100644 --- a/Projectiles/Ranged/PumplerGrenade.cs +++ b/Projectiles/Ranged/PumplerGrenade.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = -1; Projectile.DamageType = DamageClass.Ranged; Projectile.ignoreWater = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 20; diff --git a/Projectiles/Ranged/RealmRavagerBullet.cs b/Projectiles/Ranged/RealmRavagerBullet.cs index 76570d8ccd..2b74fcb9f6 100644 --- a/Projectiles/Ranged/RealmRavagerBullet.cs +++ b/Projectiles/Ranged/RealmRavagerBullet.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 3; Projectile.penetrate = 1; Projectile.timeLeft = 90; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Ranged/SandblasterBullet.cs b/Projectiles/Ranged/SandblasterBullet.cs index 7bdf86ebc3..1291a1650f 100644 --- a/Projectiles/Ranged/SandblasterBullet.cs +++ b/Projectiles/Ranged/SandblasterBullet.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 1; Projectile.aiStyle = ProjAIStyleID.Arrow; Projectile.alpha = 255; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/SeaDragonMuzzleBlast.cs b/Projectiles/Ranged/SeaDragonMuzzleBlast.cs index 245b8e92fe..f6cee980a4 100644 --- a/Projectiles/Ranged/SeaDragonMuzzleBlast.cs +++ b/Projectiles/Ranged/SeaDragonMuzzleBlast.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.MaxUpdates = 4; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - // This projectile is already point blank. It cannot be boosted by point blank. } public override void AI() diff --git a/Projectiles/Ranged/SepticSkewerHarpoon.cs b/Projectiles/Ranged/SepticSkewerHarpoon.cs index b34f8aae17..67362e8980 100644 --- a/Projectiles/Ranged/SepticSkewerHarpoon.cs +++ b/Projectiles/Ranged/SepticSkewerHarpoon.cs @@ -74,7 +74,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.localNPCHitCooldown = -1; Projectile.extraUpdates = 1; Projectile.timeLeft = 900; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/Shell.cs b/Projectiles/Ranged/Shell.cs index df5f7620f1..a9f54ada25 100644 --- a/Projectiles/Ranged/Shell.cs +++ b/Projectiles/Ranged/Shell.cs @@ -19,7 +19,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.aiStyle = ProjAIStyleID.Arrow; Projectile.arrow = true; Projectile.timeLeft = 600; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 10; } diff --git a/Projectiles/Ranged/ShockblastRound.cs b/Projectiles/Ranged/ShockblastRound.cs index 8fafacd105..6e945c6f49 100644 --- a/Projectiles/Ranged/ShockblastRound.cs +++ b/Projectiles/Ranged/ShockblastRound.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.light = 0.5f; Projectile.extraUpdates = 3; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Ranged/SicknessRound.cs b/Projectiles/Ranged/SicknessRound.cs index b67f488a47..1d7e5cb26b 100644 --- a/Projectiles/Ranged/SicknessRound.cs +++ b/Projectiles/Ranged/SicknessRound.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.light = 0.25f; Projectile.extraUpdates = 4; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Ranged/SlagRound.cs b/Projectiles/Ranged/SlagRound.cs index bc9098440e..b54b01b1a6 100644 --- a/Projectiles/Ranged/SlagRound.cs +++ b/Projectiles/Ranged/SlagRound.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.aiStyle = ProjAIStyleID.Arrow; Projectile.extraUpdates = 3; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/SpeedBlasterShot.cs b/Projectiles/Ranged/SpeedBlasterShot.cs index 25f6e366d2..5a942152a9 100644 --- a/Projectiles/Ranged/SpeedBlasterShot.cs +++ b/Projectiles/Ranged/SpeedBlasterShot.cs @@ -37,7 +37,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.MaxUpdates = 2; Projectile.timeLeft = 150 * Projectile.MaxUpdates; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; } diff --git a/Projectiles/Ranged/SproutingArrowMain.cs b/Projectiles/Ranged/SproutingArrowMain.cs index 38971fbaa1..af42a4fbfc 100644 --- a/Projectiles/Ranged/SproutingArrowMain.cs +++ b/Projectiles/Ranged/SproutingArrowMain.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 80; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.ArmorPenetration = 8; Projectile.tileCollide = false; } diff --git a/Projectiles/Ranged/StarfleetMK2Gun.cs b/Projectiles/Ranged/StarfleetMK2Gun.cs deleted file mode 100644 index 304bdf7b2b..0000000000 --- a/Projectiles/Ranged/StarfleetMK2Gun.cs +++ /dev/null @@ -1,140 +0,0 @@ -using System; -using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Projectiles.Melee; -using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.Localization; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Ranged -{ - public class StarfleetMK2Gun : ModProjectile - { - public override LocalizedText DisplayName => CalamityUtils.GetItemName(); - public override string Texture => "CalamityMod/Items/Weapons/Ranged/Starmada"; - - public override void SetDefaults() - { - Projectile.width = 122; - Projectile.height = 50; - Projectile.friendly = true; - Projectile.penetrate = -1; - Projectile.tileCollide = false; - Projectile.DamageType = DamageClass.Ranged; - Projectile.ignoreWater = true; - } - - public override void AI() - { - Lighting.AddLight(Projectile.Center, 32f / 255f, 208f / 255f, 255f / 255f); - Player player = Main.player[Projectile.owner]; - Projectile.ai[1]--; - if (Projectile.ai[0] >= 0f) - { - Projectile.ai[0] += 1f; - switch ((int)Projectile.ai[0]) - { - case 90: - case 180: - case 270: - case 360: - case 450: - Projectile.localAI[0] += 1f; - break; - case 540: - Projectile.localAI[0] += 1f; - Projectile.ai[0] = -1f; - SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - int dustAmt = 36; - for (int d = 0; d < dustAmt; d++) - { - Vector2 source = Vector2.Normalize(Projectile.velocity) * 9f; - source = source.RotatedBy((d - (dustAmt / 2 - 1)) * MathHelper.TwoPi / dustAmt, default) + player.Center; - Vector2 dustVel = source - player.Center; - int index = Dust.NewDust(source + dustVel, 0, 0, DustID.FireworkFountain_Blue, 0f, 0f, 0, default, 4f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity = dustVel; - } - break; - } - } - int baseUseTime = 27; //Ranges from 27 to 15 use time - int modifier = 2; - bool timeToFire = false; - if (Projectile.ai[1] <= 0f) - { - Projectile.ai[1] = baseUseTime - modifier * Projectile.localAI[0]; - timeToFire = true; - } - bool canFire = !player.CantUseHoldout() && player.HasAmmo(player.ActiveItem()); - if (Projectile.soundDelay <= 0 && canFire) - { - Projectile.soundDelay = baseUseTime - modifier * (int)Projectile.localAI[0]; - if (Projectile.ai[0] != 1f) - SoundEngine.PlaySound(SoundID.Item92, Projectile.Center); - } - if (timeToFire && Main.myPlayer == Projectile.owner) - { - if (canFire) - { - int type = ProjectileID.StarCannonStar; - float shootSpeed = 16f; - int damage = player.GetWeaponDamage(player.ActiveItem()); - float knockBack = player.ActiveItem().knockBack; - player.PickAmmo(player.ActiveItem(), out type, out shootSpeed, out damage, out knockBack, out _); - for (int i = 0; i < 5; i++) - { - knockBack = player.GetWeaponKnockback(player.ActiveItem(), knockBack); - Vector2 playerPosition = player.RotatedRelativePoint(player.MountedCenter, true); - Projectile.velocity = Main.screenPosition - playerPosition; - Projectile.velocity.X += Main.mouseX; - Projectile.velocity.Y += Main.mouseY; - if (player.gravDir == -1f) - Projectile.velocity.Y = Main.screenHeight - Main.mouseY + Main.screenPosition.Y - playerPosition.Y; - Projectile.velocity.Normalize(); - float variation = (1f + Projectile.localAI[0]) * 3f; - Vector2 position = playerPosition + Utils.RandomVector2(Main.rand, -variation, variation); - Vector2 speed = Projectile.velocity * shootSpeed * Main.rand.NextFloat(0.6f, 1.2f); - type = Utils.SelectRandom(Main.rand, new int[] - { - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ProjectileID.StarCannonStar, - ProjectileID.Starfury - }); - int star = Projectile.NewProjectile(Projectile.GetSource_FromThis(), position, speed, type, damage, knockBack, Projectile.owner); - if (star.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[star].penetrate = 1; - Main.projectile[star].timeLeft = 300; - Main.projectile[star].DamageType = DamageClass.Ranged; - Main.projectile[star].netUpdate = true; - } - Projectile.netUpdate = true; - } - } - else - { - Projectile.Kill(); - } - } - Projectile.rotation = Projectile.velocity.ToRotation(); - Vector2 displayOffset = new Vector2(27f, -10f * Projectile.direction).RotatedBy(Projectile.rotation); - Projectile.Center = player.RotatedRelativePoint(player.MountedCenter, true) + displayOffset; - if (Projectile.spriteDirection == -1) - Projectile.rotation += MathHelper.Pi; - Projectile.spriteDirection = Projectile.direction; - Projectile.timeLeft = 2; - player.ChangeDir(Projectile.direction); - player.heldProj = Projectile.whoAmI; - player.itemTime = 2; - player.itemAnimation = 2; - player.itemRotation = (float)Math.Atan2(Projectile.velocity.Y * Projectile.direction, Projectile.velocity.X * Projectile.direction); - } - - public override bool? CanDamage() => false; - } -} diff --git a/Projectiles/Ranged/StarmageddonStar.cs b/Projectiles/Ranged/StarmageddonStar.cs index 1f37ecea6d..207cf9d1f4 100644 --- a/Projectiles/Ranged/StarmageddonStar.cs +++ b/Projectiles/Ranged/StarmageddonStar.cs @@ -134,21 +134,31 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[starDust].velocity = Vector2.Normalize(position - speed * 3f - Main.dust[starDust].position) * 1.25f; } - int type = Utils.SelectRandom(Main.rand, new int[] - { + int type = Utils.SelectRandom(Main.rand, + [ ModContent.ProjectileType(), ModContent.ProjectileType(), ProjectileID.StarCannonStar, ProjectileID.Starfury - }); + ]); - int star = Projectile.NewProjectile(Projectile.GetSource_FromThis(), position, speed, type, Projectile.damage / 2, Projectile.knockBack * 0.5f, Projectile.owner); + Projectile starCenter = Projectile; + foreach (Projectile p in Main.ActiveProjectiles) + { + if (p.type == ModContent.ProjectileType() && p.owner == Projectile.owner) + { + starCenter = p; + break; + } + } + Vector2 predictSpeed = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(position, Main.npc[(int)starCenter.ai[2]], 12f, 5); + int star = Projectile.NewProjectile(Projectile.GetSource_FromThis(), position, predictSpeed, type, Projectile.damage / 2, Projectile.knockBack * 0.5f, Projectile.owner); if (star.WithinBounds(Main.maxProjectiles)) { if (type == ModContent.ProjectileType() || type == ModContent.ProjectileType()) Main.projectile[star].ai[0] = 1f; - Main.projectile[star].extraUpdates += 4; + Main.projectile[star].extraUpdates = 4; Main.projectile[star].penetrate = 1; Main.projectile[star].timeLeft = 300; Main.projectile[star].DamageType = DamageClass.Ranged; diff --git a/Projectiles/Ranged/StarmageddonStar2.cs b/Projectiles/Ranged/StarmageddonStar2.cs index 99b8d1a175..be24aa193a 100644 --- a/Projectiles/Ranged/StarmageddonStar2.cs +++ b/Projectiles/Ranged/StarmageddonStar2.cs @@ -134,21 +134,31 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[starDust].velocity = Vector2.Normalize(position - speed * 3f - Main.dust[starDust].position) * 1.25f; } - int type = Utils.SelectRandom(Main.rand, new int[] - { + int type = Utils.SelectRandom(Main.rand, + [ ModContent.ProjectileType(), ModContent.ProjectileType(), ProjectileID.StarCannonStar, ProjectileID.Starfury - }); + ]); - int star = Projectile.NewProjectile(Projectile.GetSource_FromThis(), position, speed, type, Projectile.damage / 2, Projectile.knockBack * 0.5f, Projectile.owner); + Projectile starCenter = Projectile; + foreach (Projectile p in Main.ActiveProjectiles) + { + if (p.type == ModContent.ProjectileType() && p.owner == Projectile.owner) + { + starCenter = p; + break; + } + } + Vector2 predictSpeed = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(position, Main.npc[(int)starCenter.ai[2]], 12f, 5); + int star = Projectile.NewProjectile(Projectile.GetSource_FromThis(), position, predictSpeed, type, Projectile.damage / 2, Projectile.knockBack * 0.5f, Projectile.owner); if (star.WithinBounds(Main.maxProjectiles)) { if (type == ModContent.ProjectileType() || type == ModContent.ProjectileType()) Main.projectile[star].ai[0] = 1f; - Main.projectile[star].extraUpdates += 4; + Main.projectile[star].extraUpdates = 4; Main.projectile[star].penetrate = 1; Main.projectile[star].timeLeft = 300; Main.projectile[star].DamageType = DamageClass.Ranged; diff --git a/Projectiles/Ranged/SuperradiantSaw.cs b/Projectiles/Ranged/SuperradiantSaw.cs index 5515cfb2db..6099118d71 100644 --- a/Projectiles/Ranged/SuperradiantSaw.cs +++ b/Projectiles/Ranged/SuperradiantSaw.cs @@ -56,7 +56,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = -1; // Saws only pierce a certain number of times before returning, and don't deal direct damage while returning Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/SuperradiantSawLingering.cs b/Projectiles/Ranged/SuperradiantSawLingering.cs index 2397d1ca85..3b2f14b333 100644 --- a/Projectiles/Ranged/SuperradiantSawLingering.cs +++ b/Projectiles/Ranged/SuperradiantSawLingering.cs @@ -40,7 +40,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.tileCollide = false; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/TelluricGlareArrow.cs b/Projectiles/Ranged/TelluricGlareArrow.cs index d970edad12..ad3d462b5e 100644 --- a/Projectiles/Ranged/TelluricGlareArrow.cs +++ b/Projectiles/Ranged/TelluricGlareArrow.cs @@ -43,7 +43,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = -1; // Can hit many enemies. Will explode extremely soon after hitting the first, though. Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool? CanDamage() => (Projectile.timeLeft < Lifetime - 4) ? null : false; diff --git a/Projectiles/Ranged/TheMaelstromShark.cs b/Projectiles/Ranged/TheMaelstromShark.cs index a9a4037ffe..5d9614fdd9 100644 --- a/Projectiles/Ranged/TheMaelstromShark.cs +++ b/Projectiles/Ranged/TheMaelstromShark.cs @@ -31,7 +31,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 1; Projectile.Opacity = 0f; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/TorrentialArrow.cs b/Projectiles/Ranged/TorrentialArrow.cs index 885533921d..648535d215 100644 --- a/Projectiles/Ranged/TorrentialArrow.cs +++ b/Projectiles/Ranged/TorrentialArrow.cs @@ -21,7 +21,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; Projectile.arrow = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ToxicArrow.cs b/Projectiles/Ranged/ToxicArrow.cs index e010f3eb95..42160ce9af 100644 --- a/Projectiles/Ranged/ToxicArrow.cs +++ b/Projectiles/Ranged/ToxicArrow.cs @@ -19,7 +19,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.arrow = true; Projectile.penetrate = 1; Projectile.timeLeft = 240; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/TyphoonArrow.cs b/Projectiles/Ranged/TyphoonArrow.cs index 0c15bffcfa..03721e4fec 100644 --- a/Projectiles/Ranged/TyphoonArrow.cs +++ b/Projectiles/Ranged/TyphoonArrow.cs @@ -17,7 +17,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.aiStyle = ProjAIStyleID.Arrow; Projectile.timeLeft = 600; AIType = ProjectileID.WoodenArrowFriendly; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void OnKill(int timeLeft) diff --git a/Projectiles/Ranged/UltimaBolt.cs b/Projectiles/Ranged/UltimaBolt.cs index 2c321b7ad7..20dde73355 100644 --- a/Projectiles/Ranged/UltimaBolt.cs +++ b/Projectiles/Ranged/UltimaBolt.cs @@ -31,7 +31,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.arrow = true; Projectile.penetrate = 1; Projectile.timeLeft = 300; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/UniversalGenesisStar.cs b/Projectiles/Ranged/UniversalGenesisStar.cs index 9eabd1a422..decaa24f1d 100644 --- a/Projectiles/Ranged/UniversalGenesisStar.cs +++ b/Projectiles/Ranged/UniversalGenesisStar.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 180; Projectile.extraUpdates = 1; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; + Projectile.localNPCHitCooldown = -1; } public override void AI() diff --git a/Projectiles/Ranged/UniversalGenesisStarcaller.cs b/Projectiles/Ranged/UniversalGenesisStarcaller.cs index fc22e9fde8..a2f2483888 100644 --- a/Projectiles/Ranged/UniversalGenesisStarcaller.cs +++ b/Projectiles/Ranged/UniversalGenesisStarcaller.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 600; Projectile.extraUpdates = 1; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() @@ -77,15 +76,11 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - SpawnStars(); - } - - private void SpawnStars() - { - // The patron said 10 blocks, but 10 blocks is like nothing... I'm sure they won't mind. + // The patron said 10 blocks, but 10 blocks is like nothing... I'm sure they won't mind int maxDistance = 480; // 30 blocks bool bossFound = false; int life = 0; + int index = -1; Vector2 targetVec = Projectile.Center; foreach (NPC npc in Main.ActiveNPCs) { @@ -94,7 +89,7 @@ namespace CalamityMod.Projectiles.Ranged if (npc.CanBeChasedBy(Projectile, false)) { float extraDist = (npc.width / 2) + (npc.height / 2); - //Calculate distance between target and the projectile to know if it's too far or not + // Calculate distance between target and the projectile to know if it's too far or not float targetDist = Vector2.Distance(npc.Center, Projectile.Center); if (targetDist < (maxDistance + extraDist) && (npc.IsABoss() || npc.life > life)) { @@ -102,16 +97,15 @@ namespace CalamityMod.Projectiles.Ranged bossFound = true; life = npc.life; targetVec = npc.Center; + index = npc.whoAmI; } } } - var source = Projectile.GetSource_FromThis(); - for (int n = 0; n < 2; n++) - { - Projectile star = CalamityUtils.ProjectileRain(source, targetVec, 400f, 100f, 500f, 800f, 29f, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner); - star.ai[0] = n; - } + Vector2 spawnPos = targetVec - new Vector2(Main.rand.NextFloat(-300f, 300f), Main.rand.NextFloat(500f, 800f)); + Vector2 velocity = index == -1 ? Utils.DirectionTo(spawnPos, Projectile.Center) * 29f : CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(spawnPos, Main.npc[index], 29f, 2); + velocity.X += Main.rand.NextFloat(-1f, 1f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.65f), Projectile.knockBack, Projectile.owner); } public override void OnKill(int timeLeft) diff --git a/Projectiles/Ranged/VanquisherArrowProj.cs b/Projectiles/Ranged/VanquisherArrowProj.cs index 4d5556908d..31f5215ec9 100644 --- a/Projectiles/Ranged/VanquisherArrowProj.cs +++ b/Projectiles/Ranged/VanquisherArrowProj.cs @@ -46,7 +46,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 2; Projectile.timeLeft = 600; Projectile.extraUpdates = 7; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 15 * Projectile.extraUpdates; } @@ -119,9 +118,9 @@ namespace CalamityMod.Projectiles.Ranged } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - // First hit is 30% damage + // First hit is 40% damage // Second hit is 100% base damage, it is the "Slash Hit" - modifiers.SourceDamage *= (Projectile.numHits == 0 ? 0.3f : 1f); + modifiers.SourceDamage *= (Projectile.numHits == 0 ? 0.4f : 1f); if (Projectile.damage < 1) Projectile.damage = 1; } diff --git a/Projectiles/Ranged/VeriumBoltProj.cs b/Projectiles/Ranged/VeriumBoltProj.cs index 3c62464ca2..8e2d75014e 100644 --- a/Projectiles/Ranged/VeriumBoltProj.cs +++ b/Projectiles/Ranged/VeriumBoltProj.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 600; Projectile.extraUpdates = 1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Ranged/VernalBolt.cs b/Projectiles/Ranged/VernalBolt.cs index f548e85826..2cd58bc842 100644 --- a/Projectiles/Ranged/VernalBolt.cs +++ b/Projectiles/Ranged/VernalBolt.cs @@ -20,7 +20,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.extraUpdates = 1; Projectile.timeLeft = 180; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/VoidragonTentacle.cs b/Projectiles/Ranged/VoidragonTentacle.cs index cf7887c1db..5b41a1d3d8 100644 --- a/Projectiles/Ranged/VoidragonTentacle.cs +++ b/Projectiles/Ranged/VoidragonTentacle.cs @@ -24,7 +24,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.MaxUpdates = 3; Projectile.DamageType = DamageClass.Ranged; Projectile.extraUpdates = 1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Rogue/AuroradicalStar.cs b/Projectiles/Rogue/AuroradicalStar.cs index 3bded3c1c6..636d1ed595 100644 --- a/Projectiles/Rogue/AuroradicalStar.cs +++ b/Projectiles/Rogue/AuroradicalStar.cs @@ -125,10 +125,7 @@ namespace CalamityMod.Projectiles.Rogue Vector2 meteorVel = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(pos, target, 20f, 3); int comet = Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, meteorVel, ModContent.ProjectileType(), (int)(Projectile.damage * 1.25f), Projectile.knockBack, Projectile.owner); if (comet.WithinBounds(Main.maxProjectiles)) - { Main.projectile[comet].DamageType = RogueDamageClass.Instance; - Main.projectile[comet].Calamity().lineColor = Main.rand.Next(3); - } } } diff --git a/Projectiles/Rogue/CircletMark.cs b/Projectiles/Rogue/CircletMark.cs deleted file mode 100644 index 1222796e47..0000000000 --- a/Projectiles/Rogue/CircletMark.cs +++ /dev/null @@ -1,159 +0,0 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Rogue -{ - public class CircletMark : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Rogue"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetDefaults() - { - Projectile.width = 14; - Projectile.height = 14; - Projectile.friendly = true; - Projectile.tileCollide = false; - Projectile.timeLeft = 900; - Projectile.ignoreWater = true; - Projectile.alpha = 255; - Projectile.DamageType = RogueDamageClass.Instance; - Projectile.penetrate = -1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - } - - public override void AI() - { - Color newColor3 = new Color(255, 255, 255); - if (Projectile.soundDelay == 0) - { - Projectile.soundDelay = -1; - SoundEngine.PlaySound(SoundID.Item60, Projectile.Center); - } - if (Projectile.localAI[1] < 30f) - { - for (int i = 0; i < 1; i++) - { - float lerpvalue1 = -0.5f; - float lerpvalue2 = 0.9f; - float randomLerp = Main.rand.NextFloat(); - Vector2 dustMovement = new Vector2(MathHelper.Lerp(0.1f, 1f, Main.rand.NextFloat()), MathHelper.Lerp(lerpvalue1, lerpvalue2, randomLerp)); - dustMovement.X *= MathHelper.Lerp(2.2f, 0.6f, randomLerp); - dustMovement.X *= -1f; - Vector2 dustMovement2 = new Vector2(2f, 10f); - Vector2 position4 = Projectile.Center + new Vector2(60f, 200f) * dustMovement * 0.5f + dustMovement2; - Dust dust = Main.dust[Dust.NewDust(position4, 0, 0, DustID.Sandnado, 0f, 0f, 0, default, 0.5f)]; - dust.position = position4; - dust.customData = Projectile.Center + dustMovement2; - dust.fadeIn = 1f; - dust.scale = 0.3f; - if (dustMovement.X > -1.2f) - { - dust.velocity.X = 1f + Main.rand.NextFloat(); - } - dust.velocity.Y = Main.rand.NextFloat() * -0.5f - 1f; - } - } - if (Projectile.localAI[0] == 0f) - { - Projectile.localAI[0] = 0.8f; - Projectile.direction = 1; - Point projCenter = Projectile.Center.ToTileCoordinates(); - Projectile.Center = new Vector2((float)(projCenter.X * 16 + 8), (float)(projCenter.Y * 16 + 8)); - } - Projectile.rotation = Projectile.localAI[1] / 40f * 6.28318548f * (float)Projectile.direction; - if (Projectile.localAI[1] < 33f) - { - if (Projectile.alpha > 0) - { - Projectile.alpha -= 8; - } - if (Projectile.alpha < 0) - { - Projectile.alpha = 0; - } - } - if (Projectile.localAI[1] > 103f) - { - if (Projectile.alpha < 255) - { - Projectile.alpha += 16; - } - if (Projectile.alpha > 255) - { - Projectile.alpha = 255; - } - } - if (Projectile.alpha == 0) - { - Lighting.AddLight(Projectile.Center, newColor3.ToVector3() * 0.5f); - } - for (int j = 0; j < 2; j++) - { - if (Main.rand.NextBool(10)) - { - Vector2 dustVel = Vector2.UnitY.RotatedBy((double)((float)j * 3.14159274f), default).RotatedBy((double)Projectile.rotation, default); - Dust dusty = Main.dust[Dust.NewDust(Projectile.Center, 0, 0, DustID.Sandnado, 0f, 0f, 225, newColor3, 1f)]; - dusty.noGravity = true; - dusty.noLight = true; - dusty.scale = Projectile.Opacity * Projectile.localAI[0]; - dusty.position = Projectile.Center; - dusty.velocity = dustVel * 2.5f; - } - } - for (int k = 0; k < 2; k++) - { - if (Main.rand.NextBool(10)) - { - Vector2 dustVel2 = Vector2.UnitY.RotatedBy((double)((float)k * 3.14159274f), default); - Dust dustier = Main.dust[Dust.NewDust(Projectile.Center, 0, 0, DustID.Sandnado, 0f, 0f, 225, newColor3, 1.5f)]; - dustier.noGravity = true; - dustier.noLight = true; - dustier.scale = Projectile.Opacity * Projectile.localAI[0]; - dustier.position = Projectile.Center; - dustier.velocity = dustVel2 * 2.5f; - } - } - if (Projectile.localAI[1] < 33f || Projectile.localAI[1] > 87f) - { - Projectile.scale = Projectile.Opacity / 2f * Projectile.localAI[0]; - } - Projectile.velocity = Vector2.Zero; - Projectile.localAI[1] += 1f; - if (Projectile.localAI[1] == 60f && Projectile.owner == Main.myPlayer) - { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, 2f, Projectile.owner, 0f, 0f); - } - if (Projectile.localAI[1] >= 120f) - { - Projectile.Kill(); - return; - } - } - - public override bool PreDraw(ref Color lightColor) - { - Color originalColor = Lighting.GetColor((int)((double)Projectile.position.X + (double)Projectile.width * 0.5) / 16, (int)(((double)Projectile.position.Y + (double)Projectile.height * 0.5) / 16.0)); - SpriteEffects spriteEffects = SpriteEffects.None; - if (Projectile.spriteDirection == -1) - { - spriteEffects = SpriteEffects.FlipHorizontally; - } - Vector2 drawPos = Projectile.position + new Vector2((float)Projectile.width, (float)Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; - Texture2D texture2D27 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Rectangle rectangle = texture2D27.Frame(1, Main.projFrames[Type], 0, Projectile.frame); - Color alphaColor = Projectile.GetAlpha(originalColor); - Vector2 origin7 = rectangle.Size() / 2f; - Color sandyColor = Main.hslToRgb(0.25f, 1f, 1f).MultiplyRGBA(new Color(255, 255, 255, 0)); - Main.spriteBatch.Draw(texture2D27, drawPos, new Microsoft.Xna.Framework.Rectangle?(rectangle), sandyColor, 0f, origin7, new Vector2(1f, 5f) * Projectile.scale * 2f, spriteEffects, 0); - Main.spriteBatch.Draw(texture2D27, drawPos, new Microsoft.Xna.Framework.Rectangle?(rectangle), alphaColor, Projectile.rotation, origin7, Projectile.scale, spriteEffects, 0); - Main.spriteBatch.Draw(texture2D27, drawPos, new Microsoft.Xna.Framework.Rectangle?(rectangle), alphaColor, 0f, origin7, new Vector2(1f, 8f) * Projectile.scale, spriteEffects, 0); - return false; - } - } -} diff --git a/Projectiles/Rogue/CircletTornado.cs b/Projectiles/Rogue/CircletTornado.cs index 8ea5f2ff63..4ac2eb94bf 100644 --- a/Projectiles/Rogue/CircletTornado.cs +++ b/Projectiles/Rogue/CircletTornado.cs @@ -12,165 +12,121 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Projectiles/TornadoProj"; + public static float Lifetime = 900f; + public static float Fadetime = 120f; + + public ref float Time => ref Projectile.ai[0]; + public override void SetDefaults() { - Projectile.width = 10; - Projectile.height = 10; + Projectile.width = Projectile.height = 10; Projectile.friendly = true; Projectile.tileCollide = false; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.minion = true; Projectile.penetrate = -1; - Projectile.timeLeft = 1200; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 30; } public override void AI() { - //only 1 tornado can exist at a time - Projectile.localAI[1] += 1f; - if (Projectile.localAI[1] >= 10f) - { - Projectile.localAI[1] = 0f; - int projCount = 0; - int oldestTornado = 0; - float tornadoAge = 0f; - int projType = Projectile.type; - for (int projIndex = 0; projIndex < Main.maxProjectiles; projIndex++) - { - Projectile proj = Main.projectile[projIndex]; - if (proj.active && proj.owner == Projectile.owner && proj.type == projType && proj.ai[0] < 900f) - { - projCount++; - if (proj.ai[0] > tornadoAge) - { - oldestTornado = projIndex; - tornadoAge = proj.ai[0]; - } - } - } - if (projCount > 1) - { - Main.projectile[oldestTornado].netUpdate = true; - Main.projectile[oldestTornado].ai[0] = 36000f; - return; - } - } - - float lifeSpan = 900f; if (Projectile.soundDelay == 0) { Projectile.soundDelay = -1; - SoundEngine.PlaySound(SoundID.Item122, Projectile.Center); + SoundEngine.PlaySound(SoundID.Item82, Projectile.Center); } - Projectile.ai[0] += 1f; - if (Projectile.ai[0] >= lifeSpan) - { + + Time++; + if (Time >= Lifetime) Projectile.Kill(); - } - if (Projectile.localAI[0] >= 30f) + if (Projectile.numHits >= 30) { Projectile.damage = 0; - if (Projectile.ai[0] < lifeSpan - 120f) + if (Time < Lifetime - Fadetime) { - float aiDecrement = Projectile.ai[0] % 60f; - Projectile.ai[0] = lifeSpan - 120f + aiDecrement; + Time = Lifetime - Fadetime + Time % 60f; Projectile.netUpdate = true; } } - Point point8 = Projectile.Center.ToTileCoordinates(); - int sizeMod; - int sizeMod2; - Collision.ExpandVertically(point8.X, point8.Y, out sizeMod, out sizeMod2, 15, 15); - sizeMod++; - sizeMod2--; - Vector2 sizeModVector = new Vector2((float)point8.X, (float)sizeMod) * 16f + new Vector2(8f); - Vector2 sizeModVector2 = new Vector2((float)point8.X, (float)sizeMod2) * 16f + new Vector2(8f); - Vector2 centering = Vector2.Lerp(sizeModVector, sizeModVector2, 0.5f); - Vector2 sizeModPos = new Vector2(0f, sizeModVector2.Y - sizeModVector.Y); - sizeModPos.X = sizeModPos.Y * 0.2f; - Projectile.width = (int)(sizeModPos.X * 0.65f); - Projectile.height = (int)sizeModPos.Y; - Projectile.Center = centering; + + GetVerticallyExpandedPos(out Vector2 newTop, out Vector2 newBottom, out Vector2 newCenter, out Vector2 newSize); + Projectile.width = (int)(newSize.X * 0.65f); + Projectile.height = (int)newSize.Y; + Projectile.Center = newCenter; if (Projectile.owner == Main.myPlayer) { bool breakFlag = false; Vector2 playerCenter = Main.player[Projectile.owner].Center; - Vector2 top = Main.player[Projectile.owner].Top; + Vector2 playerTop = Main.player[Projectile.owner].Top; for (float i = 0f; i < 1f; i += 0.05f) { - Vector2 position2 = Vector2.Lerp(sizeModVector, sizeModVector2, i); - if (Collision.CanHitLine(position2, 0, 0, playerCenter, 0, 0) || Collision.CanHitLine(position2, 0, 0, top, 0, 0)) + Vector2 collisionPos = Vector2.Lerp(newTop, newBottom, i); + if (Collision.CanHitLine(collisionPos, 0, 0, playerCenter, 0, 0) || Collision.CanHitLine(collisionPos, 0, 0, playerTop, 0, 0)) { breakFlag = true; break; } } - if (!breakFlag && Projectile.ai[0] < lifeSpan - 120f) + if (!breakFlag && Time < Lifetime - Fadetime) { - float aiDecrement2 = Projectile.ai[0] % 60f; - Projectile.ai[0] = lifeSpan - 120f + aiDecrement2; + Time = Lifetime - Fadetime + Time % 60f; Projectile.netUpdate = true; } } - if (Projectile.ai[0] < lifeSpan - 120f) + if (Time < Lifetime - Fadetime) { - return; + float randFactor = Main.rand.NextFloat(); + Vector2 randomOffset = new Vector2(MathHelper.Lerp(0.1f, 1f, Main.rand.NextFloat()) * MathHelper.Lerp(-2.2f, -0.6f, randFactor), MathHelper.Lerp(-0.5f, 0.9f, randFactor)); + Vector2 fixedOffset = new Vector2(6f, 10f); + Vector2 dustPos = newCenter + newSize * randomOffset * 0.5f + fixedOffset; + Dust sand = Dust.NewDustDirect(dustPos, 0, 0, DustID.Sandnado); + sand.position = dustPos; + sand.customData = newCenter + fixedOffset; + sand.fadeIn = 1f; + sand.scale = 0.3f; + if (randomOffset.X > -1.2f) + sand.velocity.X = 1f + Main.rand.NextFloat(); + sand.velocity.Y = Main.rand.NextFloat() * -0.5f - 1f; } } public override bool PreDraw(ref Color lightColor) { - float aiTracker = Projectile.ai[0]; - float trackerClamp = MathHelper.Clamp(aiTracker / 30f, 0f, 1f); - if (aiTracker > 540f) - { - trackerClamp = MathHelper.Lerp(1f, 0f, (aiTracker - 540f) / 60f); - } - Point centerPoint = Projectile.Center.ToTileCoordinates(); - int sizeModding; - int sizeModding2; - Collision.ExpandVertically(centerPoint.X, centerPoint.Y, out sizeModding, out sizeModding2, 15, 15); - sizeModding++; - sizeModding2--; - float vectorMult = 0.2f; - Vector2 sizeModdingVector = new Vector2((float)centerPoint.X, (float)sizeModding) * 16f + new Vector2(8f); - Vector2 sizeModdingVector2 = new Vector2((float)centerPoint.X, (float)sizeModding2) * 16f + new Vector2(8f); - Vector2.Lerp(sizeModdingVector, sizeModdingVector2, 0.5f); - Vector2 sizeModdingPos = new Vector2(0f, sizeModdingVector2.Y - sizeModdingVector.Y); - sizeModdingPos.X = sizeModdingPos.Y * vectorMult; - new Vector2(sizeModdingVector.X - sizeModdingPos.X / 2f, sizeModdingVector.Y); - Texture2D texture2D23 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Rectangle drawRectangle = texture2D23.Frame(1, 1, 0, 0); - Vector2 smallRect = drawRectangle.Size() / 2f; - float aiTrackMult = -0.06283186f * aiTracker; - Vector2 spinningpoint = Vector2.UnitY.RotatedBy((double)(aiTracker * 0.1f), default); + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + GetVerticallyExpandedPos(out Vector2 newTop, out Vector2 newBottom, out Vector2 newCenter, out Vector2 newSize); + + float TextureFadetime = Lifetime - 60f; + Color fullColor = new Color(212, 192, 100); + float colorMult = (Time > TextureFadetime ? MathHelper.Lerp(1f, 0f, (Time - TextureFadetime) / 60f) : MathHelper.Clamp(Time / 30f, 0f, 1f)); + float timedRotation = Time * MathHelper.Pi * -0.02f; + float incrementStorage = 0f; float increment = 5.1f; - Color sandYellow = new Color(225, 225, 100); - for (float k = (float)(int)sizeModdingVector2.Y; k > (float)(int)sizeModdingVector.Y; k -= increment) + for (float k = newBottom.Y; k > newTop.Y; k -= increment) { incrementStorage += increment; - float colorChanger = incrementStorage / sizeModdingPos.Y; - float incStorageMult = incrementStorage * 6.28318548f / -20f; - float lowerColorChanger = colorChanger - 0.15f; - Vector2 spinArea = spinningpoint.RotatedBy((double)incStorageMult, default); - Vector2 colorChangeVector = new Vector2(0f, colorChanger + 1f); - colorChangeVector.X = colorChangeVector.Y * vectorMult; - Color newSandYellow = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, sandYellow, colorChanger * 2f); - if (colorChanger > 0.5f) - { - newSandYellow = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, sandYellow, 2f - colorChanger * 2f); - } - newSandYellow.A = (byte)((float)newSandYellow.A * 0.5f); - newSandYellow *= trackerClamp; - spinArea *= colorChangeVector * 100f; - spinArea.Y = 0f; - spinArea.X = 0f; - spinArea += new Vector2(sizeModdingVector2.X, k) - Main.screenPosition; - Main.spriteBatch.Draw(texture2D23, spinArea, new Microsoft.Xna.Framework.Rectangle?(drawRectangle), newSandYellow, aiTrackMult + incStorageMult, smallRect, 1f + lowerColorChanger, SpriteEffects.None, 0); + float segmentHeight = incrementStorage / newSize.Y; + float addedRotation = incrementStorage * MathHelper.Pi * -0.1f; + float addedScale = segmentHeight - 0.15f; + Color drawColor = Color.Lerp(Color.Transparent, fullColor, (segmentHeight > 0.5f ? 2f - segmentHeight * 2f : segmentHeight * 2f)); + drawColor.A = (byte)((float)drawColor.A * 0.5f); + + Vector2 drawPos = new Vector2(newBottom.X, k) - Main.screenPosition; + Main.spriteBatch.Draw(tex, drawPos, null, drawColor * colorMult, timedRotation + addedRotation, tex.Size() * 0.5f, 1f + addedScale, SpriteEffects.None, 0); } return false; } + + public void GetVerticallyExpandedPos(out Vector2 newTop, out Vector2 newBottom, out Vector2 newCenter, out Vector2 newSize) + { + Point center = Projectile.Center.ToTileCoordinates(); + Collision.ExpandVertically(center.X, center.Y, out int topY, out int bottomY, 15, 15); + newTop = new Vector2(center.X, topY + 1) * 16f + new Vector2(8f); + newBottom = new Vector2(center.X, bottomY - 1) * 16f + new Vector2(8f); + newCenter = Vector2.Lerp(newTop, newBottom, 0.5f); + newSize = new Vector2(0f, newBottom.Y - newTop.Y); + newSize.X = newSize.Y * 0.2f; + } } } diff --git a/Projectiles/Rogue/EclipsesFallMain.cs b/Projectiles/Rogue/EclipsesFallMain.cs index 3448ed80af..acae2f710c 100644 --- a/Projectiles/Rogue/EclipsesFallMain.cs +++ b/Projectiles/Rogue/EclipsesFallMain.cs @@ -49,18 +49,17 @@ namespace CalamityMod.Projectiles.Rogue } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => SpawnSpears(target.Center); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => SpawnSpears(target); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => SpawnSpears(target); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => SpawnSpears(target.Center); - - private void SpawnSpears(Vector2 targetPos) + private void SpawnSpears(Entity target) { int spearAmt = Main.rand.Next(3, 4 + 1); // 3 or 4 spears - var source = Projectile.GetSource_FromThis(); for (int n = 0; n < spearAmt; n++) { - ; - CalamityUtils.ProjectileRain(source, targetPos, 400f, 100f, 500f, 800f, 29f, ModContent.ProjectileType(), (int)(Projectile.damage * RainDamageMult), Projectile.knockBack * RainDamageMult, Projectile.owner); + Vector2 spawnPos = target.Center - new Vector2(Main.rand.NextFloat(-100f, 100f), Main.rand.NextFloat(500f, 800f)); + Vector2 spearVel = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(spawnPos, target, 29f, 2) + Vector2.UnitX * Main.rand.NextFloat(-6f, 6f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos, spearVel, ModContent.ProjectileType(), (int)(Projectile.damage * RainDamageMult), Projectile.knockBack * RainDamageMult, Projectile.owner); } } diff --git a/Projectiles/Rogue/EclipsesStealth.cs b/Projectiles/Rogue/EclipsesStealth.cs index 29d036ba82..bdf017b9f2 100644 --- a/Projectiles/Rogue/EclipsesStealth.cs +++ b/Projectiles/Rogue/EclipsesStealth.cs @@ -19,8 +19,6 @@ namespace CalamityMod.Projectiles.Rogue public const float RainDamageMult = 0.2f; public const float ExplosionDamageMult = 0.5f; - // For more consistent DPS, always alternates between spawning 1 and 2 spears instead of picking randomly - private bool spawnTwoSpears = true; private bool changedTimeLeft = false; public override void SetStaticDefaults() @@ -77,19 +75,15 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.owner == Main.myPlayer) { Projectile.localAI[1] -= 1f; - - var source = Projectile.GetSource_FromThis(); if (Projectile.localAI[1] <= 0f) { // Set up the spear counter for next time. Used to be every 5 frames there was a 50% chance; now it's more reliable but slower. - Projectile.localAI[1] = Main.rand.Next(10, 13); // 10 to 12 frames between each spearfall + Projectile.localAI[1] = Main.rand.Next(8, 10+1); // 8 to 10 frames between each spearfall int type = ModContent.ProjectileType(); - // Used to be a 50% chance each spearfall for 1 or 2. Now is consistent. - int numSpears = spawnTwoSpears ? 2 : 1; - spawnTwoSpears = !spawnTwoSpears; - for (int i = 0; i < numSpears; ++i) - CalamityUtils.ProjectileRain(source, Projectile.Center, 400f, 100f, 500f, 800f, 29f, type, (int)(Projectile.damage * RainDamageMult), Projectile.knockBack * RainDamageMult, Projectile.owner); + Vector2 spawnPos = Projectile.Center - new Vector2(Main.rand.NextFloat(-100f, 100f), Main.rand.NextFloat(500f, 800f)); + Vector2 spearVel = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(spawnPos, Main.npc[(int)Projectile.ai[1]], 29f, 2) + Vector2.UnitX * Main.rand.NextFloat(-6f, 6f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos, spearVel, type, (int)(Projectile.damage * RainDamageMult), Projectile.knockBack * RainDamageMult, Projectile.owner); } } } diff --git a/Projectiles/Rogue/EradicatorProjectile.cs b/Projectiles/Rogue/EradicatorProjectile.cs index a81963a004..edc2e751bb 100644 --- a/Projectiles/Rogue/EradicatorProjectile.cs +++ b/Projectiles/Rogue/EradicatorProjectile.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.MaxUpdates = 2; Projectile.timeLeft = Lifetime; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 18; + Projectile.localNPCHitCooldown = 15 * Projectile.MaxUpdates; Projectile.DamageType = RogueDamageClass.Instance; } @@ -117,10 +117,10 @@ namespace CalamityMod.Projectiles.Rogue StealthStrikeGrind(spin); else { - // Fire lasers at up to 2 nearby targets every 8 frames for 40% damage. - // Stealth strike lasers have an intentionally lower ratio of 12%. + // Fire lasers at up to 2 nearby targets every 12 frames. + // Stealth strike lasers have an intentionally lower damage. double laserDamageRatio = Projectile.Calamity().stealthStrike ? 0.15D : 0.4D; - float laserFrames = Projectile.MaxUpdates * 8f; + float laserFrames = Projectile.MaxUpdates * 12f; CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, laserFrames, 2, ModContent.ProjectileType(), laserDamageRatio, true, Projectile.DamageType); } } @@ -130,14 +130,14 @@ namespace CalamityMod.Projectiles.Rogue // Spin extra fast to visually shred the enemy. Projectile.rotation += spinDir * RotationIncrement * 0.8f; - // Randomly fire lasers while grinding. Each laser only does 12% damage. + // Randomly fire lasers while grinding. randomLaserCharge += Main.rand.NextFloat(0.09f, 0.14f); if (randomLaserCharge >= 1f) { randomLaserCharge -= 1f; Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); - int laserDamage = (int)(Projectile.damage * 0.12D); + int laserDamage = (int)(Projectile.damage * 0.15D); Projectile laser = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), laserDamage, 0f, Projectile.owner); if (laser.whoAmI.WithinBounds(Main.maxProjectiles)) { @@ -206,9 +206,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => OnHit(); - - private void OnHit() + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { // Non-stealth strikes do not stick on hit. if (!Projectile.Calamity().stealthStrike) diff --git a/Projectiles/Rogue/HypothermiaChunk.cs b/Projectiles/Rogue/HypothermiaChunk.cs index e1ee953a4b..9c8579400c 100644 --- a/Projectiles/Rogue/HypothermiaChunk.cs +++ b/Projectiles/Rogue/HypothermiaChunk.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.height = 20; Projectile.friendly = true; Projectile.penetrate = 1; - Projectile.timeLeft = 100; + Projectile.timeLeft = 480; Projectile.extraUpdates = 4; Projectile.ignoreWater = true; Projectile.DamageType = RogueDamageClass.Instance; @@ -59,16 +59,14 @@ namespace CalamityMod.Projectiles.Rogue } if (Projectile.owner == Main.myPlayer) { - int numSplits = Main.rand.NextBool() ? 4 : 3; - int type = ModContent.ProjectileType(); int shardDamage = (int)(Projectile.damage * 0.5f); float shardKB = Projectile.knockBack * 0.75f; - for (int i = 0; i < numSplits; ++i) + for (int i = 0; i < 4; ++i) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); int texID = Main.rand.Next(4); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, type, shardDamage, shardKB, Main.myPlayer, texID, 1f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), shardDamage, shardKB, Main.myPlayer, texID, 1f); } } } diff --git a/Projectiles/Rogue/HypothermiaShard.cs b/Projectiles/Rogue/HypothermiaShard.cs index 054cdff67c..c736458032 100644 --- a/Projectiles/Rogue/HypothermiaShard.cs +++ b/Projectiles/Rogue/HypothermiaShard.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Rogue public class HypothermiaShard : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; - private float counter = 0f; + private int counter = 0; public override void SetDefaults() { Projectile.width = 6; @@ -18,7 +18,6 @@ namespace CalamityMod.Projectiles.Rogue Projectile.scale = 1f; Projectile.friendly = true; Projectile.ignoreWater = true; - Projectile.alpha = 50; Projectile.penetrate = 1; Projectile.timeLeft = 600; Projectile.DamageType = RogueDamageClass.Instance; @@ -29,18 +28,19 @@ namespace CalamityMod.Projectiles.Rogue { Lighting.AddLight(Projectile.Center, 0.1f, 0f, 0.5f); Projectile.rotation += Projectile.velocity.X * 0.2f; - counter += 0.25f; if (Main.rand.NextBool(10)) { - int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 318, 0f, 0f, 0, default, 0.8f); + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 318, 0f, 0f, Scale: 0.8f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0.2f; } + Projectile.velocity *= 0.996f; - if (counter > 100f) + counter++; + if (counter > 400) { Projectile.scale -= 0.05f; - if ((double)Projectile.scale <= 0.2) + if (Projectile.scale <= 0.2f) { Projectile.scale = 0.2f; Projectile.Kill(); @@ -53,16 +53,14 @@ namespace CalamityMod.Projectiles.Rogue public override bool OnTileCollide(Vector2 oldVelocity) { if (Projectile.velocity.X != oldVelocity.X) - { Projectile.velocity.X = -oldVelocity.X; - } if (Projectile.velocity.Y != oldVelocity.Y) - { Projectile.velocity.Y = -oldVelocity.Y; - } return false; } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); public override void OnKill(int timeLeft) { for (int k = 0; k < 3; k++) @@ -71,27 +69,26 @@ namespace CalamityMod.Projectiles.Rogue } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); - - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); - public override bool PreDraw(ref Color lightColor) { //Changes the texture of the projectile Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - if (Projectile.ai[0] == 1f) + switch (Projectile.ai[0]) { - texture = ModContent.Request("CalamityMod/Projectiles/Rogue/HypothermiaShard2").Value; + case 0: + texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + break; + case 1: + texture = ModContent.Request("CalamityMod/Projectiles/Rogue/HypothermiaShard2").Value; + break; + case 2: + texture = ModContent.Request("CalamityMod/Projectiles/Rogue/HypothermiaShard3").Value; + break; + case 3: + texture = ModContent.Request("CalamityMod/Projectiles/Rogue/HypothermiaShard4").Value; + break; } - if (Projectile.ai[0] == 2f) - { - texture = ModContent.Request("CalamityMod/Projectiles/Rogue/HypothermiaShard3").Value; - } - if (Projectile.ai[0] == 3f) - { - texture = ModContent.Request("CalamityMod/Projectiles/Rogue/HypothermiaShard4").Value; - } - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, texture.Height / 2f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, texture.Size() / 2f, Projectile.scale, SpriteEffects.None); return false; } } diff --git a/Projectiles/Rogue/LostSoulFriendly.cs b/Projectiles/Rogue/LostSoulFriendly.cs index d0f71b3f6f..3ed53a60cd 100644 --- a/Projectiles/Rogue/LostSoulFriendly.cs +++ b/Projectiles/Rogue/LostSoulFriendly.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Rogue Projectile.DamageType = RogueDamageClass.Instance; Projectile.extraUpdates = 1; Projectile.alpha = 150; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool? CanHitNPC(NPC target) => (Projectile.timeLeft < 210 || Projectile.ai[0] == 2f) && target.CanBeChasedBy(Projectile); diff --git a/Projectiles/Rogue/PalladiumJavelinProjectile.cs b/Projectiles/Rogue/PalladiumJavelinProjectile.cs index 515e6f14b1..35653b5ee4 100644 --- a/Projectiles/Rogue/PalladiumJavelinProjectile.cs +++ b/Projectiles/Rogue/PalladiumJavelinProjectile.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; //Stealth strike behavior - if (!Projectile.Calamity().stealthStrike || Projectile.owner != Main.myPlayer || Projectile.Calamity().lineColor >= 2) + if (!Projectile.Calamity().stealthStrike || Projectile.owner != Main.myPlayer || Projectile.ai[2] >= 2) return; Projectile.localAI[0]++; if (Projectile.localAI[0] >= 12f) @@ -49,18 +49,13 @@ namespace CalamityMod.Projectiles.Rogue Dust.NewDust(Projectile.Center - vector2 / 2f, (int)vector2.X, (int)vector2.Y, DustID.Palladium, 0f, 0f, 0, default, 1f); } - int javelin = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity.RotatedBy(MathHelper.ToRadians(3f)), Projectile.type, Projectile.damage, Projectile.knockBack, Projectile.owner); - int javelin2 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity.RotatedBy(MathHelper.ToRadians(-3f)), Projectile.type, Projectile.damage, Projectile.knockBack, Projectile.owner); + int javelin = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity.RotatedBy(MathHelper.ToRadians(3f)), Projectile.type, Projectile.damage, Projectile.knockBack, Projectile.owner, ai2: Projectile.ai[2] + 1); + int javelin2 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity.RotatedBy(MathHelper.ToRadians(-3f)), Projectile.type, Projectile.damage, Projectile.knockBack, Projectile.owner, ai2: Projectile.ai[2] + 1); if (javelin.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[javelin].Calamity().lineColor = Projectile.Calamity().lineColor + 1; Main.projectile[javelin].Calamity().stealthStrike = true; - } if (javelin2.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[javelin2].Calamity().lineColor = Projectile.Calamity().lineColor + 1; Main.projectile[javelin2].Calamity().stealthStrike = true; - } + Projectile.Kill(); } } diff --git a/Projectiles/Rogue/PenumbraBomb.cs b/Projectiles/Rogue/PenumbraBomb.cs index 3ecbfb63bd..ca892006b6 100644 --- a/Projectiles/Rogue/PenumbraBomb.cs +++ b/Projectiles/Rogue/PenumbraBomb.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.alpha = 10; //Rotation Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); - Projectile.rotation = (Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi)) + (MathHelper.ToRadians(180) * Projectile.direction); + Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) + (MathHelper.ToRadians(180) * Projectile.direction); //Dust float dfreq = Projectile.Calamity().stealthStrike ? 8f : 4f; @@ -81,27 +81,24 @@ namespace CalamityMod.Projectiles.Rogue } public override void OnKill(int timeLeft) { - //Dark soul projectiles - int ad = Projectile.Calamity().stealthStrike ? 40 : 60; - float dmgMult = Projectile.Calamity().stealthStrike ? 0.08f : 0.15f; - int randrot = Main.rand.Next(-30, 31); - for (int i = 0; i < 360; i += ad) + // Dark soul projectiles + int projAmt = Projectile.Calamity().stealthStrike ? 8 : 6; + for (int i = 0; i < projAmt; i++) { - Vector2 SoulSpeed = new Vector2(13f, 13f).RotatedBy(MathHelper.ToRadians(i + randrot)); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, SoulSpeed, ModContent.ProjectileType(), (int)(Projectile.damage * dmgMult), 3f, Projectile.owner, 0f, 0f); + Vector2 SoulSpeed = Vector2.UnitX.RotatedBy(MathHelper.TwoPi * i / projAmt) * 13f; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, SoulSpeed, ModContent.ProjectileType(), (int)(Projectile.damage * 0.15f), 3f, Projectile.owner, 0f, 0f); } - //Dust + + // Dust int maxDust = Projectile.Calamity().stealthStrike ? 100 : 70; for (int i = 0; i < maxDust; i++) { Vector2 dustspeed = new Vector2(Main.rand.NextFloat(-6f, 6f), Main.rand.NextFloat(-6f, 6f)); - int d = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Wraith, dustspeed.X, dustspeed.Y, 0, new Color(38, 30, 43), 1.6f); + Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Wraith, dustspeed.X, dustspeed.Y, 0, new Color(38, 30, 43), 1.6f); } + SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - Projectile.width = 110; - Projectile.height = 110; - Projectile.position.X = Projectile.position.X - (Projectile.width / 2); - Projectile.position.Y = Projectile.position.Y - (Projectile.height / 2); + Projectile.ExpandHitboxBy(110); Projectile.maxPenetrate = -1; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; @@ -115,7 +112,5 @@ namespace CalamityMod.Projectiles.Rogue CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Blackout, 300); } } diff --git a/Projectiles/Rogue/PenumbraSoul.cs b/Projectiles/Rogue/PenumbraSoul.cs index a942a55356..30bc73aab0 100644 --- a/Projectiles/Rogue/PenumbraSoul.cs +++ b/Projectiles/Rogue/PenumbraSoul.cs @@ -20,32 +20,26 @@ namespace CalamityMod.Projectiles.Rogue { Projectile.height = 18; Projectile.width = 18; - Projectile.timeLeft = 150; Projectile.friendly = true; + Projectile.DamageType = RogueDamageClass.Instance; Projectile.tileCollide = false; Projectile.ignoreWater = true; - Projectile.DamageType = RogueDamageClass.Instance; + Projectile.timeLeft = 240; Projectile.alpha = 80; - - Projectile.penetrate = 2; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; Projectile.extraUpdates = 1; + DrawOffsetX = 1; + DrawOriginOffsetY = 4; } public override void AI() { Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - DrawOffsetX = 1; - DrawOriginOffsetY = 4; // Continuously trail dust int trailDust = 1; for (int i = 0; i < trailDust; ++i) { - int dustID = 54; //Used by Wraiths and other shadowy stuff - - int idx = Dust.NewDust(Projectile.position - Projectile.velocity, Projectile.width, Projectile.height, dustID, 0f, 0f, 0, new Color(38, 30, 43)); + int idx = Dust.NewDust(Projectile.position - Projectile.velocity, Projectile.width, Projectile.height, DustID.Wraith, 0f, 0f, 0, new Color(38, 30, 43)); Main.dust[idx].noGravity = true; Main.dust[idx].velocity += Projectile.velocity * 0.8f; } @@ -54,14 +48,20 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.ai[0] > 0f) Projectile.ai[0] -= 1f; - // Home in on nearby enemies if homing is enabled - if (Projectile.ai[1] == 0f) - HomingAI(); + // Home in on nearby enemies + CalamityUtils.HomeInOnNPC(Projectile, true, 400f, 12f, 35f); } - private void HomingAI() + public override void OnKill(int timeLeft) { - CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 35f); + // Create a burst of dust + int dustAmt = Main.rand.Next(30, 41); + for (int i = 0; i < dustAmt; i++) + { + int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Wraith, 0f, 0f, 0, new Color(38, 30, 43), Main.rand.NextFloat(1f, 1.8f)); + Main.dust[idx].noGravity = true; + Main.dust[idx].velocity *= Main.rand.NextFloat(2f, 3.1f); + } } public override bool PreDraw(ref Color lightColor) @@ -69,48 +69,5 @@ namespace CalamityMod.Projectiles.Rogue CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - // Rapidly screech to a halt upon touching an enemy and disable homing. - Projectile.velocity *= 0.4f; - Projectile.ai[1] = 1f; - - // Fade out a bit with every hit - Projectile.alpha += 20; - if (Projectile.alpha > 255) - Projectile.alpha = 255; - - // Explode into dust (as if being shredded apart on contact) - int onHitDust = Main.rand.Next(6, 11); - for (int i = 0; i < onHitDust; ++i) - { - int dustID = 54; - int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustID, 0f, 0f, 0, new Color(38, 30, 43)); - - Main.dust[idx].noGravity = true; - float speed = Main.rand.NextFloat(1.4f, 2.6f); - Main.dust[idx].velocity *= speed; - float scale = Main.rand.NextFloat(1.0f, 1.8f); - Main.dust[idx].scale = scale; - } - } - - public override void OnKill(int timeLeft) - { - // Create a burst of dust - int killDust = Main.rand.Next(30, 41); - for (int i = 0; i < killDust; ++i) - { - int dustID = 54; - int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustID, 0f, 0f, 0, new Color(38, 30, 43)); - - Main.dust[idx].noGravity = true; - float speed = Main.rand.NextFloat(2.0f, 3.1f); - Main.dust[idx].velocity *= speed; - float scale = Main.rand.NextFloat(1.0f, 1.8f); - Main.dust[idx].scale = scale; - } - } } } diff --git a/Projectiles/Rogue/ShockTeslaAura.cs b/Projectiles/Rogue/ShockTeslaAura.cs index da9583480a..999b7d269d 100644 --- a/Projectiles/Rogue/ShockTeslaAura.cs +++ b/Projectiles/Rogue/ShockTeslaAura.cs @@ -94,19 +94,9 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(BuffID.Electrified, 60); target.AddBuff(ModContent.BuffType(), 60); - - if (target.knockBackResist <= 0f) - return; - - // 12AUG2023: Ozzatron: TML was giving NaN knockback, probably due to 0 base knockback. Do not use hit.Knockback - if (CalamityGlobalNPC.ShouldAffectNPC(target)) - { - float knockbackMultiplier = MathHelper.Clamp(1f - target.knockBackResist, 0f, 1f); - Vector2 trueKnockback = target.Center - Projectile.Center; - trueKnockback.Normalize(); - target.velocity = trueKnockback * knockbackMultiplier; - } } + // CIT 2MAY2025: Replaced old manual knockback code with setting HitDirectionOverride + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.HitDirectionOverride = (target.Center.X > Projectile.Center.X).ToDirectionInt(); public override void OnHitPlayer(Player target, Player.HurtInfo info) { diff --git a/Projectiles/Rogue/SlickCaneProjectile.cs b/Projectiles/Rogue/SlickCaneProjectile.cs index ce965f114c..061241ef8a 100644 --- a/Projectiles/Rogue/SlickCaneProjectile.cs +++ b/Projectiles/Rogue/SlickCaneProjectile.cs @@ -80,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 && !NeedsDebuffIconDisplayList.Includes(target.type)) + if (Projectile.owner == Main.myPlayer && target.IsAnEnemy(false) && !target.dontCountMe && !CalamityNPCSets.ForceDrawDebuffDisplay[target.type]) { float moneyValueToDrop = target.value / Main.rand.NextFloat(15f, 35f); // Maximum of 50 silver, not counting steath strikes diff --git a/Projectiles/Summon/BabyBloodCrawler.cs b/Projectiles/Summon/BabyBloodCrawler.cs index 3416df2b66..10fdd37bb7 100644 --- a/Projectiles/Summon/BabyBloodCrawler.cs +++ b/Projectiles/Summon/BabyBloodCrawler.cs @@ -54,19 +54,6 @@ namespace CalamityMod.Projectiles.Summon Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - foreach (Projectile proj in Main.ActiveProjectiles) - { - // Short circuits to make the loop as fast as possible - if (proj.owner != Projectile.owner || !proj.minion || proj.Calamity().lineColor != 1) - continue; - if (proj.type == Projectile.type) - { - proj.Calamity().lineColor = 2; - } - } - if (Projectile.Calamity().lineColor == 0) - Projectile.Calamity().lineColor = 1; - if (dust == 0f) { int constant = 16; diff --git a/Projectiles/Summon/BrimstoneElementalMinion.cs b/Projectiles/Summon/BrimstoneElementalMinion.cs index 9def69225a..81f4e960a3 100644 --- a/Projectiles/Summon/BrimstoneElementalMinion.cs +++ b/Projectiles/Summon/BrimstoneElementalMinion.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Summon bool isActive = Projectile.type == ModContent.ProjectileType(); Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.brimstoneWaifu && !modPlayer.allWaifus && !modPlayer.brimstoneWaifuVanity && !modPlayer.allWaifusVanity) + if (!modPlayer.brimElemental && !modPlayer.allElementals && !modPlayer.brimElementalVanity && !modPlayer.allElementalsVanity) { Projectile.active = false; return; @@ -52,9 +52,9 @@ namespace CalamityMod.Projectiles.Summon { if (player.dead) { - modPlayer.bWaifu = false; + modPlayer.brimEleBuff = false; } - if (modPlayer.bWaifu) + if (modPlayer.brimEleBuff) { Projectile.timeLeft = 2; } @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Summon Main.dust[brimDust].scale *= 1.15f; } } - bool passive = modPlayer.brimstoneWaifuVanity || modPlayer.allWaifusVanity; + bool passive = modPlayer.brimElementalVanity || modPlayer.allElementalsVanity; Projectile.frameCounter++; if (Projectile.frameCounter > 9) { @@ -210,7 +210,7 @@ namespace CalamityMod.Projectiles.Summon { Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - if (modPlayer.brimstoneWaifuVanity || modPlayer.allWaifusVanity) + if (modPlayer.brimElementalVanity || modPlayer.allElementalsVanity) { return false; } diff --git a/Projectiles/Summon/CausticStaffProjectile.cs b/Projectiles/Summon/CausticStaffProjectile.cs index 79ad9f70d0..a5f79fccff 100644 --- a/Projectiles/Summon/CausticStaffProjectile.cs +++ b/Projectiles/Summon/CausticStaffProjectile.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Summon switch ((int)Projectile.ai[0]) { case 0: - if (target.Calamity().marked <= 0) + if (target.Calamity().markedForDeath) target.AddBuff(ModContent.BuffType(), duration); break; case 1: diff --git a/Projectiles/Summon/CloudElementalMinion.cs b/Projectiles/Summon/CloudElementalMinion.cs index 2a8fa900b4..336fbb5feb 100644 --- a/Projectiles/Summon/CloudElementalMinion.cs +++ b/Projectiles/Summon/CloudElementalMinion.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Summon { Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.cloudWaifu && !modPlayer.allWaifus && !modPlayer.cloudWaifuVanity && !modPlayer.allWaifusVanity) + if (!modPlayer.cloudElemental && !modPlayer.allElementals && !modPlayer.cloudElementalVanity && !modPlayer.allElementalsVanity) { Projectile.active = false; return; @@ -51,9 +51,9 @@ namespace CalamityMod.Projectiles.Summon { if (player.dead) { - modPlayer.cWaifu = false; + modPlayer.cloudEleBuff = false; } - if (modPlayer.cWaifu) + if (modPlayer.cloudEleBuff) { Projectile.timeLeft = 2; } @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame = 0; } - if (!modPlayer.cloudWaifuVanity && !modPlayer.allWaifusVanity) + if (!modPlayer.cloudElementalVanity && !modPlayer.allElementalsVanity) { float lightScalar = (float)Main.rand.Next(90, 111) * 0.01f; lightScalar *= Main.essScale; @@ -146,7 +146,7 @@ namespace CalamityMod.Projectiles.Summon { Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - if (modPlayer.cloudWaifuVanity || modPlayer.allWaifusVanity) + if (modPlayer.cloudElementalVanity || modPlayer.allElementalsVanity) { return false; } diff --git a/Projectiles/Summon/CosmicViperSummon.cs b/Projectiles/Summon/CosmicViperSummon.cs index d99e8910ec..0dffeca8d7 100644 --- a/Projectiles/Summon/CosmicViperSummon.cs +++ b/Projectiles/Summon/CosmicViperSummon.cs @@ -70,12 +70,11 @@ namespace CalamityMod.Projectiles.Summon for (int dustIndex = 0; dustIndex < dustAmt; dustIndex++) { int dustType = Main.rand.NextBool(3) ? 56 : 242; - Vector2 rotate = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.75f; - rotate = rotate.RotatedBy((double)((float)(dustIndex - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + Projectile.Center; + Vector2 rotate = Vector2.Normalize(Projectile.velocity) * new Vector2(Projectile.width / 2f, Projectile.height) * 0.75f; + rotate = rotate.RotatedBy(dustIndex * MathHelper.TwoPi / (float)dustAmt) + Projectile.Center; Vector2 faceDirection = rotate - Projectile.Center; - int dusty = Dust.NewDust(rotate + faceDirection, 0, 0, dustType, faceDirection.X * 1.75f, faceDirection.Y * 1.75f, 100, default, 1.1f); - Main.dust[dusty].noGravity = true; - Main.dust[dusty].velocity = faceDirection; + Dust dusty = Dust.NewDustPerfect(Projectile.Center, dustType, faceDirection, 100, default, 1.1f); + dusty.noGravity = true; } // Construct a fake item to use with vanilla code for the sake of firing bullets. diff --git a/Projectiles/Summon/ForbiddenCircletEater.cs b/Projectiles/Summon/ForbiddenCircletEater.cs index 90472d54b1..52e97c0270 100644 --- a/Projectiles/Summon/ForbiddenCircletEater.cs +++ b/Projectiles/Summon/ForbiddenCircletEater.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Projectiles.Summon { Main.projFrames[Type] = 4; ProjectileID.Sets.CultistIsResistantTo[Type] = true; + ProjectileID.Sets.MinionShot[Type] = true; //This marks it as a minion shot, which allows it to proc summon tag effects. } public override void SetDefaults() @@ -70,6 +71,8 @@ namespace CalamityMod.Projectiles.Summon float attackDistance = 100000f; bool canAttack = false; Projectile.ai[0] += 1f; + + NPC target = null; if (Projectile.ai[0] > 30f) { if (player.HasMinionAttackTargetNPC) @@ -82,14 +85,11 @@ namespace CalamityMod.Projectiles.Summon float npcDist = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - npcX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - npcY); if (npcDist < 640f && npcDist < attackDistance && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, npc.position, npc.width, npc.height)) { - attackDistance = npcDist; - projX = npcX; - projY = npcY; - canAttack = true; + target = npc; } } } - if (!canAttack) + if (target.IsNullOrInactive()) { foreach (NPC npc in Main.ActiveNPCs) { @@ -100,60 +100,17 @@ namespace CalamityMod.Projectiles.Summon float npcDist = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - npcX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - npcY); if (npcDist < 640f && npcDist < attackDistance && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, npc.position, npc.width, npc.height)) { - attackDistance = npcDist; - projX = npcX; - projY = npcY; - canAttack = true; + + target = npc; } } } } } - if (!canAttack) - { - projX = Projectile.position.X + (float)(Projectile.width / 2) + Projectile.velocity.X * 100f; - projY = Projectile.position.Y + (float)(Projectile.height / 2) + Projectile.velocity.Y * 100f; - } - float projVel = 0.16f; - Vector2 playerDirection = Projectile.Center; - float playerX = projX - playerDirection.X; - float playerY = projY - playerDirection.Y; - float playerDist = (float)Math.Sqrt((double)(playerX * playerX + playerY * playerY)); - playerDist = 10f / playerDist; - playerX *= playerDist; - playerY *= playerDist; - if (Projectile.velocity.X < playerX) - { - Projectile.velocity.X = Projectile.velocity.X + projVel; - if (Projectile.velocity.X < 0f && playerX > 0f) - { - Projectile.velocity.X = Projectile.velocity.X + projVel * 2f; - } - } - else if (Projectile.velocity.X > playerX) - { - Projectile.velocity.X = Projectile.velocity.X - projVel; - if (Projectile.velocity.X > 0f && playerX < 0f) - { - Projectile.velocity.X = Projectile.velocity.X - projVel * 2f; - } - } - if (Projectile.velocity.Y < playerY) - { - Projectile.velocity.Y = Projectile.velocity.Y + projVel; - if (Projectile.velocity.Y < 0f && playerY > 0f) - { - Projectile.velocity.Y = Projectile.velocity.Y + projVel * 2f; - } - } - else if (Projectile.velocity.Y > playerY) - { - Projectile.velocity.Y = Projectile.velocity.Y - projVel; - if (Projectile.velocity.Y > 0f && playerY < 0f) - { - Projectile.velocity.Y = Projectile.velocity.Y - projVel * 2f; - } - } + if (!target.IsNullOrInactive()) + Projectile.velocity = Vector2.Lerp(Projectile.velocity, Projectile.DirectionTo(target.Center) * 15, 0.1f); + else + Projectile.velocity = Vector2.Lerp(Projectile.velocity, Projectile.velocity.SafeNormalize(Vector2.Zero) * 15, 0.1f); } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Summon/MechwormBody.cs b/Projectiles/Summon/MechwormBody.cs index b628517c67..dec72c4e7a 100644 --- a/Projectiles/Summon/MechwormBody.cs +++ b/Projectiles/Summon/MechwormBody.cs @@ -131,6 +131,7 @@ namespace CalamityMod.Projectiles.Summon projectile.ForceNetUpdate(false); projectile.extraUpdates = head.extraUpdates; + projectile.localNPCHitCooldown = head.localNPCHitCooldown; MechwormHead headModProj = head.ModProjectile(); if (headModProj.EndRiftGateUUID == -1) diff --git a/Projectiles/Summon/MechwormHead.cs b/Projectiles/Summon/MechwormHead.cs index bf954c8832..dbc9b6905e 100644 --- a/Projectiles/Summon/MechwormHead.cs +++ b/Projectiles/Summon/MechwormHead.cs @@ -180,6 +180,7 @@ namespace CalamityMod.Projectiles.Summon PortalAttackMovement(potentialTarget); UpdateAttackStates(); Projectile.extraUpdates = 1; + Projectile.localNPCHitCooldown = 30 * Projectile.MaxUpdates; } // Attacking movement can be canceled, so if it was, run the passive movement instead. else @@ -201,6 +202,7 @@ namespace CalamityMod.Projectiles.Summon private void PlayerFollowMovement(Player owner) { Projectile.extraUpdates = 0; + Projectile.localNPCHitCooldown = 30; // Reset the gate UUID from any previous teleports. if (EndRiftGateUUID != -1) @@ -316,7 +318,7 @@ namespace CalamityMod.Projectiles.Summon TeleportEndingPoint = target.Center - offset; } else - TeleportEndingPoint = Projectile.Center + Projectile.velocity * chargeTime / 2f; + TeleportEndingPoint = Projectile.Center + CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(Projectile.Center, target, Projectile.velocity.Length(), Projectile.MaxUpdates) * chargeTime / 2f; // On the starting frame of a teleport, spawn portals. if (Main.myPlayer == Projectile.owner) diff --git a/Projectiles/Summon/MirrorofKalandraMinions/AtzirisDisfavor.cs b/Projectiles/Summon/MirrorofKalandraMinions/AtzirisDisfavor.cs index f7199ae813..6d8df9cdd5 100644 --- a/Projectiles/Summon/MirrorofKalandraMinions/AtzirisDisfavor.cs +++ b/Projectiles/Summon/MirrorofKalandraMinions/AtzirisDisfavor.cs @@ -79,7 +79,8 @@ namespace CalamityMod.Projectiles.Summon.MirrorofKalandraMinions // Repeating swing sound. if (Projectile.soundDelay <= 0) { - SoundEngine.PlaySound(CommonCalamitySounds.LouderSwingWoosh with { Pitch = -.8f, PitchVariance = 1f, Volume = .6f }, Projectile.Center); + SoundStyle swing = new SoundStyle("CalamityMod/Sounds/Custom/LoudSwingWoosh") with { Pitch = -.8f, PitchVariance = 1f, Volume = .6f }; + SoundEngine.PlaySound(swing, Projectile.Center); Projectile.soundDelay = 15; Projectile.netUpdate = true; } diff --git a/Projectiles/Summon/PowerfulRaven.cs b/Projectiles/Summon/PowerfulRaven.cs index 6efe8f8276..369c4b346d 100644 --- a/Projectiles/Summon/PowerfulRaven.cs +++ b/Projectiles/Summon/PowerfulRaven.cs @@ -62,6 +62,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.timeLeft = 2; } } + Projectile.MinionAntiClump(); NPC potentialTarget = Projectile.Center.MinionHoming(DistanceToCheck, player); diff --git a/Projectiles/Summon/SageNeedle.cs b/Projectiles/Summon/SageNeedle.cs index d5623a1134..b17ad2b12e 100644 --- a/Projectiles/Summon/SageNeedle.cs +++ b/Projectiles/Summon/SageNeedle.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Summon // 3 slots provide 76 DoT. // [...] // 9 slots provide 240 DoT. - int sagePoisonDamage = (int)(50 * averageDamageMultiplier); + int sagePoisonDamage = (int)(SagePoison.debuffData.EnemyLostRegen * averageDamageMultiplier); target.AddBuff(ModContent.BuffType(), 300); target.Calamity().sagePoisonDamage = sagePoisonDamage; } diff --git a/Projectiles/Summon/SandElementalHealer.cs b/Projectiles/Summon/SandElementalHealer.cs index 8ec3c83484..408e4982e2 100644 --- a/Projectiles/Summon/SandElementalHealer.cs +++ b/Projectiles/Summon/SandElementalHealer.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Summon Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.sandBoobWaifu && !modPlayer.allWaifus && !modPlayer.sandBoobWaifuVanity && !modPlayer.allWaifusVanity) + if (!modPlayer.rareSandElemental && !modPlayer.allElementals && !modPlayer.rareSandElementalVanity && !modPlayer.allElementalsVanity) { Projectile.active = false; return; @@ -55,9 +55,9 @@ namespace CalamityMod.Projectiles.Summon { if (player.dead) { - modPlayer.dWaifu = false; + modPlayer.rareSandEleBuff = false; } - if (modPlayer.dWaifu) + if (modPlayer.rareSandEleBuff) { Projectile.timeLeft = 2; } @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.spriteDirection = -Projectile.direction; } - if (!modPlayer.sandBoobWaifuVanity && !modPlayer.allWaifusVanity) + if (!modPlayer.rareSandElementalVanity && !modPlayer.allElementalsVanity) { float lightScalar = (float)Main.rand.Next(90, 111) * 0.01f; lightScalar *= Main.essScale; @@ -160,7 +160,7 @@ namespace CalamityMod.Projectiles.Summon { Projectile.localAI[0] += 1f; } - if (Projectile.ai[0] == 0f && !modPlayer.sandBoobWaifuVanity && !modPlayer.allWaifusVanity) + if (Projectile.ai[0] == 0f && !modPlayer.rareSandElementalVanity && !modPlayer.allElementalsVanity) { int healProj = ModContent.ProjectileType(); if (Projectile.ai[1] == 0f && Projectile.localAI[0] >= 120f) @@ -189,7 +189,7 @@ namespace CalamityMod.Projectiles.Summon { Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - if (modPlayer.sandBoobWaifuVanity || modPlayer.allWaifusVanity) + if (modPlayer.rareSandElementalVanity || modPlayer.allElementalsVanity) { return false; } diff --git a/Projectiles/Summon/SandElementalMinion.cs b/Projectiles/Summon/SandElementalMinion.cs index 59c7f9c2bf..397f3481cd 100644 --- a/Projectiles/Summon/SandElementalMinion.cs +++ b/Projectiles/Summon/SandElementalMinion.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Summon { Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.sandWaifu && !modPlayer.allWaifus && !modPlayer.sandWaifuVanity && !modPlayer.allWaifusVanity) + if (!modPlayer.sandElemental && !modPlayer.allElementals && !modPlayer.sandElementalVanity && !modPlayer.allElementalsVanity) { Projectile.active = false; return; @@ -51,9 +51,9 @@ namespace CalamityMod.Projectiles.Summon { if (player.dead) { - modPlayer.sWaifu = false; + modPlayer.sandEleBuff = false; } - if (modPlayer.sWaifu) + if (modPlayer.sandEleBuff) { Projectile.timeLeft = 2; } @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Summon Main.dust[dust].scale *= 1.15f; } } - bool passive = modPlayer.sandWaifuVanity || modPlayer.allWaifusVanity; + bool passive = modPlayer.sandElementalVanity || modPlayer.allElementalsVanity; if (Math.Abs(Projectile.velocity.X) > 0.2f) { Projectile.spriteDirection = -Projectile.direction; diff --git a/Projectiles/Summon/SarosAura.cs b/Projectiles/Summon/SarosAura.cs index c9721af9e7..61ad52487e 100644 --- a/Projectiles/Summon/SarosAura.cs +++ b/Projectiles/Summon/SarosAura.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetDefaults() { - Projectile.minionSlots = 8f; + Projectile.minionSlots = 6f; Projectile.penetrate = -1; Projectile.width = Projectile.height = 132; diff --git a/Projectiles/Summon/SilvaCrystal.cs b/Projectiles/Summon/SilvaCrystal.cs index 3cbe3f521a..9b76c93281 100644 --- a/Projectiles/Summon/SilvaCrystal.cs +++ b/Projectiles/Summon/SilvaCrystal.cs @@ -3,6 +3,7 @@ using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -38,6 +39,7 @@ namespace CalamityMod.Projectiles.Summon { Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); + bool isMinion = Projectile.type == ModContent.ProjectileType(); if (!modPlayer.silvaSummon) { @@ -47,14 +49,11 @@ namespace CalamityMod.Projectiles.Summon if (isMinion) { if (player.dead) - { modPlayer.sCrystal = false; - } if (modPlayer.sCrystal) - { Projectile.timeLeft = 2; - } } + Projectile.Center = player.Center + Vector2.UnitY * (player.gfxOffY - 60f); if (player.gravDir == -1f) { @@ -65,36 +64,27 @@ namespace CalamityMod.Projectiles.Summon { Projectile.rotation = 0f; } - Projectile.position.X = (int)Projectile.position.X; - Projectile.position.Y = (int)Projectile.position.Y; + Projectile.velocity = Vector2.Zero; Projectile.alpha -= 5; if (Projectile.alpha < 0) - { Projectile.alpha = 0; - } if (Projectile.direction == 0) - { Projectile.direction = Main.player[Projectile.owner].direction; - } + if (Projectile.alpha == 0 && Main.rand.NextBool(15)) { - Dust silvaDust = Main.dust[Dust.NewDust(Projectile.Top, 0, 0, DustID.RainbowMk2, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1f)]; - silvaDust.velocity.X = 0f; + Vector2 dustSpawn = Projectile.Center + Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat(26f, 30f); + Dust silvaDust = Dust.NewDustPerfect(dustSpawn, DustID.RainbowMk2, Vector2.UnitY * Main.rand.NextFloat(-2f, 2f), 100, new Color(Main.DiscoR, 203, 103), 0.5f); silvaDust.noGravity = true; silvaDust.fadeIn = 1f; - silvaDust.position = Projectile.Center + Vector2.UnitY.RotatedByRandom(6.2831854820251465) * (4f * Main.rand.NextFloat() + 26f); - silvaDust.scale = 0.5f; } + Projectile.localAI[0] += 1f; if (Projectile.localAI[0] >= 60f) - { Projectile.localAI[0] = 0f; - } if (Projectile.ai[0] < 0f) - { Projectile.ai[0] += 1f; - } if (Projectile.ai[0] == 0f) { int targetID = -1; @@ -116,7 +106,7 @@ namespace CalamityMod.Projectiles.Summon { foreach (NPC target in Main.ActiveNPCs) { - if (target.CanBeChasedBy(Projectile, false)) + if (target.CanBeChasedBy(Projectile)) { float targetDistance = Projectile.Distance(target.Center); if (targetDistance < attackRange && Collision.CanHitLine(Projectile.Center, 0, 0, target.Center, 0, 0)) @@ -130,7 +120,7 @@ namespace CalamityMod.Projectiles.Summon if (targetID != -1) { Projectile.ai[0] = 1f; - Projectile.ai[1] = (float)targetID; + Projectile.ai[1] = targetID; Projectile.netUpdate = true; return; } @@ -138,7 +128,7 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.ai[0] > 0f) { int npcTrack = (int)Projectile.ai[1]; - if (!Main.npc[npcTrack].CanBeChasedBy(Projectile, false)) + if (!Main.npc[npcTrack].CanBeChasedBy(Projectile)) { Projectile.ai[0] = 0f; Projectile.ai[1] = 0f; @@ -154,49 +144,34 @@ namespace CalamityMod.Projectiles.Summon Projectile.netUpdate = true; if (Projectile.owner == Main.myPlayer) { - Vector2 attackPos = Main.npc[npcTrack].position + Main.npc[npcTrack].Size * Utils.RandomVector2(Main.rand, 0f, 1f) - Projectile.Center; - int attackAmt; - for (int j = 0; j < 3; j = attackAmt + 1) + Vector2 attackPos = Main.npc[npcTrack].Center - Projectile.Center; + for (int j = 0; j < 3; j++) { - Vector2 finalAttackPos = Projectile.Center + attackPos; - if (j > 0) - { - finalAttackPos = Projectile.Center + attackPos.RotatedByRandom(0.78539818525314331) * (Main.rand.NextFloat() * 0.5f + 0.75f); - } - float x4 = Main.rgbToHsl(new Color(Main.DiscoR, 203, 103)).X; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), finalAttackPos, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, x4, (float)Projectile.whoAmI); - attackAmt = j; + Vector2 finalAttackPos = Projectile.Center + attackPos.RotatedByRandom(j > 0 ? MathHelper.Pi * 0.125f : 0f) * (j > 0 ? Main.rand.NextFloat(0.9f, 1.1f) : 1f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), finalAttackPos, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, Main.rgbToHsl(new Color(Main.DiscoR, 203, 103)).X, Projectile.whoAmI); } return; } } } } + public override bool? CanDamage() => false; - public override Color? GetAlpha(Color lightColor) - { - return new Color(255 - Projectile.alpha, 255 - Projectile.alpha, 255 - Projectile.alpha, 127 - Projectile.alpha / 2); - } - + public override Color? GetAlpha(Color lightColor) => new Color(255 - Projectile.alpha, 255 - Projectile.alpha, 255 - Projectile.alpha, 127 - Projectile.alpha / 2); public override bool PreDraw(ref Color lightColor) { - Color colorArea = Lighting.GetColor((int)((double)Projectile.position.X + (double)Projectile.width * 0.5) / 16, (int)(((double)Projectile.position.Y + (double)Projectile.height * 0.5) / 16.0)); - Vector2 projPos = Projectile.position + new Vector2((float)Projectile.width, (float)Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; - Texture2D texture2D34 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Rectangle rectangular = texture2D34.Frame(1, Main.projFrames[Type], 0, Projectile.frame); - Color colorAlpha = Projectile.GetAlpha(colorArea); - Vector2 halfRectangle = rectangular.Size() / 2f; - float scaleFactor = (float)Math.Cos((double)(6.28318548f * (Projectile.localAI[0] / 60f))) + 3f + 3f; - for (float k = 0f; k < 4f; k += 1f) + Texture2D tex = TextureAssets.Projectile[Type].Value; + Vector2 projPos = Projectile.Center + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; + Color colorArea = Lighting.GetColor((int)(Projectile.position.X + Projectile.width * 0.5) / 16, (int)((Projectile.position.Y + Projectile.height * 0.5) / 16.0)); + Color colorAlpha = Projectile.GetAlpha(colorArea) * 0.2f; + Vector2 origin = tex.Size() / 2f; + float scaleFactor = MathF.Cos(MathHelper.TwoPi * (Projectile.localAI[0] / 60f)) + 6f; + + for (int k = 0; k < 4; k++) { - SpriteBatch spritebatch = Main.spriteBatch; - double arg_F8BE_1 = (double)(k * MathHelper.PiOver2); - Vector2 center = default; - Main.EntitySpriteDraw(texture2D34, projPos + Vector2.UnitY.RotatedBy(arg_F8BE_1, center) * scaleFactor, new Microsoft.Xna.Framework.Rectangle?(rectangular), colorAlpha * 0.2f, Projectile.rotation, halfRectangle, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(tex, projPos + Vector2.UnitY.RotatedBy(k * MathHelper.PiOver2) * scaleFactor, null, colorAlpha, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); } return false; } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/SilvaCrystalExplosion.cs b/Projectiles/Summon/SilvaCrystalExplosion.cs index 70fcf7d03b..b118833432 100644 --- a/Projectiles/Summon/SilvaCrystalExplosion.cs +++ b/Projectiles/Summon/SilvaCrystalExplosion.cs @@ -1,6 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -11,223 +12,162 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override string Texture => "CalamityMod/Projectiles/StarProj"; - public override void SetStaticDefaults() - { - ProjectileID.Sets.MinionShot[Type] = true; - } - + public ref float OwnerCheck => ref Projectile.ai[1]; + public override void SetStaticDefaults() => ProjectileID.Sets.MinionShot[Type] = true; public override void SetDefaults() { Projectile.width = Projectile.height = 14; + Projectile.DamageType = DamageClass.Summon; Projectile.alpha = 255; Projectile.tileCollide = false; Projectile.ignoreWater = true; + Projectile.penetrate = -1; Projectile.timeLeft = 900; - Projectile.DamageType = DamageClass.Summon; } public override void AI() { - Color newColor2 = Main.hslToRgb(Projectile.ai[0], 1f, 0.5f); - int activeTimer = (int)Projectile.ai[1]; - if (activeTimer < 0 || activeTimer >= 1000 || (!Main.projectile[activeTimer].active && Main.projectile[activeTimer].type != ModContent.ProjectileType())) + Color colorToUse = Main.hslToRgb(Projectile.ai[0], 1f, 0.5f); + if (OwnerCheck < 0 || OwnerCheck >= 1000 || (!Main.projectile[(int)OwnerCheck].active && Main.projectile[(int)OwnerCheck].type != ModContent.ProjectileType())) { Projectile.ai[1] = -1f; } else { - DelegateMethods.v3_1 = newColor2.ToVector3() * 0.5f; - Utils.PlotTileLine(Projectile.Center, Main.projectile[activeTimer].Center, 8f, DelegateMethods.CastLight); + DelegateMethods.v3_1 = colorToUse.ToVector3() * 0.5f; + Utils.PlotTileLine(Projectile.Center, Main.projectile[(int)OwnerCheck].Center, 8f, DelegateMethods.CastLight); } + if (Projectile.localAI[0] == 0f) { - Projectile.localAI[0] = Main.rand.NextFloat() * 0.8f + 0.8f; - Projectile.direction = (Main.rand.Next(2) > 0) ? 1 : -1; + Projectile.localAI[0] = Main.rand.NextFloat(0.8f) + 0.8f; + Projectile.direction = Main.rand.NextBool() ? 1 : -1; } - Projectile.rotation = Projectile.localAI[1] / 20f * 6.28318548f * (float)Projectile.direction; + Projectile.rotation = Projectile.localAI[1] / 20f * MathHelper.TwoPi * Projectile.direction; if (Projectile.alpha > 0) { - Projectile.alpha -= 8; - } - if (Projectile.alpha < 0) - { - Projectile.alpha = 0; + Projectile.alpha -= 16; + if (Projectile.alpha < 0) + Projectile.alpha = 0; } if (Projectile.alpha == 0) - { - Lighting.AddLight(Projectile.Center, newColor2.ToVector3() * 0.5f); - } - int dustCount; - for (int i = 0; i < 2; i = dustCount + 1) + Lighting.AddLight(Projectile.Center, colorToUse.ToVector3() * 0.5f); + + for (int i = 0; i < 2; i++) { if (Main.rand.NextBool(10)) { - Vector2 silvaDustVel = Vector2.UnitY.RotatedBy((double)((float)i * 3.14159274f), default).RotatedBy((double)Projectile.rotation, default); - Dust silvaDust = Main.dust[Dust.NewDust(Projectile.Center, 0, 0, DustID.RainbowMk2, 0f, 0f, 225, newColor2, 1.5f)]; + Vector2 silvaDustVel = Vector2.UnitY.RotatedBy(i * MathHelper.Pi + Projectile.rotation) * 2.5f; + Dust silvaDust = Dust.NewDustPerfect(Projectile.Center, DustID.RainbowMk2, silvaDustVel, 225, colorToUse, Projectile.Opacity * Projectile.localAI[0]); silvaDust.noGravity = true; silvaDust.noLight = true; - silvaDust.scale = Projectile.Opacity * Projectile.localAI[0]; - silvaDust.position = Projectile.Center; - silvaDust.velocity = silvaDustVel * 2.5f; } - dustCount = i; - } - for (int j = 0; j < 2; j = dustCount + 1) - { if (Main.rand.NextBool(10)) { - Vector2 silvaDustVel2 = Vector2.UnitY.RotatedBy((double)((float)j * 3.14159274f), default); - Dust silvaDust2 = Main.dust[Dust.NewDust(Projectile.Center, 0, 0, DustID.RainbowMk2, 0f, 0f, 225, newColor2, 1.5f)]; + Vector2 silvaDustVel2 = Vector2.UnitY.RotatedBy(i * MathHelper.Pi) * 2.5f; + Dust silvaDust2 = Dust.NewDustPerfect(Projectile.Center, DustID.RainbowMk2, silvaDustVel2, 225, colorToUse, Projectile.Opacity * Projectile.localAI[0]); silvaDust2.noGravity = true; silvaDust2.noLight = true; - silvaDust2.scale = Projectile.Opacity * Projectile.localAI[0]; - silvaDust2.position = Projectile.Center; - silvaDust2.velocity = silvaDustVel2 * 2.5f; } - dustCount = j; } if (Main.rand.NextBool(10)) { - float dustVelMod = 1f + Main.rand.NextFloat() * 2f; - float fadeIn = 1f + Main.rand.NextFloat(); - float dustScale = 1f + Main.rand.NextFloat(); - Vector2 randVector = Utils.RandomVector2(Main.rand, -1f, 1f); - if (randVector != Vector2.Zero) - { - randVector.Normalize(); - } - randVector *= 20f + Main.rand.NextFloat() * 100f; + float dustVelMod = Main.rand.NextFloat(1f, 3f); + float fadeIn = Main.rand.NextFloat(1f, 2f); + float dustScale = Main.rand.NextFloat(1f, 2f); + Vector2 randVector = Main.rand.NextVector2Circular(1f, 1f).SafeNormalize(Vector2.Zero) * Main.rand.NextFloat(20, 120f); + Vector2 dustPos = Projectile.Center + randVector; Point dustCoords = dustPos.ToTileCoordinates(); - bool shouldSpawnDust = true; - if (!WorldGen.InWorld(dustCoords.X, dustCoords.Y, 0)) + if (WorldGen.InWorld(dustCoords.X, dustCoords.Y) && !WorldGen.SolidTile(dustCoords.X, dustCoords.Y)) { - shouldSpawnDust = false; - } - if (shouldSpawnDust && WorldGen.SolidTile(dustCoords.X, dustCoords.Y)) - { - shouldSpawnDust = false; - } - if (shouldSpawnDust) - { - Dust rainbowDust = Main.dust[Dust.NewDust(dustPos, 0, 0, DustID.RainbowMk2, 0f, 0f, 127, newColor2, 1f)]; + Dust rainbowDust = Dust.NewDustPerfect(dustPos, DustID.RainbowMk2, -Vector2.UnitY * Main.rand.NextFloat(1.6f, 7.5f), 127, colorToUse, dustScale); rainbowDust.noGravity = true; - rainbowDust.position = dustPos; - rainbowDust.velocity = -Vector2.UnitY * dustVelMod * (Main.rand.NextFloat() * 0.9f + 1.6f); rainbowDust.fadeIn = fadeIn; - rainbowDust.scale = dustScale; rainbowDust.noLight = true; + Dust rainbowDust2 = Dust.CloneDust(rainbowDust); - Dust dust = rainbowDust2; - dust.scale *= 0.65f; - dust = rainbowDust2; - dust.fadeIn *= 0.65f; + rainbowDust2.scale *= 0.65f; + rainbowDust2.fadeIn *= 0.65f; rainbowDust2.color = new Color(255, 255, 255, 255); } } Projectile.scale = Projectile.Opacity / 2f * Projectile.localAI[0]; Projectile.velocity = Vector2.Zero; - Projectile.localAI[1] += 1f; - if (Projectile.localAI[1] >= 30f) - { - Projectile.Kill(); - } - } - public override bool PreDraw(ref Color lightColor) - { - Color colorArea = Lighting.GetColor((int)((double)Projectile.position.X + (double)Projectile.width * 0.5) / 16, (int)(((double)Projectile.position.Y + (double)Projectile.height * 0.5) / 16.0)); - Vector2 projPos = Projectile.position + new Vector2((float)Projectile.width, (float)Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; - Texture2D texture2D34 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Rectangle rectangular = texture2D34.Frame(1, Main.projFrames[Type], 0, Projectile.frame); - Color colorAlpha = Projectile.GetAlpha(colorArea); - Vector2 halfRectangle = rectangular.Size() / 2f; - Color projColor = Main.hslToRgb(Projectile.ai[0], 1f, 0.5f).MultiplyRGBA(new Color(255, 255, 255, 0)); - Main.EntitySpriteDraw(texture2D34, projPos, new Microsoft.Xna.Framework.Rectangle?(rectangular), projColor, Projectile.rotation, halfRectangle, Projectile.scale * 2f, SpriteEffects.None, 0); - Main.EntitySpriteDraw(texture2D34, projPos, new Microsoft.Xna.Framework.Rectangle?(rectangular), projColor, 0f, halfRectangle, Projectile.scale * 2f, SpriteEffects.None, 0); - if (Projectile.ai[1] != -1f && Projectile.Opacity > 0.3f) - { - Vector2 projDirection = Main.projectile[(int)Projectile.ai[1]].Center - Projectile.Center; - Vector2 projDistance = new Vector2(1f, projDirection.Length() / (float)texture2D34.Height); - float drawRotation = projDirection.ToRotation() + 1.57079637f; - float colorClamp = MathHelper.Distance(15f, Projectile.localAI[1]) / 20f; - colorClamp = MathHelper.Clamp(colorClamp, 0f, 1f); - if (colorClamp > 0f) - { - Main.EntitySpriteDraw(texture2D34, projPos + projDirection / 2f, new Microsoft.Xna.Framework.Rectangle?(rectangular), projColor * colorClamp, drawRotation, halfRectangle, projDistance, SpriteEffects.None, 0); - Main.EntitySpriteDraw(texture2D34, projPos + projDirection / 2f, new Microsoft.Xna.Framework.Rectangle?(rectangular), colorAlpha * colorClamp, drawRotation, halfRectangle, projDistance / 2f, SpriteEffects.None, 0); - } - } - return false; + Projectile.localAI[1] += 1f; + if (Projectile.localAI[1] >= 15f) + Projectile.Kill(); } public override void OnKill(int timeLeft) { - Vector2 spinningpoint = new Vector2(0f, -3f).RotatedByRandom(3.1415927410125732); - float rando = (float)Main.rand.Next(7, 13); - Vector2 dustVel = new Vector2(2.1f, 2f); + Vector2 spinningpoint = -Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * 3f; + int rando = Main.rand.Next(7, 12+1); + Vector2 dustVel = new Vector2(2.1f, 2f) * Main.rand.NextFloat(0.8f, 1.2f); Color newColor = Main.hslToRgb(Projectile.ai[0], 1f, 0.5f); newColor.A = 255; - float dustCount; - for (float i = 0f; i < rando; i = dustCount + 1f) + + for (int i = 0; i < rando; i++) { - int dustID = Dust.NewDust(Projectile.Center, 0, 0, DustID.RainbowMk2, 0f, 0f, 0, newColor, 1f); - Main.dust[dustID].position = Projectile.Center; - Main.dust[dustID].velocity = spinningpoint.RotatedBy((double)(6.28318548f * i / rando), default) * dustVel * (0.8f + Main.rand.NextFloat() * 0.4f); - Main.dust[dustID].noGravity = true; - Main.dust[dustID].scale = 2f; - Main.dust[dustID].fadeIn = Main.rand.NextFloat() * 2f; + Dust dustID = Dust.NewDustPerfect(Projectile.Center, DustID.RainbowMk2, spinningpoint.RotatedBy(MathHelper.TwoPi * i / rando) * dustVel, 0, newColor, 2f); + dustID.noGravity = true; + dustID.fadeIn = Main.rand.NextFloat() * 2f; + Dust dustCloning = Dust.CloneDust(dustID); - Dust dust = dustCloning; - dust.scale /= 2f; - dust = dustCloning; - dust.fadeIn /= 2f; - dustCloning.color = new Color(255, 255, 255, 255); - dustCount = i; + dustCloning.scale /= 2f; + dustCloning.fadeIn /= 2f; + dustCloning.color = Color.White; } - for (float j = 0f; j < rando; j = dustCount + 1f) + for (int j = 0; j < rando; j++) { - int dustID = Dust.NewDust(Projectile.Center, 0, 0, DustID.RainbowMk2, 0f, 0f, 0, newColor, 1f); - Main.dust[dustID].position = Projectile.Center; - Main.dust[dustID].velocity = spinningpoint.RotatedBy((double)(6.28318548f * j / rando), default) * dustVel * (0.8f + Main.rand.NextFloat() * 0.4f); - Dust dust = Main.dust[dustID]; - dust.velocity *= Main.rand.NextFloat() * 0.8f; - Main.dust[dustID].noGravity = true; - Main.dust[dustID].scale = Main.rand.NextFloat() * 1f; - Main.dust[dustID].fadeIn = Main.rand.NextFloat() * 2f; + Dust dustID = Dust.NewDustPerfect(Projectile.Center, DustID.RainbowMk2, spinningpoint.RotatedBy(MathHelper.TwoPi * j / rando) * dustVel * Main.rand.NextFloat(0.8f), 0, newColor, Main.rand.NextFloat()); + dustID.noGravity = true; + dustID.fadeIn = Main.rand.NextFloat() * 2f; + Dust dustCloning2 = Dust.CloneDust(dustID); - dust = dustCloning2; - dust.scale /= 2f; - dust = dustCloning2; - dust.fadeIn /= 2f; - dustCloning2.color = new Color(255, 255, 255, 255); - dustCount = j; + dustCloning2.scale /= 2f; + dustCloning2.fadeIn /= 2f; + dustCloning2.color = Color.White; } if (Main.myPlayer == Projectile.owner) { Projectile.friendly = true; - int width = Projectile.width; - int height2 = Projectile.height; - int penetrateClone = Projectile.penetrate; - Projectile.position = Projectile.Center; - Projectile.width = Projectile.height = 60; - Projectile.Center = Projectile.position; - Projectile.penetrate = -1; - Projectile.maxPenetrate = -1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; + Projectile.ExpandHitboxBy(60); Projectile.Damage(); - Projectile.penetrate = penetrateClone; - Projectile.position = Projectile.Center; - Projectile.width = width; - Projectile.height = height2; - Projectile.Center = Projectile.position; } } - public override Color? GetAlpha(Color lightColor) + public override Color? GetAlpha(Color lightColor) => new Color(255 - Projectile.alpha, 255 - Projectile.alpha, 255 - Projectile.alpha, 0); + public override bool PreDraw(ref Color lightColor) { - return new Color(255 - Projectile.alpha, 255 - Projectile.alpha, 255 - Projectile.alpha, 0); + Texture2D tex = TextureAssets.Projectile[Type].Value; + Vector2 projPos = Projectile.Center + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; + Color projColor = Main.hslToRgb(Projectile.ai[0], 1f, 0.5f).MultiplyRGBA(new Color(255, 255, 255, 0)); + Vector2 origin = tex.Size() / 2f; + SpriteEffects sp = SpriteEffects.None; + + Main.EntitySpriteDraw(tex, projPos, null, projColor, Projectile.rotation, origin, Projectile.scale * 2f, sp); + Main.EntitySpriteDraw(tex, projPos, null, projColor, 0f, origin, Projectile.scale * 2f, sp); + + if (OwnerCheck != -1f && Projectile.Opacity > 0.3f) + { + Color colorArea = Lighting.GetColor((int)(Projectile.position.X + Projectile.width * 0.5) / 16, (int)((Projectile.position.Y + Projectile.height * 0.5) / 16.0)); + Color colorAlpha = Projectile.GetAlpha(colorArea); + + Vector2 projDirection = Main.projectile[(int)OwnerCheck].Center - Projectile.Center; + Vector2 projDistance = new Vector2(1f, projDirection.Length() / (float)tex.Height); + float drawRotation = projDirection.ToRotation() + MathHelper.PiOver2; + float colorClamp = MathHelper.Clamp(MathHelper.Distance(15f, Projectile.localAI[1]) / 20f, 0f, 1f); + if (colorClamp > 0f) + { + Main.EntitySpriteDraw(tex, projPos + projDirection / 2f, null, projColor * colorClamp, drawRotation, origin, projDistance, sp); + Main.EntitySpriteDraw(tex, projPos + projDirection / 2f, null, colorAlpha * colorClamp, drawRotation, origin, projDistance / 2f, sp); + } + } + return false; } } } diff --git a/Projectiles/Summon/Umbrella/MagicBullet.cs b/Projectiles/Summon/Umbrella/MagicBullet.cs index d65f48bb37..662122d206 100644 --- a/Projectiles/Summon/Umbrella/MagicBullet.cs +++ b/Projectiles/Summon/Umbrella/MagicBullet.cs @@ -49,11 +49,11 @@ namespace CalamityMod.Projectiles.Summon.Umbrella target.AddBuff(BuffID.BetsysCurse, 180); if (!target.ichor) target.AddBuff(BuffID.Ichor, 180); - if (target.Calamity().marked <= 0) + if (target.Calamity().markedForDeath) target.AddBuff(ModContent.BuffType(), 180); - if (target.Calamity().aCrunch <= 0) + if (target.Calamity().armorCrunch) target.AddBuff(ModContent.BuffType(), 180); - if (target.Calamity().wDeath <= 0) + if (target.Calamity().whisperingDeath) target.AddBuff(ModContent.BuffType(), 180); } diff --git a/Projectiles/Summon/Umbrella/MagicBulletBig.cs b/Projectiles/Summon/Umbrella/MagicBulletBig.cs index 4c6080aca4..80d6243fe4 100644 --- a/Projectiles/Summon/Umbrella/MagicBulletBig.cs +++ b/Projectiles/Summon/Umbrella/MagicBulletBig.cs @@ -54,11 +54,11 @@ namespace CalamityMod.Projectiles.Summon.Umbrella target.AddBuff(BuffID.BetsysCurse, 180); if (!target.ichor) target.AddBuff(BuffID.Ichor, 180); - if (target.Calamity().marked <= 0) + if (target.Calamity().markedForDeath) target.AddBuff(ModContent.BuffType(), 180); - if (target.Calamity().aCrunch <= 0) + if (target.Calamity().armorCrunch) target.AddBuff(ModContent.BuffType(), 180); - if (target.Calamity().wDeath <= 0) + if (target.Calamity().whisperingDeath) target.AddBuff(ModContent.BuffType(), 180); } diff --git a/Projectiles/Summon/Urchin.png b/Projectiles/Summon/Urchin.png deleted file mode 100644 index d9f072c4f9..0000000000 Binary files a/Projectiles/Summon/Urchin.png and /dev/null differ diff --git a/Projectiles/Summon/UrchinSpike.cs b/Projectiles/Summon/UrchinSpike.cs deleted file mode 100644 index bb7dd11f81..0000000000 --- a/Projectiles/Summon/UrchinSpike.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Summon -{ - public class UrchinSpike : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - public override void SetStaticDefaults() - { - ProjectileID.Sets.MinionShot[Type] = true; - } - - public override void SetDefaults() - { - Projectile.width = Projectile.height = 6; - Projectile.friendly = true; - Projectile.timeLeft = 600; - Projectile.aiStyle = ProjAIStyleID.Arrow; - Projectile.DamageType = DamageClass.Summon; - } - - public override void AI() - { - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Poisoned, 180); - } -} diff --git a/Projectiles/Summon/UrchinSpike.png b/Projectiles/Summon/UrchinSpike.png deleted file mode 100644 index 0d8e8c9ebf..0000000000 Binary files a/Projectiles/Summon/UrchinSpike.png and /dev/null differ diff --git a/Projectiles/Summon/VictideSeaSnail.cs b/Projectiles/Summon/VictideSeaSnail.cs deleted file mode 100644 index 64a6a06fbe..0000000000 --- a/Projectiles/Summon/VictideSeaSnail.cs +++ /dev/null @@ -1,231 +0,0 @@ -using System; -using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Summon -{ - public class VictideSeaSnail : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - public ref float DustTimer => ref Projectile.localAI[0]; - public ref float FireCooldown => ref Projectile.localAI[1]; - public ref float PeekingOut => ref Projectile.ai[0]; - public ref float PlayerStandStillTimer => ref Projectile.ai[1]; - - public const int frameTime = 6; - public const int timeToStandStillBeforePeekOut = 200; - - public bool CanComePeekOut => !Main.player[Projectile.owner].mount.Active && PlayerStandStillTimer >= timeToStandStillBeforePeekOut || Projectile.frame > 0; - - public override void SetStaticDefaults() - { - ProjectileID.Sets.MinionSacrificable[Type] = true; - Main.projFrames[Type] = 7; - } - - public override void SetDefaults() - { - Projectile.width = Projectile.height = 30; - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.minion = true; - Projectile.minionSlots = 0f; - Projectile.timeLeft = 18000; - Projectile.penetrate = -1; - Projectile.tileCollide = false; - Projectile.timeLeft *= 5; - Projectile.DamageType = DamageClass.Summon; - } - - public override void AI() - { - Player player = Main.player[Projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - - if (!modPlayer.victideSummoner) - { - for (int d = 0; d < 45; d++) - { - Dust dust = Dust.NewDustDirect(new Vector2(Projectile.position.X, Projectile.position.Y + 16f), Projectile.width, Projectile.height - 16, DustID.BubbleBurst_Purple, 0f, 0f, 0, default, 1f); - dust.velocity *= 2f; - dust.scale *= 1.15f; - } - Projectile.active = false; - return; - } - - if (player.dead) - modPlayer.victideSnail = false; - - if (modPlayer.victideSnail) - Projectile.timeLeft = 2; - - //Create a burst of dust as it gets created - DustTimer++; - if (DustTimer <= 3) - { - int dustAmount = Main.rand.Next(40, 50); - for (int d = 0; d < dustAmount; d++) - { - Dust dust = Dust.NewDustDirect(new Vector2(Projectile.position.X, Projectile.position.Y + 16f), Projectile.width, Projectile.height - 16, DustID.BubbleBurst_Purple, 0f, 0f, 0, default, 1f); - dust.velocity *= 2f; - dust.scale *= 1.15f; - } - } - - if (player.velocity.Length() == 0) - { - PlayerStandStillTimer++; - //pop out the shell - if (PlayerStandStillTimer == timeToStandStillBeforePeekOut) - { - DustTimer = 0; - float direction = Main.rand.NextBool() ? 1f : -1f; - Projectile.velocity = new Vector2(Main.rand.NextFloat(4f, 10f) * direction, Main.rand.NextFloat(-6f, 0f)); - } - - Projectile.velocity *= 0.98f; - Projectile.velocity.X *= 0.95f; - Projectile.velocity.Y = Math.Min(Projectile.velocity.Y + 0.1f, 14f); - Projectile.tileCollide = true; - - if (CanComePeekOut) - Projectile.rotation = Projectile.rotation.AngleTowards(0, MathHelper.PiOver4 * 0.14f); - - if (PeekingOut > 0) - { - Projectile.frameCounter++; - if (Projectile.frameCounter > frameTime) - { - Projectile.frameCounter = 0; - Projectile.frame = Math.Min(6, Projectile.frame + 1); - } - } - } - - //Go back, in the shell - if (player.velocity.Length() > 0 && CanComePeekOut) - { - Projectile.frameCounter++; - if (Projectile.frameCounter > frameTime) - { - Projectile.frameCounter = 0; - Projectile.frame--; - } - - if (Projectile.frame == 0) - { - PlayerStandStillTimer = 0f; - } - } - - if (!CanComePeekOut) - { - PeekingOut = 0f; - - if (player.velocity.Length() > 0) - PlayerStandStillTimer = 0f; - - Projectile.velocity = Vector2.Zero; - Projectile.tileCollide = false; - Vector2 desiredPosition = player.Center + Vector2.UnitY * (player.gfxOffY - 60f) * player.gravDir; - //Round the result so it doesn't jitter. - desiredPosition = new Vector2((int)desiredPosition.X, (int)desiredPosition.Y); - - Projectile.rotation += MathHelper.PiOver4 * 0.2f; - - Projectile.Center = Projectile.Center.MoveTowards(desiredPosition, 7f + player.velocity.Length()); - } - - //Fire a projectile - if (Projectile.owner == Main.myPlayer) - { - if (FireCooldown > 0f) - { - FireCooldown--; - return; - } - - bool foundTarget = false; - float maxDist = 300f; - foreach (NPC npc in Main.ActiveNPCs) - { - if (npc.CanBeChasedBy(Projectile, false)) - { - if (Vector2.Distance(Projectile.Center, npc.Center) < maxDist && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, npc.position, npc.width, npc.height)) - { - foundTarget = true; - break; - } - } - } - - if (foundTarget) - { - int projAmt = Main.rand.Next(3, 7); - for (int u = 0; u < projAmt; u++) - { - Vector2 source = new Vector2(Projectile.Center.X - 4f, Projectile.Center.Y); - Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), source, velocity, ModContent.ProjectileType(), Projectile.damage, 1f, Projectile.owner); - } - - SoundEngine.PlaySound(SoundID.Item42, Projectile.position); - FireCooldown = 60f; - } - } - - if ((Projectile.Center - player.Center).Length() > 400) - { - DustTimer = 0; - Projectile.Center = player.Center + Vector2.UnitY * (player.gfxOffY - 60f) * player.gravDir; - PlayerStandStillTimer = 0f; - Projectile.frame = 0; - } - } - - public override bool? CanDamage() => false; - - public override void OnKill(int timeLeft) - { - for (int d = 0; d < 45; d++) - { - Dust dust = Dust.NewDustDirect(new Vector2(Projectile.position.X, Projectile.position.Y + 16f), Projectile.width, Projectile.height - 16, DustID.BubbleBurst_Purple, 0f, 0f, 0, default, 1f); - dust.velocity *= 2f; - dust.scale *= 1.15f; - } - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - //Touches the ground - if (oldVelocity.Y >= 0) - { - PeekingOut = 1f; - } - return false; - } - - public override bool PreDraw(ref Color lightColor) - { - Player owner = Main.player[Projectile.owner]; - - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Rectangle frame = new Rectangle(0, 36 * Projectile.frame, 38, 34); - Vector2 origin = !CanComePeekOut ? new Vector2(15, 23) : frame.Size() / 2f; - - //Look at the player - SpriteEffects flipperoni = Math.Sign(Projectile.position.X - owner.position.X) > 0 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, origin, Projectile.scale, flipperoni, 0); - - return false; - } - } -} diff --git a/Projectiles/Summon/VileFeederSummon.cs b/Projectiles/Summon/VileFeederSummon.cs index 5c57c0fb08..8c6d8b632a 100644 --- a/Projectiles/Summon/VileFeederSummon.cs +++ b/Projectiles/Summon/VileFeederSummon.cs @@ -40,16 +40,6 @@ namespace CalamityMod.Projectiles.Summon Projectile.localNPCHitCooldown = 60; } - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(Projectile.Calamity().lineColor); - } - - public override void ReceiveExtraAI(BinaryReader reader) - { - Projectile.Calamity().lineColor = reader.ReadInt32(); - } - public override void AI() { Player player = Main.player[Projectile.owner]; @@ -57,7 +47,7 @@ namespace CalamityMod.Projectiles.Summon if (spawnDust) { - Projectile.Calamity().lineColor = -1; + Projectile.ai[1] = -1; int dustAmt = 36; for (int d = 0; d < dustAmt; d++) { @@ -116,7 +106,7 @@ namespace CalamityMod.Projectiles.Summon { spawnDust = true; } - int npcIndex = Projectile.Calamity().lineColor; + int npcIndex = (int)Projectile.ai[1]; if (Projectile.localAI[0] >= 600000f) //tryna make it stay on there "forever" without glitching { breakAway = true; @@ -204,7 +194,7 @@ namespace CalamityMod.Projectiles.Summon //let the projectile know it is sticking and the npc it is sticking too Projectile.ai[0] = 3f; - Projectile.Calamity().lineColor = npcIndex; + Projectile.ai[1] = npcIndex; //follow the NPC Projectile.velocity = (npc.Center - Projectile.Center) * 0.75f; @@ -217,7 +207,7 @@ namespace CalamityMod.Projectiles.Summon for (int projIndex = 0; projIndex < Main.maxProjectiles; projIndex++) { Projectile proj = Main.projectile[projIndex]; - if (projIndex != Projectile.whoAmI && proj.active && proj.owner == Main.myPlayer && proj.type == Projectile.type && proj.ai[0] == 3f && proj.Calamity().lineColor == npcIndex) + if (projIndex != Projectile.whoAmI && proj.active && proj.owner == Main.myPlayer && proj.type == Projectile.type && proj.ai[0] == 3f && proj.ai[1] == npcIndex) { array2[projCount++] = new Point(projIndex, proj.timeLeft); if (projCount >= array2.Length) diff --git a/Projectiles/Summon/WaterElementalMinion.cs b/Projectiles/Summon/WaterElementalMinion.cs index 2e5ea2d82f..e04dd72736 100644 --- a/Projectiles/Summon/WaterElementalMinion.cs +++ b/Projectiles/Summon/WaterElementalMinion.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Summon bool isMinion = Projectile.type == ModContent.ProjectileType(); Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.sirenWaifu && !modPlayer.allWaifus && !modPlayer.sirenWaifuVanity && !modPlayer.allWaifusVanity) + if (!modPlayer.waterElemental && !modPlayer.allElementals && !modPlayer.waterElementalVanity && !modPlayer.allElementalsVanity) { Projectile.active = false; return; @@ -49,9 +49,9 @@ namespace CalamityMod.Projectiles.Summon { if (player.dead) { - modPlayer.slWaifu = false; + modPlayer.waterEleBuff = false; } - if (modPlayer.slWaifu) + if (modPlayer.waterEleBuff) { Projectile.timeLeft = 2; } @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Summon } dust--; } - bool passive = modPlayer.sirenWaifuVanity || modPlayer.allWaifusVanity; + bool passive = modPlayer.waterElementalVanity || modPlayer.allElementalsVanity; if (!passive) Lighting.AddLight(Projectile.Center, 0f, 0.25f, 1.5f); diff --git a/Projectiles/Typeless/BatholithBangleProjectile.cs b/Projectiles/Typeless/BatholithBangleProjectile.cs index 8cb026e4c2..7c9026b3c8 100644 --- a/Projectiles/Typeless/BatholithBangleProjectile.cs +++ b/Projectiles/Typeless/BatholithBangleProjectile.cs @@ -127,17 +127,6 @@ namespace CalamityMod.Projectiles.Typeless float launchPower = 9; target.MoveNPC(launchVel, launchPower, true); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - bool hasCD = Owner.Calamity().cooldowns.TryGetValue(GenericBandCooldown.ID, out CooldownInstance bandCD); - - if ((damageDone <= 2 || (target.life <= 0 && target.realLife == -1)) && Owner.Calamity().generalBandCooldown > BatholithBangle.cooldown / 2) - { - Owner.Calamity().generalBandCooldown -= BatholithBangle.cooldown / 2; - if (hasCD) - bandCD.timeLeft -= BatholithBangle.cooldown / 2; - } - } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.width * 0.5f, targetHitbox); public override bool? CanDamage() { diff --git a/Projectiles/Typeless/BloomStoneFlower.cs b/Projectiles/Typeless/BloomStoneFlower.cs index 596a08d25f..80e590b0d6 100644 --- a/Projectiles/Typeless/BloomStoneFlower.cs +++ b/Projectiles/Typeless/BloomStoneFlower.cs @@ -1,6 +1,9 @@ -using CalamityMod.Dusts; +using System; +using System.Collections.Generic; +using CalamityMod.Dusts; using CalamityMod.Particles; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -15,57 +18,86 @@ namespace CalamityMod.Projectiles.Typeless public ref float HookIndex => ref Projectile.ai[0]; public ref float FlowerPart => ref Projectile.ai[1]; + + public ref float timer => ref Projectile.ai[2]; + public float fadeTime = 0; + public bool fadeOut = false; + public int maxTime = 5; public override void SetDefaults() { Projectile.width = Projectile.height = 30; - Projectile.scale = 1.2f; + Projectile.scale = 1f; Projectile.friendly = true; Projectile.tileCollide = false; Projectile.ignoreWater = true; - Projectile.timeLeft = 300; + Projectile.timeLeft = 150; } public override void AI() { + if (timer == 0) + Projectile.rotation = Main.rand.NextFloat(0, MathHelper.TwoPi); switch (FlowerPart) { case 0: Projectile hook = Main.projectile[(int)HookIndex]; if (!(hook.active && hook.aiStyle == ProjAIStyleID.Hook && hook.ai[0] == 2f)) { - Projectile.Kill(); - return; + fadeOut = true; } + float sine = (float)Math.Sin(timer * 0.01f); + Projectile.rotation += fadeTime * sine * 0.005f; + if (Projectile.scale > 1) + Projectile.scale = MathHelper.Lerp(Projectile.scale, 1, 0.15f); - Projectile.timeLeft = 5; - if (Vector2.DistanceSquared(Projectile.Center, Main.player[Projectile.owner].Center) < 1024f) + Projectile.timeLeft++; + if (!fadeOut && Vector2.DistanceSquared(Projectile.Center, Main.player[Projectile.owner].Center) < 4096f) { SoundEngine.PlaySound(SoundID.Item60, Projectile.Center); if (Main.myPlayer == Projectile.owner) { - for (int i = 0; i < 5; i++) - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Main.rand.NextVector2Circular(4f, 4f), Type, 0, 0f, Projectile.owner, 0f, 1f); + int dusts = 6; + int dir = Main.rand.NextBool() ? -1 : 1; + for (int i = 0; i < dusts; i++) + { + Projectile pollen = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, (MathHelper.TwoPi / dusts * i).ToRotationVector2() * 3f, Type, 0, 0f, Projectile.owner, 0f, 1f); + pollen.localAI[0] = dir; + } + } - Projectile.Kill(); + fadeOut = true; + Projectile.scale = 2.5f; } + if ((fadeOut && Projectile.scale <= 1.05f) || (!fadeOut && fadeTime < maxTime)) + fadeTime += (fadeOut ? -0.2f : 1); + + if (fadeTime < 0 && fadeOut) + Projectile.Kill(); break; case 1: + if (timer == 0) + { + Projectile.scale = 1.8f; + Projectile.extraUpdates = 1; + } if (Projectile.width < 90) Projectile.ExpandHitboxBy(90); - Projectile.velocity *= 0.98f; - + Projectile.velocity = Projectile.velocity.RotatedBy(0.04f * Projectile.localAI[0]) * 1.001f; + Color mistColor = Color.Lerp(Color.HotPink, Color.Gold, Utils.GetLerpValue(100, 0, Projectile.timeLeft, true)); // Visual effect - if (Projectile.timeLeft % 10 == 0) + if (Projectile.timeLeft % 4 == 0) { - MediumMistParticle pollenCloud = new(Projectile.Center, Main.rand.NextVector2Circular(1f, 1f), Color.Yellow, Color.Gold, 3f, 100f); + MediumMistParticle pollenCloud = new(Projectile.Center, Main.rand.NextVector2Circular(1f, 1f), mistColor, mistColor, 3f * Projectile.scale, 100f); GeneralParticleHandler.SpawnParticle(pollenCloud); } if (Projectile.timeLeft % 4 == 0) { - Dust pollenDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), newColor: Color.Gold, Scale: 0.6f); + Dust pollenDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), newColor: mistColor, Scale: 0.6f * Projectile.scale); pollenDust.noLightEmittence = true; pollenDust.noGravity = true; } + if (Projectile.scale > 0.7f) + Projectile.scale -= 0.025f; // Check for buffing Player owner = Main.player[Projectile.owner]; @@ -75,12 +107,44 @@ namespace CalamityMod.Projectiles.Typeless continue; if (Projectile.Hitbox.Intersects(p.Hitbox)) - p.Calamity().bloomStoneDR = 360; + p.Calamity().bloomStoneBuffedHealRateTimer = 360; } + fadeTime++; break; } + timer++; } - public override bool PreDraw(ref Color lightColor) => FlowerPart == 0f; + public override bool PreDraw(ref Color lightColor) + { + if (FlowerPart == 0f) + { + Texture2D tex2 = ModContent.Request("CalamityMod/Particles/BigHeart").Value; + Texture2D tex = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + + int parts = 5; + float rot = 0; + float scaleFade = (float)Math.Pow(Utils.GetLerpValue(0, maxTime, fadeTime, true), 2); + for (int b = 0; b < 3; b++) + { + Color drawColor = Color.Lerp(Color.HotPink, Color.Plum, b * 0.3f) with { A = 0 }; + float scaleMult = (1 - 0.15f * b) * scaleFade; + for (int i = 0; i < parts; i++) + { + Vector2 vel = (MathHelper.TwoPi * i / parts).ToRotationVector2(); + Main.EntitySpriteDraw(tex2, Projectile.Center - Main.screenPosition + vel.RotatedBy(Projectile.rotation * (float)Math.Pow(1.5f - scaleMult, 2) + rot) * 35 * scaleMult, null, drawColor * 0.3f, Projectile.rotation * (float)Math.Pow(1.5f - scaleMult, 2) + vel.ToRotation() + MathHelper.PiOver2 + rot, tex2.Size() / 2f, new Vector2(0.9f, 1.5f) * Projectile.scale * 0.15f * scaleMult, SpriteEffects.None, 0); + } + rot += MathHelper.PiOver4 * 0.5f; + } + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Color.Gold with { A = 0 }, Projectile.rotation, tex.Size() / 2f, Projectile.scale * 0.45f * scaleFade, SpriteEffects.None, 0); + + return false; + } + else return false; + } + public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) + { + overPlayers.Add(index); + } } } diff --git a/Projectiles/Typeless/BlunderBoosterAura.cs b/Projectiles/Typeless/BlunderBoosterAura.cs index 440c655f07..a083ecbb2e 100644 --- a/Projectiles/Typeless/BlunderBoosterAura.cs +++ b/Projectiles/Typeless/BlunderBoosterAura.cs @@ -66,23 +66,9 @@ namespace CalamityMod.Projectiles.Typeless } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 180); - - if (target.knockBackResist <= 0f) - return; - - // 12AUG2023: Ozzatron: TML was giving NaN knockback, probably due to 0 base knockback. Do not use hit.Knockback - if (CalamityGlobalNPC.ShouldAffectNPC(target)) - { - float knockbackMultiplier = MathHelper.Clamp(1f - target.knockBackResist, 0f, 1f); - Vector2 trueKnockback = target.Center - Projectile.Center; - trueKnockback.Normalize(); - target.velocity = trueKnockback * knockbackMultiplier; - } - } - + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); + // CIT 2MAY2025: Replaced old manual knockback code with setting HitDirectionOverride + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.HitDirectionOverride = (target.Center.X > Projectile.Center.X).ToDirectionInt(); public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Typeless/CryonicShield.cs b/Projectiles/Typeless/CryonicShield.cs index 78a369f2b2..c07289dd98 100644 --- a/Projectiles/Typeless/CryonicShield.cs +++ b/Projectiles/Typeless/CryonicShield.cs @@ -57,27 +57,14 @@ namespace CalamityMod.Projectiles.Typeless public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { Player player = Main.player[Projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - - if (!modPlayer.CryoStoneVanity) + if (!player.Calamity().CryoStoneVanity) { target.AddBuff(BuffID.Frostburn2, 180); target.AddBuff(ModContent.BuffType(), 30); - - if (target.knockBackResist <= 0f) - return; - - // 12AUG2023: Ozzatron: TML was giving NaN knockback, probably due to 0 base knockback. Do not use hit.Knockback - if (CalamityGlobalNPC.ShouldAffectNPC(target)) - { - float knockbackMultiplier = MathHelper.Clamp(1f - target.knockBackResist, 0f, 1f); - Vector2 trueKnockback = target.Center - Projectile.Center; - trueKnockback.Normalize(); - target.velocity = trueKnockback * knockbackMultiplier; - } } } - + // CIT 2MAY2025: Replaced old manual knockback code with setting HitDirectionOverride + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.HitDirectionOverride = (target.Center.X > Projectile.Center.X).ToDirectionInt(); public override void OnHitPlayer(Player target, Player.HurtInfo info) { Player player = Main.player[Projectile.owner]; diff --git a/Projectiles/Typeless/DirectStrike.cs b/Projectiles/Typeless/DirectStrike.cs index fd9cb07627..e56d3cd89a 100644 --- a/Projectiles/Typeless/DirectStrike.cs +++ b/Projectiles/Typeless/DirectStrike.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Typeless } // If the target is moving VERY fast, direct strikes spawned on top of them can actually miss - // Setting a target will gaurentee hits on said target by teleporting the projectile onto them every frame + // Setting a target will guarantee hits on said target by teleporting the projectile onto them every frame if (!invalidTarget) Projectile.Center = Main.npc[(int)Projectile.ai[0]].Center; } diff --git a/Projectiles/Typeless/NanoFlare.cs b/Projectiles/Typeless/NanoFlare.cs index 7d3096428b..cbe942d302 100644 --- a/Projectiles/Typeless/NanoFlare.cs +++ b/Projectiles/Typeless/NanoFlare.cs @@ -24,14 +24,12 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { - //Dust for (int i = 0; i < 3; i++) { - int dint = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.TerraBlade, 0f, 0f, 0, default, 0.75f); - Dust dust = Main.dust[dint]; - dust.velocity = Projectile.velocity * Main.rand.NextFloat(-0.3f, 0.3f); - dust.color = Main.hslToRgb((float)(0.40000000596046448 + Main.rand.NextDouble() * 0.20000000298023224), 0.9f, 0.5f); - dust.color = Color.Lerp(dust.color, Color.White, 0.3f); + Dust dint = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.TerraBlade, 0f, 0f, Scale: 0.75f); + dint.velocity = Projectile.velocity * Main.rand.NextFloat(-0.3f, 0.3f); + dint.color = Main.hslToRgb(Main.rand.NextFloat(0.2f, 0.6f), 0.9f, 0.5f); + dint.color = Color.Lerp(dint.color, Color.White, 0.3f); } } @@ -40,25 +38,15 @@ namespace CalamityMod.Projectiles.Typeless for (int i = 0; i < 20; i++) { Vector2 dspeed = new Vector2(Main.rand.NextFloat(-4f, 4f), Main.rand.NextFloat(-6f, 6f)); - int dint = Dust.NewDust(Projectile.Center, 1, 1, DustID.TerraBlade, dspeed.X, dspeed.Y, 0, default, 0.7f); - Dust dust = Main.dust[dint]; - dust.color = Main.hslToRgb((float)(0.40000000596046448 + Main.rand.NextDouble() * 0.20000000298023224), 0.9f, 0.5f); + Dust dust = Dust.NewDustDirect(Projectile.Center, 1, 1, DustID.TerraBlade, dspeed.X, dspeed.Y, 0, default, 0.7f); + dust.color = Main.hslToRgb(Main.rand.NextFloat(0.2f, 0.6f), 0.9f, 0.5f); dust.color = Color.Lerp(dust.color, Color.White, 0.3f); } SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2); - Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2); - Projectile.width = 60; - Projectile.height = 60; - Projectile.maxPenetrate = -1; - Projectile.penetrate = -1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.Damage(); if (!Main.dedServ) { - Vector2 goreVec = new Vector2(Projectile.position.X + (float)(Projectile.width / 2) - 24f, Projectile.position.Y + (float)(Projectile.height / 2) - 24f); + Vector2 goreVec = new Vector2(Projectile.Center.X - 24f, Projectile.Center.Y - 24f); float smokeScale = 0.66f; for (int i = 0; i < 2; i++) { diff --git a/Projectiles/Typeless/ProtolithBangleProjectile.cs b/Projectiles/Typeless/ProtolithBangleProjectile.cs index ca833e6d43..10fa2d402d 100644 --- a/Projectiles/Typeless/ProtolithBangleProjectile.cs +++ b/Projectiles/Typeless/ProtolithBangleProjectile.cs @@ -115,17 +115,6 @@ namespace CalamityMod.Projectiles.Typeless float launchPower = 6; target.MoveNPC(launchVel, launchPower, true); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - bool hasCD = Owner.Calamity().cooldowns.TryGetValue(GenericBandCooldown.ID, out CooldownInstance bandCD); - - if ((damageDone <= 2 || (target.life <= 0 && target.realLife == -1)) && Owner.Calamity().generalBandCooldown > ProtolithBangle.cooldown / 2) - { - Owner.Calamity().generalBandCooldown -= ProtolithBangle.cooldown / 2; - if (hasCD) - bandCD.timeLeft -= ProtolithBangle.cooldown / 2; - } - } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.width * 0.5f * Projectile.scale, targetHitbox); public override bool? CanDamage() { diff --git a/Projectiles/Typeless/ReaverOrb.cs b/Projectiles/Typeless/ReaverOrb.cs deleted file mode 100644 index e2557bb25b..0000000000 --- a/Projectiles/Typeless/ReaverOrb.cs +++ /dev/null @@ -1,79 +0,0 @@ -using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Typeless -{ - public class ReaverOrb : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Typeless"; - public int dust = 3; - - public override void SetDefaults() - { - Projectile.width = 48; - Projectile.height = 50; - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.timeLeft = 18000; - Projectile.alpha = 50; - Projectile.penetrate = -1; - Projectile.tileCollide = false; - Projectile.timeLeft *= 5; - } - - public override void AI() - { - bool correctMinion = Projectile.type == ModContent.ProjectileType(); - Player player = Main.player[Projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.reaverExplore) - { - Projectile.active = false; - return; - } - if (correctMinion) - { - if (player.dead) - { - modPlayer.rOrb = false; - } - if (modPlayer.rOrb) - { - Projectile.timeLeft = 2; - } - } - dust--; - if (dust >= 0) - { - int dustAmt = 50; - for (int d = 0; d < dustAmt; d++) - { - int idx = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y + 16f), Projectile.width, Projectile.height - 16, DustID.ChlorophyteWeapon, 0f, 0f, 0, default, 1f); - Main.dust[idx].velocity *= 2f; - Main.dust[idx].scale *= 1.15f; - } - } - - Lighting.AddLight(Projectile.Center, 0.5f, 2f, 0.5f); - - Projectile.Center = player.Center + Vector2.UnitY * (player.gfxOffY - 60f); - if (player.gravDir == -1f) - { - Projectile.position.Y += 120f; - Projectile.rotation = MathHelper.Pi; - } - else - { - Projectile.rotation = 0f; - } - Projectile.position.X = (int)Projectile.position.X; - Projectile.position.Y = (int)Projectile.position.Y; - } - - public override bool? CanDamage() => false; - } -} diff --git a/Projectiles/Typeless/ReaverOrb.png b/Projectiles/Typeless/ReaverOrb.png deleted file mode 100644 index 4832434cb8..0000000000 Binary files a/Projectiles/Typeless/ReaverOrb.png and /dev/null differ diff --git a/Projectiles/Typeless/TeslaAura.cs b/Projectiles/Typeless/TeslaAura.cs index 9984be55a6..2215e6826c 100644 --- a/Projectiles/Typeless/TeslaAura.cs +++ b/Projectiles/Typeless/TeslaAura.cs @@ -67,19 +67,9 @@ namespace CalamityMod.Projectiles.Typeless { target.AddBuff(ModContent.BuffType(), 90); target.AddBuff(ModContent.BuffType(), 6); - - if (target.knockBackResist <= 0f) - return; - - // 07AUG2023: Ozzatron: TML was giving NaN knockback, probably due to 0 base knockback. Do not use hit.Knockback - if (CalamityGlobalNPC.ShouldAffectNPC(target)) - { - float knockbackMultiplier = MathHelper.Clamp(1f - target.knockBackResist, 0f, 1f); - Vector2 trueKnockback = target.Center - Projectile.Center; - trueKnockback.Normalize(); - target.velocity = trueKnockback * knockbackMultiplier; - } } + // CIT 2MAY2025: Replaced old manual knockback code with setting HitDirectionOverride + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.HitDirectionOverride = (target.Center.X > Projectile.Center.X).ToDirectionInt(); public override void OnHitPlayer(Player target, Player.HurtInfo info) { diff --git a/Projectiles/Typeless/VictideBarrier.cs b/Projectiles/Typeless/VictideBarrier.cs new file mode 100644 index 0000000000..181ab8790b --- /dev/null +++ b/Projectiles/Typeless/VictideBarrier.cs @@ -0,0 +1,242 @@ +using System; +using System.Collections.Generic; +using CalamityMod.Cooldowns; +using CalamityMod.Items.Armor.Victide; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; +using static CalamityMod.CalamityUtils; + +namespace CalamityMod.Projectiles.Typeless +{ + public class VictideBarrier : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public static readonly SoundStyle ExplosionSound = new("CalamityMod/Sounds/Custom/BubblyBurst"); + + public static float ExplosionLifetime = 24f; + public static float MaxScale = 6f; + + public static float DashSpeed = 24f; // 24 tiles + public static float DashLifetime = 16f; + public static int DashSlamIFrames = 12; + private List NPCsHitBySlam = new List() { -1 }; + + public ref float ExplodeTimer => ref Projectile.ai[0]; + public ref float DashTimer => ref Projectile.ai[1]; + public ref float HealTimer => ref Projectile.ai[2]; + public Player Owner => Main.player[Projectile.owner]; + + public static Asset Shine; + public static Asset Explosion; + public override void Load() + { + Shine = ModContent.Request("CalamityMod/Particles/SemiCircularSmearSwipe"); + Explosion = ModContent.Request("CalamityMod/Particles/SoftRoundExplosion"); + } + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 20; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.penetrate = -1; + Projectile.timeLeft = (int)ExplosionLifetime; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + + public override void AI() + { + Projectile.rotation = MathHelper.ToRadians(Main.GlobalTimeWrappedHourly * 36f); + + if (ExplodeTimer > 0f) + { + float scaleLevel = PiecewiseAnimation(ExplodeTimer / ExplosionLifetime, new CurveSegment[] { new CurveSegment(EasingType.PolyOut, 0f, 0f, 1f, 4) }); + Projectile.scale = MathHelper.Lerp(1f, MaxScale, scaleLevel); + Projectile.Opacity = MathF.Sin(MathHelper.PiOver2 + MathHelper.PiOver2 * ExplodeTimer / ExplosionLifetime); + + if (ExplodeTimer == 1f) + { + SoundEngine.PlaySound(ExplosionSound, Projectile.Center); + + for (int i = 0; i < 5; i++) + { + Vector2 velocity = (MathHelper.TwoPi * i / 5f).ToRotationVector2() * Main.rand.NextFloat(10f, 12f) * (i % 2 == 0 ? 0.88f : 1f); + Particle bub = new VelChangingSpark(Projectile.Center, velocity.RotatedByRandom(MathHelper.Pi / 10f), Vector2.UnitY * -6f, "CalamityMod/Particles/BloomRing", Main.rand.Next(36, 42 + 1), Main.rand.NextFloat(0.1f, 0.25f), Main.rand.NextBool(3) ? Color.HotPink : Color.Turquoise, Vector2.One, shrinkSpeed: 0.08f); + GeneralParticleHandler.SpawnParticle(bub); + } + } + + if (ExplodeTimer == 6f) + { + for (int i = 0; i < 8; i++) + { + Vector2 smokeVelocity = Vector2.UnitX.RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat(2.5f, 5.5f); + float smokeScale = Main.rand.NextFloat(1.6f, 2f); + Particle smoke = new HeavySmokeParticle(Projectile.Center, smokeVelocity, Color.PaleTurquoise, 18, smokeScale, 0.25f, Main.rand.NextFloat(-0.1f, 0.1f), true); + GeneralParticleHandler.SpawnParticle(smoke); + } + } + + ExplodeTimer++; + } + else if (DashTimer > 0f) + { + Owner.mount?.Dismount(Owner); + Owner.RemoveAllGrapplingHooks(); + + Owner.velocity = Projectile.velocity; + Owner.ChangeDir(Math.Sign(Projectile.velocity.X) <= 0 ? -1 : 1); + + // Move the player to the projectile, allowing them to bypass platforms (but not tiles) + Owner.Center = Projectile.Center; + + // Custom ram effect, similar to the one used in CalamityPlayerDashEffects + Rectangle hitArea = new Rectangle((int)(Owner.position.X + Owner.velocity.X * 0.5 - 4f), (int)(Owner.position.Y + Owner.velocity.Y * 0.5 - 4), Owner.width + 8, Owner.height + 8); + foreach (NPC n in Main.ActiveNPCs) + { + // Ignore critters with the Guide to Critter Companionship + if (Owner.dontHurtCritters && NPCID.Sets.CountsAsCritter[n.type]) + continue; + + if (!n.dontTakeDamage && !n.friendly && !NPCsHitBySlam.Contains(n.whoAmI)) + { + if (hitArea.Intersects(n.getRect()) && (n.noTileCollide || Owner.CanHit(n))) + { + Projectile.NewProjectile(Owner.GetSource_FromThis(), n.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, 0f, Owner.whoAmI, n.whoAmI); + Owner.GiveImmuneTimeForCollisionAttack(DashSlamIFrames); + NPCsHitBySlam.Add(n.whoAmI); + } + } + } + + // Dash trail effects + Color trailColor = Color.Lerp(Color.Cyan, Color.RoyalBlue, DashTimer / DashLifetime); + if (DashTimer % 2f == 1f) + { + Particle trail = new CustomSpark(Projectile.Center - Projectile.velocity * 2f, Projectile.velocity * 0.5f, "CalamityMod/Particles/ForwardSmear", false, 12, 0.2f, trailColor, new Vector2(1f, Main.rand.NextFloat(1.2f, 1.35f)), fadeIn: true, extraRotation: MathHelper.ToRadians(180f)); + GeneralParticleHandler.SpawnParticle(trail); + } + for (int direction = -1; direction <= 1; direction += 2) + { + Vector2 sidePos = Projectile.Center - Projectile.velocity * 2f + Projectile.velocity.SafeNormalize(Vector2.Zero).RotatedBy(MathHelper.PiOver2 * direction) * Utils.Remap(DashTimer, 1f, DashLifetime, 48f, 24f); + Particle sideTrail = new CustomSpark(sidePos, Projectile.velocity * 0.5f, "CalamityMod/Particles/BloomCircle", false, 18, 0.3f, trailColor * 0.6f, new Vector2(1f, 2.5f), shrinkSpeed: 0.2f); + GeneralParticleHandler.SpawnParticle(sideTrail); + } + + DashTimer++; + } + else + { + // If the barrier set isn't on, unceremoniously disappear + if (!Owner.Calamity().victideBarrierSet || Owner.dead || !Owner.active) + { + Projectile.Kill(); + Owner.Calamity().victideBarrierHeal = 0; + return; + } + // Set to dash if cooldown is detected and also create an explosion in its place + if (Owner.HasCooldown(WardingWave.ID)) + { + DashTimer++; + Projectile.damage = (int)Owner.GetBestClassDamage().ApplyTo(VictideHeadBarrier.BarrierDamage); + Owner.Calamity().victideBarrierHeal = 0; + if (Projectile.owner == Main.myPlayer) + { + // Set dash velocity + Projectile.velocity = Owner.SafeDirectionTo(Main.MouseWorld) * DashSpeed; + Projectile.tileCollide = true; + + // Spawn explosion + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.MountedCenter, Vector2.Zero, Type, Projectile.damage, VictideHeadBarrier.BarrierExplosionKB, Projectile.owner, 1f); + } + } + + if (Owner.Calamity().victideBarrierHeal > 0) + { + HealTimer++; + if (HealTimer % 10f == 9f) + { + Owner.Calamity().victideBarrierHeal--; + Owner.HealPlayer(1); + } + } + else + HealTimer = 0f; + + Lighting.AddLight(Owner.MountedCenter, Color.White.ToVector3() * 0.5f); + Projectile.Center = Owner.MountedCenter; + Projectile.timeLeft = (int)DashLifetime; + } + } + + public override void OnKill(int timeLeft) + { + if (DashTimer > 0f) + Owner.velocity *= 0.5f; + } + + // Explosion collision only (dash has a custom ram logic check effect) + public override bool? CanDamage() => ExplodeTimer > 0f ? null : false; + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 20f * Projectile.scale, targetHitbox); + + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.HitDirectionOverride = (Owner.Center.X < target.Center.X).ToDirectionInt(); + modifiers.SourceDamage *= Utils.Remap(Projectile.numHits, 0, 10, 1f, 0.1f, true); + } + + public override bool PreDraw(ref Color lightColor) + { + if (DashTimer > 0f) + return false; + + Texture2D explosionTex = Explosion.Value; + Color barrierColor = Main.hslToRgb(0.6f + 0.1f * MathF.Sin(Main.GlobalTimeWrappedHourly * 2f), 1f, 0.5f); + + if (ExplodeTimer > 0f) + { + Main.spriteBatch.EnterShaderRegion(BlendState.Additive); + Vector2 explosionPos = Projectile.Center - Main.screenPosition; + Main.EntitySpriteDraw(explosionTex, explosionPos, null, barrierColor * Projectile.Opacity, Projectile.rotation, explosionTex.Size() * 0.5f, 0.02f * Projectile.scale, SpriteEffects.None); + Main.spriteBatch.ExitShaderRegion(); + return false; + } + + Vector2 drawPos = Owner.Center + Vector2.UnitY * Owner.gfxOffY - Main.screenPosition; + Texture2D circleBase = TextureAssets.Projectile[Type].Value; + Color contrastingColor = Main.hslToRgb(0.6f + 0.1f * MathF.Cos(Main.GlobalTimeWrappedHourly * 2f), 1f, 0.5f); + + // Silly solution to making a clean circle over the player + Main.spriteBatch.EnterShaderRegion(); + GameShaders.Misc["CalamityMod:CircularAoETelegraph"].UseOpacity(0.5f); + GameShaders.Misc["CalamityMod:CircularAoETelegraph"].UseColor(barrierColor); + GameShaders.Misc["CalamityMod:CircularAoETelegraph"].UseSecondaryColor(Color.Transparent); + GameShaders.Misc["CalamityMod:CircularAoETelegraph"].UseSaturation(0f); + GameShaders.Misc["CalamityMod:CircularAoETelegraph"].Apply(); + + Main.EntitySpriteDraw(circleBase, drawPos, null, Color.White, 0f, circleBase.Size() * 0.5f, 80f, SpriteEffects.None); + Main.spriteBatch.ExitShaderRegion(); + + // Give it additional texture + Main.spriteBatch.EnterShaderRegion(BlendState.Additive); + Main.EntitySpriteDraw(explosionTex, drawPos, null, contrastingColor * 0.3f, Projectile.rotation, explosionTex.Size() * 0.5f, 0.04f, SpriteEffects.None); + Texture2D shineTex = Shine.Value; + Main.EntitySpriteDraw(shineTex, drawPos, null, Color.HotPink * 0.5f, MathHelper.ToRadians(36f), shineTex.Size() * 0.5f, 0.45f, SpriteEffects.None); + Main.EntitySpriteDraw(shineTex, drawPos, null, Color.Orange * 0.3f, MathHelper.ToRadians(216f), shineTex.Size() * 0.5f, 0.55f, SpriteEffects.None); + Main.spriteBatch.ExitShaderRegion(); + return false; + } + } +} diff --git a/Projectiles/Typeless/VictideBobber.cs b/Projectiles/Typeless/VictideBobber.cs new file mode 100644 index 0000000000..8c9c4113de --- /dev/null +++ b/Projectiles/Typeless/VictideBobber.cs @@ -0,0 +1,179 @@ +using System; +using CalamityMod.Items; +using CalamityMod.Items.SummonItems; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class VictideBobber : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override string Texture => "CalamityMod/Projectiles/Summon/CnidarianJellyfishOnTheString"; + + public Player Owner => Main.player[Projectile.owner]; + public ref float ParentProjectile => ref Projectile.ai[2]; + public Projectile Parent => Main.projectile[(int)ParentProjectile]; + + public int stuckTimer; + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 20; + Projectile.aiStyle = ProjAIStyleID.Bobber; + Projectile.bobber = true; + } + + public override bool PreAI() + { + // Snap if the snail is shelled, or just nowhere to be found + if (!Parent.active || Owner.ActiveItem().fishingPole <= 0 || Parent == null || Parent.frame < 6) + { + Projectile.Kill(); + return false; + } + return true; + } + + public override void AI() + { + // Automatic reeling + if (Projectile.ai[0] == 0f && Projectile.ai[1] < 0f && Main.rand.NextBool(40)) + { + Projectile.ai[0] = 1f; + Projectile.localAI[0] = 1f; + + // Consume bait as needed + int baitType = Owner.GetFishingConditions().BaitItemType; + int baitSlot = GetBaitSlot(Owner, baitType); + if (baitSlot != -1) + { + Item currentBait = Owner.inventory[baitSlot]; + bool consume = false; + + if (baitType == ItemID.TruffleWorm) + consume = true; + else if (baitType == ItemID.GoldWorm) + consume = Main.rand.NextBool(20); + else + { + float chanceMult = MathF.Max(1f, 1f + currentBait.bait / 6f); + if (Owner.accTackleBox) + chanceMult += 1f; + if (Main.rand.NextFloat() * chanceMult < 1f) + consume = true; + + // Junk (or Quest fish) default to no bait consumption + if (Projectile.localAI[1] > 0f) + { + Item dummyCatch = new Item(); + dummyCatch.SetDefaults((int)Projectile.localAI[1]); + if (dummyCatch.rare < 0) + consume = false; + } + } + if (CombinedHooks.CanConsumeBait(Owner, currentBait).GetValueOrDefault(consume)) + { + if (currentBait.type == ItemID.LadyBug || currentBait.type == ItemID.GoldLadyBug) + NPC.LadyBugKilled(Owner.Center, currentBait.type == ItemID.GoldLadyBug); + + currentBait.stack--; + if (currentBait.stack <= 0) + currentBait.SetDefaults(); + } + } + + // Summon Duke Fishron as this code otherwise only runs on player rod usage + if (baitType == ItemID.TruffleWorm) + { + Projectile.ai[0] = 2f; + CalamityUtils.SpawnBossUsingItem(Owner, NPCID.DukeFishron); + } + // Line snapping behaviour + else if (!Owner.accFishingLine && Main.rand.NextBool(7)) + Projectile.ai[0] = 2f; + // Return back items + else if (Projectile.localAI[1] > 0f) + { + Projectile.ai[1] = Projectile.localAI[1]; + Projectile.localAI[1] = 0f; + } + // Spawn enemies + else if (Projectile.localAI[1] < 0f) + { + int spawnType = (int)(-Projectile.localAI[1]); + Point spawnPos = new Point((int)Projectile.position.X, (int)Projectile.position.Y); + if (spawnType == NPCID.BloodNautilus) + spawnPos.Y += 64; + + if (Main.netMode == NetmodeID.MultiplayerClient) + NetMessage.SendData(MessageID.FishOutNPC, -1, -1, null, spawnPos.X / 16, spawnPos.Y / 16, spawnType); + else + { + Projectile.ai[0] = 2f; + NPC.NewNPC(new EntitySource_FishedOut(Owner), spawnPos.X, spawnPos.Y, spawnType); + + if (spawnType == NPCID.TownSlimeRed) + NPC.unlockedSlimeRedSpawn = true; + WorldGen.CheckAchievement_RealEstateAndTownSlimes(); + } + } + } + + // Anti-stuck auto reelback + if (Projectile.ai[0] == 0f && Projectile.localAI[1] == 0f && Projectile.velocity.Length() <= 0.2f) + { + stuckTimer++; + if (stuckTimer > 60) + Projectile.ai[0] = 1f; + } + } + + public static int GetBaitSlot(Player owner, int baitType) + { + // Ignore Bloodworm as the Old Duke summon method already manually consumes it + if (baitType == ModContent.ItemType()) + return -1; + + // Check ammo slots first + for (int i = 54; i < Main.InventorySlotsTotal; i++) + { + if (owner.inventory[i].type == baitType) + return i; + } + for (int j = 0; j < 54; j++) + { + if (owner.inventory[j].type == baitType) + return j; + } + return -1; + } + + // Anchor the bobber to the parent projectile, since the default is bound to the player + // Yes. This method is obsolete. No, there is no other way and I won't make another IL edit to remedy this fact. - Iris + public override void ModifyFishingLine(ref Vector2 lineOriginOffset, ref Color lineColor) + { + lineColor = Color.Cyan; + if (Parent.active) + { + Vector2 originalPos = Owner.MountedCenter + Vector2.UnitY * (Owner.gfxOffY - (Owner.gravDir == -1 ? 12f : 0f)); + lineOriginOffset = Parent.Center - originalPos + Vector2.UnitY * 13f; + + // How this is a thing is beyond me + lineOriginOffset.X -= 2f; + if (Owner.direction < 0) + lineOriginOffset.X += (Owner.MountedCenter.X - Parent.Center.X) * 2f; + } + } + + public override bool PreDrawExtras() + { + Lighting.AddLight(Projectile.Center, 0f, 0.2f, 0.2f); + return true; + } + } +} diff --git a/Projectiles/Typeless/VictideSeaSnail.cs b/Projectiles/Typeless/VictideSeaSnail.cs new file mode 100644 index 0000000000..94282c071c --- /dev/null +++ b/Projectiles/Typeless/VictideSeaSnail.cs @@ -0,0 +1,264 @@ +using System; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Weapons.Summon; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class VictideSeaSnail : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public ref float DustTimer => ref Projectile.localAI[0]; + public ref float CollisionTimer => ref Projectile.ai[0]; + public ref float PlayerStandStillTimer => ref Projectile.ai[1]; + public ref float PlayerFishingTimer => ref Projectile.ai[2]; + + public const int FrameTime = 6; // Switches frame every 6 frames (10 FPS) + public const int PeekCooldown = 150; + + public Player Owner => Main.player[Projectile.owner]; + public CalamityPlayer ModdedOwner => Owner.Calamity(); + + // Extra requirements so you don't break the bobber, or snail, or how would you fish underwater?? + public bool StandingStill => Owner.velocity.Length() == 0 && !Owner.pulley && !Owner.mount.Active && !Collision.DrownCollision(Owner.position, Owner.width, Owner.height, Owner.gravDir); + + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 7; + } + + public override void SetDefaults() + { + Projectile.width = 38; + Projectile.height = 34; + Projectile.netImportant = true; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + } + + public override void AI() + { + if (!ModdedOwner.victideSnailSet) + { + for (int d = 0; d < 25; d++) + { + Dust dust = Dust.NewDustDirect(new Vector2(Projectile.position.X, Projectile.position.Y + 16f), Projectile.width, Projectile.height - 16, DustID.BubbleBurst_Purple, 0f, 0f, 0, default, 1f); + dust.velocity *= 2f; + dust.scale *= 1.15f; + } + Projectile.active = false; + return; + } + + if (Owner.dead) + ModdedOwner.victideSnail = false; + + if (ModdedOwner.victideSnail) + Projectile.timeLeft = 2; + + //Create a burst of dust as it gets created, teleported, or popped out + DustTimer++; + if (DustTimer <= 3) + { + for (int d = 0; d < 25; d++) + { + Dust dust = Dust.NewDustDirect(new Vector2(Projectile.position.X, Projectile.position.Y + 16f), Projectile.width, Projectile.height - 16, DustID.BubbleBurst_Purple, 0f, 0f, 0, default, 1f); + dust.velocity *= 2f; + dust.scale *= 1.15f; + } + } + + // Small amount of light + Lighting.AddLight(Projectile.Center, 0.5f, 0.25f, 0.5f); + + if (StandingStill) + { + PlayerStandStillTimer++; + if (PlayerStandStillTimer >= PeekCooldown) + { + // Pop out the shell when ready. This give a slight velocity boost outwards + if (PlayerStandStillTimer == PeekCooldown) + { + DustTimer = 0f; + Projectile.velocity = new Vector2(Main.rand.NextFloat(2f, 3.6f) * Owner.direction, Main.rand.NextFloat(-4f, 0f)); + } + + // Fall down into position + Projectile.velocity *= 0.98f; + Projectile.velocity.X *= 0.9f; + Projectile.velocity.Y = Math.Min(Projectile.velocity.Y + 0.1f, 14f); + Projectile.tileCollide = true; + + bool? collide = CollidingWithLiquidOrPlatform(Projectile.position, Projectile.velocity, Projectile.width, Projectile.height); + if (collide.HasValue) + { + CollisionTimer++; + // Bobs up and down if collided with liquids + Projectile.velocity.Y = collide.Value ? MathF.Sin(CollisionTimer * 0.05f) * 0.25f : 0f; + } + + Projectile.rotation = Projectile.rotation.AngleTowards(0, MathHelper.PiOver4 * 0.14f); + + if (CollisionTimer > 0f) + { + Projectile.frameCounter++; + if (Projectile.frameCounter >= FrameTime) + { + Projectile.frameCounter = 0; + Projectile.frame = Math.Min(6, Projectile.frame + 1); + } + } + } + else // keep this guy spinnin' + Projectile.rotation += MathHelper.PiOver4 * 0.2f; + } + else + { + // Slowly puts its head back into shell + if (Projectile.frame > 0) + { + Projectile.frameCounter++; + if (Projectile.frameCounter >= FrameTime) + { + Projectile.frameCounter = 0; + Projectile.frame--; + } + + if (Projectile.frame == 0) + { + CollisionTimer = 0f; + PlayerStandStillTimer = 0f; + PlayerFishingTimer = 0f; + } + } + // Return to resting position once shelled again + else + { + Projectile.velocity = Vector2.Zero; + Projectile.tileCollide = false; + + Vector2 desiredPosition = Owner.Center + Vector2.UnitY * (Owner.gfxOffY - 60f) * Owner.gravDir; + //Round the result so it doesn't jitter. + desiredPosition = new Vector2((int)desiredPosition.X, (int)desiredPosition.Y); + Projectile.Center = Projectile.Center.MoveTowards(desiredPosition, 7f + Owner.velocity.Length()); + Projectile.rotation += MathHelper.PiOver4 * 0.2f; + } + } + + // Teleport and reset everything if too far away (this range is deliberately very short) + if (Vector2.Distance(Projectile.Center, Owner.Center) > 240f) + { + Projectile.Center = Owner.Center + Vector2.UnitY * (Owner.gfxOffY - 60f) * Owner.gravDir; + DustTimer = 0f; + CollisionTimer = 0f; + PlayerStandStillTimer = 0f; + PlayerFishingTimer = 0f; + Projectile.frame = 0; + return; + } + + // Only does fishing stuff when it's fully popped out + if (Projectile.frame == 6) + { + // Give the player a grace period upon any input with the fishing rod + // This means you can't just AFK with the fishing rod held + if (Owner.itemAnimation > 0 && Owner.ActiveItem().fishingPole > 0) + PlayerFishingTimer = 600f; + else + PlayerFishingTimer = Math.Max(PlayerFishingTimer -1f, 0f); + + // Automatically casts bobbers one at a time + // This casts the same way the pole does to prevent position variance + int bobberType = ModContent.ProjectileType(); + if (Owner.ownedProjectileCounts[bobberType] < 1 && Owner.ActiveItem().fishingPole > 0 && Projectile.owner == Main.myPlayer && PlayerFishingTimer > 0f) + { + SoundEngine.PlaySound(SoundID.Item1, Projectile.Center); + + Vector2 velocity = Owner.SafeDirectionTo(Main.MouseWorld) * Owner.ActiveItem().shootSpeed; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, bobberType, 0, 0f, Projectile.owner, ai2: Projectile.whoAmI); + } + } + } + + public static bool? CollidingWithLiquidOrPlatform(Vector2 Position, Vector2 Velocity, int Width, int Height) + { + Rectangle Hitbox = new Rectangle((int)Position.X, (int)Position.Y, Width, Height); + Rectangle ProjectedHitbox = new Rectangle((int)(Position.X + Velocity.X), (int)(Position.Y + Velocity.Y), Width, Height); + + int xMin = Utils.Clamp((int)(Position.X / 16f) - 1, 0, Main.maxTilesX - 1); + int xMax = Utils.Clamp((int)((Position.X + (float)Width) / 16f) + 2, 0, Main.maxTilesX - 1); + int yMin = Utils.Clamp((int)(Position.Y / 16f) - 1, 0, Main.maxTilesY - 1); + int yMax = Utils.Clamp((int)((Position.Y + (float)Height) / 16f) + 2, 0, Main.maxTilesY - 1); + for (int i = xMin; i < xMax; i++) + { + for (int j = yMin; j < yMax; j++) + { + Tile tile = Main.tile[i, j]; + if (tile == null) + return null; + + if (tile.HasTile && (Main.tileSolid[tile.TileType] || Main.tileSolidTop[tile.TileType])) + { + Rectangle Target = new Rectangle(i * 16, j * 16 , 16, 16); + if (Hitbox.Intersects(Target) || ProjectedHitbox.Intersects(Target)) + return false; + } + if (tile.LiquidAmount > 0 && !tile.HasTile) + { + float LiquidDepth = (256 - tile.LiquidAmount) / 16f; + Rectangle Target = new Rectangle(i * 16, j * 16 + (int)LiquidDepth, 16, 16 - (int)LiquidDepth); + if (Hitbox.Intersects(Target)) + return true; + } + } + } + return null; + } + + public override bool? CanDamage() => false; + + public override void OnKill(int timeLeft) + { + for (int d = 0; d < 45; d++) + { + Dust dust = Dust.NewDustDirect(new Vector2(Projectile.position.X, Projectile.position.Y + 16f), Projectile.width, Projectile.height - 16, DustID.BubbleBurst_Purple, 0f, 0f, 0, default, 1f); + dust.velocity *= 2f; + dust.scale *= 1.15f; + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + // Touches the ground + if (oldVelocity.Y >= 0) + CollisionTimer = 1f; + return false; + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle frame = tex.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + bool CanPeekOut = PlayerStandStillTimer >= PeekCooldown || Projectile.frame > 0; + Vector2 origin = !CanPeekOut ? new Vector2(15, 23) : frame.Size() * 0.5f; + + // Look at the player's direction + SpriteEffects flip = Owner.direction < 0 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Main.EntitySpriteDraw(tex, Projectile.Center + Vector2.UnitY * 2f - Main.screenPosition, frame, lightColor, Projectile.rotation, origin, Projectile.scale, flip); + + // Fisbing Rod,,. + if (Owner.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + { + Texture2D rod = Terraria.GameContent.TextureAssets.Item[ModContent.ItemType()].Value; + Main.EntitySpriteDraw(rod, Projectile.Center - Main.screenPosition + Vector2.UnitX * Owner.direction * 30f, null, lightColor, 0f, rod.Size() * 0.5f, Projectile.scale, flip); + } + return false; + } + } +} diff --git a/Projectiles/Summon/VictideSeaSnail.png b/Projectiles/Typeless/VictideSeaSnail.png similarity index 100% rename from Projectiles/Summon/VictideSeaSnail.png rename to Projectiles/Typeless/VictideSeaSnail.png diff --git a/Projectiles/Typeless/VictideSpirit.cs b/Projectiles/Typeless/VictideSpirit.cs new file mode 100644 index 0000000000..3b6ea32a18 --- /dev/null +++ b/Projectiles/Typeless/VictideSpirit.cs @@ -0,0 +1,319 @@ +using CalamityMod.Cooldowns; +using CalamityMod.Dusts; +using CalamityMod.Graphics.Primitives; +using CalamityMod.Items.Armor.Victide; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using System; +using System.Collections.Generic; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class VictideSpirit : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public Player Owner => Main.player[Projectile.owner]; + + public static Asset GlowTexture; + + public ref float SubmergedTimer => ref Projectile.ai[0]; + public ref float DustCounter => ref Projectile.ai[1]; + + public override void Load() => GlowTexture = ModContent.Request("CalamityMod/Particles/BloomCircle"); + + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 20; + ProjectileID.Sets.TrailingMode[Type] = 2; + } + + public override void SetDefaults() + { + Projectile.width = 20; + Projectile.height = 42; + Projectile.friendly = true; + Projectile.tileCollide = false; + } + + public override void OnSpawn(IEntitySource source) + { + Projectile.rotation = MathHelper.PiOver2; + for (int i = 0; i < Projectile.oldPos.Length; i++) + Projectile.oldRot[i] = MathHelper.PiOver2; + + for (int i = 0; i < 3; i++) + { + Color squareColor = Color.Lerp(Color.Cyan, Color.RoyalBlue, i * 0.5f) * 0.6f; + float squareScale = 0.6f + i * 0.2f; + float squareRot = (i % 2 == 0 ? MathHelper.PiOver4 : 0f); + Particle square = new CustomSpark(Projectile.Center, Vector2.Zero, "CalamityMod/Particles/GlowSquareParticleThick", false, 18, squareScale, squareColor, Vector2.One, true, true, squareRot, true, glowOpacity: 0.5f, glowCenterScale: squareScale * 1.15f); + GeneralParticleHandler.SpawnParticle(square); + } + } + + public override void AI() + { + if (Main.myPlayer == Projectile.owner) + { + // Validate existence + bool hasCD = Owner.Calamity().cooldowns.TryGetValue(BubblyBurrow.ID, out CooldownInstance cd); + if (!hasCD) + { + Owner.AddCooldown(BubblyBurrow.ID, VictideHeadBurrow.BurrowCooldown); + Projectile.Kill(); + return; + } + else if (!Owner.Calamity().victideBurrowSet) + { + cd.timeLeft = VictideHeadBurrow.BurrowCooldown; + Projectile.Kill(); + return; + } + else if (cd.timeLeft <= VictideHeadBurrow.BurrowCooldown) + { + Projectile.Kill(); + return; + } + // Shimmer interaction (Immediately ends if Chromatic Cloak isn't active) + else if (Owner.shimmering) + { + cd.timeLeft = VictideHeadBurrow.BurrowCooldown; + Projectile.Kill(); + return; + } + Projectile.timeLeft = cd.timeLeft - VictideHeadBurrow.BurrowCooldown; + + #region Movement and Controls + float MaxSpeed = Collision.DrownCollision(Projectile.Center - Vector2.One, 2, 2, Owner.gravDir) ? VictideHeadBurrow.SubmergedBurrowSpeed : VictideHeadBurrow.BaseBurrowSpeed; + // Controlling both opposite movement keys brings you to a near immediate stop (faster deceleration than just releasing both buttons) + // Turnaround acceleration is also twice as fast to aid smoothness of movement + if (Owner.controlLeft && Owner.controlRight) + Projectile.velocity.X *= 0.7f; + else if (Owner.controlLeft) + { + if (Projectile.velocity.X < -MaxSpeed) + { + Projectile.velocity.X = MathHelper.Lerp(Projectile.velocity.X, MaxSpeed, 0.05f); + if (Projectile.velocity.X > -MaxSpeed - 0.01f) + Projectile.velocity.X = -MaxSpeed; + } + else if (Projectile.velocity.X > 0f) + Projectile.velocity.X -= VictideHeadBurrow.BaseAcceleration * 2f; + else + Projectile.velocity.X = MathF.Max(Projectile.velocity.X - VictideHeadBurrow.BaseAcceleration, -MaxSpeed); + } + else if (Owner.controlRight) + { + if (Projectile.velocity.X > MaxSpeed) + { + Projectile.velocity.X = MathHelper.Lerp(Projectile.velocity.X, MaxSpeed, 0.05f); + if (Projectile.velocity.X < MaxSpeed + 0.01f) + Projectile.velocity.X = MaxSpeed; + } + else if (Projectile.velocity.X < 0f) + Projectile.velocity.X += VictideHeadBurrow.BaseAcceleration * 2f; + else + Projectile.velocity.X = MathF.Min(Projectile.velocity.X + VictideHeadBurrow.BaseAcceleration, MaxSpeed); + } + else + Projectile.velocity.X *= 0.92f; + + if ((Owner.controlUp || Owner.controlJump) && Owner.controlDown) + Projectile.velocity.Y *= 0.7f; + else if (Owner.controlUp || Owner.controlJump) + { + if (Projectile.velocity.Y < -MaxSpeed) + { + Projectile.velocity.Y = MathHelper.Lerp(Projectile.velocity.Y, MaxSpeed, 0.05f); + if (Projectile.velocity.Y > -MaxSpeed - 0.01f) + Projectile.velocity.Y = -MaxSpeed; + } + else if (Projectile.velocity.Y > 0f) + Projectile.velocity.Y -= VictideHeadBurrow.BaseAcceleration * 2f; + else + Projectile.velocity.Y = MathF.Max(Projectile.velocity.Y - VictideHeadBurrow.BaseAcceleration, -MaxSpeed); + } + else if (Owner.controlDown) + { + if (Projectile.velocity.Y > MaxSpeed) + { + Projectile.velocity.Y = MathHelper.Lerp(Projectile.velocity.Y, MaxSpeed, 0.05f); + if (Projectile.velocity.Y < MaxSpeed + 0.01f) + Projectile.velocity.Y = MaxSpeed; + } + else if (Projectile.velocity.Y < 0f) + Projectile.velocity.Y += VictideHeadBurrow.BaseAcceleration * 2f; + else + Projectile.velocity.Y = MathF.Min(Projectile.velocity.Y + VictideHeadBurrow.BaseAcceleration, MaxSpeed); + } + else + Projectile.velocity.Y *= 0.92f; + + // Rotation is less sudden so that the visuals are smoother -- velocity is not affected so that it also plays natural + float idealRotation = (Projectile.velocity.Length() == 0f ? MathHelper.PiOver2 : Projectile.velocity.ToRotation()); + if (MathF.Abs(idealRotation - Projectile.rotation) < MathHelper.ToRadians(1f) || MathF.Abs(idealRotation - Projectile.rotation) > MathHelper.ToRadians(90f)) + Projectile.rotation = idealRotation; + else + Projectile.rotation = MathHelper.Lerp(Projectile.rotation, idealRotation, 0.25f); + #endregion + + #region Player Manipulation + // Actively remove mounts and hooks from the player + Owner.mount?.Dismount(Owner); + Owner.RemoveAllGrapplingHooks(); + + // Give immunity frames and kill suffocation + Owner.suffocateDelay = 0; + Owner.immune = true; + Owner.immuneNoBlink = true; + Owner.immuneTime = 4; + for (int k = 0; k < Owner.hurtCooldowns.Length; k++) + { + // Excluded explicitly-anti cheesed bosses + if (k == ImmunityCooldownID.Bosses) + continue; + + Owner.hurtCooldowns[k] = Owner.immuneTime; + } + + Owner.velocity = Projectile.velocity; + if (Owner.velocity.Y == 0f) + Owner.velocity.Y += 0.00001f; // Prevent sprint particles from appearing + Owner.ChangeDir((Projectile.velocity.X > 0).ToDirectionInt()); + Projectile.direction = Owner.direction; + + // Move the player to the projectile, allowing them to bypass all tiles + Owner.Center = Projectile.Center; + #endregion + } + + #region Visual and Sound Effects + if (Collision.DrownCollision(Projectile.Center - Vector2.One, 2, 2, Owner.gravDir)) + SubmergedTimer++; + else + SubmergedTimer = 0f; + + Color BubblyBlue = new Color(97, 200, 255); + Vector2 headPosition = Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitY) * 8f; + Lighting.AddLight(headPosition, BubblyBlue.ToVector3() * Projectile.Opacity * (0.5f + 0.3f * Utils.GetLerpValue(0f, 60f, SubmergedTimer, true))); + + if (SubmergedTimer == 1f) + { + Particle ring = new DirectionalPulseRing(headPosition, Projectile.velocity.SafeNormalize(Vector2.UnitY) * 0.4f, BubblyBlue, new Vector2(0.5f, 1f), Projectile.rotation, 0.95f, 0f, 30); + GeneralParticleHandler.SpawnParticle(ring); + } + + float lifetimeRatio = Projectile.timeLeft / (float)VictideHeadBurrow.BurrowCooldown; + if (Projectile.soundDelay <= 0) + { + Projectile.soundDelay = Main.rand.Next(20, 36) + (int)(lifetimeRatio * 30); + SoundEngine.PlaySound(Main.rand.NextBool() ? SoundID.ShimmerWeak1 : SoundID.ShimmerWeak2, Projectile.Center); + } + + if ((Main.rand.NextBool(4) || Projectile.velocity.Length() > 0.25f) && SubmergedTimer == 0f) + { + Particle foam = new CustomSpark(Projectile.Center, -Projectile.velocity * 0.7f, "CalamityMod/Particles/WaterFoam", false, 9, 0.25f, Color.DeepSkyBlue, Vector2.One, extraRotation: Main.rand.NextFloat(0, MathHelper.TwoPi), shrinkSpeed: 1f); + GeneralParticleHandler.SpawnParticle(foam); + } + + DustCounter += Utils.Remap(Projectile.velocity.Length(), 0f, VictideHeadBurrow.BaseBurrowSpeed, 1f, 3f, true); + if (DustCounter >= 15f) + { + DustCounter = 0f; + for (int i = 0; i < 2; i++) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType(), Projectile.rotation.ToRotationVector2().RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(-4.8f, -6f)); + dust.noGravity = false; + dust.scale = Main.rand.NextFloat(0.65f, 0.8f); + dust.color = Color.White; + dust.noLightEmittence = true; + } + } + #endregion + } + + public float JetstreamWidthFunction(float completionRatio) => Utils.GetLerpValue(1f, 0.8f, completionRatio, true) * 3f; + public float SpiritWidthFunction(float completionRatio) => MathF.Min(MathHelper.SmoothStep(64f, 8f, completionRatio), Utils.GetLerpValue(0f, 0.15f, completionRatio, true) * 60f); + + public Color InnerJetstreamColorFunction(float completionRatio) => Color.Lerp(Color.CornflowerBlue, new Color(169, 100, 237), MathF.Pow(completionRatio, 2.5f)) * Utils.GetLerpValue(1f, 0.6f, completionRatio, true) * 0.5f; + public Color OuterJetstreamColorFunction(float completionRatio) => Color.Lerp(Color.CornflowerBlue, new Color(100, 237, 237), MathF.Pow(completionRatio, 2.5f)) * Utils.GetLerpValue(1f, 0.6f, completionRatio, true) * 0.2f; + public Color SpiritColorFunction(float completionRatio) => Color.Lerp(Color.Lerp(Color.White, Color.Cyan, 0.4f + completionRatio), Color.RoyalBlue, completionRatio) * Utils.GetLerpValue(0.8f, 0.54f, completionRatio, true); + + public override bool PreDraw(ref Color lightColor) + { + // Jetstream trails + for (int direction = -1; direction <= 1; direction += 2) + { + List trailPositionsInner = new List(); + List trailPositionsOuter = new List(); + for (int i = 0; i < Projectile.oldPos.Length; i++) + { + float mergeFactor = Utils.Remap(i, 0f, 8f, 0f, 1f, true); + + Vector2 trailPosInner = Projectile.Center - Projectile.oldRot[i].ToRotationVector2() * i * 8f; + float spreadLengthInner = 20f * MathF.Sin(Main.GlobalTimeWrappedHourly * 5f); + Vector2 sinOffsetInner = (Vector2.UnitY * direction * MathF.Sin(i * MathHelper.Pi * 0.125f) * spreadLengthInner * mergeFactor).RotatedBy(Projectile.oldRot[i]); + trailPositionsInner.Add(trailPosInner + sinOffsetInner); + + Vector2 trailPosOuter = Projectile.Center - Projectile.oldRot[i].ToRotationVector2() * i * 12f; + float spreadLengthOuter = 32f * MathF.Sin(Main.GlobalTimeWrappedHourly * 2f); + Vector2 sinOffsetOuter = (Vector2.UnitY * direction * (6f + MathF.Sin(i * MathHelper.Pi * 0.035f) * spreadLengthOuter * mergeFactor)).RotatedBy(Projectile.oldRot[i]); + trailPositionsOuter.Add(trailPosOuter + sinOffsetOuter); + } + + PrimitiveRenderer.RenderTrail(trailPositionsInner, new(JetstreamWidthFunction, InnerJetstreamColorFunction), 20); + PrimitiveRenderer.RenderTrail(trailPositionsOuter, new(JetstreamWidthFunction, OuterJetstreamColorFunction), 20); + } + + // Oops all trails? + List spiritBodyPositions = new List(); + for (int i = 0; i < Projectile.oldPos.Length; i++) + { + // 3 segments ahead so that it's a little offset forward + Vector2 spiritPos = Projectile.Center - Projectile.oldRot[i].ToRotationVector2() * (i - 3) * 8f; + spiritBodyPositions.Add(spiritPos); + } + GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/EternityStreak")); + PrimitiveRenderer.RenderTrail(spiritBodyPositions, new(SpiritWidthFunction, SpiritColorFunction, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 60); + + // Glow pulses when the ability is about to run out + if (Projectile.timeLeft < 180) + { + Main.spriteBatch.EnterShaderRegion(BlendState.Additive); + Texture2D glow = GlowTexture.Value; + Vector2 drawPos = Projectile.Center + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; + Color glowColor = new Color(255, 170, 204) * (0.2f * MathF.Sin(Projectile.timeLeft * MathHelper.Pi * 0.25f) + Utils.Remap(Projectile.timeLeft, 180f, 0f, 0.2f, 0.6f, true)); + Main.EntitySpriteDraw(glow, drawPos, null, glowColor, Projectile.rotation, glow.Size() * 0.5f, new Vector2(0.6f, 0.5f), SpriteEffects.None); + Main.spriteBatch.ExitShaderRegion(); + } + return false; + } + + public override bool? CanDamage() => false; + + public override void OnKill(int timeLeft) + { + Owner.velocity *= 0.8f; + Owner.fullRotation = 0f; + + SoundEngine.PlaySound(SoundID.Drown, Projectile.Center); + for (int i = 0; i < 3; i++) + { + Color squareColor = Color.Lerp(Color.Cyan, new Color(255, 170, 204), i * 0.5f) * 0.6f; + float squareScale = 0.6f + i * 0.2f; + float squareRot = (i % 2 == 0 ? MathHelper.PiOver4 : 0f); + Particle square = new CustomSpark(Projectile.Center, Vector2.Zero, "CalamityMod/Particles/GlowSquareParticleThick", false, 18, squareScale, squareColor, Vector2.One, true, true, squareRot, true, glowOpacity: 0.5f, glowCenterScale: squareScale * 1.15f); + GeneralParticleHandler.SpawnParticle(square); + } + } + } +} diff --git a/Properties/launchSettings.json b/Properties/launchSettings.json index a505707137..10114472bb 100644 --- a/Properties/launchSettings.json +++ b/Properties/launchSettings.json @@ -1,26 +1,14 @@ { "profiles": { - "Terraria Client (dotnet)": { + "Terraria": { "commandName": "Executable", - "executablePath": "dotnet", + "executablePath": "$(DotNetName)", "commandLineArgs": "$(tMLPath)", "workingDirectory": "$(tMLSteamPath)" }, - "Terraria Server (dotnet)": { + "TerrariaServer": { "commandName": "Executable", - "executablePath": "dotnet", - "commandLineArgs": "$(tMLServerPath)", - "workingDirectory": "$(tMLSteamPath)" - }, - "Terraria Client (dotnet.exe)": { - "commandName": "Executable", - "executablePath": "dotnet.exe", - "commandLineArgs": "$(tMLPath)", - "workingDirectory": "$(tMLSteamPath)" - }, - "Terraria Server (dotnet.exe)": { - "commandName": "Executable", - "executablePath": "dotnet.exe", + "executablePath": "$(DotNetName)", "commandLineArgs": "$(tMLServerPath)", "workingDirectory": "$(tMLSteamPath)" } diff --git a/Scenes/MusicScenes/AquaticScourgeMusicScene.cs b/Scenes/MusicScenes/AquaticScourgeMusicScene.cs index 70fb82de7f..8c0337b7be 100644 --- a/Scenes/MusicScenes/AquaticScourgeMusicScene.cs +++ b/Scenes/MusicScenes/AquaticScourgeMusicScene.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Systems { if (CalamityGlobalNPC.aquaticScourge == -1) return false; - return Main.npc[CalamityGlobalNPC.aquaticScourge].justHit || Main.npc[CalamityGlobalNPC.aquaticScourge].life <= Main.npc[CalamityGlobalNPC.aquaticScourge].lifeMax * 0.999 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode; + return Main.npc[CalamityGlobalNPC.aquaticScourge].justHit || Main.npc[CalamityGlobalNPC.aquaticScourge].life <= Main.npc[CalamityGlobalNPC.aquaticScourge].lifeMax * 0.999 || BossRushEvent.BossRushActive || Main.zenithWorld; } } } diff --git a/Sounds/CommonCalamitySounds.cs b/Sounds/CommonCalamitySounds.cs index fd0f455921..ce89a487ea 100644 --- a/Sounds/CommonCalamitySounds.cs +++ b/Sounds/CommonCalamitySounds.cs @@ -4,58 +4,35 @@ namespace CalamityMod.Sounds { public static class CommonCalamitySounds { - public static readonly SoundStyle ExoHitSound = new("CalamityMod/Sounds/NPCHit/ExoHit", 4) { Volume = 0.4f }; - - public static readonly SoundStyle ExoDeathSound = new("CalamityMod/Sounds/NPCKilled/ExoDeath") { MaxInstances = 1 }; - - public static readonly SoundStyle OtherwordlyHitSound = new("CalamityMod/Sounds/NPCHit/OtherworldlyHit"); - + public static readonly SoundStyle AstralNPCDeathSound = new("CalamityMod/Sounds/NPCKilled/AstralEnemyDeath") { Volume = 0.7f }; public static readonly SoundStyle AstralNPCHitSound = new("CalamityMod/Sounds/NPCHit/AstralEnemyHit", 3); - public static readonly SoundStyle AstralNPCDeathSound = new("CalamityMod/Sounds/NPCKilled/AstralEnemyDeath") { Volume = 0.7f }; - public static readonly SoundStyle WulfrumNPCDeathSound = new("CalamityMod/Sounds/NPCKilled/WulfrumDeath"); - - public static readonly SoundStyle PlagueBoomSound = new("CalamityMod/Sounds/Custom/PlagueSounds/PlagueBoom", 4); - - public static readonly SoundStyle WyrmScreamSound = new("CalamityMod/Sounds/Custom/WyrmScream"); - - public static readonly SoundStyle LightningSound = new("CalamityMod/Sounds/Custom/LightningStrike") { Volume = 1.6f }; //This is just the regular SoundID.Thunder sound, except its only the first variant - - public static readonly SoundStyle LightningTelegraph = new("CalamityMod/Sounds/Custom/LightningTelegraph") { Volume = 0.7f }; //This is just the regular SoundID.Thunder sound, except its only the fifth variant - - public static readonly SoundStyle LaserCannonSound = new("CalamityMod/Sounds/Item/LaserCannon") { Volume = 0.85f }; - public static readonly SoundStyle ELRFireSound = new("CalamityMod/Sounds/Item/ELRFire"); //What does ELR stand for - + public static readonly SoundStyle ExoDeathSound = new("CalamityMod/Sounds/NPCKilled/ExoDeath") { MaxInstances = 1 }; + public static readonly SoundStyle ExoHitSound = new("CalamityMod/Sounds/NPCHit/ExoHit", 4) { Volume = 0.4f }; public static readonly SoundStyle ExoLaserShootSound = new("CalamityMod/Sounds/Custom/ExoMechs/ExoLaserShoot"); - public static readonly SoundStyle ExoPlasmaExplosionSound = new("CalamityMod/Sounds/Custom/ExoMechs/ExoPlasmaExplosion", 2); - public static readonly SoundStyle ExoPlasmaShootSound = new("CalamityMod/Sounds/Custom/ExoMechs/ExoPlasmaShoot"); - public static readonly SoundStyle LargeWeaponFireSound = new("CalamityMod/Sounds/Item/LargeWeaponFire"); - - public static readonly SoundStyle GaussWeaponFire = new("CalamityMod/Sounds/Item/GaussWeaponFire"); - public static readonly SoundStyle FlareSound = new("CalamityMod/Sounds/Item/FlareSound"); - public static readonly SoundStyle PlasmaBoltSound = new("CalamityMod/Sounds/Item/PlasmaBolt") { Volume = 0.8f }; - - public static readonly SoundStyle PlasmaBlastSound = new("CalamityMod/Sounds/Item/PlasmaBlast"); + public static readonly SoundStyle LargeWeaponFireSound = new("CalamityMod/Sounds/Item/LargeWeaponFire"); + public static readonly SoundStyle LaserCannonSound = new("CalamityMod/Sounds/Item/LaserCannon") { Volume = 0.85f }; + public static readonly SoundStyle LightningSound = new("CalamityMod/Sounds/Custom/LightningStrike") { Volume = 1.6f }; // This is just the regular SoundID.Thunder sound, except its only the first variant + public static readonly SoundStyle LouderPhantomPhoenix = new("CalamityMod/Sounds/Item/LouderPhantomPhoenix", 3); public static readonly SoundStyle MeatySlashSound = new("CalamityMod/Sounds/Custom/MeatySlash"); - public static readonly SoundStyle SwiftSliceSound = new("CalamityMod/Sounds/Custom/SwiftSlice"); + public static readonly SoundStyle PlagueBoomSound = new("CalamityMod/Sounds/Custom/PlagueSounds/PlagueBoom", 4); + public static readonly SoundStyle PlasmaBoltSound = new("CalamityMod/Sounds/Item/PlasmaBolt") { Volume = 0.8f }; + public static readonly SoundStyle PlatingMine = new("CalamityMod/Sounds/Custom/PlatingMine", 3); public static readonly SoundStyle ScissorGuillotineSnapSound = new("CalamityMod/Sounds/Custom/ScissorGuillotineSnap"); - - public static readonly SoundStyle LouderPhantomPhoenix = new("CalamityMod/Sounds/Item/LouderPhantomPhoenix", 3); - - public static readonly SoundStyle LouderSwingWoosh = new("CalamityMod/Sounds/Custom/LoudSwingWoosh"); + public static readonly SoundStyle SwiftSliceSound = new("CalamityMod/Sounds/Custom/SwiftSlice"); public static readonly SoundStyle VoidstoneMine = new("CalamityMod/Sounds/Custom/VoidstoneMine", 3) { Volume = 0.4f }; - public static readonly SoundStyle PlatingMine = new("CalamityMod/Sounds/Custom/PlatingMine", 3); - + public static readonly SoundStyle WulfrumNPCDeathSound = new("CalamityMod/Sounds/NPCKilled/WulfrumDeath"); + public static readonly SoundStyle WyrmScreamSound = new("CalamityMod/Sounds/Custom/WyrmScream"); } } diff --git a/Sounds/Custom/AdrenalineMajorLossGFB.mp3 b/Sounds/Custom/AdrenalineMajorLossGFB.mp3 deleted file mode 100644 index b56ea7eeaf..0000000000 Binary files a/Sounds/Custom/AdrenalineMajorLossGFB.mp3 and /dev/null differ diff --git a/Sounds/Custom/AdrenalineMajorLossGFB.ogg b/Sounds/Custom/AdrenalineMajorLossGFB.ogg new file mode 100644 index 0000000000..d1175cc664 Binary files /dev/null and b/Sounds/Custom/AdrenalineMajorLossGFB.ogg differ diff --git a/Sounds/Custom/BEES/bees13.mp3 b/Sounds/Custom/BEES/bees13.mp3 deleted file mode 100644 index 9b7b424035..0000000000 Binary files a/Sounds/Custom/BEES/bees13.mp3 and /dev/null differ diff --git a/Sounds/Custom/BEES/bees13.ogg b/Sounds/Custom/BEES/bees13.ogg new file mode 100644 index 0000000000..e7c35d9313 Binary files /dev/null and b/Sounds/Custom/BEES/bees13.ogg differ diff --git a/Sounds/Custom/BazookaRocket.ogg b/Sounds/Custom/BazookaRocket.ogg deleted file mode 100644 index a2c5f35447..0000000000 Binary files a/Sounds/Custom/BazookaRocket.ogg and /dev/null differ diff --git a/Sounds/Custom/BubblyBurst.ogg b/Sounds/Custom/BubblyBurst.ogg new file mode 100644 index 0000000000..3db8409d9b Binary files /dev/null and b/Sounds/Custom/BubblyBurst.ogg differ diff --git a/Sounds/Custom/CalamitasClone/BulletHellEnding.ogg b/Sounds/Custom/CalamitasClone/BulletHellEnding.ogg new file mode 100644 index 0000000000..7ed1d7c40e Binary files /dev/null and b/Sounds/Custom/CalamitasClone/BulletHellEnding.ogg differ diff --git a/Sounds/Custom/CalamitasClone/BulletHellEnding.wav b/Sounds/Custom/CalamitasClone/BulletHellEnding.wav deleted file mode 100644 index 252d500055..0000000000 Binary files a/Sounds/Custom/CalamitasClone/BulletHellEnding.wav and /dev/null differ diff --git a/Sounds/Custom/CalamitasClone/CalCloneDash1.ogg b/Sounds/Custom/CalamitasClone/CalCloneDash1.ogg new file mode 100644 index 0000000000..da889da7a9 Binary files /dev/null and b/Sounds/Custom/CalamitasClone/CalCloneDash1.ogg differ diff --git a/Sounds/Custom/CalamitasClone/CalCloneDash1.wav b/Sounds/Custom/CalamitasClone/CalCloneDash1.wav deleted file mode 100644 index cbdacec6c6..0000000000 Binary files a/Sounds/Custom/CalamitasClone/CalCloneDash1.wav and /dev/null differ diff --git a/Sounds/Custom/CalamitasClone/CalCloneDash2.ogg b/Sounds/Custom/CalamitasClone/CalCloneDash2.ogg new file mode 100644 index 0000000000..55cf49223d Binary files /dev/null and b/Sounds/Custom/CalamitasClone/CalCloneDash2.ogg differ diff --git a/Sounds/Custom/CalamitasClone/CalCloneDash2.wav b/Sounds/Custom/CalamitasClone/CalCloneDash2.wav deleted file mode 100644 index d055df0041..0000000000 Binary files a/Sounds/Custom/CalamitasClone/CalCloneDash2.wav and /dev/null differ diff --git a/Sounds/Custom/CalamitasClone/CalCloneDash3.ogg b/Sounds/Custom/CalamitasClone/CalCloneDash3.ogg new file mode 100644 index 0000000000..63bdc7ee7c Binary files /dev/null and b/Sounds/Custom/CalamitasClone/CalCloneDash3.ogg differ diff --git a/Sounds/Custom/CalamitasClone/CalCloneDash3.wav b/Sounds/Custom/CalamitasClone/CalCloneDash3.wav deleted file mode 100644 index 807f5d0303..0000000000 Binary files a/Sounds/Custom/CalamitasClone/CalCloneDash3.wav and /dev/null differ diff --git a/Sounds/Custom/EidolonWyrmRoarClose.ogg b/Sounds/Custom/EidolonWyrmRoarClose.ogg deleted file mode 100644 index 4f908dd375..0000000000 Binary files a/Sounds/Custom/EidolonWyrmRoarClose.ogg and /dev/null differ diff --git a/Sounds/Custom/Polterghast/PolterSpook1.ogg b/Sounds/Custom/Polterghast/PolterSpook1.ogg deleted file mode 100644 index 55faa22baa..0000000000 Binary files a/Sounds/Custom/Polterghast/PolterSpook1.ogg and /dev/null differ diff --git a/Sounds/Custom/Polterghast/PolterSpook2.ogg b/Sounds/Custom/Polterghast/PolterSpook2.ogg deleted file mode 100644 index 698533a8bd..0000000000 Binary files a/Sounds/Custom/Polterghast/PolterSpook2.ogg and /dev/null differ diff --git a/Sounds/Custom/Polterghast/PolterSpook3.ogg b/Sounds/Custom/Polterghast/PolterSpook3.ogg deleted file mode 100644 index b45fca9b99..0000000000 Binary files a/Sounds/Custom/Polterghast/PolterSpook3.ogg and /dev/null differ diff --git a/Sounds/Custom/Polterghast/PolterSpook4.ogg b/Sounds/Custom/Polterghast/PolterSpook4.ogg deleted file mode 100644 index 8f7ebdb17b..0000000000 Binary files a/Sounds/Custom/Polterghast/PolterSpook4.ogg and /dev/null differ diff --git a/Sounds/Custom/SCalSounds/BrimstoneSkullSound.ogg b/Sounds/Custom/SCalSounds/BrimstoneSkullSound.ogg deleted file mode 100644 index 0b4c55ce85..0000000000 Binary files a/Sounds/Custom/SCalSounds/BrimstoneSkullSound.ogg and /dev/null differ diff --git a/Sounds/Custom/SCalSounds/CatastropheResonanceSlash1.ogg b/Sounds/Custom/SCalSounds/CatastropheResonanceSlash.ogg similarity index 100% rename from Sounds/Custom/SCalSounds/CatastropheResonanceSlash1.ogg rename to Sounds/Custom/SCalSounds/CatastropheResonanceSlash.ogg diff --git a/Sounds/Custom/ThunderStrike.ogg b/Sounds/Custom/ThunderStrike.ogg deleted file mode 100644 index 792f62b553..0000000000 Binary files a/Sounds/Custom/ThunderStrike.ogg and /dev/null differ diff --git a/Sounds/Custom/YanmeiKnifeExpire.ogg b/Sounds/Custom/YanmeiKnifeExpire.ogg deleted file mode 100644 index 43f93869d1..0000000000 Binary files a/Sounds/Custom/YanmeiKnifeExpire.ogg and /dev/null differ diff --git a/Sounds/Item/EnergyRifleFire.ogg b/Sounds/Item/EnergyRifleFire.ogg deleted file mode 100644 index 855a605b46..0000000000 Binary files a/Sounds/Item/EnergyRifleFire.ogg and /dev/null differ diff --git a/Sounds/Item/GatlingLaserFireEnd.ogg b/Sounds/Item/GatlingLaserFireEnd.ogg deleted file mode 100644 index b1f2180832..0000000000 Binary files a/Sounds/Item/GatlingLaserFireEnd.ogg and /dev/null differ diff --git a/Sounds/Item/GatlingLaserFireLoop.ogg b/Sounds/Item/GatlingLaserFireLoop.ogg deleted file mode 100644 index 85123255a8..0000000000 Binary files a/Sounds/Item/GatlingLaserFireLoop.ogg and /dev/null differ diff --git a/Sounds/Item/GatlingLaserFireStart.ogg b/Sounds/Item/GatlingLaserFireStart.ogg deleted file mode 100644 index b965fb567f..0000000000 Binary files a/Sounds/Item/GatlingLaserFireStart.ogg and /dev/null differ diff --git a/Sounds/Item/GaussWeaponFire.ogg b/Sounds/Item/GaussWeaponFire.ogg deleted file mode 100644 index e15236ce8e..0000000000 Binary files a/Sounds/Item/GaussWeaponFire.ogg and /dev/null differ diff --git a/Sounds/Item/GunShotSmallHeavy.ogg b/Sounds/Item/GunShotSmallHeavy.ogg deleted file mode 100644 index b23c4ff131..0000000000 Binary files a/Sounds/Item/GunShotSmallHeavy.ogg and /dev/null differ diff --git a/Sounds/Item/HeliumFlashReady.ogg b/Sounds/Item/HeliumFlashReady.ogg index 69bfb600bc..355124aaa7 100644 Binary files a/Sounds/Item/HeliumFlashReady.ogg and b/Sounds/Item/HeliumFlashReady.ogg differ diff --git a/Sounds/Item/HeliumFlashReadyAlt.ogg b/Sounds/Item/HeliumFlashReadyAlt.ogg deleted file mode 100644 index 355124aaa7..0000000000 Binary files a/Sounds/Item/HeliumFlashReadyAlt.ogg and /dev/null differ diff --git a/Sounds/Item/LargeMechGaussRifle.ogg b/Sounds/Item/LargeMechGaussRifle.ogg deleted file mode 100644 index fd91b44c4e..0000000000 Binary files a/Sounds/Item/LargeMechGaussRifle.ogg and /dev/null differ diff --git a/Sounds/Item/LaserRifleFire.ogg b/Sounds/Item/LaserRifleFire.ogg deleted file mode 100644 index 91f7b18d56..0000000000 Binary files a/Sounds/Item/LaserRifleFire.ogg and /dev/null differ diff --git a/Sounds/Item/MagicBlast.ogg b/Sounds/Item/MagicBlast.ogg deleted file mode 100644 index e8e088d672..0000000000 Binary files a/Sounds/Item/MagicBlast.ogg and /dev/null differ diff --git a/Sounds/Item/MetalScrape.ogg b/Sounds/Item/MetalScrape.ogg deleted file mode 100644 index 2f1963610a..0000000000 Binary files a/Sounds/Item/MetalScrape.ogg and /dev/null differ diff --git a/Sounds/Item/SharkoonBoom.ogg b/Sounds/Item/SharkoonBoom.ogg deleted file mode 100644 index 8dd94403c2..0000000000 Binary files a/Sounds/Item/SharkoonBoom.ogg and /dev/null differ diff --git a/Sounds/Item/SkytiedBolt.ogg b/Sounds/Item/SkytideBolt.ogg similarity index 100% rename from Sounds/Item/SkytiedBolt.ogg rename to Sounds/Item/SkytideBolt.ogg diff --git a/Sounds/Item/YanmeiKnifeHit.ogg b/Sounds/Item/YanmeiKnifeHit.ogg deleted file mode 100644 index 37abc0dcf8..0000000000 Binary files a/Sounds/Item/YanmeiKnifeHit.ogg and /dev/null differ diff --git a/Sounds/NPCHit/WulfrumHit1.ogg b/Sounds/NPCHit/WulfrumHit1.ogg new file mode 100644 index 0000000000..10d225e335 Binary files /dev/null and b/Sounds/NPCHit/WulfrumHit1.ogg differ diff --git a/Sounds/NPCHit/WulfrumHit1.wav b/Sounds/NPCHit/WulfrumHit1.wav deleted file mode 100644 index a07f2b7194..0000000000 Binary files a/Sounds/NPCHit/WulfrumHit1.wav and /dev/null differ diff --git a/Sounds/NPCHit/WulfrumHit2.ogg b/Sounds/NPCHit/WulfrumHit2.ogg new file mode 100644 index 0000000000..048e071051 Binary files /dev/null and b/Sounds/NPCHit/WulfrumHit2.ogg differ diff --git a/Sounds/NPCHit/WulfrumHit2.wav b/Sounds/NPCHit/WulfrumHit2.wav deleted file mode 100644 index 1ba1f11026..0000000000 Binary files a/Sounds/NPCHit/WulfrumHit2.wav and /dev/null differ diff --git a/Sounds/NPCHit/WulfrumHit3.ogg b/Sounds/NPCHit/WulfrumHit3.ogg new file mode 100644 index 0000000000..75a1f42e23 Binary files /dev/null and b/Sounds/NPCHit/WulfrumHit3.ogg differ diff --git a/Sounds/NPCHit/WulfrumHit3.wav b/Sounds/NPCHit/WulfrumHit3.wav deleted file mode 100644 index 782a47fb54..0000000000 Binary files a/Sounds/NPCHit/WulfrumHit3.wav and /dev/null differ diff --git a/Systems/Collections/AbyssValidTileReplacementList.cs b/Systems/Collections/AbyssValidTileReplacementList.cs deleted file mode 100644 index 243d3ba97f..0000000000 --- a/Systems/Collections/AbyssValidTileReplacementList.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Collections.Generic; -using Terraria.ModLoader; - -namespace CalamityMod.Systems.Collections -{ - /// - /// A that contains a of modded Tile IDs which the Abyss can replace while generating. - /// - public sealed class AbyssValidTileReplacementList : ModSystem - { - public static IList List { get; private set; } - - public override void OnModLoad() - { - List = - [ - // By default, Calamity does not add anything to this list. Mods are free to do so with reflection. - ]; - } - - public override void Unload() => List = null; - - /// - /// A shorthand method to check whether or not a tile can be replaced by the Abyss while generating. - /// - public static bool Includes(int tileType) => List.Contains(tileType); - } -} diff --git a/Systems/Collections/AlcoholsDict.cs b/Systems/Collections/AlcoholsDict.cs deleted file mode 100644 index bf7ef08f65..0000000000 --- a/Systems/Collections/AlcoholsDict.cs +++ /dev/null @@ -1,58 +0,0 @@ -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 and their corresponding poison level. - /// - public sealed class AlcoholsDict : ModSystem - { - public static IDictionary Dict { get; private set; } - - public override void OnModLoad() - { - Dict = new Dictionary - { - { BuffID.Tipsy, 1 }, - { BuffType(), 1 }, - { BuffType(), 1 }, - { BuffType(), 1 }, - { BuffType(), 2 }, - { BuffType(), 1 }, - { BuffType(), 1 }, - { BuffType(), 1 }, - { BuffType(), 1 }, - { BuffType(), 1 }, - { BuffType(), 1 }, - { BuffType(), 1 }, - { BuffType(), 1 }, - { BuffType(), 1 }, - { BuffType(), 1 }, - { BuffType(), 1 }, - { BuffType(), 1 }, - { BuffType(), 1 }, - { BuffType(), 1 }, - { BuffType(), 1 }, - { BuffType(), 1 } - }; - } - - public override void Unload() - { - Dict?.Clear(); - Dict = null; - } - - /// - /// A shorthand method to obtain an alcohol buff's poison level from its buff ID. - /// - public static bool TryGet(int buffType, out int poisonLevel) - { - return Dict.TryGetValue(buffType, out poisonLevel); - } - } -} diff --git a/Systems/Collections/AmalgamBuffLists.cs b/Systems/Collections/AmalgamBuffLists.cs deleted file mode 100644 index 8724883deb..0000000000 --- a/Systems/Collections/AmalgamBuffLists.cs +++ /dev/null @@ -1,123 +0,0 @@ -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 deleted file mode 100644 index 80d81b13f5..0000000000 --- a/Systems/Collections/AutoreuseableSpearsList.cs +++ /dev/null @@ -1,46 +0,0 @@ -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 deleted file mode 100644 index 769faa281d..0000000000 --- a/Systems/Collections/BlacklistedWeaponsWithToolPowerList.cs +++ /dev/null @@ -1,38 +0,0 @@ -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 deleted file mode 100644 index 2d847d0d29..0000000000 --- a/Systems/Collections/BuffedDungeonProjectilesList.cs +++ /dev/null @@ -1,37 +0,0 @@ -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/CalamityBuffSets.cs b/Systems/Collections/CalamityBuffSets.cs new file mode 100644 index 0000000000..35a8b9fd1f --- /dev/null +++ b/Systems/Collections/CalamityBuffSets.cs @@ -0,0 +1,140 @@ +using System.Collections.Generic; +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.Buffs.Summon.Whips; +using CalamityMod.DataStructures; +using CalamityMod.Items.Accessories; +using ReLogic.Reflection; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + [ReinitializeDuringResizeArrays] + public static class CalamityBuffSets + { + public static SetFactory Factory = new SetFactory(BuffLoader.BuffCount, "CalamityMod/BuffID", Search); + public static IdDictionary Search = IdDictionary.Create(); + + /// + /// If for a buff type, then that buff will have its duration extended with The Amalgam equipped.
+ /// Also used to remove buffs when contacting the Whispering Maelstrom in the Get fixed boi seed.
+ /// Defaults to . + ///
+ public static bool[] BuffedByAmalgam = Factory.CreateBoolSet(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, 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()); + + /// + /// If for a buff type, then that buff is a persistent buff.
+ /// Used by The Amalgam to prevent removing their persistence when the accessory is unequipped.
+ /// Defaults to . + ///
+ public static bool[] IsPersistentBuff = Factory.CreateBoolSet(BuffID.WeaponImbueVenom, BuffID.WeaponImbueCursedFlames, BuffID.WeaponImbueFire, BuffID.WeaponImbueGold, + BuffID.WeaponImbueIchor, BuffID.WeaponImbueNanites, BuffID.WeaponImbueConfetti, BuffID.WeaponImbuePoison, BuffType(), + BuffType(), BuffType()); + + /// + /// If for a buff type, then that buff is considered to be a sickness debuff.
+ /// Used for reducing buff duration with Honey Dew and its upgrades.
+ /// Defaults to . + ///
+ public static bool[] IsSicknessDebuff = Factory.CreateBoolSet(BuffID.Poisoned, BuffID.Venom, BuffType(), BuffType(), BuffType(), + BuffType(), BuffType(), BuffType(), BuffType(), BuffType()); + + /// + /// If for a buff type, then that buff is considered to be a fire debuff.
+ /// Used for reducing buff duration with Living Dew and its upgrades, and providing Permafrost's Concoction's life regeneration boost.
+ /// Defaults to . + ///
+ public static bool[] IsFireDebuff = Factory.CreateBoolSet(BuffID.OnFire, BuffID.OnFire3, BuffID.Burning, BuffID.CursedInferno, BuffID.ShadowFlame, BuffType(), + BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), + BuffType(), BuffType(), BuffType()); + + /// + /// If for a buff type, then that buff is considered to be a debuff.
+ /// This general-purpose set has several different uses, including reducing buff duration with Radiance, Crown Jewel and its upgrades' debuff effects, and removing debuffs with Cleansing Jelly and its upgrades' auras.
+ /// Defaults to . + ///
+ public static bool[] IsDebuff = Factory.CreateBoolSet(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(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType()); + + /// + /// If for a buff type, then that buff is a whip tag buff on the player.
+ /// Used to prevent "whip stacking", the ability to grant the player multiple whip buff effects at once.
+ /// Defaults to . + ///
+ public static bool[] IsSummonTagBuff = Factory.CreateBoolSet(BuffID.CoolWhipPlayerBuff, BuffID.ScytheWhipPlayerBuff, BuffID.SwordWhipPlayerBuff, BuffID.ThornWhipPlayerBuff, BuffType()); + + /// + /// Associates a buff type with its structure. If a buff type is not a key in this dictionary, then it has no associated .
+ /// Used for several different effects, such as applying tag effects to NPCs, preventing "whip stacking" on NPCs, and drawing the tag effect icon below the NPC. + ///
+ public static Dictionary SummonTagDebuff = new Dictionary + { + { BuffID.BlandWhipEnemyDebuff, SummonTag.LeatherWhip }, + { BuffID.BoneWhipNPCDebuff, SummonTag.SpinalTap }, + { BuffID.CoolWhipNPCDebuff, SummonTag.CoolWhip }, + { BuffID.FlameWhipEnemyDebuff, SummonTag.Firecracker }, + { BuffID.MaceWhipNPCDebuff, SummonTag.MorningStar }, + { BuffID.RainbowWhipNPCDebuff, SummonTag.Kaleidoscope }, + { BuffID.ScytheWhipEnemyDebuff, SummonTag.DarkHarvest }, + { BuffID.SwordWhipNPCDebuff, SummonTag.Durendal }, + { BuffID.ThornWhipNPCDebuff, SummonTag.Snapthorn }, + { BuffType(), ProfanedSoulCrystal.SummonTag } + }; + + /// + /// Associates a buff type with its alcohol poison level. Used for the Alcohol Poisoning mechanic.
+ /// If a buff type is not a key in this dictionary, then it does not increase alcohol poison level. + ///
+ public static Dictionary AlcoholStrength = new Dictionary + { + { BuffID.Tipsy, 1 }, + { BuffType(), 1 }, + { BuffType(), 1 }, + { BuffType(), 1 }, + { BuffType(), 2 }, + { BuffType(), 1 }, + { BuffType(), 1 }, + { BuffType(), 1 }, + { BuffType(), 1 }, + { BuffType(), 1 }, + { BuffType(), 1 }, + { BuffType(), 1 }, + { BuffType(), 1 }, + { BuffType(), 1 }, + { BuffType(), 1 }, + { BuffType(), 1 }, + { BuffType(), 1 }, + { BuffType(), 1 }, + { BuffType(), 1 }, + { BuffType(), 1 }, + { BuffType(), 1 }, + { BuffType(), 1 } + }; + } +} diff --git a/Systems/Collections/CalamityItemSets.cs b/Systems/Collections/CalamityItemSets.cs new file mode 100644 index 0000000000..6cc299caf7 --- /dev/null +++ b/Systems/Collections/CalamityItemSets.cs @@ -0,0 +1,96 @@ +using System; +using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor.Vanity; +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 ReLogic.Reflection; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + [ReinitializeDuringResizeArrays] + public static class CalamityItemSets + { + public static SetFactory Factory = new SetFactory(ItemLoader.ItemCount, "CalamityMod/ItemID", Search); + public static IdDictionary Search = IdDictionary.Create(); + + /// + /// If for an item type, allows the item to always be used as long as only one of its projectile exists.
+ /// Used to give specific vanilla spears pseudo-autoswing.
+ /// Defaults to . + ///
+ public static bool[] AutoreusableSpear = Factory.CreateBoolSet(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); + + /// + /// If for an item type, prevents an item from removing Calamity's summon damage penalty mechanic despite having tool power.
+ /// Defaults to . + ///
+ public static bool[] WeaponWithToolPowerAffectedBySummonPenalty = Factory.CreateBoolSet(ItemID.ButchersChainsaw, ItemID.LucyTheAxe, ItemID.Rockfish, + ItemType(), ItemType(), ItemType(), ItemType(), ItemType()); + + /// + /// If for an item type, manually disables Calamity's summon damage penalty mechanic while that item type is held.
+ /// Unused by Calamity itself, and is only used for external mods to add to through mod calls.
+ /// Defaults to . + ///
+ public static bool[] ItemWhichDisablesSummonerNerf = Factory.CreateBoolSet(); + + /// + /// If for an item type, holding the item sets to true, preventing fishing lines from breaking.
+ /// Should only be set on fishing poles.
+ /// Defaults to . + ///
+ public static bool[] FishingPoleThatNeverBreaks = Factory.CreateBoolSet(ItemID.GoldenFishingRod, ItemType(), ItemType()); + + /// + /// If for an item type, forces a dropped item of this type to remain within the bounds of the world if it is spawned outside of it.
+ /// Set this for items which are dropped by enemies or bosses which spawn on the edges of the world.
+ /// Defaults to . + ///
+ public static bool[] ItemForcedInsideWorld = Factory.CreateBoolSet(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, 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()); + + /// + /// If for an item type, prevents this rogue weapon from triggering Venerated Locket's clone projectile effect when used.
+ /// Primarily used for weapons which shoot short-distance projectiles.
+ /// Defaults to . + ///
+ public static bool[] DisablesVeneratedLocketEffect = Factory.CreateBoolSet(ItemType(), ItemType(), ItemType()); + + /// + /// If for an item type, this item is considered to be a magic gun.
+ /// Used for applying Calamity's reworked Meteor armor set bonus.
+ /// Defaults to . + ///
+ public static bool[] MagicGun = Factory.CreateBoolSet(ItemID.BeeGun, ItemID.BubbleGun, ItemID.ChargedBlasterCannon, ItemID.HeatRay, ItemID.LaserMachinegun, ItemID.LaserRifle, + ItemID.LeafBlower, ItemID.RainbowGun, ItemID.SpaceGun, ItemID.WaspGun, ItemID.ZapinatorGray, ItemID.ZapinatorOrange, ItemType(), ItemType(), + ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), + ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), + ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType()); + } +} diff --git a/Systems/Collections/CalamityNPCSets.cs b/Systems/Collections/CalamityNPCSets.cs new file mode 100644 index 0000000000..88f24502a4 --- /dev/null +++ b/Systems/Collections/CalamityNPCSets.cs @@ -0,0 +1,359 @@ +using System.Collections.Generic; +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 ReLogic.Reflection; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + [ReinitializeDuringResizeArrays] + public static class CalamityNPCSets + { + public static SetFactory Factory = new SetFactory(NPCLoader.NPCCount, "CalamityMod/NPCID", Search); + public static IdDictionary Search = IdDictionary.Create(); + + /// + /// If for an NPC type, makes this NPC be susceptible to .
+ /// Defaults to . + ///
+ public static bool[] CalamityNPCNotImmuneToConfused = Factory.CreateBoolSet(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()); + + /// + /// If for an NPC type, forces this NPC to draw Calamity's debuff display, even if it is not a boss.
+ /// Defaults to . + ///
+ public static bool[] ForceDrawDebuffDisplay = Factory.CreateBoolSet(NPCID.TargetDummy, NPCID.WallofFleshEye, NPCType()); + + /// + /// If for an NPC type, then that NPC will not provide increased Rage generation despite being considered a boss.
+ /// Primarily used by worm boss body and tail segments to prevent Rage being extraordinarily easy to get.
+ /// Defaults to . + ///
+ public static bool[] BossSegmentThatDoesNotGenerateRageFaster = Factory.CreateBoolSet(NPCType(), NPCType(), NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), + NPCType(), NPCType(), NPCType(), NPCType()); + + /// + /// If for an NPC type, allows the NPC to scale its health based on the Boss Health Boost Percentage config option, even if it is not a boss.
+ /// Also allows the NPC to receive health scaling from having multiple players in Expert+.
+ /// Defaults to . + ///
+ public static bool[] ScalesHealthLikeBoss = Factory.CreateBoolSet(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()); + + /// + /// If for an NPC type, then that NPC will have its contact damage set to 0.
+ /// Defaults to . + ///
+ public static bool[] DealsZeroContactDamage = Factory.CreateBoolSet(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.AncientDoom); + + /// + /// If for an NPC type, then that NPC will have its damage reduced by 25% if the world is in Hardmode.
+ /// Defaults to . + ///
+ public static bool[] NerfDamageInHardmode = Factory.CreateBoolSet(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.Corruptor, NPCID.Crimslime, 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.MossHornet, NPCID.Moth, + NPCID.PigronCorruption, NPCID.PigronCrimson, NPCID.PigronHallow, NPCID.Pixie, NPCID.PossessedArmor, NPCID.RockGolem, NPCID.DesertScorpionWalk, NPCID.DesertScorpionWall, + NPCID.Slimer, 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); + + /// + /// If for an NPC type, then that NPC is a post-Plantera Dungeon enemy. This causes two separate changes to the enemy.
+ /// First, it grants them a 20% chance to drop Ectoplasm upon death.
+ /// Second, it multiplies their max health by 2.5x and increases their damage by a flat 30 if Moon Lord has been defeated.
+ /// Defaults to . + ///
+ public static bool[] IsBuffedDungeonEnemy = Factory.CreateBoolSet(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); + + /// + /// If for an NPC type, then that NPC is spawned in the Pumpkin Moon.
+ /// This will multiply their max health by 3.5x and increase their damage by a flat 30 if Devourer of Gods has been defeated.
+ /// Defaults to . + ///
+ public static bool[] IsBuffedPumpkinMoonEnemy = Factory.CreateBoolSet(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); + + /// + /// If for an NPC type, then that NPC is spawned in the Frost Moon.
+ /// This will multiply their max health by 2.5x and increase their damage by a flat 30 if Devourer of Gods has been defeated.
+ /// Defaults to . + ///
+ public static bool[] IsBuffedFrostMoonEnemy = Factory.CreateBoolSet(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); + + /// + /// If for an NPC type, then that NPC is spawned in the Solar Eclipse.
+ /// This will multiply their max health by 5x and increase their damage by a flat 30 if Devourer of Gods has been defeated.
+ /// Defaults to . + ///
+ public static bool[] IsBuffedSolarEclipseEnemy = Factory.CreateBoolSet(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); + + // TODO: This set should really also handle the actual splitting behavior and loot, but unsure of the best way to do that looking at what we have right now + /// + /// If for an NPC type, then that NPC is part of a worm which splits in Death Mode. Solely used to reduce their max health to 15% of its standard value.
+ /// Defaults to . + ///
+ public static bool[] DeathModeSplittingWorm = Factory.CreateBoolSet(NPCID.DuneSplicerHead, NPCID.DuneSplicerBody, NPCID.DuneSplicerTail, + NPCID.DiggerHead, NPCID.DiggerBody, NPCID.DiggerTail, NPCID.SeekerHead, NPCID.SeekerBody, NPCID.SeekerTail); + + /// + /// If for an NPC type, then the NPC will receive a 30 second global cooldown to slowing debuffs after being inflicted by one.
+ /// Also used to prevent weapon pulling effects and Anarchy Blade's ability to instantly kill enemies that are below 50% health.
+ /// Defaults to . + ///
+ public static bool[] ResistSlowingDebuffsAndOtherSpecialEffects = Factory.CreateBoolSet(NPCID.KingSlime, NPCType(), NPCType(), + NPCType(), NPCID.EyeofCthulhu, 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, NPCID.SkeletronPrime, 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()); + + /// + /// Associates an NPC type with the base value of their max health in Boss Rush.
+ /// If an NPC type is not a key in this dictionary, then it will use its standard max health value. + ///
+ public static Dictionary BossRushHealth = 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 }, + { 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 }, + { NPCID.TheDestroyer, 600000 }, // 30 seconds + immunity timer at start + { NPCID.TheDestroyerBody, 600000 }, + { NPCID.TheDestroyerTail, 600000 }, + { NPCID.Probe, 10000 }, + { NPCID.SkeletronPrime, 160000 }, // 30 seconds + { 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, 100000 }, // 30 seconds + { NPCID.GolemHead, 70000 }, + { NPCID.GolemFistLeft, 30000 }, + { NPCID.GolemFistRight, 30000 }, + { 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 } + }; + + /// + /// Associates an NPC type with an ID number used for Calamity's Speedrun Timer. Used for drawing the correct map icon for the boss.
+ /// If an NPC type is not a key in this dictionary, then it will not be displayed on the Speedrun Timer. + ///
+ public static Dictionary BossSpeedrunTimerID = new Dictionary + { + { 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 } + }; + } +} diff --git a/Systems/Collections/CalamityNPCTypeSets.cs b/Systems/Collections/CalamityNPCTypeSets.cs new file mode 100644 index 0000000000..3985e71ee1 --- /dev/null +++ b/Systems/Collections/CalamityNPCTypeSets.cs @@ -0,0 +1,72 @@ +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.NormalNPCs; +using CalamityMod.NPCs.Perforator; +using CalamityMod.NPCs.Ravager; +using CalamityMod.NPCs.SlimeGod; +using CalamityMod.NPCs.StormWeaver; +using ReLogic.Reflection; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + [ReinitializeDuringResizeArrays] + public static class CalamityNPCTypeSets + { + public static SetFactory Factory = new SetFactory(NPCLoader.NPCCount, "CalamityMod/NPCType", Search); + public static IdDictionary Search = IdDictionary.Create(); + + public static bool[] AngryBones = Factory.CreateBoolSet(NPCID.AngryBones, NPCID.AngryBonesBig, NPCID.AngryBonesBigMuscle, NPCID.AngryBonesBigHelmet); + + public static bool[] BoundTownNPC = Factory.CreateBoolSet(NPCID.BoundGoblin, NPCID.BoundWizard, NPCID.BoundMechanic, NPCID.SleepingAngler, NPCID.BartenderUnconscious, + NPCID.WebbedStylist, NPCID.GolferRescue); + + public static bool[] Hornet = Factory.CreateBoolSet(NPCID.Hornet, NPCID.HornetFatty, NPCID.HornetHoney, NPCID.HornetLeafy, NPCID.HornetSpikey, NPCID.HornetStingy); + + // Used for dropping Ancient Bone Dust, vanilla has a Skeleton NPCID set which has more unwanted enemies in it + public static bool[] Skeleton = Factory.CreateBoolSet(NPCID.Skeleton, NPCID.HeadacheSkeleton, NPCID.MisassembledSkeleton, NPCID.PantlessSkeleton, NPCID.BoneThrowingSkeleton, + NPCID.BoneThrowingSkeleton2, NPCID.BoneThrowingSkeleton3, NPCID.BoneThrowingSkeleton4, NPCID.SkeletonTopHat, NPCID.SkeletonAstonaut, NPCID.SkeletonAlien, + NPCID.ArmoredSkeleton, NPCID.SkeletonArcher, NPCID.GreekSkeleton, NPCID.SporeSkeleton); + + // Unused, though is more restrictive than the vanilla Zombie NPCID set + public static bool[] Zombie = Factory.CreateBoolSet(NPCID.Zombie, NPCID.ArmedZombie, NPCID.BaldZombie, NPCID.PincushionZombie, NPCID.ArmedZombiePincussion, NPCID.SlimedZombie, + NPCID.ArmedZombieSlimed, NPCID.SwampZombie, NPCID.ArmedZombieSwamp, NPCID.TwiggyZombie, NPCID.ArmedZombieTwiggy, NPCID.FemaleZombie, NPCID.ArmedZombieCenx, + NPCID.ZombieRaincoat, NPCID.ZombieEskimo, NPCID.ArmedZombieEskimo, NPCID.MaggotZombie, NPCType()); + + + + public static List AquaticScourge = [ NPCType(), NPCType(), NPCType(), NPCType() ]; + + public static List Ares = [ NPCType(), NPCType(), NPCType(), NPCType(), NPCType() ]; + + public static List AstrumDeus = [ NPCType(), NPCType(), NPCType() ]; + + public static List DesertScourge = [ NPCType(), NPCType(), NPCType() ]; + + public static List Destroyer = [ NPCID.TheDestroyer, NPCID.TheDestroyerBody, NPCID.TheDestroyerTail ]; + + public static List DevourerOfGods = [ NPCType(), NPCType(), NPCType() ]; + + public static List EaterOfWorlds = [ NPCID.EaterofWorldsHead, NPCID.EaterofWorldsBody, NPCID.EaterofWorldsTail ]; + + public static List Perforators = [ NPCType(), NPCType(), NPCType(), NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), NPCType() ]; + + public static List Ravager = [ NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), NPCType() ]; + + public static List SkeletronPrime = [ NPCID.SkeletronPrime, NPCID.PrimeCannon, NPCID.PrimeLaser, NPCID.PrimeSaw, NPCID.PrimeVice ]; + + public static List SlimeGod = [ NPCType(), NPCType(), NPCType(), NPCType(), NPCType() ]; + + public static List StormWeaver = [ NPCType(), NPCType(), NPCType() ]; + + public static List Thanatos = [ NPCType(), NPCType(), NPCType(), NPCType() ]; + } +} diff --git a/Systems/Collections/CalamityProjectileSets.cs b/Systems/Collections/CalamityProjectileSets.cs new file mode 100644 index 0000000000..3e0b91e9f0 --- /dev/null +++ b/Systems/Collections/CalamityProjectileSets.cs @@ -0,0 +1,113 @@ +using CalamityMod.Projectiles.Boss; +using CalamityMod.Projectiles.Magic; +using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Summon; +using CalamityMod.Projectiles.Typeless; +using ReLogic.Reflection; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + [ReinitializeDuringResizeArrays] + public static class CalamityProjectileSets + { + public static SetFactory Factory = new SetFactory(ProjectileLoader.ProjectileCount, "CalamityMod/ProjectileID", Search); + public static IdDictionary Search = IdDictionary.Create(); + + /// + /// If for a projectile type, then that minion will completely ignore Calamity's summon damage penalty mechanic with no exceptions.
+ /// Unused by Calamity itself, and is only used for external mods to add to through mod calls.
+ /// Defaults to . + ///
+ public static bool[] MinionWhichIgnoresSummonerNerf = Factory.CreateBoolSet(); + + /// + /// If for a projectile type, then that projectile is spawned by a post-Plantera Dungeon enemy.
+ /// This increases the projectile's damage by a flat 30 if Moon Lord has been defeated.
+ /// Defaults to . + ///
+ public static bool[] IsBuffedDungeonProjectile = Factory.CreateBoolSet(ProjectileID.PaladinsHammerHostile, ProjectileID.ShadowBeamHostile, ProjectileID.InfernoHostileBolt, + ProjectileID.InfernoHostileBlast, ProjectileID.LostSoulHostile, ProjectileID.SniperBullet, ProjectileID.RocketSkeleton, ProjectileID.BulletDeadeye, ProjectileID.Shadowflames); + + /// + /// If for a projectile type, then that projectile is spawned by a Solar Eclipse, Pumpkin Moon, or Frost Moon enemy.
+ /// This increases the projectile's damage by a flat 15 during those events if Devourer of Gods has been defeated.
+ /// Defaults to . + ///
+ public static bool[] IsBuffedEventProjectile = Factory.CreateBoolSet(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); + + /// + /// If for a projectile type, then that projectile is considered a friendly bee.
+ /// Used to allow the projectile to inflict Plague while wearing the Plaguebringer armor.
+ /// Defaults to . + ///
+ public static bool[] IsFriendlyBeeProjectile = Factory.CreateBoolSet(ProjectileID.GiantBee, ProjectileID.Bee, ProjectileID.Wasp, ProjectileType(), + ProjectileType(), ProjectileType(), ProjectileType()); + + /// + /// If for a projectile type, then that projectile is a bomb or other explosive which is not a weapon.
+ /// Used to provide early-game worm bosses a resistance to their explosive damage.
+ /// Defaults to . + ///
+ public static bool[] ResistedExplosiveProjectile = Factory.CreateBoolSet(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.ScarabBomb, ProjectileID.TNTBarrel, ProjectileType()); + + /// + /// If for a projectile type, then that projectile will never be reflected by armor or accessory effects.
+ /// Set this for persistent projectiles such as deathrays to avoid major screwing of their behavior.
+ /// Only needs to be set for hostile projectiles, as these effects already have a check to ensure they never trigger in PvP.
+ /// Defaults to . + ///
+ public static bool[] ShouldNotBeReflected = Factory.CreateBoolSet(ProjectileID.SaucerDeathray, ProjectileID.PhantasmalDeathray, ProjectileType(), + ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), + ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), + ProjectileType(), ProjectileType(), ProjectileType()); + + /// + /// Determines what other projectiles this projectile will share ID-static immunity frames with. Defaults to -1, which means that it does not share immunity frames.
+ /// Each "set" of projectile which shares immunity frames is registered to point to the same ID reference, usually the first projectile in the set. If a projectile with this reference hits an NPC, all other projectiles with that reference also have their ID-static immunity cooldown set for that NPC. + ///
+ public static int[] SharedIDStaticIFrames = Factory.CreateIntSet(-1, + // Vanilla bees + ProjectileID.Bee, ProjectileID.Bee, + ProjectileID.GiantBee, ProjectileID.Bee, + // Vilethorn + ProjectileID.VilethornBase, ProjectileID.VilethornBase, + ProjectileID.VilethornTip, ProjectileID.VilethornBase, + // Nettle Burst + ProjectileID.NettleBurstRight, ProjectileID.NettleBurstRight, + ProjectileID.NettleBurstLeft, ProjectileID.NettleBurstRight, + ProjectileID.NettleBurstEnd, ProjectileID.NettleBurstRight, + // Magical Harp notes + ProjectileID.QuarterNote, ProjectileID.QuarterNote, + ProjectileID.EighthNote, ProjectileID.QuarterNote, + ProjectileID.TiedEighthNote, ProjectileID.QuarterNote, + // North Pole + ProjectileID.NorthPoleWeapon, ProjectileID.NorthPoleWeapon, + ProjectileID.NorthPoleSpear, ProjectileID.NorthPoleWeapon, + ProjectileID.NorthPoleSnowflake, ProjectileID.NorthPoleWeapon, + // Spore gas clouds + ProjectileID.SporeTrap, ProjectileID.SporeTrap, + ProjectileID.SporeTrap2, ProjectileID.SporeTrap, + ProjectileID.SporeGas, ProjectileID.SporeTrap, + ProjectileID.SporeGas2, ProjectileID.SporeTrap, + ProjectileID.SporeGas3, ProjectileID.SporeTrap, + // Astral Staff + ProjectileType(), ProjectileType(), + ProjectileType(), ProjectileType(), + // Keelhaul + ProjectileType(), ProjectileType(), + ProjectileType(), ProjectileType(), + // Toxic clouds + ProjectileID.ToxicCloud, ProjectileID.ToxicCloud, + ProjectileID.ToxicCloud2, ProjectileID.ToxicCloud, + ProjectileID.ToxicCloud3, ProjectileID.ToxicCloud + ); + } +} diff --git a/Systems/Collections/CalamityTileSets.cs b/Systems/Collections/CalamityTileSets.cs new file mode 100644 index 0000000000..e241e9881b --- /dev/null +++ b/Systems/Collections/CalamityTileSets.cs @@ -0,0 +1,22 @@ +using CalamityMod.Tiles.LivingFire; +using ReLogic.Reflection; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + [ReinitializeDuringResizeArrays] + public static class CalamityTileSets + { + public static SetFactory Factory = new SetFactory(TileLoader.TileCount, "CalamityMod/TileID", Search); + public static IdDictionary Search = IdDictionary.Create(); + + /// + /// Should only contain modded tiles. If for a tile type, then that tile can be replaced by the Abyss during world generation.
+ /// Unused by Calamity itself, and is only used for external mods to add to through reflection.
+ /// Defaults to . + ///
+ public static bool[] CanBeReplacedByAbyssGeneration = Factory.CreateBoolSet(); + } +} diff --git a/Systems/Collections/ConfusionDebuffImmunitiesList.cs b/Systems/Collections/ConfusionDebuffImmunitiesList.cs deleted file mode 100644 index 5b7e79cc23..0000000000 --- a/Systems/Collections/ConfusionDebuffImmunitiesList.cs +++ /dev/null @@ -1,57 +0,0 @@ -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() - ]; - } - - 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 deleted file mode 100644 index 39b22ffc30..0000000000 --- a/Systems/Collections/DebuffsList.cs +++ /dev/null @@ -1,100 +0,0 @@ -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 deleted file mode 100644 index 0f312357da..0000000000 --- a/Systems/Collections/DisabledSummonerNerfItemList.cs +++ /dev/null @@ -1,19 +0,0 @@ -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 deleted file mode 100644 index 48a47c670b..0000000000 --- a/Systems/Collections/DisabledSummonerNerfMinionList.cs +++ /dev/null @@ -1,19 +0,0 @@ -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/EventProjectileBuffList.cs b/Systems/Collections/EventProjectileBuffList.cs deleted file mode 100644 index 9f3db41e46..0000000000 --- a/Systems/Collections/EventProjectileBuffList.cs +++ /dev/null @@ -1,43 +0,0 @@ -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 deleted file mode 100644 index f68d38db98..0000000000 --- a/Systems/Collections/FireDebuffsList.cs +++ /dev/null @@ -1,43 +0,0 @@ -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 deleted file mode 100644 index 4ccdaf609f..0000000000 --- a/Systems/Collections/FriendlyBeesList.cs +++ /dev/null @@ -1,38 +0,0 @@ -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 deleted file mode 100644 index 917ae8271c..0000000000 --- a/Systems/Collections/GrenadeResistIDList.cs +++ /dev/null @@ -1,43 +0,0 @@ -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 deleted file mode 100644 index aea4781598..0000000000 --- a/Systems/Collections/HighTestFishingPoleList.cs +++ /dev/null @@ -1,27 +0,0 @@ -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 deleted file mode 100644 index 6fd8da39ab..0000000000 --- a/Systems/Collections/ItemsForcedInsideWorldList.cs +++ /dev/null @@ -1,110 +0,0 @@ -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/LivingFireTilesList.cs b/Systems/Collections/LivingFireTilesList.cs deleted file mode 100644 index 81b2d27c33..0000000000 --- a/Systems/Collections/LivingFireTilesList.cs +++ /dev/null @@ -1,40 +0,0 @@ -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 deleted file mode 100644 index b13da9e39b..0000000000 --- a/Systems/Collections/MagicGunIDList.cs +++ /dev/null @@ -1,63 +0,0 @@ -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(), - 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 deleted file mode 100644 index 7ca8a86472..0000000000 --- a/Systems/Collections/NPCIDs/AngryBonesIDList.cs +++ /dev/null @@ -1,28 +0,0 @@ -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 deleted file mode 100644 index e6b8dae864..0000000000 --- a/Systems/Collections/NPCIDs/AquaticScourgeIDList.cs +++ /dev/null @@ -1,27 +0,0 @@ -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 deleted file mode 100644 index 09b52cdd3a..0000000000 --- a/Systems/Collections/NPCIDs/AresIDList.cs +++ /dev/null @@ -1,28 +0,0 @@ -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 deleted file mode 100644 index d5ddc2b632..0000000000 --- a/Systems/Collections/NPCIDs/AstrumDeusIDList.cs +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index a3667b2fd0..0000000000 --- a/Systems/Collections/NPCIDs/BoundNPCIDList.cs +++ /dev/null @@ -1,29 +0,0 @@ -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 deleted file mode 100644 index ebacf52a13..0000000000 --- a/Systems/Collections/NPCIDs/CosmicGuardianIDList.cs +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index d0c72b67bf..0000000000 --- a/Systems/Collections/NPCIDs/DemonEyeIDList.cs +++ /dev/null @@ -1,36 +0,0 @@ -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 deleted file mode 100644 index 280a969845..0000000000 --- a/Systems/Collections/NPCIDs/DesertScourgeIDList.cs +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index 5199177076..0000000000 --- a/Systems/Collections/NPCIDs/DestroyerIDList.cs +++ /dev/null @@ -1,25 +0,0 @@ -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 deleted file mode 100644 index ff37b9725c..0000000000 --- a/Systems/Collections/NPCIDs/DevourerOfGodsIDList.cs +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index e4c2f65476..0000000000 --- a/Systems/Collections/NPCIDs/EaterOfWorldsIDList.cs +++ /dev/null @@ -1,25 +0,0 @@ -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 deleted file mode 100644 index db9e1b362a..0000000000 --- a/Systems/Collections/NPCIDs/GolemIDList.cs +++ /dev/null @@ -1,27 +0,0 @@ -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 deleted file mode 100644 index 3cb3d5e17f..0000000000 --- a/Systems/Collections/NPCIDs/HornetIDList.cs +++ /dev/null @@ -1,40 +0,0 @@ -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 deleted file mode 100644 index 9f05bd9acf..0000000000 --- a/Systems/Collections/NPCIDs/MossHornetIDList.cs +++ /dev/null @@ -1,27 +0,0 @@ -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 deleted file mode 100644 index 4bb42decc1..0000000000 --- a/Systems/Collections/NPCIDs/PerforatorWormIDList.cs +++ /dev/null @@ -1,32 +0,0 @@ -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 deleted file mode 100644 index 61dfdb3135..0000000000 --- a/Systems/Collections/NPCIDs/RavagerIDList.cs +++ /dev/null @@ -1,30 +0,0 @@ -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 deleted file mode 100644 index ec63ae51f9..0000000000 --- a/Systems/Collections/NPCIDs/SkeletonIDList.cs +++ /dev/null @@ -1,50 +0,0 @@ -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 deleted file mode 100644 index 2cf7a31640..0000000000 --- a/Systems/Collections/NPCIDs/SkeletronPrimeIDList.cs +++ /dev/null @@ -1,29 +0,0 @@ -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, - 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 deleted file mode 100644 index 85bdebd8b6..0000000000 --- a/Systems/Collections/NPCIDs/SlimeGodIDList.cs +++ /dev/null @@ -1,28 +0,0 @@ -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 deleted file mode 100644 index 39f1ecd0fa..0000000000 --- a/Systems/Collections/NPCIDs/StormWeaverIDList.cs +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index 8688eac6b6..0000000000 --- a/Systems/Collections/NPCIDs/ThanatosIDList.cs +++ /dev/null @@ -1,27 +0,0 @@ -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 deleted file mode 100644 index 0b5ece97d5..0000000000 --- a/Systems/Collections/NPCIDs/ZombieIDList.cs +++ /dev/null @@ -1,59 +0,0 @@ -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 deleted file mode 100644 index 9fd9f5a0a4..0000000000 --- a/Systems/Collections/NPCs/BossHPScalingList.cs +++ /dev/null @@ -1,152 +0,0 @@ -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() - ]; - } - - 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 deleted file mode 100644 index 452538f8b9..0000000000 --- a/Systems/Collections/NPCs/BossRushHPChangeDict.cs +++ /dev/null @@ -1,127 +0,0 @@ -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 }, - - { NPCID.EaterofWorldsHead, 15000 }, // 30 seconds + immunity timer at start - { NPCID.EaterofWorldsBody, 15000 }, - { NPCID.EaterofWorldsTail, 15000 }, - - { 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 }, - - { NPCID.TheDestroyer, 600000 }, // 30 seconds + immunity timer at start - { NPCID.TheDestroyerBody, 600000 }, - { NPCID.TheDestroyerTail, 600000 }, - { NPCID.Probe, 10000 }, - - { NPCID.SkeletronPrime, 160000 }, // 30 seconds - { 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 deleted file mode 100644 index c04456463f..0000000000 --- a/Systems/Collections/NPCs/BossTypeDict.cs +++ /dev/null @@ -1,112 +0,0 @@ -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/BuffedDungeonEnemiesList.cs b/Systems/Collections/NPCs/BuffedDungeonEnemiesList.cs deleted file mode 100644 index 78c00a647b..0000000000 --- a/Systems/Collections/NPCs/BuffedDungeonEnemiesList.cs +++ /dev/null @@ -1,52 +0,0 @@ -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 deleted file mode 100644 index 9a9f638071..0000000000 --- a/Systems/Collections/NPCs/DeathModeSplittingWormList.cs +++ /dev/null @@ -1,31 +0,0 @@ -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 deleted file mode 100644 index aaff7f27b1..0000000000 --- a/Systems/Collections/NPCs/EclipseBuffList.cs +++ /dev/null @@ -1,42 +0,0 @@ -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 deleted file mode 100644 index 87699925d8..0000000000 --- a/Systems/Collections/NPCs/EnemyImmunitiesList.cs +++ /dev/null @@ -1,187 +0,0 @@ -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, - 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, - NPCID.SkeletronPrime, - 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 deleted file mode 100644 index d94d780e9e..0000000000 --- a/Systems/Collections/NPCs/FrostMoonBuffList.cs +++ /dev/null @@ -1,40 +0,0 @@ -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 deleted file mode 100644 index a8d0a144bd..0000000000 --- a/Systems/Collections/NPCs/HardmodeNPCNerfList.cs +++ /dev/null @@ -1,155 +0,0 @@ -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 deleted file mode 100644 index f2e0ed4f62..0000000000 --- a/Systems/Collections/NPCs/MinibossList.cs +++ /dev/null @@ -1,52 +0,0 @@ -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 deleted file mode 100644 index 456dbaa828..0000000000 --- a/Systems/Collections/NPCs/NoRageWormSegmentList.cs +++ /dev/null @@ -1,47 +0,0 @@ -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/PumpkinMoonBuffList.cs b/Systems/Collections/NPCs/PumpkinMoonBuffList.cs deleted file mode 100644 index 6ab32c0323..0000000000 --- a/Systems/Collections/NPCs/PumpkinMoonBuffList.cs +++ /dev/null @@ -1,42 +0,0 @@ -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 deleted file mode 100644 index c5f8624656..0000000000 --- a/Systems/Collections/NPCs/ZeroContactDamageNPCList.cs +++ /dev/null @@ -1,124 +0,0 @@ -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.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 deleted file mode 100644 index 1cd6d90efe..0000000000 --- a/Systems/Collections/NeedsDebuffIconDisplayList.cs +++ /dev/null @@ -1,27 +0,0 @@ -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 deleted file mode 100644 index 01e165e604..0000000000 --- a/Systems/Collections/PersistentBuffList.cs +++ /dev/null @@ -1,38 +0,0 @@ -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/ProjectileDestroyExceptionsList.cs b/Systems/Collections/ProjectileDestroyExceptionsList.cs deleted file mode 100644 index 7b2c882b31..0000000000 --- a/Systems/Collections/ProjectileDestroyExceptionsList.cs +++ /dev/null @@ -1,150 +0,0 @@ -using System.Collections.Generic; -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 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(), - 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/SharedStaticIFramesIDSet.cs b/Systems/Collections/SharedStaticIFramesIDSet.cs deleted file mode 100644 index c8a102b76d..0000000000 --- a/Systems/Collections/SharedStaticIFramesIDSet.cs +++ /dev/null @@ -1,137 +0,0 @@ -using System.Collections.Generic; -using CalamityMod.Projectiles.Magic; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Systems.Collections -{ - /// - /// A which contains an ProjectileID Set, created with the appropriate factory.
- ///
- /// This is populated from a much more human readable set of "shared iframe lists", contained in OnModLoad. - ///
- public sealed class SharedStaticIFrames : ModSystem - { - public static IDictionary> SharedIFrameSets { get; private set; } - public static int[] SharedIFrameFactorySet { get; private set; } - - public override void PostSetupContent() - { - // This transient structure is used to make the setup of intended shared-iframe sets as easy as possible. - // - // If you want to add a new projectile to share iframes with any existing sets, just add it to that [ area ]. - // - // If you want to create a brand new shared iframe set, just add a new [ area ] at the bottom. - IList> setupLists = - [ - [ // Set 1: Vanilla bees (Hive Pack) - ProjectileID.Bee, - ProjectileID.GiantBee - ], - - [ // Set 2: Vilethorn - ProjectileID.VilethornBase, - ProjectileID.VilethornTip - ], - - [ // Set 3: Nettle Burst - ProjectileID.NettleBurstLeft, - ProjectileID.NettleBurstRight, - ProjectileID.NettleBurstEnd - ], - - [ // Set 4: Harp notes - ProjectileID.QuarterNote, - ProjectileID.EighthNote, - ProjectileID.TiedEighthNote - ], - - [ // Set 5: The North Pole - ProjectileID.NorthPoleWeapon, - ProjectileID.NorthPoleSpear, - ProjectileID.NorthPoleSnowflake, - ], - - [ // Set 6: All spore gas clouds - ProjectileID.SporeTrap, - ProjectileID.SporeTrap2, - ProjectileID.SporeGas, - ProjectileID.SporeGas2, - ProjectileID.SporeGas3 - ], - - [ // Set 7: Astral Staff - ModContent.ProjectileType(), - ModContent.ProjectileType() - ], - - [ // Set 8: Keelhaul - ModContent.ProjectileType(), - ModContent.ProjectileType() - ], - - [ // Set 9: All toxic clouds - ProjectileID.ToxicCloud, - ProjectileID.ToxicCloud2, - ProjectileID.ToxicCloud3 - ] - ]; - - // Convert the above list-of-lists into a dictionary, where the key is the shared iframe projectile ID. - SharedIFrameSets = new SortedDictionary>(); - foreach (var innerList in setupLists) - { - int sharedIDForThisSet = innerList[0]; - SharedIFrameSets.Add(sharedIDForThisSet, innerList); - } - - // Now construct a vanilla Terraria Projectile ID Set using the appropriate factory. - - // Calculate the total length of the input buffer to the factory - int totalLength = 0; - foreach(var l in SharedIFrameSets.Values) - totalLength += l.Count; - - // Create the buffer and fill it - int[] buffer = new int[totalLength * 2]; - int idx = 0; - foreach (var sharedFrameList in setupLists) - { - int sharedIDForThisSet = sharedFrameList[0]; - - foreach (var projID in sharedFrameList) - { - buffer[idx++] = projID; - buffer[idx++] = sharedIDForThisSet; - } - } - - SharedIFrameFactorySet = ProjectileID.Sets.Factory.CreateIntSet(-1, buffer); - } - - public override void Unload() - { - SharedIFrameSets = null; - SharedIFrameFactorySet = null; - } - - /// - /// A shorthand method to check if this projectile shares static iframes in any way. - /// - public static bool Includes(int projType) => SharedIFrameFactorySet[projType] != -1; - - /// - /// The intended - /// - /// The projectile type to get the set of shared iframe projectile IDs for. - /// A list of projectile IDs that share static iframes with this projectile ID. This list may be empty. - public static IList GetSharedStaticIFrames(int projType) - { - int sharedSetID = SharedIFrameFactorySet[projType]; - bool setExists = SharedIFrameSets.TryGetValue(sharedSetID, out var ret); - - return setExists ? ret : []; - } - } -} diff --git a/Systems/Collections/SicknessDebuffsList.cs b/Systems/Collections/SicknessDebuffsList.cs deleted file mode 100644 index 7d687952a6..0000000000 --- a/Systems/Collections/SicknessDebuffsList.cs +++ /dev/null @@ -1,39 +0,0 @@ -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/SummonTagBuffList.cs b/Systems/Collections/SummonTagBuffList.cs deleted file mode 100644 index c37383d0bd..0000000000 --- a/Systems/Collections/SummonTagBuffList.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Collections.Generic; -using CalamityMod.Buffs.Summon.Whips; -using Terraria.ID; -using Terraria.ModLoader; -using static Terraria.ModLoader.ModContent; - -namespace CalamityMod.Systems.Collections -{ - /// - /// A that contains a of all summon tag buff's IDs. - /// - public sealed class SummonTagBuffList : ModSystem - { - public static IList List { get; private set; } - - public override void OnModLoad() - { - List = - [ - BuffID.CoolWhipPlayerBuff, - BuffID.ScytheWhipPlayerBuff, - BuffID.SwordWhipPlayerBuff, - BuffID.ThornWhipPlayerBuff, - BuffType() - ]; - } - - public override void Unload() => List = null; - - /// - /// A shorthand method to check whether or not a buff ID is a summon tag buff. - /// - public static bool Includes(int buffID) => List.Contains(buffID); - } -} diff --git a/Systems/Collections/SummonTagDebuffDict.cs b/Systems/Collections/SummonTagDebuffDict.cs deleted file mode 100644 index ca07c34f3f..0000000000 --- a/Systems/Collections/SummonTagDebuffDict.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.Collections.Generic; -using CalamityMod.Buffs.Summon.Whips; -using CalamityMod.DataStructures; -using CalamityMod.Items.Accessories; -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 all summon tag debuff's IDs and their associated SummonTag. - /// - public sealed class SummonTagDebuffDict : ModSystem - { - public static IDictionary Dict { get; private set; } - - public override void OnModLoad() - { - Dict = new Dictionary - { - { BuffID.BlandWhipEnemyDebuff, SummonTag.LeatherWhip }, - { BuffID.BoneWhipNPCDebuff, SummonTag.SpinalTap }, - { BuffID.CoolWhipNPCDebuff, SummonTag.CoolWhip }, - { BuffID.FlameWhipEnemyDebuff, SummonTag.Firecracker }, - { BuffID.MaceWhipNPCDebuff, SummonTag.MorningStar }, - { BuffID.RainbowWhipNPCDebuff, SummonTag.Kaleidoscope }, - { BuffID.ScytheWhipEnemyDebuff, SummonTag.DarkHarvest }, - { BuffID.SwordWhipNPCDebuff, SummonTag.Durendal }, - { BuffID.ThornWhipNPCDebuff, SummonTag.Snapthorn }, - { BuffType(), ProfanedSoulCrystal.SummonTag }, - }; - - } - - public override void Unload() - { - Dict?.Clear(); - Dict = null; - } - - /// - /// A shorthand method to obtain a SummonTag from its debuff. - /// - public static bool TryGet(int buffType, out SummonTag tag) - { - return Dict.TryGetValue(buffType, out tag); - } - - public static bool Add(int buffType, SummonTag tag) - { - return Dict.TryAdd(buffType, tag); - } - } -} diff --git a/Systems/Collections/VeneratedLocketBanList.cs b/Systems/Collections/VeneratedLocketBanList.cs deleted file mode 100644 index 2aef022abf..0000000000 --- a/Systems/Collections/VeneratedLocketBanList.cs +++ /dev/null @@ -1,30 +0,0 @@ -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() - ]; - } - - public override void Unload() => List = null; - - public static bool Includes(int itemType) => List.Contains(itemType); - } -} diff --git a/Systems/Graphic/LightingEffectsSystem.cs b/Systems/Graphic/LightingEffectsSystem.cs index 6fa1fddea4..1bc1a1631b 100644 --- a/Systems/Graphic/LightingEffectsSystem.cs +++ b/Systems/Graphic/LightingEffectsSystem.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Systems // Total darkness float signusDarkness = signusLifeRatio * multiplier; darkRatio = MathHelper.Clamp(signusDarkness, 0f, 1f); - scale += (CalamityWorld.LegendaryMode ? MaxGFBSignusDarkness : MaxSignusDarkness) * darkRatio; + scale += (Main.zenithWorld ? MaxGFBSignusDarkness : MaxSignusDarkness) * darkRatio; } } } diff --git a/Systems/Mechanic/DifficultyModeSystem.cs b/Systems/Mechanic/DifficultyModeSystem.cs index ad8bc82f47..98906a763f 100644 --- a/Systems/Mechanic/DifficultyModeSystem.cs +++ b/Systems/Mechanic/DifficultyModeSystem.cs @@ -7,6 +7,7 @@ using CalamityMod.UI.ModeIndicator; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using Newtonsoft.Json.Linq; using ReLogic.Content; using Terraria; using Terraria.Audio; @@ -22,6 +23,7 @@ namespace CalamityMod.Systems public class DifficultyModeSystem : ModSystem { internal static bool _hasCheckedItOutYet = false; //Simple variable to add a cool effect to the mode selector + internal static int _newGameModeID = GameModeID.Normal; public static List Difficulties = new List(); //Difficulty modes ordered by ascending difficulty public static List DifficultyTiers; //Difficulty modes grouped together by difficulty @@ -30,11 +32,14 @@ namespace CalamityMod.Systems public static FieldInfo journeySliderCacheField; // The current value of the journey mode difficulty slider public static MethodInfo journeyDifficultyUpdateMethod; // The method which updates difficulty modes in journey mode - public override void Load() + public override void OnModLoad() { MostAlternateDifficulties = 1; //Initialize base mod difficulties - Difficulties = new List() { new NoDifficulty(), new ExpertDifficulty(), new MasterDifficulty(), new RevengeanceDifficulty(), new DeathDifficulty() }; + Difficulties = new List() { ModContent.GetInstance(), + ModContent.GetInstance(), + ModContent.GetInstance(), ModContent.GetInstance(), + ModContent.GetInstance() }; // Reflect private journey difficulty slider info journeySliderCacheField = typeof(CreativePowers.DifficultySliderPower).GetField("_sliderCurrentValueCache", BindingFlags.Instance | BindingFlags.NonPublic); @@ -43,7 +48,7 @@ namespace CalamityMod.Systems CalculateDifficultyData(); } - public override void Unload() + public override void OnModUnload() { Difficulties = null; } @@ -51,11 +56,68 @@ namespace CalamityMod.Systems // Makes the world automatically convert to Death if in Master, or out of Death if in Expert public override void PostUpdateWorld() { - if (Main.GameMode == GameModeID.Expert && GetCurrentDifficulty == DeathDifficulty.Instance) - ModeIndicatorUI.SwitchToDifficulty(RevengeanceDifficulty.Instance); - if (Main.GameMode == GameModeID.Master && GetCurrentDifficulty == RevengeanceDifficulty.Instance) - ModeIndicatorUI.SwitchToDifficulty(DeathDifficulty.Instance); + static void HandleExternalGameModeChange(int tier) + { + switch (tier) + { + case GameModeID.Normal: + { + // vanilla game mode in classic, but cal difficulty >= expert + if (GetCurrentDifficulty == ModContent.GetInstance() || GetCurrentDifficulty == ModContent.GetInstance()) + { + ModeIndicatorUI.SwitchToDifficulty(ModContent.GetInstance()); + } + break; + } + case GameModeID.Expert: + { + // if death was activated, change it to revengence + if (GetCurrentDifficulty == ModContent.GetInstance()) + { + ModeIndicatorUI.SwitchToDifficulty(ModContent.GetInstance()); + } + break; + } + case GameModeID.Master: + { + // if revengence and master both activated, change it to death + if (GetCurrentDifficulty != ModContent.GetInstance() && CalamityWorld.revenge) + { + ModeIndicatorUI.SwitchToDifficulty(ModContent.GetInstance()); + } + break; + } + } + } + + if (Main.GameMode == GameModeID.Creative) + { + CreativePowers.DifficultySliderPower power = CreativePowerManager.Instance.GetPower(); + if (power.GetIsUnlocked()) + { + int effectiveVanillaDifficulty; + var sliderValue = (float)journeySliderCacheField.GetValue(power); + if (sliderValue == 1) + { + effectiveVanillaDifficulty = GameModeID.Master; + } + else if (sliderValue >= 0.66f) + { + effectiveVanillaDifficulty = GameModeID.Expert; + } + else + { + effectiveVanillaDifficulty = GameModeID.Normal; + } + HandleExternalGameModeChange(effectiveVanillaDifficulty); + } + } + else + { + HandleExternalGameModeChange(Main.GameMode); + } } + public static DifficultyMode GetCurrentDifficulty { @@ -104,6 +166,45 @@ namespace CalamityMod.Systems Difficulties[i]._difficultyTier = tierIndex; } } + private static readonly Dictionary compatitableValueRanges = new() + { + { GameModeID.Normal, (0.33f, 0.66f ) }, + { GameModeID.Expert, (0.66f, 1f) }, + { GameModeID.Master, (1f, 1f) } + }; + + public static void AlignJourneyDifficultySlider() + { + if(Main.GameMode != GameModeID.Creative) + { + // I have to throw an unhandled exception here to make you alerted to bugs while developing + // If this is tested and working, turn it into a silent warning before release + throw new ArgumentException("DifficultyModeSystemAlignJourneyDifficultySlider(): must be invoked in journey mode"); + } + CreativePowers.DifficultySliderPower power = CreativePowerManager.Instance.GetPower(); + var oldValue = (float)journeySliderCacheField.GetValue(power); + if (compatitableValueRanges.ContainsKey(_newGameModeID)) + { + var (low, high) = compatitableValueRanges[_newGameModeID]; + float valueToSet; + if (oldValue >= low && oldValue < high) + { + valueToSet = oldValue; + } + else + { + valueToSet = low; + } + journeySliderCacheField.SetValue(power, valueToSet); + journeyDifficultyUpdateMethod.Invoke(power, null); + } + else + { + // I have to throw an unhandled exception here to make you alerted to bugs while developing + // If this is tested and working, turn it into a silent warning before release + throw new ArgumentException("DifficultyModeSystemAlignJourneyDifficultySlider(): _newGameModeID must be in GameModeID.Normal, Expert, Master"); + } + } public override void SaveWorldData(TagCompound tag) { @@ -136,28 +237,36 @@ namespace CalamityMod.Systems } } - public abstract class DifficultyMode + public abstract class DifficultyMode : ModType { + protected override void Register() + { + // This is registered in DifficultyModeSystem.OnModLoad + // Note that DifficultyModeSystem.Load can't ensure system is loaded after all modes + } public abstract bool Enabled { get; set; } + protected Asset _texture; public abstract Asset Texture { get; } + protected Asset _textureDisabled; public abstract Asset TextureDisabled { get; } + protected SoundStyle? _activationSound; + public abstract SoundStyle ActivationSound{ get; } + public abstract int BackBoneGameModeID { get; } + internal int _difficultyTier; + public abstract float DifficultyScale{ get; } + + public new abstract LocalizedText Name { get; } + public abstract Color ChatTextColor{ get; } + public abstract LocalizedText ShortDescription{ get; } public virtual LocalizedText ExpandedDescription => LocalizedText.Empty; - public float DifficultyScale; - public LocalizedText Name; - public LocalizedText ShortDescription; - public Color ChatTextColor; - - public LocalizedText FTWName; - public Color FTWTextColor; - - public SoundStyle ActivationSound; - - internal int _difficultyTier; + public abstract LocalizedText FTWName{ get; } + public abstract Color FTWTextColor{ get; } + /// /// Used to know which difficulties to toggle on when selecting a particular difficulty. @@ -173,62 +282,37 @@ namespace CalamityMod.Systems { get => true; set + { + if (!Main.GameModeInfo.IsJourneyMode) { - if (!Main.GameModeInfo.IsJourneyMode) - { - Main.GameMode = value == true ? GameModeID.Normal : GameModeID.Expert; - } - else - { - CreativePowers.DifficultySliderPower power = CreativePowerManager.Instance.GetPower(); - if (power.GetIsUnlocked()) - { - DifficultyModeSystem.journeySliderCacheField.SetValue(power, value == true ? 0.33f : 0.66f); - DifficultyModeSystem.journeyDifficultyUpdateMethod.Invoke(power, null); - } - } + Main.GameMode = value == true ? GameModeID.Normal : GameModeID.Expert; + } + else + { + DifficultyModeSystem.AlignJourneyDifficultySlider(); } - } - - private Asset _texture; - public override Asset Texture - { - get - { - if (_texture == null) - _texture = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Classic"); - - return _texture; - } - } - private Asset _textureDisabled; - public override Asset TextureDisabled - { - get - { - if (_textureDisabled == null) - _textureDisabled = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Classic_Off"); - - return _textureDisabled; } } - public NoDifficulty() - { - DifficultyScale = 0; - Name = Language.GetText("UI.Normal"); - ShortDescription = GetText("UI.ClassicInfo"); - ChatTextColor = Color.White; + public override Asset Texture => _texture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Classic"); - FTWName = Language.GetText("UI.Expert"); - FTWTextColor = new Color(255, 186, 117); // World display: Main.mcColor + public override Asset TextureDisabled => _textureDisabled ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Classic_Off"); - ActivationSound = SoundID.MenuTick with { Volume = 1f }; + public override SoundStyle ActivationSound => _activationSound ??= SoundID.MenuTick with { Volume = 1f }; - Instance = this; - } + public override int BackBoneGameModeID => GameModeID.Normal; - public static NoDifficulty Instance { get; private set; } = null; + public override float DifficultyScale => 0; + + public override LocalizedText Name => Language.GetText("UI.Normal"); + + public override Color ChatTextColor => Color.White; + + public override LocalizedText ShortDescription => GetText("UI.ClassicInfo"); + + public override LocalizedText FTWName => Language.GetText("UI.Expert"); + + public override Color FTWTextColor => new Color(255, 186, 117); // World display: Main.mcColor } public class ExpertDifficulty : DifficultyMode @@ -244,57 +328,31 @@ namespace CalamityMod.Systems } else { - CreativePowers.DifficultySliderPower power = CreativePowerManager.Instance.GetPower(); - if (power.GetIsUnlocked()) - { - DifficultyModeSystem.journeySliderCacheField.SetValue(power, value == true ? 0.66f : 0.33f); - DifficultyModeSystem.journeyDifficultyUpdateMethod.Invoke(power, null); - } + DifficultyModeSystem.AlignJourneyDifficultySlider(); } } } - private Asset _texture; - public override Asset Texture - { - get - { - if (_texture == null) - _texture = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Expert"); + public override Asset Texture => _texture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Expert"); - return _texture; - } - } - private Asset _textureDisabled; - public override Asset TextureDisabled - { - get - { - if (_textureDisabled == null) - _textureDisabled = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Expert_Off"); + public override Asset TextureDisabled => _textureDisabled ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Expert_Off"); - return _textureDisabled; - } - } + public override SoundStyle ActivationSound => _activationSound ??= SoundID.ForceRoarPitched; + + public override int BackBoneGameModeID => GameModeID.Expert; + + public override float DifficultyScale => 0.1f; + + public override LocalizedText Name => Language.GetText("UI.Expert"); + public override Color ChatTextColor => new Color(255, 186, 117); // World display: Main.mcColor + + public override LocalizedText ShortDescription => GetText("UI.ExpertShortInfo"); public override LocalizedText ExpandedDescription => GetText("UI.ExpertExpandedInfo"); - public ExpertDifficulty() - { - DifficultyScale = 0.1f; - Name = Language.GetText("UI.Expert"); - ShortDescription = GetText("UI.ExpertShortInfo"); - ChatTextColor = new Color(255, 186, 117); // World display: Main.mcColor + public override LocalizedText FTWName => Language.GetText("UI.Master"); - FTWName = Language.GetText("UI.Master"); - FTWTextColor = new Color(28, 255, 170); // World display: Main.hcColor - - ActivationSound = SoundID.ForceRoarPitched; - - Instance = this; - } - - public static ExpertDifficulty Instance { get; private set; } = null; + public override Color FTWTextColor => new Color(28, 255, 170); // World display: Main.hcColor } public class MasterDifficulty : DifficultyMode @@ -310,57 +368,33 @@ namespace CalamityMod.Systems } else { - CreativePowers.DifficultySliderPower power = CreativePowerManager.Instance.GetPower(); - if (power.GetIsUnlocked()) - { - DifficultyModeSystem.journeySliderCacheField.SetValue(power, value == true ? 1f : 0.66f); - DifficultyModeSystem.journeyDifficultyUpdateMethod.Invoke(power, null); - } + DifficultyModeSystem.AlignJourneyDifficultySlider(); } } } - private Asset _texture; - public override Asset Texture - { - get - { - if (_texture == null) - _texture = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Master"); + public override Asset Texture => _texture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Master"); + + public override Asset TextureDisabled => _textureDisabled ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Master_Off"); - return _texture; - } - } - private Asset _textureDisabled; - public override Asset TextureDisabled - { - get - { - if (_textureDisabled == null) - _textureDisabled = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Master_Off"); + public override SoundStyle ActivationSound => _activationSound ??= SoundID.NPCDeath10; - return _textureDisabled; - } - } + public override int BackBoneGameModeID => GameModeID.Master; + + public override float DifficultyScale => 0.25f; + + public override LocalizedText Name => Language.GetText("UI.Master"); + + public override Color ChatTextColor => new Color(28, 255, 170); // World display: Main.hcColor + + public override LocalizedText ShortDescription => GetText("UI.MasterShortInfo"); public override LocalizedText ExpandedDescription => GetText("UI.MasterExpandedInfo"); - public MasterDifficulty() - { - DifficultyScale = 0.25f; - Name = Language.GetText("UI.Master"); - ShortDescription = GetText("UI.MasterShortInfo"); - ChatTextColor = new Color(28, 255, 170); // World display: Main.hcColor + public override LocalizedText FTWName => Language.GetText("UI.Legendary"); - FTWName = Language.GetText("UI.Legendary"); - FTWTextColor = Main.legendaryModeColor; + public override Color FTWTextColor => Main.legendaryModeColor; - ActivationSound = SoundID.NPCDeath10; - - Instance = this; - } - - public static MasterDifficulty Instance { get; private set; } = null; } public class RevengeanceDifficulty : DifficultyMode @@ -380,28 +414,21 @@ namespace CalamityMod.Systems } } - private Asset _texture; - public override Asset Texture - { - get - { - if (_texture == null) - _texture = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Rev"); + public override Asset Texture => _texture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Rev"); - return _texture; - } - } - private Asset _textureDisabled; - public override Asset TextureDisabled - { - get - { - if (_textureDisabled == null) - _textureDisabled = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Rev_Off"); + public override Asset TextureDisabled => _textureDisabled ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Rev_Off"); - return _textureDisabled; - } - } + public override SoundStyle ActivationSound => _activationSound ??= SoundID.Item119; + + public override int BackBoneGameModeID => GameModeID.Expert; + + public override float DifficultyScale => 0.25f; + + public override LocalizedText Name => GetText("UI.Revengeance"); + + public override Color ChatTextColor => new Color(211, 42, 42); + + public override LocalizedText ShortDescription => GetText("UI.RevengeanceShortInfo"); public override LocalizedText ExpandedDescription { @@ -413,22 +440,9 @@ namespace CalamityMod.Systems } } - public RevengeanceDifficulty() - { - DifficultyScale = 0.25f; - Name = GetText("UI.Revengeance"); - ShortDescription = GetText("UI.RevengeanceShortInfo"); - ChatTextColor = new Color(211, 42, 42); + public override LocalizedText FTWName => GetText("UI.Death"); - FTWName = GetText("UI.Death"); - FTWTextColor = new Color(192, 64, 219); - - ActivationSound = SoundID.Item119; - - Instance = this; - } - - public static RevengeanceDifficulty Instance { get; private set; } = null; + public override Color FTWTextColor => new Color(192, 64, 219); } public class DeathDifficulty : DifficultyMode @@ -446,12 +460,7 @@ namespace CalamityMod.Systems } else { - CreativePowers.DifficultySliderPower power = CreativePowerManager.Instance.GetPower(); - if (power.GetIsUnlocked()) - { - DifficultyModeSystem.journeySliderCacheField.SetValue(power, value == true ? 1f : 0.66f); - DifficultyModeSystem.journeyDifficultyUpdateMethod.Invoke(power, null); - } + DifficultyModeSystem.AlignJourneyDifficultySlider(); } CalamityWorld.death = value; } @@ -460,45 +469,28 @@ namespace CalamityMod.Systems } } - private Asset _texture; - public override Asset Texture - { - get - { - if (_texture == null) - _texture = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Death"); + public override Asset Texture => _texture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Death"); - return _texture; - } - } - private Asset _textureDisabled; - public override Asset TextureDisabled - { - get - { - if (_textureDisabled == null) - _textureDisabled = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Death_Off"); + public override Asset TextureDisabled => _textureDisabled ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Death_Off"); - return _textureDisabled; - } - } + public override SoundStyle ActivationSound => _activationSound ??= DemonshadeHelm.ActivationSound; + + public override int BackBoneGameModeID => GameModeID.Master; + + public override float DifficultyScale => 0.5f; + + public override LocalizedText Name => GetText("UI.Death"); + + public override Color ChatTextColor => new Color(192, 64, 219); + + public override LocalizedText ShortDescription => GetText("UI.DeathShortInfo"); public override LocalizedText ExpandedDescription => GetText("UI.DeathExpandedInfo"); - public DeathDifficulty() - { - DifficultyScale = 0.5f; - Name = GetText("UI.Death"); - ShortDescription = GetText("UI.DeathShortInfo"); - ChatTextColor = new Color(192, 64, 219); - FTWName = GetText("UI.Malice"); - FTWTextColor = new Color(240, 128, 128); + public override LocalizedText FTWName => GetText("UI.Malice"); - ActivationSound = DemonshadeHelm.ActivationSound; - - Instance = this; - } + public override Color FTWTextColor => new Color(240, 128, 128); public override int[] FavoredDifficultyAtTier(int tier) { @@ -508,7 +500,7 @@ namespace CalamityMod.Systems for (int i = 0; i < tierList.Length; i++) { - if (tierList[i].Name == GetText("UI.Master") || tierList[i].Name == GetText("UI.Revengeance")) + if (tierList[i] is MasterDifficulty || tierList[i] is RevengeanceDifficulty) difficulties.Add(i); } @@ -517,6 +509,5 @@ namespace CalamityMod.Systems return difficulties.ToArray(); } - public static DeathDifficulty Instance { get; private set; } = null; } } diff --git a/Systems/Mechanic/RecipeSystem.cs b/Systems/Mechanic/RecipeSystem.cs index ddc20ba5fb..ba26817d84 100644 --- a/Systems/Mechanic/RecipeSystem.cs +++ b/Systems/Mechanic/RecipeSystem.cs @@ -11,6 +11,8 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Items.Placeables.FurnitureDriftwood; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using CalamityMod.Items.Placeables.Crags; using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Items.Tools; @@ -1630,30 +1632,6 @@ namespace CalamityMod.Systems r.Register(); r.DisableDecraft(); - // Mechanical Glove directly from correct class emblem for cheaper (compromise) - r = Recipe.Create(ItemID.MechanicalGlove); - r.AddIngredient(ItemID.PowerGlove); - r.AddIngredient(ItemID.WarriorEmblem); - r.AddIngredient(ItemID.SoulofFright); - r.AddIngredient(ItemID.SoulofMight); - r.AddIngredient(ItemID.SoulofSight); - r.AddTile(TileID.TinkerersWorkbench); - r.Register(); - r.SortAfterFirstRecipesOf(ItemID.MechanicalGlove); - r.DisableDecraft(); - - // Celestial Emblem directly from correct class emblem for cheaper (compromise) - r = Recipe.Create(ItemID.CelestialEmblem); - r.AddIngredient(ItemID.CelestialMagnet); - r.AddIngredient(ItemID.SorcererEmblem); - r.AddIngredient(ItemID.SoulofFright); - r.AddIngredient(ItemID.SoulofMight); - r.AddIngredient(ItemID.SoulofSight); - r.AddTile(TileID.TinkerersWorkbench); - r.Register(); - r.SortAfterFirstRecipesOf(ItemID.CelestialEmblem); - r.DisableDecraft(); - // Tiershift Mini Nuke 1s to post Moon Lord. r = Recipe.Create(ItemID.MiniNukeI, 333); r.AddIngredient(ItemID.RocketIII, 333); diff --git a/Systems/World/BestiaryRegistrySystem.cs b/Systems/World/BestiaryRegistrySystem.cs index 10e32c9b49..42b2228f25 100644 --- a/Systems/World/BestiaryRegistrySystem.cs +++ b/Systems/World/BestiaryRegistrySystem.cs @@ -17,7 +17,6 @@ namespace CalamityMod.Systems ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[NPCType()] = ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[NPCType()]; ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[NPCType()] = ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[NPCType()]; ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[NPCType()] = ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[NPCType()]; - ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[NPCType()] = ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[NPCType()]; ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[NPCType()] = ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[NPCID.LavaSlime]; } } diff --git a/Tiles/Abyss/AcidWoodTree.cs b/Tiles/Abyss/AcidWoodTree.cs index 0e790dcafb..ef235d14ed 100644 --- a/Tiles/Abyss/AcidWoodTree.cs +++ b/Tiles/Abyss/AcidWoodTree.cs @@ -1,7 +1,7 @@ using CalamityMod.Dusts; using CalamityMod.Gores.Trees; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using CalamityMod.Items.Potions.Food; using CalamityMod.Items.Tools; using CalamityMod.NPCs.AcidRain; diff --git a/Tiles/Astral/AstralBeacon.cs b/Tiles/Astral/AstralBeacon.cs index 39410d4401..f773a5e22a 100644 --- a/Tiles/Astral/AstralBeacon.cs +++ b/Tiles/Astral/AstralBeacon.cs @@ -20,7 +20,6 @@ namespace CalamityMod.Tiles.Astral { public const int Width = 5; public const int Height = 4; - public static readonly Color FailColor = new Color(237, 93, 83); public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Custom/AstralBeaconUse"); @@ -70,12 +69,6 @@ namespace CalamityMod.Tiles.Astral bool usingStarcore = Main.LocalPlayer.HasItem(ModContent.ItemType()); - if (Main.IsItDay()) - { - CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Status.Boss.DeusAltarRejectNightText", FailColor); - return false; - } - Vector2 ritualSpawnPosition = new Vector2(left + Width / 2, top).ToWorldCoordinates(); ritualSpawnPosition += new Vector2(0f, -24f); diff --git a/Tiles/Astral/AstralTree.cs b/Tiles/Astral/AstralTree.cs index d7440d736b..e0ef7fcfd1 100644 --- a/Tiles/Astral/AstralTree.cs +++ b/Tiles/Astral/AstralTree.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Tiles.Astral //treeFrame = (i + j * j) % 3; } - public override int DropWood() => ModContent.ItemType(); + public override int DropWood() => ModContent.ItemType(); public override int CreateDust() => ModContent.DustType(); public override int SaplingGrowthType(ref int style) diff --git a/Tiles/AstralDesert/AstralPalmTree.cs b/Tiles/AstralDesert/AstralPalmTree.cs index 3fb709e4d8..085f713984 100644 --- a/Tiles/AstralDesert/AstralPalmTree.cs +++ b/Tiles/AstralDesert/AstralPalmTree.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Tiles.AstralDesert return Color.White * MathHelper.Lerp(0.05f, 0.75f, brightness); } - public override int DropWood() => ModContent.ItemType(); + public override int DropWood() => ModContent.ItemType(); public override int CreateDust() => ModContent.DustType(); diff --git a/Tiles/AstralSnow/AstralSnowTree.cs b/Tiles/AstralSnow/AstralSnowTree.cs index e8becab1b5..1edb32555d 100644 --- a/Tiles/AstralSnow/AstralSnowTree.cs +++ b/Tiles/AstralSnow/AstralSnowTree.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Tiles.AstralSnow //treeFrame = (i + j * j) % 6; } - public override int DropWood() => ModContent.ItemType(); + public override int DropWood() => ModContent.ItemType(); public override int CreateDust() => ModContent.DustType(); diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index 4b21d53067..222d30dfc0 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -33,6 +33,7 @@ namespace CalamityMod.Tiles TileType(), TileType(), TileType(), + TileType(), TileType() }; diff --git a/Tiles/Abyss/AcidwoodTile.cs b/Tiles/FurnitureAcidwood/AcidwoodTile.cs similarity index 96% rename from Tiles/Abyss/AcidwoodTile.cs rename to Tiles/FurnitureAcidwood/AcidwoodTile.cs index eb33744e0a..03b7e8c4f7 100644 --- a/Tiles/Abyss/AcidwoodTile.cs +++ b/Tiles/FurnitureAcidwood/AcidwoodTile.cs @@ -5,7 +5,7 @@ using Terraria.GameContent.Metadata; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.Abyss +namespace CalamityMod.Tiles.FurnitureAcidwood { public class AcidwoodTile : ModTile { diff --git a/Tiles/Abyss/AcidwoodTile.png b/Tiles/FurnitureAcidwood/AcidwoodTile.png similarity index 100% rename from Tiles/Abyss/AcidwoodTile.png rename to Tiles/FurnitureAcidwood/AcidwoodTile.png diff --git a/Tiles/FurnitureBasalt/BasaltSlab.cs b/Tiles/FurnitureBasalt/BasaltSlab.cs new file mode 100644 index 0000000000..c1056c95cb --- /dev/null +++ b/Tiles/FurnitureBasalt/BasaltSlab.cs @@ -0,0 +1,57 @@ +using CalamityMod.Systems; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Tiles.SunkenSea; + +namespace CalamityMod.Tiles.FurnitureBasalt +{ + public class BasaltSlab : ModTile + { + public override void SetStaticDefaults() + { + TileID.Sets.GeneralPlacementTiles[Type] = false; + TileID.Sets.HasSlopeFrames[Type] = true; + Main.tileSolid[Type] = true; + Main.tileBlockLight[Type] = true; + Main.tileShine2[Type] = true; + Main.tileBlendAll[Type] = true; + + Main.tileLargeFrames[Type] = 1; + + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithDesert(Type); + + DustType = DustID.Ash; + HitSound = SoundID.Tink; + + AddMapEntry(new Color(58, 55, 70)); + + MinPick = 110; + + //Stone merges + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ShellstoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/RunestoneMerge"); + //Sand merges + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/VolcanicSandMerge"); + this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); + this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); + this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); + //Normal merges + this.RegisterUniversalMerge(TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); + this.RegisterUniversalMerge(TileID.Dirt, "CalamityMod/Tiles/Merges/DirtMerge"); + this.RegisterUniversalMerge(TileID.Ash, "CalamityMod/Tiles/Merges/AshMerge"); + this.RegisterUniversalMerge(TileID.Mud, "CalamityMod/Tiles/Merges/MudMerge"); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 1, 0f, 0f, 1, new Color(100, 100, 100), 1f); + return false; + } + + } +} diff --git a/Tiles/FurnitureBasalt/BasaltSlab.png b/Tiles/FurnitureBasalt/BasaltSlab.png new file mode 100644 index 0000000000..a81c872726 Binary files /dev/null and b/Tiles/FurnitureBasalt/BasaltSlab.png differ diff --git a/Tiles/SunkenSea/Driftwood.cs b/Tiles/FurnitureDriftwood/Driftwood.cs similarity index 91% rename from Tiles/SunkenSea/Driftwood.cs rename to Tiles/FurnitureDriftwood/Driftwood.cs index 2912e3a13a..131b45406e 100644 --- a/Tiles/SunkenSea/Driftwood.cs +++ b/Tiles/FurnitureDriftwood/Driftwood.cs @@ -5,7 +5,7 @@ using Terraria.GameContent.Metadata; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.SunkenSea +namespace CalamityMod.Tiles.FurnitureDriftwood { public class Driftwood : ModTile { @@ -27,7 +27,7 @@ namespace CalamityMod.Tiles.SunkenSea AddMapEntry(new Color(136, 129, 154)); // 02JUN2024: Ozzatron: Dunesand has no merge - // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); + //TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); // 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); diff --git a/Tiles/SunkenSea/Driftwood.png b/Tiles/FurnitureDriftwood/Driftwood.png similarity index 100% rename from Tiles/SunkenSea/Driftwood.png rename to Tiles/FurnitureDriftwood/Driftwood.png diff --git a/Tiles/Astral/AstralMonolith.cs b/Tiles/FurnitureMonolith/AstralMonolith.cs similarity index 98% rename from Tiles/Astral/AstralMonolith.cs rename to Tiles/FurnitureMonolith/AstralMonolith.cs index 5dd4bb0a03..b6d82a7aec 100644 --- a/Tiles/Astral/AstralMonolith.cs +++ b/Tiles/FurnitureMonolith/AstralMonolith.cs @@ -8,8 +8,9 @@ using Terraria; using Terraria.GameContent.Metadata; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Tiles.Astral; -namespace CalamityMod.Tiles.Astral +namespace CalamityMod.Tiles.FurnitureMonolith { public class AstralMonolith : ModTile { diff --git a/Tiles/Astral/AstralMonolith.png b/Tiles/FurnitureMonolith/AstralMonolith.png similarity index 100% rename from Tiles/Astral/AstralMonolith.png rename to Tiles/FurnitureMonolith/AstralMonolith.png diff --git a/Tiles/Astral/AstralMonolithGlow.png b/Tiles/FurnitureMonolith/AstralMonolithGlow.png similarity index 100% rename from Tiles/Astral/AstralMonolithGlow.png rename to Tiles/FurnitureMonolith/AstralMonolithGlow.png diff --git a/Tiles/FurnitureNavystone/NavystoneChair_Highlight.png b/Tiles/FurnitureNavystone/NavystoneChair_Highlight.png index 3dd53285f5..fca0c61d27 100644 Binary files a/Tiles/FurnitureNavystone/NavystoneChair_Highlight.png and b/Tiles/FurnitureNavystone/NavystoneChair_Highlight.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneChest.png b/Tiles/FurnitureNavystone/NavystoneChest.png index 9dc4ddf331..b77c5ad9e5 100644 Binary files a/Tiles/FurnitureNavystone/NavystoneChest.png and b/Tiles/FurnitureNavystone/NavystoneChest.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneChest_Highlight.png b/Tiles/FurnitureNavystone/NavystoneChest_Highlight.png index 86679e1277..721846627a 100644 Binary files a/Tiles/FurnitureNavystone/NavystoneChest_Highlight.png and b/Tiles/FurnitureNavystone/NavystoneChest_Highlight.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneClock_Highlight.png b/Tiles/FurnitureNavystone/NavystoneClock_Highlight.png index d2cb217e2e..813835a873 100644 Binary files a/Tiles/FurnitureNavystone/NavystoneClock_Highlight.png and b/Tiles/FurnitureNavystone/NavystoneClock_Highlight.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneDoorClosed_Highlight.png b/Tiles/FurnitureNavystone/NavystoneDoorClosed_Highlight.png index d21d32f4f0..e212eaa1db 100644 Binary files a/Tiles/FurnitureNavystone/NavystoneDoorClosed_Highlight.png and b/Tiles/FurnitureNavystone/NavystoneDoorClosed_Highlight.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneDoorOpen_Highlight.png b/Tiles/FurnitureNavystone/NavystoneDoorOpen_Highlight.png index bc5836ec43..6b2214683a 100644 Binary files a/Tiles/FurnitureNavystone/NavystoneDoorOpen_Highlight.png and b/Tiles/FurnitureNavystone/NavystoneDoorOpen_Highlight.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneDresser_Highlight.png b/Tiles/FurnitureNavystone/NavystoneDresser_Highlight.png index 75041c40a0..4caa037707 100644 Binary files a/Tiles/FurnitureNavystone/NavystoneDresser_Highlight.png and b/Tiles/FurnitureNavystone/NavystoneDresser_Highlight.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneToilet.png b/Tiles/FurnitureNavystone/NavystoneToilet.png index 57725c5ebf..470aaf68a0 100644 Binary files a/Tiles/FurnitureNavystone/NavystoneToilet.png and b/Tiles/FurnitureNavystone/NavystoneToilet.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneToilet_Highlight.png b/Tiles/FurnitureNavystone/NavystoneToilet_Highlight.png index 5b92e1cc43..5d2772081a 100644 Binary files a/Tiles/FurnitureNavystone/NavystoneToilet_Highlight.png and b/Tiles/FurnitureNavystone/NavystoneToilet_Highlight.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneTriclinium_Highlight.png b/Tiles/FurnitureNavystone/NavystoneTriclinium_Highlight.png index 456252de1c..8376806503 100644 Binary files a/Tiles/FurnitureNavystone/NavystoneTriclinium_Highlight.png and b/Tiles/FurnitureNavystone/NavystoneTriclinium_Highlight.png differ diff --git a/Tiles/SunkenSea/PolishedNavystoneBrick.cs b/Tiles/FurnitureNavystone/PolishedNavystoneBrick.cs similarity index 94% rename from Tiles/SunkenSea/PolishedNavystoneBrick.cs rename to Tiles/FurnitureNavystone/PolishedNavystoneBrick.cs index 9331d479ab..06f5c11b6a 100644 --- a/Tiles/SunkenSea/PolishedNavystoneBrick.cs +++ b/Tiles/FurnitureNavystone/PolishedNavystoneBrick.cs @@ -4,7 +4,7 @@ using Terraria.ModLoader; using Terraria.ID; using CalamityMod.Systems; -namespace CalamityMod.Tiles.SunkenSea +namespace CalamityMod.Tiles.FurnitureNavystone { public class PolishedNavystoneBrick : ModTile { diff --git a/Tiles/SunkenSea/PolishedNavystoneBrick.png b/Tiles/FurnitureNavystone/PolishedNavystoneBrick.png similarity index 100% rename from Tiles/SunkenSea/PolishedNavystoneBrick.png rename to Tiles/FurnitureNavystone/PolishedNavystoneBrick.png diff --git a/Tiles/SunkenSea/SmoothSeaPrism.png b/Tiles/FurnitureNavystone/SmoothSeaPrism.png similarity index 100% rename from Tiles/SunkenSea/SmoothSeaPrism.png rename to Tiles/FurnitureNavystone/SmoothSeaPrism.png diff --git a/Tiles/FurnitureRunestone/RunestoneTerracotta.cs b/Tiles/FurnitureRunestone/RunestoneTerracotta.cs new file mode 100644 index 0000000000..ddbef319ce --- /dev/null +++ b/Tiles/FurnitureRunestone/RunestoneTerracotta.cs @@ -0,0 +1,44 @@ +using CalamityMod.Systems; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Tiles.SunkenSea; + +namespace CalamityMod.Tiles.FurnitureRunestone +{ + public class RunestoneTerracotta : ModTile + { + public override void SetStaticDefaults() + { + TileID.Sets.GeneralPlacementTiles[Type] = false; + + Main.tileSolid[Type] = true; + Main.tileBlockLight[Type] = true; + + CalamityUtils.MergeWithGeneral(Type); + + TileID.Sets.HasSlopeFrames[Type] = true; + + TileID.Sets.ChecksForMerge[Type] = true; + HitSound = SoundID.Tink; + DustType = DustID.Pot; + AddMapEntry(new Color(186, 130, 130)); + Main.tileShine2[Type] = true; + + TileID.Sets.CanBeDugByShovel[Type] = true; + + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ShellstoneMerge"); + this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); + this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); + this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); + } + + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + { + return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); + } + } +} diff --git a/Tiles/FurnitureRunestone/RunestoneTerracotta.png b/Tiles/FurnitureRunestone/RunestoneTerracotta.png new file mode 100644 index 0000000000..c70ef9bd5f Binary files /dev/null and b/Tiles/FurnitureRunestone/RunestoneTerracotta.png differ diff --git a/Tiles/FurnitureShellstone/ShellTrimBrick.cs b/Tiles/FurnitureShellstone/ShellTrimBrick.cs new file mode 100644 index 0000000000..e62c5122a0 --- /dev/null +++ b/Tiles/FurnitureShellstone/ShellTrimBrick.cs @@ -0,0 +1,34 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; +using Terraria.ID; +using CalamityMod.Systems; +using CalamityMod.Tiles.SunkenSea; + +namespace CalamityMod.Tiles.FurnitureShellstone +{ + public class ShellTrimBrick : ModTile + { + public override void SetStaticDefaults() + { + Main.tileSolid[Type] = true; + Main.tileBlockLight[Type] = true; + + CalamityUtils.MergeWithGeneral(Type); + TileID.Sets.HasSlopeFrames[Type] = true; + + HitSound = SoundID.Tink; + DustType = DustID.CorruptPlants; + AddMapEntry(new Color(156, 191, 199)); + + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/RunestoneMerge"); + } + + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + { + return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); + } + } +} diff --git a/Tiles/FurnitureShellstone/ShellTrimBrick.png b/Tiles/FurnitureShellstone/ShellTrimBrick.png new file mode 100644 index 0000000000..36960b0c90 Binary files /dev/null and b/Tiles/FurnitureShellstone/ShellTrimBrick.png differ diff --git a/Tiles/SunkenSea/ShellstoneSlab.cs b/Tiles/FurnitureShellstone/ShellstoneSlab.cs similarity index 93% rename from Tiles/SunkenSea/ShellstoneSlab.cs rename to Tiles/FurnitureShellstone/ShellstoneSlab.cs index bb2f5c706e..c3d5e24bc6 100644 --- a/Tiles/SunkenSea/ShellstoneSlab.cs +++ b/Tiles/FurnitureShellstone/ShellstoneSlab.cs @@ -3,8 +3,9 @@ using Terraria; using Terraria.ModLoader; using Terraria.ID; using CalamityMod.Systems; +using CalamityMod.Tiles.SunkenSea; -namespace CalamityMod.Tiles.SunkenSea +namespace CalamityMod.Tiles.FurnitureShellstone { public class ShellstoneSlab : ModTile { diff --git a/Tiles/SunkenSea/ShellstoneSlab.png b/Tiles/FurnitureShellstone/ShellstoneSlab.png similarity index 100% rename from Tiles/SunkenSea/ShellstoneSlab.png rename to Tiles/FurnitureShellstone/ShellstoneSlab.png diff --git a/Tiles/Merges/VolcanicSandMerge.cs b/Tiles/Merges/VolcanicSandMerge.cs new file mode 100644 index 0000000000..24e96261eb --- /dev/null +++ b/Tiles/Merges/VolcanicSandMerge.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using CalamityMod.Tiles.SunkenSea; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class VolcanicSandMerge : TileBlendTexture + { + public override int TileType => ModContent.TileType(); + } +} diff --git a/Tiles/Merges/VolcanicSandMerge.png b/Tiles/Merges/VolcanicSandMerge.png new file mode 100644 index 0000000000..2f351b6d1a Binary files /dev/null and b/Tiles/Merges/VolcanicSandMerge.png differ diff --git a/Tiles/Rubblemaker/SunkenSea/DriftwoodAmbientEcho.cs b/Tiles/Rubblemaker/SunkenSea/DriftwoodAmbientEcho.cs index c58f0510f5..5cc0e8630a 100644 --- a/Tiles/Rubblemaker/SunkenSea/DriftwoodAmbientEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/DriftwoodAmbientEcho.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Items.Placeables.FurnitureDriftwood; using CalamityMod.Tiles.SunkenSea.Ambient; using Terraria.GameContent; using Terraria.ModLoader; diff --git a/Tiles/SunkenSea/AridSoil.cs b/Tiles/SunkenSea/AridSoil.cs new file mode 100644 index 0000000000..8d6ced2822 --- /dev/null +++ b/Tiles/SunkenSea/AridSoil.cs @@ -0,0 +1,61 @@ +using CalamityMod.Systems; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.SunkenSea +{ + public class AridSoil : ModTile + { + public override void SetStaticDefaults() + { + TileID.Sets.GeneralPlacementTiles[Type] = false; + + Main.tileSolid[Type] = true; + Main.tileBlockLight[Type] = true; + + Main.tileBlendAll[Type] = true; + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithDesert(Type); + + TileID.Sets.HasSlopeFrames[Type] = true; + TileID.Sets.ChecksForMerge[Type] = true; + TileID.Sets.CanBeDugByShovel[Type] = true; + Main.tileShine2[Type] = true; + + DustType = DustID.Hive; + AddMapEntry(new Color(171, 101, 87)); + + //Stone merges + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ShellstoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/RunestoneMerge"); + + //Sand merges + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/PolypSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ScarletSeaGrassTile"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/VolcanicSandMerge"); + this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); + this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); + this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); + + //Normal merges + this.RegisterUniversalMerge(TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); + this.RegisterUniversalMerge(TileID.Dirt, "CalamityMod/Tiles/Merges/DirtMerge"); + this.RegisterUniversalMerge(TileID.Ash, "CalamityMod/Tiles/Merges/AshMerge"); + this.RegisterUniversalMerge(TileID.Mud, "CalamityMod/Tiles/Merges/MudMerge"); + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + { + return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); + } + } +} diff --git a/Tiles/SunkenSea/AridSoil.png b/Tiles/SunkenSea/AridSoil.png new file mode 100644 index 0000000000..e03a0d0ed3 Binary files /dev/null and b/Tiles/SunkenSea/AridSoil.png differ diff --git a/Tiles/SunkenSea/Basalt.cs b/Tiles/SunkenSea/Basalt.cs index 08dcb46d06..6c8ee7e5ef 100644 --- a/Tiles/SunkenSea/Basalt.cs +++ b/Tiles/SunkenSea/Basalt.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; Main.tileShine2[Type] = false; + Main.tileBlendAll[Type] = true; CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithDesert(Type); @@ -26,13 +27,17 @@ namespace CalamityMod.Tiles.SunkenSea MinPick = 110; + //Stone merges this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ShellstoneMerge"); - this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/RunestoneMerge"); + //Sand merges + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/VolcanicSandMerge"); this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); + //Normal merges this.RegisterUniversalMerge(TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); this.RegisterUniversalMerge(TileID.Dirt, "CalamityMod/Tiles/Merges/DirtMerge"); this.RegisterUniversalMerge(TileID.Ash, "CalamityMod/Tiles/Merges/AshMerge"); diff --git a/Tiles/SunkenSea/BlackPearlPile.cs b/Tiles/SunkenSea/BlackPearlPile.cs index 7749b43860..5b2ffb59e3 100644 --- a/Tiles/SunkenSea/BlackPearlPile.cs +++ b/Tiles/SunkenSea/BlackPearlPile.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileBlockLight[Type] = true; TileID.Sets.HasSlopeFrames[Type] = true; + Main.tileBlendAll[Type] = true; CalamityUtils.MergeWithGeneral(Type); Main.tileShine[Type] = 3500; @@ -28,18 +29,22 @@ namespace CalamityMod.Tiles.SunkenSea TileID.Sets.CanBeDugByShovel[Type] = true; + //Stone merges this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ShellstoneMerge"); this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/PyreMantleMerge"); - this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/RunestoneMerge"); - this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); - this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); - this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); + //Normal merges this.RegisterUniversalMerge(TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); this.RegisterUniversalMerge(TileID.Dirt, "CalamityMod/Tiles/Merges/DirtMerge"); this.RegisterUniversalMerge(TileID.Ash, "CalamityMod/Tiles/Merges/AshMerge"); this.RegisterUniversalMerge(TileID.Mud, "CalamityMod/Tiles/Merges/MudMerge"); + //Sand merges + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/VolcanicSandMerge"); + this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); + this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); + this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) diff --git a/Tiles/SunkenSea/Dunesand.cs b/Tiles/SunkenSea/Dunesand.cs index ddf287c5f5..e9c49ead2d 100644 --- a/Tiles/SunkenSea/Dunesand.cs +++ b/Tiles/SunkenSea/Dunesand.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileShine2[Type] = true; DustType = DustID.Hive; - AddMapEntry(new Color(210, 124, 45)); + AddMapEntry(new Color(206, 124, 97)); this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); diff --git a/Tiles/SunkenSea/Dunesand.png b/Tiles/SunkenSea/Dunesand.png index 06514fde68..f6ad7b21b3 100644 Binary files a/Tiles/SunkenSea/Dunesand.png and b/Tiles/SunkenSea/Dunesand.png differ diff --git a/Tiles/SunkenSea/LimeCoral.cs b/Tiles/SunkenSea/LimeCoral.cs index 9aaf526827..3bf70a96fd 100644 --- a/Tiles/SunkenSea/LimeCoral.cs +++ b/Tiles/SunkenSea/LimeCoral.cs @@ -36,9 +36,9 @@ namespace CalamityMod.Tiles.SunkenSea { if (!Main.tile[i - 1, j].HasTile || !Main.tile[i + 1, j].HasTile || !Main.tile[i, j - 1].HasTile || !Main.tile[i, j + 1].HasTile) { - r = 0.59f; - g = 0.81f; - b = 0.32f; + r = 139f / 255f; + g = 206f / 255f; + b = 56f / 255f; } } diff --git a/Tiles/SunkenSea/LimeCoral.png b/Tiles/SunkenSea/LimeCoral.png index b7fb07b8d0..fb914d3a3b 100644 Binary files a/Tiles/SunkenSea/LimeCoral.png and b/Tiles/SunkenSea/LimeCoral.png differ diff --git a/Tiles/SunkenSea/Limestone.cs b/Tiles/SunkenSea/Limestone.cs index 6c05789b43..91779fe959 100644 --- a/Tiles/SunkenSea/Limestone.cs +++ b/Tiles/SunkenSea/Limestone.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; + Main.tileBlendAll[Type] = true; CalamityUtils.MergeWithGeneral(Type); TileID.Sets.HasSlopeFrames[Type] = true; @@ -21,13 +22,27 @@ namespace CalamityMod.Tiles.SunkenSea TileID.Sets.ChecksForMerge[Type] = true; HitSound = SoundID.Tink; DustType = DustID.Pot; - AddMapEntry(new Color(154, 119, 119)); + AddMapEntry(new Color(206, 166, 142)); + //Stone merges this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ShellstoneMerge"); - this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ScarletSeaGrassTile"); - this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/PolypSandMerge"); - this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/RunestoneMerge"); + + //Sand merges + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/PolypSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ScarletSeaGrassTile"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/VolcanicSandMerge"); + this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); + this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); + this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); + + //Normal merges + this.RegisterUniversalMerge(TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); + this.RegisterUniversalMerge(TileID.Dirt, "CalamityMod/Tiles/Merges/DirtMerge"); + this.RegisterUniversalMerge(TileID.Ash, "CalamityMod/Tiles/Merges/AshMerge"); + this.RegisterUniversalMerge(TileID.Mud, "CalamityMod/Tiles/Merges/MudMerge"); } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) diff --git a/Tiles/SunkenSea/Limestone.png b/Tiles/SunkenSea/Limestone.png index 8663309de3..1ff28b15d7 100644 Binary files a/Tiles/SunkenSea/Limestone.png and b/Tiles/SunkenSea/Limestone.png differ diff --git a/Tiles/SunkenSea/LimestoneCobble.cs b/Tiles/SunkenSea/LimestoneCobble.cs new file mode 100644 index 0000000000..2fb987d704 --- /dev/null +++ b/Tiles/SunkenSea/LimestoneCobble.cs @@ -0,0 +1,53 @@ +using CalamityMod.Systems; +using CalamityMod.Tiles.Merges; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.SunkenSea +{ + public class LimestoneCobble : ModTile + { + public override void SetStaticDefaults() + { + Main.tileSolid[Type] = true; + Main.tileBlockLight[Type] = true; + + Main.tileBlendAll[Type] = true; + CalamityUtils.MergeWithGeneral(Type); + + TileID.Sets.HasSlopeFrames[Type] = true; + + TileID.Sets.ChecksForMerge[Type] = true; + HitSound = SoundID.Tink; + DustType = DustID.Pot; + AddMapEntry(new Color(154, 119, 119)); + + //Stone merges + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ShellstoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/RunestoneMerge"); + + //Sand merges + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/PolypSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ScarletSeaGrassTile"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/VolcanicSandMerge"); + this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); + this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); + this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); + + //Normal merges + this.RegisterUniversalMerge(TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); + this.RegisterUniversalMerge(TileID.Dirt, "CalamityMod/Tiles/Merges/DirtMerge"); + this.RegisterUniversalMerge(TileID.Ash, "CalamityMod/Tiles/Merges/AshMerge"); + this.RegisterUniversalMerge(TileID.Mud, "CalamityMod/Tiles/Merges/MudMerge"); + } + + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + { + return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); + } + } +} diff --git a/Tiles/SunkenSea/LimestoneCobble.png b/Tiles/SunkenSea/LimestoneCobble.png new file mode 100644 index 0000000000..8663309de3 Binary files /dev/null and b/Tiles/SunkenSea/LimestoneCobble.png differ diff --git a/Tiles/SunkenSea/MagentaCoral.png b/Tiles/SunkenSea/MagentaCoral.png index e02ef96fce..83ac873383 100644 Binary files a/Tiles/SunkenSea/MagentaCoral.png and b/Tiles/SunkenSea/MagentaCoral.png differ diff --git a/Tiles/SunkenSea/MediumSeaPrismCrystal.cs b/Tiles/SunkenSea/MediumSeaPrismCrystal.cs index 430664f3a3..7643048aeb 100644 --- a/Tiles/SunkenSea/MediumSeaPrismCrystal.cs +++ b/Tiles/SunkenSea/MediumSeaPrismCrystal.cs @@ -10,6 +10,8 @@ using Terraria.Enums; using Terraria.ObjectData; using CalamityMod.Items.Weapons.Melee; using Terraria.GameContent; +using CalamityMod.Systems; +using Microsoft.Xna.Framework.Graphics; namespace CalamityMod.Tiles.SunkenSea { @@ -70,20 +72,52 @@ namespace CalamityMod.Tiles.SunkenSea public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - var tile = Main.tile[i, j]; - bool lessLightDueToLowWater = tile.LiquidAmount > 50 && tile.LiquidType == LiquidID.Water; + float fade1 = GetFade1(i, j); + float fade2 = GetFade2(i, j); - //Blue - Color blue = new Color(202, 236, 238); - Color darkviolet = new Color(18, 67, 116); - Color value = Color.Lerp(blue, darkviolet, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f); - Color value1 = Color.Lerp(blue, darkviolet, (MathF.Sin((j - 10) / 50f + Main.GameUpdateCount * 0.064f + -i / 30f) + 1f) / 2f); - r = lessLightDueToLowWater ? 0.27f : 0.36f; - g = lessLightDueToLowWater ? 0.405f : 0.54f; - b = lessLightDueToLowWater ? 0.405f : 0.54f; - r *= (value.R + value1.R) / 300f; - g *= (value.G + value1.G) / 300f; - b *= (value.B + value1.B) / 300f; + Color baseColor = new Color(162, 216, 218); //Blue + Color glow1 = new Color(171, 113, 215); //Purple + Color glow2 = new Color(56, 174, 117); //Green + + Vector3 blended = baseColor.ToVector3(); + + blended = Vector3.Lerp(blended, glow1.ToVector3(), fade1 * 0.5f); + blended = Vector3.Lerp(blended, glow2.ToVector3(), fade2 * 0.5f); + + float brightness = 0.6f; + blended *= brightness; + + r = blended.X; + g = blended.Y; + b = blended.Z; + } + + private static float GetFade1(int i, int j) + { + return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.2f) + 1f) / 2f; + } + + private static float GetFade2(int i, int j) + { + return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.1f + i * 0.08f - j * 0.05f) + 1f) / 2f; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Framing.GetTileSafely(i, j); + Vector2 offScreen = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 position = new Vector2(i * 16, j * 16) - Main.screenPosition + offScreen; + + Rectangle sourceRect = new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16); + + Texture2D baseTex = ModContent.Request("CalamityMod/Tiles/SunkenSea/MediumSeaPrismCrystal_Blue").Value; + spriteBatch.Draw(baseTex, position, sourceRect, Lighting.GetColor(i, j) * 1.5f); + + Texture2D tex1 = ModContent.Request("CalamityMod/Tiles/SunkenSea/MediumSeaPrismCrystal_Purple").Value; + Texture2D tex2 = ModContent.Request("CalamityMod/Tiles/SunkenSea/MediumSeaPrismCrystal_Green").Value; + + spriteBatch.Draw(tex1, position, sourceRect, Lighting.GetColor(i, j) * 1.5f * GetFade1(i, j)); + spriteBatch.Draw(tex2, position, sourceRect, Lighting.GetColor(i, j) * 1.5f * GetFade2(i, j)); } public override void KillMultiTile(int i, int j, int frameX, int frameY) { diff --git a/Tiles/SunkenSea/MediumSeaPrismCrystal.png b/Tiles/SunkenSea/MediumSeaPrismCrystal.png index e087780707..dd17c7eb0b 100644 Binary files a/Tiles/SunkenSea/MediumSeaPrismCrystal.png and b/Tiles/SunkenSea/MediumSeaPrismCrystal.png differ diff --git a/Tiles/SunkenSea/MediumSeaPrismCrystal_Blue.png b/Tiles/SunkenSea/MediumSeaPrismCrystal_Blue.png new file mode 100644 index 0000000000..dd17c7eb0b Binary files /dev/null and b/Tiles/SunkenSea/MediumSeaPrismCrystal_Blue.png differ diff --git a/Tiles/SunkenSea/MediumSeaPrismCrystal_Green.png b/Tiles/SunkenSea/MediumSeaPrismCrystal_Green.png new file mode 100644 index 0000000000..0d9062d94e Binary files /dev/null and b/Tiles/SunkenSea/MediumSeaPrismCrystal_Green.png differ diff --git a/Tiles/SunkenSea/MediumSeaPrismCrystal_Purple.png b/Tiles/SunkenSea/MediumSeaPrismCrystal_Purple.png new file mode 100644 index 0000000000..36c9f2955e Binary files /dev/null and b/Tiles/SunkenSea/MediumSeaPrismCrystal_Purple.png differ diff --git a/Tiles/SunkenSea/Runestone.cs b/Tiles/SunkenSea/Runestone.cs index 7108f7d9ed..4730684727 100644 --- a/Tiles/SunkenSea/Runestone.cs +++ b/Tiles/SunkenSea/Runestone.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Tiles.SunkenSea TileID.Sets.ChecksForMerge[Type] = true; HitSound = SoundID.Tink; DustType = DustID.Pot; - AddMapEntry(new Color(152, 89, 78)); + AddMapEntry(new Color(151, 91, 81)); Main.tileShine2[Type] = true; TileID.Sets.CanBeDugByShovel[Type] = true; diff --git a/Tiles/SunkenSea/Runestone.png b/Tiles/SunkenSea/Runestone.png index a0f612e995..f2ace3dbb4 100644 Binary files a/Tiles/SunkenSea/Runestone.png and b/Tiles/SunkenSea/Runestone.png differ diff --git a/Tiles/SunkenSea/RunestoneTerracotta.png b/Tiles/SunkenSea/RunestoneTerracotta.png deleted file mode 100644 index 610bdefa21..0000000000 Binary files a/Tiles/SunkenSea/RunestoneTerracotta.png and /dev/null differ diff --git a/Tiles/SunkenSea/SeaPrism.cs b/Tiles/SunkenSea/SeaPrism.cs index 3c3f1ae585..37d02cbb70 100644 --- a/Tiles/SunkenSea/SeaPrism.cs +++ b/Tiles/SunkenSea/SeaPrism.cs @@ -1,6 +1,7 @@ using System; using CalamityMod.Systems; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -17,11 +18,11 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = false; TileID.Sets.HasSlopeFrames[Type] = true; + Main.tileMerge[Type][ModContent.TileType()] = true; CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithDesert(Type); Main.tileLighted[Type] = true; - Main.tileShine[Type] = 5000; Main.tileShine2[Type] = true; TileID.Sets.ChecksForMerge[Type] = true; @@ -48,22 +49,61 @@ namespace CalamityMod.Tiles.SunkenSea public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - float brightness = 0.9f; - Color blue = new Color(162, 216, 218); - Color darkviolet = new Color(18, 78, 96); - Color value = Color.Lerp(blue, darkviolet, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f); - Color value1 = Color.Lerp(blue, darkviolet, (MathF.Sin((j - 100) / 50f + Main.GameUpdateCount * 0.004f + -i / 30f) + 1f) / 2f); - r = (value.R + value1.R) / 800f; - g = (value.G + value1.G) / 800f; - b = (value.B + value1.B) / 800f; - r *= brightness; - g *= brightness; - b *= brightness; + float fade1 = GetFade1(i, j); + float fade2 = GetFade2(i, j); + + Color baseColor = new Color(162, 216, 218); //Blue + Color glow1 = new Color(171, 113, 215); //Purple + Color glow2 = new Color(56, 174, 117); //Green + + Vector3 blended = baseColor.ToVector3(); + + blended = Vector3.Lerp(blended, glow1.ToVector3(), fade1 * 0.5f); + blended = Vector3.Lerp(blended, glow2.ToVector3(), fade2 * 0.5f); + + float brightness = 0.6f; + blended *= brightness; + + r = blended.X; + g = blended.Y; + b = blended.Z; } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); } + + private static float GetFade1(int i, int j) + { + return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.2f) + 1f) / 2f; + } + + private static float GetFade2(int i, int j) + { + return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.1f + i * 0.08f - j * 0.05f) + 1f) / 2f; + } + + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Framing.GetTileSafely(i, j); + Vector2 offScreen = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 position = new Vector2(i * 16, j * 16) - Main.screenPosition + offScreen; + + int frameX = tile.TileFrameX + (i % 8 * subsheetWidth); + int frameY = tile.TileFrameY + (j % 8 * subsheetHeight); + + Rectangle sourceRect = new Rectangle(frameX, frameY, 16, 16); + + Texture2D baseTex = ModContent.Request("CalamityMod/Tiles/SunkenSea/SeaPrism_Blue").Value; + spriteBatch.Draw(baseTex, position, sourceRect, Lighting.GetColor(i, j) * 1.5f); + + Texture2D tex1 = ModContent.Request("CalamityMod/Tiles/SunkenSea/SeaPrism_Purple").Value; + Texture2D tex2 = ModContent.Request("CalamityMod/Tiles/SunkenSea/SeaPrism_Green").Value; + + spriteBatch.Draw(tex1, position, sourceRect, Lighting.GetColor(i, j) * 1.5f * GetFade1(i, j)); + spriteBatch.Draw(tex2, position, sourceRect, Lighting.GetColor(i, j) * 1.5f * GetFade2(i, j)); + return true; + } } } diff --git a/Tiles/SunkenSea/SeaPrism.png b/Tiles/SunkenSea/SeaPrism.png index 7e6c12266c..01220e2182 100644 Binary files a/Tiles/SunkenSea/SeaPrism.png and b/Tiles/SunkenSea/SeaPrism.png differ diff --git a/Tiles/SunkenSea/SeaPrism_Blue.png b/Tiles/SunkenSea/SeaPrism_Blue.png new file mode 100644 index 0000000000..7e6c12266c Binary files /dev/null and b/Tiles/SunkenSea/SeaPrism_Blue.png differ diff --git a/Tiles/SunkenSea/SeaPrism_Green.png b/Tiles/SunkenSea/SeaPrism_Green.png new file mode 100644 index 0000000000..9ad3fbf00c Binary files /dev/null and b/Tiles/SunkenSea/SeaPrism_Green.png differ diff --git a/Tiles/SunkenSea/SeaPrism_Purple.png b/Tiles/SunkenSea/SeaPrism_Purple.png new file mode 100644 index 0000000000..00eb510c4c Binary files /dev/null and b/Tiles/SunkenSea/SeaPrism_Purple.png differ diff --git a/Tiles/SunkenSea/VolcanicSand.png b/Tiles/SunkenSea/VolcanicSand.png index a85b4c8dee..624e5b075c 100644 Binary files a/Tiles/SunkenSea/VolcanicSand.png and b/Tiles/SunkenSea/VolcanicSand.png differ diff --git a/UI/BossHealthBarManager.cs b/UI/BossHealthBarManager.cs index 5d523812fc..119239acb0 100644 --- a/UI/BossHealthBarManager.cs +++ b/UI/BossHealthBarManager.cs @@ -141,12 +141,11 @@ namespace CalamityMod.UI OneToMany[NPCID.PrimeCannon] = SkelePrime; OneToMany[NPCID.PrimeLaser] = SkelePrime; - int[] Golem = new int[] { NPCID.Golem, NPCID.GolemFistLeft, NPCID.GolemFistRight, NPCID.GolemHead, NPCID.GolemHeadFree }; + int[] Golem = new int[] { NPCID.Golem, NPCID.GolemFistLeft, NPCID.GolemFistRight, NPCID.GolemHead }; OneToMany[NPCID.Golem] = Golem; OneToMany[NPCID.GolemFistLeft] = Golem; OneToMany[NPCID.GolemFistRight] = Golem; OneToMany[NPCID.GolemHead] = Golem; - OneToMany[NPCID.GolemHeadFree] = Golem; int[] Saucer = new int[] { NPCID.MartianSaucerCore, NPCID.MartianSaucerTurret, NPCID.MartianSaucerCannon }; OneToMany[NPCID.MartianSaucerCore] = Saucer; diff --git a/UI/DialogueDisplay/Assets/DialogueArrow.png b/UI/DialogueDisplay/Assets/DialogueArrow.png new file mode 100644 index 0000000000..18a8a71a0e Binary files /dev/null and b/UI/DialogueDisplay/Assets/DialogueArrow.png differ diff --git a/UI/DialogueDisplay/DialogueDisplayDebugItem.cs b/UI/DialogueDisplay/DialogueDisplayDebugItem.cs new file mode 100644 index 0000000000..68fd8d5325 --- /dev/null +++ b/UI/DialogueDisplay/DialogueDisplayDebugItem.cs @@ -0,0 +1,31 @@ +using Terraria.ID; +using Terraria.ModLoader; +using Terraria; +using System.Linq; +using CalamityMod.UI.DialogueDisplay.DisplayEffects; + +namespace CalamityMod.UI.DialogueDisplay +{ + public class DialogueDisplayDebugItem : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Debug"; + public override string Texture => "CalamityMod/Items/Weapons/Summon/StaffOfNecrosteocytes"; + public override void SetDefaults() + { + Item.width = 25; + Item.height = 29; + Item.rare = ItemRarityID.Red; + Item.useAnimation = Item.useTime = 20; + Item.useStyle = ItemUseStyleID.HoldUp; + } + public override bool? UseItem(Player player) + { + if (DialogueDisplayUI.Dialogues.ContainsKey("OceanBlue")) + DialogueDisplaySystem.ProgressDialogue("OceanBlue"); + else + DialogueDisplaySystem.StartDialogue("OceanBlue", Main.npc.First(n => n.active), -1, effects: new WhisperingPearlEffects()); + + return true; + } + } +} diff --git a/UI/DialogueDisplay/DialogueDisplayUI.cs b/UI/DialogueDisplay/DialogueDisplayUI.cs new file mode 100644 index 0000000000..e3c8640665 --- /dev/null +++ b/UI/DialogueDisplay/DialogueDisplayUI.cs @@ -0,0 +1,1186 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text.Json; +using System.Text.Json.Serialization; +using CalamityMod.Fonts; +using CalamityMod.UI.DialogueDisplay.DialogueEvents; +using CalamityMod.UI.DialogueDisplay.DisplayEffects; +using CalamityMod.UI.DialogueDisplay.TextEffects; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +using Terraria.UI; +using Terraria.UI.Chat; +using static ReLogic.Graphics.DynamicSpriteFont; + +namespace CalamityMod.UI.DialogueDisplay +{ + internal class DialogueDisplayUI : UIState + { + internal static readonly Dictionary Dialogues = []; + internal static readonly Dictionary DialogueEntities = []; + internal static readonly Dictionary DialogueUptimes = []; + internal static readonly List DialoguesToRemove = []; + + public override void Update(GameTime gameTime) + { + foreach (string key in DialoguesToRemove) + { + RemoveChild(Dialogues[key].ui); + Dialogues.Remove(key); + DialogueEntities.Remove(key); + DialogueUptimes.Remove(key); + } + DialoguesToRemove.Clear(); + + foreach (var pair in DialogueEntities) + { + if (pair.Value != null && pair.Value.active) + Dialogues[pair.Key].ui.Position = pair.Value.Center; + else + Dialogues[pair.Key].ui.ClosingDialogue = true; + } + + foreach (var pair in DialogueUptimes) + { + if (Dialogues[pair.Key].ui.Uptime >= pair.Value) + { + if (Dialogues[pair.Key].ui.ProgressDialogue) + Dialogues[pair.Key].ui.SwitchingPage = true; + else + Dialogues[pair.Key].ui.ClosingDialogue = true; + } + } + + foreach (var pair in Dialogues) + { + float distFromSource = 0; + DialogueDisplay dialogue = pair.Value.ui; + DialogueTextData data = pair.Value.data; + if (dialogue.DisplayEffects.FadeWhenTooFar) + { + distFromSource = Vector2.Distance(Main.LocalPlayer.Center, dialogue.Position); + // If the player is too far, cancel the dialogue + if (distFromSource > dialogue.DisplayEffects.FadeBuffer + dialogue.DisplayEffects.FadeDistance) + { + DialoguesToRemove.Add(pair.Key); + continue; + } + } + + if (dialogue.DialoguePage.Event != null) + { + if (dialogue.DialoguePage.Event.IsOver) + { + if (!dialogue.ProgressDialogue) + DialoguesToRemove.Add(pair.Key); + else + { + if (++data.Page >= data.PageCount) + DialoguesToRemove.Add(pair.Key); + else + { + dialogue.DialoguePage = data.Pages[data.Page]; + dialogue.SwitchingPage = false; + dialogue.SwitchCounter = 0; + Activate(); + } + } + return; + } + } + if (dialogue.Switching) + { + if (dialogue.SwitchCounter >= dialogue.DisplayEffects.TimeToDisappear) + { + if (dialogue.ClosingDialogue || !dialogue.ProgressDialogue) + DialoguesToRemove.Add(pair.Key); + else + { + if (++data.Page >= data.PageCount) + DialoguesToRemove.Add(pair.Key); + else + { + dialogue.DialoguePage = data.Pages[data.Page]; + dialogue.SwitchingPage = false; + dialogue.SwitchCounter = 0; + Activate(); + } + } + continue; + } + dialogue.SwitchCounter++; + } + } + + base.Update(gameTime); + } + } + + public class DialogueDisplay : UIElement + { + public static readonly Dictionary DialogueSounds = new() + { + { "Amidias", SoundID.NPCHit1 }, + { "Otonilou", SoundID.NPCHit25 } + }; + + /// + /// How long this dialogue has existed + /// + public int DialogueTimer = 0; + /// + /// Which page are we reading? + /// + //public int currentPage; + /// + /// The position from which the text originates + /// + public Vector2 Position = Vector2.Zero; + /// + /// How many page there are + /// + //public int pageCount => DialogueData.Length; + + public bool SwitchingPage = false; + public bool ProgressDialogue = true; + public bool ClosingDialogue = false; + public bool ScreenLocked; + + public Vector2 TextSize { get; private set; } + public Vector2 SizeOffsetFromStart { get; private set; } + + public bool Switching => SwitchingPage || ClosingDialogue; + internal int SwitchCounter = 0; + + internal DialoguePage DialoguePage; + internal DisplayEffect DisplayEffects; + internal string Text = ""; + private int TextTimer = 0; + internal int textIndex = 0; + internal int Uptime = 0; + internal string FontKey; + + //Effects + internal Dictionary UniqueColors = []; + internal Dictionary UniqueBorderColors = []; + + internal Dictionary Pauses = []; + internal Dictionary> TextEffects = []; + internal Dictionary UniqueScales = []; + internal List LineBreakIndexes = []; + + private DialogueCharacterData[] CharacterData; + private Color BaseColor = Color.White; + private Color BaseBorderColor = Color.Black; + internal bool Crawling = true; + private int storedDelay = 0; + private bool lockDelay = false; + private float WrapWidth = -1; + + public DialogueDisplay(DialoguePage textData, DisplayEffect displayEffects, int startPage = 0, bool screenLocked = false, float wrapWidth = -1, string font = "MouseText") + { + DisplayEffects = displayEffects; + ScreenLocked = screenLocked; + DialoguePage = textData; + DisplayEffects = displayEffects; + FontKey = font; + WrapWidth = wrapWidth; + } + + public override void OnActivate() + { + Text = ""; + UniqueColors = []; + UniqueBorderColors = []; + Pauses = []; + TextEffects = []; + UniqueScales = []; + + if (DialoguePage.Event != null) + return; + + int fullLength = 0; + List lines = []; + for (int i = 0; i < DialoguePage.Lines.Length; i++) + { + string fullLine = DialoguePage.Lines[i]; + + FindEffects(ref fullLine, fullLength); + + if (fullLine[^1] != ' ') + fullLine += ' '; + + lines.Add(fullLine); + fullLength += fullLine.Length; + } + + if (WrapWidth != -1) + { + for (int i = 0; i < lines.Count; i++) + { + string line = lines[i]; + if (line[^1] == ' ') + line = line.Remove(line.Length - 1, 1); + + int finalIndex = 0; + float width = MeasureString(line, FontAssetSystem.Fonts[FontKey]).X; + + if (width > WrapWidth) + { + string yoinked = ""; + do + { + finalIndex = line.LastIndexOf(' '); + if (finalIndex < line.Length - 1) + finalIndex++; + yoinked = line.Substring(finalIndex) + yoinked; + line = line.Remove(finalIndex); + } while (MeasureString(line, FontAssetSystem.Fonts[FontKey]).X > WrapWidth); + + lines[i] = line; + if (yoinked[0] == ' ') + yoinked = yoinked.Remove(0, 1); + + if (i >= lines.Count - 1) + lines.Add(yoinked); + else + lines[i + 1] = yoinked + lines[i + 1]; + } + } + } + + fullLength = 0; + int[] lineLengths = new int[lines.Count]; + LineBreakIndexes.Clear(); + for (int i = 0; i < lines.Count; i++) + { + lineLengths[i] = lines[i].Length; + + Text += lines[i]; + + fullLength += lines[i].Length; + LineBreakIndexes.Add(fullLength); + } + + if (DialoguePage.BaseColor != null) + BaseColor = DialogueDisplaySystem.GetColorFromHex(DialoguePage.BaseColor); + + if (DialoguePage.BaseBorderColor != null) + BaseBorderColor = DialogueDisplaySystem.GetColorFromHex(DialoguePage.BaseBorderColor); + else + { + BaseBorderColor = BaseColor * DialoguePage.BorderDarkening; + BaseBorderColor.A = 255; + } + + CharacterData = new DialogueCharacterData[Text.Length]; + + for (int i = 0; i < Text.Length; i++) + { + int j = 0; + int summedLength = 0; + for (; j < lineLengths.Length; j++) + { + summedLength += lineLengths[j]; + if (i < summedLength) + break; + } + CharacterData[i] = new(i, Text.Length, j); + } + + textIndex = 0; + Crawling = true; + TextTimer = -30; + storedDelay = 0; + lockDelay = false; + DialogueTimer = 0; + Uptime = 0; + + Vector2 zero = Vector2.Zero; + bool newLine = true; + + float textWidth = 0f; + + float highestFirstLineYScale = 1f; + for (int j = 0; j < Text.Length; j++) + { + if (Text[j] == '\n') + break; + if (UniqueScales.TryGetValue(j, out Vector2 uniqueScale) && uniqueScale.Y > highestFirstLineYScale) + highestFirstLineYScale = uniqueScale.Y; + } + + SizeOffsetFromStart = new(8, 16 * highestFirstLineYScale); + + for (int i = 0; i < Text.Length; i++) + { + char c = Text[i]; + + #region Positioning + Vector2 scale = Vector2.One; + if (UniqueScales.TryGetValue(i, out Vector2 result)) + scale = result; + else if (DialoguePage.TextScale != -1) + scale *= DialoguePage.TextScale; + + //Checks for Special Characters, and handles Line Breaks + switch (c) + { + case '\n': + if (zero.X > textWidth) + textWidth = zero.X; + + zero.X = 0; + + float highestYscale = 1f; + for (int j = i + 1; j < Text.Length; j++) + { + if (Text[j] == '\n') + break; + if (UniqueScales.TryGetValue(j, out Vector2 uniqueScale) && uniqueScale.Y > highestYscale) + highestYscale = uniqueScale.Y; + } + zero.Y += FontAssetSystem.Fonts[FontKey].LineSpacing * highestYscale; + newLine = true; + continue; + case '\r': + continue; + } + + if (LineBreakIndexes.Contains(i)) + { + if (zero.X > textWidth) + textWidth = zero.X; + + zero.X = 0; + + float highestYscale = 1f; + for (int j = i + 1; j < Text.Length; j++) + { + if (Text[j] == '\n') + break; + if (UniqueScales.TryGetValue(j, out Vector2 uniqueScale) && uniqueScale.Y > highestYscale) + highestYscale = uniqueScale.Y; + } + zero.Y += FontAssetSystem.Fonts[FontKey].LineSpacing * highestYscale; + newLine = true; + } + + //Sets the character's position within the full text + SpriteCharacterData spriteData = FontAssetSystem.Fonts[FontKey].SpriteCharacters[c]; + Vector3 kerning = spriteData.Kerning; + Rectangle padding = spriteData.Padding; + + if (newLine) + kerning.X = Math.Max(kerning.X, 0f); + else + zero.X += FontAssetSystem.Fonts[FontKey].CharacterSpacing * scale.X; + + zero.X += kerning.X * scale.X; + Vector2 position = zero + spriteData.Glyph.Size() * 0.5f; + position.X += padding.X * scale.X; + position.Y += padding.Y * scale.Y; + + CharacterData[i].TextPosition = position - (Vector2.UnitY * scale.Y * FontAssetSystem.Fonts[FontKey].LineSpacing * 0.5f); + + zero.X += (kerning.Y + kerning.Z) * scale.X; + newLine = false; + #endregion + } + + if (zero.X > textWidth) + textWidth = zero.X; + float textHeight = zero.Y; + + if (DialoguePage.AlignType != Alignment.Left) + { + for (int i = 0; i < lineLengths.Length; i++) + { + DialogueCharacterData furthestChar = CharacterData.Last(d => d.LineNumber == i && Text[d.Index] != '\n'); + float xPos = furthestChar.TextPosition.X; + float dif = textWidth - xPos; + if (DialoguePage.AlignType == Alignment.Center) + foreach (var c in CharacterData.Where(c => c.LineNumber == i)) + c.TextPosition.X += dif / 2f; + else + foreach (var c in CharacterData.Where(c => c.LineNumber == i)) + c.TextPosition.X += dif; + } + } + + TextSize = new Vector2(textWidth + 8, textHeight + 12) + SizeOffsetFromStart; + } + + private void FindEffects(ref string fullLine, int fullLength) + { + Stack returnPoints = []; + Stack returnString = []; + + for (int j = 0; j < fullLine.Length; j++) + { + char c = fullLine[j]; + + if (c == '[') + { + int k = j + 1; + string currentData = "["; + bool readingData = true; + for (k = j + 1; k < fullLine.Length; k++) + { + if (fullLine[k] == ']') + break; + if (fullLine[k] == '[') + { + returnPoints.Push(j); + returnString.Push(currentData); + currentData = "["; + c = fullLine[k]; + j = k; + readingData = true; + } + else if (readingData) + { + currentData += fullLine[k]; + if (fullLine[k] == ':') + readingData = false; + } + + } + if (fullLine[k] != ']') + throw new Exception("[ was found without a ] after it."); + + string effect = fullLine[j..k]; + string ID = ""; + string Text = ""; + List Params = []; + List ColorParams = []; + List BorderColorParams = []; + string Param = ""; + bool readingText = false; + bool readingParams = false; + for (int l = 1; l < effect.Length; l++) + { + char ch = effect[l]; + if (ch == '(') + { + readingParams = true; + continue; + } + else if (ch == ':') + { + readingText = true; + continue; + } + else if (ch == ']') + break; + + if (readingText) + Text += ch; + else if (readingParams) + { + if (ch == ',' || ch == ')') + { + if (ID == "Colors") + { + if (float.TryParse(Param, out float result)) + Params.Add(result); + else + ColorParams.Add(Param); + } + if (ID == "BorderColors") + { + if (float.TryParse(Param, out float result)) + Params.Add(result); + else + BorderColorParams.Add(Param); + } + else + { + if (float.TryParse(Param, out float result)) + Params.Add(result); + else + throw new Exception("Invalid Parameter found"); + } + Param = ""; + } + else if (ch == ' ') + continue; + else + Param += ch; + } + else + ID += ch; + } + + fullLine = fullLine.Remove(j, k - j + 1); + fullLine = fullLine.Insert(j, Text); + + if (ID == "Pause") + { + Pauses.Add(j - 1 + fullLength - ID.Length - Params[0].ToString().Length, Params[0]); + } + else + { + for (int i = 0; i < Text.Length; i++) + { + int index = j + i + fullLength; + if (ID == "Colors") + { + int storedLen = 0; + foreach (string s in returnString) + storedLen += s.Length; + + UniqueColors.Add(index - storedLen, (Params.Count == 0 ? 0 : Params[0], [.. ColorParams])); + } + else if (ID == "BorderColors") + { + int storedLen = 0; + foreach (string s in returnString) + storedLen += s.Length; + + UniqueBorderColors.Add(index - storedLen, (Params.Count == 0 ? 0 : Params[0], [.. BorderColorParams])); + } + else if (ID == "Scale") + { + int storedLen = 0; + foreach (string s in returnString) + storedLen += s.Length; + + Vector2 scale; + if (Params.Count == 0) + scale = Vector2.One; + else if (Params.Count == 1) + scale = new(Params[0], Params[0]); + else + scale = new(Params[0], Params[1]); + + + UniqueScales.Add(index - storedLen, scale); + } + else + { + int storedLen = 0; + foreach (string s in returnString) + storedLen += s.Length; + + string path = "CalamityMod.UI.DialogueDisplay.TextEffects."; + Type t = Type.GetType(path + ID) ?? throw new Exception("Invalid text effect ID found"); + TextEffect te = (TextEffect)Activator.CreateInstance(t); + if (TextEffects.TryGetValue(index - storedLen, out var value)) + value.Add(new(te, [.. Params])); + else + TextEffects.Add(index - storedLen, [new(te, [.. Params])]); + } + } + } + + if (returnPoints.Count > 0) + { + j = returnPoints.Pop() - 1; + returnString.Pop(); + } + } + } + } + + private Vector2 MeasureString(string text, DynamicSpriteFont font) + { + if (text.Length == 0) + return Vector2.Zero; + + Vector2 zero = Vector2.Zero; + zero.Y = font.LineSpacing; + float val = 0f; + int num = 0; + float num2 = 0f; + bool newLine = true; + for (int i = 0; i < text.Length; i++) + { + char c = text[i]; + Vector2 scale = Vector2.One; + if (UniqueScales.TryGetValue(i, out Vector2 result)) + scale = result; + else if (DialoguePage.TextScale != -1) + scale *= DialoguePage.TextScale; + + //Checks for Special Characters, and handles Line Breaks + switch (c) + { + case '\n': + zero.X = 0; + + float highestYscale = 1f; + for (int j = i + 1; j < text.Length; j++) + { + if (text[j] == '\n') + break; + if (UniqueScales.TryGetValue(j, out Vector2 uniqueScale) && uniqueScale.Y > highestYscale) + highestYscale = uniqueScale.Y; + } + zero.Y += font.LineSpacing * highestYscale; + newLine = true; + continue; + case '\r': + continue; + } + + //Sets the character's position within the full text + SpriteCharacterData spriteData = font.SpriteCharacters[c]; + Vector3 kerning = spriteData.Kerning; + Rectangle padding = spriteData.Padding; + + if (newLine) + kerning.X = Math.Max(kerning.X, 0f); + else + zero.X += font.CharacterSpacing * scale.X; + + zero.X += kerning.X * scale.X; + Vector2 position = zero + spriteData.Glyph.Size() * 0.5f; + position.X += padding.X * scale.X; + position.Y += padding.Y * scale.Y; + + zero.X += (kerning.Y + kerning.Z) * scale.X; + newLine = false; + } + + zero.X += Math.Max(num2, 0f); + zero.Y += num * font.LineSpacing; + zero.X = Math.Max(zero.X, val); + return zero; + } + + public override void Update(GameTime gameTime) + { + base.Update(gameTime); + + if (DialoguePage.Event != null) + DialoguePage.Event.UpdateEvent(); + else if (!Switching) + { + if (DisplayEffects.FadeWhenTooFar) + { + float distFromSource = Vector2.Distance(Main.LocalPlayer.Center, Position); + SwitchCounter = (int)(MathHelper.Clamp((distFromSource - DisplayEffects.FadeBuffer) / DisplayEffects.FadeDistance, 0f, 1f) * DisplayEffects.TimeToDisappear); + } + + int textDelay = DialoguePage.TextDelay; + if (DialoguePage.TextDelay != -1) + textDelay = DialoguePage.TextDelay; + + if (DialoguePage.Event != null && !DialoguePage.Event.IsOver) + { + DialoguePage.Event.UpdateEvent(); + } + + if (textIndex < Text.Length) + { + if (TextTimer == 0) + { + if (!lockDelay) + { + PunctuationData data = new(); + if (DialoguePage.BasePunctuationDelay != null) + data = DialoguePage.BasePunctuationDelay; + + if (DialoguePage.PunctuationDelays != null) + { + if (DialoguePage.PunctuationDelays.TryGetValue(Text[textIndex].ToString(), out var value)) + data = value; + else if (DialoguePage.PunctuationDelays.TryGetValue(Text[textIndex].ToString(), out value)) + data = value; + } + + switch (Text[textIndex]) + { + case '.': + case '?': + case '!': + case ';': + case ':': + case ',': + if (data.ForceSet) + storedDelay = data.Delay; + else + storedDelay += data.Delay; + break; + case '-': + case '–': + case '—': + if (textIndex == Text.Length - 1 || Text[textIndex + 1] == ' ') + { + if (data.ForceSet) + storedDelay = data.Delay; + else + storedDelay += data.Delay; + } + break; + } + + if (data.Locks) + lockDelay = true; + } + + if (Pauses.TryGetValue(textIndex, out float pause)) + storedDelay = (int)(pause * 60); + } + + if (++TextTimer % ((Text[textIndex] == ' ' || Text[textIndex] == '\n') && storedDelay > 0 ? textDelay + storedDelay : textDelay) == 0 && TextTimer >= 0) + { + if (Text[textIndex] == ' ') + { + storedDelay = 0; + lockDelay = false; + } + else + { + string speaker = null; + if (DialoguePage.Speaker != null) + speaker = DialoguePage.Speaker; + if (speaker != null) + SoundEngine.PlaySound(DialogueSounds[speaker]); + } + + TextTimer = 0; + ++textIndex; + } + } + else + Crawling = false; + } + + if (!Crawling) + Uptime++; + DialogueTimer++; + } + + protected override void DrawSelf(SpriteBatch spriteBatch) + { + Vector2 textTop = DisplayEffects.TextOffsetFromStart(Position, TextSize); + Vector2 pageTop = textTop - SizeOffsetFromStart; + + DisplayEffects.PreDraw(spriteBatch, pageTop, TextSize, DialogueTimer, SwitchCounter); + + #region Shadow Drawing + for (int i = 0; i < textIndex; i++) + { + char c = Text[i]; + + if (c == '\r' || c == '\n') + continue; + + if (CharacterData == null) + Activate(); + + Vector2 drawPos; + float rotation = 0f; + float opacity = 1f; + Vector2 scale = Vector2.One; + if (UniqueScales.TryGetValue(i, out Vector2 result)) + scale = result; + + Color color; + if (UniqueColors.TryGetValue(i, out var textColors)) + { + Color[] colors = new Color[textColors.hexcodes.Length]; + for (int j = 0; j < colors.Length; j++) + colors[j] = DialogueDisplaySystem.GetColorFromHex(textColors.hexcodes[j]); + + color = CalamityUtils.MulticolorLerp(Main.GlobalTimeWrappedHourly + (i * textColors.IndexOffset), colors); + } + else + color = BaseColor; + + Color borderColor; + if (UniqueBorderColors.TryGetValue(i, out var borderColors)) + { + Color[] colors = new Color[borderColors.hexcodes.Length]; + for (int j = 0; j < colors.Length; j++) + colors[j] = DialogueDisplaySystem.GetColorFromHex(borderColors.hexcodes[j]); + + borderColor = CalamityUtils.MulticolorLerp(Main.GlobalTimeWrappedHourly + (i * borderColors.IndexOffset), colors); + } + else + borderColor = BaseBorderColor; + + if (CharacterData[i].Timer < DisplayEffects.TimeToAppear) + { + drawPos = DisplayEffects.AppearPositioning(Position, textTop + CharacterData[i].TextPosition, CharacterData[i].Timer, CharacterData[i]); + opacity = DisplayEffects.AppearOpacity(opacity, CharacterData[i].Timer, CharacterData[i]); + color = DisplayEffects.AppearColoring(color, CharacterData[i].Timer, CharacterData[i]); + rotation = DisplayEffects.AppearRotation(rotation, CharacterData[i].Timer, CharacterData[i]); + scale = DisplayEffects.AppearScale(scale, CharacterData[i].Timer, CharacterData[i]); + } + else + drawPos = textTop + CharacterData[i].TextPosition; + + if (SwitchCounter > 0) + { + drawPos = DisplayEffects.DisappearPositioning(drawPos, SwitchCounter, CharacterData[i]); + opacity = DisplayEffects.DisappearOpacity(opacity, SwitchCounter, CharacterData[i]); + color = DisplayEffects.DisappearColoring(color, SwitchCounter, CharacterData[i]); + rotation = DisplayEffects.DisappearRotation(rotation, SwitchCounter, CharacterData[i]); + scale = DisplayEffects.DisappearScale(scale, SwitchCounter, CharacterData[i]); + } + + if (!ScreenLocked) + drawPos -= Main.screenPosition; + + foreach (var l in TextEffects.Where(v => v.Key == i)) + foreach ((TextEffect Effect, float[] args) in l.Value) + { + drawPos = Effect.ModifyPos(drawPos, CharacterData[i], args); + + rotation = Effect.ModifyRot(rotation, CharacterData[i], args); + + color = Effect.ModifyColor(color, CharacterData[i], args); + + scale = Effect.ModifyScale(scale, CharacterData[i], args); + } + + SpriteCharacterData spriteData = FontAssetSystem.Fonts[FontKey].SpriteCharacters[c]; + Vector2 origin = spriteData.Glyph.Size() * 0.5f; + + CharacterData[i].SetDrawInfo(drawPos, spriteData.Glyph, color * opacity, rotation, scale); + + foreach (var l in TextEffects.Where(v => v.Key == i)) + foreach ((TextEffect Effect, float[] args) in l.Value) + Effect.PreDraw(spriteBatch, spriteData.Texture, CharacterData[i]); + + for (int j = 0; j < ChatManager.ShadowDirections.Length; j++) + spriteBatch.Draw(spriteData.Texture, drawPos + (ChatManager.ShadowDirections[j] * 2), spriteData.Glyph, borderColor * opacity, rotation, origin, scale, SpriteEffects.None, 0); + } + #endregion + + #region Character Drawing + for (int i = 0; i < textIndex; i++) + { + char c = Text[i]; + + if (c == '\r' || c == '\n') + continue; + + if (CharacterData == null) + Activate(); + + SpriteCharacterData spriteData = FontAssetSystem.Fonts[FontKey].SpriteCharacters[c]; + Vector2 origin = spriteData.Glyph.Size() * 0.5f; + + spriteBatch.Draw(spriteData.Texture, CharacterData[i].DrawPosition, spriteData.Glyph, CharacterData[i].DrawColor, CharacterData[i].Rotation, origin, CharacterData[i].Scale, SpriteEffects.None, 0); + + foreach (var l in TextEffects.Where(v => v.Key == i)) + foreach ((TextEffect Effect, float[] args) in l.Value) + Effect.PostDraw(spriteBatch, spriteData.Texture, CharacterData[i]); + + CharacterData[i].Timer++; + } + #endregion + + DisplayEffects.PostDraw(spriteBatch, pageTop, TextSize, DialogueTimer, SwitchCounter); + } + } + + public class DialogueDisplaySystem : ModSystem + { + internal static DialogueDisplayUI State; + + internal static UserInterface UI; + + public override void Load() + { + if (!Main.dedServ) + { + UI = new(); + State = new(); + State.Activate(); + } + } + + public override void ModifyInterfaceLayers(List layers) + { + int preInventory = layers.FindIndex(layer => layer.Name == "Vanilla: Interface Logic 2"); + if (preInventory != -1) + { + layers.Insert(preInventory, new LegacyGameInterfaceLayer("Dialogue Display", () => + { + UI.Draw(Main.spriteBatch, new()); + return true; + }, InterfaceScaleType.Game)); + } + } + + public override void UpdateUI(GameTime gameTime) + { + if (UI?.CurrentState != null) + UI?.Update(gameTime); + } + + public static readonly JsonSerializerOptions stringEnumOptions = new() + { + Converters = { new JsonStringEnumConverter() } + }; + + public static DialogueTextData Deserialize(string key) + { + string activeExtension = LanguageManager.Instance.ActiveCulture.Name; + string path = "UI/DialogueDisplay/" + activeExtension + "/" + key + ".json"; + + // Fall back to english if not found + if (!CalamityMod.Instance.FileExists(path)) + path = "UI/DialogueDisplay/en-US/" + key + ".json"; + + // Throw if we cant find english either + if (!CalamityMod.Instance.FileExists(path)) + throw new FileNotFoundException($"Could not find the dialog file {path}."); + + Stream stream = CalamityMod.Instance.GetFileStream(path); + + DialogueTextData data = JsonSerializer.Deserialize(stream, stringEnumOptions); + + stream.Close(); + + return data; + } + + public static Color GetColorFromHex(string hex) + { + System.Drawing.Color color = System.Drawing.ColorTranslator.FromHtml('#' + hex); + int r = Convert.ToInt16(color.R); + int g = Convert.ToInt16(color.G); + int b = Convert.ToInt16(color.B); + return new Color(r, g, b); + } + + /// + /// Manually progresses dialogue + /// + public static void ProgressDialogue(string pearlKey) + { + if (DialogueDisplayUI.Dialogues.TryGetValue(pearlKey, out var val)) + { + DialogueDisplay display = val.ui; + if (display.SwitchingPage) + return; + + // If the text crawl hasnt finished, finish it instantly + if (display.textIndex < display.Text.Length - 1) + display.textIndex = display.Text.Length - 1; + // If the text crawl has finished, progress to the next page or finish if we're out of pages + else + display.SwitchingPage = true; + } + } + + /// + /// Ends the dialogue if it exists in the world + /// + /// The name of the dialogue's localization key + public static void EndDialogue(string key) + { + if (DialogueDisplayUI.Dialogues.TryGetValue(key, out var val)) + val.ui.ClosingDialogue = true; + } + + public static void RemoveDialogue(string key) + { + DialogueDisplayUI.DialoguesToRemove.Add(key); + } + + /// + /// Creates a dialogue instance in the world + /// + /// The name of the dialogue's localization key + /// The position of the text in the world + public static void StartDialogue(string key, Vector2 startPosition, int Uptime = -1, bool progressDialogue = true, DisplayEffect effects = null, float wrapWidth = -1) + { + UI ??= new(); + State ??= new(); + effects ??= new DisplayEffect(); + + DialogueTextData textData = Deserialize(key); + + DialogueDisplay display = new(textData.Pages[0], effects, wrapWidth: wrapWidth) + { + Position = startPosition, + ProgressDialogue = progressDialogue, + }; + DialogueDisplayUI.Dialogues.Add(key, (display, textData)); + if (Uptime != -1) + DialogueDisplayUI.DialogueUptimes.Add(key, Uptime); + State.Append(display); + display.Activate(); + + if (UI.CurrentState != State) + UI?.SetState(State); + } + + /// + /// Creates a dialogue instance in the world + /// + /// The name of the dialogue's localization key + /// The entity this dialogue will appear with + /// The entity this dialogue will appear with + public static void StartDialogue(string key, Entity entity, int Uptime = -1, DisplayEffect effects = null, float wrapWidth = -1) + { + UI ??= new(); + State ??= new(); + effects ??= new DisplayEffect(); + + DialogueTextData textData = Deserialize(key); + + DialogueDisplay display = new(textData[0], effects, wrapWidth: wrapWidth) + { + Position = entity.Center + }; + DialogueDisplayUI.Dialogues.Add(key, (display, textData)); + DialogueDisplayUI.DialogueEntities.Add(key, entity); + if (Uptime != -1) + DialogueDisplayUI.DialogueUptimes.Add(key, Uptime); + State.Append(display); + display.Activate(); + + if (UI.CurrentState != State) + UI?.SetState(State); + } + + /// + /// Resets all of the dialogue's variables + /// + public static void EndAllDialogue() + { + DialogueDisplayUI.Dialogues.Clear(); + State.RemoveAllChildren(); + UI?.SetState(null); + } + } + + public enum Alignment + { + None = -1, + Left, + Center, + Right + } + + public class DialogueTextData + { + public DialoguePage[] Pages { get; init; } + public DialoguePage this[int index] { get => Pages[index]; set => Pages[index] = value; } + + public int Page { get; set; } + public int PageCount => Pages.Length; + + public string DefaultColor { get; init; } + public string DefaultSpeaker { get; init; } + + public int DefaultScale { get; init; } + + public Alignment AlignType { get; init; } + + public int TextDelay { get; init; } + public PunctuationData BasePunctuationDelay { get; init; } + public int PunctuationDelayCap { get; init; } + public Dictionary PunctuationDelays { get; init; } + + [JsonConstructor] + public DialogueTextData(DialoguePage[] pages, int page = 0, string defaultColor = null, string defaultSpeaker = null, int defaultScale = 1, Alignment alignType = Alignment.Left, int textDelay = 3, PunctuationData basePunctuationDelay = null, int punctuationDelayCap = 60, Dictionary punctuationDelays = null) + { + Pages = pages; + Page = page; + DefaultColor = defaultColor; + DefaultSpeaker = defaultSpeaker; + DefaultScale = defaultScale; + TextDelay = textDelay; + BasePunctuationDelay = basePunctuationDelay ?? new(); + PunctuationDelayCap = punctuationDelayCap; + PunctuationDelays = punctuationDelays ?? []; + AlignType = alignType; + + foreach (DialoguePage p in Pages) + { + p.BaseColor ??= defaultColor; + p.Speaker ??= defaultSpeaker; + if (p.TextScale == -1) + p.TextScale = DefaultScale; + if (p.TextDelay == -1) + p.TextDelay = TextDelay; + if (p.AlignType == Alignment.None) + p.AlignType = AlignType; + p.BasePunctuationDelay ??= BasePunctuationDelay; + if (p.PunctuationDelayCap == -1) + p.PunctuationDelayCap = PunctuationDelayCap; + p.PunctuationDelays ??= PunctuationDelays; + } + } + } + + public class DialoguePage + { + public string[] Lines { get; set; } + + public string BaseColor { get; set; } = null; + public string BaseBorderColor { get; set; } = null; + public float BorderDarkening { get; set; } = 0.33f; + public string Speaker { get; set; } = null; + + public int TextScale { get; set; } = -1; + public Alignment AlignType { get; set; } = Alignment.Left; + + + public int TextDelay { get; set; } = -1; + public PunctuationData BasePunctuationDelay { get; set; } = null; + public int PunctuationDelayCap { get; set; } = -1; + public Dictionary PunctuationDelays { get; set; } = null; + + public DialogueEvent Event { get; set; } = null; + } + + public class PunctuationData + { + public int Delay { get; set; } = 10; + public bool ForceSet { get; set; } = false; + public bool Locks { get; set; } = false; + } + + public class DialogueCharacterData(int index, int textLength, int lineNumber) + { + public int Timer = 0; + + #region Text Info + public int Index = index; + + public int TextLength = textLength; + + public int LineNumber = lineNumber; + + public float CompletionRatio => Index / (float)TextLength; + + public Vector2 TextPosition = Vector2.Zero; + #endregion + + #region Draw Info + public Vector2 DrawPosition; + public Rectangle Frame; + public Color DrawColor; + public float Rotation; + public Vector2 Scale; + + internal void SetDrawInfo(Vector2 drawPos, Rectangle frame, Color color, float rotation, Vector2 scale) + { + DrawPosition = drawPos; + Frame = frame; + DrawColor = color; + Rotation = rotation; + Scale = scale; + } + #endregion + } + +} diff --git a/UI/DialogueDisplay/DialogueEvents/DialogueEvent.cs b/UI/DialogueDisplay/DialogueEvents/DialogueEvent.cs new file mode 100644 index 0000000000..25f3ef9479 --- /dev/null +++ b/UI/DialogueDisplay/DialogueEvents/DialogueEvent.cs @@ -0,0 +1,18 @@ +namespace CalamityMod.UI.DialogueDisplay.DialogueEvents +{ + public abstract class DialogueEvent + { + public string ID { get; set; } + public string[] Args { get; set; } + + internal bool EventOver = true; + public bool IsOver => EventOver; + + internal int EventCounter = 0; + + public virtual void UpdateEvent() + { + EventCounter++; + } + } +} diff --git a/UI/DialogueDisplay/DialogueEvents/SoundEvent.cs b/UI/DialogueDisplay/DialogueEvents/SoundEvent.cs new file mode 100644 index 0000000000..2fc79a048f --- /dev/null +++ b/UI/DialogueDisplay/DialogueEvents/SoundEvent.cs @@ -0,0 +1,19 @@ +using ReLogic.Utilities; +using Terraria.Audio; + +namespace CalamityMod.UI.DialogueDisplay.DialogueEvents +{ + public class SoundEvent : DialogueEvent + { + SoundStyle style; + SlotId soundSlot; + + public override void UpdateEvent() + { + if (EventCounter == 0) + soundSlot = SoundEngine.PlaySound(style = new SoundStyle(Args[0])); + else if (!SoundEngine.TryGetActiveSound(soundSlot, out var result) || result.Style != style) + EventOver = true; + } + } +} diff --git a/UI/DialogueDisplay/DisplayEffects/AlwaysOnScreen.cs b/UI/DialogueDisplay/DisplayEffects/AlwaysOnScreen.cs new file mode 100644 index 0000000000..43b4cc0fff --- /dev/null +++ b/UI/DialogueDisplay/DisplayEffects/AlwaysOnScreen.cs @@ -0,0 +1,47 @@ +using Microsoft.Xna.Framework.Graphics; +using Terraria.ModLoader; +using Terraria; +using Microsoft.Xna.Framework; + +namespace CalamityMod.UI.DialogueDisplay.DisplayEffects +{ + public class AlwayOnScreen : DisplayEffect + { + Vector2 StartPosition; + + public override bool FadeWhenTooFar => false; + + public override Vector2 TextOffsetFromStart(Vector2 startPos, Vector2 textSize) + { + StartPosition = startPos; + + Vector2 playerPos = Main.LocalPlayer.Center; + Vector2 halfSize = textSize * 0.5f; + Vector2 newPos = startPos - halfSize + (Vector2.UnitY * -(textSize.Y + 36)); + Vector2 screenPos = newPos.ToScreenPosition(); + + Vector2 boundTopLeftScreen = new((Main.screenWidth / 2f) - (Main.screenWidth / 2.5f), (Main.screenHeight / 2f) - (Main.screenHeight / 2.5f)); + + if (screenPos.X < boundTopLeftScreen.X) + newPos.X = playerPos.X - (Main.screenWidth / 2.5f); + if (screenPos.Y < boundTopLeftScreen.Y) + newPos.Y = playerPos.Y - (Main.screenHeight / 2.5f); + + if (newPos.X > playerPos.X + (Main.screenWidth / 2.5f) - textSize.X) + newPos.X = playerPos.X + (Main.screenWidth / 2.5f) - textSize.X; + if (newPos.Y > playerPos.Y + (Main.screenHeight / 2.5f) - textSize.Y) + newPos.Y = playerPos.Y + (Main.screenHeight / 2.5f) - textSize.Y; + + return newPos; + } + + public override void PreDraw(SpriteBatch spriteBatch, Vector2 textTopLeft, Vector2 textSize, int textTimer, int switchTimer) + { + Texture2D tex = ModContent.Request("CalamityMod/UI/DialogueDisplay/Assets/DialogueArrow").Value; + Vector2 textCenter = textTopLeft + textSize * 0.5f; + Vector2 toStart = (StartPosition - textCenter).SafeNormalize(-Vector2.UnitY) * 64; + spriteBatch.Draw(tex, textCenter + toStart - Main.screenPosition, null, Color.White, toStart.ToRotation(), tex.Size() * 0.5f, 1f, 0, 0); + } + } + +} diff --git a/UI/DialogueDisplay/DisplayEffects/BuiltEffect.cs b/UI/DialogueDisplay/DisplayEffects/BuiltEffect.cs new file mode 100644 index 0000000000..5d74c9ba32 --- /dev/null +++ b/UI/DialogueDisplay/DisplayEffects/BuiltEffect.cs @@ -0,0 +1,12 @@ +using Microsoft.Xna.Framework; +using Terraria; + +namespace CalamityMod.UI.DialogueDisplay.DisplayEffects +{ + public class BuiltEffect : DisplayEffect + { + public override Vector2 AppearPositioning(Vector2 startPos, Vector2 goalPos, float time, DialogueCharacterData charData) => Vector2.Lerp(goalPos + Vector2.UnitX.RotatedBy(charData.Index) * 400, goalPos, time / TimeToAppear); + + public override float AppearRotation(float goalRotation, float time, DialogueCharacterData charData) => MathHelper.Lerp(goalRotation + MathHelper.TwoPi * 2, goalRotation, time / TimeToAppear); + } +} diff --git a/UI/DialogueDisplay/DisplayEffects/DisplayEffect.cs b/UI/DialogueDisplay/DisplayEffects/DisplayEffect.cs new file mode 100644 index 0000000000..d4cb2b60d3 --- /dev/null +++ b/UI/DialogueDisplay/DisplayEffects/DisplayEffect.cs @@ -0,0 +1,49 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace CalamityMod.UI.DialogueDisplay.DisplayEffects +{ + public class DisplayEffect + { + public virtual Vector2 TextOffsetFromStart(Vector2 startPos, Vector2 textSize) => startPos + new Vector2(-textSize.X / 2f, -(textSize.Y + 40)); + + public virtual bool FadeWhenTooFar => true; + + public virtual float FadeBuffer => 150f; + + public virtual float FadeDistance => 150f; + + public virtual void PreDraw(SpriteBatch spriteBatch, Vector2 textStart, Vector2 textSize, int textTimer, int switchTimer) { } + + public virtual void PostDraw(SpriteBatch spriteBatch, Vector2 textStart, Vector2 textSize, int textTimer, int switchTimer) { } + + public virtual float TimeToAppear => 30; + + #region Appear Functions + public virtual Vector2 AppearPositioning(Vector2 startPos, Vector2 goalPos, float time, DialogueCharacterData charData) => Vector2.Lerp(startPos, goalPos, CalamityUtils.SineOutEasing(time / TimeToAppear, 1)); + + public virtual Color AppearColoring(Color goalColor, float time, DialogueCharacterData charData) => goalColor; + + public virtual float AppearOpacity(float goalOpacity, float time, DialogueCharacterData charData) => CalamityUtils.SineOutEasing(MathHelper.Clamp(time / 20f, 0f, 1f), 1); + + public virtual float AppearRotation(float goalRotation, float time, DialogueCharacterData charData) => goalRotation; + + public virtual Vector2 AppearScale(Vector2 goalScale, float time, DialogueCharacterData charData) => Vector2.Lerp(Vector2.Zero, goalScale, CalamityUtils.CircOutEasing(time / TimeToAppear, 1)); + #endregion + + public virtual float TimeToDisappear => 30; + + #region Disappear Functions + public virtual Vector2 DisappearPositioning(Vector2 startPos, float time, DialogueCharacterData charData) => startPos; + + public virtual Color DisappearColoring(Color startColor, float time, DialogueCharacterData charData) => startColor; + + public virtual float DisappearOpacity(float startOpacity, float time, DialogueCharacterData charData) => 1 - CalamityUtils.SineOutEasing(MathHelper.Clamp(time / (TimeToDisappear * 0.66f), 0f, 1f), 1); + + public virtual float DisappearRotation(float startRotation, float time, DialogueCharacterData charData) => startRotation; + + public virtual Vector2 DisappearScale(Vector2 startScale, float time, DialogueCharacterData charData) => Vector2.Lerp(startScale, startScale * 1.5f, CalamityUtils.ExpOutEasing(time / TimeToDisappear, 1)); + #endregion + } + +} diff --git a/UI/DialogueDisplay/DisplayEffects/WhisperingPearlEffects.cs b/UI/DialogueDisplay/DisplayEffects/WhisperingPearlEffects.cs new file mode 100644 index 0000000000..420dbd1258 --- /dev/null +++ b/UI/DialogueDisplay/DisplayEffects/WhisperingPearlEffects.cs @@ -0,0 +1,27 @@ +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework; +using Terraria.ModLoader; +using Terraria; + +namespace CalamityMod.UI.DialogueDisplay.DisplayEffects +{ + public class WhisperingPearlEffects : DisplayEffect + { + public override void PreDraw(SpriteBatch spriteBatch, Vector2 textStart, Vector2 textSize, int textTimer, int switchTimer) + { + if (textTimer < 0) + return; + + float Opacity = 1f; + if (textTimer < 30f) + Opacity = MathHelper.Lerp(0f, 1f, CalamityUtils.CircOutEasing(textTimer / 30f, 1)); + + if (switchTimer > 0) + Opacity *= 1 - CalamityUtils.CircOutEasing(switchTimer / 60f, 1); + + Texture2D tex = ModContent.Request("CalamityMod/Particles/SmallBloom").Value; + spriteBatch.Draw(tex, textStart + textSize * 0.5f - Main.screenPosition, null, Color.Black * 0.6f * Opacity, 0f, tex.Size() * 0.5f, new Vector2(textSize.X / 160f, textSize.Y / 120f), 0, 0); + } + } + +} diff --git a/UI/DialogueDisplay/TextEffects/Shaking.cs b/UI/DialogueDisplay/TextEffects/Shaking.cs new file mode 100644 index 0000000000..67ec28bf1a --- /dev/null +++ b/UI/DialogueDisplay/TextEffects/Shaking.cs @@ -0,0 +1,19 @@ +using Microsoft.Xna.Framework; +using Terraria; + +namespace CalamityMod.UI.DialogueDisplay.TextEffects +{ + internal class Shaking : TextEffect + { + private const float StandardAmp = 2f; + + public override Vector2 ModifyPos(Vector2 pos, DialogueCharacterData data, float[] args) + { + var amp = StandardAmp; + if (args.Length > 0) + amp = args[0]; + + return pos + Main.rand.NextVector2Circular(amp, amp); + } + } +} diff --git a/UI/DialogueDisplay/TextEffects/TextEffect.cs b/UI/DialogueDisplay/TextEffects/TextEffect.cs new file mode 100644 index 0000000000..50f3ce4baf --- /dev/null +++ b/UI/DialogueDisplay/TextEffects/TextEffect.cs @@ -0,0 +1,17 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace CalamityMod.UI.DialogueDisplay.TextEffects +{ + public abstract class TextEffect + { + public virtual Vector2 ModifyPos(Vector2 pos, DialogueCharacterData data, float[] args) => pos; + public virtual float ModifyRot(float rot, DialogueCharacterData data, float[] args) => rot; + public virtual Color ModifyColor(Color current, DialogueCharacterData data, float[] args) => current; + public virtual Vector2 ModifyScale(Vector2 scale, DialogueCharacterData data, float[] args) => scale; + + public virtual void PreDraw(SpriteBatch spritebatch, Texture2D texture, DialogueCharacterData data) { } + public virtual void PostDraw(SpriteBatch spritebatch, Texture2D texture, DialogueCharacterData data) { } + + } +} diff --git a/UI/DialogueDisplay/TextEffects/Wavy.cs b/UI/DialogueDisplay/TextEffects/Wavy.cs new file mode 100644 index 0000000000..deae5245f7 --- /dev/null +++ b/UI/DialogueDisplay/TextEffects/Wavy.cs @@ -0,0 +1,34 @@ +using System; +using Microsoft.Xna.Framework; +using Terraria; + +namespace CalamityMod.UI.DialogueDisplay.TextEffects +{ + public class Wavy : TextEffect + { + private const float StandardAmp = 6f; + + private const float StandardFreq = 1.5f; + + private const float StandardOffsetFactor = MathHelper.TwoPi / 320f; //since we use position, this means a full cycle will occur every 320 coordiantes + + public override Vector2 ModifyPos(Vector2 pos, DialogueCharacterData data, float[] args) + { + var amp = StandardAmp; + if(args.Length > 0) + amp = args[0]; + + var freq = StandardFreq; + if (args.Length > 1) + freq = args[1]; + + var indexFactor = StandardOffsetFactor; + if (args.Length > 2) + indexFactor = args[2]; + + var sineWave = (float)Math.Sin(Main.GlobalTimeWrappedHourly * freq + data.TextPosition.X * indexFactor) * amp; + + return pos + Vector2.UnitY * sineWave; + } + } +} diff --git a/UI/DialogueDisplay/en-US/OceanBlue.json b/UI/DialogueDisplay/en-US/OceanBlue.json new file mode 100644 index 0000000000..3343eb23ee --- /dev/null +++ b/UI/DialogueDisplay/en-US/OceanBlue.json @@ -0,0 +1,27 @@ +{ + "Pages": [ + { + "BaseColor": "6383FF", + "BaseBorderColor": "020104", + "Speaker": "Amidias", + + "PunctuationDelays": { + "!": { + "Delay": 40, + "ForceSet": true, + "Locks": true + }, + "?": { + "Delay": 40, + "ForceSet": true, + "Locks": true + } + }, + + "Lines": [ + "[Wavy:'Glub, glub, im a fish. Glub glub, im a fish]", + "[Wavy:[BorderColors(EEA5A9):Glub, glub, im a fish. Glub glub, im a fish']]" + ] + } + ] +} \ No newline at end of file diff --git a/UI/DialogueDisplay/en-US/RoyalBlue.json b/UI/DialogueDisplay/en-US/RoyalBlue.json new file mode 100644 index 0000000000..4e808a2a2d --- /dev/null +++ b/UI/DialogueDisplay/en-US/RoyalBlue.json @@ -0,0 +1,179 @@ +{ + "TextDelay": 3, + "BasePunctuationDelay": { + "Delay": 10, + "ForceSet": false, + "Locks": false + }, + "PunctuationDelayCap": 30, + "PunctuationDelays": { + "!": { + "Delay": 20, + "ForceSet": true, + "Locks": true + }, + "?": { + "Delay": 20, + "ForceSet": true, + "Locks": true + } + }, + + "Pages": [ + { + "BaseColor": "6383FF", + "Speaker": "Amidias", + + "TextDelay": 5, + "PunctuationDelays": { + "!": { + "Delay": 40, + "ForceSet": true, + "Locks": true + }, + "?": { + "Delay": 40, + "ForceSet": true, + "Locks": true + } + }, + + "Lines": [ + "[Wavy:'My Goddess... [Pause(2.5)]Are you sure of the course of action? [Pause(2.5)]]", + "[Wavy:We could all flee, [Pause(1)]we have the resources left for a full evacuation.']" + ] + }, + + { + "BaseColor": "83ECEE", + "Speaker": "Otonilou", + "Lines": [ + "[Wavy:'No matter to where we flee, the] [Wavy:[Shaking:[Scale(2):[Colors(FFD500):Godseeker]]]] [Wavy:and his troops will]", + "[Wavy:always be one step away. Even if we hid beneath the deepest of waters]", + "[Wavy:nothing will stop the wrath soon approaching.']" + ] + }, + + { + "BaseColor": "6383FF", + "Speaker": "Amidias", + "Lines": [ + "[Wavy:'Can't we erase any trail? Hide until his ultimate passing?]", + "[Wavy:Fake your death?!']" + ] + }, + + { + "BaseColor": "83ECEE", + "Speaker": "Otonilou", + "Lines": [ + "[Wavy:'...Oh, Amidias. I couldn't have wished for a better king.]", + "[Wavy:But the truth is...']" + ] + }, + + { + "BaseColor": "6383FF", + "Speaker": "Amidias", + "Lines": [ + "[Wavy:'Please, don't tell me you believe him.']" + ] + }, + + { + "BaseColor": "83ECEE", + "Speaker": "Otonilou", + "Lines": [ + "[Wavy:'...In his deathbed, [Colors(00FFD5):Vetrasyl] confessed to me.]", + "[Wavy:Of his weakness in the face of danger and shame of his escape.]", + "[Wavy:Despite his pleas to carry on his will,]", + "[Wavy:his sureness that he was entrusting the right woman,]", + "[Wavy:I knew that once I consumed his Soul, I would be a sinner.']" + ] + }, + + { + "BaseColor": "6383FF", + "Speaker": "Amidias", + "Lines": [ + "[Wavy:'...Otonilou, I will not...']" + ] + }, + + { + "BaseColor": "A75C1B", + "Speaker": "Otonilou", + "Lines": [ + "[Wavy:'But none of you are.']" + ] + }, + + { + "BaseColor": "83ECEE", + "Speaker": "Otonilou", + "Lines": [ + "[Wavy:'I have bared my sin for longer than that man's wretched walk upon our planet,]", + "[Wavy:but my people were never sinners!]", + "[Wavy:None of you deserve this fate, to be erased from memory!]", + "[Wavy:And on this day, Amidias...']" + ] + }, + + { + "BaseColor": "83ECEE", + "Speaker": "Otonilou", + "Lines": [ + "[Wavy:'If I am a sinner,]", + "[Wavy:then my death shall wash away the sins of all who call themselves Ilmerans.]", + "[Wavy:I shall burn with our nation so that those who yet live may rise from its ashes,]", + "[Wavy:all free from the sin of your Gods!']" + ] + }, + + { + "BaseColor": "6383FF", + "Speaker": "Amidias", + "Lines": [ + "[Wavy:'My Goddess, I... I...']" + ] + + }, + + { + "BaseColor": "83ECEE", + "Speaker": "Otonilou", + "Lines": [ + "[Wavy:'Shed not a tear, Amidias.]", + "[Wavy:I know this is a tall order, but I wouldn't be giving it to you]", + "[Wavy:if I did not trust in your resolve. So heed me... When the time comes,]", + "[Wavy:guide our people. To a new home, where the sun shines even in the deepest of waters.']" + ] + }, + + { + "BaseColor": "6383FF", + "Speaker": "Amidias", + "Lines": [ + "[Wavy:'...It shall be done, my Goddess.]", + "[Wavy:I shall not perish, not until a future for our kind is secured.]", + "[Wavy:This, I promise.']" + ] + }, + + { + "BaseColor": "6383FF", + "Speaker": "Amidias", + "Lines": [ + "[Wavy:'It was an honor to serve you, Otonilou.']" + ] + }, + + { + "BaseColor": "83ECEE", + "Speaker": "Otonilou", + "Lines": [ + "[Wavy:'And it was an honor to have met you, my king.']" + ] + } + ] +} \ No newline at end of file diff --git a/UI/DraedonSummoning/CodebreakerUI.Communication.cs b/UI/DraedonSummoning/CodebreakerUI.Communication.cs index bfaa365107..341ccc23b8 100644 --- a/UI/DraedonSummoning/CodebreakerUI.Communication.cs +++ b/UI/DraedonSummoning/CodebreakerUI.Communication.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using CalamityMod.Fonts; using CalamityMod.NPCs.ExoMechs; using log4net; using Microsoft.Xna.Framework; @@ -232,15 +233,6 @@ namespace CalamityMod.UI.DraedonSummoning internal set; } = new(); - /// - /// The font used for displaying dialog. - /// - public static DynamicSpriteFont DialogFont - { - get; - internal set; - } - /// /// The dialog hover sound. /// @@ -256,17 +248,6 @@ namespace CalamityMod.UI.DraedonSummoning new("CalamityMod/Sounds/Custom/Codebreaker/DraedonTalk3") }; - public override void OnModLoad() - { - if (Main.dedServ) - return; - - if (Environment.OSVersion.Platform == PlatformID.Win32NT) - DialogFont = CalamityMod.Instance.Assets.Request("Fonts/CodebreakerDialog", AssetRequestMode.ImmediateLoad).Value; - else - DialogFont = FontAssets.MouseText.Value; - } - public static void DisplayCommunicationPanel() { // Draw the background panel. This pops up. @@ -433,7 +414,7 @@ namespace CalamityMod.UI.DraedonSummoning Color textColor = Color.Cyan; Color markerColor = Color.White; - Vector2 textArea = DialogFont.MeasureString(inquiry) * GeneralScale; + Vector2 textArea = FontAssetSystem.Fonts["CodebreakerDialog"].MeasureString(inquiry) * GeneralScale; Rectangle textAreaRect = new((int)textTopLeft.X, (int)textTopLeft.Y, (int)(textArea.X * 0.9f), (int)textArea.Y); Rectangle markerArea = Utils.CenteredRectangle(markerDrawPosition, markerTextureSize); textAreaRect.Y = markerArea.Y; @@ -514,7 +495,7 @@ namespace CalamityMod.UI.DraedonSummoning Vector2 markerTextureOrigin = markerTexture.Size() * 0.5f; Main.spriteBatch.Draw(markerTexture, markerDrawPosition, null, markerColor * opacity, 0f, markerTextureOrigin, markerScale, 0, 0f); - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, DialogFont, inquiry, textTopLeft, textColor * opacity, 0f, Vector2.Zero, Vector2.One * GeneralScale * 0.85f); + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, FontAssetSystem.Fonts["CodebreakerDialog"], inquiry, textTopLeft, textColor * opacity, 0f, Vector2.Zero, Vector2.One * GeneralScale * 0.85f); textTopLeft.Y += verticalOffsetPerOption; OptionsTextHeight += verticalOffsetPerOption; } @@ -632,7 +613,7 @@ namespace CalamityMod.UI.DraedonSummoning foreach (var entry in dialogEntries) { int lineIndex = 0; - foreach (string line in Utils.WordwrapString(entry.Dialog, DialogFont, 336, 1000, out _)) + foreach (string line in Utils.WordwrapString(entry.Dialog, FontAssetSystem.Fonts["CodebreakerDialog"], 336, 1000, out _)) { if (string.IsNullOrEmpty(line)) continue; @@ -650,7 +631,7 @@ namespace CalamityMod.UI.DraedonSummoning Vector2 anchorPoint = new(dialogArea.Center.X, markerDrawPosition.Y); markerDrawPosition.X = anchorPoint.X + (anchorPoint.X - markerDrawPosition.X) - GeneralScale * 12f; localTextTopLeft.X = anchorPoint.X + (anchorPoint.X - localTextTopLeft.X) - GeneralScale * 14f; - localTextTopLeft.X -= DialogFont.MeasureString(line).X * DialogTextScale.X; + localTextTopLeft.X -= FontAssetSystem.Fonts["CodebreakerDialog"].MeasureString(line).X * DialogTextScale.X; localTextTopLeft.Y -= localTextOffsetY; // Use a neutral grey-ish color if text is being said by the player. @@ -664,7 +645,7 @@ namespace CalamityMod.UI.DraedonSummoning Main.spriteBatch.Draw(markerTexture, markerDrawPosition, null, Color.White * dialogHistoryDrawInterpolant, 0f, markerTextureOrigin, markerScale, markerDirection, 0f); // Draw the text itself. - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, DialogFont, line, localTextTopLeft, dialogColor * dialogHistoryDrawInterpolant, 0f, Vector2.Zero, DialogTextScale); + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, FontAssetSystem.Fonts["CodebreakerDialog"], line, localTextTopLeft, dialogColor * dialogHistoryDrawInterpolant, 0f, Vector2.Zero, DialogTextScale); textTopLeft.Y += panelOffsetPerLine; lineIndex++; diff --git a/UI/DraedonsArsenal/ChargeMeterUI.cs b/UI/DraedonsArsenal/ChargeMeterUI.cs index af52bdb329..57c70e0ead 100644 --- a/UI/DraedonsArsenal/ChargeMeterUI.cs +++ b/UI/DraedonsArsenal/ChargeMeterUI.cs @@ -65,7 +65,7 @@ namespace CalamityMod.UI.DraedonsArsenal changed = true; } if (changed) - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); } // If the Charge Meter is turned off or the player is not holding an item, stop. @@ -132,7 +132,7 @@ namespace CalamityMod.UI.DraedonsArsenal if (ms.LeftButton == ButtonState.Released) { dragOffset = null; - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); } } } diff --git a/UI/FlightBar/FlightBar.cs b/UI/FlightBar/FlightBar.cs index db8cf50b90..ce2f74805e 100644 --- a/UI/FlightBar/FlightBar.cs +++ b/UI/FlightBar/FlightBar.cs @@ -125,7 +125,7 @@ namespace CalamityMod.UI } if (changed) - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); return; } @@ -175,7 +175,7 @@ namespace CalamityMod.UI if (ms.LeftButton == ButtonState.Released) { dragOffset = null; - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); } } } diff --git a/UI/ModeIndicator/ModeIndicatorUI.cs b/UI/ModeIndicator/ModeIndicatorUI.cs index 281c4de30d..f56da1d192 100644 --- a/UI/ModeIndicator/ModeIndicatorUI.cs +++ b/UI/ModeIndicator/ModeIndicatorUI.cs @@ -401,6 +401,8 @@ namespace CalamityMod.UI.ModeIndicator // Todo, maybe in the future having a way to have multiple difficulty options on the same tier that can coexist, and it works in branching pathes? Not very necessary for cal & addons. // But would be super useful so other mods can let their own difficulties go there. + DifficultyModeSystem._newGameModeID = mode.BackBoneGameModeID; + // Disable difficulties. for (int i = 0; i < Difficulties.Count; i++) { @@ -440,8 +442,11 @@ namespace CalamityMod.UI.ModeIndicator SoundEngine.PlaySound(mode.ActivationSound); CalamityNetcode.SyncCalamityWorldDifficulties(Main.myPlayer); - menuOpen = false; - menuOpenTransitionTime = MenuAnimLength; + if (menuOpen) + { + menuOpen = false; + menuOpenTransitionTime = MenuAnimLength; + } } #endregion diff --git a/UI/ResourceSets/CalamityResourceOverlay.cs b/UI/ResourceSets/CalamityResourceOverlay.cs index b954995b71..82bcf2a992 100644 --- a/UI/ResourceSets/CalamityResourceOverlay.cs +++ b/UI/ResourceSets/CalamityResourceOverlay.cs @@ -40,6 +40,8 @@ namespace CalamityMod.UI.ResourceSets { string folder = $"{baseFolder}MP"; CalamityPlayer modPlayer = Main.LocalPlayer.Calamity(); + if (Main.LocalPlayer.statMana < 0) + return folder + "ManaBurn"; if (modPlayer.pHeart) return folder + "PhantomHeart"; if (modPlayer.eCore) @@ -92,16 +94,14 @@ namespace CalamityMod.UI.ResourceSets // dozezoze - this method is where Chalice's bleed overlay is drawn. This can almost certainly be optimized, but it shouldn't cause problems. public override void PostDrawResourceDisplay(PlayerStatsSnapshot snapshot, IPlayerResourcesDisplaySet displaySet, bool drawingLife, Color textColor, bool drawText) { - - - var CalPlayer = Main.LocalPlayer.Calamity(); - if (!CalPlayer.chaliceOfTheBloodGod) return; var Player = Main.LocalPlayer; - var bleed = CalPlayer.chaliceBleedoutBuffer; - var hearts = snapshot.AmountOfLifeHearts; + var CalPlayer = Player.Calamity(); if (drawingLife) { + if (!CalPlayer.chaliceOfTheBloodGod) return; + var bleed = CalPlayer.chaliceBleedoutBuffer; + var hearts = snapshot.AmountOfLifeHearts; var height = 0; int drawType = -1; //0 - bars 1- regular heart 2 - fancy heart Vector2 position = new Vector2(Main.screenWidth - 60, 28); @@ -147,7 +147,7 @@ namespace CalamityMod.UI.ResourceSets int width = 12 * snapshot.AmountOfLifeHearts; GraphicsDevice _graphicsDevice = Main.graphics.GraphicsDevice; var barOverlay = new Texture2D(_graphicsDevice, width, 12); - Color[] barTextureData = new Color[12*12]; + Color[] barTextureData = new Color[12 * 12]; ModContent.Request("CalamityMod/UI/ResourceSets/HPChaliceBleedBar").Value.GetData(barTextureData); var pixelsPerLife = 12f / snapshot.LifePerSegment; int deadPixels = (int)Math.Floor((snapshot.LifeMax - snapshot.Life) * pixelsPerLife); @@ -163,7 +163,7 @@ namespace CalamityMod.UI.ResourceSets var bleedCol = Color.Transparent; if ((i_MOD_width < bleedPixels + deadPixels) && !(i_MOD_width < deadPixels)) { - bleedCol = barTextureData[((i % 12)+(i/width)*12)]; + bleedCol = barTextureData[((i % 12) + (i / width) * 12)]; } textureData[i] = bleedCol; @@ -197,7 +197,106 @@ namespace CalamityMod.UI.ResourceSets } } } + // This is where Mana Burn is drawn + else if (Player.statMana < 0) + { + var mana = -Player.statMana; + var stars = snapshot.AmountOfManaStars; + var height = 0; + int drawType = -1; //0 - bars 1- regular heart 2 - fancy heart + Vector2 position = new Vector2(Main.screenWidth - 70, 52); + // This sets which bleed overlay draw style to use, as well as the position needed for the selected stat display + switch (displaySet.NameKey) + { + case "HorizontalBarsWithText": + height = 12; + drawType = 0; + break; + case "HorizontalBarsWithFullText": + height = 12; + position.Y -= 2; + drawType = 0; + break; + case "HorizontalBars": + height = 12; + position.Y -= 4; + drawType = 0; + break; + case "Default": + drawType = 1; + position = new Vector2(Main.screenWidth - 25, 43); + break; + case "New": + drawType = 2; + position = new Vector2(Main.screenWidth - 25, 38); + break; + case "NewWithText": + drawType = 2; + position = new Vector2(Main.screenWidth - 25, 38); + break; + } + if (drawType == -1) + { + return; // Loaded HP style doesn't match any of the vanilla ones, so we won't draw the overlay. + } + if (drawType == 0) //bars + { + + // This works by dynamically creating a texture that it then draws over the life bar. + int width = 12 * stars; + GraphicsDevice _graphicsDevice = Main.graphics.GraphicsDevice; + var barOverlay = new Texture2D(_graphicsDevice, width, 12); + Color[] barTextureData = new Color[12*12]; + ModContent.Request(ManaTexturePath() + "Bar").Value.GetData(barTextureData); + var pixelsPerLife = 12f / snapshot.ManaPerSegment; + int deadPixels = (int)Math.Floor((snapshot.ManaMax + snapshot.Mana) * pixelsPerLife); + var bleedPixels = Math.Round(mana * pixelsPerLife); + + Color[] textureData = new Color[width * 12]; + + // doze 19MAR2025 - I don't know if I could optimize this any further without switching to shaders. + // I don't expect performance issues, but at some point might be worth adding a config to disable the indicator in case of lag or accessibility concerns + for (int i = 0; i < textureData.Length; i++) + { + var i_MOD_width = i % width; //minor optimization, calculated here once instead of twice in the loop. + var bleedCol = Color.Transparent; + if ((i_MOD_width < bleedPixels + deadPixels) && !(i_MOD_width < deadPixels)) + { + bleedCol = barTextureData[((i % 12)+(i/width)*12)]; + } + textureData[i] = bleedCol; + + } + + barOverlay.SetData(textureData); + Main.spriteBatch.Draw(barOverlay, position, null, Color.White, 0, new Vector2(width, 0), 1, SpriteEffects.None, 1); + } + else if (drawType == 1) //default heart + { + Texture2D heartTexture = ModContent.Request(ManaTexturePath() + "Star").Value; + for (int i = 0; i < stars; i++) + { + Vector2 PosOffset = new Vector2(0, 28*i); + var opacity = Math.Clamp(-(i * snapshot.ManaPerSegment - snapshot.Mana) / snapshot.ManaPerSegment, -100, 100); + if ((i) * snapshot.ManaPerSegment > -snapshot.Mana) opacity = 0f; + opacity = Math.Clamp(-((i * snapshot.ManaPerSegment - (float)mana) / snapshot.ManaPerSegment), 0, 1); + Main.spriteBatch.Draw(heartTexture, position + PosOffset, null, Color.White, 0, heartTexture.Size() / 2, 1 * opacity, SpriteEffects.None, 1); + } + } + else if (drawType == 2) //fancy heart. this is the same as default but with different distances between hearts + { + Texture2D heartTexture = ModContent.Request(ManaTexturePath() + "Star").Value; + for (int i = 0; i < stars; i++) + { + Vector2 PosOffset = new Vector2(0, 22*i); + var opacity = Math.Clamp(-(i * snapshot.ManaPerSegment - snapshot.Mana) / snapshot.ManaPerSegment, -100, 100); + if ((i) * snapshot.ManaPerSegment > -snapshot.Mana) opacity = 0f; + opacity = Math.Clamp(-((i * snapshot.ManaPerSegment - (float)mana) / snapshot.ManaPerSegment), 0, 1); + Main.spriteBatch.Draw(heartTexture, position + PosOffset, null, Color.White, 0, heartTexture.Size() / 2, 1 * opacity, SpriteEffects.None, 1); + } + } + } } diff --git a/UI/ResourceSets/MPManaBurnBar.png b/UI/ResourceSets/MPManaBurnBar.png new file mode 100644 index 0000000000..ceb93f277d Binary files /dev/null and b/UI/ResourceSets/MPManaBurnBar.png differ diff --git a/UI/ResourceSets/MPManaBurnStar.png b/UI/ResourceSets/MPManaBurnStar.png new file mode 100644 index 0000000000..d5cf117948 Binary files /dev/null and b/UI/ResourceSets/MPManaBurnStar.png differ diff --git a/UI/Rippers/RipperUI.cs b/UI/Rippers/RipperUI.cs index 424310e6ec..f36c398ae7 100644 --- a/UI/Rippers/RipperUI.cs +++ b/UI/Rippers/RipperUI.cs @@ -146,7 +146,7 @@ namespace CalamityMod.UI.Rippers changed = true; } if (changed) - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); } if (modPlayer.AdrenalineEnabled) @@ -165,7 +165,7 @@ namespace CalamityMod.UI.Rippers changed = true; } if (changed) - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); } #region Mouse Interaction @@ -225,7 +225,7 @@ namespace CalamityMod.UI.Rippers if (ms.LeftButton == ButtonState.Released) { rageDragOffset = null; - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); } } else if (adrenHover) @@ -267,7 +267,7 @@ namespace CalamityMod.UI.Rippers if (ms.LeftButton == ButtonState.Released) { adrenDragOffset = null; - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); } } #endregion diff --git a/UI/StealthUI.cs b/UI/StealthUI.cs index 133c0eef49..c369445106 100644 --- a/UI/StealthUI.cs +++ b/UI/StealthUI.cs @@ -76,7 +76,7 @@ namespace CalamityMod.UI } if (changed) - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); } Rectangle mouseHitbox = new Rectangle((int)Main.MouseScreen.X, (int)Main.MouseScreen.Y, 8, 8); @@ -139,7 +139,7 @@ namespace CalamityMod.UI if (ms.LeftButton == ButtonState.Released) { dragOffset = null; - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); } } } diff --git a/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs b/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs index 04b5b562da..f6b1e35b38 100644 --- a/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs +++ b/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs @@ -70,7 +70,7 @@ namespace CalamityMod.UI.SulphurousWaterMeter } if (changed) - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); } Rectangle mouseHitbox = new Rectangle((int)Main.MouseScreen.X, (int)Main.MouseScreen.Y, 8, 8); @@ -123,7 +123,7 @@ namespace CalamityMod.UI.SulphurousWaterMeter if (ms.LeftButton == ButtonState.Released) { dragOffset = null; - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); } } else diff --git a/UI/VanillaBossBars/CeaselessVoidBossBar.cs b/UI/VanillaBossBars/CeaselessVoidBossBar.cs index 55c3541beb..29fb7c446c 100644 --- a/UI/VanillaBossBars/CeaselessVoidBossBar.cs +++ b/UI/VanillaBossBars/CeaselessVoidBossBar.cs @@ -40,7 +40,7 @@ namespace CalamityMod.UI.VanillaBossBars // Determine the shield health // Amount of Dark Energies expected from each phase/difficulty - int ExpectedBallsCounter = ((lifePercent <= 0.1f ? 3 : lifePercent <= 0.4f ? 2 : lifePercent <= 0.7f ? 1 : 0) + (CalamityWorld.death ? 6 : CalamityWorld.revenge ? 5 : Main.expertMode ? 4 : 3)) * (CalamityWorld.LegendaryMode ? 6 : 3) + 2; + int ExpectedBallsCounter = ((lifePercent <= 0.1f ? 3 : lifePercent <= 0.4f ? 2 : lifePercent <= 0.7f ? 1 : 0) + (CalamityWorld.death ? 6 : CalamityWorld.revenge ? 5 : Main.expertMode ? 4 : 3)) * (Main.getGoodWorld ? 6 : 3) + 2; // The Dark Energies will instantly all die at a certain point of their total max health float RatioToCombust = 0.2f; if (NPC.AnyNPCs(NPCType())) diff --git a/Utilities/FasterParallel.cs b/Utilities/FasterParallel.cs new file mode 100644 index 0000000000..fc33ffdb23 --- /dev/null +++ b/Utilities/FasterParallel.cs @@ -0,0 +1,102 @@ +#nullable enable + +using System; +using System.Threading; + +using ReLogic.Threading; + +namespace CalamityMod.Utilities +{ + // Tomat: I have recycled this from my initial implementation I've given to + // Nitrate. + /// + /// A faster implementation of without a timeout. + /// + public static class FasterParallel + { + /// + /// A faster reimplementation of . + /// + public static void For(int fromInclusive, int toExclusive, ParallelForAction callback, object? context = null) + { + var rangeLength = toExclusive - fromInclusive; + + if (rangeLength == 0) + { + return; + } + + var initialCount = Math.Min(Math.Max(1, Environment.ProcessorCount - 1), rangeLength); + var rangeLengthPerTask = rangeLength / initialCount; + var remainder = rangeLength % initialCount; + CountdownEvent countdownEvent = new(initialCount); + var currentRangeStart = toExclusive; + + for (var i = initialCount - 1; i >= 0; --i) + { + var rangeLengthForTask = rangeLengthPerTask; + + if (i < remainder) + { + rangeLengthForTask++; + } + + currentRangeStart -= rangeLengthForTask; + var rangeStart = currentRangeStart; + var rangeEnd = rangeStart + rangeLengthForTask; + RangeTask rangeTask = new(callback, rangeStart, rangeEnd, context, countdownEvent); + + if (i < 1) + { + InvokeTask(rangeTask); + } + else + { + ThreadPool.QueueUserWorkItem(InvokeTask, rangeTask); + } + } + + countdownEvent.Wait(); + } + + private static void InvokeTask(object? context) + { + (context as RangeTask)?.Invoke(); + } + + private class RangeTask + { + private readonly ParallelForAction action; + private readonly int fromInclusive; + private readonly int toExclusive; + private readonly object? context; + private readonly CountdownEvent countdownEvent; + + public RangeTask(ParallelForAction action, int fromInclusive, int toExclusive, object? context, CountdownEvent countdownEvent) + { + this.action = action; + this.fromInclusive = fromInclusive; + this.toExclusive = toExclusive; + this.context = context; + this.countdownEvent = countdownEvent; + } + + public void Invoke() + { + try + { + if (fromInclusive == toExclusive) + { + return; + } + + action(fromInclusive, toExclusive, context); + } + finally + { + countdownEvent.Signal(); + } + } + } + } +} diff --git a/Utilities/ItemUtils.cs b/Utilities/ItemUtils.cs index 0f4c8d0cc7..cd56f436e1 100644 --- a/Utilities/ItemUtils.cs +++ b/Utilities/ItemUtils.cs @@ -61,9 +61,9 @@ namespace CalamityMod int accRerolls = 0; int[][] accessoryReforgeTiers = new int[][] { - /* 0 */ new int[] { PrefixID.Hard, PrefixID.Jagged, PrefixID.Brisk, PrefixID.Wild, GetCalPrefix("Quiet") }, + /* 0 */ new int[] { PrefixID.Hard, PrefixID.Jagged, PrefixID.Brisk, PrefixID.Wild }, /* 1 */ new int[] { PrefixID.Guarding, PrefixID.Spiked, PrefixID.Precise, PrefixID.Fleeting, PrefixID.Rash, GetCalPrefix("Cloaked") }, - /* 2 */ new int[] { PrefixID.Armored, PrefixID.Angry, PrefixID.Hasty2, PrefixID.Intrepid, PrefixID.Arcane, GetCalPrefix("Camouflaged") }, + /* 2 */ new int[] { PrefixID.Armored, PrefixID.Angry, PrefixID.Hasty2, PrefixID.Intrepid, PrefixID.Arcane }, /* 3 */ new int[] { PrefixID.Warding, PrefixID.Menacing, PrefixID.Lucky, PrefixID.Quick2, PrefixID.Violent, GetCalPrefix("Silent") }, }; diff --git a/Utilities/LocalizationUtils.cs b/Utilities/LocalizationUtils.cs index 3c579363a5..c4afd06b22 100644 --- a/Utilities/LocalizationUtils.cs +++ b/Utilities/LocalizationUtils.cs @@ -1,4 +1,6 @@ -using Terraria.ID; +using CalamityMod.Enums; +using Terraria; +using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -81,6 +83,8 @@ namespace CalamityMod public static string GetTextValueFromModItem(string suffix) where T : ModItem => GetTextFromModItem(ModContent.ItemType(), suffix).ToString(); #region Tooltip Format Helper + public static string EmbedItemIcon(this int itemID) => $"[i:{itemID}] " + GetItemName(itemID); + public static string FramesToSeconds(this int frame) => Round(frame / 60f, "N2"); public static string ToMph(this float velocity) => Round(velocity * 216000f / 42240f, "N0"); @@ -91,11 +95,33 @@ namespace CalamityMod public static string ToJumpSpeedPercent(this float boost) => Round(boost * 20f, "N2"); public static string ToStealth(this float stealth) => Round(stealth * 100f, "N0"); + public static string GetChanceFromDenominator(this int denominator) => ToPercent(1 / (float)denominator); + public static string ToPercent(this float percent, string precision = "N1") => Round(percent * 100f, precision); public static string ToPercent(this double percent, string precision = "N1") => Round(percent * 100D, precision); // Double-rounded for proper digit cutoffs public static string Round(this float number, string precision = "N4") => float.Parse((number).ToString(precision)).ToString(); public static string Round(this double number, string precision = "N4") => float.Parse((number).ToString(precision)).ToString(); #endregion + + public static string GetArmorSetBonusKey() + { + ModKeybind setBonusKey = CalamityKeybinds.ArmorSetBonusHotKey; + bool hasHotkey = setBonusKey.GetAssignedKeys().Count != 0; + string directionKey = (Main.ReversedUpDownArmorSetBonuses ? Language.GetTextValue("Key.UP") : Language.GetTextValue("Key.DOWN")); + + // Allow both + if (hasHotkey && CalamityClientConfig.Instance.SetBonusDoubleTap == SetBonusDoubleTapOptions.On) + return GetText("Common.BothArmorSetBonusKeys").Format(setBonusKey.TooltipHotkeyString(), directionKey); + // Literally bind nothing (mentions the key name to you) + else if (!hasHotkey && CalamityClientConfig.Instance.SetBonusDoubleTap == SetBonusDoubleTapOptions.Off) + return GetTextValue("Common.NoArmorSetBonusKey"); + // Hotkey only + else if (hasHotkey) + return GetText("Common.ArmorSetBonusKey").Format(setBonusKey.TooltipHotkeyString()); + // Double tap only + else + return GetText("Common.DoubleTapDown").Format(directionKey); + } } } diff --git a/Utilities/MiscUtils.cs b/Utilities/MiscUtils.cs index fb0b74fabd..2c059e617d 100644 --- a/Utilities/MiscUtils.cs +++ b/Utilities/MiscUtils.cs @@ -212,7 +212,7 @@ namespace CalamityMod } public static int SecondsToFrames(int seconds) => seconds * 60; - public static int SecondsToFrames(float seconds) => (int)(seconds * 60); + public static int SecondsToFrames(float seconds) => (int)MathF.Round(seconds * 60); public static int MinutesToFrames(int minutes) => minutes * 3600; public static bool WithinBounds(this int index, int cap) => index >= 0 && index < cap; diff --git a/Utilities/NPCDebuffs.cs b/Utilities/NPCDebuffs.cs index 9f0f06c931..ec5d8be588 100644 --- a/Utilities/NPCDebuffs.cs +++ b/Utilities/NPCDebuffs.cs @@ -102,7 +102,7 @@ namespace CalamityMod // 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 (!ConfusionDebuffImmunitiesList.Includes(npc.type) && cal) + if (!CalamityNPCSets.CalamityNPCNotImmuneToConfused[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 d65a255a8d..19b85c5d58 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -1026,10 +1026,10 @@ namespace CalamityMod item.CountsAsClass() ); - bool heldItemIsTool = (item.pick > 0 || item.axe > 0 || item.hammer > 0) && !BlacklistedWeaponsWithToolPowerList.Includes(item.type); + bool heldItemIsTool = (item.pick > 0 || item.axe > 0 || item.hammer > 0) && !CalamityItemSets.WeaponWithToolPowerAffectedBySummonPenalty[item.type]; bool heldItemCanBeUsed = item.useStyle != ItemUseStyleID.None; bool heldItemIsAccessoryOrAmmo = item.accessory || item.ammo != AmmoID.None; - bool heldItemIsExcludedByModCall = DisabledSummonerNerfItemList.Includes(item.type); + bool heldItemIsExcludedByModCall = CalamityItemSets.ItemWhichDisablesSummonerNerf[item.type]; if (heldItemIsClassedWeapon && heldItemCanBeUsed && !heldItemIsTool && !heldItemIsAccessoryOrAmmo && !heldItemIsExcludedByModCall) return true; diff --git a/Utilities/ProjectileUtils.cs b/Utilities/ProjectileUtils.cs index bf30417251..132ca8c0e9 100644 --- a/Utilities/ProjectileUtils.cs +++ b/Utilities/ProjectileUtils.cs @@ -165,7 +165,7 @@ namespace CalamityMod } } - public static void HomeInOnNPC(Projectile projectile, bool ignoreTiles, float distanceRequired, float homingVelocity, float inertia) + public static void HomeInOnNPC(Projectile projectile, bool ignoreTiles, float distanceRequired, float homingVelocity, float inertia, bool respectIFrames = false) { if (!projectile.friendly) return; @@ -184,7 +184,7 @@ namespace CalamityMod foreach (NPC n in Main.ActiveNPCs) { float extraDistance = (n.width / 2) + (n.height / 2); - if (!n.CanBeChasedBy(projectile, false) || !projectile.WithinRange(n.Center, maxDistance + extraDistance)) + if (!n.CanBeChasedBy(projectile, false) || !projectile.WithinRange(n.Center, maxDistance + extraDistance) || (respectIFrames && (projectile.localNPCImmunity[n.whoAmI] > 0 || n.immune[projectile.owner] > 0 || Projectile.perIDStaticNPCImmunity[projectile.type][n.whoAmI] > 0))) continue; float currentNPCDist = Vector2.Distance(n.Center, projectile.Center); @@ -340,9 +340,8 @@ namespace CalamityMod Vector2 spawnPosition = new Vector2(x, y); Vector2 velocity = targetPos - spawnPosition; velocity.X += Main.rand.NextFloat(-xVariance, xVariance); - float speed = projSpeed; float targetDist = velocity.Length(); - targetDist = speed / targetDist; + targetDist = projSpeed / targetDist; velocity.X *= targetDist; velocity.Y *= targetDist; return Projectile.NewProjectileDirect(source, spawnPosition, velocity, projType, damage, knockback, owner); diff --git a/Utilities/TileUtils.cs b/Utilities/TileUtils.cs index 86e9ccad9a..f0ea7eb99e 100644 --- a/Utilities/TileUtils.cs +++ b/Utilities/TileUtils.cs @@ -6,6 +6,8 @@ using CalamityMod.Systems; using CalamityMod.Tiles; using CalamityMod.Tiles.Abyss; using CalamityMod.Tiles.Astral; +using CalamityMod.Tiles.FurnitureDriftwood; +using CalamityMod.Tiles.FurnitureMonolith; using CalamityMod.Tiles.AstralDesert; using CalamityMod.Tiles.AstralSnow; using CalamityMod.Tiles.Crags; @@ -448,6 +450,8 @@ namespace CalamityMod TileType(), TileType(), TileType(), + TileType(), + TileType(), TileType(), TileType(), TileType(), @@ -518,6 +522,7 @@ namespace CalamityMod TileType(), // Sunken Sea TileType(), + TileType(), TileType(), TileType(), TileType(), diff --git a/Walls/NavystoneWall.cs b/Walls/NavystoneWall.cs index 500df762c1..51f5124c88 100644 --- a/Walls/NavystoneWall.cs +++ b/Walls/NavystoneWall.cs @@ -1,16 +1,81 @@ -using Microsoft.Xna.Framework; +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria.GameContent; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Walls { public class NavystoneWall : ModWall, IVisibleThroughWater { + internal static FramedMaskTexture GlowMask; int IVisibleThroughWater.WaterMapEntry { get; set; } public override void SetStaticDefaults() { + GlowMask = new("CalamityMod/Walls/NavystoneWall_Glow", 36, 36); DustType = 96; this.AddMapEntryWithWaterVisibility(new Color(16, 45, 48)); } + public override void Unload() + { + GlowMask?.Unload(); + GlowMask = null; + } + public static void DrawWallGlow(int wallType, int i, int j, SpriteBatch spriteBatch) + { + if (GlowMask.Texture is null) + return; + + Tile tile = Main.tile[i, j]; + int xLength = 32; + int xOff = 0; + + int xPos = tile.WallFrameX + xOff; + int yPos = tile.WallFrameY; + + Rectangle frame = new Rectangle(xPos, yPos, xLength, 32); + Color drawcolor; + drawcolor = WorldGen.paintColor(tile.WallColor); + drawcolor.A = 255; + Vector2 zero = new Vector2(Main.offScreenRange, Main.offScreenRange); + + if (Main.drawToScreen) + zero = Vector2.Zero; + + Vector2 pos = new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero; + Color lightColor = Lighting.GetColor(i, j, Color.White); + + spriteBatch.Draw(TextureAssets.Wall[wallType].Value, pos + new Vector2(-8 + xOff, -8), frame, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + + if (GlowMask.HasContentInFramePos(xPos, yPos)) + { + float brightness = MathHelper.Clamp(0.2f - (j / 680), 0f, 0.2f); + + float time = Main.GameUpdateCount; + float waveScale1 = time * 0.094f; + int scalar = i - (j / 2); + float wave1 = waveScale1 * -50 + scalar * 12; + float wave1angle = 0.30f + 0.25f * MathF.Sin(MathHelper.ToRadians(wave1)); + + drawcolor *= brightness; + + float transparency = 0.02f + (wave1angle / 4); + Color glowColor = Color.White * transparency; + + for (int k = 0; k < 3; k++) + { + //Vector2 offset = new Vector2(Main.rand.NextFloat(-1, 1f), Main.rand.NextFloat(-1, 1f)) * 0.2f * k; + spriteBatch.Draw(GlowMask.Texture, pos + new Vector2(-8 + xOff, -8), frame, glowColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + } + } + + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) + { + DrawWallGlow(Type, i, j, spriteBatch); + return false; + } public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; } diff --git a/Walls/NavystoneWall.png b/Walls/NavystoneWall.png index 3c3de52f96..1f7e78021e 100644 Binary files a/Walls/NavystoneWall.png and b/Walls/NavystoneWall.png differ diff --git a/Walls/NavystoneWall_Glow.png b/Walls/NavystoneWall_Glow.png new file mode 100644 index 0000000000..680f0c9855 Binary files /dev/null and b/Walls/NavystoneWall_Glow.png differ diff --git a/Walls/ShellTrimBrickWall.cs b/Walls/ShellTrimBrickWall.cs new file mode 100644 index 0000000000..ed32eacef6 --- /dev/null +++ b/Walls/ShellTrimBrickWall.cs @@ -0,0 +1,21 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Walls +{ + public class ShellTrimBrickWall : ModWall, IVisibleThroughWater + { + int IVisibleThroughWater.WaterMapEntry { get; set; } + + public override void SetStaticDefaults() + { + Main.wallHouse[Type] = false; + DustType = 24; + + this.AddMapEntryWithWaterVisibility(new Color(75, 71, 85)); + } + + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + } +} diff --git a/Walls/ShellTrimBrickWall.png b/Walls/ShellTrimBrickWall.png new file mode 100644 index 0000000000..9c121bd0d5 Binary files /dev/null and b/Walls/ShellTrimBrickWall.png differ diff --git a/Walls/ShellstoneSlabWall.png b/Walls/ShellstoneSlabWall.png index 3d6e1f138f..2b2171a158 100644 Binary files a/Walls/ShellstoneSlabWall.png and b/Walls/ShellstoneSlabWall.png differ diff --git a/Waters/SunkenSeaBurrowsWater.png b/Waters/SunkenSeaBurrowsWater.png index 1dd5bd9f12..b5445b95b0 100644 Binary files a/Waters/SunkenSeaBurrowsWater.png and b/Waters/SunkenSeaBurrowsWater.png differ diff --git a/Waters/SunkenSeaBurrowsWater_Block.png b/Waters/SunkenSeaBurrowsWater_Block.png index bbf43cea00..55f4835baf 100644 Binary files a/Waters/SunkenSeaBurrowsWater_Block.png and b/Waters/SunkenSeaBurrowsWater_Block.png differ diff --git a/Waters/SunkenSeaBurrowsWater_Slope.png b/Waters/SunkenSeaBurrowsWater_Slope.png index fcd463d89f..c8c200a00e 100644 Binary files a/Waters/SunkenSeaBurrowsWater_Slope.png and b/Waters/SunkenSeaBurrowsWater_Slope.png differ diff --git a/Waters/SunkenSeaBurrowsWaterflow.png b/Waters/SunkenSeaBurrowsWaterflow.png index f2ea06818a..7dfa31563c 100644 Binary files a/Waters/SunkenSeaBurrowsWaterflow.png and b/Waters/SunkenSeaBurrowsWaterflow.png differ diff --git a/Waters/SunkenSeaPolypWater.png b/Waters/SunkenSeaPolypWater.png index 682fb25774..d49ec9cb77 100644 Binary files a/Waters/SunkenSeaPolypWater.png and b/Waters/SunkenSeaPolypWater.png differ diff --git a/Waters/SunkenSeaPolypWater_Block.png b/Waters/SunkenSeaPolypWater_Block.png index 1f823d0ea9..7cb531a45a 100644 Binary files a/Waters/SunkenSeaPolypWater_Block.png and b/Waters/SunkenSeaPolypWater_Block.png differ diff --git a/Waters/SunkenSeaPolypWater_Slope.png b/Waters/SunkenSeaPolypWater_Slope.png index ddf2446ee4..7786b18561 100644 Binary files a/Waters/SunkenSeaPolypWater_Slope.png and b/Waters/SunkenSeaPolypWater_Slope.png differ diff --git a/Waters/SunkenSeaPolypWaterflow.png b/Waters/SunkenSeaPolypWaterflow.png index ee3de90b50..d1fca985c2 100644 Binary files a/Waters/SunkenSeaPolypWaterflow.png and b/Waters/SunkenSeaPolypWaterflow.png differ diff --git a/Waters/SunkenSeaReefsWater.png b/Waters/SunkenSeaReefsWater.png index f29cd37d8b..62239832c4 100644 Binary files a/Waters/SunkenSeaReefsWater.png and b/Waters/SunkenSeaReefsWater.png differ diff --git a/Waters/SunkenSeaReefsWater_Block.png b/Waters/SunkenSeaReefsWater_Block.png index 025f317ee5..f93b5fb6c1 100644 Binary files a/Waters/SunkenSeaReefsWater_Block.png and b/Waters/SunkenSeaReefsWater_Block.png differ diff --git a/Waters/SunkenSeaReefsWater_Slope.png b/Waters/SunkenSeaReefsWater_Slope.png index 5a485e545f..b9fd91405c 100644 Binary files a/Waters/SunkenSeaReefsWater_Slope.png and b/Waters/SunkenSeaReefsWater_Slope.png differ diff --git a/Waters/SunkenSeaReefsWaterflow.png b/Waters/SunkenSeaReefsWaterflow.png index 33755735bd..18a47b1801 100644 Binary files a/Waters/SunkenSeaReefsWaterflow.png and b/Waters/SunkenSeaReefsWaterflow.png differ diff --git a/World/Abyss.cs b/World/Abyss.cs index 6c51e76870..9a563fdc90 100644 --- a/World/Abyss.cs +++ b/World/Abyss.cs @@ -73,7 +73,7 @@ namespace CalamityMod.World if (tile.HasTile) { bool vanillaTile = tile.TileType < TileID.Count; - bool validModdedTile = tile.TileType != ModContent.TileType() && AbyssValidTileReplacementList.Includes(tile.TileType); + bool validModdedTile = tile.TileType != ModContent.TileType() && CalamityTileSets.CanBeReplacedByAbyssGeneration[tile.TileType]; canConvert = vanillaTile || validModdedTile; } diff --git a/World/AstralBiome.cs b/World/AstralBiome.cs index 6fcb107f3b..40f0d73511 100644 --- a/World/AstralBiome.cs +++ b/World/AstralBiome.cs @@ -4,6 +4,8 @@ using System.Linq; using CalamityMod.Schematics; using CalamityMod.Tiles.Abyss; using CalamityMod.Tiles.Astral; +using CalamityMod.Tiles.FurnitureAcidwood; +using CalamityMod.Tiles.FurnitureMonolith; using CalamityMod.Tiles.AstralDesert; using CalamityMod.Tiles.AstralSnow; using CalamityMod.Tiles.Ores; diff --git a/World/DraedonStructures.cs b/World/DraedonStructures.cs index 411b8181db..9b34b7222f 100644 --- a/World/DraedonStructures.cs +++ b/World/DraedonStructures.cs @@ -48,7 +48,7 @@ namespace CalamityMod.World if (tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || - tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || + tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || tile.WallType == ModContent.WallType() || // hardened eutrophic sand doesnt have a wall lol tile.WallType == ModContent.WallType() || tile.WallType == ModContent.WallType() || diff --git a/World/SunkenSea.cs b/World/SunkenSea.cs index bfd794e460..30a5dffd7a 100644 --- a/World/SunkenSea.cs +++ b/World/SunkenSea.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using CalamityMod.Tiles.SunkenSea; using CalamityMod.Tiles.SunkenSea.Ambient; +using CalamityMod.Utilities; using CalamityMod.Walls; using Microsoft.Xna.Framework; using ReLogic.Threading; @@ -19,30 +20,20 @@ namespace CalamityMod.World public class SunkenSea { /* - Dylandoe checklist: - - -Make ambient tiles naturally grow on sunken sea tiles/sands (only eutrophic sand is done) - -Add basalt slab block - -Add navystone brick wall + checklist: + -Add the wall corals properly -Make sunken sea walls produce water - */ - - /* - ena todo - - fix the fucking forest being shaved (done - HPU) cut a half oval out of the top of forest in anticipation of structure placement - change the type of noise both reefs and forest use (reefs more jagged, forest more flat) (done - HPU) - cut a curve out of the top of shores (the desert part) (done - HPU) - extend basalt to hell - DONE - convert normal terrain blocks below basalt into basalt (maybe??? - HPU) - BLOTCHES EVERYWHERE */ - public static void NormalForLoop(int fromInclusive, int toExclusive, int step, Action action) + + public static void ParallelFor(int fromInclusive, int toExclusive, int step, Action action) { - for (int i = fromInclusive; i < toExclusive; i += step) - action.Invoke(i); + FasterParallel.For(fromInclusive, toExclusive, (start, end, _) => + { + for (int i = start; i < end; i += step) + action.Invoke(i); + }); } public static void PlaceTimelessShores(int startPosX, int startPosY) @@ -62,7 +53,7 @@ namespace CalamityMod.World else return -steepness * x + steepness; } - for (int X = startPosX - biomeSize - 5; X < startPosX + biomeSize + 20; X += 15) + ParallelFor(startPosX - biomeSize - 5, startPosX + biomeSize + 20, 15, (X) => { float height = MathHelper.Lerp(startPosY + 35, startPosY - 15, trapezoidLateralSteep(Utils.GetLerpValue(startPosX - biomeSize - 20, startPosX + biomeSize + 20, X))); for (int Y = startPosY + 25; Y >= height; Y -= 10) @@ -75,13 +66,13 @@ namespace CalamityMod.World })); WorldUtils.Gen(new Point(X, Y), new ModShapes.All(circle), new Actions.SetTile((ushort)ModContent.TileType())); } - } + }); // // Makes the bottom borders of the Timeless Shores curved downwards. // const int totalCuveDepth = 90; - for (int x = startPosX - biomeSize - 10; x < startPosX - biomeSize + 200; x += 10) + ParallelFor(startPosX - biomeSize - 10, startPosX - biomeSize + 200, 10, (x) => { int curveDepth = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize - 17, startPosX - biomeSize + 200, x, true))); for (int y = startPosY + 50; y <= startPosY + 70 + curveDepth; y += 5) @@ -94,9 +85,8 @@ namespace CalamityMod.World })); WorldUtils.Gen(new Point(x, y), new ModShapes.All(circle), new Actions.SetTile((ushort)ModContent.TileType())); } - } - - for (int x = startPosX + biomeSize - 200; x < startPosX + biomeSize + 10; x += 5) + }); + ParallelFor(startPosX + biomeSize - 200, startPosX + biomeSize + 10, 5, (x) => { int curveDepth = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize + 20, startPosX + biomeSize - 200, x, true))); for (int y = startPosY + 50; y <= startPosY + 70 + curveDepth; y += 5) @@ -109,11 +99,11 @@ namespace CalamityMod.World })); WorldUtils.Gen(new Point(x, y), new ModShapes.All(circle), new Actions.SetTile((ushort)ModContent.TileType())); } - } + }); // Clear a smaller square out of the center where the biomes stuff will be // Added curves to the top of the biome via curve depth -hpu 02/19/25 - for (int X = startPosX - biomeSize + 10; X < startPosX + biomeSize - 10; X += 1) + ParallelFor(startPosX - biomeSize + 10, startPosX + biomeSize - 10, 1, (X) => { int curveDepth = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize + 20, startPosX + biomeSize - 200, X, true))); int curveDepth2 = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize - 17, startPosX - biomeSize + 200, X, true))); @@ -133,12 +123,12 @@ namespace CalamityMod.World new Actions.Clear() })); } - } + }); // // Places slopes at the sides of the shores to actually make shores. // - for (int moundX = startPosX - biomeSize - 15; moundX < startPosX - biomeSize + 200; moundX += 20) + ParallelFor(startPosX - biomeSize - 15, startPosX - biomeSize + 200, 20, (moundX) => { int RandomX = Main.rand.Next(15, 20); ShapeData mound = new(); @@ -149,9 +139,8 @@ namespace CalamityMod.World WorldUtils.Gen(new Point(moundX, moundY), new Shapes.Mound(30, moundHeight), blotchMod); WorldUtils.Gen(new Point(moundX, moundY), new ModShapes.All(mound), new Actions.SetTile((ushort)ModContent.TileType())); WorldUtils.Gen(new Point(moundX, moundY), new ModShapes.All(mound), new Actions.PlaceWall((ushort)ModContent.WallType())); - } - - for (int moundX = startPosX + biomeSize - 200; moundX < startPosX + biomeSize - 15; moundX += 20) + }); + ParallelFor(startPosX + biomeSize - 200, startPosX + biomeSize - 15, 20, (moundX) => { ShapeData mound = new(); GenAction blotchMod = new Modifiers.Blotches().Output(mound); @@ -160,7 +149,8 @@ namespace CalamityMod.World WorldUtils.Gen(new Point(moundX, moundY), new Shapes.Mound(30, moundHeight), blotchMod); WorldUtils.Gen(new Point(moundX, moundY), new ModShapes.All(mound), new Actions.SetTile((ushort)ModContent.TileType())); - } + }); + // // Makes a large platform in the middle of the Timeless Shores. @@ -168,7 +158,7 @@ namespace CalamityMod.World const int platformSize = 130; const int platformHeight = 35; // Remember that because of Terraria's coordinate system, making it lower actually makes it higher. const int platformDepth = 35; // How deep it goes. Like above, the higher it is, the lower it goes. - for (int platformX = startPosX - platformSize / 2; platformX < startPosX + platformSize / 2; platformX += 5) + ParallelFor(startPosX - platformSize / 2, startPosX + platformSize / 2, 5, (platformX) => { // This makes the "stem" of the platform be thinner towards the base and then expand on the top. int thickness = (int)(MathF.Pow(CalamityUtils.Convert01To010(Utils.GetLerpValue(startPosX - platformSize / 2, startPosX + platformSize / 2, platformX)), 3f) * platformDepth) + platformHeight; @@ -181,16 +171,16 @@ namespace CalamityMod.World new Actions.PlaceTile((ushort)ModContent.TileType()) })); } - } - for (int x = startPosX - platformSize / 2; x < startPosX + platformSize / 2; x += 1) + }); + ParallelFor(startPosX - platformSize / 2, startPosX + platformSize / 2, 1, (x) => { float interpolator = CalamityUtils.Convert01To010(Utils.GetLerpValue(startPosX - platformSize / 2, startPosX + platformSize / 2, x, true)); int elevation = (int)MathHelper.Lerp(4f, 1f, interpolator); WorldUtils.Gen(new Point(x, startPosY + platformHeight - 7), new Shapes.Circle(elevation), Actions.Chain(new GenAction[] { new Actions.Clear(), })); - } + }); // Plateau - for (int wallPillarX = startPosX - biomeSize; wallPillarX < startPosX + biomeSize; wallPillarX += 100) + ParallelFor(startPosX - biomeSize, startPosX + biomeSize, 100, (wallPillarX) => { int randomDisplacement = WorldGen.genRand.Next(-27, 46); int RandomX = Main.rand.Next(15, 20); @@ -218,23 +208,23 @@ namespace CalamityMod.World ; } - } + }); //place water below the clear barrier for the islands so that theres water inbetween them - for (int WaterX = startPosX - biomeSize + 35; WaterX < startPosX + biomeSize - 35; WaterX += 1) + ParallelFor(startPosX - biomeSize + 35, startPosX + biomeSize - 35, 1, (WaterX) => { for (int WaterY = startPosY + 37; WaterY <= startPosY + 60; WaterY++) { Main.tile[WaterX, WaterY].Get().LiquidType = LiquidID.Water; Main.tile[WaterX, WaterY].LiquidAmount = byte.MaxValue; } - } + }); // // Generates pillars made out of walls at random points in the Timeless Shores. // const int furthestDistanceFromCenter = 100; - for (int wallPillarX = startPosX - (biomeSize / 2) - furthestDistanceFromCenter; wallPillarX < startPosX + (biomeSize / 2) + furthestDistanceFromCenter; wallPillarX += 100) + ParallelFor(startPosX - (biomeSize / 2) - furthestDistanceFromCenter, startPosX + (biomeSize / 2) + furthestDistanceFromCenter, 100, (wallPillarX) => { int randomDisplacementX = WorldGen.genRand.Next(-10, 10); int RandomX = Main.rand.Next(3, 6); @@ -260,13 +250,13 @@ namespace CalamityMod.World })) ; } - } + }); // // Makes the transition area to the Timeless Shores. // Replaces tiles, walls, and places some water spots. // - for (int x = startPosX - biomeSize - 30; x < startPosX + biomeSize + 30; x += 20) + ParallelFor(startPosX - biomeSize - 30, startPosX + biomeSize + 30, 20, (x) => { int curveDepth = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize + 30, startPosX + biomeSize - 200, x, true))); int curveDepth2 = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize - 30, startPosX - biomeSize + 200, x, true))); @@ -341,7 +331,7 @@ namespace CalamityMod.World !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y - 2].HasTile && !Main.tile[X, Y - 3].HasTile && !Main.tile[X, Y - 4].HasTile && !Main.tile[X, Y - 5].HasTile; - + if (canPlaceSand) PlaceSand(X, Y, 5, ModContent.TileType()); @@ -358,39 +348,40 @@ namespace CalamityMod.World if (!Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile) WorldGen.KillTile(X, Y); - // Timeless Shores ambiant tiles - //if (Main.tile[X, Y].TileType == ModContent.TileType()) - //{ - // //Driftwood Ambiance - // if (WorldGen.genRand.NextBool(150)) - // { - // ushort[] DriftwoodPiles = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - - // WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(DriftwoodPiles)); - // } - //} - //if (Main.tile[X, Y].TileType == ModContent.TileType()) - //{ - // //Driftwood Ambiance - // if (WorldGen.genRand.NextBool(150)) - // { - // ushort[] DriftwoodPiles = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - - // WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(DriftwoodPiles)); - // } - //} } - } - - - // Slope tiles + + // Slope tiles and Soil Spawn for (int X = startPosX - biomeSize; X < startPosX + biomeSize; X += 1) { for (int Y = startPosY - 300; Y <= startPosY + 200; Y++) + { Tile.SmoothSlope(X, Y); + + if (Main.tile[X, Y].TileType == ModContent.TileType()) + { + if (WorldGen.genRand.NextBool(25) && !Main.tile[X - 1, Y].HasTile) + { + ushort[] Soil = new ushort[] { (ushort)ModContent.TileType() }; + + ShapeData circle = new ShapeData(); + GenAction blotchMod = new Modifiers.Blotches(2, 0.4); + WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(WorldGen.genRand.Next(3, 7)), Actions.Chain(new GenAction[] + { + blotchMod.Output(circle) + })); + + WorldUtils.Gen(new Point(X, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[] + { + new Modifiers.OnlyTiles((ushort)ModContent.TileType()), + new Actions.ClearTile(), new Actions.PlaceTile(WorldGen.genRand.Next(Soil)) + })); + + } + } + } } - } + }); } // Sides of the sunken sea (radiant reefs) @@ -712,7 +703,7 @@ namespace CalamityMod.World { bool canPlaceGrass = false; - //place sand clumps on top of exposed limestone + //place grass on top of exposed sand if (Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y - 2].HasTile && !Main.tile[X, Y - 3].HasTile && !Main.tile[X, Y - 4].HasTile && !Main.tile[X, Y - 5].HasTile) { @@ -724,6 +715,27 @@ namespace CalamityMod.World PlaceSand(X, Y, 0, ModContent.TileType()); } } + if (Main.tile[X, Y].TileType == ModContent.TileType()) + { + if (WorldGen.genRand.NextBool(25) && !Main.tile[X - 1, Y].HasTile) + { + ushort[] Soil = new ushort[] { (ushort)ModContent.TileType() }; + + ShapeData circle = new ShapeData(); + GenAction blotchMod = new Modifiers.Blotches(2, 0.4); + WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(WorldGen.genRand.Next(3, 7)), Actions.Chain(new GenAction[] + { + blotchMod.Output(circle) + })); + + WorldUtils.Gen(new Point(X, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[] + { + new Modifiers.OnlyTiles((ushort)ModContent.TileType()), + new Actions.ClearTile(), new Actions.PlaceTile(WorldGen.genRand.Next(Soil)) + })); + + } + } } } diff --git a/World/WorldEvilIsland.cs b/World/WorldEvilIsland.cs index 689cb7af47..8adc8d8472 100644 --- a/World/WorldEvilIsland.cs +++ b/World/WorldEvilIsland.cs @@ -18,7 +18,7 @@ namespace CalamityMod.World int yIslandGen; Rectangle potentialArea; - if (WorldGen.getGoodWorldGen) + if (WorldGen.drunkWorldGen) { do {